This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Well a better approach might be implementing the algorithm as presented in the link submitted by 'Bu' (oh, and Bu - that really is a quite good reference to Dijkstra's Algorithm).
Your approach seems to be missing the weight of the vertices (or maybe i'm missing something).
As to traversing, the link also supplies the pseudocode for iterating and obtaining the (or one of the) shortest path.
One way that seems to help in understanding (and hence implementation) is to do this on paper and note how you would sovle this by hand (or if you are required to implement DA, then how you would solve this by hand using the DA.
Joined: Jan 24, 2006
I re-did the application, with 2D array...
and did dijkstra's with a triple nested for loop...