You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Application
Sometimes I want to create a constraint for which I already know the values for some of the variables. I can create the constraint and then immediately fix the variable after, but it might be nice to do it on creation (also can memory/time).
Proposed Solution
I would like to be able to provide boolean values in the place of variables. This would be equivalent to fixing them.
csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)
def and_gate(in0, in1, out):
return (in0 and in1) == out
csp.add_constraint(and_gate, ['a', 'b', False])
In this case the constraint would be the identical to
csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)
def nand(in0, in1):
return not (in0 and in1)
csp.add_constraint(nand, ['a', 'b'])
The text was updated successfully, but these errors were encountered:
Application
Sometimes I want to create a constraint for which I already know the values for some of the variables. I can create the constraint and then immediately fix the variable after, but it might be nice to do it on creation (also can memory/time).
Proposed Solution
I would like to be able to provide boolean values in the place of variables. This would be equivalent to fixing them.
In this case the constraint would be the identical to
The text was updated successfully, but these errors were encountered: