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.5.tar.gz
(17.1 kB
view hashes)
Built Distribution
Close
Hashes for dwavebinarycsp-0.0.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99c5b606123daaeb564b995546501376c7fb1d82849b27e8cf70bb9f213d6e78 |
|
MD5 | f75eb39aa67b1a218e6cd0c92e5c2f68 |
|
BLAKE2b-256 | 05e8ec391f84a73ee55506e6bda6fa48ab4e0806bf55c9281b6108cfcfea837f |