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.
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.
Contribution
See CONTRIBUTING.rst file.
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.0.10.tar.gz
(19.4 kB
view hashes)
Built Distribution
Close
Hashes for dwavebinarycsp-0.0.10-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ca0fb6363ec31f4daf5f7bdca6506df90bd1d61783ad6252a877f4f2d3bee38 |
|
MD5 | 542bcd1f9726ebebf6513b4ba147a89f |
|
BLAKE2b-256 | 75ce1d3a2db55982db08c6c80f18f4639c2746b7ec5357db9d2506df9da7e98a |