stefano guerrieri
stefano guerrieri

Reputation: 143

is it possible to force cp-sat to meet all the constraints for a feasible solution?

Dears I read that CP-SAT for a feasible solution does not ensure that all constraints are met. Am I right? Is there a way to force it to met all of them even if the solution is "feasible"? Does it provide the constrains met and not met? Thank you

Upvotes: 0

Views: 455

Answers (2)

Laurent Perron
Laurent Perron

Reputation: 11014

This is wrong. Every constraint must be met. And the solver checks all solutions produced to make sure they are valid.

I believe you are confused by the notion of enforced literals in constraints. This is the equivalent of index constraints in the MIP world.

Given a Boolean variable b, and a constraint (currently limited to bool_or, bool_and and linear_constraints), you can write

b => constraint

or

negation(b) => constraint

meaning that if the prefix is true, then the constraint must be satisfied.

Upvotes: 1

PySeeker
PySeeker

Reputation: 874

Where did you read that? CP-approach means finding rather a good feasible solution than an optimal solutions, which obviously speeds up the computation.

The definition of a fesaible solution is: A set of values for the decision variables that satisfies all of the constraints in an optimization problem.

You can run an CP-SAT example and check, if a constraint is violated. But there should be not violation.

Edit: Or are we talking about relaxation?

Upvotes: 0

Related Questions