GATE CS 2024 Set 1 | Question 45

Algorithms › Graph Algorithms · MSQ · 2 marks · Answer: C

  1. Question 45Algorithmsmsq2 marks
    is a directed graph, a DFS spanning tree rooted at that is also a BFS tree rooted at . For every such , which statements is/are TRUE?
    • A.
      There are no back-edges in G wrt T
    • B.
      There are no cross-edges in G wrt T
    • C.
      There are no forward-edges in G wrt T
      ✓
    • D.
      The only edges in G are the edges in T

    Answer: C

    Solution

    Answer: (C) There are no forward-edges in G with respect to the tree T If one tree T is simultaneously a DFS tree and a BFS tree of a directed graph, it can have no forward edges: a forward edge (with a proper descendant more than one level below) would have been used by BFS to place directly one level under , contradicting the tree. Back edges and cross edges can still exist (e.g. when has a cycle), so (A) and (B) are not guaranteed; extra non-tree edges may exist, so (D) is false.

More GATE PYQ on Graph Algorithms

All GATE CS Algorithms PYQ →

Attempt GATE CS 2024 Set 1 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →