Skip to main content
https://img.shields.io/pypi/v/dwave-qbsolv.svg https://codecov.io/gh/dwavesystems/qbsolv/branch/master/graph/badge.svg https://travis-ci.org/dwavesystems/qbsolv.svg?branch=master https://ci.appveyor.com/api/projects/status/y2f7rqxvepn4ak4b/branch/master?svg=true https://readthedocs.com/projects/d-wave-systems-qbsolv/badge/?version=latest https://circleci.com/gh/dwavesystems/qbsolv.svg?style=svg

Qbsolv

A decomposing solver that finds a minimum value of a large quadratic unconstrained binary optimization (QUBO) problem by splitting it into pieces. The pieces are solved using a classical solver running the tabu algorithm. qbsolv also enables configuring a D-Wave system as the solver.

Installation or Building

Python

A wheel might be available for your system on PyPI. Source distributions are provided as well.

pip install dwave-qbsolv

Alternatively, you can build the library with setuptools.

pip install -r python/requirements.txt
pip install cython==0.27
python setup.py install

C

To build the C library use cmake to generate a build command for your system. On Linux the commands would be something like this:

mkdir build; cd build
cmake ..
make

To build the command line interface turn the cmake option QBSOLV_BUILD_CMD on. The command line option for cmake to do this would be -DQBSOLV_BUILD_CMD=ON. To build the tests turn the cmake option QBSOLV_BUILD_TESTS on. The command line option for cmake to do this would be -DQBSOLV_BUILD_TESTS=ON.

Command Line Usage

qbsolv -i infile [-o outfile] [-m] [-T] [-n] [-S SubMatrix] [-w]
    [-h] [-a algorithm] [-v verbosityLevel] [-V] [-q] [-t seconds]

Description

qbsolv executes a quadratic unconstrained binary optimization (QUBO) problem represented in a file. It returns bit-vector results that minimizes—or optionally, maximizes—the value of the objective function represented by the QUBO. The problem is represented in QUBO(5) file format.

The QUBO input problem is not limited to the graph size or connectivity of a sampler, for example the D-Wave system.

Options are as follows:

-i infile
    Name of the file for the input QUBO. This option is mandatory.
-o outfile
    Optional output filename.
    Default is the standard output.
-a algorithm
    Optional selection for the outer loop algorithm.  Default is o.
    'o' for original qbsolv method. Submatrix based upon change in energy.
    'p' for path relinking.  Submatrix based upon differences of solutions
-m
    Optional selection of finding the maximum instead of the minimum.
-T target
    Optional argument target value of the objective function. Stops execution when found.
-t timeout
    Optional timeout value. Stops execution when the elapsed CPU time equals or
    exceeds it. Timeout is only checked after completion of the main
    loop. Other halt values such as 'target' and 'repeats' halt before 'timeout'.
    Default value is 2592000.0.
-n repeats
    Optional number of times the main loop of the algorithm is repeated with
    no change in optimal value found before stopping.
    Default value is 50.
-S subproblemSize
    Optional size of the sub-problems into which the QUBO is decomposed.
    If no "-S 0" or "-S" argument is present, uses the size specified in the
    embedding file found in the workspace set up by DW. If no DW environment is
    established, value defaults to 47 and uses the tabu solver on subproblems.
    If a value is specified, subproblems based on that size are solved with the
    tabu solver.
-w
    If present, the QUBO matrix and result are printed in .csv format.
-h
    If present, prints the help or usage message for qbsolv and exits without execution.
-v verbosityLevel
    Optional setting of the verbosity of output. The default verbosityLevel of
    0 outputs the number of bits in the solution, the solution,
    and the energy of the solution.  A verbosityLevel of 1 outputs the same
    information for multiple solutions, if found. A verbosityLevel of 2
    also outputs more detailed information at each step of the algorithm. The
    information increases for verbosity levels of up to 4.
-V
    If present, prints the version number of the qbsolv program and exits without execution.
-q
    If present, prints the format of the QUBO file.
-r seed
    Used to reset the seed for the random number generation.

qbsolv QUBO Input File Format

A .qubo file contains data that describes an unconstrained quadratic binary optimization problem. It is an ASCII file comprising four types of lines:

  1. Comments defined by a “c” in column 1. Comments may appear anywhere in the file, and are ignored.

  2. Program line defined by a “p” in the first column. A single program line must be the first non-comment line in the file. The program line has six required fields separated by space(s), as in this example:

    p   qubo  topology   maxNodes   nNodes   nCouplers

    where:

    p          Problem line sentinel.
    qubo       File type identifier.
    topology   String that identifies the topology of the problem and the specific
               problem type. For an unconstrained problem, target is "0" or
               "unconstrained." In future implementations, valid strings
               might include "chimera128" or "chimera512" (among others).
    maxNodes   Number of nodes in the topology.
    nNodes     Number of nodes in the problem (nNodes <= maxNodes).
               Each node has a unique number and must take a value in the range
               {0 - (maxNodes-1)}. A duplicate node number is an error. Node
               numbers need not be in order, and need not be contiguous.
    nCouplers  Number of couplers in the problem. Each coupler is a unique connection
               between two different nodes. The maximum number of couplers is (nNodes)^2.
               A duplicate coupler is an error.
  3. nNodes clauses. Each clause is made up of three numbers, separated by one or more blanks. The first two numbers must be integers and are the number for this node (repeated). The node number must be in range {0 , (maxNodes-1)}. The third value is the weight associated with the node. Weight may be an integer or float, and can take on any positive or negative value, or be set to zero.

  4. nCouplers clauses. Each clause is made up of three numbers, separated by one or more blanks. The first two numbers, (i and j), are the node numbers for this coupler and must be different integers, where (i < j).Each number must be one of the nNodes valid node numbers (and thus in range {0, (maxNodes-1)}). The third value is the strength associated with the coupler. Strength may be an integer or float, and can take on any positive or negative value, but not zero. Every node must connect with at least one other node (thus must have at least one coupler connected to it).

Here is a simple QUBO file example for an unconstrained QUBO with 4 nodes and 6 couplers. This example is provided to illustrate the elements of a QUBO benchmark file, not to represent a real problem.

| <--- column 1
c
c  This is a sample .qubo file
c  with 4 nodes and 6 couplers
c
p  qubo  0  4  4  6
c ------------------
0  0   3.4
1  1   4.5
2  2   2.1
3  3   -2.4
c ------------------
0  1   2.2
0  2   3.4
1  2   4.5
0  3   -2
1  3   4.5678
2  3   -3.22

Library usage

TODO

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dwave-qbsolv-0.3.3.tar.gz (90.6 kB view details)

Uploaded Source

Built Distributions

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

dwave_qbsolv-0.3.3-cp39-cp39-win_amd64.whl (57.8 kB view details)

Uploaded CPython 3.9Windows x86-64

dwave_qbsolv-0.3.3-cp39-cp39-win32.whl (50.3 kB view details)

Uploaded CPython 3.9Windows x86

dwave_qbsolv-0.3.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (205.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.5+ x86-64

dwave_qbsolv-0.3.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl (194.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.5+ i686

dwave_qbsolv-0.3.3-cp38-cp38-win_amd64.whl (58.2 kB view details)

Uploaded CPython 3.8Windows x86-64

dwave_qbsolv-0.3.3-cp38-cp38-win32.whl (50.5 kB view details)

Uploaded CPython 3.8Windows x86

dwave_qbsolv-0.3.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (218.1 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.5+ x86-64

dwave_qbsolv-0.3.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl (203.6 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.5+ i686

dwave_qbsolv-0.3.3-cp37-cp37m-win_amd64.whl (57.2 kB view details)

Uploaded CPython 3.7mWindows x86-64

dwave_qbsolv-0.3.3-cp37-cp37m-win32.whl (49.7 kB view details)

Uploaded CPython 3.7mWindows x86

dwave_qbsolv-0.3.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (204.7 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.5+ x86-64

dwave_qbsolv-0.3.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl (190.5 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.5+ i686

dwave_qbsolv-0.3.3-cp36-cp36m-win_amd64.whl (57.2 kB view details)

Uploaded CPython 3.6mWindows x86-64

dwave_qbsolv-0.3.3-cp36-cp36m-win32.whl (49.7 kB view details)

Uploaded CPython 3.6mWindows x86

dwave_qbsolv-0.3.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (205.3 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.5+ x86-64

dwave_qbsolv-0.3.3-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl (191.5 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.5+ i686

File details

Details for the file dwave-qbsolv-0.3.3.tar.gz.

File metadata

  • Download URL: dwave-qbsolv-0.3.3.tar.gz
  • Upload date:
  • Size: 90.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.1 requests/2.26.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/2.7.18

File hashes

Hashes for dwave-qbsolv-0.3.3.tar.gz
Algorithm Hash digest
SHA256 aa5ac45698dc6254b603aa41c62e9a59043d9c03f8be131b134c9800a23f7d34
MD5 dfb4c58a6395d4f13499532c057b4f3b
BLAKE2b-256 201f9154bec02fdd36dd49eb48fbf6d77aed939a600a7dfaa4989d68277cf27e

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: dwave_qbsolv-0.3.3-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 57.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.1

File hashes

Hashes for dwave_qbsolv-0.3.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 3bff222dfb7f02bca11767e6dec33a1a3103e0733be2000bd2541f4398674019
MD5 8802ad282bdc323dd490ee2c3e9ef459
BLAKE2b-256 2141e265dce35affa0b66e8ef09148b3c43e96c9fc5c42d173ebd6ad87831f26

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp39-cp39-win32.whl.

File metadata

  • Download URL: dwave_qbsolv-0.3.3-cp39-cp39-win32.whl
  • Upload date:
  • Size: 50.3 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.1

File hashes

Hashes for dwave_qbsolv-0.3.3-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 e3771461bd7029c1f8a167093bb600fb362814099b904e35db1fb32b72c5259e
MD5 fe0e449e7db533f17525e798bfc39da5
BLAKE2b-256 a71b3e901966a3153c3a0f95aaf4ba9c6b0f44299f77a00aaaead09101427aab

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for dwave_qbsolv-0.3.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2ce4e36863725ee504ca6cf8de57f0696e1c83b4b322c7a368740e8f6852d5dd
MD5 6b427cfd7dd0bb6855a35dc5dfb2d402
BLAKE2b-256 5322bf228188aee18e4b94c86205dd0c64048ff2b233be40bc0215df89501582

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for dwave_qbsolv-0.3.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 e687c7c073cf97dd25a52ba154dffc87b2b9a13687ab1fda89b0d5d36685b4a9
MD5 469aee939fa4b1ca0ec40aa5813499fc
BLAKE2b-256 4f1bed31af6b677be429259b0284f886df1779e518d243f1ddca0e3a39f9fdd6

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: dwave_qbsolv-0.3.3-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 58.2 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.7

File hashes

Hashes for dwave_qbsolv-0.3.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e751caa57a41c83a4ffbebc09879c24bb08588678ef4f1cae2fdd5f8506c2a24
MD5 5c0f58c4b858ae647af741c9f1982800
BLAKE2b-256 0e6851877480c5e58d5f76a8a0f55054920280f1c25aa97a1e24a39908f0e727

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp38-cp38-win32.whl.

File metadata

  • Download URL: dwave_qbsolv-0.3.3-cp38-cp38-win32.whl
  • Upload date:
  • Size: 50.5 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.7

File hashes

Hashes for dwave_qbsolv-0.3.3-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 f1bef7dcbc91e335c5d15ec5188de14fc05256d7662d702e31a6623cfc009b03
MD5 e2d972482488f00604cccebe0d7c8368
BLAKE2b-256 c9e5b39ee3f904748fd1df13fb2f1a1f318dadd73f4959a977d4ce75780949f5

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for dwave_qbsolv-0.3.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c23e382cfa3575a5345e6ec79132da981f985848c3f40c12ed2c524fe1001c58
MD5 8ab2a8a56e58dc5b53d24682856ba858
BLAKE2b-256 5ab83a9cd707e39dc53a2b2d0fe8436223f3a7303003bc3d6872af72ce971ba6

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for dwave_qbsolv-0.3.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 0f148f27cfd089f0e052f4ed5cc151040ad99d1ecd33ab3e96061e8341dd843c
MD5 cce14f6862c2d6d4bfe2485e2fedfea1
BLAKE2b-256 0b0911f503047783a3318b26a5b5ae0897280061df62bb992d952c8d0d13c310

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: dwave_qbsolv-0.3.3-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 57.2 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.9

File hashes

Hashes for dwave_qbsolv-0.3.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 fa942eb1f15abd324be0d9a076d82429d8b5447344154f2a4e143e3005404ca8
MD5 5d2e30b8e0b738a3f987156348fff66a
BLAKE2b-256 4d86e0e0e87278a938b8905d179b057c64061a63e36d8e4f065b88997a0ab4e2

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp37-cp37m-win32.whl.

File metadata

  • Download URL: dwave_qbsolv-0.3.3-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 49.7 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.9

File hashes

Hashes for dwave_qbsolv-0.3.3-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 b2032a5fa7dd0c73f381006bdf6b536050d243d78b83764472e39e55ec491389
MD5 dc1c56b4fef70bef7244ab7bdf076b61
BLAKE2b-256 8186c000a1f8b90696bfd870400e7ef1b5ad585030722b70b8be7d600053f6a9

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for dwave_qbsolv-0.3.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 cfbef14c9ca23a9db9d442e3f2c84f221eeb0f532542c060b3820bff1c0f01a0
MD5 519dd329cc62e83f90d118cb6adaacd9
BLAKE2b-256 ca16d3fb338542534ee4a225a6df2b5433b5ee1e0861abbe8da43c0defb34a86

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for dwave_qbsolv-0.3.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 4f18bedb63001e0bfbc66daabd4d1e90745a3dbbfb85ab0b6f05bf70d1bcecfb
MD5 b78676ed18e5904c1648667b6245c49c
BLAKE2b-256 003da786cebda54a901ad6610761dcb01f7eb313baac98dfef1f9570149536b8

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: dwave_qbsolv-0.3.3-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 57.2 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.6.8

File hashes

Hashes for dwave_qbsolv-0.3.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 9dfa0556b8b31e5e5136d1249628d3dc55d734bdc34d651c38a5f34979048537
MD5 4e582ddbae5a5d778c31155b0da41f06
BLAKE2b-256 a7f0848a98b829ad3c0a72e3fd2e798107ade8ebb42dc80d84bfa97b9e858265

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp36-cp36m-win32.whl.

File metadata

  • Download URL: dwave_qbsolv-0.3.3-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 49.7 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.6.8

File hashes

Hashes for dwave_qbsolv-0.3.3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 6c344e6a1102f5be07e4bb3ea81772096c6c18892c78ae5c80b8d0c340c9222a
MD5 ad059270953f33ba151a9c21828dc601
BLAKE2b-256 343353a04a72c51875dc845301d787ee23c3cbf44f6e9321529e9306ef769dc5

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for dwave_qbsolv-0.3.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e67e89f800f14f0f8b669d369460ac1ea0dc205807846a14a2515568b5422f3f
MD5 c3d040128af4b9aa97f2e430f8ad54ed
BLAKE2b-256 0b34c216baefb25702fe5d55775ad0c6c05ef59b6b8b9f0b5693065db6d902c1

See more details on using hashes here.

File details

Details for the file dwave_qbsolv-0.3.3-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for dwave_qbsolv-0.3.3-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 9a357b696c544be6f8b27c25920472ed0268790fd25b91a77360e69de2ce0471
MD5 8f20d69fe280bee9d3f19858d523ce86
BLAKE2b-256 c9ef2004cf7f9baf8615fdec35de8121e007b2cf0950e8da74bb72a67183b76b

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 Sentry Error logging StatusPage Status page