0

McCabe's cyclomatic complexity measure is computed as follows:

V = e - n + 2

where e = number of edges; n = number of nodes

Why 2 is added to (e-n) in order to obtain the result?

1 Answers1

1

It seems to be similar to Euler's formula for planar graphs, and since I'm no fan of McCabe, I suppose they use it to seem more science-y.

I say similar because I don't see how, in the question, if 'n' is the number of nodes, why that would be different from the number of vertices.

J.Backus
  • 1,441
  • 1
  • 6
  • 6