algorithm of Prim

algorithm of Prim

One of the algorithms to find the Minimal Spanning tree is the algorithm of Prim:
  • Choose a random point on the graph (1st visited knot)
  • Choose the connection with the smallest value connected with this knot
  • Add this knot to the set of visited knots
  • Choose the connection with the smallest value connected with your set of visited knots and add it to your tree
  • Add the new visited knot to your set of visited knots
  • Continue until you visited all knots.

The algorythm step by step

Click on the arrows of the navigation bar and follow how the algorithm is set up.