# File lib/rgl/traversal.rb, line 312
312:     def depth_first_visit (u, vis = DFSVisitor.new(self), &b)
313:       vis.color_map[u] = :GRAY
314:       vis.handle_examine_vertex(u)
315:       each_adjacent(u) { |v|
316:         vis.handle_examine_edge(u, v)
317:         if vis.follow_edge?(u, v)            # (u,v) is a tree edge
318:           vis.handle_tree_edge(u, v)         # also discovers v
319:           vis.color_map[v] = :GRAY           # color of v was :WHITE
320:           depth_first_visit(v, vis, &b)
321:         else                                 # (u,v) is a non tree edge
322:           if vis.color_map[v] == :GRAY
323:             vis.handle_back_edge(u, v)       # (u,v) has gray target
324:           else
325:             vis.handle_forward_edge(u, v)    # (u,v) is a cross or forward edge 
326:           end
327:         end
328:       }
329:       vis.color_map[u] = :BLACK
330:       vis.handle_finish_vertex(u)           # finish vertex
331:       b.call(u)
332:     end