Approximating the Maximum Quadratic Assignment Problem 1 Esther M. Arkin Refael Hassin 3 Maxim Sviridenko 4 Keywords: Approximation algorithm; quadratic assignment problem 1 Introduction In the maximum quadratic assignment problem three n n nonnegative symmetric matrices A = (a ij ), B = (b ij ), and P C = (c ij ) are given P and the objective is to compute a permutation of V = f1; : : :; ng so that i;jv a (i);(j) b i;j + iv c i;(i) is maximized. i6=j The problem is NP-hard and generalizes many NP-hard problems such as max clustering with given sizes (see denition below). An indication to the hardness of approximating the problem is that the best known approximation factors for two special cases of max clustering with given sizes are 1, when all sizes are equal to a constant c [7], and (n)?1 3 when all sizes c except for one are 1 [5]. In this note we provide an approximation algorithm with a constant performance guarantee, 1, 4 under the assumption that the weights in B satisfy the triangle inequality (TI), b i;j b i;k + b k;j, for all i; j; k V. For maximum linear arrangement (see denition below) the bound guaranteed by our algorithm is 1, which slightly improves a result of [15]. Special cases and related problems There are many interesting special cases, some of which are `graphic', that is, A is a 0/1 incidence matrix of a graph. In this case, the problem is to compute in B a subgraph isomorphic to A of maximum total weight. In some of these applications, the role of C may be to represent the eect of a partial solution which has already been determined, so that the weights of C represent the total weight incurred by i if it is permuted to (i) through interactions with the imposed partial solution (see, for example, [3]). We will describe below the meaning of A and B in these applications. In max weight perfect matching A consists of n disjoint edges. This problem can be solved in polynomial time. In max clustering with given sizes A is the union of vertex disjoint cliques. Assuming TI [7] and [13] provide algorithms with bound 1 1 if all clusters have the same size and [13] gives a p bound if the sizes dier. In a special case, max dispersion, A consists of a clique of p vertices 1 and n? p isolated vertices. and 1 approximation algorithms were developed in [0] and [16], 4 respectively. 1 A shortened preliminary version of this paper appeared in Proc. Eleventh Annual ACM-SIAM Symposium on Discrete Algorithms (SODA '00), 889-890, January, 000. Department of Applied Mathematics and Statistics, SUNY Stony Brook, Stony Brook, NY 11794-3600, estie@ams.sunysb.edu. Partially supported by NSF (CCR9730). 3 Department of Statistics and Operations Research, Tel-Aviv University, Tel-Aviv 69978, Israel, hassin@math.tau.ac.il 4 Basic Research Institute in Computer Science (BRICS), University of Aarhus, Denmark, sviri@brics.dk. Research of the third author was partially supported by the Russian Foundation for Basic Research, grants 97-01-00890, 99-01-00601, 99-01-00510 1
In max cut with given sizes A consists of a complete bipartite graph. [1] and [8] give 1 and 0.651 approximations for the general and for the equal parts case (graph bisection), respectively, without TI. Both results are slightly improved in [6]. Constant factor approximations, without TI, when A consists of a collection of vertex disjoint paths are described in [1]. In particular, the bound for packing of 3-edge paths is 3. 4 In max TSP A consists of a cycle. With TI, a 5 bound is given in [17]. Without TI, a 6 deterministic algorithm with bound 3 5 and a randomized algorithm with bound are given in [1] 4 33 and [14], respectively. In max star packing A consists of a collection of vertex disjoint stars. A p 1 -approximation assuming TI is given in [13]. In maximum latency TSP A consists of a Hamiltonian path with weights 1; ; :::; n? 1 in this order. With TI, a 1 factor is given in [4], while [14] obtains a bound of 1 time that of max TSP, without TI. In maximum linear arrangement A is a complete graph with nonnegative weights and b i;j = jj? ij. [15] contains a randomized asymptotic 1 -approximation algorithm for this problem. It also contains a 1 -approximation for generalized maximum linear arrangement in which 3 a vector x 1 ; :::; x n is given and b i;j = jx j? x i j. In contrast, [] show that no constant factor approximation exists for minimum quadratic assignment unless P=NP. In fact, Queyranne showed that approximating minimum quadratic assignment with the triangle inequality within any constant factor in polynomial time implies P=NP even for the problem with matrix B introducing a line metric [19]. Special graphic cases in which A consists of p vertex disjoint paths, (cycles, cliques) have constant factor approximations under restrictions: For p xed see [10, 11], and for equal-sized sets see [9]. However, these special cases with general p and unequal sized sets are open. Notice also that the maximum quadratic assignment problem with triangle inequality is MAXSNP-hard since it contains the maximum f1; g-tsp as a special case. The MAXSNPhardness of the later problem can be simply derived from the work [18]. 3 Algorithm Denote by apx the expected weight returned by Quadratic Assignment of Figure 1. Let opt denote the weight of an optimal solution. Theorem 1 apx 1 4 opt. Proof: Since M B is a maximum matching with respect to the weights b, it follows that for every p; q V such that (p; q) = M B but (p; p 0 ) M B and (q; q 0 ) M B b p;q b p;p 0 + b q;q 0: (1) Also, if v is not incident to any edges in M B then for i = 1; :::; l b v;wi ; b v;zi b wi;z i. Let be an optimal permutation. Summing over all i; j V i 6= j we get opt = X i;jv i6=j a (i);(j) b i;j + X iv c i;(i) lx i=1 b wi;z i (deg A (w i) + deg A (z i)) + X iv c i(i) = X iv f i;(i) X iv f i;^(i) : We now consider the approximate solution returned by Quadratic Assignment. The algorithm sets ((w i ); (z i )) to (^(w i ); ^(z i )) or to (^(z i ); ^(w i )) each with probability 1. Therefore,
Quadratic Assignment input 1. n n nonnegative matrices A = (a ij ) and C = (c ij ).. n n nonnegative matrix B = (b ij ), satisfying the triangle inequality. returns 1. Permutation of V = f1; :::; ng of weight P i;jv a (i);(j)b i;j + P iv c i;(i): begin Compute a maximum weight matching M B in V with respect to weights fb ij g. Assume that M B = f(w 1 ; z 1 ); :::; (w l ; z l )g where l = b n c for i V if i fw k ; z k g for some k f1; :::; lg then b(i) := b wk;zk. else b(i) := 0 (there is at most one such vertex). end if for i V P deg A i := a jv nfig ij. for i; j V f ij := b(i)deg A j + c ij. ^ := an optimal solution to a linear assignment problem max Pi f i;(i). for i = 1; :::; l (w i ) := ^(w i ) and (z i ) := ^(z i ) with probability 1. (w i ) := ^(z i ) and (z i ) := ^(w i ), otherwise. if v is a vertex which is free with respect to M B, then (v) := ^(v). return. end Quadratic Assignment Figure 1: Algorithm Quadratic Assignment 3
a^(p);^(q) for (p; q) = M B is multiplied in a random approximate solution by one of the numbers b pq ; b pq 0; b p 0 q ; b p 0 q 0, each with probability 1 4 where (p; p0 ) M B and (q; q 0 ) M B. Hence, the expected contribution of pair ^(p); ^(q) is equal to 1 4 a^(p);^(q)(b pq + b pq 0 + b p 0 q + b p 0 q 0) 1 4 a^(p);^(q) maxfb pp 0; b qq 0g 1 4 a^(p);^(q)(b pp 0 + b qq 0) where the rst inequality follows from the triangle inequality. If (p; q) M B then a^(p);^(q) is always multiplied by b pq. Summing over all p 6= w i and q 6= z i we get that the contribution of the edge (w i ; z i ) to apx is at least 1 4 (dega^(w + i) dega^(z )b i) w i;z i. Notice also that the contribution of c i(i) in apx is at least 1 c i^(i) since i doesn't change its assignment with probability 1. We obtain apx 1 4X iv b(i)deg A^(i) + 1 X iv c i;^(i) 1 4 X iv f i;^(i) so that the claim of the theorem follows. The running time of the algorithm is O(n 3 ) due to the matching and assignment steps it uses. We note that the maximum weight matching can be replaced by a `greedy' matching (include vertex-disjoint edges in non-increasing order of weights). The only property required from the matching is b p;q b p;p 0 + b q;q 0 which the greedy matching satises as well. A greedy matching can be computed in O(n log n) time. If C = 0 the assignment problem in the algorithm has a special `factored structure' and can be solved as follows: Sort the b(i)'s and the deg A j 's in non-increasing orders i 1 ; :::; i n and j 1 ; :::; j n, respectively, and assign i r to j r for r = 1; :::; n (see for example Exercise 1.a in []). Combined with the previous observation, the running time of the algorithm in the C = 0 case is O(n log n). The algorithm can be derandomized by the method of conditional probabilities [3]. Finally, we prove the following: Theorem For maximum linear arrangement, Quadratic Assignment is a 1 -approximation algorithm. Proof: Recall that in maximum linear arrangement b i;j = jj?ij. The greedy matching (which is one of numerous maximum weight matchings) contains the edges (1; n); (; n? 1); (3; n? ); :::. For any edge (p; q) not in the greedy matching, Equation (1) can be replaced by b p;q 1 (b p;p 0 + b q;q 0): Consequently, the bound of Theorem 1 improves in this case to 1. Acknowledgement We thank Alexander Ageev for helpful comments. References [1] A.A. Ageev and M.I. Sviridenko, \Approximation algorithms for maximum coverage and max cut with given sizes of parts", Proceedings of IPCO'99, Lecture Notes in Computer Science 1610 (1999), 17-30. [] R.K. Ahuja, T.L. Magnanti and J.B. Orlin, Network Flows: Theory, Algorithms, and Applications, Prentice-Hall, New Jersey, 1993. 4
[3] N. Alon and J.H. Spencer, The probabilistic method, John Wiley and Sons, New York, 199. [4] P. Chalasani and R. Motwani, \Approximating capacitated routing and delivery problems", SIAM J. Comput. 8 (1999), 133-149. [5] U. Feige, G. Kortsarz, and D. Peleg, \The dense k-subgraph problem", Algorithmica, to appear. [6] U. Feige and M. Langberg, \Approximation algorithms for maximization problems arising in graph partitioning", manuscript (1999). [7] T. Feo and M. Khellaf, \A class of bounded approximation algorithms for graph partitioning", Networks 0 (1990), 181-195. [8] A. Frieze and M. Jerrum, \Improved approximation algorithms for MAX k-cut and MAX BISECTION," Algorithmica 18 (1997), 67-81. [9] M.X. Goemans and D.P. Williamson, \A general approximation technique for constrained forest problems", SIAM J. Comput. 4 (1995), 96-317. [10] N. Guttmann-Beck and R. Hassin, \Approximation algorithms for minimum tree partition", Disc. Applied Math. 87 (1998), 117-137. [11] N. Guttmann-Beck and R. Hassin, \Approximation algorithms for min-sum p-clustering", Disc. Applied Math. 89 (1998), 15-14. [1] R. Hassin and S. Rubinstein, \An approximation algorithm for maximum packing of 3-edge paths", Information Processing Letters 63 (1997), 63-67. [13] R. Hassin and S. Rubinstein, \Robust matchings, maximum clustering, and maximum capacitated medians", submitted for publication. Extended abstract appeared in Algorithm Theory - SWAT000 M. Halldorsson (Ed.) (Lecture Notes in Computer Science 1851, 51-58). [14] R. Hassin and S. Rubinstein, \Better approximations for Max TSP", Information Processing Letters, to appear. [15] R. Hassin and S. Rubinstein, \Approximation algorithms for maximum linear arrangement", (1999). Extended abstract appeared in Algorithm Theory - SWAT000 M. Halldorsson (Ed.) (Lecture Notes in Computer Science 1851, 31-36).. [16] R. Hassin, S. Rubinstein and A. Tamir, \Approximation algorithms for maximum dispersion", Operations Research Letters 1 (1997), 133-137. [17] A.V. Kostochka and A.I. Serdyukov, \Polynomial algorithms with the estimates 3 4 and 5 6 for the traveling salesman problem of the maximum" (in Russian), Upravlyaemye Sistemy 6 (1985) 55-59. [18] C.H. Papadimitriou and M. Yannakakis, \The traveling salesman problem with distances one and two", Math. Oper. Res. 18 (1993) 1{11. [19] M. Queyranne, \Performance ratio of polynomial heuristics for triangle inequality quadratic assignment problems", Operations Research Letters, 4 (1986), 31-34. 5
[0] S.S. Ravi, D.J. Rosenkrantz and G.K. Tayi, \Heuristic and special case algorithms for dispersion problems," Operations Research 4 (1994), 99-310. [1] A.I. Serdyukov, \An algorithm with an estimate for the traveling salesman problem of the maximum" (in Russian), Upravlyaemye Sistemy 5 (1984) 80-86. [] S. Sahni and T. Gonzalez, \P-complete approximation problems", J. ACM 3 (1976) 555-565. [3] A. Tamir, \Obnoxious facility location on graphs," SIAM J. Discrete Mathematics 4 (1991) 550-567. 6