516 views
1 votes
1 votes
Hello,

I have doubt regarding prims algorithm

1)should we choose the lowest cost edge and then implement algo further?

2)Or we choose any vertex and then lowest cost edge of that vertex?

2 Answers

Best answer
1 votes
1 votes
IN PRIMS we can chooses any vertex and find the minimum edge ...in such way we add vertex without forming cycle...at every time we include such edge which has minimum cost among all vertex we choose...and process continue..

SO NO COMPULSION ON CHOOSING VERTEX OR EDGE...

IN KRUSKALS..we must have to chooses such edge which has minimum weight and we have add edges as per increasing order of weight ...

SO IN PRIMS = CHOOSE ANY VERTEX AND FIND ITS MINIMUM EDGE and include that EGDE , VERTEX and continue process...
selected by
0 votes
0 votes
in prims algo we always starts with a start vertex then check lowest value edge reachable .

Related questions

1 votes
1 votes
0 answers
2
just_bhavana asked Oct 30, 2017
838 views
Assuming that the graph can contain repeated edge weights, we have a single tree at any instance when applying Prim's algorithm.Justify this statement.
3 votes
3 votes
1 answer
3
pC asked Sep 22, 2017
2,522 views
Explain Prims AlgorithmAnalysis Of Time ComplexityHow does $\mathcal{O}(VlogV + ElogV)=\mathcal{O}(ElogV)$
5 votes
5 votes
3 answers
4
Kapil asked Jan 24, 2017
3,410 views
It may be the case that "Kruskal's Algorithm may not maintain connectivity while Prim's algorithm always does that" ?Any example which favours this ?