判断有向无环图(DAG)

1.拓扑排序

bfs 所有入度为0的先入选。

2.tarjan 1个点1个集合

3.暴力

一个点不能重新到达自己

原文地址:https://www.cnblogs.com/cmyg/p/11147397.html