All through the examples while calculating shortest_path it looks like the code is calculating the shortest path without taking into account the actual length. nx.shortest_path(G, origin, destination) calculates the shortest path in terms of number of jumps from one node to another node in the graph, to take into account the actual distance between them it should be nx.shortest_path(G, origin, destination, weight='length') to take into account the length of all the edges. Let me know if I am missing something.
All through the examples while calculating
shortest_path
it looks like the code is calculating the shortest path without taking into account the actual length.nx.shortest_path(G, origin, destination)
calculates the shortest path in terms of number of jumps from one node to another node in the graph, to take into account the actual distance between them it should benx.shortest_path(G, origin, destination, weight='length')
to take into account the length of all the edges. Let me know if I am missing something.