python - 检测循环有向图中的多个循环

标签 python graph-theory cycle directed-graph

我有一个有向循环图,其中包含多个循环,我需要一种方法来检测(并列出)有向图中存在的每个循环。

该图可以在这里看到:http://img412.imageshack.us/img412/3327/schematic.gif

这是为了调试我的 python 脚本而放在一起的虚拟图。它包含循环:

[n13,n14],[n6,n8,n15,n16,n7],[n6,n8,n9,n7]

算法必须检测有向图中的每个循环,而不仅仅是最小的循环或它遇到的第一个循环。

最佳答案

您并没有真正指定如何表示有向图,但您可以查看 Neopythonic:Detecting Cycles in directed graph .

关于python - 检测循环有向图中的多个循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3349508/

相关文章:

python - 用逗号打印unicode

python - TypeError - 这个错误是什么意思?

python - 检测数字序列中的重复循环(python)

python - 如何将图(NetworkX)节点的属性输出到数据帧(Pandas)中

algorithm - 检查两个数组是否是循环排列

javascript - 在响应式 slider 中设置高度(jQuery Cycle)

python - 在 pytables 中优化复杂的 table.where() 查询?

python - 计算 numpy 矩阵中 true 的周围(python)

algorithm - 图论 : Calculating Clustering Coefficient

c++ - 所有对最短路径