We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 42aadfb commit d78cdafCopy full SHA for d78cdaf
src/scc.rs
@@ -1 +1,25 @@
1
+use crate::internal_scc;
2
+
3
+pub struct SccGraph {
4
+ internal: internal_scc::SccGraph,
5
+}
6
7
+impl SccGraph {
8
+ pub fn new(n: usize) -> Self {
9
+ SccGraph {
10
+ internal: internal_scc::SccGraph::new(n),
11
+ }
12
13
14
+ pub fn add_edge(&mut self, from: usize, to: usize) {
15
+ let n = self.internal.num_vertices();
16
+ assert!(from < n);
17
+ assert!(to < n);
18
+ self.internal.add_edge(from, to);
19
20
21
+ pub fn scc(&self) -> Vec<Vec<usize>> {
22
+ self.internal.scc()
23
24
25
0 commit comments