Sie sind auf Seite 1von 6

rd

Andrzej Kraslawski and Ilkka Turunen (Editors) Proceedings of the 23 European Symposium on
Computer Aided Process Engineering - ESCAPE 23, June 9-12, 2013, Lappeenranta, Finland

c 2013 Elsevier B.V. All rights reserved. 

A Metaheuristic Optimization Algorithm for


Binary Quadratic Problems
Otto Nissfolk and Tapio Westerlund
Center of Excellence in Optimization and Systems Engineering, bo Akademi University,
Biskopsgatan 8, 20500 bo, Finland

Abstract
This paper focuses on the formulation and solution of binary quadratic problems. A new
metaheuristic approach is presented in order to acquire good solutions. Computational
results show that the heuristic solver nds good solutions quite fast. One of the test
problems is tai256c, a gray-scale pattern problem by Taillard (1995) found in the QAPLIB
(Burkard et al. (1997), http://www.seas.upenn.edu/qaplib/inst.html). The tai256c problem
has been written in a quadratic form by Nissfolk et al. (2012) and then convexied using
the QCR method by Billionnet et al. (2009). The algorithm is based on an iterative two-
stage selection of variables to optimize. First the algorithm goes trough the vector of
binary variables of length k, chooses the m-rst variables (m < k) with a value of one
and optimizes over them, and then continues to the m next variables with values of one
and selects them for optimization. In these optimization steps the solution can either
improve or stay the same. Once the algorithm has gone through the whole vector without
improvement it randomly selects m variables with values of one to optimize and does this
for a specied number of iterations.
Keywords: Quadratic assignment problem (QAP), mixed integer quadratic programming
(MIQP), semidenite programming (SDP), quadratic convex reformulation (QCR)

1. Introduction
This paper addresses the important task of solving certain classes of the Quadratic As-
signment Problem (QAP) introduced by Koopmans and Beckmann in 1957. The QAP is
a problem where n facilities and n locations are given with specied ows and distances
between the facilities and locations respectively. The cost is a function of the distances
and ows between the facilities and an additional cost may be associated with placing a
facility at a certain location. The overall objective is to minimize the total cost of placing
each facility to a certain location.
In its basic form QAP is a non-convex 0-1 quadratic program. The problem this paper
focuses on is the solution of tai256c by Taillard (1995). Problem tai256c is a gray-
pattern problem with 256 locations of which 92 have to be occupied. In this paper a new
two-phase metaheuristic is introduced as a method of getting good solutions quite fast.
The paper is organized as follows: The different quadratic formulations are introduced in
section 2. The metaheuristic algorithm is presented in section 3. The results are presented
in section 4 and nally the paper is concluded in section 5.
Otto.Nissfolk@abo., Tapio.Westerlund@abo.
 O. Nissfolk and T. Westerlund

2 Problem formulation
2.1 The QAP
The QAP introduced by Koopmans and Beckmann (1957) has the following form:
n n n n n n
min
xX
fik d jl xi j xkl + ci j xi j (1)
i=1 j=1 k=1 l=1 i=1 j=1

n n
where X = {x| xi j = 1 i N, xi j = 1 j N, xi j {0, 1} i, j N} (2)
j=1 i=1

and fik is the ow between facilities i and k, d jl is the distance between locations j and
l, and ci j is the cost of placing facility i at location j. The variable xi j = 1 if facility i is
assigned to location j, otherwise, xi j = 0 and N = {1, 2, . . . , n}. With no loss of generality
we can assume that ci j = 0 and omit the linear term in (1).

2.2 Trace formulation


Another popular formulation of the QAP is the trace formulation (Edwards, 1980). If F
and D are given ow and distance matrices and X the permutation matrix, with elements
dened by (2), the quadratic objective in (1) (with ci j = 0) can be expressed using the
trace-operator according to
n n n n
fik d jl xi j xkl = tr(DXFXT ).
i=1 j=1 k=1 l=1

2.3 QAP with rank-1 ow matrix


We assume that the ow matrix (or distance matrix) is symmetric positive denite and of
rank-1 i.e., F = qqT for some vector q = (q1 , . . . , qn )T . The quadratic part of the objective
function (1) can, in this case, be restated as
n n n n
fik d jl xi j xkl = tr(DXFXT ) = tr(DXqqT XT ) = tr(DyyT ) = yT Dy
i=1 j=1 k=1 l=1

where y=Xq i.e., y is a permutation of q. By substituting yi = nj=1 q j xi j , we then get a


quadratic problem of the form

min yT Dy (3)
xX,yRn

subject to
n n n
yi = xi j q j i, yi = q j (4)
j=1 i=1 j=1

Problem (3-4) is a mixed integer quadratic optimization problem (MIQP) with n continu-
ous, n2 binary variables of SOS1-type and n + 1 linear constraints. The objective function
is not necessarily convex.
A Metaheuristic Optimization Algorithm for Binary Quadratic Problems 

2.4. Convex QAP with rank-1 ow matrix


In order to efciently solve the quadratic formulation dened in section 2.3 we have to
convexify the objective (3). The convexication can be done, for example, by adding the
smallest eigenvalue to the diagonal so that diag(u) = min (D)I or by using the QCR-
method (Billionnet et al., 2009). By solving an SDP problem we will get an optimal
u-vector so that the lower bounding is as tight as possible. If we add u to the diagonal of
D then we have to subtract new variables z(zi = y2i ) to obtain the same objective value as
in (3).

min yT (D + diag(u))y uT z (5)


xX, y,zRn

subject to
n n n n
yi = xi j q j , zi = xi j q2j i, yi = q j . (6)
j=1 j=1 i=1 j=1

Problem (5-6) is a convex MIQP with 2n continuous, n2 binary variables and 4n + 1


constraints (counting SOS1-constraints).

3. Metaheuristic Algorithm
The optimization algorithm is based on optimizing over m binary variables with the value
of 1 and keeping the rest of variables with value 1 locked (k m). The optimization is
therefore done over the m ones and all zeros. In the case of tai256c, k is 92 and that is the
sum of ones in the x-vector. In the rst step, optimization is done over the m rst variables
with value 1 and the remaining k m variables with value 1 are locked. After that, the
algorithm chooses the next m variables (m + 1 to 2m) and after the algorithm has passed
through the whole x-vector without improvement it randomly chooses m ones to optimize.
This step is then repeated until a predetermined criteria is reached, usually a specied
number of iterations or a specied time. An example of how the algorithm works is found
in gure 1. In gure 1 one can see how the algorithm chooses the variables to lock, which
are marked with gray color. First you see the initial x-vector, the x13 -vectors are the
vectors where the values are chosen blockwise and the xr1,r2 are examples of random
selection. When using tai256c as a test-problem, the objective function in equation (5)
and the constraint in equation (6) can be simplied because the q-vector only contains
binary variables. The simplied equations are given below in equations (7-8) and the
iteration constraint in equation (9):
min xT (D + diag(u))x uT x (7)
subject to
n
xi = k (8)
i=1
iteration constraint
xiter = 1 , (9)
where iter = 1, 2, 3, ..., m for the rst iteration and iter = m + 1, m + 2, m + 3, ..., 2m for
the second iteration and so on in the rst phase until no improvements can be made. After
that in the second phase, iter = m random positions in the x-vector.
 O. Nissfolk and T. Westerlund


1 1 1 1 1 1
0 0 0
0 0 0
1 1 1
1 1 1

1 1 1 1 1 1

0 0 0 0 0 0

0 0 0 0 0 0

0 0 0 0 0 0
x= x1 = x2 = x3 = xr1 = xr2 =
1 1 1 1 1 1

0 0 0 0 0 0

0 0 0 0 0 0

0 0 0 0 0 0

1 1 1 1 1 1

1 1 1 1 1 1
0 0 0 0 0 0

Figure 1. An example of how the algorithm selects the variables to lock

4. Results
In gure 2 the objective value is plotted versus the elapsed time. Here one can see that
when the number of ones used in the optimization goes up the objective value goes down.
It is also quite clear that when the number of ones is increased the solution time is higher
because there are more possible congurations that the ones can take.

Objective function value vs. time


107
m=1
4.53 m=5
m = 10
4.52 m = 12
Objective value

m = 16
4.51
m = 18
4.50

4.49

4.48

1 10 100 1000 10000 100000 1000000 s


Time in seconds

Figure 2. Objective value versus time for different values of m


A Metaheuristic Optimization Algorithm for Binary Quadratic Problems 

Objective function value vs. iteration count


107

m=1
4.53 m=5
m = 10
m = 12
4.52 m = 16
m = 18
Objective value

4.51

4.50

4.49

4.48

1 10 100 1000 10000


Number of iterations

Figure 3. Objective value versus time for different values of m

Solution spread
107
min
4.53 mean
max
Objective value

4.52

4.51

4.50

4.49

4.48
1 10 100 1000 10000
Number of iterations

Figure 4. Spread of the solutions with m = 5


 O. Nissfolk and T. Westerlund

In gure 3 the objective value is plotted versus the number of iterations. Here one can see,
precisely like in gure 2, that the objective value gets lower with higher number of ones.
It is also worth noting that with higher values of m, the objective value changes more per
iteration. The spread of solutions can be seen in gure 4. The results are based on 10 runs
with m = 5 and then the best, worst and average values are plotted.

5. Conclusions
In this paper a new method for obtaining an upper-bound for MIQP problems is intro-
duced. Unfortunately the solutions obtained are not as good as the best known upper-
bound for tai256c found in the QAPLIB (Burkard et al. (1997), http://www.seas.upenn.
edu/qaplib/inst.html). However, good solutions are found quite fast, for example with
m = 8 a solution only 0.3% over the best known upper-bound is found after just over
60 CPU-s. The best found solution with this method is only 0.06% over the best known
upper-bound and this solution is found after 72000 CPU-s. When testing this algorithm
on the tai64c-problem the best found solution is the global optimal solution found in just
over 30 CPU-s.

Acknowledgments
Financial support from the Foundation of bo Akademi University, as part of the grant
for the Center of Excellence in Optimization and Systems Engineering, is gratefully ac-
knowledged.

References
Billionnet, A., Elloumi, S., Plateau, M.-C., March 2009. Improving the performance of standard
solvers for quadratic 0-1 programs by a tight convex reformulation: The QCR method. Dis-
crete Appl. Math. 157, 11851197.
Burkard, R. E., Karisch, S. E., Rendl, F., June 1997. QAPLIB - a quadratic assignment problem
library. Journal of Global Optimization 10, 391403.
Edwards, C. S., 1980. A branch and bound algorithm for the Koopmans-Beckmann quadratic as-
signment problem. Combinatorial Optimization II 13, 3552.
Koopmans, T. C., Beckmann, M., 1957. Assignment problems and the location of economic activi-
ties. Econometrica 25 (1), pp. 5376.
Nissfolk, O., Prn, R., Westerlund, T., Jansson, F., 2012. A mixed integer quadratic reformulation
of the quadratic assignment problem with rank-1 matrix. In: Karimi, I. A., Srinivasan, R.
(Eds.), 11th International Symposium on Process Systems Engineering. Vol. 31 of Computer
Aided Chemical Engineering. Elsevier, pp. 360 364.
Taillard, D., 1995. Comparison of iterative searches for the quadratic assignment problem. Location
Science 3 (2), 87 105.

Das könnte Ihnen auch gefallen