# An Efficient Closed-Form Formula for Evaluating r-Flip Moves in Quadratic Unconstrained Binary Optimization

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

- (a)
- The execution of an implementation of an r-flip local search, for a larger value of r, can be computationally expensive to execute. This is because the size of the search space is of order n chosen r, and for fixed values of n, it grows quickly in r for the value of $r\le \u230an/2\u230b$. Hence, smaller values of r, especially r equal to 1 and 2, have shown considerable success.
- (b)
- In practice, an r-flip local search process with a small value of r (e.g., r = 1) can quickly reach local optimality. Thus, as a way to escape 1-flip local optimality, researchers have tried to dynamically change the value of r as the search progressed. This offers an opportunity to expand the search to a more diverse solution space.

#### Previous Works

- n: The number of variables;
- x: A starting feasible solution;
- x*: The best solution found so far by the algorithm;
- K: The largest value of k for r-flip, k $\le $ r;
- Π(i): The i-th element of x in the order π(1)⋯π(n);
- S: = {i:x
_{i}is tentatively chosen to receive a new value to produce a new solution x_{i}′} restricting consideration to |S| = r; - D: The set of candidates for an improving move;
- Tabu_ten: The maximum number of iterations for which a variable can remain tabu;
- Tabu(i): A vector representing tabu status of x;
- $E\left({x}_{i}\right)$: Derivative of f(x) with respect to ${x}_{i}$;
- $E\left(x\right)=\left(E\right({x}_{1}),\dots ,E({x}_{n}\left)\right)$ The vector of derivatives;
- X(.): A vector representing the solution of x;
- E(.): A vector representing the value of derivative $E\left({x}_{i}\right)$.

Algorithm 1: 1-flip local search. |

Initialize: n, x, evaluate the vector E(x) Flag = 1 1 Do while (Flag = 1) 2 Flag = 0 3 Randomly choose a sequence $\pi \left(1\right),\dots ,\pi \left(n\right)$ of integers 1,…,n. 4 Do I = $\pi \left(1\right),\dots ,\pi \left(n\right)$ 5 If $\left(E\right({x}_{i})<0$$\mathit{and}{x}_{i}=1$$)\mathit{or}(E\left({x}_{i}\right)0$$\mathit{and}{x}_{i}=0$): ${x}_{i}=1-{x}_{i}$, update the vector E(x) using Equation (6), Flag = 1 6 End do 7 End while |

Algorithm 2: Exhaustive r-flip local search. |

Initialize: n, x, evaluate the vector E(x), value of r Flag = 1 1 Do while (Flag = 1) 2 Flag = 0 3 For each combination $S\subset N$$\mathit{and}\left|S\right|\le r,$$\mathit{evaluate}\u2206f$, Equation (7): $\mathit{If}\u2206f$ > 0: ${x}_{i}=1-{x}_{1},$$\mathit{for}i\in S$, update E(x) using Equation (8), Flag = 1 4 End while |

## 2. New Results on Closed-Form Formulas

**Lemma**

**1.**

**Proof.**

**Lemma**

**2.**

**Proof.**

**Theorem**

**1.**

**Proof.**

**Proposition**

**1.**

**Proof.**

**Example**

**1.**

#### 2.1. Strategy 1

**Lemma**

**3.**

**Proof.**

- I.
- The smaller the value of $\left|E\right({x}_{i}\left)\right|$ is, the more likely that ${x}_{i}$ is involved in an improving k-flip move for k ≤ r (this might be due to the fact that the right-hand-side value M in Equation (20) for a given r is constant. Thus, smaller values of $\left|E\right({x}_{i}\left)\right|$ on the left-hand side might help to satisfy the inequality more easily.
- II.
- Because the elements of D(n) are in ascending order of absolute values of derivatives, a straightforward implementable series of alternatives to be considered for improving subsets, S, may be the elements of the set given in Equation (22). Note that there are many more subsets of D(n) compared to the sets in Equation (21) that are candidates for consideration in possible k-flip moves. Here, we only provide one possible efficient implementable strategy.

**Proposition**

**2.**

**Proof.**

#### 2.2. Strategy 2

**Corollary**

**1**

- Step 1. Randomly initialize a solution to the problem. For each value of r, calculate M. Apply the algorithm in Algorithm 1 and generate a locally optimal solution x with respect to a 1-flip search. However, in Step 5 of Algorithm 1, only consider the derivatives with $\left|E\right({x}_{i}\left)\right|<M$.
- Step 2. Find the number of elements in set D(1) for x.
- Step 3. Repeat steps 1 and 2 200 times for each problem and find the average number of elements in set D(1) for the same size problem, density, and r-value.

#### 2.3. Implementation Details

Algorithm 3: r-flip local search: strategy 1 |

Initialize: n, x, evaluate vector E(x), value of r, M Flag = 1 1 Do while (Flag = 1) 2 Flag = 0 3 Call 1-flip local search: Algorithm 1 4 Sort variables according to$\left|E\left({x}_{\pi \left(i\right)}\right)\right|\le \left|E\left({x}_{\pi \left(i+1\right)}\right)\right|,$ using Inequality (20) evaluate value of K 5 For$j=\pi \left(1\right),\cdots ,\pi \left(K\right):$ 6 For${S}_{j}=\left\{\pi \left(1\right),\cdots ,\pi \left(j\right)\right\},$$\mathit{evaluate}{M}_{{S}_{j}}$ $\mathit{If}{\sum}_{i=1}^{j}\left|E\left({x}_{\pi \left(i\right)}\right)\right|{M}_{{S}_{j}}$, evaluate ∆f using Equation (7). 7 If$\u2206f$ > 0: ${x}_{i}=1-{x}_{i},$$\mathrm{for}i\in {S}_{j},$ update E(x) using Equation (8), Flag = 1, go to Step 1 8 End for 9 End while |

Algorithm 4: r-flip local search: strategy 2 |

Initialize: n, x, evaluate E(x), value of r, M Flag = 1 1 Do while (Flag = 1) 2 Flag $=0,\mathit{and}S=\varnothing $ 3 Call 1-flip local search: Algorithm 1 4 Randomly choose a sequence$\pi \left(1\right),\cdots ,\pi \left(n\right)$$\mathit{of}\mathit{integers}1,\cdots ,n$ 5 For$j=\pi \left(1\right),\cdots ,\pi \left(n\right)$: 6 If$\left|E\left({x}_{j}\right)\right|M,$$\mathit{and}\left|S\cup \left\{j\right\}\right|\le r$$\mathit{evaluate}\u2206f$$\mathit{for}S\cup \left\{j\right\}$ using Equation (7) 7 If$\u2206f$ > 0: ${x}_{i}=1-{x}_{i},$$\mathit{for}i\in S\cup \left\{j\right\},$ update E(x) using Equation (8),$S=S\cup \left\{j\right\},$ Flag =1, go to Step 1 8 End for 9 End while |

Algorithm 5: Hybrid r-flip/1-flip local search embedded with a simple tabu search algorithm |

Initialize: n, x, tabu list, evaluate E(x), value of r, M, tabu tenure Call local search: Algorithm 4 Do while (until some stopping criteria, e.g., CPU time limit, is reached) Call Destruction() Call Construction() Call randChange() End while |

- Step 3a. Find the variable that is not on the tabu list and lead to the small change to the solution when the variable is flipped.
- Step 3b. Change its value, place it on the tabu list to update the tabu list, and update E(x).
- Step 3c. Test whether there is any variable that is not on the tabu list and that can improve the solution. If not, go to Step 3a.

- Step 4a. Test all of the variables that are not on the tabu list. If a solution better than the current best solution is found, change its value, place it on the tabu list, update E(x), update the tabu list, and go to Step 1.
- Step 4b. Find the index i corresponding to the greatest value of E(x
_{i}), change its value of x_{i}, place it on the tabu list to update the tabu list, and update E(x). - Step 4c. If this is the 15th iteration in the Construction() procedure, go to Step 1.
- Step 4d. Test whether there is any variable that is not on the tabu list and that can improve the solution. If not, go to Step 3a. If yes, go to Step 4a.

## 3. Computational Results

- OFV: The value of the objective function for the best solution found by each algorithm;
- BFS: The best solution found among algorithms within the CPU time limit;
- TB [s]: Time for each algorithm to reach the best solution in seconds;
- AT [s]: Average computing time out of 10 runs to reach OFV;
- DT: % Deviation of computing time out of 10 runs to reach OFV.

^{−4}even though not all runs found the same OFV. We used 0.000 as the value of RSD when the value was rounded up to three decimal points.

## 4. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## Appendix A. Numerical Example for Theorem 1 and Proposition 1

x(.) | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | |

E(.) | 624 | 177 | −74 | −459 | 209 | −7 | 44 | −7 | −120 | 523 | −124 | 233 | 22 | 114 | −3 | 431 | 375 | −89 | 242 | −66 | |

f(x) | 1528 | 624 | 127 | 0 | 0 | 55 | 0 | 70 | 0 | 0 | 383 | 0 | 3 | 58 | 104 | 0 | 89 | −5 | 0 | 20 | 0 |

_{1}) = −30 + (50 ∗ 1 – 68 ∗ 0 – 66 ∗ 0 + 94 ∗ 1 – 100 ∗ 0 – 20 ∗ 1 – 4 ∗ 0 + 80 ∗ 0 + 94 ∗ 1 + 0 ∗ 0 + 86 ∗ 1 + 76 ∗ 1 + 98 ∗ 1 − 36 ∗ 0 + 76 ∗ 1 + 52 ∗ 1 − 8 ∗ 0 + 48 ∗ 1 + 42 ∗ 0) = 624

_{2}) = −7 + 50 ∗ 1 + (50 ∗ 0 + 28 ∗ 0 + 60 ∗ 1 + 56 ∗ 0 − 54 ∗ 1 + 78 ∗ 0 + 4 ∗ 0 + 30 ∗ 1 − 42 ∗ 0 − 28 ∗ 1 − 50 ∗ 1 + 90 ∗ 1 − 42 ∗ 0 + 90 ∗ 1 − 26 ∗ 1 + 6 ∗ 0 + 22 ∗ 1 + 0 ∗ 0) = 177

_{3}) = −26 + (−68 ∗ 1 + 50 ∗ 1) + (−46 ∗ 0 + 26 ∗ 1 + 82 ∗ 0 − 50 ∗ 1 − 90 ∗ 0 + 44 ∗ 0 − 94 ∗ 1 + 54 ∗ 0 + 52 ∗ 1 − 50 ∗ 1 + 54 ∗ 1 − 68 ∗ 0 − 52 ∗ 1 + 20 ∗ 1 + 96 ∗ 0 + 64 ∗ 1 − 22 ∗ 0) = −74

_{4}) = −35 + (−66 ∗ 1 + 28 ∗ 1 − 46 ∗ 0) + (8 ∗ 1 − 82 ∗ 0 − 84 ∗ 1 − 46 ∗ 0 − 34 ∗ 0 − 22 ∗ 1 − 62 ∗ 0 − 34 ∗ 1 − 56 ∗ 1 − 86 ∗ 1 + 18 ∗ 0 + 44 ∗ 1 − 84 ∗ 1 + 2 ∗ 0 − 72 ∗ 1 − 60 ∗ 0) = −459

_{5}) to E(x

_{19})

_{20}) = 22 + (42 ∗ 1 + 0 ∗ 1 − 22 ∗ 0 − 60 ∗ 0 + 14 ∗ 1 + 2 ∗ 0 − 70 ∗ 1 + 94 ∗ 0 − 16 ∗ 0 + 0 ∗ 1 + 52 ∗ 0 + 28 ∗ 1 − 96 ∗ 1 + 64 ∗ 1 − 34 ∗ 0 + 10 ∗ 1 − 26 ∗ 1 + 80 ∗ 0 − 54 ∗ 1) = −66

_{1}) = 1 ∗ (−30 + 50 + 94 − 20 + 94 + 86 + 76 + 98 + 76 + 52 + 48) = 624

_{2}) = 1 ∗ (−7 + 60 − 54 + 30 − 28 − 50 + 90 + 90 − 26 + 22) = 127

_{3}) = 0 ∗ (26 − 50 − 94 + 52 − 50 + 54 − 52 + 20 + 64) = 0

_{4}) to f(x

_{19})

_{20}) = 0 ∗ (22) = 0

**Figure A2.**The indicated elements satisfy Proposition 1. Only the two-element combinations indicated by the red font can improve f(x), which satisfies Theorem 1, whereas the ones indicated by the black font cannot.

**Table A2.**An improvement using 2-flip for the locally optimal solution, x, and values of E(x

_{i}), i = 1, …, n.

x(.) | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | |

E(.) | 646 | 267 | −204 | −463 | 275 | −83 | −120 | 199 | −270 | 367 | −78 | 269 | 58 | 348 | 49 | 347 | 361 | −123 | 78 | 64 | |

f(x) | 1684 | 646 | 217 | 0 | 0 | 121 | 0 | 0 | 35 | 0 | 315 | 0 | 83 | 10 | 240 | −39 | 99 | −31 | 0 | −34 | 22 |

_{1}) = 1 ∗ (−30 + 50 + 94 − 4 + 94 + 86 + 76 + 98 − 36 + 76 + 52 + 48 + 42) = 646

_{2}) = 1 ∗ (−7 + 60 + 78 + 30 − 28 − 50 + 90 − 42 + 90 − 26 + 22) = 217

_{3}) to f(x

_{18})

_{19}) = 1 ∗ (20 − 54) = −34

_{20}) = 1 ∗ (22) = 22

1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1684 |

1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 1646 |

1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 1633 |

1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1616 |

1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 1601 |

1 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 1530 |

1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 1528 |

Study | r-Flip Rules |
---|---|

Debevre, P, Sugimura, M, and Parizy, M, Ieee Access, 2023 [2]. | The automotive paint shop problem was formulated as QUBO, then 1-flip and multiple flip moves provided for the solution. |

Glover, F, and Hao, J-K, Int. J. Metaheuristics, 2010 [6]. | An efficient evaluation of 2-flip moves for QUBO was presented. |

Glover, F, and Hao, J-K, Annals of Operations Research, 2016 [7]. | A class of approaches called f-flip strategies that include a fractional value for f is provided for QUBO. |

Lozano, M, Molina, D, and Garcia-Martinez, C, European Journal of Operational Research, 2011 [10]. | A maximum diversity QUBO problem was considered with an added number of variables that must be equal to an integer m. A 2-flip strategy with computational experiment was presented. |

Alidaee, B., G. Kochenberger, and H. Wang, Int. J. Appl. Metaheuristic Comput., 2010 [11]. | Several theoretical results for r-flip moves in a general pseudo-Boolean optimization including QUBO were demonstrated. |

Anacleto, E, Meneses, C, Ravelo, S, Computers & Operations Research, 2020 [12]. | Two closed-form formulas for evaluating r-flip moves were presented. The effectiveness of the moves was evaluated experimentally. |

Anacleto, E, Meneses, C, and Liang, T, Computers & Operations Research, 2021 [13]. | An r-flip move strategy for a quadratic assignment problem that can be transferred to QUBO was considered. A closed-form formula and experimental evaluations were considered. |

Katayama, K, and Naihisa, H, in: W. Hart, N. Krasnogor, J.E. Smith (Eds.), Recent Advances in Memetic Algorithms, Springer, Berlin, 2004 [30]. | A k-flip move in the context of a memetic algorithm was presented. |

Liang, R.N, Anacleto, E.A.J, and Meneses, C.N. Computers & Operations Research, 2023 [31]. | A closed-form formula for pseudo-Boolean optimization and data structure for efficient implementation of the 1-flip rule was presented. |

Merz, P, and Freisleben, B, Journal of Heuristics, 2002 [32]. | Provided 1-flip and multiple-flip strategies for QUBO and provided a computational experiment. |

Rosenberg, G., Vazifeh, M, Woods, B, and Haber, E, Computational Optimization and Applications, 2016 [33]. | A k-flip strategy in the context of a quantum annealer was presented. |

Alidaee, B., Wang, H., and Liu, W. Working Paper, WP 2021-002. Texas A&M International University, 2022 [34]. | New Results on Closed-Form Formulas for Evaluating r-flip Moves in Quadratic Unconstrained Binary Optimization. |

## References

- Boros, E.; Hammer, P.L.; Minoux, M.; Rader, D.J. Optimal cell flipping to minimize channel density in VLSI design and pseudo-Boolean optimization. Discret. Appl. Math.
**1999**, 90, 69–88. [Google Scholar] [CrossRef] - Debevre, P.; Sugimura, M.; Parizy, M. Quadratic Unconstrained Binary Optimization for the Automotive Paint Shop Problem. IEEE Access
**2023**, 11, 97769–97777. [Google Scholar] [CrossRef] - Glover, F.; Kochenberger, G.; Du, Y. Quantum Bridge Analytics I: A tutorial on formulating and using QUBO models. Ann. Oper. Res.
**2019**, 17, 335–371. [Google Scholar] [CrossRef] - Glover, F.; Kochenberger, G.A.; Alidaee, B. Adaptive Memory Tabu Search for Binary Quadratic Programs. Manag. Sci.
**1998**, 44, 336–345. [Google Scholar] [CrossRef] - Glover, F.; Lü, Z.; Hao, J.-K. Diversification-driven tabu search for unconstrained binary quadratic problems. 4OR
**2010**, 8, 239–253. [Google Scholar] [CrossRef] - Glover, F.; Hao, J.-K. Fast two-flip move evaluations for binary unconstrained quadratic optimisation problems. Int. J. Metaheuristics
**2010**, 1, 100–108. [Google Scholar] [CrossRef] - Glover, F.; Hao, J.-K. f-Flip strategies for unconstrained binary quadratic programming. Ann. Oper. Res.
**2016**, 238, 651–657. [Google Scholar] [CrossRef] - Kochenberger, G.; Hao, J.-K.; Glover, F.; Lewis, M.; Lü, Z.; Wang, H.; Wang, Y. The unconstrained binary quadratic programming problem: A survey. J. Comb. Optim.
**2014**, 28, 58–81. [Google Scholar] [CrossRef] - Kochenberger, G.A.; Glover, F.; Wang, H. Binary Unconstrained Quadratic Optimization Problem. In Handbook of Combinatorial Optimization; Pardalos, P.M., Du, D.-Z., Graham, R.L., Eds.; Springer: New York, NY, USA, 2013; pp. 533–557. [Google Scholar]
- Lozano, M.; Molina, D.; Garcia-Martinez, C. Iterated greedy for the maximum diversity problem. Eur. J. Oper. Res.
**2011**, 214, 31–38. [Google Scholar] [CrossRef] - Alidaee, B.; Kochenberger, G.; Wang, H. Theorems Supporting r-flip Search for Pseudo-Boolean Optimization. Int. J. Appl. Metaheuristic Comput.
**2010**, 1, 93–109. [Google Scholar] [CrossRef] - Anacleto, E.A.J.; Meneses, C.N.; Ravelo, S.V. Closed-form formulas for evaluating r-flip moves to the unconstrained binary quadratic programming problem. Comput. Oper. Res.
**2020**, 113, 104774. [Google Scholar] [CrossRef] - Anacleto, E.; Meneses, C.; Liang, T. Fast r-flip move evaluations via closed-form formulae for Boolean quadraticprogramming problems with generalized upper bound constraints. Comput. Oper. Res.
**2021**, 132, 105297. [Google Scholar] [CrossRef] - Glover, F.; Lewis, M.; Kochenberger, G. Logical and inequality implications for reducing the size and difficulty of quadratic unconstrained binary optimization problems. Eur. J. Oper. Res.
**2018**, 265, 829–842. [Google Scholar] [CrossRef] - Lewis, M.; Glover, F. Quadratic Unconstrained Binary Optimization Problem Preprocessing: Theory and Empirical Analysis. Networks
**2017**, 70, 79–97. [Google Scholar] [CrossRef] - Vredeveld, T.; Lenstra, J.K. On local search for the generalized graph coloring problem. Oper. Res. Lett.
**2003**, 31, 28–34. [Google Scholar] [CrossRef] - Kochenberger, G.; Glover, F. Introduction to special xQx issue. J. Heuristics
**2013**, 19, 525–528. [Google Scholar] [CrossRef] - Ahuja, R.K.; Ergun, Ö.; Orlin, J.B.; Punnen, A.P. A survey of very large-scale neighborhood search techniques. Discret. Appl. Math.
**2002**, 123, 75–102. [Google Scholar] [CrossRef] - Ahuja, R.K.; Orlin, J.B.; Pallottino, S.; Scaparra, M.P.; Scutellà, M.G. A Multi-Exchange Heuristic for the Single-Source Capacitated Facility Location Problem. Manag. Sci.
**2004**, 50, 749–760. [Google Scholar] [CrossRef] - Yagiura, M.; Ibaraki, T. Analyses on the 2 and 3-Flip Neighborhoods for the MAX SAT. J. Comb. Optim.
**1999**, 3, 95–114. [Google Scholar] [CrossRef] - Yagiura, M.; Ibaraki, T. Efficient 2 and 3-Flip Neighborhood Search Algorithms for the MAX SAT: Experimental Evaluation. J. Heuristics
**2001**, 7, 423–442. [Google Scholar] [CrossRef] - Yagiura, M.; Kishida, M.; Ibaraki, T. A 3-flip neighborhood local search for the set covering problem. Eur. J. Oper. Res.
**2006**, 172, 472–499. [Google Scholar] [CrossRef] - Alidaee, B. Fan-and-Filter Neighborhood Strategy for 3-SAT Optimization, Hearin Center for Enterprise Science; The University of Mississippi, Hearin Center for Enterprise Science: Oxford, MS, USA, 2004. [Google Scholar]
- Glover, F. A Template for Scatter Search and Path Relinking; Springer: Berlin/Heidelberg, Germany, 1998. [Google Scholar]
- Ivanov, S.V.; Kibzun, A.I.; Mladenović, N.; Urošević, D. Variable neighborhood search for stochastic linear programming problem with quantile criterion. J. Glob. Optim.
**2019**, 74, 549–564. [Google Scholar] [CrossRef] - Mladenović, N.; Hansen, P. Variable neighborhood search. Comput. Oper. Res.
**1997**, 24, 1097–1100. [Google Scholar] [CrossRef] - Alidaee, B.; Sloan, H.; Wang, H. Simple and fast novel diversification approach for the UBQP based on sequential improvement local search. Comput. Ind. Eng.
**2017**, 111, 164–175. [Google Scholar] [CrossRef] - Palubeckis, G. Multistart Tabu Search Strategies for the Unconstrained Binary Quadratic Optimization Problem. Ann. Oper. Res.
**2004**, 131, 259–282. [Google Scholar] [CrossRef] - Glen, S. Relative Standard Deviation: Definition & Formula. 2014. Available online: https://www.statisticshowto.com/relative-standard-deviation/ (accessed on 10 November 2023).
- Katayama, K.; Naihisa, H. An Evolutionary Approach for the Maximum Diversity Problem; Hart, W., Krasnogor, N., Smith, J.E., Eds.; Recent Advances in Memetic Algorithms; Springer: Berlin/Heidelberg, Germany, 2004; pp. 31–47. [Google Scholar]
- Liang, R.N.; Anacleto, E.A.J.; Meneses, C.N. Fast 1-flip neighborhood evaluations for large-scale pseudo-Boolean optimization using posiform representation. Comput. Oper. Res.
**2023**, 159, 106324. [Google Scholar] [CrossRef] - Merz, P.; Freisleben, B. Greedy and Local Search Heuristics for Unconstrained Binary Quadratic Programming. J. Heuristics
**2002**, 8, 197–213. [Google Scholar] [CrossRef] - Rosenberg, G.; Vazifeh, M.; Woods, B.; Haber, E. Building an iterative heuristic solver for a quantum annealer. Comput. Optim. Appl.
**2016**, 65, 845–869. [Google Scholar] [CrossRef] - Alidaee, B.; Wang, H.; Liu, W. New Results on Closed-Form Formulas for Evaluating r-flip Moves in Quadratic Unconstrained Binary Optimization; Working Paper Series, WP 2021-002; Texas A&M International University: Laredo, TX, USA, 2022. [Google Scholar]

r = 2 | r = 3 | r = 4 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|

Density | ||||||||||||

Prob. Size | 0.1 | 0.3 | 0.5 | 0.8 | 0.1 | 0.3 | 0.5 | 0.8 | 0.1 | 0.3 | 0.5 | 0.8 |

2500 | <100 | <40 | <30 | <20 | <400 | <200 | <100 | <100 | <1000 | <500 | <300 | <200 |

3000 | <100 | <40 | <30 | <20 | <400 | <200 | <100 | <100 | <1100 | <500 | <400 | <250 |

4000 | <100 | <30 | <30 | <20 | <500 | <200 | <100 | <100 | <1200 | <600 | <400 | <250 |

5000 | <100 | <30 | <30 | <20 | <500 | <200 | <100 | <100 | <1300 | <600 | <400 | <250 |

6000 | <100 | <30 | <30 | <20 | <500 | <200 | <100 | <100 | <1400 | <600 | <400 | <250 |

Instance ID | Algorithm 3 | Algorithm 4 | Algorithm 5 | |||||
---|---|---|---|---|---|---|---|---|

Size | Density | OFV | TB (s) | OFV | TB (s) | OFV | TB (s) | |

p30000_1 | 30,000 | 0.5 | 127,239,168 | 591 | 127,292,467 | 591 | 127,336,719 | 592 |

p30000_2 | 30,000 | 0.8 | 158,439,036 | 572 | 158,472,098 | 555 | 158,526,518 | 571 |

p30000_3 | 30,000 | 1 | 179,192,241 | 584 | 179,219,781 | 587 | 179,261,723 | 590 |

**Table 3.**The solution quality of the MST2 algorithm and Algorithm 5 with CPU time limits of 60 and 600 s out of 10 runs.

Instance ID | MST2 with 60 s | r-Flip with 60 s | MST2 with 600 s | r-Flip with 600 s | ||||
---|---|---|---|---|---|---|---|---|

Size | Density | r = 1 | r = 2 | r = 1 | r = 2 | |||

p3000_1 | 3000 | 0.5 | 10 (0) | 10 (0) | 10 (0) | 10 (0) | 10 (0) | 10 (0) |

p3000_2 | 3000 | 0.8 | 10 (0) | 10 (0) | 10 (0) | 10 (0) | 10 (0) | 10 (0) |

p3000_3 | 3000 | 0.8 | 4 (0.01) | 7 (0.007) | 10 (0) | 10 (0) | 10 (0) | 10 (0) |

p3000_4 | 3000 | 1 | 10 (0) | 10 (0) | 10 (0) | 10 (0) | 10 (0) | 10 (0) |

p3000_5 | 3000 | 1 | 10 (0) | 9 (0.003) | 7 (0.002) | 9 (0.001) | 10 (0) | 10 (0) |

p4000_1 | 4000 | 0.5 | 10 (0) | 10 (0) | 10 (0) | 10 (0) | 10 (0) | 10 (0) |

p4000_2 | 4000 | 0.8 | 10 (0) | 10 (0) | 10 (0) | 9 (0.004) | 10 (0) | 10 (0) |

p4000_3 | 4000 | 0.8 | 10 (0) | 10 (0) | 10 (0) | 10 (0) | 10 (0) | 10 (0) |

p4000_4 | 4000 | 1 | 1 (0.033) | 10 (0) | 10 (0) | 10 (0) | 10 (0) | 10 (0) |

p4000_5 | 4000 | 1 | 10 (0) | 10 (0) | 10 (0) | 10 (0) | 10 (0) | 10 (0) |

p5000_1 | 5000 | 0.5 | 6 (0.000) | 1 (0.002) | 2 (0.002) | 10 (0) | 3 (0.002) | 2 (0.002) |

p5000_2 | 5000 | 0.8 | 10 (0) | 4 (0.003) | 1 (0.002) | 6 (0.012) | 10 (0) | 10 (0) |

p5000_3 | 5000 | 0.8 | 10 (0) | 7 (0.001) | 3 (0.002) | 10 (0) | 10 (0) | 10 (0) |

p5000_4 | 5000 | 1 | 10 (0) | 1 (0.002) | 1 (0.001) | 10 (0) | 3 (0.002) | 1 (0.001) |

p5000_5 | 5000 | 1 | 6 (0.021) | 9 (0.003) | 4 (0.004) | 10 (0) | 10 (0) | 10 (0) |

p6000_1 | 6000 | 0.5 | 10 (0) | 10 (0) | 4 (0.001) | 10 (0) | 10 (0) | 10 (0) |

p6000_2 | 6000 | 0.8 | 10 (0) | 4 (0.001) | 4 (0.001) | 1 (0.006) | 10 (0) | 9 (0) |

p6000_3 | 6000 | 1 | 9 (0.002) | 3 (0.002) | 1 (0.007) | 10 (0) | 10 (0) | 10 (0) |

p7000_1 | 7000 | 0.5 | 1 (0.002) | 1 (0.006) | 1 (0.007) | 10 (0) | 2 (0.002) | 4 (0.002) |

p7000_2 | 7000 | 0.8 | 7 (0.000) | 1 (0.008) | 1 (0.008) | 10 (0) | 1 (0.004) | 2 (0.004) |

p7000_3 | 7000 | 1 | 8 (0.011) | 3 (0.021) | 5 (0.023) | 10 (0) | 10 (0) | 10 (0) |

p8000_1 | 8000 | 0.5 | 10 (0) | 1 (0.004) | 1 (0.005) | 9 (0.001) | 10 (0) | 1 (0.002) |

p8000_2 | 8000 | 0.8 | 10 (0) | 1 (0.009) | 1 (0.008) | 10 (0) | 7 (0.003) | 10 (0) |

p8000_3 | 8000 | 1 | 10 (0) | 1 (0.013) | 1 (0.01) | 10 (0) | 4 (0.001) | 3 (0.002) |

p30000_1 | 30,000 | 0.5 | 1 (0.002) | 1 (0.023) | 1 (0.019) | 7 (0.018) | 1 (0.017) | 1 (0.011) |

p30000_2 | 30,000 | 0.8 | 10 (0) | 1 (0.017) | 1 (0.016) | 6 (0.01) | 1 (0.019) | 1 (0.013) |

p30000_3 | 30,000 | 1 | 10 (0) | 1 (0.015) | 1 (0.019) | 2 (0.037) | 1 (0.025) | 1 (0.019) |

**Table 4.**Results of the MST2 algorithm and r-flip strategy in Algorithm 5 within the CPU time limit of 60 s.

Instance ID | BFS (60 s) | MST2 (60 s) | r-Flip (60 s) | ||||
---|---|---|---|---|---|---|---|

OFV | TB (s) | OFV (r = 1) | TB (s) | OFV (r = 2) | TB (s) | ||

p3000_1 | 3,931,583 | 3,931,583 | 10 | 3,931,583 | 3 | 3,931,583 | 8 |

p3000_2 | 5,193,073 | 5,193,073 | 25 | 5,193,073 | 2 | 5,193,073 | 2 |

p3000_3 | 5,111,533 | 5,111,533 | 52 | 5,111,533 | 8 | 5,111,533 | 4 |

p3000_4 | 5,761,822 | 5,761,437 | 10 | 5,761,822 | 2 | 5,761,822 | 2 |

p3000_5 | 5,675,625 | 5,675,430 | 24 | 5,675,625 | 7 | 5,675,625 | 17 |

p4000_1 | 6,181,830 | 6,181,830 | 40 | 6,181,830 | 3 | 6,181,830 | 4 |

p4000_2 | 7,801,355 | 7,797,821 | 12 | 7,801,355 | 13 | 7,801,355 | 4 |

p4000_3 | 7,741,685 | 7,741,685 | 31 | 7,741,685 | 5 | 7,741,685 | 8 |

p4000_4 | 8,711,822 | 8,709,956 | 58 | 8,711,822 | 5 | 8,711,822 | 11 |

p4000_5 | 8,908,979 | 8,905,340 | 27 | 8,908,979 | 4 | 8,908,979 | 13 |

p5000_1 | 8,559,680 | 8,556,675 | 56 | 8,559,680 | 21 | 8,559,680 | 7 |

p5000_2 | 10,836,019 | 10,829,848 | 34 | 10,836,019 | 59 | 10,836,019 | 11 |

p5000_3 | 10,489,137 | 10,477,129 | 28 | 10,489,137 | 20 | 10,489,137 | 16 |

p5000_4 | 12,251,710 | 12,245,282 | 52 | 12,251,710 | 54 | 12,251,520 | 42 |

p5000_5 | 12,731,803 | 12,725,779 | 56 | 12,731,803 | 17 | 12,731,803 | 16 |

p6000_1 | 11,384,976 | 11,377,315 | 42 | 11,384,976 | 12 | 11,384,976 | 5 |

p6000_2 | 14,333,855 | 14,330,032 | 39 | 14,333,855 | 27 | 14,333,767 | 14 |

p6000_3 | 16,132,915 | 16,122,333 | 51 | 16,130,731 | 24 | 16,132,915 | 48 |

p7000_1 | 14,477,949 | 14,467,157 | 56 | 14,477,949 | 41 | 14,476,263 | 21 |

p7000_2 | 18,249,948 | 18,238,729 | 55 | 18,249,948 | 47 | 18,246,895 | 47 |

p7000_3 | 20,446,407 | 20,431,354 | 59 | 20,446,407 | 15 | 20,446,407 | 12 |

p8000_1 | 17,340,538 | 17,326,259 | 47 | 17,340,538 | 26 | 17,340,538 | 35 |

p8000_2 | 22,208,986 | 22,180,465 | 55 | 22,208,986 | 54 | 22,208,683 | 53 |

p8000_3 | 24,670,258 | 24,647,248 | 56 | 24,670,258 | 43 | 24,669,351 | 50 |

p30000_1 | 127,252,438 | 126,732,48,3 | 60 | 127,252,438 | 58 | 127,219,336 | 60 |

p30000_2 | 158,384,175 | 157,481,366 | 69 | 158,384,175 | 59 | 158,339,497 | 60 |

p30000_3 | 179,103,085 | 178,093,109 | 89 | 179,103,085 | 58 | 179,029,747 | 54 |

**Table 5.**Results of the MST2 algorithm and r-flip strategy in Algorithm 5 within the CPU time limit of 600 s.

Instance ID | BFS (600 s) | MST2 (600 s) | r-Flip (600 s) | ||||
---|---|---|---|---|---|---|---|

OFV | TB (s) | OFV (r = 1) | TB (s) | OFV (r = 2) | TB (s) | ||

p3000_1 | 3,931,583 | 3,931,583 | 11 | 3,931,583 | 5 | 3,931,583 | 5 |

p3000_2 | 5,193,073 | 5,193,073 | 25 | 5,193,073 | 1 | 5,193,073 | 3 |

p3000_3 | 5,111,533 | 5,111,533 | 52 | 5,111,533 | 30 | 5,111,533 | 8 |

p3000_4 | 5,761,822 | 5,761,822 | 269 | 5,761,822 | 1 | 5,761,822 | 2 |

p3000_5 | 5,675,625 | 5,675,625 | 505 | 5,675,625 | 43 | 5,675,625 | 29 |

p4000_1 | 6,181,830 | 6,181,830 | 40 | 6,181,830 | 4 | 6,181,830 | 2 |

p4000_2 | 7,801,355 | 7,800,851 | 530 | 7,801,355 | 8 | 7,801,355 | 8 |

p4000_3 | 7,741,685 | 7,741,685 | 30 | 7,741,685 | 5 | 7,741,685 | 2 |

p4000_4 | 8,711,822 | 8,711,822 | 67 | 8,711,822 | 2 | 8,711,822 | 7 |

p4000_5 | 8,908,979 | 8,906,525 | 65 | 8,908,979 | 4 | 8,908,979 | 13 |

p5000_1 | 8,559,680 | 8,559,075 | 324 | 8,559,680 | 9 | 8,559,680 | 27 |

p5000_2 | 10,836,019 | 10,835,437 | 541 | 10,836,019 | 17 | 10,836,019 | 21 |

p5000_3 | 10,489,137 | 10,488,735 | 400 | 10,489,137 | 29 | 10,489,137 | 38 |

p5000_4 | 12,252,318 | 12,249,290 | 265 | 12,252,318 | 127 | 12,251,848 | 143 |

p5000_5 | 12,731,803 | 12,731,803 | 265 | 12,731,803 | 19 | 12,731,803 | 32 |

p6000_1 | 11,384,976 | 11,384,976 | 406 | 11,384,976 | 8 | 11,384,976 | 39 |

p6000_2 | 14,333,855 | 14,333,767 | 498 | 14,333,855 | 62 | 14,333,855 | 17 |

p6000_3 | 16,132,915 | 16,128,609 | 239 | 16,132,915 | 60 | 16,132,915 | 71 |

p7000_1 | 14,478,676 | 14,477,039 | 344 | 14,478,676 | 92 | 14,478,676 | 397 |

p7000_2 | 18,249,948 | 18,242,205 | 587 | 18,249,948 | 115 | 18,249,844 | 43 |

p7000_3 | 20,446,407 | 20,431,833 | 109 | 20,446,407 | 47 | 20,446,407 | 21 |

p8000_1 | 17,341,350 | 17,337,154 | 546 | 17,340,538 | 45 | 17,341,350 | 141 |

p8000_2 | 22,208,986 | 22,207,866 | 122 | 22,208,986 | 49 | 22,208,986 | 89 |

p8000_3 | 24,670,924 | 24,669,797 | 402 | 24,670,924 | 185 | 24,670,924 | 386 |

p30000_1 | 127,336,719 | 127,323,304 | 568 | 127,332,912 | 598 | 127,336,719 | 592 |

p30000_2 | 158,561,564 | 158,438,942 | 573 | 158,561,564 | 580 | 158,526,518 | 571 |

p30000_3 | 179,329,754 | 179,113,916 | 575 | 179,329,754 | 599 | 179,261,723 | 590 |

**Table 6.**Computing the time deviation of the MST2 algorithm and r-flip strategy in Algorithm 5 within the time limit of 60 s.

Instance ID | MST2 | 1-Flip | 2-Flip | |||
---|---|---|---|---|---|---|

AT (s) | DT | AT (s) | DT | AT (s) | DT | |

p3000_1 | 12.5 | 15.663 | 15.7 | 84.075 | 24.1 | 56.875 |

p3000_2 | 32.5 | 20.059 | 4.9 | 45.583 | 4.8 | 68.606 |

p3000_3 | 54.3 | 5.901 | 29.3 | 46.180 | 12.0 | 60.477 |

p3000_4 | 13.3 | 18.434 | 12.0 | 107.798 | 10.0 | 51.640 |

p3000_5 | 30.4 | 15.829 | 33.2 | 45.470 | 32.3 | 48.240 |

p4000_1 | 49.0 | 10.227 | 7.7 | 50.131 | 9.3 | 36.570 |

p4000_2 | 14.2 | 9.848 | 22.1 | 62.351 | 21.1 | 70.476 |

p4000_3 | 35.4 | 11.236 | 15.1 | 69.699 | 16.5 | 75.542 |

p4000_4 | 58.0 | 0 | 22.2 | 65.408 | 35.4 | 45.780 |

p4000_5 | 31.1 | 11.082 | 18.1 | 73.038 | 29.6 | 40.109 |

p5000_1 | 56.8 | 2.339 | 4.0 | 0 | 10.0 | 42.426 |

p5000_2 | 35.0 | 3.563 | 28.3 | 74.329 | 11.0 | 0 |

p5000_3 | 30.0 | 8.607 | 38.9 | 33.038 | 33.0 | 50.069 |

p5000_4 | 54.0 | 5.238 | 54.0 | 0 | 42.0 | 0 |

p5000_5 | 57.2 | 1.317 | 38.8 | 40.504 | 30.5 | 63.379 |

p6000_1 | 43.3 | 5.112 | 32.9 | 47.380 | 21.8 | 67.507 |

p6000_2 | 39.8 | 4.238 | 31.8 | 51.521 | 42.3 | 46.315 |

p6000_3 | 52.1 | 5.027 | 32.3 | 44.640 | 48.0 | 0 |

p7000_1 | 56.0 | 0 | 41.0 | 0 | 21.0 | 0 |

p7000_2 | 55.3 | 1.367 | 47.0 | 0 | 47.0 | 0 |

p7000_3 | 59.0 | 0 | 42.0 | 56.293 | 35.2 | 45.958 |

p8000_1 | 48.1 | 7.232 | 26.0 | 0 | 35.0 | 0 |

p8000_2 | 55.9 | 0.566 | 54.0 | 0 | 53.0 | 0 |

p8000_3 | 57.2 | 1.806 | 43.0 | 0 | 50.0 | 0 |

p30000_1 | 60.0 | 0 | 58.0 | 0 | 60.0 | 0 |

p30000_2 | 70.0 | 1.166 | 59.0 | 0 | 60.0 | 0 |

p30000_3 | 90.3 | 0.912 | 58.0 | 0 | 54.0 | 0 |

**Table 7.**Computing the time deviation of the MST2 algorithm and r-flip strategy in Algorithm 5 within the time limit of 600 s.

Instance ID | MST2 | 1-Flip | 2-Flip | |||
---|---|---|---|---|---|---|

AT (s) | DT | AT (s) | DT | AT (s) | DT | |

p3000_1 | 11.9 | 16.067 | 21.3 | 62.678 | 37.8 | 130.045 |

p3000_2 | 29.1 | 18.144 | 5.5 | 69.234 | 7.7 | 81.231 |

p3000_3 | 58.5 | 16.889 | 126.4 | 99.610 | 143.6 | 116.812 |

p3000_4 | 292.1 | 11.285 | 10.8 | 58.365 | 13.7 | 49.512 |

p3000_5 | 543.9 | 6.365 | 109.1 | 88.328 | 164.3 | 72.144 |

p4000_1 | 42.8 | 7.773 | 13.5 | 63.553 | 15.1 | 63.861 |

p4000_2 | 552.2 | 2.597 | 30.7 | 49.923 | 37.0 | 110.712 |

p4000_3 | 31.7 | 7.293 | 18.8 | 57.442 | 22.9 | 47.545 |

p4000_4 | 70.8 | 4.094 | 42.2 | 102.331 | 48.7 | 115.376 |

p4000_5 | 70.5 | 8.596 | 25.3 | 81.984 | 43.0 | 69.595 |

p5000_1 | 337.2 | 4.265 | 70.7 | 126.287 | 48.0 | 61.872 |

p5000_2 | 557.8 | 4.565 | 135.4 | 96.462 | 210.6 | 67.670 |

p5000_3 | 428.5 | 7.257 | 115.8 | 96.524 | 115.5 | 104.238 |

p5000_4 | 279.4 | 5.987 | 270.3 | 48.842 | 143.0 | 0 |

p5000_5 | 287.1 | 9.234 | 194.5 | 94.641 | 172.7 | 92.268 |

p6000_1 | 424.8 | 4.555 | 152.9 | 95.641 | 145.9 | 46.657 |

p6000_2 | 498.0 | 0 | 142.5 | 97.375 | 73.8 | 122.070 |

p6000_3 | 252.3 | 5.571 | 248.0 | 51.129 | 318.1 | 61.672 |

p7000_1 | 344.5 | 0.153 | 272.5 | 93.675 | 441.5 | 12.974 |

p7000_2 | 587.0 | 0 | 115.0 | 0 | 265.1 | 76.694 |

p7000_3 | 109.0 | 0 | 84.5 | 39.472 | 131.1 | 55.401 |

p8000_1 | 548.6 | 1.398 | 251.3 | 63.346 | 141.0 | 0 |

p8000_2 | 145.4 | 11.829 | 258.3 | 56.352 | 300.7 | 56.001 |

p8000_3 | 514.3 | 11.365 | 368.8 | 43.667 | 417.3 | 12.797 |

p30000_1 | 572.0 | 1.365 | 598.0 | 0 | 592.0 | 0 |

p30000_2 | 581.5 | 1.526 | 580.0 | 0 | 571.0 | 0 |

p30000_3 | 586.5 | 2.773 | 599.0 | 0 | 590.0 | 0 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Alidaee, B.; Wang, H.; Sua, L.S.
An Efficient Closed-Form Formula for Evaluating *r*-Flip Moves in Quadratic Unconstrained Binary Optimization. *Algorithms* **2023**, *16*, 557.
https://doi.org/10.3390/a16120557

**AMA Style**

Alidaee B, Wang H, Sua LS.
An Efficient Closed-Form Formula for Evaluating *r*-Flip Moves in Quadratic Unconstrained Binary Optimization. *Algorithms*. 2023; 16(12):557.
https://doi.org/10.3390/a16120557

**Chicago/Turabian Style**

Alidaee, Bahram, Haibo Wang, and Lutfu S. Sua.
2023. "An Efficient Closed-Form Formula for Evaluating *r*-Flip Moves in Quadratic Unconstrained Binary Optimization" *Algorithms* 16, no. 12: 557.
https://doi.org/10.3390/a16120557