Page 1 of 1
Dijkstra heap
Posted: Wed Feb 26, 2003 2:37 pm
by msn
Can you show me how to use Dijkstra heap?
Posted: Wed Feb 26, 2003 5:50 pm
by makbet
I don't know what exactly you want to know, but you have to implement
the following functions:
- heapify(v)
- extract-min
- decrease-key(v)
At first,
for all v d[v]=infinity
d[0]=0, where 0 is the starting point
Extract-min returns the vertice with smallest d,
throws it out of the heap, and uses heapify to
keep the condition of the heap. Decrease-key
is useful when you relax an edge and want to decrease
value d of a vertice (when you find a shorter path to it).
You can find those functions on the internet or in
"Introduction to Algorithms"
Posted: Sun Mar 02, 2003 4:09 am
by msn
Thankyou for your help.Where i can find "Introduction to Algorithms"?
Posted: Sun Mar 02, 2003 7:18 pm
by makbet
In a bookstore.
