Re: Dijkstra Algorithm Help

2011-03-09 Thread Ulrich Eckhardt
yoro wrote: > Thanks for replying, maybe i'm misunderstanding your comment - > nodeTable is used to store the distances from source of each node > within a text file, the file having the format : > > 1,2,3,4,5,6,7,8,9 > 1,2,3,4,5,6,7,8,9 > > Each of these nodes will have the same settings as set

Re: Dijkstra Algorithm Help

2011-03-09 Thread Tim Roberts
yoro wrote: > >Thanks for replying, maybe i'm misunderstanding your comment - Yes, it was not clear at first glance that you are calling populateNodeTable twice. You call it once and throw away the result, then you call it again and pass the result to tentativeDistance. That's probably not what

Re: Dijkstra Algorithm Help

2011-03-08 Thread yoro
On Mar 8, 6:49 pm, MRAB wrote: > On 08/03/2011 18:12, yoro wrote: > > > > > Hello, > > > I am having a little trouble writing Dijkstra's Algorithm, at the > > point where I have to calculate the distance of each node from the > > source - here is my code so far: > > > infinity = 100 > > invali

Re: Dijkstra Algorithm Help

2011-03-08 Thread MRAB
On 08/03/2011 18:12, yoro wrote: Hello, I am having a little trouble writing Dijkstra's Algorithm, at the point where I have to calculate the distance of each node from the source - here is my code so far: infinity = 100 invalid_node = -1 startNode = 0 class Node: distFromSource = in