Dijkstra Algorithm

Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Thread Solved

Join Date: Mar 2007
Posts: 18
Reputation: wujtehacjusz is an unknown quantity at this point 
Solved Threads: 7
wujtehacjusz's Avatar
wujtehacjusz wujtehacjusz is offline Offline
Newbie Poster

Dijkstra Algorithm

 
0
  #1
Mar 25th, 2007
Hi!

I have a problem with Dijkstar algorithm. At my university I was told that to use this algorithm I have to have:
  • array of distances from starting node to all unreached nodes going only via node in set reached.
  • set of reached nodes (I pressume that it would be an array or linked list)
  • set of unreached nodes (as before array or linked list)
I initilize distance array by putting distance from starting node to all other nodes. If node is unreachable I am putting there infinity. Then I am choosing closest node from unreached set, move it to reached set and for all nodes in unreached set I am chcecking if going through node I just reached helps in getting to that node. I repeat this process untill set of unreached nodes is empty.

I am confortable with implementing it unsing just simple arrays or linked lists. Problm is taht I whant to improve time it takes to compute.

How would I do it?
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 18
Reputation: wujtehacjusz is an unknown quantity at this point 
Solved Threads: 7
wujtehacjusz's Avatar
wujtehacjusz wujtehacjusz is offline Offline
Newbie Poster

Re: Dijkstra Algorithm

 
0
  #2
Mar 25th, 2007
I marked is as solved. It was foolish to post topic about something as simple as this. I found solution to my problem.

If anybody is interested. Best way of implementing Dijkstra algorithm is described here http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/GraphAlgor/dijkstraAlgor.htm
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Computer Science Forum


Views: 3688 | Replies: 1
Thread Tools Search this Thread



Tag cloud for Computer Science
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC