An improved approximation algorithm for the

3 downloads 0 Views 320KB Size Report
first improvement over the trivial maximum weight matching based 2- ... that the total number of extracted bandpasses in the resultant matrix is maximized [3,2,8]. ... a row maps to a vertex, a column maps to an edge, and aij = 1 if and only if.
An improved approximation algorithm for the Bandpass problem Weitian Tong1 , Randy Goebel1 , Wei Ding2 , and Guohui Lin1� 1

Department of Computing Science, University of Alberta Edmonton, Alberta T6G 2E8, Canada 2 Zhejiang Water Conservancy and Hydropower College Hangzhou, Zhejiang, China {weitian,rgoebel,guohui}@ualberta.ca [email protected]

Abstract. The general Bandpass-B problem is NP-hard and can be approximated by a reduction into the B-set packing problem, with a worst case performance ratio of O(B 2 ). When B = 2, a maximum weight matching gives a 2-approximation to the problem. The Bandpass-2 problem, or simply the Bandpass problem, can be viewed as a variation of the maximum traveling salesman problem, in which the edge weights are dynamic rather than given at the front. We present in this paper a 24 -approximation algorithm for the Bandpass problem, which is the 13 first improvement over the trivial maximum weight matching based 2approximation algorithm. Keywords: Bandpass problem, approximation, maximum weight matching, worst case performance ratio

1

Introduction

In optical communication networks, a sending point uses a binary matrix Am×n to send m information packages to n different destination points, in which the entry aij = 1 if information package i is not destined for point j, or aij = 0 otherwise. To achieve the highest cost reduction via wavelength division multiplexing technology, an optimal packing of information flows on different wavelengths into groups is necessary [2]. Under this binary matrix representation, every B consecutive 1’s in a column indicates an opportunity for merging information to reduce the communication cost, where B is a pre-specified positive integer called the bandpass number. Such a set of B consecutive 1’s in a column of the matrix is said to form a bandpass. When counting the number of bandpasses in the present matrix, no two of them in the same column are allowed to share any �

Correspondence author.

2

Tong et al.

common rows. The computational problem, the Bandpass-B problem, is to find an optimal permutation of rows of the input matrix Am×n such that the total number of extracted bandpasses in the resultant matrix is maximized [3,2,8]. Note that though multiple bandpass numbers can be used in practice, for the sake of complexities and costs, usually only one fixed bandpass number is considered [2]. The general Bandpass-B problem, for any fixed B ≥ 2, has been proven to be NP-hard [8]. In fact, the NP-hardness of the Bandpass2 can be proven by a reduction from the well-known Hamiltonian path problem [6, GT39], where in the constructed binary matrix Am×n , a row maps to a vertex, a column maps to an edge, and aij = 1 if and only if edge ej is incident to vertex vi . It follows that there is a row permutation achieving m − 1 bandpasses if and only if there is a Hamiltonian path in the graph. On the approximability, the Bandpass-B problem has a close connection to the weighted B-set packing problem [6]. Given an instance I of a maximization problem Π, let C ∗ (I) (C(I), respectively) denote the value of the optimal solution (the value of the solution produced by an algorithm, respectively). The performance ratio of the algorithm on I is C ∗ (I) C ∗ (I) C(I) . The algorithm is a ρ-approximation if supI C(I) ≤ ρ. By taking advantages of the approximation algorithms designed for the weighted Bset packing problem [1,4], the Bandpass-B problem can be approximated within O(B 2 ) [8]. Moreover, since the maximum weight matching problem is solvable in cubic time, the Bandpass-2 problem admits a simple maximum weight matching based 2-approximation algorithm [8]. In this paper, we present for the Bandpass-2 problem, or simply the Bandpass problem, the first improved approximation algorithm, with the worst case performance ratio proven to be at most 24 13 . Our algorithm is still based on maximum weight matchings. While the algorithm is not too complex, our main contribution lies in the non-trivial performance analysis.

2

The approximation algorithm

A reduction from the Hamiltonian path problem has been used to prove the NP-hardness of the Bandpass problem. But the Bandpass problem does not readily reduce to the maximum traveling salesman problem (Max-TSP) [6] for approximation algorithm design. The main reason is that, an instance graph of Max-TSP is static, in that all (non-negative) edge weights are given at the front, while in the Bandpass problem the

Approximating the Bandpass problem

3

number of bandpasses extracted between two consecutive rows in a row permutation is permutation dependent. Nevertheless, as shown in the sequel, our design idea is based on maximum weight matchings, the same as in approximating Max-TSP [9,7,5]. Formally, in Max-TSP, a complete edge weighted graph is given, where the edge weights are non-negative integers, and the goal is to compute a Hamiltonian cycle of the maximum weight. Note that there are several variants of Max-TSP been studied in the literature. In our case, the input graph is undirected (or symmetric) and the edge weights do not necessarily satisfy the triangle inequality. The following Lemma 1 states the currently best approximation result for Max-TSP. Lemma 1. [5] The Max-TSP admits a cubic time approximation algorithm with worst case performance ratio asymptotically 81 61 . In our Bandpass problem, since we can always add a row of all 0’s if needed, we assume without loss of generality that the number of rows, m, is even. Given the input binary matrix Am×n , let ri denote the i-th row. We first construct a graph G of which the vertex set is exactly the row set {r1 , r2 , . . . , rm }. Between rows ri and rj , the static edge weight is defined as the maximum number of bandpasses that can be formed between the two rows, and is denoted as w(i, j). In the sequel we use row (of the matrix) and vertex (of the graph) interchangeably. For a row permutation π = (π1 , π2 , . . . , πm ), its i-th row is the πi -th row in the input matrix. We call a maximal segment of consecutive 1’s in a column of π a strip of π. The length of a strip is defined to be the number of 1’s therein. Apparently, a length-� strip contributes exactly � 2� � bandpasses. We use S� (π) to denote the set of length-� strips of π, and s� (π) = |S� (π)|. Let b(π) denote the number of bandpasses extracted from the permutation π. We have b(π) =

n � �=2

n

� � � s� (π)� � = s2 (π) + s� (π)� �. 2 2

(1)

�=3

Let p(π) denote the number of pairs of consecutive 1’s in the permutation π. We have p(π) =

n � �=2

s� (π)(� − 1) = s2 (π) +

n � �=3

s� (π)(� − 1).

(2)

4

2.1

Tong et al.

Algorithm description

In our algorithm denoted Approx, the first step is to compute a maximum weight matching M1 in graph G. Recall that there are an even number of rows. Therefore, M1 is a perfect matching (even though some edge weights could be 0). Let w(M1 ) denote the sum of its edge weights, indicating that exactly w(M1 ) bandpasses can be extracted from the row pairings suggested by M1 . These bandpasses are called the bandpasses of M1 . Next, every 1 involved in a bandpass of M1 is changed to 0. Let the resultant matrix be denoted as A�m×n , the resultant edge weight between rows ri and rj be w� (i, j) — which is the maximum number of bandpasses can be formed between the two revised rows, and the resultant graph be denoted as G� . One can see that if an edge (ri , rj ) belongs to M1 , then the new edge weight w� (i, j) = 0. In the second step of Approx, we compute a maximum weight matching M2 in graph G� , and let w� (M2 ) denote its weight. If an edge (ri , rj ) belongs to both M1 and M2 , then it is removed from M2 . Such a removal does not decrease the weight of M2 as w� (i, j) = 0. Consider the union of M1 and M2 . Note that every cycle of this union, if any, must be an even cycle with alternating edges of M1 and M2 . The third step of Approx is to break cycles, by removing for each cycle the least weight edge of M2 . Let M denote the final set of edges of the union, which form into disjoint paths. In the last step, we randomly stack these paths to give a row permutation π. The number of bandpasses extracted from π, b(π), is at least the weight of M , which is greater than or equal to w(M1 ) + 12 w� (M2 ). 2.2

Performance analysis

Let π ∗ denote the optimal row permutation such that its b(π ∗ ) is maximized over all row permutations. Correspondingly, S2 (π ∗ ) denotes the set of length-2 strips in π ∗ , which contribute exactly s2 (π ∗ ) bandpasses towards b(π ∗ ). The key part in the performance analysis for algorithm Approx is to estimate w� (M2 ), as done in the following. To this purpose, we partition the bandpasses of S2 (π ∗ ) into four groups: G1 , G2 , G3 , G4 . Note that bandpasses of S2 (π ∗ ) do not share any 1. G1 consists of the bandpasses of S2 (π ∗ ) that also belong to matching M1 (such as the one between rows ra and rb in Figure 1); G2 consists of the bandpasses of S2 (π ∗ ), each of which shares (exactly) a 1 with exactly one bandpass of M1 , and the other 1 of the involved bandpass of

Approximating the Bandpass problem

5

M1 is shared by another bandpass in G2 ; G3 consists of the bandpasses of S2 (π ∗ ), each of which shares (exactly) a 1 with at least one bandpass of M1 , and if it shares a 1 with exactly one bandpass of M1 then the other 1 of the involved bandpass of M1 is not shared by any other bandpass of S2 (π ∗ ) (or more specifically, not shared by another bandpass of G3 ); G4 consists of the remaining bandpasses of S2 (π ∗ ). Figure 1 gives an illustration of how these bandpasses look like.

u: �: k: j: i: t: b: a:

1 1

.. .

.. . .. .

✞0 ☎ ✞0 ☎

1 1 G3 ✝ ✞1 ✆ ☎ ✝1 ✆ G2 1 1 1 ✝1 ✆ 0 0 1

✞☎

✞0 ☎ ✝1 ✆

1 G4 0

✝1 ✆G1 1

Fig. 1. An illustration of the bandpasses of S2 (π ∗ ) (in ovals) and the bandpasses of M1 (in boxes) for grouping purpose. A horizontal line in the figure represents a row, led by its index. In this figure, rows ra and rb are adjacent in π ∗ , denoted as (ra , rb ) ∈ π ∗ , and edge (ra , rb ) ∈ M1 as well; the bandpass between these two rows belongs to G1 . Edges (rt , ri ), (rj , rk ), (r� , ru ) ∈ M1 , (ri , rj ), (rk , r� ) ∈ π ∗ ; the bandpasses of S2 (π ∗ ) shown in the figure have their group memberships indicated beside them respectively.

We thus have, s2 (π ∗ ) = |G1 | + |G2 | + |G3 | + |G4 |.

(3)

From these definitions, we know all bandpasses of G1 are in M1 . Also, one pair of bandpasses of G2 correspond to a distinct bandpass of M1 . Bandpasses of G3 can be further partitioned into subgroups such that a subgroup of bandpasses share 1’s with a subset of distinct bandpasses of M1 ; moreover, these involved bandpasses of G3 and M1 form into an alternating cycle of length at least 4, or an alternating path of length 2. When they form into an odd-length alternating path, then from the definitions of groups G2 and G3 we conclude the following on the path length �: if � = 3, then one bandpass belongs to G3 and the other two belong to M1 ; if � ≥ 5, then the ratio between the number of bandpasses belonging to G3 and the number of associated bandpasses belonging to M1 is at most 32 . When they form into an even-length alternating path,

6

Tong et al.

then half of the bandpasses belong to G3 and the other half belong to M1 . It follows that M1 contains at least 23 |G3 | bandpasses corresponding to G3 . That is, 1 2 w(M1 ) ≥ |G1 | + |G2 | + |G3 |. (4) 2 3 Apparently, all bandpasses of G4 are in graph G� , while none of G1 ∪ G2 ∪ G3 is in graph G� . Note that the bandpasses of G2 are paired up such that each pair of the two bandpasses share a 1 with a bandpass of M1 . Assume without loss of generality that these two bandpasses of G2 are formed between rows ri and rj and between rows rk and r� , respectively, and that the involved bandpass of M1 is formed between rows rj and rk . That is, in the optimal row permutation π ∗ , rows ri and rj are adjacent, and rows rk and r� are adjacent; while edge (rj , rk ) ∈ M1 . We remark that these four rows are distinct. We conclude that edge (ri , r� ) ∈ / M1 . The proof is simple as otherwise in the particular column a bandpass would be formed between rows ri and r� , making the two bandpasses of G2 lose their group memberships. Lemma 2. Assume edge (rj , rk ) ∈ M1 , and that one bandpass of (rj , rk ) shares 1 with (two) bandpasses of G2 . Then edge (rj , rk ) is adjacent to at most four edges in the optimal row permutation π ∗ , at most two of which are incident at row rj and at most two of which are incident at row rk . Proof. The lemma is straightforward from the above discussion, and the fact that edge (rj , rk ) does not belong to π ∗ . Continue from the above discussion, assuming that edge (rj , rk ) ∈ M1 , and that one bandpass of (rj , rk ) shares 1 with two bandpasses of G2 , which are formed between rows ri and rj and between rows rk and r� , respectively. We know that in graph G� , see also Figure 1, between rows ri and r� , in the same column there is a bandpass (which contributes 1 towards the edge weight w� (i, �)). We call such a kind of bandpasses the induced bandpasses. From Lemma 2, edge (rj , rk ) is adjacent to at most two edges of π ∗ incident at row rj . It follows that in graph G� , row r� can form induced bandpasses with at most two other rows. In the other words, the subgraph of G� induced by the edges containing induced bandpasses, denoted as G�s is a degree 2 graph. Lemma 3. G�s is a degree 2 graph, and its weight w� (G�s ) ≥ 21 |G2 |.

Approximating the Bandpass problem

7

Proof. The first half of the lemma is a result of the above discussion. Since every pair of bandpasses of G2 lead to an induced bandpass, all the edge weights in G�s sum up to at least 12 |G2 |, which is the number of bandpass pairs in G2 . Lemma 4. The weight of matching M2 is w� (M2 ) ≥ max{ 14 |G2 |, 12 |G4 |} ≥ 1 1 12 |G2 | + 3 |G4 |. Proof. Note that a degree 2 graph can be decomposed into two disjoint matchings. Therefore, even in G�s there is a matching of weight at least 1 � 1 � � � 2 w (Gs ) ≥ 4 |G2 |. The lemma follows as Gs is a subgraph of G and that M2 is the maximum weight matching of G� . On the other hand, graph G� contains all bandpasses of S2 (π ∗ ) except those of G1 ∪ G2 ∪ G3 . Therefore, w� (M2 ) ≥ 12 |G4 |. The last inequality in the lemma comes from the fact that � � � � � � 1 1 1 1 2 1 1 1 max |G2 |, |G4 | ≥ |G2 | + |G4 | = |G2 | + |G4 |. 4 2 3 4 3 2 12 3 Theorem 1. Algorithm Approx is a cubic time the Bandpass problem.

24 13 -approximation

for

Proof. The running time of algorithm Approx is dominated by the computing for two maximum weight matchings, which can be done in cubic time. Since M1 is the maximum weight matching in graph G, from Eq. (2) we have � � n � 1 1 ∗ ∗ ∗ w(M1 ) ≥ p(π ) ≥ s2 (π ) + s� (π )(� − 1) . (5) 2 2 �=3

Combining Eqs. (4) and (5), we have � � �� � � n � 3 1 1 1 2 ∗ ∗ |G1 | + |G2 | + |G3 | . w(M1 ) ≥ s2 (π ) + s� (π )(� − 1) + 4 2 4 2 3 �=3 (6) The solution π produced by Approx contains b(π) ≥ w(M1 )+ 12 w� (M2 ) bandpasses, as indicated at the end of Section 2.1. From Lemma 4, we have 1 1 b(π) ≥ w(M1 ) + |G2 | + |G4 |. (7) 24 6 Together with Eqs. (3) and (6), the above Eq. (7) becomes, � � n 1 13 9 � ∗ ∗ b(π) ≥ |G1 | + s2 (π ) + s� (π )(� − 1) . (8) 12 24 13 �=3

8

Tong et al.

Note that for all � ≥ 3, (� − 1) ≥ 32 � 2� �. It then follows from Eqs. (8) and (1) that � � n 13 9 3� 13 ∗ ∗ � b(π) ≥ s2 (π ) + × s� (π )� � ≥ b(π ∗ ). (9) 24 13 2 2 24 �=3

That is, the worst-case performance ratio of algorithm Approx is at most 24 13 .

3

Conclusions and future work

In this paper, we presented a 24 13 -approximation algorithm for the Bandpass problem, which is the first improvement over the maximum weight matching based 2-approximation algorithm. Our algorithm is still based on maximum weight matchings, similarly as tackling the closely related Max-TSP. Though out algorithm description is not too complex, its performance analysis appears non-trivial. It is noted that our algorithm applies to the Max-TSP as well, achieving a worst case performance ratio 85 . We are not sure whether a better analysis would narrow the gap between 85 and 24 13 on the Bandpass problem. For the Max-TSP, Serdyukov presented a 43 -approximation algorithm based on the maximum weight assignment and the maximum weight matching [9]. But this elegant idea does not easily pass on to the Bandpass problem. Hassin and Rubinstein gave a randomized approximation algorithm for the Max-TSP with expected performance ratio 33 25 [7] (which is de-randomized leading to the approximation algorithm in Lemma 1). It would be interesting to design a randomized approximation for the Bandpass problem too, with better than 24 13 expected performance ratio.

Acknowledgement This research was supported in part by NSERC.

References 1. E. M. Arkin and R. Hassin. On local search for weighted packing problems. Mathematics of Operations Research, 23:640–648, 1998. 2. D. A. Babayev, G. I. Bell, and U. G. Nuriyev. The bandpass problem: combinatorial optimization and library of problems. Journal of Combinatorial Optimization, 18:151–172, 2009.

Approximating the Bandpass problem

9

3. G. I. Bell and D. A. Babayev. Bandpass problem. In Annual INFORMS meeting, 2004. October 2004, Denver, CO, USA. 4. B. Chandra and M. M. Halld´ orsson. Greedy local improvement and weighted set packing approximation. In ACM-SIAM Proceedings of the Tenth Annual Symposium on Discrete Algorithms (SODA’99), pages 169–176, 1999. 5. Z.-Z. Chen, Y. Okamoto, and L. Wang. Improved deterministic approximation algorithms for Max TSP. Information Processing Letters, 95:333–342, 2005. 6. M. R. Garey and D. S. Johnson. Computers and Intractability: A Guide to the Theory of NP-completeness. W. H. Freeman and Company, San Francisco, 1979. 7. R. Hassin and S. Rubinstein. Better approximations for Max TSP. Information Processing Letters, 75:181–186, 2000. 8. G. Lin. On the Bandpass problem. Journal of Combinatorial Optimization, 22:71– 77, 2011. 9. A. I. Serdyukov. An algorithms for with an estimate for the traveling salesman problem of the maximum. Upravlyaemye Sistemy, 25:80–86, 1984.