src/main/java/de/dfki/lt/loot/digraph/DirectedBiGraph.java
private void bfsVisitInverse(int startVertex, GraphVisitor<EdgeInfo> visitor,
                        BitSet visited) {

    Queue<Integer> active = new LinkedList<Integer>();
    active.offer(startVertex);
    visited.set(startVertex);  // vertex gets gray
    visitor.discoverVertex(startVertex, this);
    while (active.peek() != null) {
      int vertex = active.poll();
      for (Edge<EdgeInfo> outEdge : getInEdges(vertex)) {
        int target = outEdge.getTarget();
        if (! visited.get(target)) {
          active.offer(target);
          visited.set(target);  // vertex gets gray
          visitor.discoverVertex(target, this);
          visitor.treeEdge(outEdge, this);
        } else {
          visitor.nonTreeEdge(outEdge, this);
        }
      }
      // vertex gets black
      visitor.finishVertex(vertex, this);
    }
  }
/** Private helper function for the bfs variants
   *
   *  Visit all vertices of this graph in a breadth first manner. The vertex
   *  list is traversed in order, and every non-visited vertex is then put onto
   *  a queue, consecutively. This bfs works on the inverse of the graph,
   *  i.e., it uses the incoming instead of the outgoing edges.
   *  The desired functionality can be implemented by the given
   *  {@link GraphVisitor} argument.
   */
Private helper function for the bfs variants
Visit all vertices of this graph in a breadth first manner. The vertex
list is traversed in order, and every non-visited vertex is then put onto
a queue, consecutively. This bfs works on the inverse of the graph,
i.e., it uses the incoming instead of the outgoing edges.
The desired functionality can be implemented by the given
GraphVisitor argument.
Private helper function for the bfs variants Visit all vertices of this graph in a breadth first manner . The vertex list is traversed in order and every non - visited vertex is then put onto a queue consecutively . This bfs works on the inverse of the graph i . e . it uses the incoming instead of the outgoing edges . The desired functionality can be implemented by the given GraphVisitor argument .
private void bfsVisitInverse(int startVertex, GraphVisitor<EdgeInfo> visitor,
                        BitSet visited) {
    Queue<Integer> active = new LinkedList<Integer>();
    active.offer(startVertex);
    visited.set(startVertex);  
    visitor.discoverVertex(startVertex, this);
    while (active.peek() != null) {
      int vertex = active.poll();
      for (Edge<EdgeInfo> outEdge : getInEdges(vertex)) {
        int target = outEdge.getTarget();
        if (! visited.get(target)) {
          active.offer(target);
          visited.set(target);  
          visitor.discoverVertex(target, this);
          visitor.treeEdge(outEdge, this);
        } else {
          visitor.nonTreeEdge(outEdge, this);
        }
      }
      visitor.finishVertex(vertex, this);
    }
  }
private void bfsVisitInverse ( int startVertex , GraphVisitor < EdgeInfo > visitor , BitSet visited ) { Queue < Integer > active = new LinkedList < Integer > ( ) ; active . offer ( startVertex ) ; visited . set ( startVertex ) ; visitor . discoverVertex ( startVertex , this ) ; while ( active . peek ( ) != null ) { int vertex = active . poll ( ) ; for ( Edge < EdgeInfo > outEdge : getInEdges ( vertex ) ) { int target = outEdge . getTarget ( ) ; if ( ! visited . get ( target ) ) { active . offer ( target ) ; visited . set ( target ) ; visitor . discoverVertex ( target , this ) ; visitor . treeEdge ( outEdge , this ) ; } else { visitor . nonTreeEdge ( outEdge , this ) ; } } visitor . finishVertex ( vertex , this ) ; } }
Private helper function for the bfs variants
  Visit all vertices of this graph in a breadth first manner.
Private helper function for the bfs variants Visit all vertices of this graph in a breadth first manner .
// vertex gets gray // vertex gets gray // vertex gets black