| Crates.io | biconnected-components |
| lib.rs | biconnected-components |
| version | 0.4.0 |
| created_at | 2023-07-20 09:25:35.04192+00 |
| updated_at | 2025-02-28 09:27:01.630445+00 |
| description | Find biconnected components in a graph |
| homepage | |
| repository | https://github.com/a-maier/biconnected-components |
| max_upload_size | |
| id | 921170 |
| size | 14,600 |
Compute the biconnected components of a graph.
use petgraph::graph::UnGraph;
use biconnected_components::Bcc;
// construct a simple graph
let g = UnGraph::<(), ()>::from_edges([
(0, 1),
(1, 2)
]);
// Get a vector of the biconnected components defined by their node indices
let bcc = g.bcc();
assert_eq!(bcc.len(), 2);
for bcc_nodes in bcc {
println!("Found biconnected component with nodes {bcc_nodes:?}");
}
License: MIT OR Apache-2.0