Testing whether a graph is acyclic
To test a graph for being acyclic:
- If the graph has no nodes, stop. The graph is acyclic.
- If the graph has no leaf, stop. The graph is cyclic.
- Choose a leaf of the graph. Remove this leaf and all arcs going into the leaf to get a new graph.
- Go to 1.
Comments