Skip to content

Commit

Permalink
Updated visibility of modules to outside modules
Browse files Browse the repository at this point in the history
  • Loading branch information
RaoulLuque committed Jul 3, 2024
1 parent 21b4d4b commit dfb3160
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
5 changes: 4 additions & 1 deletion src/compute_treewidth_upper_bound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ use std::{
fmt::Debug,
hash::BuildHasher,
};
use petgraph::{graph::NodeIndex, Graph, Undirected};

use crate::*;
use petgraph::{graph::NodeIndex, Graph, Undirected};
use construct_clique_graph::*;
use fill_bags_along_paths::*;
use find_width_of_tree_decomposition::find_width_of_tree_decomposition;

/// Different methods for computing the spanning tree of the clique graph that is used as the base
/// of the tree decomposition.
Expand Down
18 changes: 12 additions & 6 deletions src/fill_bags_while_generating_mst.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use log::trace;
use petgraph::{graph::NodeIndex, Graph, Undirected};
use std::{
collections::{HashMap, HashSet},
hash::BuildHasher,
};

use log::trace;
use petgraph::{graph::NodeIndex, Graph, Undirected};

/// The function computes a [tree decomposition][https://en.wikipedia.org/wiki/Tree_decomposition]
/// with the vertices having bags (HashSets) as labels
/// given a clique graph. For this a minimum spanning tree of the clique graph is constructed using
Expand Down Expand Up @@ -57,8 +56,15 @@ pub fn fill_bags_while_generating_mst<N, E, O: Ord, S: Default + BuildHasher + C
);
}

if current_treewidth != crate::find_width_of_tree_decomposition(&result_graph) {
current_treewidth = crate::find_width_of_tree_decomposition(&result_graph);
if current_treewidth
!= crate::find_width_of_tree_decomposition::find_width_of_tree_decomposition(
&result_graph,
)
{
current_treewidth =
crate::find_width_of_tree_decomposition::find_width_of_tree_decomposition(
&result_graph,
);
// DEBUG
// println!("Max bagsize increased to: {}", current_treewidth + 1);
}
Expand Down Expand Up @@ -636,6 +642,6 @@ fn find_vertex_that_minimizes_bag_size<O: Ord + Default + Clone, S: BuildHasher
);

// Find treewidth (biggest bag size) of
crate::find_width_of_tree_decomposition(&result_graph)
crate::find_width_of_tree_decomposition::find_width_of_tree_decomposition(&result_graph)
}).expect("There should be interesting vertices since there are vertices left and the graph is connected")
}
11 changes: 3 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
mod check_tree_decomposition;
mod clique_graph_edge_weight_functions;
mod compute_treewidth_upper_bound;
mod construct_clique_graph;
mod fill_bags_along_paths;
pub mod construct_clique_graph;
pub mod fill_bags_along_paths;
mod fill_bags_while_generating_mst;
mod find_connected_components;
mod find_maximum_cliques;
mod find_width_of_tree_decomposition;
pub mod find_width_of_tree_decomposition;
mod generate_partial_k_tree;
mod maximum_minimum_degree_heuristic;

Expand All @@ -17,17 +17,12 @@ pub use compute_treewidth_upper_bound::{
compute_treewidth_upper_bound, compute_treewidth_upper_bound_not_connected,
SpanningTreeConstructionMethod,
};
pub(crate) use construct_clique_graph::{construct_clique_graph, construct_clique_graph_with_bags};
pub(crate) use fill_bags_along_paths::{
fill_bags_along_paths, fill_bags_along_paths_using_structure,
};
pub(crate) use fill_bags_while_generating_mst::{
fill_bags_while_generating_mst, fill_bags_while_generating_mst_least_bag_size,
fill_bags_while_generating_mst_update_edges, fill_bags_while_generating_mst_using_tree,
};
pub(crate) use find_connected_components::find_connected_components;
pub(crate) use find_maximum_cliques::{find_maximal_cliques, find_maximum_cliques_bounded};
pub(crate) use find_width_of_tree_decomposition::find_width_of_tree_decomposition;
pub use generate_partial_k_tree::{
generate_k_tree, generate_partial_k_tree, generate_partial_k_tree_with_guaranteed_treewidth,
};
Expand Down

0 comments on commit dfb3160

Please sign in to comment.