CBSE NET JUNE 2013 PAPER II
Cyclomatic complexity of a flow graph G with n vertices and e edges is
To solve above problem, first remember these 3 rules to compute the cyclomatic complexity.
1. The number of regions correspond to the cyclomatic complexity.
2. Cyclomatic complexity V(G) for a flow graph G, is defined as,
where E=Number of flow graph edges
N=Number of flow graph nodes
3.Cyclomatic complexity,V(G) for a flow graph G, is defined as,
where P=Number of predicate nodes contained in flow graph G.
Now come to the solution for above problem,
According to rule 2, the formula for Cyclomatic Complexity V(G)=E-N+2 where E is no of edges, N is no of vertices.