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?