1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! goatd — Greatest Of All Tree Decompositions: tree decompositions of graphs.
//!
//! A [`Graph`] goes in and a [`TreeDecomposition`] comes out.
//!
//! [`elimination`] provides min-fill, min-degree, and nested-dissection orders.
//! [`flowcutter`] provides the vendored FlowCutter decomposer and a Rust
//! separator search. [`portfolio`] combines constructions, and
//! [`decomposition`] contains the result type and its separator-based
//! refinement. [`partition`] exposes
//! the multilevel graph and hypergraph bisectors used by those constructions.
//!
//! [`Graph::from_gr`] and [`TreeDecomposition::to_td`] handle the PACE formats.
//! [`TreeDecomposition::validate`] checks a result against its graph. The
//! library is single-threaded. [`meter::arm`] makes duration budgets advance by
//! charged graph work instead of wall time when repeatable stopping points are
//! needed.
//!
//! ```
//! use goatd::Graph;
//! use goatd::elimination::{Order, decompose};
//!
//! // The 4-cycle with one chord: treewidth 2.
//! let graph = Graph::new(4, [(0, 1), (1, 2), (2, 3), (3, 0), (0, 2)]);
//! let td = decompose(&graph, Order::MinFill, 0, None)?;
//! assert_eq!(td.treewidth(), 2);
//!
//! let text = td.to_td();
//! assert!(text.starts_with("s td "));
//! # Ok::<(), goatd::Error>(())
//! ```
pub use ;
pub use Error;
pub use Graph;