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.2.tar.gz
(15.0 kB
view hashes)
Built Distribution
Close
Hashes for dwavebinarycsp-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6de8579720ac0ac4069ebe044c23c649133854b4a5736c056b0f01d247b9899 |
|
MD5 | 4626472dea9c41a087fb8d113a305f6b |
|
BLAKE2b-256 | b33d55092dbd54fe341f170e9cf793b393ec0e8a2bab71d0881cd858593325a1 |