32
DISCRETE APPLIED Discrete Applied Mathematics 63 (1995) 43-74 MATHEMATICS On the recognition of permuted bottleneck Monge matrices* Bettina Klinz*, Riidiger Rudolf, Gerhard J. Woeginger TU Graz, Institut ftir Mathematik B, Kopernikusgasse 24, A-8010 Graz, Austria Dedicated to Prof. Rainer E. Burkhard on the occasion of his 50th birthday Received 4 March 1993; revised 30 November 1993 Abstract An II x m matrix A is called bottleneck Monge matrix if max{ajj, a,,} < max{a,, ali} for all l<i<r<n, 1 < j < s < m. The matrix A is termed permuted bottleneck Monge matrix, if there exist row and column permutations such that the permuted matrix becomes a bottleneck Monge matrix. We first deal with the special case of Cl bottleneck Monge matrices. Next, we derive several fundamental properties on the combinatorial structure of bottleneck Monge matrices with arbitrary entries. As a main result we show that permuted bottleneck Monge matrices with arbitrary entries can be recognized in O(nm(n + m)) time. 1. Introduction Problem Statement. An n x m matrix A is called Monge matrix if A satisfies the so-called Monge property: Uij + Urs < ais + Ll,j for all 1 < i < r < n, 1 < j < S < m. (1) This property dates back to a paper by Monge [21] and was rediscovered by Hoffman [16] (actually, Hoffman considered the more general notion of Monge sequences). Ma- trices fulfilling property (1) are also known as distribution matrices (see e.g. [ 151 or [29]). If we replace the + sign in the Monge property (1) by “max” we get the bottleneck Monge property: max{aij, ars} < max(ai,, a,j} for all 1 < i < r < n, 1 < j < S < m. (2) Matrices A fulfilling property (2) are called bottleneck Monge matrices or max- distribution matrices (see e.g. [7] or [S]). Note that matrices with a single row or *This research has been supported by the Christian Doppler Laboratorium fiir Diskrete Optimierung and by the Fonds zur Fijrderung der wissenschaftlichen Forschung, Project P8971-PHY. *Corresponding author. 0166-218X/95/$09.50 0 1995-Elsevier Science B.V. All rights reserved SSDI 0166-218X(94)00019-A

On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

DISCRETE APPLIED

Discrete Applied Mathematics 63 (1995) 43-74 MATHEMATICS

On the recognition of permuted bottleneck Monge matrices*

Bettina Klinz*, Riidiger Rudolf, Gerhard J. Woeginger

TU Graz, Institut ftir Mathematik B, Kopernikusgasse 24, A-8010 Graz, Austria

Dedicated to Prof. Rainer E. Burkhard on the occasion of his 50th birthday

Received 4 March 1993; revised 30 November 1993

Abstract

An II x m matrix A is called bottleneck Monge matrix if max{ajj, a,,} < max{a,, ali} for all l<i<r<n, 1 < j < s < m. The matrix A is termed permuted bottleneck Monge matrix, if there exist row and column permutations such that the permuted matrix becomes a bottleneck Monge matrix.

We first deal with the special case of Cl bottleneck Monge matrices. Next, we derive several fundamental properties on the combinatorial structure of bottleneck Monge matrices with arbitrary entries. As a main result we show that permuted bottleneck Monge matrices with arbitrary entries can be recognized in O(nm(n + m)) time.

1. Introduction

Problem Statement. An n x m matrix A is called Monge matrix if A satisfies the so-called Monge property:

Uij + Urs < ais + Ll,j for all 1 < i < r < n, 1 < j < S < m. (1)

This property dates back to a paper by Monge [21] and was rediscovered by Hoffman [16] (actually, Hoffman considered the more general notion of Monge sequences). Ma- trices fulfilling property (1) are also known as distribution matrices (see e.g. [ 151 or [29]).

If we replace the + sign in the Monge property (1) by “max” we get the bottleneck

Monge property:

max{aij, ars} < max(ai,, a,j} for all 1 < i < r < n, 1 < j < S < m. (2)

Matrices A fulfilling property (2) are called bottleneck Monge matrices or max-

distribution matrices (see e.g. [7] or [S]). Note that matrices with a single row or

*This research has been supported by the Christian Doppler Laboratorium fiir Diskrete Optimierung and by the Fonds zur Fijrderung der wissenschaftlichen Forschung, Project P8971-PHY. *Corresponding author.

0166-218X/95/$09.50 0 1995-Elsevier Science B.V. All rights reserved SSDI 0166-218X(94)00019-A

Page 2: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

44 B. Klinz et al. 1 Discrete Applied Mathematics 63 (1995) 43-74

a single column trivially satisfy the properties (2) and (1). Therefore, we assume throughout that all considered matrices have at least two rows and columns.

Since in many applications the ordering of rows and columns does not play a role, the problem arises which matrices can be transformed into (bottleneck) Monge matrices by permuting rows and columns. Hence, we call a matrix A permuted Monge

matrix, respectively, permuted bottleneck Monge matrix if and only if there are permutations 4 and $ of the rows and the columns such that the permuted matrix A,,, = (ag(i)ecj)) is a Monge matrix, respectively, a bottleneck Monge matrix.

Now the problem arises how to recognize (bottleneck) Monge matrices and per- muted (bottleneck) Monge matrices. Whereas it is trivial to decide in polynomial time whether a given input matrix is (bottleneck) Monge (check all inequalities in (1) or (2)), the situation is more interesting in the permuted case. Formally, the recognition

problem for permuted (bottleneck) Monge matrices is stated as follows.

(RP) Given an n x m matrix A, decide whether or not there exist two permutations q5 and

$ such that the permuted matrix A,,, is a (bottleneck) Monge matrix. In the

afirmative case, determine such a pair of permutations (4, $).

In some applications the following restricted versions of the above recognition

problem (RP) occur.

(RP= ) Solve (RP) under the additional requirement that c++ = II/. (RP’) Solve (RP) when only row permutations, but no column permutations are

allowed.

In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge matrices and thus solved (RP) for the sum case. In this paper we solve (RP) for the bottleneck case.

Motivation. Many problems in combinatorial optimization become easy or easier, if their input matrices are Monge or bottleneck Monge matrices. For example, it can be shown that the well-known north-west-corner rule yields an optimal solution of the Hitchcock transportation problem for all feasible demand and supply vectors if and only if the cost matrix is a Monge matrix. (For a more general result, see [16].) For bottleneck Monge matrices an analogous approach succeeds for transportation problems with bottleneck objective function (see [6,7]). Another well-known prop- erty of (bottleneck) Monge matrices is that the linear (bottleneck) assignment problem becomes trivial since it is solved by the identity permutation. In the above examples the problem remains unchanged if rows and columns of the given cost matrices are permuted independently. Hence, the problem (RP) plays an important role in the recognition of greedily solvable transportation and assignment problems.

All problems mentioned above are solvable in polynomial time for arbitrary cost matrices. There are also applications where the general problem is NP-hard, but becomes efficiently solvable when restricted to (bottleneck) Monge matrices. For

Page 3: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43-74 45

example, the traveling salesman problem (TSP) with sum objective function (bottle- neck objective function) becomes efficiently solvable if the distance matrix is a (bottle- neck) Monge matrix (for further details, see e.g. [l&8,29]). Note that for the TSP the same reordering has to be applied to both rows and columns. Hence, we arrive at the restricted recognition problem (RP=).

There are also applications which lead to recognition problems of type (RP’), where the ordering of the columns remains fixed. Consider e.g. a flow-shop scheduling problem with n jobs and m machines. Given a fixed ordering of the machines according to which the jobs have to pass the machines, the problem is to determine a schedule which minimizes the makespan. Let pij denote the processing time of job i on machine j. Several authors observed that if the matrix P = (pij) fulfills min{ pij, p,,} > min { pis, plj} for all 1 < i < I d n, 1 d j < s < m then the schedule obtained by processing the jobs on each machine according to the sequence (n, n - 1, . . . . 1) is optimal (see e.g. the survey paper by Monma and Rinnooy Kan [22]). Note that this condition is equivalent to P = ( - pij) being a bottleneck Monge matrix. Since the order of the machines is fixed, we are only allowed to renumber the jobs, i.e. the rows of P. We note that for the two-machine case the schedule ob- tained by reordering the jobs such that the matrix of the negative processing times becomes bottleneck Monge coincides with the ordering obtained by the famous Johnson rule [19].

Further applications of bottleneck Monge matrices and matrices with related properties can be found in [3].

Related results. All results in the literature on recognizing Monge properties are for the sum case only. We give a brief summary. Deineko and Filonenko [12] solved the recognition problem for permuted n x m Monge matrices in O(nm + n log n + m log m) time. (Note that this yields an 0(n2) time algorithm for the special case of n x n matrices which is in any case superior to the algorithm which is presented in [lo] without a convincing proof of correctness.) Recently, several authors con- sidered generalizations of the Monge property (1) to multidimensional arrays and showed how to recognize permuted multidimensional Monge arrays, see e.g. [4] (resp.

c241). Cechlarova and Szabo [9] dealt with recognizing n x n matrices which can be

permuted so as to fulfil the weaker version of property (1) where i = j holds, and presented an 0(n4) algorithm for this problem.

Starting from Hoffman’s definition of a Monge sequence, Alon et al. [2] gave an 0(m2n log n) algorithm which constructs a Monge sequence for an n x m input matrix A with n >, m whenever such a sequence exists. Later on this algorithm was generaliz- ed to matrices with infinite entries by Shamir [26] and Dietrich and Shamir [14].

Outline ofmain results. Our algorithm for recognizing permuted bottleneck Monge matrices with arbitrary entries relies on the following threshold-type approach: Let iii > d2 > ... > iiL denote the sequence of all pairwise-distinct values of entries in the input matrix A and associate with each value &, 1 < k Q L, a related O-l matrix Tk in the following way: If entry aij < & then the corresponding entry in Tk is 0, otherwise it

Page 4: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

46 B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43-74

is 1. Then A is a permuted bottleneck Monge matrix if and only if there exists a common pair (4, I/) of row and column permutations such that the permuted matrices Tz,,, k = 1, . . . , L, are all bottleneck Monge matrices. To exploit this idea algorithmically, we need an efficient recognition algorithm for the special case of

permuted (rl bottleneck Monge matrices. Fortunately, &l bottleneck Monge matrices can be characterized in a nice way,

both from the matrix point of view and also in terms of their associated bipartite graph. A result of Chen and Yesha [11] implies that a O-l matrix A is bottleneck Monge if and only if the complement of the bipartite graph B(A) associated with A is a strongly ordered bipartite permutation graph (for definitions and further details, see Section 2). Hence, the recognition algorithm for strongly ordered bipartite permuta- tion graphs developed by Spinrad et al. [27] can be used to recognize permuted (rl bottleneck Monge matrices in linear time. Furthermore, the set of all pairs of row and column permutations (4, $) which transform the given (rl matrix into a bottleneck Monge matrix, can be described in a concise and compact way. Based on this description we can solve the restricted recognition problem (RP=) where the same permutation has to be applied to both rows and columns.

Organization ofthe paper. In Section 2 we summarize two characterizations for Gl bottleneck Monge matrices from the literature. In particular, we relate the class of O-l bottleneck Monge matrices to strongly ordered bipartite permutation graphs and to so-called double staircase matrices. In the next two sections, Sections 3 and 4, we investigate the structure of bottleneck Monge matrices with arbitrary entries. We derive several properties of bottleneck Monge matrices which provide some evidence that indeed the recognition problem for permuted bottleneck Monge matrices is more difficult than the corresponding problem for permuted Monge matrices. In Section 5 we first present a compact characterization of the set of all pairs of row and column permutations that transform a given O-l matrix into a bottleneck Monge matrix. Then we describe a linear-time algorithm for recognizing permuted f&l bottleneck Monge matrices and briefly compare our algorithm to the algorithm of Spinrad et al. [27] for recognizing bipartite permutation graphs. Based on the results for (rl matrices, Section 6 derives a recognition algorithm for bottleneck Monge matrices with arbitrary entries. Finally, in Section 7 we consider several problem variations. We close the paper with a short discussion and some concluding remarks in Section 8.

2. O-l bottleneck Monge matrices

It turned out that there exist several graph theoretical results that are closely related to O-l bottleneck Monge matrices. We start with some definitions.

Let A be a O-l matrix and denote by B(A) = (VI, V,; EA) its associated bipartite graph with a vertex in V1 for each row of A, a vertex in V, for each column of A and an edge (i, j) E EA joining vertices i E VI and j E VZ if and only if the entry aij of A equals 1.

Page 5: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43-74 41

A bipartite graph H = (V,, V,; E) is said to be strongly ordered if for all (i, j), (i', j’) E E, where i, i’ E VI and j, j’ E VZ, it follows from i < i’, j’ < j that (i, j’) E E and (i’, j) E E.

Let G = (V, E) be an undirected graph with vertex set V and edge set E and denote by G = (V, E) its complement having an edge (i, j) E l? iff (i, j) $ E. Let furthermore N(i)

designate the neighbourhood of vertex i, not including i itself. The graph G = (I’, E) is called permutation graph, if there exists a pair (pi, p2) of

permutations of the vertex set I, such that there is an edge (i, j) E E if and only if vertex i precedes vertex j in one of {pi, pz> and j precedes i in the other.

Bipartite permutation graphs can be characterized as follows (see [27]).

Theorem 2.1 (Spinrad et al. [27]). Let H = (VI, V,; E) be a bipartite graph. Then the

following three statements are equivalent for H.

(9 (ii)

(iii)

H is a bipartite permutation graph.

The vertices in VI u V, can be renumbered such that the resulting graph is strongly

ordered.

There exists an ordering p of vertex set VI which has the adjacency and enclosure

properties, i.e. for each j E V2 the neighbours of j are consecutive within p and for

every pair of vertices j’, j” E V, such that N( j’) is a subset of N( j”), the vertices

within N( j”)\ N( j’) occur consecutively within p.

Now the relation between bipartite permutation graphs and &l bottleneck Monge matrices has to be clarified. For that purpose, we return to the matrix point of view. Since any matrix with just one row or one column satisfies the bottleneck Monge property (2), we henceforth consider only matrices with at least two rows and at least two columns.

We say that a matrix A avoids a set % of matrices if no element of % appears as submatrix in A (cf. [17]). Obviously, a O-l matrix A fulfills the bottleneck Monge property (2) if and only if it avoids the following three 2 x 2 submatrices:

Observation 2.2 (Chen and Yesha [Ill, Theorem 31). A O-l matrix A is a bottleneck

Monge matrix if and only if its associated bipartite graph B(A) is the complement of

a strongly ordered bipartite permutation graph.

This result enables us to recognize permuted O-l bottleneck Monge matrices by applying the algorithm of Spinrad et al. [27] which decides whether a given bipartite graph H is a bipartite permutation graph and if so, determines a strong ordering of H.

In the following we present another characterization of O-l bottleneck Monge matrices. Let A be an n x m O-l matrix with no rows of all ones. Denote by si (resp.5) the position of the first (resp. last zero) in row i. A O-l matrix A is said to be a double

Page 6: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

48 B. Klinz et al. 1 Discrete Applied Mathematics 63 (1995) 43-74

staircase matrix if sr < s2 6 +.. < sn,fi < fi d *.. <fn and aij = 0 for allj E [sitf;], i.e.

if the zeros in each row are consecutive and if the rows are ordered increasingly with respect to both the first and the last zero entry in each row. The term “double staircase” is introduced since in a pictorial setting the positions of the first (resp. last) zero in each row form a staircase. (Matrices with a similar property were introduced independently in [l l] .)

In the following it will be shown that O-l bottleneck Monge matrices with no rows or columns of all ones are in fact equivalent to double staircase matrices. A O-1 matrix A has the consecutive zeros property for rows (columns) if the columns (rows) can be permuted such that zeros in each row (column) are consecutive (see e.g. [28] or [S] for more details). If the zeros occur consecutively in each row and in each column of the O-l matrix A, then A is said to be doubly convex. Note that any double staircase matrix is also doubly convex. The following observations are straightforward.

Observation 2.3. Let A be a (rl bottleneck Monge matrix with no all ones rows and

columns. Then the following three properties hold for A. (i) Identical columns (rows) form a contiguous block in A.

(ii) If A has at least two rows (columns), then the zeros in each row (column) of A are consecutive.

(iii) Inserting an arbitrary number of all ones columns and rows into A does not destroy

the bottleneck Mange property.

Proof. We prove (i) for columns. Suppose that two identical columns j, and j, are separated by another column j2. Then obviously either (0, LO) or (1, 0, 1) occurs as submatrix within A. Both cases easily lead to contradictions.

To show (ii) for the rows of A, observe that if (0, LO) occurs as submatrix in A within columns jr, j, and j,, then the middle column j, must be an all ones column, since otherwise one of the submatrices Br, B2 or B, would be produced. 0

From now on we assume that A neither contains identical rows nor identical columns nor all ones rows nor all ones columns. We call such a matrix a reduced O-l matrix and state the following theorem.

Theorem 2.4. A reduced O-l matrix A is a bottleneck Monge matrix if and only ifit is a double staircase matrix.

Proof. The proof of e is trivial, and we only show * : Suppose that the matrix A is not a double staircase matrix. Then there exist two rows iI and iZ, iI < i2, such that either the first zero of i2 lies to the left of the first zero of iI or the last zero of i2 lies to the left of the last zero of iI. In the first case at least one of the matrices Bz or B1 is contained in A. Likewise, in the second case either B3 or B1 must occur in A. 0

Page 7: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43-74 49

We conclude this section by noting that the consecutive zeros property for rows and columns is necessary but not sufficient for a matrix to be a permuted bottleneck Monge matrix. Consider the following matrix:

A=

By Theorem 2.4 it suffices to show that A cannot be permuted into a double staircase matrix. Suppose the contrary. From the first and the third row of A it follows that in any double staircase matrix obtained from A by row and column permutations, columns 1 and 2 and columns 2 and 3 need to be adjacent. The remaining rows of A,

however, imply that column 2 cannot be the middle column in a double staircase matrix. Thus we arrive at a contradiction.

3. Bottleneck Monge matrices with arbitrary entries

We first give some examples of bottleneck Monge matrices and then describe the main differences between Monge matrices and bottleneck Monge matrices.

3.1. Examples for bottleneck Monge matrices

O-l Bottleneck Monge matrices. From the results in Section 2 we know that any O-l bottleneck Monge matrix is either a double staircase matrix or can be obtained from a double staircase matrix by inserting an arbitrary number of all ones rows and columns.

Generalized staircase matrices. Let A be an n x m matrix and suppose that _ _ al > a2 > ..a > &. are the pairwise-distinct values of entries of matrix A. For 1 < k Q L, we define f&l matrices Tk as follows: If entry aij < iik then the correspond- ing entry in Tk is 0; otherwise, it is 1. The following observation relates the original matrix A to the matrices Tk.

Observation 3.1. A is a bottleneck Monge matrix if and only f all matrices Tk, k=l , . . . . L, are bottleneck Monge matrices.

Note that the definition of double staircase matrices can be extended in a natural way to matrices A with rows of all ones by simply requiring that such rows occur only at the top and at the bottom of A.

Let k E (1, . . . . L}. For each matrix entry tik the rows of A can be partitioned into two ChSSeS Rlk and RZk, where RZk contains the rows with all entries > fik. For each row i in R Ik We define numbers sik := min { j: Uij < iik} andfik := IllaX { j: Uij < iik}. %lCe the

Page 8: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

50 B. Klinz ef al. / Discrete Applied Mathematics 63 (1995) 43-74

rows in RZk play the role of the all ones rows in the (rl case, we require that a row i from RZk either precedes all rows in Rlk or succeeds all rows in Rlk. For convenience, we set sik =& = 1 in the first case and sik =J;.k = n in the latter case. A matrix A is now called generalized staircase matrix if the following three conditions are satisfied for all IdkbL:

0) s Ik ,< s2k < “* & s,k,

(ii) fik d .hk d . . . < fnk and

(iii) aij < & for all j such that sik < j < &. Obviously, generalized staircase matrices form a proper subclass of bottleneck Monge matrices. This subclass has some nice properties which do not hold for bottleneck Monge matrices in general. For example, the rows and columns of a generalized staircase matrix are bitonic vectors, where a vector x E Rd is called bitonic if there existsanindexq,1~q~dsuchthatx,~...3x,andx,dx,+ld...~xd.Observe that the bitonicity implies that all row and column maxima can be determined in O(n + m) time. It follows furthermore that the maximum entry of a generalized staircase matrix can be found in constant time by comparing the entry in the right upper corner and the entry in the left lower corner. All these properties are not true for bottleneck Monge matrices in general.

Two-row bottleneck Monge matrices. Let A be a matrix with 2 rows. We define the following three sets of columns Ci:= {j: a,, < aZj), C= := {j: alj = u,~) and C’ := {j: Ulj > a,j}. By generalizing ideas of Burkard [7] and Johnson [19] we obtain a complete characterization of bottleneck Monge matrices with two rows.

Lemma 3.2. Let A be a 2 x m matrix. A is a bottleneck Monge matrix if and only if column j precedes column s, i.e. j < s, whenever one of the following five conditions is

satisfied. (i) j E C’, SEC< and a2j >a2s. (i’) j E C’, SEC= andazj>a,,.

(ii) j E C’, s E C’ and a,j < aI,. (ii’) jE C=, s E C’ and a,j < a,,. (iii) jEC< and SEC’.

Proof. =s- : Let A be bottleneck Monge. Suppose j and s are two columns which satisfy (i) or (i’). From j E C’ we get alj < a2j and by assumption we have a2j > a2S. Therefore, max {aij, azs} < max {al,, Uzj} and hence j < s, since otherwise the bottle- neck Monge property would be violated. In the same manner it can be shown that the ordering j < s is implied by conditions (ii), (ii’), and (iii), respectively.

F: Assume the contrary and let j and s, j < s, be two columns such that maX{Uij, u2s} > max(a rs, U2j). Now there are two cases, namely aij > a2S and aij < u2sr respectively. We demonstrate the proof for the first case and leave the second to the reader. Due to the above assumptions we must have aij > a,, and Uij > azj. Hence j E C' . Note that s cannot belong to C’, since (iii) would lead to s < j, a contradiction. Thus s $ C’. But then due to alj > al, either (ii) or (ii’) would imply s < j, thus another contradiction. q

Page 9: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

B. Klinz et al. 1 Discrete Applied Mathematics 63 (1995) 43-74 51

Remark 3.1. (1) The rules of Lemma 3.2 can be summarized as follows. First, any column from C’ precedes any column from C’ (cf. (iii)). Secondly, the columns within C’ have to be ordered according to nonincreasing value of a2j (cf. (i)), while those within C’ have to be ordered according to nondecreasing value of arj (cf. (ii)). Ties can be resolved arbitrarily. We note that there is no condition on the mutual placement of two columns j and s for which j E C= and aij = azj > max{ai,, Q). Consequently, for each column j E C= there exists an interval of possible positions of this column in a bottleneck Monge matrix.

(2) By scanning the columns of a 2 x m input matrix A and testing whether the conditions of the above lemma are satisfied, it can be decided in O(m) time whether A is bottleneck Monge.

(3) Consequently, it can be decided in O(min{n’m, m’n}) time whether any given n x m matrix is bottleneck Monge. (Simply test all pairs of rows or all pairs of columns.)

(4) Lemma 3.2 yields an implicit description of the set of all column permutations that transform a given 2 x m matrix into a bottleneck Monge matrix. In particular, there is a unique ordering of the columns if all matrix entries are pairwise distinct. Hence, permuted bottleneck n x m Monge matrices can be recognized in O(nm + n log n + m log m) time provided that all nm entries are pairwise distinct.

(5) Any 2 x m matrix is a permuted bottleneck Monge matrix. (An analogous result for the sum case is mentioned in [13].) The following O(mlogm) time algorithm reorders the columns such that the resulting matrix becomes bottleneck Monge: Arrange first the columns within C’ according to (i), then the columns in C= in arbitrary order and finally the columns in C’ according to (ii). (This procedure is essentially Johnson’s [ 193 rule for two-machine job-shop scheduling.)

3.2. Diflerences between Mange matrices and bottleneck Mange matrices

In the remaining part of this section we state some differences between Monge matrices and bottleneck Monge matrices with far-reaching consequences on the recognition problem (RP).

Monge matrices are closely related to the class of totally monotone matrices which received much attention in recent years (see e.g. [l] or [23]). An n x m matrix A is said to be totally monotone if aij < ai, implies a,j < ars for all l~i<rdnandldj<s~m.ItiseasytoseethatifAisMonge,then -Ais totally monotone. Unfortunately, no analogous result holds for bottleneck Monge matrices. However, the negative of any generalized staircase matrix (see Section 3.1) is totally monotone.

Another difference between Monge matrices and bottleneck Monge matrices is the following: While for Monge matrices there is a nice equivalent characterization stating that an n x m matrix A is a Monge matrix if and only if

6.j + &+l,j+l d Q+l,j + &,j+l foralll<i<n-1, l<j<m-1, (3)

Page 10: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

52 B. Klinz et al. / Discrete Applied Mathematics 63 (I995) 43-74

there is no analogous characterization for bottleneck Monge matrices. It is easy to see that the condition

max{ai,j, Qi+l,j+l } < max{ai+l,j, ai,j+l}

forall1~~i,<n-1,1~j<m-1 (4)

is not equivalent to the bottleneck Monge property (2). Take, for example, the following 2 x 3 matrix which fulfills (4) but is not bottleneck Monge:

A= 5 ’ l ( > 2 7 3’

Due to these differences between Monge matrices and bottleneck Monge matrices, neither the problem of deciding whether a given matrix is bottleneck Monge nor the problem of recognizing permuted bottleneck Monge matrices can be solved by carrying over the algorithms which are known for the sum case.

The reason for this different behaviour lies in the algebraic properties of the operations “ + ” and “max”. The conditions (1) and (3) are equivalent because the inequalities x1 + yz < x2 + y1 and yl+zzdy,+zl imply xr+zz<xx2+z1. However, it cannot be concluded from max(xi, y2) Q max(xz, y, > and

max{yr, z2} d max{y,, zl} that max(x,, z2} < max{xz, zl}. In other words, the difficulties with “max” are due to the fact that the strong cancellation rule

a@c<b@c=-a<bistruefor @:= + butnotfor @:=max. The following lemma shows that there is a weaker version of the transitivity-type

result above which also holds for “max”.

Lemma 3.3. Let x1, x2, yl, y,, z1 and z2 be real numbers such that either (i) y, = y, and

yl <max{x,,x,,z,, z2} or (ii) y, # y2. Then the two inequalities

max{xl,y2} d max(x2, yl} and max{y,, z2} d max{y2, zl} (5)

imply the third inequality

max{x,,z,} < max(x2,z1}. (6)

4. Fundamental properties of bottleneck Monge matrices

Our aim in investigating the structure of bottleneck Monge matrices is twofold. On the one hand, we obtain a better understanding of bottleneck Monge matrices which facilitates the recognition of permuted bottleneck Monge matrices. On the other hand, the results presented below show that the combinatorial structure of bottleneck Monge matrices is more complicated than that of Monge matrices. This explains that our recognition algorithm for permuted bottleneck Monge matrices (to be presented in Section 6) is more involved and less efficient than the corresponding recognition algorithm of Deineko and Filonenko [12] for permuted Monge matrices.

Page 11: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

B. Klinz et al. 1 Discrete Applied Mathematics 63 (1995) 43-74 53

Let henceforth A be an n x m matrix with row set (1,2, . . ., n> and column set

{1,2, ..‘, m>. By &d we denote the identity permutation on the set { 1, . . . , d), i.e. &d(i) := i

foralliE{l,..., d}. For 4 a permutation on { 1, . . . , d}, the permutation r$- defined by I#-(i) := +(d - i + 1) is called the reuerse permutation of 4. Accordingly, the reverse

matrix A- of matrix A is given by A- := AE;~;.

Observation 4.1. Let A be a bottleneck Monge matrix and let u E R” and v E R”’ be two

real vectors. Then (i) the transpose AT of A, (ii) the reverse matrix A- of A, and (iii) B = (b,) defined by b, := max(a+ nip vi} are also bottleneck Monge matrices.

Because of property (i) we may henceforth assume that n B m except for the case of the restricted recognition problem (RP’) where the ordering of the columns is fixed.

In the sequel we aim at obtaining a characterization of the set 9(A) := ((4, tj):

A,,, is bottleneck Monge) of all pairs of row and column permutations that trans- form a given matrix A into a bottleneck Monge matrix. Obviously, two rows or two columns for which there is no restriction on their mutual placement in a bottleneck Monge matrix play an important role in such a characterization. Two vectors x and y from IWd are said to be max-related, x - y for short, if and only if for all p < q

max {xr, y4} = max {x4, yP>. (7)

The lemma below provides an alternative characterization of max-related vectors.

Lemma 4.2. Let x and y be two vectors in Rd. Then x and y are max-related ifand only if

one of the following two conditions holds:

There exists a real number w such that

y,=max(x,,w} forp=l,..., d, (8)

or there exists a real number W such that

xp = max{y,, G} for p = 1, . . . . d. (9)

Proof. +- : Let x - y and assume w.1.o.g. that x is lexicographically not larger than y, i.e. xiy. Then either we have x = y or there exists an index p’ such that x,,, < y,.. If x = y, then choosing w := min,, ,,,,,,d~p results in the desired relation (8). The case x # y can be handled by setting w := y,.. Suppose that (8) does not hold. Then there exists a q such that y, # max{x,, yp,}. Thanks to the assumption x - y we have max {x4, y,,,} = max {xp., y4}. Consequently xp, > y,,, a contradiction.

.= : Trivial, since max{x,, y4} = max{x,, xq, w} = max{x,, yp> holds for all

P<4. 0

The relation - is reflexive and symmetric, but not transitive. (Take, for example, x = (30, 10, 20)T, y = (30, 20, 20)T and z = (30, 15, 10)T.) Also note that a constant vector x with xp= c for all p = l,..., p is max-related to any other vector y with

Page 12: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

54 B. Klinz ef al. / Discrete Applied Mathematics 63 (1995) 43-74

maxq= ,,,,,,d y4 < c. In the sum case, the analogue of max-related vectors are vectors differing only by an additive constant from each other. This relation is an equivalence relation; hence in [24] the term “equivalent” is used for vectors x and y with

x,=y,+wforp= l,..., d, where w is a real constant. Since the relation N is not transitive, bottleneck Monge matrices do not behave as

nicely as Monge matrices. While it can be shown that two rows or columns of a Monge matrix can be exchanged without violating the Monge property (1) if and only if they are equivalent, a corresponding result for bottleneck Monge matrices only holds for adjacent max-related rows or columns. Furthermore, in contrast to the situation for Monge matrices, where equivalent rows (columns) occur within a con- tiguous block of pairwise-equivalent rows (columns), this is not the case of bottleneck Monge matrices.

Lemma 4.3. Let A be a bottleneck Monge matrix and j and s := j + 1 be two adjacent columns of A. The matrix obtained from A by exchanging columns j and s is bottleneck Monge if and only if the columns j and s are max-related.

Proof. * : Since A is bottleneck Monge we must have max{aij , urs} ,< max{a,, ~,j} for all 1 < i < r < n. On the other hand, since after exchanging columns j and s the resulting matrix is again bottleneck Monge, the inequality max{+, arj} < max{aij, ars} must hold. Hence, we get max{ois, Ulj} = max{aij, u,~} for all

l<i<r<n.

* : Suppose w.1.o.g. that there is a number w such that a, = max{aij, w} for all i. Let 1 < i < r < n. We obtain max{aij, ars} = max{aij, U,j, W} = max{ai,, alj}. II

Lemma 4.4. Let A be a bottleneck Monge matrix and j -C s < j' be three columns of A.

Then the following holds:

Proof. Suppose that aif = max{+, W} for all i = 1,. .., n (the case aij = max{aip, G> is symmetric). We claim that s N j’. Suppose the contrary. Then there exist rows i and r, i < r, such that max{ais, c.z,~} < max{aiY, urs}. Using the above expression for aii’ we obtain max{ai,, arj, W} < max{aij, %, W}. It follows that max{ais, a,j} < max{aii, ars}, a contradiction. 0

For Monge matrices with no equivalent rows and columns the reverse matrix is the only other Monge matrix that can be obtained by reordering rows and columns (cf. [24]). The corresponding property does not hold for bottleneck Monge matrices without max-related rows and columns as can easily be seen by the following example matrix:

1 7 7 2 !

Page 13: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43-74 55

A contains no max-related rows and columns, but nevertheless both A and the matrix obtained from A by exchanging the first two rows and the first two columns are bottleneck Monge matrices. Note that in the first matrix the columns occur in their natural ordering (l-2-3), while in the second they are arranged according to the ordering (2-l-3).

Henceforth, we refer to matrices which contain no max-related rows and columns as being reduced. The above example suggests to take a closer look at the mutual placement of three columns (or three rows) in a reduced bottleneck Monge matrix. Let j,, j, and j, be three columns of the input matrix A and let o = (jr-j,-j,) be an ordering of jr, j, and j,. We denote by o- = ( j,-j2-j,) the reverse ordering of w. An ordering w is said to be feasible with respect to A if and only if there exist permutations 4 and J/ of the rows and the columns of A which transform A into a bottleneck Monge matrix A,,, such that the columns jr, j, and j, are arranged according to o.

Let x, y E Rd. An unordered pair of indices {i, r>, i # r, is called a discriminating pair with respect to x and y if and only if max{q, y,} # max{x,, yi}. Let D(x, y) denote the set of all discriminating pairs w.r.t. x and y, and denote by D*(x, y) the set of all indices which are contained in at least one discriminating pair, i.e. D*(x, y) := {i E { 1, . . . . d}: 3r E { 1, . . . . d} s.t. (i, r} E D(x, y)}. Clearly, if x N y we have

D*(x, y) = 0.

Lemma 4.5. For x, y E Rd, define an undirected graph Go = (Vu, En) with vertex set v, := (1,2, . ..) d} and edge set En, where (i, r) E En if and only if the pair {i, r} is a discriminating pair. Then the following holds.

(i) At most one connected component of the graph Gn contains more than one node. (ii) If x +y, then for each r 4 D*(x, y) there exists a real number w, such that

X, = y, = W, and W, > max{xi, vi} for ~11 i E D*(x, y).

Proof. (i) Assume the contrary. Then there must exist four pairwise-distinct vertices iI, il, rl and r2 such that the subgraph of GD induced by these four vertices contains

exactly the two edges (iI, rr) and (iz, r2). Hence, {iI, rl > and {iz, r2 > are discriminating pairs w.r.t. x and y. W.1.o.g. suppose that max(q,, yl,} < max(x,,, yi,} and max{xi2, yl,} < max{x,,, yi,}. Let p E (i2, r2). By assumption we must have max(xi,, yP> = max{x,, yi,} and max{x,,, yP} = max{x,, y,,}. We now set X; = x,.~,

x; = Y,,, Y; = xp, Y; = Y,, z; = xii and z; = yiI. Applying Lemma 3.3 we get

y; = y;, i.e. xP = y, for p E {i2, r2}. But this contradicts our assumption

max(xi,, Yl,> < max{x,,, Yi2). (ii) Let {iI, rI } be a discriminating pair and let i2 # D*(x, y). By analogous argu-

ments as above we obtain from Lemma 3.3 that xii = yi2 >, max{x,,, yil, +, yr,}. Since any discriminating pair can be chosen for {iI, rl }, we are done. 0

Now we are ready to prove the main result of this section.

Page 14: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

56 B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43-74

Theorem 4.6. Let A be an n x 3 reduced bottleneck Monge matrix with column set { 1,2,3} and denote by cj, j = 1,2,3, the jth column vector of A.

Then the ordering CO = (2-l-3) of the columns of A is feasible if and only iffor each i E D*(c’, c2) there exists a real number w such that ai = w for all i E D*(c’, c2) and

w3max{a,,,a,,}fora11r~D*(c1,c2).

Proof. =a : Suppose that A can be permuted into a bottleneck Monge matrix A’ in which the columns occur according to the ordering w = (2-l-3). Let further {i, I}, i < I, be an arbitrary discriminating pair with respect to the columns 1 and 2. Consequently, we have max {ail, ar2} < max{aj2, a,l } which in turn implies that row r must precede row i in the permuted matrix A’. Since both A and A’ are bottleneck Monge, we furthermore get max{a,.,, ai3} = max{ar3, ai,} for p = 1,2. Applying Lemma 3.3 with xl = arl, ~2 = ai,, ~1 = ar3, y2 = ai3, ~1 = ar2 and ~2 = ai leads to

ar3 = ai > max (ail, apl, ai2, ar2}. Using property (i) in Lemma 4.5 with respect to columns 1 and 2, it now immediately follows that column 3 is constant when restricted to the rows in D*(c’, c’).

e : First, we claim that all rows i such that i E D*(cl, c’) must occur consecutively within matrix A. For suppose that there exist three rows i < r < i’ such that i,i’ E D*(c’, c2) and r $ D*(c’, c2). Then the submatrix of A composed of the rows i, r and i’ looks as follows:

Up1 Ui,2 W

where W, W’ > max{a,i, ai2, ai,i, ai,2}. Clearly, B is bottleneck Monge. Therefore, the following two inequalities hold: max (ai2, ar3} < max{w, w’} and max{w, w’} < max{aiP2, ar3}. We now distinguish two cases, namely w < w’ and w > w’. In the

first case, we get ar3 < max{w, w’} = w’ d max(ais2, ar3}. Thanks to w’ 3 ai, this implies ar3 = w’. In the second case we similarly obtain ar3 = w. In both cases it turns out that row I is max-related to the rows i and i’ which yields a contradiction to our assumption that the matrix A is reduced.

It remains to be shown that the column ordering (2-l-3) is feasible. For that purpose we rearrange the rows of A in the following way: Rows i $ D*(c’, c2) remain in the same position they had in A, while the ordering of the remaining rows is reversed. For example, if we have 6 rows and D*(c’, c2) = {2,3,4), then the new ordering of the rows construc- ted by the above rule is (143-2-56). Taking into account the fact proven above that the rows from D*(c’, c2) occur consecutively within A, it is now easy to check that the matrix A’ obtained from A by arranging the rows as explained above and the columns according to the given ordering (2-l-3) fulfills the bottleneck Monge property. 0

Obviously, a similar result could be proved for the feasibility of the column ordering w = (l-3-2).

Page 15: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43- 74 51

5. Recognition of permuted O-l bottleneck Monge matrices

In this section we show how to recognize permuted cl bottleneck Monge matrices in polynomial time. Furthermore, we present a complete and compact characterization of the set P(A) := ((4, $): A,,, is bottleneck Monge} for O-l matrices A.

Let A be a O-l matrix with row set R := { 1,2, . . ..n} and column set c := (1,2, ..,) m} and let B(A) be the bipartite graph associated with matrix A. According to the results mentioned in Section 2, a O-1 matrix A is a bottleneck Monge matrix if and only if B(A), the complement graph of the bipartite graph B(A), is a strongly ordered permutation graph. Hence the following approach can be used to recognize permuted 0-l bottleneck Monge matrices in O(nm) time: We first use the algorithm of Spinrad et al. [27] to decide whether the graph B(A) is a bipartite permutation graph. In the affirmative case, this algorithm also delivers a strong ordering of the vertex set of B(A). By arranging the rows and columns of A according to this ordering we then obtain a pair of permutations (4, II/) such that the permuted matrix A,,* is bottleneck Monge. (For details about the algorithm of Spinrad et al. [27] the reader is referred to the original paper.)

We note that the algorithm of [27] finds only one pair of permutations (4, I++) such that the permuted matrix A,,, is bottleneck Monge. In our recognition algo- rithm for permuted bottleneck Monge matrices with arbitrary entries (to be des- cribed in the next section), however, we need the set P(A) of all such pairs of permutations.

Let ZERO(~) denote the set of all rows of matrix A that have a zero entry in columnj. Then two columns j, and j, are said to intersect iff they have at least one zero in common, i.e. iff ZERo( j,) n Zmo( j,) # 8. A ccordingly, the undirected graph I(A) = (C, E) with vertex set C = { 1, . . . . m} and an edge (j,, j,) E E if and only if the columns j, and j, intersect, is called intersection graph of the matrix A. If the graph I(A) is connected, we also say that the matrix A is connected. Likewise, a set of columns of A is said to be connected, if these columns induce a connected matrix.

Let 6 = (c”, E”) be a connected component of the intersection graph Z(A). The matrix A’ obtained from A by removing columns which are not contained in c is called a component of A. For a component A’, define its associated block x to consist of all rows of A’ which contain at least one zero entry.

It turns out that the set B(A) can be described in a particularly simple way if A is a reduced and connected double staircase matrix. Recall that the ordering o = (j,-j,-j,) of three columns j,, j, and j, of the matrix A is said to be feasible with respect to A if and only if A can be permuted into a bottleneck Monge matrix such that the three columns j, , j, and j, occur according to w (the rows may be permuted arbitrarily).

The following uniqueness result provides a first step towards a full characterization of B(A).

Page 16: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

58 B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43-74

Theorem 5.1. Let A be an n x m connected and reduced double staircase matrix. Then

we have

g(A)= {(w,),(~,,G)}.

Proof. We show that E, and E; are the only possible arrangements of the columns in a double staircase matrix. Assume the contrary. Then A must have a submatrix of three adjacent columns j,, j, := j, + 1 and j j := j, + 2 such that either both the

column orderings o1 = (ji-j,--j,) and w2 = (j,-j,-j,) or both the orderings w1 and wJ = (ji-j,-j,) are feasible. We treat the first case, the latter case can be handled analogously. Let A’ be the submatrix of A which is composed of the columns j,, j, and j,. Since A’ is a connected double staircase matrix with pairwise-distinct columns and no all ones columns, it follows from Theorem 4.6 that ai,j, = 1 for all rows i with i E D*( j,, j,). From Lemma 4.5 we obtain that ar,j, = ar,j2 = 1 for all r r$ D*( j1 , j,) which in turn implies that a,,j, = ar,j2 = 1 for all rows r in which column j, has a zero entry. But this results in a contradiction to the assumption that A’ is connected. 0

Now let A be a connected O-l matrix which contains no all ones rows or columns, but which may contain identical rows or columns. According to Observation 2.3 such rows and columns must occur contiguously within a double staircase matrix. We refer to a group of contiguous identical rows or columns in matrix A as a row stripe (resp. column stripe) of A. In a connected double staircase matrix A the relative order of the row and column stripes is fixed up to the reversal of both orderings, while obviously the rows (columns) within a row (column) stripe may occur in arbitrary order.

Next we deal with Cl matrices which need no longer be connected or reduced, but which still do not contain all ones rows or columns. In this case the set P(A) can be described as follows.

Observation 5.2. Let A be a double staircase matrix which contains no all ones rows or columns and let A,, A,, . . . , iif be the blocks of matrix A. Then the following character- ization holds for the set B(A): If(4, t,k) EP(A), then the rows and columns in the permuted matrix A,,, are arranged according to the following rules: (i) There exists a permutation 7~ on the set (1, . . ..f} such that for any q = 1, . . ..f - 1,

the rows of A corresponding to the rows of block AZC4) precede the rows of A which are associated with the rows of block A nCq+ 1,. An analogous property has to hold for the columns.

(ii) The rows and columns within block Aq are arranged according to a pair of permuta-

tions (oq, z,) with (o,,, zq) E 9(&J.

As a consequence of Theorem 5.1 and Observation 5.2 we get that for a reduced double staircase matrix A with f components with at least two columns each, the set B(A) contains 2’.f! distinct pairs of permutations.

Page 17: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

B. Klinz et al. 1 Discrete Applied Mathematics 63 (1995) 43-74 59

The remaining case concerns all ones rows and all ones columns. These rows and columns can be placed anywhere within a O-l bottleneck Monge matrix. Putting together all these observations, we get a complete description of the set B(A) for O-l matrices A. Finally, we describe a simple O(nm) time algorithm to recognize permuted O-l bottleneck Monge matrices.

Let A be an n x m O-l matrix and jr, j, and j, be three connected columns of A. For notational convenience, we define the set F(A) to be the set of triples (jr, j,, j,) such that the ordering o = (j,-j,-j,) is feasible with respect to A. Obviously, if

(jr,j,,j,) E s(A), we also have (j3,j,,jr) E F(A).

Lemma 5.3. Let A be an n x m O-l matrix and let j,, j, and j, be three connected,

pairwise-distinct columns of A. Then exactly one of the following four cases holds for A.

1. (j,,j,,j,) E s(A) and (j3,jlrj2) E F(A).

2. (jt,j,,j,) ES(A) and (j,,jz,jI) E S(A).

3. (j,,j,,j,) E F(A) and (j,,j,,j,) E F(A). 4. A cannot be permuted into a double staircase matrix.

Lemma 5.4. Let A be an n x m doubly convex O-l matrix and let jI, j, and j, be three

connected pairwise-distinct columns of A. Then it can be decided in constant time which

of the four cases of the previous lemma holds.

Proof. There are only 12 distinct reduced and connected double staircase matrices with three columns (if two matrices are reverse to each other, we count them as one). These matrices are the following:

M7=

Mlo =

0 1 1

0 0 1

1 0 0

1 1 0

, MS=

0 1

0 0 0,

1 I

Me=

1 1 0

‘0 1 l\

0 0 1 = 0 0 0 ’ M9

(1 1 0 I

0 1

0 0 1

0 0

1 0 1 I

0’

0

0 1 1

0 0 1

0 0 0 )

1 0 0

1 1 0 I

1 0 1 1

0 0 1

1 0 1

1 0 0

1 1 0

Page 18: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

60 B. Klinz et al. / Discrete Applied Mathematics 63 (199.5) 43-74

Let A’ be the n x 3 submatrix of A which is induced by the columnsj, , j, and j, and let A* be the reduced matrix associated with A’. Our task now is simply to find a pair of permutations (a, z) and a number p, p = 1, . . . , 12, such that A,* T = M, or to prove that this is not possible. In the first case, the permutation z induces the two orderings of the columns j,, j, and j, which belong to the set 9(A), while in the latter case A cannot be a permuted double staircase matrix.

To complete the proof of the lemma we note that each matrix M, with column set { 1,2,3} can be identified by a set of conditions on the sets Zj := ZERO(~), j = 1,2,3, which only involve the basic set operations union, intersection and test for subset. For example, for M3 we require that (i) Z3 c Z,, (ii) Z1 $ Z2, (iii) Z2 $ Z1, (iv) Zr n Z3 = 8 and (v) Z1 n Z, # 8. All other matrices can be handled similarly. Due to the fact that A is doubly convex, the sets Zj are intervals which implies that all set operations we need can be performed in constant time (after some preprocessing). We remark that identical rows and all ones rows do not influence the conditions above. Hence, the conditions can be directly applied to the matrix A’ without constructing the associated reduced matrix A*. 0

Finally, we are ready to describe our recognition algorithm for permuted O-l bottleneck Monge matrices. Due to Observation 5.2 we may assume that the input matrix A is connected, if not, we apply Steps 2-5 of the algorithm below to each component of A.

Algorithm 1. Recognition of permuted G-1 bottleneck Monge matrices. 1. Find a pair of permutations (0, r) for the rows and the columns of the input matrix

A such that the permuted matrix A’ := A,,, becomes doubly convex. If no such pair exists, we are finished, since A cannot be a permuted bottleneck Monge matrix.

2. Transform A’ into a reduced matrix A*.

3. Take the first three columns 1,2 and 3 and determine their ordering in a double staircase matrix. Let p := 4.

4. As long as p d m, take column p and try to insert it into the feasible ordering 0 = (j, -j, - . . . - j,_ r) obtained so far. To that end, test for any two columns j, and j,+ 1 which are adjacent in w whether p can be inserted in between, i.e. whether (j,, p, j,,,) E @(A). Furthermore, we have to test whether (p,j,,j,) EF(A) and whether (j,_,,j,_,,p) EB(A). If exactly one of these conditions is fulfilled, then insert p at the corresponding position and update o. Otherwise, we stop, since A cannot be a permuted double staircase matrix.

5. Rearrange the columns of A* according to o and sort the rows lexicographically increasing with respect to the vector composed of the positions of the first and last zero entry in each row. The resulting matrix is a double staircase matrix.

There might exist an exponential number of pairs (a, z) such that A’ := A,,, is doubly convex. Hence, we cannot simply check all such pairs, and therefore, the remaining steps of Algorithm 1 are indeed necessary to obtain an efficient recognition algorithm.

Page 19: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43-74 61

Analysis of Algorithm 1. Step 1 can be implemented in O(nm) time by applying the algorithm of Booth and Lueker [S] to both rows and columns of A. Since A’ is doubly convex, its rows and columns can be sorted according to the lexicographical order in O(n + m) time. Then identical rows and columns are contiguous and the reduced matrix A* in Step 2 can be obtained in O(n + m) time. By Lemma 5.4, Step 3 takes O(1) time and inserting column p in Step 4 takes at most O(p) time. Hence, at most 0(m2) time is spent in Step 4. Step 5 takes O(n) time provided that the positions of the first and last zero entry in each row have been computed in the previous step. Since by assumption we have m d n, the overall complexity of Algorithm 1 is O(nm).

Both the algorithm of Spinrad et al. [27] and our algorithm are incremental approaches. In our algorithm the columns of the input matrix play the same role as the vertices from the set I’, of the bipartite input graph in the algorithm of [27]. The main difference between the two methods is that while we first permute the input matrix A into a doubly convex matrix and then try to obtain the double staircase structure in a second phase, the algorithm of Spinrad deals with the adjacency and the enclosure properties of the input graph at the same time.

We close this section with an alternative characterization of permuted O-l bottle- neck Monge matrices. In [28] Tucker gave a forbidden submatrix characterization of the set of Cl matrices which have the consecutive zeros property for both rows and columns. In [17] we asked for the matrices which have to be added to Tucker’s set of forbidden submatrices in order to obtain a characterization of the class of 0-l bottleneck Monge matrices. The result below not only answers this question; in conjunction with the results in [28] we also obtain a forbidden subgraph characteriza- tion of the class of bipartite permutation graphs.

Theorem 5.5. Let A be an n x m O-1 matrix which has the consecutive zeros propertyfor both rows and columns. For %Y a set of (rl matrices, define 9(.%) as the set of all matrices

which can be obtained from matrices in 28 by permuting rows and columns. Then A is a permuted &l bottleneck Monge matrix if and only if A does not contain

any submatrix from the set %!(SY) with 28 = (B4, Bf, B5, BT} and

Proof. =z= : Matrices B4 and B5 cannot be permuted into bottleneck Monge matrices. -c= : Suppose that the n x m Cl matrix A is a minimal counterexample with n 2 m:

A has the consecutive zeros property for rows and columns, is not permuted bottle- neck Monge, but none of the submatrices from the set ‘%(a) defined above is contained in A. The removal of any row or column from A must result in a permuted bottleneck Monge matrix. Due to these assumptions, A is connected and reduced, but cannot be permuted into a double staircase matrix.

Page 20: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

62 B. Klinz et al. 1 Discreie Applied Mathematics 63 (1995) 43-74

We now rearrange the rows and columns of A such that the resulting matrix A’ becomes doubly convex. It follows that A’ contains three columns j < s < t and two rows i and r such that aij = ai, = a:, = 0, aij = ai, = 1 and ai, = 0. (Otherwise A would be a permuted double staircase matrix, by Theorem 2.1 and Observation 2.2.) Let A” be the (n - 1) x 3 matrix which is obtained from A by removing row r and all columns #j, s, t. Obviously, A” is a connected permuted double staircase matrix. By using

analogous arguments as used by Spinrad et al. [27] in their proof of Theorem 2.1, it can be shown that the rows of matrix A” can be rearranged such that the resulting matrix B becomes a double staircase matrix. (We simply sort the rows lexicographi- tally increasing with respect to the vector composed of the positions of the first and the last zero in each row.)

Suppose w.1.o.g. that B is already reduced. Since the matrices M1 through Ml2 repres- ent all possible cases of connected and reduced double staircase matrices with three columns, B must be equal to either Mz, M4, M=,, M6, MS or M9 (the remaining matrices do not contain a row of three zeros). Now we add the row (1, 41) to the top of matrix B and denote the resulting matrix by B*. (Note that this row corresponds to the entries of the removed row r in the columns j, s and t.) First, observe that the cases B = MS, B = M8 and B = M9 lead to a contradiction, since in these cases the matrix B* does not have the consecutive zeros property for columns. In the remaining cases, B = MZ, B = M4 and B = M6, the matrix B* can be permuted into at least one of the forbidden submatrices B, and B5. This completes the proof of the theorem. 0

6. Recognition of permuted bottleneck Monge matrices

In this section we use the results of the previous section on recognizing permuted O-l bottleneck Monge matrices to obtain an efficient algorithm for recognizing permuted bottleneck Monge matrices with arbitrary entries. In Section 6.1 we first describe the fundamental ideas underlying our approach which lead to an O(n2m2) time algorithm for the recognition of n x m permuted bottleneck Monge matrices. In Section 6.2 we explain how the complexity can be brought down to O((n + m)nm). This section is concluded by an example in Section 6.3 which shows the algorithm in action.

6.1. A polynomial-time algorithm for recognizing permuted bottleneck Monge matrices

The algorithm described in this section relies mainly on the threshold-type ap- proach introduced in Observation 3.1. Let a”1 > & > ... > & be the sequence of all pairwise-distinct values of entries of the matrix A. Then we define the so-called threshold matrices Tk, k = 1 , . . . , k If entry Uij < a"h, then the corresponding entry in Tk is 0, otherwise it is 1.

By applying the results of the previous section, we are able to check for each k whether or not the O-l matrix Tk is a permuted bottleneck Monge matrix.

Page 21: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43-74 63

Moreover, we obtain a characterization of the set PPk := S(T’) = ((4, $) 1 T&, is bottleneck Monge}. What remains to be done is to determine the intersection of all sets Pk. Obviously, the original matrix A is permuted bottleneck Monge if and only if this intersection is nonempty.

Define 2& := n:=i 9q to be the set of all pairs of permutations (4, +) which transform the first k threshold matrices into bottleneck Monge matrices. Our aim is to determine a pair of permutations (4, $) E &. or to show that 2& = 8. However, in general we cannot construct the full set 2&, since this task is too time-consuming. Instead, we will maintain sets $ with B E & for all k = 1, . . . , L such that & = $3 if and only if 2& = 0.

Case 1: We start with the simplest case where all matrices Tk are connected. We furthermore exclude all ones rows and all ones columns for a while from our consider- ations. Then we are able to compute the sets .?& efficiently and have jk = $k. Note that for k = 1 these assumptions are trivially true, since all entries of T’ are equal to 0. We recall that in (rl bottleneck Monge matrices with no rows and columns of all ones, identical rows and columns appear contiguously and that for connected O-l matrices A with no all ones rows and columns, the set B(A) can be fully described by the order of the row stripes and of the column stripes. Within a stripe the arrangement of the rows or columns is arbitrary. This motivates the following definition.

Let Dr, . . . . D, be stripes (sets) of dl , . , . , d, identical elements each. Then the set Y of allpermutationsowith~4,~~dp<~~1(i)~~4p,~dpforalli~D,,q=l,...,u,iscalled a stripe permutation. Furthermore, let Y- denote the reverse stripe permutation of Y which contains all permutations G such that 6 E Y.

We first show how to intersect two arbitrary stripe permutations 9, and 9, and how to construct the corresponding new stripe permutation .Y3 = Y1 n Y2. This intersection process is done recursively. Let C1 , . . . , C, and D1, . . . , D, be the different stripes which define .4p1 and YZ, respectively. If sP3 # 0, we must either have Cr c D1

or D1 E C,; w.1.o.g. suppose C1 G D1. Then Cr is the first stripe of the intersection ~7~. The next stripes are obtained recursively as the intersection of the stripe permuta- tions induced by C1, . . . . C, and D1\C1, D2, . . . . D,. This algorithm can be imple- mented to run in linear time.

It follows from the considerations above that the set PJk and the intersection 2!k_ 1 = fl:I : Pq computed so far, can both be represented by a pair of stripe permutations for the rows and the columns, say (B!,, 9’i) and (W,, Y2), respectively. To compute the intersection 9,‘ n _!&- 1 we first determine the following intersections of pairs of stripe permutations: (W, n WZ, Y1 n Y2) and (9; n B2, 9’; n ,402) (note that in the latter case both the ordering of the row and of the column stripes must be reversed). It can easily be seen that this intersection step cannot yield two distinct pairs of stripe permutations; either one of the intersections is empty or both pairs are identical. So let (W,, Y3) be the resulting pair of stripe permutations. Then we have (4, II/) E 2,‘ if and only if either (4, $) E (W,, Y3) or (4, $) E (9;) 9’;). Hence, the set $k can again be represented by a pair of stripe permutations. Summarizing, we are able to construct the full set & = _%!k _ 1 n p)k in linear time.

Page 22: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

64 B. Klinr et al. 1 Discrete Applied Mathematics 63 (1995) 43- 74

Case 2: Now let us deal with the case when we arrive for the first time at a threshold matrix T’ that is not connected any more, but still does not contain all ones rows or columns. Suppose that T’ induces the blocks Tr, Fz2, . . . . T,. According to Observa- tion 5.2, the relative order of the blocks is arbitrary, but within each block the sets B(T,) can be completely described by two stripe permutations W, and 9, for the rows and the columns of Fq,, respectively (instead of 9, and 9, also the reverse permuta- tions W;and 9; could be used).

In order to intersect the current set & 1 = A?_ 1 with the set Bi, we thus would have to take into account all possibilities of arranging the blocks of T’. This task turns out to be too time-consuming. Below we show that it is sufficient to compute a proper subset _!& of the intersection & = _??_ 1 n P1. For that purpose, we determine an appropriate ordering rt of the blocks of T’ which is consistent with the current set _$?- 1 and intersect _3!_ 1 only with those pairs of permutations within PI for which the blocks are arranged according to rc. The advantage of this approach is that after fixing the ordering rc, we are again in the situation that we need to intersect two pairs of stripe permutations.

The following observation is crucial to the approach sketched above. It guarantees that two columns which are in distinct components of G, remain in distinct compo- nents in G, for q < p.

Observation 6.1. Let Gk := (V, Ek) be the intersection graph corresponding to the

threshold matrix Tk, k = 1, ., . , L. Then we have E, E E, for all 1 < p < q < L.

In the sequel, we describe how to find an ordering rr of the blocks of T’ which is consistent with the intersection _&_i determined so far. To that end, suppose that _9- 1 is described by the stripe permutations W and Y which are induced by the row

and column stripes Rr , . . . . R, and S1 , . . . , S,, respectively. Let stripe R, contain r4 rows and stripe S, contain sP columns. Then we define numbers N’(j) (resp. N’(i)) for each column j (resp. for each row i) of matrix T’ by setting

N,(j):=l+ C sq foralljESprP=l ,..., v, q=l

t-1 N,(i):=l+ 1 rq foralliER,,t=l,..., u.

q=l

Note that N,(j) denotes the leftmost position of column j within the stripe permuta- tion 9, while N,(i) corresponds to the leftmost position of row i within the stripe permutation W.

Now the numbers N,(j) and N,(i) are used to construct an appropriate ordering rt of the blocks of T’. We first compute for each block Tq of matrix T’ the following four numbers:

crz := min{N,(j)(columnjE T,}, /I,” := max {NJ j) 1 column j E T,},

% ’ := min (N,(i) 1 row i E ?;,}, /?i := max (N,(i) ( row i E Fq}.

Page 23: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

B. Klinz et al. 1 Discrete Applied Mathematics 63 (1995) 43-74 65

The ordering rc is obtained by sorting the blocks such that c&i, < ee. d t+.,, &i, 9 ... < &,-), c&~, < ... d a&, and &, < ... < ficn. If there is no such order- ing, the intersection $ _ i n Y1 is empty implying that also _!JL = 0. Ties are broken arbitrarily.

The next step consists in pasting together the stripe permutations representing the blocks of T’ according to the ordering rr constructed above. The result will again be a pair (B?‘, 9’) of stripe permutations. The pasting is done as follows: Let (W,, Y4) be the pair of stripe permutations which is obtained from applying Algorithm 1 to the block Fq,, 4 = 1 , . ..J We start with a pair of empty sets and construct the final pair (BY, 9’) step by step. In the qth step, 1 < q <f we append the stripes of W, to the current 9’ and the stripes of 9, to the current 9”. We have, however, to be careful to add the stripes of $9, and Y, in the right order. There are three cases:

(a) If the row stripes within 9, and the column stripes within 9, are ordered according to nondecreasing values of N, and N,, respectively, then the stripes of B?q and 9, are added in the same order as they appear within 9q and 9,. In other words, the orientation of the block r, remains the same.

(b) If the ordering of the stripes in 9, and 9’4p4 is according to nonincreasing values of N, and N, (and case (a) does not occur), then the stripes of 9, and Y, are added in reverse order. In other words, the orientation of the block Fq is reversed.

(c) If neither (a) nor (b) holds, then the input matrix A cannot be permuted into a bottleneck Monge matrix.

Case 3: The only remaining case concerns threshold matrices Tk with all ones rows or columns. Such rows and columns are treated as follows: If an all ones row or column is created in Tk that was not present in Tk-‘, the position of this row or column is arbitrary with respect to Tk and any matrix T’ with 1 > k. Its position, however, is determined by the position of that stripe of the set Sk,_ 1 in which this row or column was located in step k - 1. Hence, we can choose an arbitrary position within this stripe and fix the new all ones row or column at this position. For convenience, we adopt the convention of always choosing the leftmost position, i.e. the first position within the stripe. In all further steps the position of the new row or column, which now forms a stripe of its own, remains fixed and hence can be disregarded in subsequent steps.

Theorem 6.2. For a permuted bottleneck Monge matrix A, the algorithm described

above detects a pair (4, $) such that A,,, is bottleneck Monge.

Proof. Since A is permuted bottleneck Monge, there exists a pair of permutations

(4, $) such that A+,, is bottleneck Monge and (4, +) E _&,. Suppose now that (4, II/) # JL. We show that then there exists another pair (@, $‘) E _?!!L with A,,,,, bottleneck Monge.

Let 1 be such that (4, $) E .&i, but (4, $) $ _&. (Such 1 exists, since the set s1 = 91 contains all pairs of permutations.) If T’ was connected, we would have 3, = _%?l and (4, $) $ sL. Consequently, T’ consists off> 2 blocks r,, . . . , T,-. The order fi in which

Page 24: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

66 B. Klinz et al. / Discrete Applied Mathemarics 63 (1995) 43-74

these blocks occur within the pair (4, $) must be different from the ordering rr con- structed by our algorithm and also from the reverse ordering n-. But this only can happen if the arrangement of the blocks is not unique, i.e. if there are indices ql, . . . , qk

such that

and

Consequently, all rows (resp. all columns) of the blocks r,i, . . . , Tqk were in the same row stripe (resp. in the same column stripe) with respect to the pair of stripe permutations representing the set S?& _ 1. It follows that the submatrix of A which is associated with these blocks can be reordered to be of the following blockdiagonal form:

where the matrices &I in the diagonal are bottleneck Monge matrices and the rest is filled up with the threshold value Zl_ 1. Hence, the order of the blocks r,>, . . . , Fqb, is arbitrary and thus independently of which ordering of these blocks is chosen in our algorithm, we obtain a pair of permutations (@, tj’) such that A,,,,. is bottleneck Monge. 0

To analyze the time complexity of our algorithm, we observe that the algorithm goes through L rounds. In round k, we first compute the set Pk associated with the O-l threshold matrix Tk in O(nm) time by applying Algorithm 1, and then construct the set _& as explained above. The latter step can be done in O(n + WI) time, once the numbers N, and N, are known. Since these numbers are computed in O(nm) time, we arrive at an overall time complexity O(Lnm) that is O(n’m*) in the worst case. However, recall that permuted bottleneck Monge matrices whose entries are all pairwise distinct, i.e. matrices for which L = nm, can be recognized in O(nm + n log n + m log m) time (cf. Remark 3.1).

6.2. An improved recognition algorithm

In this part we show how to get the O(n* m*) worst-case bound for the general case down to O(nm(n + m)).

The key observation is that not every threshold value dk contributes a new piece of information about the set 2,. Thus, we introduce critical thresholds, i.e. thresholds &

Page 25: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

B. Klinz et al. 1 Discrete Applied Mathematics 63 (1995) 43-74 67

such that at least one stripe in the pair of stripe permutations representing the set _!& _ i is partitioned into two stripes. This only happens if there are two rows or columns within this stripe which become different in the kth threshold matrix Tk, whereas they were identical in Tq for q < k. Hence, for a critical threshold & we always have jk # & _ 1 and for noncritical thresholds _& = & _ i (with the trivial exception of jk = 8). Therefore, skipping thresholds which are not critical can do no harm,

provided that we check in the end whether the constructed permutations indeed yield a bottleneck Monge matrix.

Lemma 6.3. For A an n x m matrix, there are at most m - 1 thresholds which are

critical with respect to the columns of A, and at most n - 1 thresholds critical with

respect to the rows.

Proof. Each threshold value critical with respect to the columns splits up at least one column stripe. In the worst case, all columns are pairwise distinct, and we have to continue this splitting process until each stripe contains exactly one column. 0

Now the problem remains how to determine the critical thresholds. Starting from the critical threshold &, the next critical threshold 2il can be determined as follows in O(nm) overall time.

(i) Compute for each row and column stripe of the permutations representing &, the maximum entry smaller than the previous threshold iik with the property that at least two rows (columns) of this stripe become different in the corres- ponding Gl threshold matrix.

(ii) Choose the maximum of all these values as the next critical threshold. Finally, we combine all previous considerations and results and formulate our

algorithm, which either finds a pair (4, $) which permutes the given input matrix A into a bottleneck Monge matrix A,,, or proves that this is not possible.

Algorithm 2. Recognition of permuted bottleneck Monge matrices. 1. Start with the threshold matrix T1 which is the zero matrix and initialize all data

accordingly. Set N,(i) = N,(j) = 1 for all i = 1, . . . , n and j = 1, . . . , m and let 8, be the set of all row and column permutations of matrix A. Set 1 := 1.

2. Starting from the previous critical threshold I!&, compute the next critical thre- shold &, k > 1. If there exists no more critical threshold, then go to Step 7; otherwise, construct the threshold matrix Tk and its associated intersection graph Gk.

3. Identify all ones columns and rows in Tk, fix their positions as explained above and disregard them afterwards.

4. Determine the blocks Tk and compute for each block the minimal and the maximal value of the numbers N, and N,. Sort the blocks of Tk increasingly with respect to the numbers c1’, p, tl’, p to obtain an ordering rc.

Page 26: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

68 B. Klinz et al. 1 Discrete Applied Mathematics 63 (1995) 43-74

5. Apply Algorithm 1 to each block of Tk and construct the stripe permutations for each block. Update the numbers N, and N,.

6. Construct the new set ._@k as the intersection of $r and the pair of stripe permutations obtained from the set 9,‘ by arranging the blocks according to the ordering rc. Set 1 := k and go to Step 2.

7. If & = 0, then A cannot be permuted into a bottleneck Monge matrix. Other- wise, choose an arbitrary pair (4, $) from 3, and check whether A,,, is a bottle- neck Monge matrix. In the negative case, A again cannot be a permuted bottleneck Monge matrix.

Analysis of Algorithm 2. Since there are at most O(n + m) critical thresholds, there are at most O(n + m) rounds. Each round takes O(nm) time and the test in Step 7 can be performed in O(nm2) time (see Remark 3.1). This gives a worst-case run time of O(nm(n + m)) for Algorithm 2.

Finally, we mention that the following two-phase approach yields a slight improve- ment over Algorithm 2. We start with applying a modified version of Algorithm 2 which only constructs an ordering of the columns and disregards the rows. This clearly takes O(nm2) time since there are at most O(m) critical thresholds. A corres- ponding ordering of the rows can then be determined in O(min {n2m, nm2 log rr>) time as explained in Section 7. Combining these considerations with Algorithm 2 we get an O(min{nm(n + m), nm2 logn}) time algorithm for recognizing permuted bottleneck Monge matrices with arbitrary entries.

6.3. An example illustrating Algorithm 2

In order to assist the reader in understanding how Algorithm 2 works, we present a short example which illustrates the main steps of the algorithm. Let us start with the following 7 x 7 matrix:

8483858

6626564

8384858

A= 8676564

8585838

4737574

8585848

1234567

The numbers on top of and to the right of the matrix A indicate the row and column numbers which henceforth will be used for identifying the rows and columns.

We want to decide whether or not A is a permuted bottleneck Monge matrix and, if possible, determine a pair of permutations (4, II/) such that A,,, is bottleneck Monge.

Page 27: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43-74 69

This question will be answered by applying Algorithm 2. Before we actually start with the algorithm, we introduce the following notational convention: A stripe permuta- tion is enclosed by (. . .) and each stripe within a stripe permutation is enclosd by

[...I.

Now we are prepared to start the algorithm. Since A contains seven distinct values, we have L = 7. We start with the largest threshold value, cir = 8. In the initialization step we set N,(i) = N,(j) = 1 for all i = 1, . . . ,7 and j = 1, . . . . 7 and .LZr := (([l 3 . ...71), (CL . . . . 71)). (At the beginning all rows (resp. columns) belong to the same stripe.)

The next critical threshold value is fiZ = 7. The associated threshold matrix T2

consists of a single block and neither contains all ones rows nor all ones columns. Hence, the Steps 3 and 4 of Algorithm 2 can be omitted and we can continue with Step 5 which consists in applying Algorithm 1 to T2. As a result we find that T2 is a permuted double staircase matrix since by reordering the rows and columns of T2 as indicated below we obtain the following double staircase matrix:

135724 6

0000000 2

0000000 6

1000000 4

1111000 1

1111000 3

1111000 5

1111000 7

The numbers on top of and to the right of the above matrix correspond to the numbers of the rows and columns in the original matrix T2.

The set g2 of all pairs of row and column permutations which transform T2 into a double staircase matrix can be represented by the following pair of stripe permuta- tions (9, 9’) with

8 = < [2,61, C41, CL 395971)

and

9 = (Cl19 c3,5,71, r,2,4,61>.

Recall that (4, II/) E P2 if and only if (4, +) E (W, 9’) or (4, $) E (9-, Y -). Since & contains all possible pairs of row and column permutations, J2, the intersection of S2

and 2, is equal to ~9’~. The next critical threshold value is ii3 = 6. The corresponding threshold matrix T3

remains connected and still has no all ones rows or columns. Applying Algorithm 1 to T3 we obtain that P3 can be represented by the following pair of stripe permutations:

(( C61, C21, C41, CL 3,5,71>, <CL 31, [5,71, [2,4,61>),

Page 28: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

70 B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43- 74

where again the first stripe permutation corresponds to the rows and the second to the columns. Intersecting L$$ with p3 yields that L& is represented by the pair

CC C61, CA, C41, CL 3, 5,71>, (C11, C31, C5,71, I?, 4961)).

The threshold value & = 5 is skipped, since no new information is gained when considering the threshold matrix associated with 5. Thus, 5 is not critical, but the next value a”5 = 4 is again critical. As can easily be checked the threshold matrix Ts is not any longer connected and contains three blocks, F1, i;z and T3. r, is induced by the rows 2,4 and 6 and by the columns 1,3 and 7, r, by the rows 1 and 3 and the columns 2 and 4 and finally T3 by the rows 5 and 7 and the single column 6. Furthermore, note that T5 contains an all ones column, namely column 5. Hence, for the first time we arrived at a situation where we need to carry out Steps 3 and 4 of Algorithm 2.

According to Step 3 and the description in Case 3 in Section 6.1 we have to fix column 5 at the leftmost position within its stripe, i.e. within the stripe [S, 71. Hence, column 5 takes the third position and can be disregarded for the rest of the algorithm.

Since T5 is not connected, the next step consists in determining the order of the blocks T, , T2 and r, in a bottleneck Monge matrix. This is achieved in Step 4 of the algorithm. First we determine the values N’ and NC for all rows and columns and obtain

N,(l) = 1, N,(2) = 5, N,(3) = 2, N,(4) = 5, N,(5) = 3,

N,(6) = 5, and N,(7) = 3

and

N,(l) = 4, N,(2) = 2, N,(3) = 4, N,(4) = 3, N,(5) = 4,

N,(6) = 1, and N,(7) = 4.

This in turn yields

cl\ = 1 9 a; = 4 9 a; = 4, p; = 3, p; = 4, p; = 4

and

a”,=l, a”,=5, UC,=5 3 p; = 3, p; = 5, p; = 5.

Ordering the blocks of T5 by increasing values of ar, a’, /Y and /? shows that block F1 has to be the first block while the order of r2 and ii;3 is arbitrary.

Next we apply Algorithm 1 to each of the three blocks and determine the sets 9( Fi), 9( Tz) and 9( ?i3). Each of these sets of pairs of row and column permutations can be represented by a pair of stripe permutations; namely 9(T1) by

((C61, PI, C41>, <Cll, C31, C7l>h WTd by (<CL 31h <CT 41)) and ~(~d by (( [5,7] ), ( [6] )). Now these stripe permutations must be pasted together. Using the numbers N’ and NC calculated above, it can easily be checked that the orientation of all blocks may remain the same - it is not necessary to reverse a block. Pasting together the above row and column stripes in the order Fi, TJ and Tz and inserting

Page 29: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43-74 71

column 5 at the third position results in the following pair (W, 9’) of stripe permuta- tions with

G%’ = ((C61, PI, C41, C5,71, CL 31) and y’ = (Cll, C31, C51, C71, C61, C2,41 >I.

Thus _!&, the intersection of _@s and (al, S’), is equal to (a’, 9”). The last critical threshold to be considered is ii6 = 3. (Afterwards all rows and

columns belong to distinct stripes.) We again compute the numbers CX’, c?, p’ and fl and finally obtain that !& can be represented by

(( II619 C21, C41, II519 C71, C31, Cl1 >v < IIll, C31, II519 L-711 C61, C21, C41 >I

In a final step we choose the following pair (4, II/) E _& (in this case the choice is unique):

i 1 2 3 4 5 6 7

4(i) 6 2 4 5 7 3 1 tj(i) 1 3 5 7 6 2 4

It is easy to verify that A,,, is indeed a bottleneck Monge matrix. Consequently, A is permuted bottleneck Monge.

7. Problem variations

As already mentioned in the introduction, there exist applications where permuted bottleneck Monge matrices are only useful if the pair of permutations (4, J/) satisfies additional requirements, e.g. for the traveling salesman problem we demand 4 = +. An extension of the techniques presented in Section 6 leads to an 0(n3) time algorithm for this problem. For details we refer the reader to [18].

Another problem variation (RP’) is to require that the ordering of the columns remains fixed and only the rows may be rearranged (e.g. in a special case of the flow-shop scheduling problem). Given an n x m matrix A, we want to find a permuta- tion 4 such that A,,,m is bottleneck Monge. This problem can be solved by an analogous threshold method as used in Section 6 for the unrestricted problem. Note that in this case the underlying problem for O-l matrices becomes easier - we just construct a lexicographical sorting of the rows of the threshold matrices Tk with respect to the vector of the positions of the first and last zero entry in each row. This yields an O(n’m) time algorithm.

Another algorithm for the problem (RP’) is based on Lemma 3.2 and the sub- sequent remark. There we observed that the set of row permutations that transform a given n x 2 matrix into a bottleneck Monge matrix can be computed in O(nlogn) time. Because of the simple structure of this set of row permutations, we can apply this approach to all n x 2 submatrices of the n x m input matrix A and obtain a

Page 30: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

72 B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43-74

permutation 4 of the rows of A which is feasible for all O(m’) submatrices of order n x 2 and hence for A. Obviously, this results in an 0(nm2 log n) time algorithm for solving (RP’). Hence, the problem (RP’) can be solved in 0(min{n2m, nm210gn}) time.

While the two problem variations considered above deal with posing additional restrictions on the permutations C#J and $, there are also variations where the bottleneck Monge property is replaced by a related but stronger property. The reason for this is that the bottleneck Monge property is too weak for certain problem classes (for example, bottleneck Monge matrices are in general not totally monotone). Therefore, Bein et al. [3] introduced the following stronger property:

Foralll<i<rdnandl<j<sdmweeitherhave

lllaX{Uij,U,,} < IllaX{Uis,U,j} 01

maX(aij,a,,} = maX(ai,, a,j} and

min(Uij, ors} < min{Ui,, Ulj}. (*)

Matrices satisfying this stronger property are totally monotone and hence the matrix- searching techniques developed for totally monotone matrices (see e.g. [l]) can be applied to get better algorithms e.g. for special shortest path problems with bottleneck objective function (cf. [3]).

Investigating the class of matrices that can be permuted to satisfy the property above, it turns out that for O-l matrices this class of matrices coincides with the class of Cl Monge matrices. Using the results of Deineko and Filonenko [12] and of Rudolf [24], we thus get again an O(nm(n + m)) time recognition algorithm which is of the same type as the recognition algorithm for permuted bottleneck Monge matrices presented in this paper. An even better algorithm which runs in O(nm + n log n + m log m) time can be obtained by applying the idea of Deineko and Filonenko directly (see [25]).

It is interesting to note that the class of matrices which fulfil the property (*) coincides with the class of matrices A for which there exists a number d > 1 such that the new matrix B obtained by setting bij = dU1j for 1 < i < n and 1 < j < m satisfies the (sum) Monge property (1). Note that bottleneck Monge matrices in general do not have this property.

Another problem variation concerns the recognition of permuted bottleneck Monge matrices which may contain unspecified elements. Let us call a matrix A a partial bottleneck Monge matrix if some elements of A are unspecified and the bottleneck Monge property has to hold only for all 2 x 2 submatrices containing four specified elements. It can be shown that the recognition of permuted partial bottle- neck Monge matrices is NP-complete (see [25]).

8. Summary and concluding remarks

We studied the following recognition problem: Given an n x m matrix A, decide whether A is a permuted bottleneck Monge matrix, i.e. either construct a pair of

Page 31: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43-74 13

permutations (4, $) for the rows and columns of A such that the permuted matrix A,,, becomes a bottleneck Monge matrix or determine that no such permutations exist.

For the special case of&l matrices we first gave a compact and concise character- ization of the class of O-l bottleneck Monge matrices and then presented an O(nm) algorithm for recognizing them. As a main result, we furthermore showed that our results for O-l matrices can be used to obtain an O(nm(n + m)) time recognition algorithm for permuted bottleneck Monge matrices with arbitrary entries.

There remain a lot of related questions that deserve further work. (1) It is an open problem whether there is also an efficient direct recognition

algorithm for permuted bottleneck Monge matrices with arbitrary entries which does not make use of the reduction to a sequence of recognition problems for O-l matrices as applied in this paper.

(2) Does there exist an algorithm which, given an n x m input matrix A, decides in less than 0(min{n2m,nm2}) time whether A is bottleneck Monge?

(3) Generalize the bottleneck Monge property to multidimensional arrays and develop an efficient recognition algorithm for permuted multidimensional bottleneck Monge arrays (cf. the results for multidimensional Monge arrays in [4,24]).

References

[l] A. Aggarwal, M.M. Klawe, S. Moran, P. Shor and R. Wilber, Geometric applications of a matrix-

searching algorithm, Algorithmica 2 (1987) 195-208.

[2] N. Alon, S. Cosares, D.S. Hochbaum and R. Shamir, An algorithm for the detection and construction

of Monge sequences, Linear Algebra Appl. 114/l 15 (1989) 669-680.

[3] W. Bein, P. Brucker and J.K. Park, Application of an algebraic Monge property, extended abstract,

Presented at the 3rd Twente Workshop on Graphs and Combinatorial Optimization, Enschede,

(1993).

[4] W.W. Bein, P. Brucker, J.K. Park and P.K. Pathak, A Monge property for the d-dimensional

transportation problem, Discrete Appl Math. 58 (1995) 97-109.

[S] K.S. Booth and G.S. Lueker, Testing for the consecutive ones property, interval graphs, and graph

planarity using PQ-tree algorithms, J. Comput. System Sci. 13 (1976) 335-379.

[6] R.E. Burkard, Remarks on some scheduling problems with algebraic objective function, Methods

Oper. Res. 32 (1978) 63-77.

[7] R.E. Burkard, On the role of bottleneck Monge matrices in combinatorial optimization, manuscript,

Institute of Mathematics, University of Technology, Graz (1993) submitted for publication.

[8] R.E. Burkard and W. Sandholzer, Efficiently solvable special cases of bottleneck travelling salesman

problems, Discrete Appl. Math. 32 (1991) 61-76.

[9] K. Cechlarova and P. Szabo, On the Monge property of matrices, Discrete Math. 81 (1989)

1233128.

[lo] R. Chandrasekaran, Recognition of Gilmore-Gomory traveling salesman problem, Discrete Appl.

Math. 14 (1986) 231-238.

[l l] L. Chen and Y. Yesha, Efficient parallel algorithms for bipartite permutation graphs, Networks 22

(1993) 29-39.

[12] V.G. Deineko and V.L. Filonenko, On the reconstruction of specially structured matrices, Aktual.

Problemy EVM: Programmirovanije, Dnepropetrovsk, DGU (1979) 4345 (in Russian).

[ 131 B.L. Dietrich, Monge sequences, antimatroids, and the transportation problem with forbidden arcs,

Linear Algebra Appl. 139 (1990) 1333145.

Page 32: On the recognition of permuted bottleneck Monge matrices*In their widely unknown paper [12], Deineko and Filonenko gave a polynomial- time algorithm for recognizing permuted Monge

74 B. Klinz et al. / Discrete Applied Mathematics 63 (1995) 43-74

[14] B.L. Dietrich and R. Shamir, Characterization and algorithms for greedily solvable transportation problems, in: Proceedings of the 1st ACM-SIAM Symposium on Discrete Algorithms (1990) 358-366.

[15] PC. Gilmore, E.L. Lawler and D.B. Shmoys, Well-solved special cases in: E.L.Lawler, J.K. Lenstra, A.H.G. Rinnooy Kan and D.B. Shmoys, eds., The Traveling Salesman Problem: A Guided Tour of Combinatorial Optimization (Wiley, Chichester, 1985) 78-143.

1161 A.J. Hoffman, On simple linear programming problems, in: V. Klee, eds., Convexity, Proceedings Symposia in Pure Mathematics 7 (American Mathematical Society, Providence, RI, 1963) 317-327.

[17] B. Klinz, R. Rudolf and G.J. Woeginger, Permuting matrices to avoid forbidden submatrices, Tech. Rept. 23492, Institute of Mathematics, University of Technology, Graz (1992); Discrete Appl. Math. 60 (1995) 223-248.

[18] B. Klinz, R. Rudolf and G.J. Woeginger, On the recognition of restricted classes of permuted bottleneck Monge matrices, manuscript, Institute of Mathematics, University of Technology, Graz.

[19] S.M. Johnson, Optimal two- and three-stage production schedules with setup times included, Naval Res. Logist. Quart. 1 (1954) 61-68.

[20] E.L. Lawler, J.K. Lenstra, A.H.G. Rinnooy Kan and D.B. Shmoys, The Traveling Salesman Problem: A Guided Tour of Combinatorial Optimization (Wiley, Chichester, 1985).

[21] G. Monge, Mtmoires sur la theorie des deblais et des remblais, in: Histoires de 1’Academie Royale des Sciences, Ann&e M. DCCLXXXI, Avec les Memoires de Mathimatique et de Physique, pour Ie mime Ann&e, Tires des Registres de cette Academic, Paris (1781) 666704.

[22] CL. Monma and A.H.G. Rinnooy Kan, A concise survey of efficiently solvable special cases of the permutation flow shop-problem, RAIRO Rech. Oper. 17 (1983) 105-l 19.

[23] J.K. Park, The Monge array: an abstraction and its application, Ph.D. Thesis, MIT, Cambridge, MA (1991).

[24] R. Rudolf, Recognition of d-dimensional Monge arrays, Tech. Rept. 230-92, Institute of Mathematics, University of Technology, Graz (1992); Discrete Appl. Math. 52 (1994) 71-82.

[25] R. Rudolf, Monge properties and their recognition, Ph.D. Thesis, TU Graz (1993). [26] R. Shamir, A fast algorithm for constructing Monge sequences in transportation problems with

forbidden arcs, Report 136/89, Tel Aviv University (1989); Discrete Math. 114 (1993) 435444. [27] J. Spinrad, A. Brandstldt and L. Stewart, Bipartite permutation graphs, Discrete Appl. Math. 18

(1987) 279-292. [28] A. Tucker, A structure theorem for the consecutive ones property, J. Combin. Theory Ser. B 12 (1972)

153-162. [29] J.A.A. van der Veen, Solvable cases of traveling salesman problem with various objective functions,

Ph.D. Thesis, University Groningen (1992).