GATE / CS ARCHIVE

GATE CSE 2019 / QUESTION 12

Hamiltonian cycles in an undirected complete graph

Discrete Mathematics · Graph Theory · Full GATE CSE 2019 paper

GATE 2019, Q12 1 mark · MCQ
Report issue

Graph Theory

Question 12, GATE 2019: For an undirected complete graph on n vertices with n>2, count distinct Hamiltonian cycles. Choices: A n!; B (n−1)!; C 1; D (n−1)!/2. Rotations and reversal describe the same undirected cycle.
Tap to enlarge
Your answer
Answer & solution

Official answer: C OR D

Our answer: D generally; official accepts C OR D

Method: count vertex orders while removing the two sources of duplicate descriptions.

1. A Hamiltonian cycle visits every vertex once and returns to its start. Because the graph is complete, any ordering of the vertices produces the required edges.
2. Fix one named vertex as the start. The other n − 1 vertices can be arranged in (n−1)! orders. Fixing the start removes the n equivalent rotations that would appear in an unrestricted n! count.
3. Every undirected cycle is still counted twice: once for each traversal direction. For example, v1,v2,…,vn,v1 and v1,vn,…,v2,v1 use exactly the same undirected edges. Since n>2, these are two distinct orders, so divide by 2.
4. Hence the general count is (n−1)!/2. For n=3 this gives 1; for n=4 it gives 3, showing why the constant answer 1 does not hold for every allowed n.

Result: D is the general formula. The official key also accepts C, the value 1; that is true only for n=3, not for general n>2. Preserve both official scoring alternatives without presenting C as the general formula.

Original paper, page 6 · Answer key