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

Method new_multi

src/graph/directed/search.rs:18–28  ·  view source on GitHub ↗

find vertices in G that are reachable from sources

(graph: &dyn IGraph, sources: &[usize])

Source from the content-addressed store, hash-verified

16
17 /// find vertices in G that are reachable from sources
18 pub fn new_multi(graph: &dyn IGraph, sources: &[usize]) -> Self {
19 let mut dfs = Self {
20 marked: vec![false; graph.V()],
21 };
22 for &s in sources {
23 if !dfs.marked[s] {
24 dfs.dfs(graph, s);
25 }
26 }
27 dfs
28 }
29
30 /// is v reachable?
31 pub fn marked(&self, v: usize) -> bool {

Callers

nothing calls this directly

Calls 1

dfsMethod · 0.45

Tested by

no test coverage detected