GATE / CS ARCHIVE

GATE CSE 1997 / QUESTION 9(b)

Maximum lattice spanning-tree weight

Algorithms · Graph Algorithms · Full GATE CSE 1997 paper

GATE 1997, Q9(b) 3 marks · Descriptive
Report issue

Graph Algorithms

Question 9(b), GATE 1997: The vertices are the n² integer lattice points (x,y), 1≤x,y≤n, n≥2. Distinct vertices are adjacent when BOTH |x1−x2|≤1 and |y1−y2|≤1; an edge has Euclidean length sqrt((x1−x2)²+(y1−y2)²). This is the GateForum p11 adjacency, including the second-coordinate bound omitted in GFG. Find the maximum spanning-tree weight; also distinguish the literal GFG graph that constrains only |x1−x2|≤1.
Question 9(b), GATE 1997: The vertices are the n² integer lattice points (x,y), 1≤x,y≤n, n≥2. Distinct vertices are adjacent when BOTH |x1−x2|≤1 and |y1−y2|≤1; an edge has Euclidean length sqrt((x1−x2)²+(y1−y2)²). This is the GateForum p11 adjacency, including the second-coordinate bound omitted in GFG. Find the maximum spanning-tree weight; also distinguish the literal GFG graph that constrains only |x1−x2|≤1.
Question 9(b), GATE 1997: The vertices are the n² integer lattice points (x,y), 1≤x,y≤n, n≥2. Distinct vertices are adjacent when BOTH |x1−x2|≤1 and |y1−y2|≤1; an edge has Euclidean length sqrt((x1−x2)²+(y1−y2)²). This is the GateForum p11 adjacency, including the second-coordinate bound omitted in GFG. Find the maximum spanning-tree weight; also distinguish the literal GFG graph that constrains only |x1−x2|≤1.
Tap to enlarge
Answer & solution

Answer: (2n−2)√(1+(n−1)²)+(n−1)+nΣ_(j=2)^(n−1)√(1+max(j−1,n−j)²) (no official key was published)

In the stated king-move grid, every edge is either horizontal/vertical with weight 1 or diagonal with weight √2. We therefore want as many diagonal edges as a spanning tree can contain.

Color vertex (x,y) by the parity of x+y. A diagonal changes both coordinates by one, so it preserves this parity; a horizontal or vertical edge changes it. Both parity classes are nonempty for n≥2. A connected spanning tree must consequently include at least one unit edge to join the two classes. Since it has n²−1 edges in total, its weight is at most (n²−2)√2+1.

To attain the bound, observe that the diagonal-only graph has exactly two connected components, one of each parity. Here is a constructive connectivity argument. Repeatedly use an upward diagonal to reduce y until reaching the first row; at a side boundary choose the inward direction, always possible because n≥2. On the first row, vertices of a fixed parity can move two columns at a time through a vertex of the second row. Thus all vertices of each parity are connected by diagonals. Take a spanning tree inside each diagonal component. Together they use n²−2 diagonal edges. Add any unit edge between the components. This produces a spanning tree attaining the upper bound.

For n=2 the two diagonals, joined by one side, have weight 2√2+1. Under the paper's literal omission of the y-bound, longer edges are allowed when n≥3. Its maximum is instead

(2n−2)√(1+(n−1)²) + (n−1) + nΣ_(j=2)n−1√(1+max(j−1,n−j)²).

Here is a separate optimality proof for that literal graph. Call vertices on y=1 or y=n boundary vertices. For each interior vertex at row j, select an edge to a farthest boundary row in an adjacent column. Such a column always exists for n≥2. Its length is √(1+max(j−1,n−j)²), a maximum edge across the cut isolating that vertex. Add these edges while each interior vertex is still isolated; all chosen parents are boundary vertices, so no cycle arises. By the maximum-spanning-tree cut property, each addition is safe.

Next add all 2n−2 boundary diagonals with |dx|=1 and |dy|=n−1. They are globally maximum edges, each of length √(1+(n−1)²), and form two disjoint alternating-row paths on the 2n boundary vertices. Interior attachments do not join those paths. Finally join them by a same-column edge from y=1 to y=n, of length n−1. Every competing cross-component edge with an interior endpoint is at most √(1+(n−2)²)<n−1 for n≥3. Remaining boundary cross-edges have length at most n−1, so this last edge is also cut-safe. At n=2 there are no interior vertices and the bridge length is 1.

The safe selections form a spanning tree and give the displayed sum: n equal-length interior attachments for each row j, 2n−2 boundary diagonals, and one bridge. Thus both materially different printed graphs have an explicit maximum and a proof, rather than silently restoring a bound.

Original paper, page 6