I understand that it's nice to have flexibility, and it's a user mistake, but this is a hole I likely will not be the only one to fall into:
import dwavebinarycsp
csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)
csp.add_constraint([(0, 0, 0), (0, 1, 0), (1, 0, 0), (1, 1, 1)], {'a', 'b', 'c'})
csp.constraints
Out[89]: [Constraint.from_configurations(frozenset([(1, 0, 0), (0, 1, 0), (0, 0, 0), (1, 1, 1)]), ('a', 'c', 'b'), Vartype.BINARY, name='Constraint')]
It's very easy to inadvertently use {} instead of [] or () and how often will someone really want random assignment of variables on a constraint?
I understand that it's nice to have flexibility, and it's a user mistake, but this is a hole I likely will not be the only one to fall into:
import dwavebinarycsp
csp = dwavebinarycsp.ConstraintSatisfactionProblem(dwavebinarycsp.BINARY)
csp.add_constraint([(0, 0, 0), (0, 1, 0), (1, 0, 0), (1, 1, 1)], {'a', 'b', 'c'})
csp.constraints
Out[89]: [Constraint.from_configurations(frozenset([(1, 0, 0), (0, 1, 0), (0, 0, 0), (1, 1, 1)]), ('a', 'c', 'b'), Vartype.BINARY, name='Constraint')]
It's very easy to inadvertently use {} instead of [] or () and how often will someone really want random assignment of variables on a constraint?