Subject: | Method to see whether graph has any cycles |
It would be useful to have a method
$G->has_any_cycle()
Returns true if $G has any cycle (a path starting with some node N and leading back to N). This is meaningful only for directed graphs.