UGC-NET Jun 2013 · Introduction to Graph Theory

MCQ · 2 marks · Problem PROG-GRPH-0015

Cyclometric complexity of a flow graph G with n vertices and e edges is
  1. A
    V(G) = e+n-2
  2. B
    V(G) = e-n+2
  3. C
    V(G) = e+n+2
  4. D
    V(G) = e-n-2

Solve it on GATE DA practice →More Graph Theory & Algorithms problems

Show the worked solution\[\boxed{V(G)=e-n+2}\]McCabe's cyclomatic complexity of a connected flow graph with \(e\) edges and \(n\) nodes counts the independent paths. Equivalently, \(V(G)\) equals the number of decision nodes plus 1, or the number of regions of the planar flow graph. Check with a single if-else: 4 nodes, 4 edges, \(V=4-4+2=2\) paths.Answer: B

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com