Cyclic or Acyclic?

Testing whether a graph is acyclic

To test a graph for being acyclic:

  1. If the graph has no nodes, stop. The graph is acyclic.
  2. If the graph has no leaf, stop. The graph is cyclic.
  3. Choose a leaf of the graph. Remove this leaf and all arcs going into the leaf to get a new graph.
  4. Go to 1.
        acyclic         cyclic

Source