Skip to main content

Solves constraints satisfaction problems with binary quadratic model samplers

Project description

https://img.shields.io/pypi/v/dwavebinarycsp.svg https://ci.appveyor.com/api/projects/status/b99rhw0l6ljsgw5t?svg=true https://codecov.io/gh/dwavesystems/dwavebinarycsp/branch/master/graph/badge.svg https://readthedocs.com/projects/d-wave-systems-binarycsp/badge/?version=latest https://circleci.com/gh/dwavesystems/dwavebinarycsp.svg?style=svg

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.

Contributing

Ocean’s contributing guide has guidelines for contributing to Ocean packages.

Project details


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.2.0.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dwavebinarycsp-0.2.0-py3-none-any.whl (35.2 kB view details)

Uploaded Python 3

File details

Details for the file dwavebinarycsp-0.2.0.tar.gz.

File metadata

  • Download URL: dwavebinarycsp-0.2.0.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.12

File hashes

Hashes for dwavebinarycsp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7a5cf530e4a7c1288055c9b9fd0d3032175b06d19da7642fe5724dc85050ea1e
MD5 c5a7244cc39d02b3f6a6384949cb3c60
BLAKE2b-256 62f30b2dbce6ca7a99b02254ceb8135888c117ef80edcf7ca12b7063cd22c8a4

See more details on using hashes here.

File details

Details for the file dwavebinarycsp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dwavebinarycsp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 35.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.12

File hashes

Hashes for dwavebinarycsp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47daf23c239601f6c26d69bba1d8e7363a62c9ce0c10e9aa2904ca271438111a
MD5 350375c19c7396265ba13ccac4299146
BLAKE2b-256 26811816881b1e2946d0ed1fa22efadf119679063caeaad53aeb4fc581156948

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page