Skip to content

what difference between IntVar.setRange and solver.addConstraints #4063

Discussion options

You must be logged in to vote

In general, propagators (build by constraints) are tasked to wait for triggers and then remove values from variable-domains within a fixpoint-iteration loop. This happens a lot during search.

If you can remove those values a-priori, you don't need a propagator anymore and don't pay for it's overhead (listener = wait; propagation-work) as the domain was changed at the root-lvl before any decisions/branchings are made which usually trigger fixpoint-search / propagation.

Every non-toy solver, when seeing solver.addConstraints(solver.makeLessOrEqual(IntVar, upperValue)) will transform / lift / rewrite this into a domain-change and don't add/post a propagator or get rid of it later during pres…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@lperron
Comment options

@hlee13
Comment options

Answer selected by lperron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #4062 on January 19, 2024 10:50.