Skip to main content

Solves constraints satisfaction problems with binary quadratic model samplers

Project description


Library to construct a binary quadratic model from a constraint satisfaction problem with small constraints over binary variables.

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['sample', 'energy']):
    print(sample, csp.check(sample), energy)


To install:

pip install dwavebinarycsp

To build from source:

pip install -r requirements.txt
python install


Released under the Apache License 2.0. See LICENSE file.


See CONTRIBUTING.rst file.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
dwavebinarycsp-0.0.10-py2.py3-none-any.whl (36.2 kB) Copy SHA256 hash SHA256 Wheel py2.py3
dwavebinarycsp-0.0.10.tar.gz (19.4 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page