Exemplo n.º 1
0
 private void ifNotDagThrowException(Digraph g) {
   DirectedCycle cycle = new DirectedCycle(g);
   if (cycle.hasCycle() || !isOnlyOneRoot(g)) throw new IllegalArgumentException();
 }