From 7143c7239aa9abbfc5f453fd594399e402344b38 Mon Sep 17 00:00:00 2001 From: alanSquirrelyz Date: Fri, 6 Feb 2026 13:29:29 -0800 Subject: [PATCH] fix infinite loop in ApproximateSetCover --- .../ApproximateSetCover/MANISBPT11/ApproximateSetCover.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/benchmarks/ApproximateSetCover/MANISBPT11/ApproximateSetCover.h b/benchmarks/ApproximateSetCover/MANISBPT11/ApproximateSetCover.h index 3ed5edaf..e7bfde11 100644 --- a/benchmarks/ApproximateSetCover/MANISBPT11/ApproximateSetCover.h +++ b/benchmarks/ApproximateSetCover/MANISBPT11/ApproximateSetCover.h @@ -139,7 +139,8 @@ inline parlay::sequence SetCover(Graph& G, size_t num_buckets = 512) { // 3. sets -> elements (count and add to cover if enough elms were won) const size_t low_threshold = - std::max((size_t)ceil(pow(1.0 + sc::epsilon, cur_bkt - 1)), (size_t)1); + (cur_bkt == 0) ? (size_t)1 + : std::max((size_t)ceil(pow(1.0 + sc::epsilon, cur_bkt - 1)), (size_t)1); auto won_ngh_f = [&](const uintE& u, const uintE& v, const W& wgh) -> bool { return Elms[v] == perm[u]; };