GateAI
Graph Traversals

GATE CSE 2023 · Q56

NAT2 marksEasy

Time

Let U={1,2,3}U = \{1, 2, 3\}. Let 2U2^U denote the powerset of UU. Consider an undirected graph GG whose vertex set is 2U2^U. For any A,B∈2UA, B \in 2^U, (A,B)(A, B) is an edge in GG if and only if (i) A≠BA \neq B, and (ii) either A⊊BA \subsetneq B or B⊊AB \subsetneq A. For any vertex AA in GG, the set of all possible orderings in which the vertices of GG can be visited in a Breadth First Search (BFS) starting from AA is denoted by B(A)\mathcal{B}(A). If ∅\emptyset denotes the empty set, then the cardinality of B(∅)\mathcal{B}(\emptyset) is ________.

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 5040

Graph Traversals

The vertex set of the graph GG is the power set of U={1,2,3}U = \{1, 2, 3\}, so the total number of vertices is:

∣V∣=2∣U∣=23=8|V| = 2^{|U|} = 2^3 = 8

An undirected edge exists between any two distinct subsets AA and BB if and only if one is a proper subset of the other (A⊊BA \subsetneq B or B⊊AB \subsetneq A).

For the empty set ∅\emptyset, it is a proper subset of every other non-empty subset S⊆US \subseteq U:

∅⊊S,∀S∈2U∖{∅}\emptyset \subsetneq S, \quad \forall S \in 2^U \setminus \{\emptyset\}

Therefore, ∅\emptyset is directly connected to all remaining 23−1=72^3 - 1 = 7 vertices in the graph GG.

In a Breadth First Search (BFS) starting from ∅\emptyset:

  1. The starting vertex ∅\emptyset is visited first (1 choice).

  2. Since all other 7 vertices are at distance 1 from ∅\emptyset, they will all be visited at level 1 in any possible permutation.

Thus, the number of possible BFS orderings starting from ∅\emptyset is:

∣B(∅)∣=1×7!=5040|\mathcal{B}(\emptyset)| = 1 \times 7! = 5040

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Graph Traversals previous year question is Q56 of the GATE CSE 2023 paper. Find more GATE CSE PYQs on Graph Traversals in Engineering Mathematics, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 1 related Graph Traversals PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Graph Traversals in GATE CSE

GATE CSE 2023 Q56 is the only Graph Traversals question in the GATE CSE papers so far.

How GATE tests Graph Traversals

More from GATE CSE 2023

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2023 · Q56 · NAT

Let U = {1, 2, 3}. Let 2U denote the powerset of U. Consider an undirected graph G whose vertex set is 2U. For any A, B ∈ 2U, (A, B) is an edge in G if and only if (i) A ≠ B, and (ii) either A B or B A. For any vertex A in G, the set of all possible orderings in which the vertices of G can be visited in a Breadth First Search (BFS) starting from A is denoted by B(A). If ∅ denotes the empty set, then the cardinality of B(∅) is …

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.