Dijkstra heap

Let's talk about algorithms!

Moderator: Board moderators

Post Reply
msn
New poster
Posts: 6
Joined: Mon Feb 24, 2003 12:29 pm

Dijkstra heap

Post by msn »

Can you show me how to use Dijkstra heap?
makbet
New poster
Posts: 44
Joined: Tue Nov 26, 2002 11:01 pm
Location: Wejherowo

Post 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"
msn
New poster
Posts: 6
Joined: Mon Feb 24, 2003 12:29 pm

Post by msn »

Thankyou for your help.Where i can find "Introduction to Algorithms"?
makbet
New poster
Posts: 44
Joined: Tue Nov 26, 2002 11:01 pm
Location: Wejherowo

Post by makbet »

In a bookstore. :)
Post Reply

Return to “Algorithms”