From 1058610a74bcdf501dde55d1128df52c566812b0 Mon Sep 17 00:00:00 2001 From: RaoulLuque Date: Sun, 7 Apr 2024 14:12:55 +0200 Subject: [PATCH] Added main function with basic usage of library --- src/main.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1ad679c..e208738 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,9 @@ mod algorithms; -use algorithms::find_maximum_cliques::find_maximum_cliques; +use algorithms::{ + construct_clique_graph::construct_clique_graph, fill_bags_along_paths::fill_bags_along_paths, + find_maximum_cliques::find_maximum_cliques, + find_width_of_tree_decomposition::find_width_of_tree_decomposition, +}; use petgraph::Graph; fn main() { @@ -28,5 +32,10 @@ fn main() { graph.add_edge(nodes[3], nodes[6], 0); graph.add_edge(nodes[4], nodes[6], 0); - let mut cliques: Vec> = find_maximum_cliques::, _>(&graph).collect(); + let cliques: Vec> = find_maximum_cliques::, _>(&graph).collect(); + let mut clique_graph = construct_clique_graph(cliques); + fill_bags_along_paths(&mut clique_graph); + let computed_treewidth = find_width_of_tree_decomposition(clique_graph); + + println!("The computed treewidth is: {}", computed_treewidth); }