Dijkstra's algorithm: why does it work? (not how)

Posted by BeeBand on Stack Overflow See other posts from Stack Overflow or by BeeBand
Published on 2010-05-18T11:17:27Z Indexed on 2010/05/18 11:20 UTC
Read the original article Hit count: 395

Filed under:

I understand what Dijkstra's algorithm is but I don't understand why it works.

When selecting the next vertice to examine, why does Dijkstra's algorithm select the one with the smallest weight? Why not just select a vertex arbitrarily, since the algorithm visits all vertices anyway?

© Stack Overflow or respective owner

Related posts about algorithm