A QUBO, Quadratic Unconstrained Binary Optimization, is a type of optimization problem where the aim is to find the best combination of binary choices (0/1) to maximize or minimize a quadratic objective function. It involves no constraints except that the variables are binary.
The QUBO model's significance in combinatorial optimization is heightened by its equivalence to the Ising model, which is prominent in physics. Consequently, the broad range of optimization problems solved effectively by state-ofthe-art QUBO solution methods are joined by an important domain of problems arising in physics applications.
The reformulation is derived from, A Tutorial on Formulating and Using QUBO Models. Glover, F., Kochenberger, G., & Du, Y. 2019. Following are some examples included to test the qubo reformulation.
Once the problem is defined, it can be solved through the qubo reformulation by including the qubo_solve.gms
using $batinclude. The qubo_solve.gms
file should be in the same location where the main gms file is located. If not, the location of the file must be specified by either including it in the $batinclude statement, for e.g., $batinclude 'location\of\the\file\qubo_solve.gms'
or by setting the command line parameter, -IDIR
.
The qubo_solve.gms
requires the following 5 positional arguments. Since they are positional arguments they must be in the exact order as mentioned below.
Following is the list of optional -key=val
pair arguments, some of which are method specific.
-method=classic
).-method=qpu
)-method=classic
)examiner
tool.modelName_p(penalty)_c(total_offset).csv
Note: Generating the API key and setting up the Python-Dwave Environment is considered to be available when chosen method of solving is qpu
.
$batinclude
statement. For e.g., $batinclude qubo_solve.gms setPacking MIP max z 6 -solver=cplex -timeLimit=60 -numThreads=2 -logOn=2
-IDIR=<path//to//qubo_solve.gms>
in the parameter editor and hit the run button (or press F9)gams '.\QAP.gms' -IDIR=<path//to//qubo_solve.gms>
The script generates two gdx files. One for the standard problem which is saved as modelName.gdx
and another for the reformulted model, saved as qout_modeName.gdx
. A successful run will then return the level of binary variables and the objective variable.
Note: In order to binarize the right hand side of each constraint, the reformulation needs to generate slack variables depending on the RHS. The number of binary variables to be generated for a number $x$ is $2^n$ where n = $log_2(x)$ . This with the fact that there can be many constraints, can make the reformulation computationally challenging.
iobj
must be nonzero in the gdx file created by Convert.The reformulation will throw appropriate exceptions if the limitations are not statisfied.
The file test_qubo_solve.gms
tests the correctness of qubo_solve in certain scenarios. The test file should be in the same location as qubo_solve.gms
. There is a test for checking the correctness of the reformulation and solution obtained from the Dwave QPU. This is not enabled by default. In order to enable this test one should run the file with the command line option --TESTDWAVE=yes
. It follows that the required python packages are already present in the python environment defined by GMSPYTHONLIB
.
A penalty value that is too large can impede the solution process as the penalty terms overwhelm the original objective function information, making it difficult to distinguish the quality of one solution from another. On the other hand, a penalty value that is too small jeopardizes the search for feasible solutions. Generally, there is a ‘Goldilocks region’ of considerable size that contains penalty values that work well. A little preliminary thought about the model can yield a ballpark estimate of the original objective function value. Taking P to be some percentage (75% to 150%) of this estimate is often a good place to start. In the end, solutions generated can always be checked for feasibility, leading to changes in penalties and further rounds of the solution process as needed to zero in on an acceptable solution.
The QUBO reformulation tool has been developed under the financial support of:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4