Question

Figures (i) and (ii) represent intercity highway systems. The black dots represent cities and the line segments between them represent intercity highways.

A salesperson needs to make a trip. She needs to start from a city, visit each of the remaining cities exactly once, and finally return to the same city from which she started.

Which one of the following options is then true?

Figure (i) shows a 4 by 4 grid graph with 16 vertices; Figure (ii) shows a 5-vertex graph where two hub vertices are connected to three degree-2 vertices.
Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2026 answer key

Solution

Determine whether each graph contains a Hamiltonian cycle.

A trip that starts at a city, visits every other city exactly once, and returns to the starting city is a Hamiltonian cycle.

  1. Figure (i) is a 4×44 \times 4 grid graph (P4□P4P_4 \square P_4). Any m×nm \times n grid graph with at least one even dimension has a Hamiltonian cycle (for instance, snaking across the rows and returning along the left boundary column).
  2. Figure (ii) is the complete bipartite graph K2,3K_{2,3} with parts of sizes 22 and 33. Since a bipartite graph can only have cycles of even length and ∣V∣=5|V| = 5 is odd (or equivalently, the 3 vertices of degree 2 must all use both edges incident to the same 2 hub vertices, requiring 66 edges at the hubs in a 5-cycle), Figure (ii) has no Hamiltonian cycle.

Thus, such a trip is possible for (i), but not for (ii).

Final answer

Option (A)

Common trap

Confusing an Eulerian circuit with a Hamiltonian cycle.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2026 Computer Science and Information Technology - Session 2 (CS2)
Question
8 of 65
Section
General Aptitude

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.