Asked in
Computer Programming
Math and Arithmetic
C Programming

How does Prim's algorithm work?


User Avatar
Wiki User
August 24, 2008 11:56AM

First a vertex is selected arbitrarily. on each iteration we expand the tree by simply attaching to it the nearest vertex not in the tree. the algorithm stops after all yhe graph vertices have been included.. one main criteria is the tree should not be cyclic.