Content deleted Content added
Fixed the link |
I changed the final equation in the description of the second figure, from 10-8+1=3, to 10-8+2=4, because, it says that it's using equation [3], but equation [3] say that the formula has a +2, not a +1, so the result changes. |
||
Line 25:
:''P'' = the number of [[connected component (graph theory)|connected components]].
[[Image:control flow graph of function with loop and an if statement.svg|thumb|250px|The same function as above, represented using the alternative formulation, where each exit point is connected back to the entry point. This graph has 10 edges, 8 nodes, and 1 [[connected component (graph theory)|connected component]], which also results in a cyclomatic complexity of 3 using the alternative formulation (10 - 8 +
An alternative formulation is to use a graph in which each exit point is connected back to the entry point. In this case, the graph is [[strongly connected]], and the cyclomatic complexity of the program is equal to the [[cyclomatic number]] of its graph (also known as the [[Betti number#Example 2: the first Betti number in graph theory|first Betti number]]), which is defined as<ref name="mccabe76" />
|