GATE / CS ARCHIVE

GATE CSE 2018 / QUESTION 43

Graph of adjacent transpositions

Discrete Mathematics · Graph Theory · Full GATE CSE 2018 paper

GATE 2018, Q43 2 marks · NAT
Report issue

Graph Theory

Question 43, GATE 2018: Vertices are all 100! permutations of 1…100. Two vertices are adjacent exactly when one swaps two adjacent positions of the other. If degree is y and connected-component count z, find y+10z.
Tap to enlarge
Answer & solution

Official answer: 109

Method

There are 99 boundaries between consecutive positions, and swapping at distinct boundaries gives distinct neighboring permutations. To prove connectedness construct a path: repeatedly swap an adjacent inverted pair, as in bubble sort. Each move is an edge and reduces inversion count by one, so every permutation reaches the sorted permutation after finitely many steps. Connecting every vertex to a common vertex proves exactly one component. Parity alternates on each move, but bipartiteness does not imply disconnectedness.

Solution

There are 99 adjacent positions available for a swap. Each gives a different permutation, so every vertex has degree 99. Adjacent swaps can sort any permutation to the identity, proving that the graph is connected and z=1. Thus y+10z=99+10=109.

Original paper, page 18 · Answer key