ConstraintSatisfactionProblem.add_variable(v)[source]

Parameters: v (variable) – Variable in the constraint satisfaction problem. May be of any type that can be a dict key.

Examples

This example adds two variables, one of which is already used in a constraint of the constraint satisfaction problem.

>>> import operator
>>> csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.SPIN)