我怎么知道该开关程序的真正圈复杂度?

我一直在做一个练习的测试程序,然后出现下一个问题。 人们总是说有两种方法可以求出圈复杂度:

1. V(G) = E - N + 2
2. V (G) = P + 1

E - Number of edges
N - Number of Nodes
P = Number of predicate nodes (node that contains condition)

我为该程序制作了以下流程图。

Flow network of the program carried out

但是,如果我应用公式,每个公式都会给我带来不同的结果:

E = There are 30 edges
N = There are 23 nodes
P = There are 6 predicate nodes(1,6,7,8,9,16)

1. V(G) = E - N + 2 = 30 - 23 + 2 = 9
2. V (G) = P + 1 = 6 + 1 = 7

怎么可能?

haoqiwei123 回答:我怎么知道该开关程序的真正圈复杂度?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2961019.html

大家都在问