IAE Academy

GATE 2025 CS1 Q.64: solution and answer

GATE 2025 · CS1Q.64 · 2 marks · NAT

The maximum value of such that the edge between the nodes B and C is included in every minimum spanning tree of the given graph is ________ . (answer in integer)

Graph (4 vertices A, B, C, D arranged as a square with both diagonals drawn, i.e. ):
- A connects to B with weight 7 (top edge)
- A connects to D with weight 6 (left edge)
- D connects to C with weight 8 (bottom edge)
- B connects to C with weight (right edge, unknown)
- B connects to D with weight 1 (one diagonal)
- A connects to C with weight 3 (other diagonal)

GATE 2025 CS1 question 64: A square-shaped graph with 4 labelled circular nodes: A (top-left), B (top-right), D (bottom-left), C (bottom-right).Tap to open full size
Figure from the GATE 2025 CS1 paper. It is part of the question.
Figure description

A square-shaped graph with 4 labelled circular nodes: A (top-left), B (top-right), D (bottom-left), C (bottom-right). Edges: A–B labelled 7 (top side), A–D labelled 6 (left side), D–C labelled 8 (bottom side), B–C labelled x (right side). Two diagonals cross in the middle without meeting at a vertex: B–D labelled 1 (label near its upper half) and A–C labelled 3 (label near its lower half, towards C).

Answer and solution

ANSWER

The maximum integer value of x for which edge B–C lies in every minimum spanning tree is 5.

Official answer: 5Source: Official answer key, GATE 2025 CS1 (IIT Roorkee)

  1. Read the graph from the figure. It is on with , , , , and .

  2. The correct test for an edge being in EVERY minimum spanning tree: an edge is in every MST if and only if is not a maximum-weight edge (strict or tied) on any cycle. Equivalently, must be the strictly lightest edge crossing some cut. A tie for the maximum is not enough. If ties another edge for the heaviest weight on a cycle, you can swap for that edge and get another MST of the same weight that does not contain .

  3. List every cycle through and the largest of its other edges:
    - (edges , ): largest is .
    - (edges , ): largest is .
    - (edges , , ): largest is .
    - (edges , , ): largest is .

  4. For not to be a maximum on any of these cycles, must be strictly less than every one of these values:

  5. The same condition from the cut side. Take the cut versus . The edges crossing it are , , and . If , then is the unique lightest edge crossing this cut, so every MST must contain it (cut property).

  6. Check . Kruskal's algorithm takes , then , leaving the two components and . The next lightest edges are and , and either one joins the two components. So and are both MSTs of weight . The first one does not contain , so fails.

  7. For any , is the strict unique maximum on cycle , so no MST contains it.

  8. Check . Kruskal's algorithm takes , , then , which joins and . All remaining edges () would close a cycle. The MST of weight is unique and contains .

  9. So must be an integer with , and the maximum value is .

KEY IDEA

An edge is in every MST exactly when it is the strictly lightest edge crossing some cut. Here that cut is {B, D} versus {A, C}. The other edges crossing it weigh 6, 7 and 8, so B–C must weigh strictly less than 6. The largest integer that works is 5.

WATCH OUT FOR

Treating a tie as good enough and answering 6. When x = 6, B–C ties with A–D = 6 across the cut {B, D} | {A, C}. Kruskal's algorithm can then pick A–D instead, which gives an MST without B–C. "Included in SOME MST" allows ties, but "included in EVERY MST" needs a strict inequality.

From the GATE 2025 CS1 paper. Every question of this paper · Download the full paper · All 28 Graph algorithms questions, with notes

More Graph algorithms questions