gboeing/osmnx-examples

Use of nx.shortest_path without weight attribute

MridulS opened this issue · 2 comments

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.

This is discussed in notebook 6 and demonstrated in its cell 13.

Thanks for the link! :)