Acyclic graphs detection added.