Skip to content

Commit

Permalink
Fixed logging
Browse files Browse the repository at this point in the history
  • Loading branch information
RaoulLuque committed Jun 10, 2024
1 parent 6b58e41 commit 9522e39
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 5 deletions.
11 changes: 10 additions & 1 deletion dimacs_benchmarks/benchmark_results/dimacs_results.txt
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@

| Graph name | Upper bound | MTrNiTLd | MTrNiTLdBC 2 | FiWhNiTLd | FiWhLdTNiBC 2 |
| zeroin.i.3.col | None | 60 57 | 140 378 | 57 1159 | 155 121893 |
| zeroin.i.2.col | None | 57 58 | 142 392 | 57 1277 | 152 112873 |
| zeroin.i.1.col | None | 99 82 | 124 517 | 96 725 | 124 150621 |
| mulsol.i.5.col | 31 | 59 57 | 151 444 | 49 1424 | 168 132741 |
| mulsol.i.4.col | 32 | 58 54 | 149 440 | 49 1425 | 171 137321 |
| mulsol.i.3.col | 32 | 58 53 | 147 435 | 49 1511 | 163 135577 |
| mulsol.i.2.col | 32 | 58 60 | 147 431 | 49 1408 | 158 139667 |
| mulsol.i.1.col | 50 | 66 66 | 115 491 | 62 747 | 135 127709 |
| le450_5d.col | 303 | 449 2747 | 432 2872 | 442 2001878| 443 749957 |
11 changes: 10 additions & 1 deletion dimacs_benchmarks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,16 @@ use std::{collections::HashSet, hash::BuildHasher};
use petgraph::graph::NodeIndex;
use HeuristicTypes::*;

pub const HEURISTICS_BEING_TESTED: [HeuristicTypes; 2] = [MstTreeNiTLd, MstTreeNiTLdBC(2)];
pub const HEURISTICS_BEING_TESTED: [HeuristicTypes; 8] = [
MstTreeNiTLd,
MstTreeNiTLdBC(2),
MstTreeNiTLdBC(3),
MstTreeNiTLdBC(10),
FillWhileNiTLd,
FillWhileNiTLdBC(2),
FillWhileNiTLdBC(3),
FillWhileNiTLdBC(10),
];

pub fn heuristic_to_edge_weight_heuristic<S: BuildHasher + Default>(
heuristic: &HeuristicTypes,
Expand Down
4 changes: 2 additions & 2 deletions dimacs_benchmarks/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn main() {

for heuristic in HEURISTICS_BEING_TESTED {
let heuristic_string = heuristic.to_string();
log.push_str(&format!(" {0: <11} |", heuristic_string))
log.push_str(&format!(" {0: <15} |", heuristic_string))
}
log.push_str("\n");

Expand Down Expand Up @@ -127,7 +127,7 @@ fn main() {
for i in 0..HEURISTICS_BEING_TESTED.len() {
let current_value_tuple = calculation_vec.get(i).expect("Calculation should exist");
log.push_str(&format!(
" {0: <4} {1: <7}|",
" {0: <7} {1: <7} |",
current_value_tuple.0, current_value_tuple.1
));
}
Expand Down
4 changes: 4 additions & 0 deletions k_tree_benchmarks/benchmark_results/k_tree_results.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
n: 50 | k: 10 | p: 10
| MTrNiTLd | MTrNiTLdBC 2 | MTrNiTLdBC 3 | MTrNiTLdBC 10 | FiWhNiTLd | FiWhLdTNiBC 2 | FiWhLdTNiBC 3 | FiWhLdTNiBC 10 |
| 19.2 19.3 | 42.8 9.4 | 47.8 217.4 | 19.4 19.6 | 15.9 962.8 | 45.9 475.2 | 47.4 70126.4 | 16.4 979.3 |

35 changes: 34 additions & 1 deletion k_tree_benchmarks/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,39 @@ pub const PARTIAL_K_TREE_CONFIGURATIONS: [(usize, usize, usize); 24] = [
(1000, 20, 50),
];

// pub const PARTIAL_K_TREE_CONFIGURATIONS: [(usize, usize, usize); 30] = [
// (10, 5, 5),
// (10, 5, 10),
// (10, 5, 15),
// (10, 5, 20),
// (10, 5, 25),
// (10, 5, 30),
// (10, 5, 35),
// (10, 5, 40),
// (10, 5, 45),
// (10, 5, 50),
// (10, 5, 55),
// (10, 5, 60),
// (10, 5, 65),
// (10, 5, 70),
// (10, 5, 75),
// (20, 5, 5),
// (20, 5, 10),
// (20, 5, 15),
// (20, 5, 20),
// (20, 5, 25),
// (20, 5, 30),
// (20, 5, 35),
// (20, 5, 40),
// (20, 5, 45),
// (20, 5, 50),
// (20, 5, 55),
// (20, 5, 60),
// (20, 5, 65),
// (20, 5, 70),
// (20, 5, 75),
// ];

fn main() {
// Opening log file
let mut benchmark_log_file =
Expand Down Expand Up @@ -154,7 +187,7 @@ fn main() {
log.push_str(&format!("n: {} | k: {} | p: {} \n", n, k, p));

for heuristic in HEURISTICS_BEING_TESTED {
log.push_str(&format!("| {: <10} ", heuristic))
log.push_str(&format!("| {: <15} ", heuristic.to_string()))
}

log.push_str("|\n|");
Expand Down

0 comments on commit 9522e39

Please sign in to comment.