Skip to main content

StrongConnectivity

Struct StrongConnectivity 

Source
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 next

Instances are immutable and safe to share between threads (Send and Sync).

Memory: up to 28 x node_count bytes.

Implementations§

Source§

impl StrongConnectivity

Source

pub fn strong_bridges(&self) -> &Edges

Returns the strong bridges, in edge index order.

Time: O(1).

Source

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

Source§

fn clone(&self) -> StrongConnectivity

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StrongConnectivity

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.