我如何检查是否有向图是无环?图是无环

2023-09-11 01:48:24 作者:苦渡众生

我如何检查是否有向图是无环?而且怎么叫算法?我想AP preciate一个参考。

How do I check if a directed graph is acyclic? And how is the algorithm called? I would appreciate a reference.

推荐答案

我会尝试排序拓扑,如果​​你不能,那么它有个周期。

I would try to sort the graph topologically, and if you can't, then it has cycles.

相关推荐
 
精彩推荐
图片推荐