Question

Consider the following undirected graph G:

Undirected weighted graph G with 5 vertices and 7 edges, with edge weights 1, 3, 4, 4, 4, 5, and variable x.

Choose a value for xx that will maximize the number of minimum weight spanning trees (MWSTs) of G. The number of MWSTs of G for this value of xx is ______.

Official answer and solution
Official answer
4
From
Official GATE 2018 answer key

Solution

Use Kruskal's algorithm principles to choose xx so that ties at critical cuts create the maximum number of distinct MWSTs.

The graph has 5 vertices {V1,V2,V3,V4,V5}\{V_1, V_2, V_3, V_4, V_5\} and 7 edges with weights: (V1,V4)=1,(V1,V5)=3,(V2,V1)=4,(V2,V4)=4,(V4,V5)=4,(V1,V3)=x,(V5,V3)=5(V_1, V_4)=1, (V_1, V_5)=3, (V_2, V_1)=4, (V_2, V_4)=4, (V_4, V_5)=4, (V_1, V_3)=x, (V_5, V_3)=5.

Edges (V1,V4)(V_1, V_4) [weight 1] and (V1,V5)(V_1, V_5) [weight 3] have the smallest weights and must be included in every MWST, connecting component {V1,V4,V5}\{V_1, V_4, V_5\}. Edge (V4,V5)(V_4, V_5) of weight 4 creates a cycle with them and is never selected.

To connect V2V_2 to {V1,V4,V5}\{V_1, V_4, V_5\}, there are two edges of weight 4: (V2,V1)(V_2, V_1) and (V2,V4)(V_2, V_4). Choosing either edge connects V2V_2 at minimal cost, giving (21)=2\binom{2}{1} = 2 independent choices.

To connect V3V_3, the available edges are (V1,V3)(V_1, V_3) of weight xx and (V5,V3)(V_5, V_3) of weight 5.

  • If x<5x < 5, (V1,V3)(V_1, V_3) is strictly smaller, giving only 1 choice for V3V_3.
  • If x>5x > 5, (V5,V3)(V_5, V_3) is strictly smaller, giving only 1 choice for V3V_3.
  • If x=5x = 5, both (V1,V3)(V_1, V_3) and (V5,V3)(V_5, V_3) have weight 5, giving (21)=2\binom{2}{1} = 2 independent choices for V3V_3.

Thus, setting x=5x = 5 maximizes the number of MWSTs to 2×2=42 \times 2 = 4.

Final answer

4

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2018 Computer Science and Information Technology (CS)
Question
57 of 65, printed as CS Q.47
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.