-
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 minimum spanning tree using Prim's algorithm #74
base: main
Are you sure you want to change the base?
Conversation
82654ca
to
f1a9246
Compare
It was passing the checks before but now It's throwing error... idk why |
No worries, this is broken because of #76 |
@MridulS Thank you!! |
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.
Thanks for this @NikitaSharma1 , this is a very nice notebook and IMO the minimum spanning tree is an excellent application to highlight. I really like the motivating example too, i.e. optimal route planning between cities.
While reading through the example though, I did have one high-level question - for the given application, wouldn't you want to start with the complete graph with an edge between each city weighted by the linear distance between the two cities? I realize this isn't a necessary condition for finding the minimum spanning tree, but for the application of finding the optimal road layout between 5 cities, you'd definitely want to consider the possible routes between each pair of cities. Does this sound right?
@rossbar I totally agree with your point. I was thinking of making it as simple as possible with all situations covered, so, maybe that's why it slipped out of my mind. Would you suggest improvising the example and replacing the optimal route problem with a generalized example, like points A, B, C, D, and E instead of cities, or adding more edges to the example to make it a complete graph? |
The route finding problem is the “traveling salesman problem”. And it shouldn’t be a tree. It finds the best path. A tree is rarely a path. But here’s a better setting that makes sense from a spanning tree perspective. Suppose you are trying to lay out the pipes for a gas distribution system. You can connect each city to other cities, but you want to find the tree that minimizes the total pipe length. So, unlike our traveler who has to continue from wherever their last position was, the tree can be extended from any point on the already built portion of the tree. There must be other settings for the spanning trees — and I’m sure some of them do not start with a complete graph. But this gas pipeline tree setting does still have that complete graph information. I just wanted to separate the “best route” problem from the “best tree” problem. Can someone come up with a setting that doesn’t start with a complete graph? |
Wikipedia gives some examples that might help. |
Hi, I opened a issue regarding this #101 I will take into account all suggestions given here and will be constructing the notebook, thanks! |
@NikitaSharma1 are you still planning to work on this? If so, I think the place to (re)start would be by updating the motivating example per feedback from the previous review! |
No description provided.