diff --git a/.gitignore b/.gitignore index 9c2e769..bb5449d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /dimacs_benchmarks/benchmark_results /k_tree_benchmarks/benchmark_results k_tree_benchmarks/benchmark_results/k_tree_results.txt +/.vscode \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 41bfd20..2f78d90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -87,7 +87,7 @@ dependencies = [ [[package]] name = "dimacs_petgraph_parser" version = "0.1.0" -source = "git+https://github.com/RaoulLuque/dimacs-petgraph-parser#3747698d544f07f8b0dc180e3059e8a369a09e21" +source = "git+https://github.com/RaoulLuque/dimacs-petgraph-parser#af3dc3d242b6ad571e52e2a42ea6aa8407342832" dependencies = [ "itertools", "petgraph", @@ -136,9 +136,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -213,9 +213,9 @@ checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", "indexmap", @@ -229,9 +229,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ "unicode-ident", ] @@ -311,18 +311,18 @@ source = "git+https://github.com/rust-lang/rustc-hash#e155548d4bc95fb98e214506d7 [[package]] name = "serde" -version = "1.0.200" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f" +checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.200" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb" +checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", @@ -331,9 +331,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" dependencies = [ "proc-macro2", "quote", diff --git a/dimacs_benchmarks/src/main.rs b/dimacs_benchmarks/src/main.rs index 33fd398..9d42e89 100644 --- a/dimacs_benchmarks/src/main.rs +++ b/dimacs_benchmarks/src/main.rs @@ -38,8 +38,12 @@ fn main() { let graph_file = File::open(graph_path.path()) .expect("Graph file should exist and be readable"); - let graph: Graph = - read_graph(graph_file).expect("Graph should be in correct format"); + let (graph, _, _, _): ( + Graph, + _, + _, + _, + ) = read_graph(graph_file).expect("Graph should be in correct format"); // DEBUG // { diff --git a/dimacs_graphs/color/fpsol2.i.1.col b/dimacs_graphs/color/fpsol2.i.1.col index cb5415b..8269b55 100644 --- a/dimacs_graphs/color/fpsol2.i.1.col +++ b/dimacs_graphs/color/fpsol2.i.1.col @@ -6,6 +6,7 @@ c DESCRIPTION: Coloring problem generated from a register allocation c problem based on real code. c c graph #1 from register allocation file - +u 66 p edge 496 11654 e 1 2 e 1 3 diff --git a/dimacs_graphs/color/fpsol2.i.2.col b/dimacs_graphs/color/fpsol2.i.2.col index 9203710..b096b9f 100644 --- a/dimacs_graphs/color/fpsol2.i.2.col +++ b/dimacs_graphs/color/fpsol2.i.2.col @@ -6,6 +6,7 @@ c DESCRIPTION: Coloring problem generated from a register allocation c problem based on real code. c c graph #2 from register allocation file - +u 31 p edge 451 8691 e 1 2 e 1 3 diff --git a/dimacs_graphs/color/fpsol2.i.3.col b/dimacs_graphs/color/fpsol2.i.3.col index 04699ff..ad0e8a5 100644 --- a/dimacs_graphs/color/fpsol2.i.3.col +++ b/dimacs_graphs/color/fpsol2.i.3.col @@ -6,6 +6,7 @@ c DESCRIPTION: Coloring problem generated from a register allocation c problem based on real code. c c graph #3 from register allocation file - +u 31 p edge 425 8688 e 1 2 e 1 3 diff --git a/dimacs_graphs/color/inithx.i.1.col b/dimacs_graphs/color/inithx.i.1.col index 9dd4a66..8010194 100644 --- a/dimacs_graphs/color/inithx.i.1.col +++ b/dimacs_graphs/color/inithx.i.1.col @@ -6,6 +6,7 @@ c DESCRIPTION: Coloring problem generated from a register allocation c problem based on real code. c c graph #1 from register allocation file inithx.i +u 56 p edge 864 18707 e 1 2 e 1 3 diff --git a/dimacs_graphs/color/inithx.i.2.col b/dimacs_graphs/color/inithx.i.2.col index 824fbaa..69577ac 100644 --- a/dimacs_graphs/color/inithx.i.2.col +++ b/dimacs_graphs/color/inithx.i.2.col @@ -6,6 +6,7 @@ c DESCRIPTION: Coloring problem generated from a register allocation c problem based on real code. c c graph #2 from register allocation file inithx.i +u 31 p edge 645 13979 e 1 2 e 1 3 diff --git a/dimacs_graphs/color/inithx.i.3.col b/dimacs_graphs/color/inithx.i.3.col index 7bc429b..9783b15 100644 --- a/dimacs_graphs/color/inithx.i.3.col +++ b/dimacs_graphs/color/inithx.i.3.col @@ -6,6 +6,7 @@ c DESCRIPTION: Coloring problem generated from a register allocation c problem based on real code. c c graph #3 from register allocation file inithx.i +u 31 p edge 621 13969 e 1 2 e 1 3 diff --git a/dimacs_graphs/color/le450_15b.col b/dimacs_graphs/color/le450_15b.col index 94b6ca2..ea9902f 100644 --- a/dimacs_graphs/color/le450_15b.col +++ b/dimacs_graphs/color/le450_15b.col @@ -31,6 +31,7 @@ c edge density : 0.080861 c max degree : 94 c avg degree : 36.31 c min degree : 1 +u 289 p edge 450 8169 e 1 440 e 1 72 diff --git a/dimacs_graphs/color/le450_15c.col b/dimacs_graphs/color/le450_15c.col index 0485564..53f1b82 100644 --- a/dimacs_graphs/color/le450_15c.col +++ b/dimacs_graphs/color/le450_15c.col @@ -31,6 +31,7 @@ c edge density : 0.165108 c max degree : 139 c avg degree : 74.13 c min degree : 18 +u 372 p edge 450 16680 e 1 425 e 1 343 diff --git a/dimacs_graphs/color/le450_15d.col b/dimacs_graphs/color/le450_15d.col index 351b6c6..ba91656 100644 --- a/dimacs_graphs/color/le450_15d.col +++ b/dimacs_graphs/color/le450_15d.col @@ -31,6 +31,7 @@ c edge density : 0.165801 c max degree : 138 c avg degree : 74.44 c min degree : 18 +u 371 p edge 450 16750 e 1 342 e 1 95 diff --git a/dimacs_graphs/color/le450_25a.col b/dimacs_graphs/color/le450_25a.col index 690d634..08e0f0d 100644 --- a/dimacs_graphs/color/le450_25a.col +++ b/dimacs_graphs/color/le450_25a.col @@ -31,6 +31,7 @@ c edge density : 0.081762 c max degree : 128 c avg degree : 36.71 c min degree : 2 +u 255 p edge 450 8260 e 1 267 e 1 303 diff --git a/dimacs_graphs/color/le450_25b.col b/dimacs_graphs/color/le450_25b.col index 345c123..813db8b 100644 --- a/dimacs_graphs/color/le450_25b.col +++ b/dimacs_graphs/color/le450_25b.col @@ -31,6 +31,7 @@ c edge density : 0.081792 c max degree : 111 c avg degree : 36.72 c min degree : 2 +u 251 p edge 450 8263 e 1 267 e 1 242 diff --git a/dimacs_graphs/color/le450_25c.col b/dimacs_graphs/color/le450_25c.col index 67dbe94..5788298 100644 --- a/dimacs_graphs/color/le450_25c.col +++ b/dimacs_graphs/color/le450_25c.col @@ -31,6 +31,7 @@ c edge density : 0.171670 c max degree : 179 c avg degree : 77.08 c min degree : 7 +u 349 p edge 450 17343 e 1 210 e 1 85 diff --git a/dimacs_graphs/color/le450_25d.col b/dimacs_graphs/color/le450_25d.col index b5e31da..9d7c6b0 100644 --- a/dimacs_graphs/color/le450_25d.col +++ b/dimacs_graphs/color/le450_25d.col @@ -31,6 +31,7 @@ c edge density : 0.172482 c max degree : 157 c avg degree : 77.44 c min degree : 11 +u 349 p edge 450 17425 e 1 342 e 1 287 diff --git a/dimacs_graphs/color/le450_5a.col b/dimacs_graphs/color/le450_5a.col index baaa439..769a054 100644 --- a/dimacs_graphs/color/le450_5a.col +++ b/dimacs_graphs/color/le450_5a.col @@ -31,6 +31,7 @@ c edge density : 0.056560 c max degree : 42 c avg degree : 25.40 c min degree : 13 +u 307 p edge 450 5714 e 1 330 e 1 367 diff --git a/dimacs_graphs/color/le450_5b.col b/dimacs_graphs/color/le450_5b.col index d228b27..d28ce59 100644 --- a/dimacs_graphs/color/le450_5b.col +++ b/dimacs_graphs/color/le450_5b.col @@ -31,6 +31,7 @@ c edge density : 0.056758 c max degree : 42 c avg degree : 25.48 c min degree : 12 +u 309 p edge 450 5734 e 1 277 e 1 49 diff --git a/dimacs_graphs/color/le450_5c.col b/dimacs_graphs/color/le450_5c.col index 75900f9..c7de7e2 100644 --- a/dimacs_graphs/color/le450_5c.col +++ b/dimacs_graphs/color/le450_5c.col @@ -31,6 +31,7 @@ c edge density : 0.097035 c max degree : 66 c avg degree : 43.57 c min degree : 27 +u 315 p edge 450 9803 e 1 440 e 1 164 diff --git a/dimacs_graphs/color/le450_5d.col b/dimacs_graphs/color/le450_5d.col index b009700..875748d 100644 --- a/dimacs_graphs/color/le450_5d.col +++ b/dimacs_graphs/color/le450_5d.col @@ -31,6 +31,7 @@ c edge density : 0.096580 c max degree : 68 c avg degree : 43.36 c min degree : 29 +u 303 p edge 450 9757 e 1 159 e 1 164 diff --git a/dimacs_graphs/color/mulsol.i.1.col b/dimacs_graphs/color/mulsol.i.1.col index 757c5cc..986ba51 100644 --- a/dimacs_graphs/color/mulsol.i.1.col +++ b/dimacs_graphs/color/mulsol.i.1.col @@ -6,6 +6,7 @@ c DESCRIPTION: Coloring problem generated from a register allocation c problem based on real code. c c graph #1 from register allocation file mulsol.i +u 50 p edge 197 3925 e 1 2 e 1 3 diff --git a/dimacs_graphs/color/mulsol.i.2.col b/dimacs_graphs/color/mulsol.i.2.col index 2192259..6270e62 100644 --- a/dimacs_graphs/color/mulsol.i.2.col +++ b/dimacs_graphs/color/mulsol.i.2.col @@ -6,6 +6,7 @@ c DESCRIPTION: Coloring problem generated from a register allocation c problem based on real code. c c graph #2 from register allocation file mulsol.i +u 32 p edge 188 3885 e 1 2 e 1 3 diff --git a/dimacs_graphs/color/mulsol.i.3.col b/dimacs_graphs/color/mulsol.i.3.col index 3d01ab4..99fb0e9 100644 --- a/dimacs_graphs/color/mulsol.i.3.col +++ b/dimacs_graphs/color/mulsol.i.3.col @@ -6,6 +6,7 @@ c DESCRIPTION: Coloring problem generated from a register allocation c problem based on real code. c c graph #3 from register allocation file mulsol.i +u 32 p edge 184 3916 e 1 2 e 1 3 diff --git a/dimacs_graphs/color/mulsol.i.4.col b/dimacs_graphs/color/mulsol.i.4.col index af8fb6d..9039bc4 100644 --- a/dimacs_graphs/color/mulsol.i.4.col +++ b/dimacs_graphs/color/mulsol.i.4.col @@ -6,6 +6,7 @@ c DESCRIPTION: Coloring problem generated from a register allocation c problem based on real code. c c graph #4 from register allocation file mulsol.i +u 32 p edge 185 3946 e 1 2 e 1 3 diff --git a/dimacs_graphs/color/mulsol.i.5.col b/dimacs_graphs/color/mulsol.i.5.col index 4d947df..cf5c396 100644 --- a/dimacs_graphs/color/mulsol.i.5.col +++ b/dimacs_graphs/color/mulsol.i.5.col @@ -6,6 +6,7 @@ c DESCRIPTION: Coloring problem generated from a register allocation c problem based on real code. c c graph #5 from register allocation file mulsol.i +u 31 p edge 186 3973 e 1 2 e 1 3 diff --git a/treewidth_heuristic/src/compute_treewidth_upper_bound.rs b/treewidth_heuristic/src/compute_treewidth_upper_bound.rs index 6f0f469..29f6da6 100644 --- a/treewidth_heuristic/src/compute_treewidth_upper_bound.rs +++ b/treewidth_heuristic/src/compute_treewidth_upper_bound.rs @@ -1,6 +1,6 @@ use std::{ collections::{HashMap, HashSet}, - hash::{BuildHasher, RandomState}, + hash::BuildHasher, }; use crate::*; @@ -64,7 +64,7 @@ pub fn compute_treewidth_upper_bound, i32, petgraph::prelude::Undirected, @@ -190,6 +190,8 @@ pub fn compute_treewidth_upper_bound_not_connected< #[cfg(test)] mod tests { + use std::hash::RandomState; + use super::*; use crate::tests::*;