MCPcopy Create free account
hub / github.com/douchuan/algorithm / new_single

Method new_single

src/graph/directed/search.rs:9–15  ·  view source on GitHub ↗

find vertices in G that are reachable from s

(graph: &dyn IGraph, s: usize)

Source from the content-addressed store, hash-verified

7impl DirectedDFS {
8 /// find vertices in G that are reachable from s
9 pub fn new_single(graph: &dyn IGraph, s: usize) -> Self {
10 let mut dfs = Self {
11 marked: vec![false; graph.V()],
12 };
13 dfs.dfs(graph, s);
14 dfs
15 }
16
17 /// find vertices in G that are reachable from sources
18 pub fn new_multi(graph: &dyn IGraph, sources: &[usize]) -> Self {

Callers

nothing calls this directly

Calls 1

dfsMethod · 0.45

Tested by

no test coverage detected