dwavebinarycsp#

Deprecated since version 0.3.1: dwavebinarycsp is deprecated and will be removed in Ocean 10. For solving problems with constraints, we recommand using the hybrid solvers in the Leap service. You can find documentation for the hybrid solvers at Hybrid Solvers.

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)

Code