src/main/java/de/dfki/lt/loot/digraph/AbstractGraph.java
private void dfsVisit(int vertex,
                        GraphVisitor<EI> visitor,
                        BitSet visited,
                        boolean converse) {
    visited.set(vertex);  // vertex gets gray
    visitor.discoverVertex(vertex, this);

    for (Edge<EI> edge : getOutEdges(vertex)) {
      int target = converse ? edge.getSource() : edge.getTarget();
      // is the target vertex white?
      if (! visited.get(target)) {
        visitor.treeEdge(edge, this);
        dfsVisit(target, visitor, visited, converse);
      } else {
        visitor.nonTreeEdge(edge, this);
      }
    }
    // vertex gets black
    visitor.finishVertex(vertex, this);
  }
/** Recursive helper function for the dfs methods.
   *  @param vertex the current vertex to visit
   *  @param visitor a {@link GraphVisitor}, to be called appropriately
   *  @param visited a BitSet indicating if the vertex is visited for the first
   *      time
   *  @param converse if true, the dfs runs on a lazy converse of a
   *      {@link Graph}, which means that the edge direction is inverse,
   *      i.e., getSource() returns the target node, getTarget() the source
   */
Recursive helper function for the dfs methods.
@param vertex the current vertex to visit
@param visitor a  GraphVisitor, to be called appropriately
@param visited a BitSet indicating if the vertex is visited for the first
time
@param converse if true, the dfs runs on a lazy converse of a
Graph, which means that the edge direction is inverse,
i.e., getSource() returns the target node, getTarget() the source
Recursive helper function for the dfs methods . @param vertex the current vertex to visit @param visitor a GraphVisitor to be called appropriately @param visited a BitSet indicating if the vertex is visited for the first time @param converse if true the dfs runs on a lazy converse of a Graph which means that the edge direction is inverse i . e . getSource () returns the target node getTarget () the source
private void dfsVisit(int vertex,
                        GraphVisitor<EI> visitor,
                        BitSet visited,
                        boolean converse) {
    visited.set(vertex);  
    visitor.discoverVertex(vertex, this);
    for (Edge<EI> edge : getOutEdges(vertex)) {
      int target = converse ? edge.getSource() : edge.getTarget();
      if (! visited.get(target)) {
        visitor.treeEdge(edge, this);
        dfsVisit(target, visitor, visited, converse);
      } else {
        visitor.nonTreeEdge(edge, this);
      }
    }
    visitor.finishVertex(vertex, this);
  }
private void dfsVisit ( int vertex , GraphVisitor < EI > visitor , BitSet visited , boolean converse ) { visited . set ( vertex ) ; visitor . discoverVertex ( vertex , this ) ; for ( Edge < EI > edge : getOutEdges ( vertex ) ) { int target = converse ? edge . getSource ( ) : edge . getTarget ( ) ; if ( ! visited . get ( target ) ) { visitor . treeEdge ( edge , this ) ; dfsVisit ( target , visitor , visited , converse ) ; } else { visitor . nonTreeEdge ( edge , this ) ; } } visitor . finishVertex ( vertex , this ) ; }
Recursive helper function for the dfs methods.
Recursive helper function for the dfs methods .
// vertex gets gray // is the target vertex white? // vertex gets black