Similar Posts

Subscribe
Notify of
2 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
speedjajxx
1 year ago

Yeah, definitely. As soon as you get it, it’s going very fast. You only have to write a distance of infinity and the predecessor zero for each node. Then you set the distance from the start node to 0. After that, in each iteration, you will find the node with the smallest distance, see if you can reach nodes faster and if so, update their distance and predecessors. Once you’ve seen a node in an iteration as a node with a shortest distance, you don’t have to update it anymore. You do the whole thing until you see your target node as a node with a shortest distance (you say you’re expanding). After that, you go back to the destination node via the predecessor until you arrive at the start node and have the shortest path.

That’s all it is. There are some YouTube videos that visualize the whole thing well.

sarah3
1 year ago

yes should go