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.4.tar.gz
(17.0 kB
view hashes)
Built Distribution
Close
Hashes for dwavebinarycsp-0.0.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f24c2028334678f8c0a0a95aa9ae2e7e0836f20539dab5f157652f540a5b36b8 |
|
MD5 | 3e11e7dd07bd8436099e8d82c284670a |
|
BLAKE2b-256 | 8e0e3ed020f65935aa954efcf8f66009fe33e4fc098367c8c2ed1657e3979734 |