Does it make more sense to implement a shortest path algorithm as a method of the Graph class or a separate function which takes the graph as a parameter?
Motivation: