private void classifyUnknownEdges ( ) { Iterator < EdgeType > edgeIter = graph . edgeIterator ( ) ; while ( edgeIter . hasNext ( ) ) { EdgeType edge = edgeIter . next ( ) ; int dfsEdgeType = getDFSEdgeType ( edge ) ; if ( dfsEdgeType == UNKNOWN_EDGE ) { int srcDiscoveryTime = getDiscoveryTime ( getSource ( edge ) ) ; int destDiscoveryTime = getDiscoveryTime ( getTarget ( edge ) ) ; if ( srcDiscoveryTime < destDiscoveryTime ) { // If the source was visited earlier than the // target, it's a forward edge. dfsEdgeType = FORWARD_EDGE ; } else { // If the source was visited later than the // target, it's a cross edge. dfsEdgeType = CROSS_EDGE ; } setDFSEdgeType ( edge , dfsEdgeType ) ; } } }
Classify CROSS and FORWARD edges