src/main/java/de/dfki/lt/loot/digraph/AbstractGraph.java
private void bfsVisit(int startVertex, GraphVisitor<EI> visitor,
                        BitSet visited, boolean converse) {

    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<EI> outEdge : getOutEdges(vertex)) {
        int target = converse ? outEdge.getSource() : 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. 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. 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 . The desired functionality can be implemented by the given GraphVisitor argument .
private void bfsVisit(int startVertex, GraphVisitor<EI> visitor,
                        BitSet visited, boolean converse) {
    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<EI> outEdge : getOutEdges(vertex)) {
        int target = converse ? outEdge.getSource() : 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 bfsVisit ( int startVertex , GraphVisitor < EI > visitor , BitSet visited , boolean converse ) { 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 < EI > outEdge : getOutEdges ( vertex ) ) { int target = converse ? outEdge . getSource ( ) : 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