Algebra or Calculus (depending on the complexity of the graph)