# dwavebinarycsp.ConstraintSatisfactionProblem.check¶

ConstraintSatisfactionProblem.check(solution)[source]

Check that a solution satisfies all of the constraints.

Parameters: solution (container) – An assignment of values for the variables in the constraint satisfaction problem. True if the solution satisfies all of the constraints; False otherwise. bool

Examples

This example creates a binary-valued constraint satisfaction problem, adds two logic gates implementing Boolean constraints, $$c = a \wedge b$$ and $$d = a \oplus c$$, and verifies that the combined problem is satisfied for a given assignment.

>>> import dwavebinarycsp
>>> import dwavebinarycsp.factories.constraint.gates as gates
>>> csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)