Expand description
Graph containers, formatters, and random graph/tree generators. Graph containers and random graph generators.
This module covers both representation and construction. You can build graphs manually, generate structured families such as trees or DAGs, inspect adjacency representations, and merge or relabel existing graphs.
§Example
use hpdg::graph::Graph;
let graph = Graph::chain(5, None, false, None);
assert_eq!(graph.node_count(), 5);
assert_eq!(graph.edge_count(), 4);§Display-Oriented Output
Many graph utilities in this module can be inspected directly as text:
crate::graph::Edgeandcrate::graph::Graphimplementstd::fmt::Display.crate::graph::Graph::to_stringandcrate::graph::Graph::to_string_withproduce edge-list text.crate::graph::Graph::to_adj_list_stringproduces adjacency-list text.crate::graph::GraphMatriximplementsstd::fmt::Displayfor matrix output.crate::graph::Merger::to_stringrenders merged graph views directly.
Structs§
- Edge
- Graph edge with an optional integral weight.
- Graph
- Adjacency-list graph container used by most graph APIs in the crate.
- Graph
GenOptions - Options shared by some graph-generation helpers.
- Graph
Matrix - Dense adjacency-matrix helper.
- Graph
Stats - Summary statistics for a
Graph. - Merger
- Merge multiple graphs into one graph view.
- Switch
Graph - A switchable multigraph to perform edge-switch operations.
Enums§
- Degree
Sequence - Degree-sequence input accepted by
Graph::from_degree_sequence.