From f0b2977b0cdb4136900f19ac93f833122fd5b468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffan=20S=C3=B8lvsten?= Date: Thu, 4 Apr 2024 14:02:54 +0200 Subject: [PATCH] Simplify 'Terminal Count' heuristic to be linear and ignore idempotent terminal - It now only cares about the shortcutting terminal - It now also is fully linear such that at least 0.5 percent of all arcs have to be a shortcutting terminal --- src/adiar/internal/algorithms/quantify.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/adiar/internal/algorithms/quantify.h b/src/adiar/internal/algorithms/quantify.h index 8fa14028d..4e6c57d00 100644 --- a/src/adiar/internal/algorithms/quantify.h +++ b/src/adiar/internal/algorithms/quantify.h @@ -1320,17 +1320,16 @@ namespace adiar::internal // Terminal Count Heuristics const size_t false_weight = - 1 + Policy::collapse_to_terminal(typename Policy::pointer_type(false)); + Policy::collapse_to_terminal(typename Policy::pointer_type(false)); const size_t true_weight = - 1 + Policy::collapse_to_terminal(typename Policy::pointer_type(true)); + Policy::collapse_to_terminal(typename Policy::pointer_type(true)); const double total_arcs = 2.0 * size; const double weighted_terminals = false_weight * false_terminals + true_weight * true_terminals; - const size_t exponent = 21.0 * (weighted_terminals / total_arcs) + 0.4; const typename Policy::label_type terminal_threshold = - (1u << std::min(exponent, log2(2 * Policy::max_label))) - 1u; + (200.0 * weighted_terminals) / total_arcs; // --------------------------------------------------------------------------------------------- // Shallow Variables Heuristic