code: func (d *VisitingDepthFirst) Walk(g VisitableGraph, from graph.Node, until func(graph.Node) bool) graph.Node {
  	if d.visited == nil {
  		d.visited = &intsets.Sparse{}
  	}
  	d.stack.Push(from)
  	d.visited.Insert(from.ID())
  	if until != nil && until(from) {
  		return from
  	}
  
  	var found graph.Node
  	for d.stack.Len() > 0 {
  		t := d.stack.Pop()
  		g.VisitFrom(t, func(n graph.Node) (shouldContinue bool) {
  			if d.EdgeFilter != nil && !d.EdgeFilter(g.Edge(t, n)) {
  				return true
  			}
  			if d.visited.Has(n.ID()) {
  				return true
  			}
  			if d.Visit != nil {
  				d.Visit(t, n)
  			}
  			d.visited.Insert(n.ID())
  			d.stack.Push(n)
  			if until != nil && until(n) {
  				found = n
  				return false
  			}
  			return true
  		})
  		if found != nil {
  			return found
  		}
  	}
  	return nil
  }
docs: // Walk performs a depth-first traversal of the graph g starting from the given node,
  // depending on the EdgeFilter field and the until parameter if they are non-nil. The
  // traversal follows edges for which EdgeFilter(edge) is true and returns the first node
  // for which until(node) is true. During the traversal, if the Visit field is non-nil, it
  // is called with the nodes joined by each followed edge.