answersLogoWhite

0

Computer Programming
Math and Arithmetic
C Programming

How does Prim's algorithm work?


Top Answer
User Avatar
Wiki User
Answered 2008-08-24 11:56:24

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.

001
๐Ÿ™
0
๐Ÿคจ
0
๐Ÿ˜ฎ
0
๐Ÿ˜‚
0
User Avatar

Your Answer

Loading...

Still have questions?

Related Questions

What is the difference between prims and kruskal's algorithm with example?

prim's


What is the difference between prims and kruskal's algorithm?

Prims select vertex to build minimum spanning tree....kruskal's select edge at a time.... Prims work perfect when lot of edges in graph .........whereas kruskal's want sorted edges... Prims O(E+VlogV) Kruskal O(ElogV)


What is the difference between Prims algorithm Kruskals algorithm and dijktras algorithm?

Well, Dijkstra algorithm is a way to find a path with minimum weight between 2 vertices's in a weighted graph. Prims And Kruskal algorithms are algorithms used to find the a path with minimum weight in a way that you can go from any vertex to another. Prims And Kruskal Algorithms are some how the same and both are greedy algorithms, but Prims insiste that the next edge to be chosen must be an edge with minimum weight connected to the current fringe whereas kruskal says that the next edge to be chosen dosent have to be connected to the current set of edges.


What is the difference between Prims algorithm and kruskals algorithm for finding the minimum spanning tree of a graph?

Prims And Kruskal Algorithms are some how the same and both are greedy algorithms, but Prims insiste that the next edge to be chosen must be an edge with minimum weight connected to the current fringe whereas kruskal says that the next edge to be chosen dosent have to be connected to the set of vertices's Already Chosen.


What is the difference between Prims algorithm and Dijkstras algorithm?

Both Prim's and Dijkstra's algorithm are manipulating with graphs but they have different roles. Dijkstra's algorithm is used to find the shortest path between any two nodes in a weighted graph while the Prim's algorithm finds the minimum spanning tree of a graph.


Can someone provide the C program for Prim's algorithm?

The C code for Prim's algorithm can be found in the following link. https://sites.google.com/site/itstudentjunction/lab-programming-solutions/data-structures-programs/program-to-find-minimal-spanning-tree-using--prims-algorithm


What is mining Spanning Tree algorithm?

They are algorithms that give us a minimum connection between points(nodes) without cycles. 2 algorithms that do this are : Krushkals and Prims.


When was Graham Street Prims F.C. created?

Graham Street Prims F.C. was created in 1904.


What do you mean by analysis of algorithm?

it is a processor of the work


How do you use prim's algorithm to find a spanning tree of a connected graph with no weight on its edges?

Prims Algorithm is used when the given graph is dense , whereas Kruskals is used when the given is sparse,we consider this because of their time complexities even though both of them perform the same function of finding minimum spanning tree. ismailahmed syed


How does the bellman ford algorithm work?

This distance-vector algorithm works by computing the shortest path , and considers weights. The algorithm was distributed widely in the RIP protocol.


What is the difference between an algorithm and a flowchart in general?

Algorithm is step wise analysis of the work to be done. Flow chart is a pictorial representation of an algorithm. As flow chart is a picture of work to be done,it may be printed in our mind when we observe it.


How does the US Algorithm work for multiplication?

just multiplie


What algorithm will work for any two fractions?

Many of them.


Is heyristic an algorithm?

A heuristic is not an algorithm, but rather a general rule of thumb. It doesn't always work, but it's fairly decent.


What is algorith and flow chart with example?

Algorithm is any way to work upon a program. Flow chart is way to depict the algorithm. The various steps of algorithm are shown as graphical way.


What was the name of prims cat in The Hunger Games?

Buttercup


How many faces on a rectangular prims?

6 faces


How many faces have a triangular prims?

5 faces


How many faces does a rectangular prims have?

6 faces


What color is prims cat in the hunger games?

orange


What is the name of prims goat?

Lady is the name of the goat.


What was Katy perry most famous album?

prims


Why algorithm is needed?

if u want to work any program then the first step is perform step by step analysis so that algorithm is needed


What is prims goats name?

Prim goat's name is Lady