944,022 Members | Top Members by Rank

Ad:
Mar 25th, 2007
0

Dijkstra Algorithm

Expand Post »
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?
Similar Threads
Reputation Points: 12
Solved Threads: 7
Newbie Poster
wujtehacjusz is offline Offline
18 posts
since Mar 2007
Mar 25th, 2007
0

Re: Dijkstra Algorithm

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
Reputation Points: 12
Solved Threads: 7
Newbie Poster
wujtehacjusz is offline Offline
18 posts
since Mar 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Computer Science Forum Timeline: Writing bootsector to a floppy
Next Thread in Computer Science Forum Timeline: Matlab - Is this a floating point arithmetic problem?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC