Skip to content
New issue

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

ImpossibleBQM error #35

Closed
arcondello opened this issue May 15, 2018 · 1 comment
Closed

ImpossibleBQM error #35

arcondello opened this issue May 15, 2018 · 1 comment
Assignees
Labels

Comments

@arcondello
Copy link
Member

Constraint.from_configurations(frozenset([(0, 1, 1, 0, 1, 0, 1, 0), (0, 1, 0, 0, 0, 1, 0, 1), (0, 1, 0, 1, 0, 1, 1, 0), (0, 0, 0, 0, 1, 0, 0, 0), (0, 0, 0, 1, 1, 0, 0, 0), (0, 1, 0, 1, 1, 0, 1, 0), (0, 0, 0, 0, 1, 0, 1, 0), (0, 0, 1, 0, 0, 1, 0, 1), (0, 0, 0, 1, 0, 0, 1, 0), (0, 1, 0, 1, 1, 0, 0, 1), (0, 1, 1, 0, 0, 1, 1, 0), (0, 1, 0, 0, 1, 0, 0, 1), (1, 0, 0, 1, 0, 0, 0, 1), (0, 0, 0, 0, 0, 1, 0, 0), (1, 0, 0, 0, 1, 0, 0, 0), (1, 0, 0, 0, 0, 0, 0, 0), (0, 0, 0, 1, 0, 1, 0, 1), (0, 0, 0, 0, 0, 1, 1, 0), (0, 0, 1, 0, 1, 0, 0, 1), (0, 1, 1, 0, 1, 0, 0, 1), (0, 1, 0, 0, 0, 1, 1, 0), (0, 1, 0, 1, 0, 1, 0, 1), (0, 1, 0, 1, 1, 0, 0, 0), (0, 1, 0, 0, 0, 1, 0, 0), (0, 0, 0, 0, 1, 0, 0, 1), (0, 0, 1, 0, 0, 1, 1, 0), (1, 0, 1, 0, 0, 0, 0, 1), (0, 0, 1, 0, 0, 0, 0, 0), (0, 0, 1, 0, 0, 1, 0, 0), (0, 1, 0, 0, 1, 0, 1, 0), (0, 1, 0, 0, 1, 0, 0, 0), (0, 0, 0, 1, 0, 1, 1, 0), (0, 0, 0, 0, 0, 1, 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, 0, 1, 0, 0), (0, 0, 0, 1, 0, 0, 0, 1), (0, 1, 1, 0, 1, 0, 0, 0), (1, 0, 1, 0, 0, 1, 0, 1), (1, 0, 0, 0, 1, 0, 1, 0), (1, 0, 0, 1, 0, 1, 1, 0)]), ('AB0', 'BC0', 'AB1', 'BC1', 'AB2', 'BC2', 'AB3', 'BC3'), Vartype.BINARY, name='Constraint')

This is a reducible constraint, but each of the four components can be mapped to two variables. So this should be able to be stitched to a bqm over 8 variables.

@arcondello arcondello changed the title No constraint can be built for ImpossibleBQM error May 15, 2018
@arcondello
Copy link
Member Author

For a csp with only the above constraint

In [15]: bqm = dwavebinarycsp.stitch(csp, max_graph_size=9)

In [16]: bqm
Out[16]: BinaryQuadraticModel({'BC3': 0.0, 'BC2': 0.0, 'BC0': 0.0, 'BC1': 0.0, 'AB3': 0.0, 'AB1': 0.0, 'AB2': 0.0, 'AB0': 0.0}, {('AB3', 'AB0'): 0.0, ('BC2', 'AB2'): 4.0, ('BC3', 'AB0'): 0.0, ('AB3', 'BC0'): 0.0, ('BC2', 'AB1'): 0.0, ('BC0', 'AB0'): 4.0, ('BC3', 'BC0'): 0.0, ('BC3', 'AB3'): 4.0, ('BC3', 'BC2'): 0.0, ('BC1', 'AB2'): 0.0, ('BC0', 'AB2'): 0.0, ('AB3', 'AB2'): 0.0, ('BC1', 'AB1'): 4.0, ('BC0', 'AB1'): 0.0, ('AB3', 'AB1'): 0.0, ('BC0', 'BC1'): 0.0, ('AB3', 'BC1'): 0.0, ('BC3', 'BC1'): 0.0, ('AB2', 'AB0'): 0.0, ('AB1', 'AB2'): 0.0, ('BC2', 'AB0'): 0.0, ('AB1', 'AB0'): 0.0, ('BC1', 'BC2'): 0.0, ('BC0', 'BC2'): 0.0, ('BC3', 'AB2'): 0.0, ('AB3', 'BC2'): 0.0, ('BC1', 'AB0'): 0.0, ('BC3', 'AB1'): 0.0}, -4.0, Vartype.BINARY)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant