A Brief Overview of the DNN Bound for QAP

In this post I want to sketch out the DNN bound for the quadratic assignment problem (QAP).

If you want to know more about QAP, read this. The idea is to assign facilities to locations in a way that minimizes the flow of materials between them. Here, try solving one:

nug08 · 8 facilities, 8 locations
Cost so far
0
Place the facilities. The best possible cost is 214.
Unassigned
Drag a facility onto a location, or tap a facility and then a location. Dropping onto a taken location swaps the two. Lines join facilities that exchange flow, heavier for more; the cost adds flow times distance over every pair, so heavy lines should be short. Buttons: random, greedy, optimal and clear.

I’m interested in the DNN bound because QAP is very hard to solve, and DNN is a relaxed version of QAP. When you solve DNN, you get a lower bound on the corresponding QAP. You can use that to help solve the original QAP.

DNN was proposed by Zhao, Karisch, Rendl and Wolkowicz in 1998. I have a great deal of admiration for this paper, and am honored to have met both Karisch and Wolkowicz! We will now sketch out how they derived it.

It’s going to get technical, but the idea is the following:

  • Rewrite QAP by lifting it into a higher dimension to make the objective linear.
  • Use a semidefinite programming relaxation to make the constraints linear.
  • Solve the resulting semidefinite program to get the bound.

The point of doing all of this is that the bound is tighter than most alternatives, which helps us solve the QAP, if we can compute the bound fast enough.

Lifting QAP to get a linear objective

We will write QAP in matrix form as follows.

QAP(A,B,C):min⁡tr⁡(AXB+C)XTsubject toX∈Π

Here Π is the set of n×n permutation matrices. A is a flow matrix and B a distance matrix, both symmetric, and Xij=1 if facility i is assigned to location j.

Let vec(X) be the vector formed by stacking the columns of X, so we let x = vec(X). We can rewrite the condition “X is a permutation matrix” in terms of a “lifted” matrix Y, which uses the outer product of x:

y=(1x),Y=yyT=(1xTxxxT),
Y(ij),(kl)=XijXkl,Y0,(ij)=Xij,Y00=1.

Here the entries of x are indexed by pairs, x(ij)=Xij, and index 0 belongs to the 1 on top.

Why would we do that? To explain, I need more notation.

  • A∙B is tr⁡(ABT), A⊗B is the Kronecker product, vec⁡(A) is the columns of A stacked, and e is the vector of ones.
  • V is an n×(n−1) matrix whose columns are an orthonormal basis for the nullspace of eT, as in PB and QPB.

Then, because tr⁡(AXB)XT=xT(B⊗A)x and C∙X=vec⁡(C)Tx, the objective is linear in Y:

tr⁡(AXB+C)XT=L∙Y,L=(012vec⁡(C)T12vec⁡(C)B⊗A).

All we have done so far is rewrite things, but at least now we have a linear objective.

At this point, two paths diverge in a wood. In my thesis, Kurt and I did some tricks to make B⊗A convex, and then considered a quadratic program with continuous variables.

Here, Zhao et al. work with Y directly and try to constrain it. Let us follow that path.

The assignment constraints, lifted

A permutation matrix X satisfies the assignment constraints, i.e. the row sums and column sums of X are 1. But we’re working with Y now.

Xe=XTe=e is true exactly when X=1neeT+VMVT for some (n−1)×(n−1) matrix M. That is the substitution behind PB and QPB. In lifted form we have y=2Vˆ(1vec⁡(M)) with

Vˆ=(1201n2eV⊗V),VˆTVˆ=I.

So y lies in the range of Vˆ, a subspace of dimension (n−1)2+1, and every lifted permutation can be written

Y=VˆRVˆT,R=VˆTYVˆ⪰0.

This implies that every column in Y satisfies the assignment constraints, scaled by that column’s entry in row 0:

∑iY(ij),(kl)=Y0,(kl)for each j,∑jY(ij),(kl)=Y0,(kl)for each i.

Gangster zeros and nonnegativity: the DNN relaxation

Two more facts about a lifted permutation round out the picture. Both are in Zhao et al.

Gangster zeros. A location holds one facility, so XijXkj=0 for i≠k, and a facility has one location, so XijXil=0 for j≠l. Each of these products is an entry of Y, so those entries are zero. Zhao et al. write 𝒢(Y)=0 for them. They call 𝒢 the gangster operator because it shoots holes in the matrix.

Together with the column sums, the gangster zeros say more. Take j=l in the first sum above. The zeros remove every term but i=k, leaving Y(kl),(kl)=Y0,(kl): the diagonal of Y equals its row 0. Column 0 gives ∑iY0,(ij)=∑jY0,(ij)=1, so the marginals X‾ij=Y0,(ij) form a doubly stochastic matrix.

Nonnegativity. Every entry of a lifted permutation is a product of zeros and ones, so 0≤Y≤1. A matrix that is both positive semidefinite and entrywise nonnegative is called doubly nonnegative.

Now drop the one requirement that is not convex, that Y has rank one, and keep the rest:

DNN(A,B,C):min⁡L∙Ysubject toY=VˆRVˆT,R⪰0,Y00=1,𝒢(Y)=0,0≤Y≤1.

Here’s what Y looks like:

The lifted matrix Y
00loc 1loc 1loc 2loc 2loc 3loc 3

n = 3. Y is 10 × 10. 36 of its 100 entries are forced to zero. Shown: the permutation with facility→location 1→2, 2→3, 3→1. Point at a cell to see which product it stands for.

Because vec stacks columns, the n×n blocks of Y are indexed by pairs of locations. Diagonal blocks are diagonal and off-diagonal blocks have zero diagonals. The ones of any lifted permutation avoid every hole.

  • The upper bound Y≤1 is implied by the other constraints. Oliveira, Wolkowicz and Xu keep it because it speeds up computation (as we will cover in a future post).
  • Nonnegativity is what makes the relaxation strong, and what put it out of reach for two decades for big QAPs. At n=30 the matrix has about 406,000 distinct entries, each with its own sign constraint, and interior-point methods cannot carry that many inequalities.
  • Povh and Rendl (2009) reach the same relaxation from a completely positive formulation of the QAP.
  • At a node of the branch-and-bound tree with m facilities unassigned, the subproblem is again a QAP of size m. C collects the interactions with the fixed assignments and there is a constant term. Everything here applies with m in place of n.
nOrder of Y: n2+1Order of R: (n−1)2+1Distinct entries of Y
1214512210,585
2040136280,601
30901842406,351

Obtaining the DNN Bound

If you solve the semidefinite program with objective L∙Y with the constraints above, you get the DNN bound.

On the QAPLIB problems Kurt and I considered, the DNN bound closes on average 89% of the gap between QPB and the optimum, and at least 61% on every problem where the computation converged. We obtain the optimum on ten of them. On the “nug” problems it is on average 1.8% below the optimum, where QPB is 10% to 17% below. This makes a big difference in a branch-and-bound context. Here’s a visual:

Nugent problems: root bound as a share of the optimum
  • QPB
  • DNN
nug12568 / 578
nug141,011 / 1,014
nug151,141 / 1,150
nug16a1,600 / 1,610
nug16b1,219 / 1,240
nug171,708 / 1,732
nug181,894 / 1,930
nug202,507 / 2,570
nug212,382 / 2,438
nug223,529 / 3,596
nug243,402 / 3,488
nug253,626 / 3,744
nug305,950 / 6,124
All 42 problems, with GLB, PB and SDPB1
ProblemOptimumGLBPBQPBSDPB1DNN
esc16a683847554764
esc16b292220250250250290
esc16c16083959595154
esc16d163−19−19−1913
esc16e281266627
esc16g261299925
esc16h996625708708708977
esc16i140−25−25−2512
esc16j81−6−6−68
had121,6521,5361,5731,5921,6041,652
had142,7242,4922,6092,6302,6512,724
had163,7203,3583,5603,5953,6123,720
had185,3584,7765,1045,1435,1745,358
had206,9226,1666,6256,6776,7136,922
kra30a88,90068,36063,71768,57269,736–
kra30b91,42069,06563,81869,02170,324–
nug12578493472482486568
nug141,0148528718919031,011
nug151,1509639739961,0091,141
nug16a1,6101,3141,4031,4481,4611,600
nug16b1,2401,0221,0461,0711,0821,219
nug171,7321,3881,4871,5291,5481,708
nug181,9301,5541,6631,7051,7231,894
nug202,5702,0572,1962,2542,2812,507
nug212,4381,8331,9792,0552,0902,382
nug223,5962,4832,9663,0803,1403,529
nug243,4882,6762,9603,0283,0683,402
nug253,7442,8693,1903,2723,3053,626
nug306,1244,5395,2665,3655,4135,950
rou12235,528202,272200,024206,102208,685235,528
rou15354,210298,548296,705303,777306,833350,217
rou20725,520599,948597,045607,822615,549695,181
scr1231,41027,8584,7278,58511,11731,410
scr1551,14044,73710,35512,47917,04651,140
scr20110,03086,76616,11323,96028,535106,802
tai12a224,416195,918193,124199,597203,595224,416
tai15a388,214327,501325,019330,310333,437377,101
tai17a491,812412,722408,910416,033419,619476,525
tai20a703,482580,674575,831585,139591,994671,675
tai25a1,167,256962,417956,657983,456974,0041,096,657
tai30a1,818,1461,504,6881,500,4071,518,0591,529,1351,706,870
tho30149,93690,578119,254124,684125,972143,576

In the illustration above we show QPB and DNN in relation to the optimum, across several QAPLIB instances. We haven’t discussed how to solve DNN yet, but the key point here is that the DNN bound reported is not fully converged because it’s costly to compute. So we are understating DNN(A,B,C) by a bit, but not enough to change the main narrative.

If you expand the table below the illustration, you’ll see even more details. We compare DNN with the GLB, PB, QPB and SDPB1 bounds as Kurt and I reported back in 2001. For kra30a and kra30b the DNN calculation procedure used did not converge with parameters tuned on the Nugent problems, so no value is given.

Good news: the bound is great. Bad news: solving SDPs is hard, and costly. We will consider that in a future post.