Problem:
Find the shortest paths in a undirected weighted graph with 200 nodes.
Solution:
Straightforward implementation of the Dijkstra's algorithm.
As usual, I had a bug (forget to recursively call FixDown). Brute force comparison and asserting heap invariant helped me to find and fix the bug.
Find the shortest paths in a undirected weighted graph with 200 nodes.
Solution:
Straightforward implementation of the Dijkstra's algorithm.
As usual, I had a bug (forget to recursively call FixDown). Brute force comparison and asserting heap invariant helped me to find and fix the bug.
No comments:
Post a Comment