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 _______.
Official answer and solution
- Official answer
- 5040
- From
- Official GATE 2023 answer key
Solution
Analyze adjacency in the powerset graph and count permutations of vertices at distance 1 from .
- The set has subsets.
- An edge exists between and if and only if and either or .
- Consider the empty set :
For any non-empty subset , holds true. Therefore, is adjacent to every other vertex in the graph . - In a Breadth First Search starting from :
- Level 0 contains only (visited first).
- Level 1 contains all 7 other vertices of , because all of them are directly connected to by an edge.
- Since all 7 remaining vertices are at distance 1 from the start vertex , a BFS can visit these 7 vertices in any arbitrary permutation among themselves.
- The number of possible BFS vertex orderings is:
5040
Assuming vertices are partitioned into levels by subset cardinality (), overlooking that creates direct edges from to all subsets regardless of size.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2023 Computer Science and Information Technology (CS)
- Question
- 56 of 65
- Section
- Computer Science and Information Technology
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.