We help IT Professionals succeed at work.

Dijkstra's Algorithm

mustish1
mustish1 asked
on
Hi guys: Can any one please help me in that algorithm. I get some help on a piece of papper but still dont understand how this theorem implement on this diagram. Thanks.


D(z)<--, T(z)<--0
For all y not= z T(y)<--1, D(y)<--M(z,y)
    if M(z,y) = X Then L(y)<-- X Else L(y) <-- z
While T Not= 0
    Find a y belongs to T such that for all u belongs to T D(y)<= D(u)
    T(y)<--0
    For all u belongs to T
        if D(u)>D(y)+M(y,u) Then
             D(u)<---D(y)+M(y,u)
             L(u)<--y

k1.jpg
Comment
Watch Question

I know Dijkstra's algorithm really well but I find your pseudo-code close to incomprehensible, unless it is a language I am unfamiliar with. If you got this code off a professor I'd question his non standard style.

There are an enormous number of very good links on a google that really I can not do better than in their explaination, eg

http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm

Author

Commented:
That wiki is hard. Can you please tell me any other easy way?

Thanks.