Dijkstra's algorithm added and graph constructed