GATE CS 2024 Set 2 — Question 51

MSQ+2 / -0HardTrees & Spanning TreesGraph Theory (Math)Engineering MathematicsGraph Terminology (Degree, Paths, Cycles)

Engineering Mathematics → Graph Theory (Math) → Graph Terminology (Degree, Paths, Cycles)

Last updated

Question

Let GG be an undirected connected graph in which every edge has a positive integer weight. Suppose that every spanning tree in GG has even weight. Which of the following statements is/are TRUE for every such graph GG ?
A.
All edges in GG have even weight
B.
All edges in GG have even weight OR all edges in GG have odd weight
C.
In each cycle CC in GG, all edges in CC have even weight
D.
In each cycle CC in GG, either all edges in CC have even weight OR all edges in CC have odd weight

Correct answer

(D) In each cycle C in G, either all edges in C have even weight OR all edges in C have odd weight

Solution

Let w(e)w(e) denote the weight of edge ee. The weight of a spanning tree TT is W(T)=eTw(e)W(T) = \sum_{e \in T} w(e). We are given that W(T) is even for every spanning tree TT of GG.
Consider any cycle CC in GG. Let ee be an edge in CC. Since GG is connected, there exists a spanning tree TT such that TT contains all edges of CC except ee (i.e., ee is the fundamental cycle edge with respect to TT).
Let ff be any other edge in CC. Since fTf \in T and ff is on the unique cycle formed by adding ee to TT, the set of edges T=(T{f}){e}T' = (T \setminus \{f\}) \cup \{e\} forms another spanning tree of GG.
The weights of TT and TT' are:
W(T)=Wcommon+w(f)W(T) = W_{common} + w(f)
W(T)=Wcommon+w(e)W(T') = W_{common} + w(e)We are given that both W(T) and W(T)W(T') are even. Therefore, their difference must be even:
W(T)W(T)=w(e)w(f)0(mod2)W(T') - W(T) = w(e) - w(f) \equiv 0 \pmod 2
    w(e)w(f)(mod2)\implies w(e) \equiv w(f) \pmod 2This implies that any two edges ee and ff in the cycle CC must have the same parity (both even or both odd). Since this holds for any pair of edges in CC, all edges in the cycle CC must have the same parity.
Thus, for every cycle CC, either all edges in CC are even, or all edges in CC are odd. This corresponds to statement (D).
Counter-examples for other options:
  • (A) & (C): Consider a graph consisting of a single cycle of length 3 (triangle) with edge weights 1, 1, 1. The spanning trees have weights 1+1=21+1=2 (even). This satisfies the condition. However, the edges are odd, so (A) and (C) are false.
  • (B): Consider two disjoint triangles, one with weights (1, 1, 1) and another with weights (2, 2, 2), connected by a path of two edges with weights 1, 1. The total weight of any spanning tree will be sum of (2 edges from triangle 1) + (2 edges from triangle 2) + (path edges). Sum = (odd+odd) + (even+even) + (odd+odd) = even + even + even = even. This graph satisfies the condition. However, it contains both odd and even edges, so (B) is false.

More questions on Graph Theory (Math)

Practice GATE CS PYQs with adaptive difficulty

Timed practice, skill tracking, and AI explanations — free to start.

Start practicing free