hitchhikers-guide icon indicating copy to clipboard operation
hitchhikers-guide copied to clipboard

Network tutorial: wrong shortest path length

Open hsxavier opened this issue 5 years ago • 0 comments

The length of the shortest path between nodes 12 and 15 in the Karate network should be:

len(networkx.shortest_path(Graph_Karate, 12, 15)) - 1

because the output of shortest_path includes both the starting and ending nodes. However, the notebooks Introduction_to_Networks_Karate.ipynb and Introduction_to_Networks_clean.ipynb show, instead:

len(networkx.shortest_path(Graph_Karate, 12,15))

hsxavier avatar Jan 11 '20 17:01 hsxavier