Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

Cyclomatic Complexity of a graph calculations and examples


Cyclomatic Complexity of a graph calculations and examples

Number of edges :
Number of Nodes :


[insert_php] if(isset($_POST[“Enter”])){

$a=$_POST[“Number_of_edges”];
$b=$_POST[“Number_of_nodes”];
echo ‘

‘;
echo ‘

‘;
echo ‘
‘;
echo ‘

‘;
echo ‘
‘;
$c=($a-$b)+2;
echo ‘

‘; }
[/insert_php]

Number of edges you provided are‘.$a.’
Number of nodes you provided are‘.$b.’
Number of edges – number of nodes + 2Cyclomatic Complexity of that graph

Result: Cyclomatic complexity is :

‘.$c.’

Example 1

Number of edges 11

number of nodes 9

Cyclomatic Complexity=
11-9+2=4

Example 2

Number of edges 15

number of nodes 9

Cyclomatic Complexity
=
15-9+2=8