Last Updated : 20 Nov, 2018

Consider the following weighted graph:

\"\"

Which of the following edge set is not a Prim\’s order to find minimum spanning tree?

(A) (IG), (GF), (GD), (GH), (DE), (EB), (FU), (UR)
(B) (IG), (GD), (DE), (EH), (EB), (GF), (FU), (UR)
(C) (IG), (GH), (GF), (GD), (DE), (EB), (FU), (UR)
(D) None of these


Answer: (B)

Explanation: For the given graph, minimum spanning tree (MST) will be as given and cost of the MST is 13.

\"\"

According Prim\’s algorithm, possible orders to find MST are as following:

  1. (IG), (GF), (GD), (GH), (DE), (EB), (FU), (UR)
  2. (IG), (GH), (GD), (GF), (DE), (EB), (FU), (UR)
  3. (IG), (GF), (GH), (GD), (DE), (EB), (FU), (UR)
  4. (IG), (GH), (GF), (GD), (DE), (EB), (FU), (UR)
  5. (IG), (GD), (GF), (GH), (DE), (EB), (FU), (UR)
  6. (IG), (GD), (GH), (GF), (DE), (EB), (FU), (UR)

Option (B) will also produce minimum spanning tree but it violates Prim\’s algorithm.

So, option (B) is correct.

Quiz of this Question


Share your thoughts in the comments