is_two_edge_connected

Function is_two_edge_connected 

Source
pub fn is_two_edge_connected<G>(graph: &G) -> bool
where G: Graph<Weight = f64>,
Expand description

Returns true if the graph has no bridges (is 2-edge-connected).

ยงExamples

use graph_core::{AdjacencyList, Graph};
use graph_spanning::bridges::is_two_edge_connected;

// Complete graph K4 has no bridges.
let mut g: AdjacencyList<()> = AdjacencyList::undirected();
let n: Vec<_> = (0..4).map(|_| g.add_node(())).collect();
for i in 0..4 {
    for j in i+1..4 {
        g.add_edge(n[i], n[j], 1.0).unwrap();
    }
}
assert!(is_two_edge_connected(&g));