Simple class design on shortest path algorithm on graph.