Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which one of the following statements is incorrect ?

  • A.The number of regions corresponds to the cyclomatic complexity.
  • B.Cyclometric complexity for a flow graph G is V(G) = N - E + 2, where E is the number of edges and N is the number of nodes in the flow graph.
  • C.Cyclometric complexity for a flow graph G is V(G) = E - N + 2, where E is the number of edges & N is the number of nodes in the flow graph.
  • D.Cyclometric complexity for a flow graph G is V(G) = P + 1, where P is the number of predicate nodes contained in the flow graph G.

Answer: B

For a flow graph, cyclomatic complexity is V(G) = E - N + 2, with E the number of edges and N the number of nodes. It is also P + 1, with P the number of predicate nodes, and it equals the number of regions of the graph. So statements (A), (C) and (D) are correct. Statement (B) gives V(G) = N - E + 2, with the terms reversed, which would be negative for most graphs, so it is the incorrect statement. The answer is option (B).

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.