public boolean containsCycle(){
  for (Iterator<EdgeType> i=graph.edgeIterator(); i.hasNext(); ) {
    EdgeType edge=i.next();
    if (getDFSEdgeType(edge) == BACK_EDGE) {
      return true;
    }
  }
  return false;
}

public boolean containsCycle ( ) { for ( Iterator < EdgeType > i = graph . edgeIterator ( ) ; i . hasNext ( ) ; ) { EdgeType edge = i . next ( ) ; if ( getDFSEdgeType ( edge ) == BACK_EDGE ) { return true ; } } return false ; }
return whether or not the graph contains a cycle : i . e . , whether it contains any back edges . this should only be called after search ( ) has been called ( since that method actually executes the search ) .
