问题描述
Cyclomatic Complexity 是通过这个公式(从维基百科借来的)参考程序的控制流图来定义的:
M = E − N + 2P,where
E = the number of edges of the graph.
N = the number of nodes of the graph.
P = the number of connected components.
我无法理解最后一个。在这种情况下,“连接组件的数量”是多少?维基百科本身仅将 (connected) components 的概念用于无向图。
还有strongly connected component的概念:如果每个顶点都可以从其他每个顶点到达,则称有向图是强连通的。因此可以猜测连通分量的数量就是控制流图的强连通分量的数量。这样对吗?如果没有,有人可以提供具有不同连接组件数量的控制流图样本吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)