Notebook on shortest path using Dijkstra's algorithm#65
Notebook on shortest path using Dijkstra's algorithm#65NikitaSharma1 wants to merge 9 commits intonetworkx:mainfrom
Conversation
|
Thanks @NikitaSharma1! Can you please convert the [we really need to get the contributing guide for nx-guides up and running 😅 ] |
|
@MridulS I converted it to md but I am getting |
|
@MridulS thank you so much!! |
| - ZRH : `min(infinity, 5) = 5` | ||
|
|
||
|
|
||
|  |
There was a problem hiding this comment.
How were these images generated? It's usually a good idea to keep the code handy to reproduce the figures :)
There was a problem hiding this comment.
Yes, these images should be generated directly by code in the notebook - showing how to make high-quality visualizations of graph/network data is one of the primary goals of these tutorials!
There was a problem hiding this comment.
I used diagrams.net for the graphs for 2 reasons:
- I think inserting code for graphs might break the flow of the learner as it happened to me in Dintz and I have like 6 graphs.
- If you'll look in the images, I can add edge labels, node labels and colour edges, but, I don't know how to add the distance of the nodes in the graph (like infinite initially and then keep updating).
But, yes you're right. I'll try to figure it out and create an easy and understandable graph using networkx.
|
|
||
| # printing the distance and path from the source node 'DEL' to target node 'LCY' | ||
| print(dist[target], paths[target]) | ||
| ``` |
There was a problem hiding this comment.
BTW we don't need to implement the algorithm in the same exact way as done inside NetworkX for nx-guides. The goal is to provide a pedagogical source so if possible feel free to remove bits that you think can be better compressed :)
There was a problem hiding this comment.
So, can I replace it with a basic general implementation?
| ## Reference | ||
|
|
||
| Shivani Sanan, Leena jain, Bharti Kappor (2013). (IJAIEM) "Shortest Path Algorithm" <br> | ||
| https://www.ijaiem.org/volume2issue7/IJAIEM-2013-07-23-079.pdf |
There was a problem hiding this comment.
Why is this paper cited in references? This doesn't define the Dijkstra algorithm.
It's defined in:
Dijkstra, Edsger W. "A note on two problems in connexion with graphs." Numerische mathematik 1, no. 1 (1959): 269-271.
e93d10c to
c3e7f83
Compare
I created a notebook on Dijkstra's algorithm and how it is implemented in NetworkX. I would like to know if there's any other topic I can add or explain in more detail.