private void discoverBackEdges(DiGraphNode<N, E> u) {
   u.setAnnotation(GRAY);
   for (DiGraphEdge<N, E> e : u.getOutEdges()) {
     if (ignoreEdge(e)) {
       continue;
     }
     DiGraphNode<N, E> v = e.getDestination();
     if (v.getAnnotation() == WHITE) {
       discoverBackEdges(v);
     } else if (v.getAnnotation() == GRAY) {
       e.setAnnotation(BACK_EDGE);
     }
   }
   u.setAnnotation(BLACK);
 }