edited by
1,787 views
0 votes
0 votes

Consider the undirected graph below:

Using Prim’s algorithm to construct a minimum spanning tree starting with node $a$, which one of the following sequences of edges represents a possible order in which the edges would be added to construct the minimum spanning tree?

  1. $(a,b), (a,h), (g,h), (f,g), (c,f), (c,i), (c,d), (d,e)$
  2. $(a,b), (b,h), (g,h), (g,i), (c,i), (c,f), (c,d), (d,e)$
  3. $(a,b), (b,c), (c,i), (c,f), (f,g), (g,h), (c,d), (d,e)$
  4. $(a,b), (g,h), (g,f), (c,f), (c,i), (f,e), (b,c), (d,e)$ 
edited by

2 Answers

0 votes
0 votes

Prim’s algorithm may informally be described as performing the following steps:

  1. Initialize a tree with a single vertex, chosen arbitrarily from the graph.

  2. Grow the tree by one edge: of the edges that connect the tree to vertices not yet in the tree, find the minimum-weight edge, and transfer it to the tree.

  3. Repeat step 2 (until all vertices are in the tree)                                                                                         Here we have to start with vertex a so first edge must be (a,b)                                                                  next either ( b.c) or (a,h) {hence option  B,D are out  if  we go with (b,c) then next must be (c,i) followed by (c,f)  (f,g) then (g,h)  and   (c,d) and (d,e)                                                                                               which is option C) hence it is correct ans

  if we go with (a,h) next must be (h,g) or  (g,h) as in option A hence  is  also correct  (although order is changed)  

Both A, C are correct as per offiical key

edited by
0 votes
0 votes
ANSWER IS OPTIONN C

PRIMS ->GROWS LIKE TREE

BY TAKING 3EDGES U WILL  SEE   OPTIONN C MATCHES
Answer:

Related questions

3 votes
3 votes
1 answer
1
Pooja Palod asked Oct 15, 2015
3,032 views
Suppose that edge weights are uniformly distributed over half open interval $[0,1)$. Which algorithm kruskal's or prim's can make you run faster?
0 votes
0 votes
1 answer
2
1 votes
1 votes
0 answers
3
Shivam Chauhan asked Nov 2, 2017
749 views
First statement is False because complexity will be O(E2).I think the second statement is true? But not sure
0 votes
0 votes
3 answers
4