We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I ended up re-adding nodes to the queue with their new priority rather than decreasing the key of nodes already present. This Stack Overflow post discusses some of the benefits of doing it the other way, but with java fast IO my solution was fast enough without it.
Dijkstra: Shortest Reach 2
You are viewing a single comment's thread. Return to all comments →
I ended up re-adding nodes to the queue with their new priority rather than decreasing the key of nodes already present. This Stack Overflow post discusses some of the benefits of doing it the other way, but with java fast IO my solution was fast enough without it.
http://stackoverflow.com/questions/9255620/why-does-dijkstras-algorithm-use-decrease-key