D-Wave Binary CSP#
Library to construct a binary quadratic model from a constraint satisfaction problem with small constraints over binary variables.
Below is an example usage:
import dwavebinarycsp
import dimod
csp = dwavebinarycsp.factories.random_2in4sat(8, 4) # 8 variables, 4 clauses
bqm = dwavebinarycsp.stitch(csp)
resp = dimod.ExactSolver().sample(bqm)
for sample, energy in resp.data(['sample', 'energy']):
print(sample, csp.check(sample), energy)
Documentation#
- Release:
8.0.1
- Date:
Oct 30, 2024
Note
This documentation is for the latest version of dwavebinarycsp. Documentation for the version currently installed by dwave-ocean-sdk is here: dwavebinarycsp.