Skip to content

feat(pumpkin-core,pumpkin-propagators): Change representation of holes to intervals - #668

Draft
ImkoMarijnissen wants to merge 18 commits into
mainfrom
backup/hole-pieces-before-rebase
Draft

ImkoMarijnissen wants to merge 18 commits into
mainfrom
backup/hole-pieces-before-rebase

Conversation

@ImkoMarijnissen

@ImkoMarijnissen ImkoMarijnissen commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

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:

  1. Changed the representation of the holes in the domain.
  2. Usage:
    • The Cumulative propagator uses the removal when removing holes in the domain.
    • ExtendedCPIP also uses it when removing ranges from the domain.
  3. PropagationContext has two additional methods: contains_any_in_range and remove_range for determining whether a range is empty and removing a range of values from the domain.
  4. Added IntegerVariable::range_of_underlying_domain, to map ranges of values to the original domain to ensure that removal happens correctly.
  5. The core has been adjusted to take into account that a trail entry can represent multiple predicates.
  6. It also contains some small optimisations concerning the conflict analysis loop and looking up trail positions + not unnecessarily traversing the nogood multiple times in extended nogood propagation.

This is mostly in preparation for creating a new predicate which represents $[x \notin [lb, ub]]$. Whether we want these changes in main is still being investigated.

TODO

  • Profiling
  • Free Search

Experimental Results

For the experiments I ran four configurations:

  • pumpkin-main-default: the current main with no additional flags
  • pumpkin-main-ecpip: the current main with extended nogood propagation and cpip
  • pumpkin-hole-pieces-default: this branch with no additional flags
  • pumpkin-hole-pieces-ecpip: this branch with extended nogood propagation and cpip

We can see a slight degradation when running with 1UIP, but that it is better when using extended CPIP.

Configuration MiniZinc score Area score, average Area score, median Area score, total
main-default 441.4 27.79 1.09 10921
main-ecpip 450.5 28.29 0.89 11120
hole-pieces-default 440.1 28.30 0.92 11124
hole-pieces-ecpip 456.0 27.08 0.89 10641

And looking at them pairwise:

Pair MiniZinc score Area score, average Area score, median Area score, total
main-default 149.6 22.63 0.93 8895
hole-pieces-default 148.4 23.16 0.88 9102
main-ecpip 146.8 22.94 0.85 9015
hole-pieces-ecpip 149.2 21.77 0.86 8555

@EmirDe

EmirDe commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

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.

@ImkoMarijnissen

Copy link
Copy Markdown
Contributor Author

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.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants