Skip to main content

Solves constraints satisfaction problems with binary quadratic model samplers

Project description

https://img.shields.io/pypi/v/dwavebinarycsp.svg https://ci.appveyor.com/api/projects/status/b99rhw0l6ljsgw5t?svg=true https://codecov.io/gh/dwavesystems/dwavebinarycsp/branch/master/graph/badge.svg https://readthedocs.com/projects/d-wave-systems-binarycsp/badge/?version=latest https://circleci.com/gh/dwavesystems/dwavebinarycsp.svg?style=svg

dwavebinarycsp

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)

Installation

To install:

pip install dwavebinarycsp

To build from source:

pip install -r requirements.txt
python setup.py install

License

Released under the Apache License 2.0. See LICENSE file.

Contributing

Ocean’s contributing guide has guidelines for contributing to Ocean packages.

Project details


Download files

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

Source Distribution

dwavebinarycsp-0.3.0.tar.gz (29.1 kB view hashes)

Uploaded Source

Built Distribution

dwavebinarycsp-0.3.0-py3-none-any.whl (35.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page