Set smallestWeight[vertex] = 0This is because step 1 is:
Initialize array with smallestWeight[u] = weights[vertex, u]Unless I misread something (or the weight from a node to itself isn't zero), I assume that step 1 subsumes step 2. Or am I missing something?
See also other errata.
No comments:
Post a Comment