468,257 Members | 1,405 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,257 developers. It's quick & easy.

Dijkstra Algorithm

Can somebody please explain and provide pseudocode for the Dijkstra
algorithm?

I'm trying to implement the Dijkstra shortest path algorithm. However, I'm
finding it extremely difficult to understand.

I've a node class that hold the node name, and the x,y coordinate.
I've an edge class the takes two(2) nodes, from and to, and a name for the
edge.
I'm using only simple arrays to store the nodes and the edges, no priority
queues.

I've also read the pseudocode on:
http://en.wikipedia.org/wiki/Dijkstra's_algorithm
but find it too mathematical.

Can somebody please provide me with pseudocode and comments/exlanation that
uses simple arrays and programming contructs?

Many thanks

James
Jul 26 '06 #1
1 15665
How about googling +Dijkstra +c# +"shortest path" - yields a good hit:

http://cs.nerdbank.net/blogs/jmpinli..._CallBack=true
(I cannot vouch for the quality of code / math)

However; graph theory is by definition quite math orientated; if you don't
understand the math, I would advise sticking to pre-written code - otherwise
you will struggle to maintain it. Or - go to the library and get a book on
graph theory; some books make it quite easy to follow with visualisations
etc - note that "quite easy" in this context is subjective.

Marc
Jul 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Ricardo Batista | last post: by
6 posts views Thread by ThanhVu Nguyen | last post: by
3 posts views Thread by A_StClaire_ | last post: by
3 posts views Thread by Ook | last post: by
9 posts views Thread by Josh Zenker | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.