From 897a723cd5476fcfa41c35639e3d59c35fcc30f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffan=20S=C3=B8lvsten?= Date: Thu, 4 Apr 2024 13:45:13 +0200 Subject: [PATCH] Remove 'Terminal Count' heuristic It seems like this heuristic is not good enough at differentiating between cases that should use one or more partial sweeps and those that should not. If anything, it might only be a bad proxy for some other meta information that we should use instead. Hence, we better remove it to not have semi-dead and untested code laying around in the codebase --- src/adiar/internal/algorithms/quantify.h | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/src/adiar/internal/algorithms/quantify.h b/src/adiar/internal/algorithms/quantify.h index 8fa14028d..cca740620 100644 --- a/src/adiar/internal/algorithms/quantify.h +++ b/src/adiar/internal/algorithms/quantify.h @@ -1311,26 +1311,8 @@ namespace adiar::internal const predicate& pred) { // Extract meta data constants about the DAG - const size_t size = dd.size(); - const size_t width = dd.width(); - const size_t false_terminals = dd.number_of_terminals(false); - const size_t true_terminals = dd.number_of_terminals(true); - - // --------------------------------------------------------------------------------------------- - // Terminal Count Heuristics - - const size_t false_weight = - 1 + Policy::collapse_to_terminal(typename Policy::pointer_type(false)); - - const size_t true_weight = - 1 + 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; + const size_t size = dd.size(); + const size_t width = dd.width(); // --------------------------------------------------------------------------------------------- // Shallow Variables Heuristic @@ -1364,7 +1346,7 @@ namespace adiar::internal adiar_assert(shallow_variables <= Policy::max_label); // --------------------------------------------------------------------------------------------- - return std::min(terminal_threshold, shallow_variables); + return shallow_variables; } //////////////////////////////////////////////////////////////////////////////////////////////////