Graph that implements dijkstra's algorithm.