Solves constraints satisfaction problems with binary quadratic model samplers
Project description
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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for dwavebinarycsp-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04e4ce545d5f6467885436f52b40d247a6ba8e690dbb303d669ea953b789f869 |
|
MD5 | 4e7f32cf0da2c58315fef17b0a151f9a |
|
BLAKE2b-256 | c3f7beb84c2e5cdf41843ab5d89f950f0800cdf72c21ed0373c497e26c73d5aa |