-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notebook on shortest path using Dijkstra's algorithm #65
base: main
Are you sure you want to change the base?
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!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some general comments.
- ZRH : `min(infinity, 5) = 5` | ||
|
||
|
||
![Figure 1&2](Graphs/figure1_2.png "Step 1 and Step 2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.