GATE CSE 2023 Q56: Number of BFS orderings from ∅ in the subset graph of {1, 2, 3}
- Algorithms
- 2 marks
- NAT
- No negative marking
Question
Let . Let denote the powerset of . Consider an undirected graph whose vertex set is . For any , is an edge in if and only if (i) , and (ii) either or . For any vertex in , the set of all possible orderings in which the vertices of can be visited in a Breadth First Search (BFS) starting from is denoted by .
If denotes the empty set, then the cardinality of is _______.
Try it: numerical answer: type the value
Show answer and explanation
Answer: 5040 (official GATE 2023 final answer key)
Concept used: BFS from a vertex adjacent to every other vertex visits all of them at level 1, in any order.
First step: Note that is a proper subset of each of the other 7 subsets.
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2023 CS question paper and final answer key, organised by IIT Kanpur. Question paper · Answer key
More Algorithms PYQs
- 2026 Session 1 · Q17Solve nested recurrences T1 = 4T1(n/2) + T2, T2 = 5T2(n/4) + log n
- 2026 Session 1 · Q41Shortest paths with at most k edges: two statements
- 2026 Session 1 · Q47Condition forcing a vertex into every minimum vertex cover
- 2026 Session 1 · Q49Cycle and cut properties of MSTs with distinct weights
- 2026 Session 1 · Q50Impossible DFS discovery/finish orderings for a DAG edge
- 2026 Session 1 · Q55Properties of 2-colorable (bipartite) graphs