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.
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.1.2.tar.gz
(18.9 kB
view hashes)
Built Distribution
Close
Hashes for dwavebinarycsp-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 979107f2e163ce0565772a2a84480561695a9c00deaba9a062a6150a087443a9 |
|
MD5 | 3b1ef690a31347541851f4618346d089 |
|
BLAKE2b-256 | e6f28422100bfa1a9cce5c0f3ca8b088a3d1f46582c0085adb2db09837dbc0f1 |