@@ -22,12 +22,9 @@ mod tests;
2222/// An annotation for an SCC. This can be a representative,
2323/// the max/min element of the SCC, or all of the above.
2424///
25- /// Concretely, the following properties must hold (where `merge`
26- /// is `merge_scc` and `merge_reached`):
27- /// - idempotency: `a.merge(a) = a`
28- /// - commutativity: `a.merge(b) = b.merge(a)`
25+ /// Concretely, the both merge operations must commute, e.g. where `merge`
26+ /// is `merge_scc` and `merge_reached`: `a.merge(b) == b.merge(a)`
2927///
30- /// This is rather limiting and precludes, for example, counting.
3128/// In general, what you want is probably always min/max according
3229/// to some ordering, potentially with side constraints (min x such
3330/// that P holds).
@@ -62,7 +59,7 @@ impl Annotation for () {
6259/// the index type for the graph nodes and `S` is the index type for
6360/// the SCCs. We can map from each node to the SCC that it
6461/// participates in, and we also have the successors of each SCC.
65- pub struct Sccs < N : Idx , S : Idx , A : Annotation > {
62+ pub struct Sccs < N : Idx , S : Idx , A : Annotation = ( ) > {
6663 /// For each node, what is the SCC index of the SCC to which it
6764 /// belongs.
6865 scc_indices : IndexVec < N , S > ,
@@ -314,8 +311,7 @@ where
314311 /// D' (i.e., D' < D), we know that N, N', and all nodes in
315312 /// between them on the stack are part of an SCC.
316313 ///
317- /// Additionally, we keep track of a representative annotation of the
318- /// SCC.
314+ /// Additionally, we keep track of a current annotation of the SCC.
319315 ///
320316 /// [wikipedia]: https://bit.ly/2EZIx84
321317 fn construct ( graph : & ' c G , to_annotation : F ) -> Sccs < G :: Node , S , A > {
0 commit comments