- Notifications
You must be signed in to change notification settings - Fork71
Open
Description
When using ExactSumConstraint, the solver sometimes raises:ValueError: max() iterable argument is empty
This happens inside ExactSumConstraint.preProcess() when the code callsmax(domains[variable])
after domain pruning.
If all possible values for a variable are removed during the preprocessing step, the corresponding domain becomes empty, causing max() and min() to fail.
Root Cause
In preProcess():
for value in domain[:]: if value * multiplier + other_vars_min > exactsum: domain.remove(value) if value * multiplier + other_vars_max < exactsum: domain.remove(value)# Then later:self._var_max = { variable: max(domains[variable]) * multiplier for variable, multiplierMetadata
Metadata
Assignees
Labels
No labels