954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Dijkstra Algorithm

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?

wujtehacjusz
Newbie Poster
18 posts since Mar 2007
Reputation Points: 12
Solved Threads: 7
 

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

wujtehacjusz
Newbie Poster
18 posts since Mar 2007
Reputation Points: 12
Solved Threads: 7
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You