We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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?
The text was updated successfully, but these errors were encountered:
What we want is any ordered iterable. So a generator or OrderedDict would both work. We could also just limit it to list/tuple.
Let me think about it
Sorry, something went wrong.
arcondello
No branches or pull requests
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?
The text was updated successfully, but these errors were encountered: