From be240011c5a202401506e29d95eb84be051ec43e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raoul=20Luqu=C3=A9?= Date: Fri, 10 May 2024 13:04:13 +0200 Subject: [PATCH] Updated Readme --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 13d6102..f2e828a 100644 --- a/README.md +++ b/README.md @@ -1 +1,30 @@ +# Treewidth Heuristic Using Clique Graphs + A library implementing a heuristic for computing an upper bound for the treewidth of arbitrary graphs using the clique graph operator for my bachelor thesis. + +## Usage + +This crate provides `compute_treewidth_upper_bound` and `compute_treewidth_upper_bound_not_connected` as functions. +They calculate upper bounds on the treewidth of connected and not connected undirected (pet)graphs respectively. + +```rust +use treewidth_heuristic::compute_treewidth_upper_bound; +use treewidth_heuristic::negative_intersection_heuristic; +use treewidth_heuristic::TreewidthComputationMethod::FillWhilstMST; + +use petgraph::graph::UnGraph; + +// Create an undirected graph +let graph = UnGraph::::from_edges(&[ + (1, 2), (2, 3), (3, 4), + (1, 4)]); + +// Compute treewidth using the negative intersection heuristic, the FillWhilstMST computation method +// and not checking the tree decomposition for correctness after the computation. +let treewidth_upper_bound = compute_treewidth_upper_bound( + &graph, + negative_intersection_heuristic, + FillWhilstMST, + false, +); +``` \ No newline at end of file