Data update

This commit is contained in:
Ingy döt Net 2025-02-27 18:35:13 -05:00
parent 8e4e15fa56
commit 72eb4943cb
1853 changed files with 35514 additions and 9441 deletions

View file

@ -26,7 +26,7 @@ class Knapsack
candidate = items[candidate_index]
# candidate is a best of available items, so if we fill remaining value with it
# and still don't reach the threshold, the branch is wrong
return nil if taken.total_value + 1.0 * candidate.value / candidate.weight * remaining_weight < @threshold_value
return nil if taken.total_value + 1.0 * candidate.value / candidate.weight * remaining_weight <= @threshold_value
# now recursively check both variants
mask = taken.mask.clone
mask[candidate_index] = true