Shortest paths through two-tone pairs

Shortest paths through two-tone pairs

Shortest paths through two-tone pairs Th. Epping 1, W. Hochst¨attler 2 University of Technology Cottbus, Germany 1 Introduction We consider a spec...

79KB Sizes 1 Downloads 135 Views

Shortest paths through two-tone pairs

Th. Epping 1, W. Hochst¨attler 2 University of Technology Cottbus, Germany

1

Introduction

We consider a special class of instances of a combinatorial problem that has been shown to be NP-complete in general (see [1]). The use of matroid theory allows us to solve the problem for certain instances in these class in polynomial time and thereby to partially answer an open problem stated in [1]. Problem 1 Given is an alphabet Σ of size n2 and a word w = (w1 , . . . , wn ) in which each element l ∈ Σ occurs exactly twice. Synthesize w with a minimal number of color changes, when every element of Σ is available once in each of two given colors. A color change occurs in a solution to Problem 1 whenever adjacent letters of w differ in color. The number of occurences of each element of Σ in w is not prescribed in the general form of the problem, where it can be seen as the problem of sequencing products (the elements of Σ) so that the production sequence is maintained and contains a minimal number of color changes (an application can be found in the paint shop of an automobile plant, see [2] for more details). We show that Problem 1 can be modelled as the problem of finding a shortest circuit through a special element in a binary one-point-extension of a regular matroid. This problem is well-known and solvable in polynomial time for matroids that have the MaxFlow-MinCut property. Furthermore, we give a lower and an upper bound on the value of an optimal solution. 1 2

[email protected] [email protected]

Preprint submitted to Elsevier Science

12 February 2003

2

Problem reformulation and a solution algorithm

Suppose that we are given an instance w of Problem 1. We associate with w a (|Σ| × (n − 1))-matrix A = A(w) that is defined by

aσj :=

    1    0

, if j is greater than or equal to the position of the first occurence of σ in w and less than the position of the second , otherwise,

where σ ∈ Σ. This way, every column of A corresponds to a possible position of a color change in w (see Figure 1 for an example). 



1   0   0    0  

ABBCDACEED

1 1 1 1 0 0 0 0A  

1 0 0 0 0 0 0 0 B   0 0 1 1 1 0 0 0 C 0001111

  1 D 

000000010

E

Fig. 1. An example instance of Problem 1 and the associated matrix

As each element of Σ is available only once in each of two colors, there must be an odd number of color changes between its first and second occurence in w. Problem 1 can thus be formulated as depicted in Figure 2(a). In the following, we denote by 1 resp. 0 the vector of all ones resp. zeros of appropriate dimension. n−1 i=1

1T x → min!

xi → min!

(A, 1)x ≡ 0 mod 2

Ax ≡ 1 mod 2

xn = 1

xi ∈ {0, 1}

xi ∈ {0, 1}

(a)

(b)

Fig. 2. Integer programming with constraints over GF(2)

If we replace the constraint Ax ≡ 1 mod 2 by the equivalent constraints (A, 1)x ≡ 0 mod 2 and xn = 1, we obtain the integer program depicted in Figure 2(b). Now, interpreting each column of (A, 1) as an element of a binary vector matroid, we are faced with the problem of finding a shortest circuit of (A, 1) that contains the element 1. Note that A is totally unimodular, so that (A, 1) is a one-point-extension of a regular matroid. 2

Problem 2 Given is a connected binary matroid M = (E, I) with a special element l and a distance function d : E \ l → N≥0 . Find a circuit C of M containing l such that e∈C d(e) is minimal. The following theorem and the mentioned polynomial time solution algorithm can be found in [3]. A matroid has the MaxFlow-MinCut (MFMC) property, if it does not contain an F7∗ minor. For regular MFMC matroids, the problem can be solved by linear programming. For non-regular MFMC matroids, the algorithm makes use of Seymours splitter theorem. Theorem 3 Problem 2 is solvable in polynomial time for MFMC matroids. Corollary 4 Problem 1 is solvable in polynomial time for instances for which the binary vector matroid given by the matrix (A, 1) has the MFMC property.

3

MaxFlow-MinCut duality

The transformation of Problem 1 into Problem 2 shows that we are actually rather interested in the solution of a shortest path problem than in the solution of a maximal flow problem. Definition 5 Suppose that we are given a matroid M = (E, I) with a specific element l ∈ E and a distance function d : E → N≥0 . We call a set S = {C1 , . . . , Ck } of cocircuits of M a coflow through l of value k, if both (a) Ci ∩ Cj = {l} for all Ci , Cj ∈ S and Ci = Cj , and (b) |{Ci : e ∈ Ci }| ≤ d(e) for all e ∈ E. Informally speaking, a coflow is a disjoint packing of cocircuits if we disregard the element l. We cite the dual version of Seymours famous MaxFlow-MinCut theorem for matroids. Theorem 6 Given is a binary matroid M = (E, I) and a specific element l ∈ E. Then M has no F7 minor that contains l if and only if the minimal length of a circuit through l equals the maximal value of a coflow through l for all distance functions d : E → N≥0 . In terms of Problem 2, we have M = (A, 1), l = 1, and a distance function d ≡ 1 except for d( 1) = 0. The disjoint packing of cocircuits consists of sums (i. e., symmetric differences) of rows of A. These have to be odd, as each cocircuit must contain the element 1. Altogether we get the following theorem. Theorem 7 If (A, 1) has no F7 minor that contains 1, then the minimum number of color changes of an instance of Problem 1 equals the maximal value of a disjoint odd row sum packing of rows of A. 3

Example 8 The minimal number of color changes for the instance shown in Figure 1 is 4, and (A, 1) contains no F7 minor. A maximal disjoint odd row sum packing is given by {A∆B∆C}, {C∆D∆E}, {B}, and {E}. We do not know yet how a disjoint odd row sum packing can be efficiently computed in general. In particular, there seems to be no immediate way to derive a packing from the dual solution of the linear program in case of regular instances of Problem 2. However, a theorem similar to Theorem 3 should hold for instances of Problem 2 that contain no F7 minor (i. e., instances that have a “ShortestCircuitMaxCoflow” property) as well.

4

Lower and upper bounds

We end with two lemmas that comprise a lower and an upper bound on the minimal number of color changes of an instance of Problem 1. The algorithm for the computation of the lower bound is based on the fact that the matrix A associated with an instance w is a clique matrix of an interval graph (see [4]). More details on the algorithm can be found in [2]. The lemma on the upper bound is a special case of a lemma mentioned in [1]. Lemma 9 A lower bound on the minimal number of color changes for a given instance of Problem 1 can be computed in polynomial time, using an algorithm for the maximum stable weighted set problem. Lemma 10 The minimal number of color changes for any instance of Problem 1 is bounded from above by |Σ|, and this bound is tight. References [1] Th. Epping, W. Hochst¨ attler, P. Oertel: Some results on a paint shop problem for words. In: Electronic Notes in Discrete Mathematics, Volume 8, 2001. [2] Th. Epping, W. Hochst¨ attler, M. E. L¨ ubbecke: MaxFlow-MinCut duality for a paint shop problem. To appear in: U. Leopold-Wildburger, F. Rendl, G. W¨ ascher (Eds.): ”Operations Research Proceedings 2002”, Berlin, Springer, 2003. [3] K. Truemper: Matroid decomposition. Academic Press, 1992. Available online via http://www.emis.de/monographs/md/. [4] M. C. Golumbic: Algorithmic graph theory and perfect graphs. Academic Press, 1980.

4