Shortest path dijkstra algorithm Java code for two cities