Skip to content

UGC NET CS 2019Theory of Computation and Compilers › Code Generation and Code OptimizationVerified

UGC NET CS 2019 PYQ: A flow graph $F$ with entry node $(1)$ and exit node $(11)$ is shown below: How many regions are there in…

A flow graph $F$ with entry node $(1)$ and exit node $(11)$ is shown below:

UGC NET CS 2019 Code Generation and Code Optimization diagram: A flow graph $F$ with entry node $(1)$ and exit node $(11)$

How many regions are there in flowgraph $F$?

  1. A
    2
  2. B
    3
  3. C
    4
    Correct answer
  4. D
    5

Answer

(C) 4

Approach

Count the nodes and edges of the planar flow graph. The visible nodes are 1, the combined $(2,3)$, $(4,5)$, and 6,7,8,9,10,11, so $V=9$. The edges are $1\to(2,3)$, $(2,3)\to6$, $(2,3)\to(4,5)$, $6\to7$, $6\to8$, $7\to9$, $8\to9$, $9\to10$, $(4,5)\to10$, $10\to11$, and the back edge $10\to1$, giving $E=11$. For a connected planar graph, Euler's formula is $F=E-V+2$, so $F=11-9+2=4$. These four regions consist of three finite bounded regions plus the single outer (unbounded) region, which matches the standard region count for this flow graph. Therefore the correct option is (C) 4.

Reviewed by UGC IQ Editorial Team.