pub(crate) fn new<G>(graph: G, initials: impl IntoIterator<Item = N>) -> Self
    where
        G: Visitable<Map = VM> + IntoEdges<NodeId = N, EdgeId = E>,
    {
        let mut discovered = graph.visit_map();
        let stack = initials
            .into_iter()
            .filter_map(|node_ix| {
                // This check ensures that if a node is repeated in initials, its edges are only
                // added once.
                if discovered.visit(node_ix) {
                    Some(graph.edges(node_ix).map(edge_triple))
                } else {
                    None
                }
            })
            .flatten()
            .collect();
        Self { stack, discovered }
    }
Creates a new EdgeDfs, using the graph's visitor map, and puts all edges out of `initials`
in the queue of edges to visit.
guppy/src/petgraph_support/walk.rs