pub struct StrongConnectivity { /* private fields */ }Expand description
The strong bridges and strong articulation points of a graph, as
components::strong_connectivity_of returns them.
A strong bridge is an edge whose removal increases the number of SCCs (strongly connected components), and a strong articulation point is a node whose removal does the same. Strong bridges lie inside SCCs of two or more nodes. Strong articulation points lie inside SCCs of three or more nodes, since without one node of an SCC of two, the other still forms an SCC. So a graph without cycles has neither, and a self-loop is never a strong bridge.
The edges are followed in their direction, as by
components::sccs_of: the edges a -> b and b -> a are two
edges, and both are strong bridges of the SCC they form.
Biconnectivity has the counterparts for a graph read as undirected.
Here, in the control flow of the method load, the loop splits into several SCCs without
header, body or next, but not without then:
let strong = components::strong_connectivity_of(&BiAdjacentGraph::of(&cfg));
let strong_bridges = strong.strong_bridges();
// strong_bridges: header -> body, body -> then, then -> next, next -> header
let strong_articulation_points = strong.strong_articulation_points();
// strong_articulation_points: [1, 2, 4] - header, body and nextInstances are immutable and safe to share between threads (Send and Sync).
Memory: up to 28 x node_count bytes.
Implementations§
Source§impl StrongConnectivity
impl StrongConnectivity
Sourcepub fn strong_bridges(&self) -> &Edges
pub fn strong_bridges(&self) -> &Edges
Returns the strong bridges, in edge index order.
Time: O(1).
Sourcepub fn strong_articulation_points(&self) -> SortedIntView<'_>
pub fn strong_articulation_points(&self) -> SortedIntView<'_>
Returns the strong articulation points, in ascending order.
Time: O(1).
Trait Implementations§
Source§impl Clone for StrongConnectivity
impl Clone for StrongConnectivity
Source§fn clone(&self) -> StrongConnectivity
fn clone(&self) -> StrongConnectivity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more