Repository navigation
feat(pumpkin-core,pumpkin-propagators): Change representation of holes to intervals - #668
ImkoMarijnissen wants to merge 18 commits into
Conversation
…y value exists in range + switching to vec view
|
Question. Do we want to refactor the core crate to factor out basic data structures like assignments etc into a separate crate, and have the crate provide an interface? The core could then use the interface, which would make it easier for us to swap-in swap-out different representations like sorted intervals, inteval variables, etc. We could discuss. |
…equality predicate
I would think this is a good idea, but I would suggest having that as a follow-up PR to this one, since it requires quite a lot of changes. |
Currently, we store the holes in the domain as individual values. This makes removing ranges of values more difficult since it requires removing each individual value.
This PR addresses this by changing the storage of the holes to a vector of sorted, non-overlapping intervals. Adjacent pieces are not merged since we need to be able to tell the trail position for each individual removal (e..g, if$[3, 5]$ and $[6, 9]$ are removed, then they are not merged since they have different trail positions). The following changes are included in this PR:
Cumulativepropagator uses the removal when removing holes in the domain.ExtendedCPIPalso uses it when removing ranges from the domain.PropagationContexthas two additional methods:contains_any_in_rangeandremove_rangefor determining whether a range is empty and removing a range of values from the domain.IntegerVariable::range_of_underlying_domain, to map ranges of values to the original domain to ensure that removal happens correctly.This is mostly in preparation for creating a new predicate which represents$[x \notin [lb, ub]]$ . Whether we want these changes in
mainis still being investigated.TODO
Experimental Results
For the experiments I ran four configurations:
pumpkin-main-default: the currentmainwith no additional flagspumpkin-main-ecpip: the currentmainwith extended nogood propagation and cpippumpkin-hole-pieces-default: this branch with no additional flagspumpkin-hole-pieces-ecpip: this branch with extended nogood propagation and cpipWe can see a slight degradation when running with 1UIP, but that it is better when using extended CPIP.
And looking at them pairwise: