next up previous
Next: Dijkstra's Algoritm for shortest Up: Easy Graph Problems Previous: Minimum Spanning Tree

Prim's algorithm

gif
program192
Prim's algorithm is a simple greedy algorithm. The class notes indicate that Prim's algorithm as described above has a performance complexity of O(nm). However, Cormen et.al.[] claim a running time performance of tex2html_wrap_inline578 assuming an algorithm that uses a priority queue implemented using a binary heap. Cormen et. al.[] claim a better performance for Prim's algorithm when the priority queue is implemented using Fibonacci heaps. In this case the running time can be reduced to tex2html_wrap_inline580.

 figure196
Figure 2: Minimum Spanning Tree resulting from Prim's Algorithm



Nitin Sharma
Wed Oct 8 17:46:14 PDT 1997