SYNOPSIS

     use Data::Graph::Util qw(toposort is_cyclic is_acyclic);
    
     my @sorted = toposort(
         { a=>["b"], b=>["c", "d"], c=>[], d=>["c"] }, # graph
     ); # => ("a", "b", "d", "c")
    
     say is_cyclic ({a=>["b"]}); # => 0
     say is_acyclic({a=>["b"]}); # => 1
    
     say is_cyclic ({a=>["b"], b=>["c"], c=>["a"]}); # => 1
     say is_acyclic({a=>["b"], b=>["c"], c=>["a"]}); # => 0

DESCRIPTION

    Early release. More functions will be added later.

FUNCTIONS

    None are exported by default, but they are exportable.

 toposort(\%graph) => sorted list

 is_cyclic(\%graph) => bool

    Return true if graph contains at least one cycle.

 is_acyclic(\%graph) => bool

    Return true if graph is acyclic, i.e. contains no cycles.

SEE ALSO

    https://en.wikipedia.org/wiki/Graph_(abstract_data_type)

    Sort::Topological can also sort a DAG, but cannot handle cyclical
    graph.

