33
Ž . Journal of Algorithms 34, 337]369 2000 doi:10.1006rjagm.1999.1054, available online at http:rrwww.idealibrary.com on Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids 1 Wun-Tat Chan and Francis Y. L. Chin Department of Computer Science and Information Systems, The Uni ¤ ersity of Hong Kong, Pokfulam Road, Hong Kong E-mail: [email protected], [email protected] Received February 24, 1998 N Ž . Ž . In a rectangular grid, given two sets of nodes, S sources and T sinks , of size 2 Ž . each, the disjoint paths DP problem is to connect as many nodes in S to the Ž nodes in T using a set of ‘‘disjoint’’ paths. Both edge-disjoint and ¤ ertex-disjoint . cases are considered in this paper. Note that in this DP problem, a node in S can be connected to any node in T. Although in general the sizes of S and T do not have to be the same, algorithms presented in this paper can also find the maximum number of disjoint paths pairing nodes in S and T. We use the network flow approach to solve this DP problem. By exploiting all the properties of the network, such as planarity and regularity of a grid, integral flow, and unit capacity Ž sourcersinkrflow, we can optimally compress the size of the working grid to be . Ž 2 . Ž 1.5 . Ž 2.5 . defined from ON to ON and solve the problem in ON time for both the edge-disjoint and vertex-disjoint cases, an improvement over the straightfor- Ž 3 . ward approach which takes ON time. Q 2000 Academic Press 1. INTRODUCTION N Given two sets of nodes of size each, called sources S and sinks T, in 2 Ž . a rectangular grid of infinite size, the disjoint paths DP problem is to connect as many nodes in S as possible to the nodes in T using a set of Ž ‘‘disjoint’’ paths. Both edge-disjoint and ¤ ertex-disjoint cases are considered . in this paper. Note that in this DP problem, each of the disjoint paths connects one node in S to one node in T only and there is no predefined mapping between the nodes in S and the nodes in T; i.e., the paths create Ž a one-to-one correspondence between S and T. It can be shown in . Appendix A that solving this DP problem in an infinite grid is equivalent 1 The research is partially supported by Hong Kong RGC Grant 338r065r0022. 337 0196-6774r00 $35.00 Copyright Q 2000 by Academic Press All rights of reproduction in any form reserved.

Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

Embed Size (px)

Citation preview

Page 1: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

Ž .Journal of Algorithms 34, 337]369 2000doi:10.1006rjagm.1999.1054, available online at http:rrwww.idealibrary.com on

Efficient Algorithms for Finding the Maximum Numberof Disjoint Paths in Grids1

Wun-Tat Chan and Francis Y. L. Chin

Department of Computer Science and Information Systems, The Uni ersity of HongKong, Pokfulam Road, Hong Kong

E-mail: [email protected], [email protected]

Received February 24, 1998

NŽ . Ž .In a rectangular grid, given two sets of nodes, SS sources and TT sinks , of size 2Ž .each, the disjoint paths DP problem is to connect as many nodes in SS to the

Žnodes in TT using a set of ‘‘disjoint’’ paths. Both edge-disjoint and ¨ertex-disjoint.cases are considered in this paper. Note that in this DP problem, a node in SS can

be connected to any node in TT. Although in general the sizes of SS and TT do nothave to be the same, algorithms presented in this paper can also find the maximumnumber of disjoint paths pairing nodes in SS and TT. We use the network flowapproach to solve this DP problem. By exploiting all the properties of the network,such as planarity and regularity of a grid, integral flow, and unit capacity

Žsourcersinkrflow, we can optimally compress the size of the working grid to be. Ž 2 . Ž 1.5. Ž 2.5.defined from O N to O N and solve the problem in O N time for both

the edge-disjoint and vertex-disjoint cases, an improvement over the straightfor-Ž 3.ward approach which takes O N time. Q 2000 Academic Press

1. INTRODUCTION

NGiven two sets of nodes of size each, called sources SS and sinks TT, in2Ž .a rectangular grid of infinite size, the disjoint paths DP problem is to

connect as many nodes in SS as possible to the nodes in TT using a set ofŽ‘‘disjoint’’ paths. Both edge-disjoint and ¨ertex-disjoint cases are considered

.in this paper. Note that in this DP problem, each of the disjoint pathsconnects one node in SS to one node in TT only and there is no predefinedmapping between the nodes in SS and the nodes in TT; i.e., the paths create

Ža one-to-one correspondence between SS and TT. It can be shown in.Appendix A that solving this DP problem in an infinite grid is equivalent

1The research is partially supported by Hong Kong RGC Grant 338r065r0022.

337

0196-6774r00 $35.00Copyright Q 2000 by Academic Press

All rights of reproduction in any form reserved.

Page 2: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN338

Žto solving the DP problem with the same set of nodes throughout this.paper, ‘‘nodes’’ refers to nodes in both SS and TT embedded inside a

2 N = 2 N working grid. Although in general the sizes of SS and TT do nothave to be the same, algorithms presented in this paper can also find themaximum number of disjoint paths pairing nodes in SS and TT. When TT isthe set of boundary vertices of the grid, this problem is known as the

w x w xescape problem 5 , the breakout routing problem 9 in a printed circuitw xboard, the single-layer fanout routing problem 24 for ball-grid array

w xpackages, and the reconfiguration problem 2, 4, 14, 19]21 on VLSIrWSIŽ .wafer scale integration processor arrays in the presence of faulty proces-sors.

Ž .The edge-disjoint paths EDP problem is the DP problem with edge-dis-joint paths. If we have to connect all nodes in SS to all nodes in TT only, wecan reduce the EDP problem to a multiple-source, multiple-sink integral

w xflow problem 12, 13 on a grid network, where sources are with unitsupply, sinks are with unit demand, and every grid edge has unit capacity.

w xAs the grid is planar, this multiple-source, multiple-sink problem 12, 13Ž .on an O p -size planar network can be solved using a fast shortest-path

w x Ž 4r3 . Ž 8r3 .algorithm for planar graphs 8 in O p log p time, i.e., O N log NŽ 2 .time for the EDP problem, as the size of the grid is O N . Alternatively,

if we have to connect as many nodes as possible in SS to the nodes in TT,we can reduce the EDP problem to the single-source, single-sink unit

w xcapacity MAX-FLOW problem 1, 11 or a maximum vertexredge-disjointŽ . w xs, t -paths routing problem 7, 10, 16]18, 22, 23 by connecting the sourcesto a super-source s and the sinks to a super-sink t. However, this reductionusually destroys the planarity of the graph. Solving the EDP problem as a

w x Ž 1.5.unit capacity MAX-FLOW problem 1 in a general graph takes O pŽ 3.time, i.e., O N for the EDP problem.

Ž .The vertex-disjoint paths VDP problem is the DP problem withvertex-disjoint paths. It can also be solved by reducing it to the unit

w xcapacity MAX-FLOW problem. However, we need to ‘‘split’’ 3 eachvertex in the network into two and connect them by a directed edge withunit capacity which ensures that only one path can traverse a vertex in theoriginal network. This transformation also destroys the planarity of the

w xgrid but results in a simple network 15 with unit capacity which leads toŽ 1.5. Ž 3.an O p time algorithm, i.e., O N for the VDP problem.

Ž 3.The O N time bound for the DP problems can also be achieved easilyw x Ž w xwith the standard Ford]Fulkerson algorithm 6 see 1 for an extensive

.survey on network flow algorithms . A network is constructed by connect-ing the sources to a super-source and the sinks to a super-sink; thealgorithm finds an augmenting path from the super-source to the super-sinkin each iteration. In the ith iteration, the existence of an augmenting pathguarantees the existence of a set of i edge-disjoint paths from i sources to

Page 3: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 339

Ž .FIG. 1. Example of finding of an augmenting path in an auxiliary grid. a A set of 3Ž . Ž . Ž .disjoint paths connecting three sources v and three sinks ===== . b An augmenting path

Ž .indicated by ¥ in an auxiliary grid. c A set of four disjoint paths.

Ži sinks vertex-disjoint paths can also be found by ‘‘splitting’’ each vertex.into two as described previously . An auxiliary grid in the ith iteration is

w x Žthe corresponding residual network 1 without the edge capacity or make.them all unit capacity . Assuming there are i disjoint paths from the

super-source to the super-sink, the auxiliary grid is the working grid witheach undirected edge on any of the i paths be replaced by a directed edge

Ž .in an opposite direction to the path Fig. 1b . The search for an augment-ing path starting from the super-source to the super-sink can be performedby a depth-first or breadth-first search in the auxiliary grid. For example,Fig. 1a shows the grid with three edge-disjoint paths. Figure 1b indicatesan augmenting path starting from source D on the auxiliary grid.

If the augmenting path starting from an unvisited source2 crosses anŽ .existing path this is only allowed in the edge-disjoint paths problem or

passes through some directed edges in the auxiliary grid, then the newpath from that source assumes the first part of the augmenting path andthen switches to the second part3 of the path which it crosses or throughwhose directed edge it passes. At the same time, the affected path willexchange its second part with the second part of the augmenting path. Forexample, the new set of edge-disjoint paths for Fig. 1b is presented in Fig.1c, which contains one more edge-disjoint path than the original set shownin Fig. 1a. The next iteration will be repeated with the new set ofedge-disjoint paths. Thus, after each iteration the number of edge-disjointpaths would be increased by one. The algorithm terminates when no

2Saying an augmenting path is starting from an unvisited source is equivalent to saying thatit is starting from the super-source to an unvisited source. Similarly, saying an augmentingpath is ending at an unvisited sink is equivalent to saying that it is ending at the super-sinkthrough the unvisited sink.

3 We assume the first part of a path is connected to the source and the second part to thesink.

Page 4: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN340

augmenting path exists in the auxiliary grid and finds the maximumnumber of sources that can be connected to sinks. As each iteration takesŽ 2 . Ž 3.O N time to search for an augmenting path, this algorithm takes O N

time.In this paper we present efficient and practical algorithms for EDP and

VDP problems based on the Ford]Fulkerson algorithm. Our algorithmsexploit all the properties of the network, such as planarity and regularity ofa grid, integral flow, and unit capacity sourcersinkrflow, to find augment-ing paths efficiently. Since the N nodes can be widely spread over anarbitrarily large grid, our algorithms first perform a precomputation on the

Žgrid to remove most of the empty rowsrcolumns under some conditions.which will be explained in Appendix A , so that the DP problem can be

limited to a working grid of size 2 N = 2 N. Moreover, the precomputationalso ensures that the set of disjoint paths connecting the maximum numberof nodes in SS to nodes in TT in the infinite grid is preserved in the DPproblem with the 2 N = 2 N working grid. The details of this precomputa-tion are described in Appendix A. Our algorithm to solve the EDPproblem can be outlined as follows. First, it takes advantage of thesparseness of N nodes in the 2 N = 2 N working grid to isolate a number

Ž .of node-free rectangular blocks in the grid Fig. 2a . This isolation ofŽ 2 .rectangular blocks reduces the size complexity of the grid from O N to a

Ž 1.5.graph of optimal size O N and retains all the properties needed to findan augmenting path in the original grid. This reduction in size complexity

Ž 1.5.enables us to find an augmenting path in O N time and solve the DPŽ 2.5.problem in O N time. In Section 2 we propose an optimal algorithm to

isolate node-free rectangular blocks in a grid. The main idea of ouralgorithms, to find an augmenting path efficiently at each iteration, will be

Ž . Ž .FIG. 2. a The isolation of rectangular blocks and b a step in RB-ISOLATION.

Page 5: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 341

discussed in Section 3. In Section 4 we will discuss how to implement thoseideas, i.e., how to provide a necessary and sufficient condition for feasible

Ž 2 .routing in a rectangular block, and how a grid of O N size can beŽ 1.5.represented by a graph of size O N and how the reachability informa-

tion can be retained in the graph. By tilting the grid 458, we shall show inSection 5 that the same techniques can be applied and used to solve theVDP problem. Section 6 concludes.

2. ISOLATION OF RECTANGULAR BLOCKS

Throughout this paper it is assumed that the N nodes are embedded inan m = n grid where N F m, n F 2 N. However, this is not usually thecase. If N nodes are very sparsely located in the grid, the size of the gridto include these N nodes can be arbitrarily large. Appendix A shows a

Ž .simple O N time preprocessing step which eliminates most of the emptyrowsrcolumns so that the resultant m = n working grid provides the samesolution as the original infinite grid.

Ž 2 .In this section, an O N time algorithm to optimally isolate node-freerectangular blocks in an m = n grid is presented. The rectangular blocksshould be free of any nodes and totally disjoint from each other; i.e., theirboundaries should not share any common grid vertices or edges. Forexample, the rectangular blocks indicated by the shaded regions in Fig. 2aare at least one rowrcolumn of cells apart. A cell is defined as thesmallest square region enclosed by four grid edgesrvertices. These rectan-gular blocks cannot cover the whole m = n grid because they do not shareboundary vertices or edges and cannot cover the N nodes. However, weshall show in the following subsections that the number of cells whichcannot be covered by rectangular blocks, for our algorithm and the optimal

Ž 1.5.algorithm, is Q N . Thus, our algorithm finds an asymptotically ‘‘opti-mal’’ isolation of rectangular blocks. In the rest of this paper, when werefer to a block, it is a node-free rectangular block unless otherwisespecified.

2.1. Algorithm for the Isolation of Rectangular Blocks

The isolation of blocks in a grid G is done recursively by the procedureRB-ISOLATION. Without loss of generality, assume m F n. That meansthe width is larger than the height of the grid. Otherwise, the grid ispartitioned horizontally. The grid is partitioned into three subgrids, G ,L

Ž . Ž .G , and G , of the same height Fig. 2b , where 1 G , G , and GM R L M RŽ .represent the left, middle, and right rectangular subgrids, 2 G and GL R

Ž .each share a common boundary with G , 3 G should cover the middleM M

Page 6: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN342

Ž .grid column, and 4 G contains no nodes except at its right andror leftMboundaries. Note that G and G can be null while G always exists. IfL R MG or G exists, it will be partitioned recursively. If G is more thanL R Mthree grid columns wide, then G will become an isolated block after itsMleftmost and rightmost grid columns are removed. Otherwise, no middleblock can be isolated.

Ž . ŽPROCEDURE RB-ISOLATION G where G is an m = n grid with.m F n .

Ž . Ž .1 Base case If the number of nodes N is 0 or m s 1, return.nŽ . ? @2 Let grid column i, where 1 F i F , be the column with the2

n? @smallest index such that all columns from i q 1 to are free of nodes.2

Column i is then the common boundary between G and G .L MnŽ . ? @3 Let grid column j, where - j F n, be the column with the2

n? @largest index such that all columns from q 1 to j y 1 are free of nodes.2

Column j is then the common boundary between G and G .M R

Ž .4 If j G i q 3, then the subgrid containing grid columns fromŽi q 1 to j y 1 will be an isolated block in G . Otherwise, we do not haveM

.an isolated block in G .M

Ž .5 If i G 2, then G , the subgrid containing grid columns from 1 toLŽ .i, will be handled recursively, i.e., RB-ISOLATION G .L

Ž .6 If j F n y 1, then G , the subgrid containing grid columns fromRŽ .j to n, will be handled recursively, i.e., RB-ISOLATION G .R

2.2. Analysis of RB-Isolation

In Steps 2 and 3 of RB-ISOLATION, i and j are found by scanningtoward the left and right side from the middle column, respectively. The

Ž .columns scanned will be in G and form an isolated block if any Step 4 ;Mthese scanned grid columns will not be considered again in the algorithm.As all the grid verticesredges are scanned only a constant number of

Ž . Ž 2 .times, the time complexity of RB-ISOLATION is O mn , i.e., O N .The performance of RB-ISOLATION can also be measured by the

number of cells that cannot be covered by the blocks. Obviously, thenumber of verticesredges that are not covered by blocks should be no

Ž .more than four times the number of uncovered cells. Let T N, m, n bethe number of uncovered cells, where N is the number of nodes in anm = n grid with m F n. Furthermore, let N and N be the numbers ofL Rnodes in G , an m = n grid, and G , an m = n grid, respectively.L L L R R RAccording to RB-ISOLATION, we have N q N s N, N G 0, N G 0,L R L R

n nŽ ? @. Ž ? @.m F n , m F n , and m , m F min m, and n , n F max m, .L L R R L R L R2 2

T N , m , n F T N , m , n q T N , m , n q 2 m y 1 ,Ž . Ž . Ž . Ž .L L L R R R

Page 7: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 343

Ž .where the number of uncovered cells is at most 2 m y 1 when G isŽ .partitioned into three subgrids Step 3 in RB-ISOLATION . From Step 1,

Ž . Ž . Žwe have T 0, m, n s 0 and T N, 1, n s 0 no cells can be formed by only.one single rowrcolumn of vertices . We shall prove by induction on N that

' 'Ž . �Ž . 4T N, m, n F max k N y k mn , 0 for N G 0, n G m ) 1, k s 12,1 2 1and k s 5.2

'Ž . � 4Base step: When N s 0, T 0, m, n s 0 F max yk mn , 0 .2

Inductive step: When N ) 0,

T N , m , n F max k N y k m n , 0Ž . ' '½ 5ž /1 L 2 L L

q max k N y k m n , 0 q 2 m y 1Ž .' '½ 5ž /1 R 2 R R

N mn'F max 2k y 2k , k N y k q 2 m y 1Ž .( (1 2 1 2½ 52 2

Ž .note that the maximum value occurs when N s N , N s 0, or N s 0L R L R

N k2' ' 'F max k N y 2 k q 2, k y q 2 mn(1 2 1½ 5'2 2

' 'F k N y k mn .Ž .1 2

'Ž . Ž .Thus, the number of uncovered cells verticesredges is O mnN , i.e.,Ž 1.5.O N .

2.3. Lower Bound of the Unco¨ered Cells

In this section we shall show that the number of uncovered cells'Ž .generated in an m = n grid with N nodes is at least V mnN or

Ž 1.5.V N .

Ž .THEOREM 2.1. As long as the rectangular blocks free of nodes to beisolated do not contain any holes, there are instances in which the number of

'Ž .unco¨ered cells generated is at least V mnN for an m = n grid with Nm n� 4nodes where N G max , .n m

m n� 4 'Proof. Since N G max , , both m and n are greater than mnrN .n m

' 'Thus, the m = n grid can be divided into N square mnrN = mnrNŽ .' 'subgrids in the form of a mNrn = nNrm array . If we place a node

in the center of each subgrid, the distance between any pair of nodes is1' 'mnrN and between any node and the grid boundary is mnrN . As the2

blocks to be isolated do not contain any holes, each node cannot be

Page 8: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN344

isolated and must be connected to some boundary vertices through a chainof uncovered cells. This implies that at least N rectilinear edges arerequired to connect all the N nodes to the grid boundary, where eachrectilinear edge can be represented by a chain of uncovered cells betweentwo nodes or between a node and a boundary vertex. Thus, the number of

'Ž .uncovered cells should be V mnN .

3. FRAMEWORK OF THE ALGORITHM

Our algorithms for the DP problems are based on the Ford]Fulkersonalgorithm. At each iteration, we have to find an augmenting path from anunvisited source to an unvisited sink in the auxiliary grid efficiently.

Ž 2 .Instead of traversing the original auxiliary grid of O N size to find anŽ 1.5.augmenting path, our algorithms work on a graph of size O N , thus

Ž 2 .reducing the time complexity of each traversalriteration from O N toŽ 1.5.O N . The reduction in time complexity is based on an observation that

the blocks are free of any nodes, and a search step to find an augmentingpath does not have to consider all the grid vertices or edges in a block aslong as the reachability information between any pair of boundary verticesof the block is known during the search of an augmenting path in eachiteration. The construction of disjoint paths within each p = q block takespq time and is only performed once at the end of the algorithm.

The reachability information can be represented by a reachability graphŽ .of size O p q q which replaces each p = q block in the auxiliary grid

using the same set of boundary vertices to connect with vertices outsidethe block. The reachability graph captures information on whether anyboundary vertex is connected to any other boundary vertex of the blockthrough some edge-disjoint paths inside the block. For instance, Fig. 3a isa snapshot of the grid at a particular iteration of the algorithm. It showssome edge-disjoint paths connecting sources to sinks without showing theinternal paths within a 5 = 7 block. Since the block is node-free, thenumber of incoming edges to the block must equal the number of outgoingedges from the block and there are usually more than one way of pairingthe incoming edges with outgoing edges by edge-disjoint paths inside theblock. Section 4.1 gives a necessary and sufficient condition for theexistence of disjoint paths in a block by a given set of incomingroutgoingedges.

The auxiliary grid can be constructed by reversing the directions of allŽedges on the paths in the grid. During a graph traversal breadth-first or

.depth-first search for an augmenting path on the auxiliary grid, the

Page 9: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 345

Ž .FIG. 3. a A set of edge-disjoint paths in the presence of a rectangular 5 = 7 block andŽ .b the corresponding reachability graph.

traversal can only enter the block through a boundary vertex without anincoming edge and exit the block through a boundary vertex 4 without anoutgoing edge. In general, one does not have to traverse each edge in a

Ž .p = q block, which takes O pq time, in order to find an exit vertex of theblock if one knows which boundary vertices are ‘‘reachable’’ from theentering vertex. In Fig. 3a, one can enter the block through any boundaryvertex without any incoming edges on the right of the dotted line and exitthrough any boundary vertices without any outgoing edges; however, if oneenters the block through a boundary vertex on the left of the dotted line,one can only exit through boundary vertices on the same side of the dottedline. This is because the dotted line in Fig. 3a represents a set of edgesŽ .cut which is saturated by edge-disjoint paths from left to right. Thisreachability information can be captured by the reachability graph asshown in Fig. 3b. We describe the main idea of our algorithm as follows.

Ž . Ž .1 Preprocess the grid Appendix A .Ž . Ž2 Isolate a set of node-free rectangular blocks in the grid Section

.2 .Ž .3 Repeat

Ž .i Based on the set of edge-disjoint paths found so far, constructthe auxiliary grid and replace each rectangular block by its reachability

Ž .graph to be discussed in Section 4.2 .

4 To be precise, this only applies to boundary vertices which are not corner vertices of theblock. The traversal can also enter the block through a corner vertex with only one incomingedge and similarly exit the block through a corner vertex with only one outgoing edge.

Page 10: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN346

Ž .ii Apply a breadth-first search to find an augmenting path froman unvisited source to an unvisited sink in the auxiliary grid. Exit if notfound.

Ž .iii Based on the augmenting path, update the edge-disjoint pathsof the grid as well as the incoming and outgoing edges of those affectedrectangular blocks.

Ž .4 The set of edge-disjoint paths can be found by constructingdisjoint paths which connect those boundary vertices with incoming edgesto those boundary vertices with outgoing edges in each rectangular blockŽ .Section 4.3 and Appendix B .

3.1. Time Analysis

The running time of the overall algorithm depends on:

Ž .a Step 1: the time complexity of the preprocessing, which takesŽ . Ž .O N time to construct an m = n grid, where m, n is O N , which

Ž .provides the same solution as the original DP problem Appendix A .Ž . Ž .b Step 2: the isolation of rectangular blocks, which takes O mnŽ .time Section 2 .Ž . Ž .c Step 3 i : the construction of a reachability graph of a p = q

Ž .block in O p q q time, i.e., in time proportional to the number ofŽ .boundary vertices of the block Section 4.2 .

Ž . Ž .d Step 3 ii : the search for an augmenting path which depends onthe number of boundary vertices of all the blocks and the number of

Ž 1.5.uncovered vertices. Since there are O N uncovered cells generated inthe isolation algorithm, the total number of boundary vertices and uncov-

Ž 1.5.ered vertices is at most O N .

As there are at most N nodes, the total running time of Step 3 will beŽ 2.5. Ž . Ž .O N . Since Step 4 takes at most O mn time Section 4.3 , the whole

Ž 2.5.algorithm takes at most O N time.

4. EDGE-DISJOINT PATHS IN A RECTANGULAR BLOCKAND ITS REACHABILITY GRAPH

Ž .The next three subsections give: 1 a necessary and sufficient reachabil-Ž .ity condition on the boundary vertices of a block, 2 the construction of

Ž . Ž .the reachability graph, and 3 an O mn time algorithm to find theedge-disjoint paths in the block when the set of incomingroutgoing edgesis given.

Page 11: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 347

4.1. Necessary and Sufficient Condition

w x w xGiven a p = q block denoted by 1 :: p = 1 :: q , vertices in the blockŽ .can be represented by i, j where 1 F i F p and 1 F j F q. Set II consists

of all incoming edges and set OO all outgoing edges, entering and exitingthe block through its boundary vertices. A set of edge-disjoint paths

< <Ž < <.satisfies II j OO if there are exactly II s OO edge-disjoint paths com-Ž .pletely inside the block and joining or pairing up each incoming edge in

II with a distinct outgoing edge in OO.Ž .A cut edge cut is defined as a set of block edges whose removal will

Ž .divide the block into components. In particular, h-cut i is a horizontal cutŽ .which denotes the ith row of block edges and ¨-cut j is a vertical cut

which denotes the jth column of block edges. The capacity of a cut, h-cutor v-cut, equals the number of edges in the cut. For example, given a

Ž . �ŽŽ . Ž .. 4p = q block, h-cut i s i, b , i q 1, b N 1 F b F q has capacity q, andŽ . �ŽŽ . Ž .. 4¨-cut j s a, j , a, j q 1 N 1 F a F p has capacity p. The demand of

a cut represents the least number of paths needed to pass through the cutŽ . Ž Ž ..in order to satisfy II j OO. For instance, the demand of h-cut i ¨-cut j

is the difference between the number of incoming and outgoing edgesŽ . Ž Ž . .above the i q 1 st row on the left of the j q 1 st column of the block.

We say that a cut is saturated if its demand equals its capacity ando¨ersaturated if its demand is larger than its capacity.

LEMMA 4.1. Gi en a rectangular p = q block and two sets of edges, II and< < < <OO, with II s OO , there exists a set of edge-disjoint paths satisfying II j OO if

Ž . Ž .and only if all the h-cut i for 1 F i F p y 1 and ¨-cut j for 1 F j F q y 1are not o¨ersaturated.

Proof. Only if part: Obvious.w xIf part: According to the well-known max-flow]min-cut theorem 1 , if

< <a set of II edge-disjoint paths in the block satisfying II j OO does notexist, there must exist an oversaturated cut C. In the following, we shallshow that if there is an oversaturated cut, then there is an oversaturatedh-cut or v-cut. If C disconnects the block into more than two components,either C cannot be oversaturated or a proper subset of C which discon-nects the block into two components will also be oversaturated. Note that

Ž .i C cannot contain two boundary edges on the same side, sayŽŽ . Ž .. ŽŽ . Ž .. Ž .1, i , 1, i q 1 and 1, j , 1, j q 1 with i - j Fig. 4 as the capacity ofC is greater than j y i, the number of boundary vertices in one of thecomponents.

Ž . Ž .ii C cannot contain two boundary edges on adjacent sides Fig. 4either, as the capacity of C is always no less than the number of boundaryvertices in one of the components.

Page 12: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN348

FIG. 4. Cases for partitions of a rectangular block.

Ž .iii C must contain two boundary edges on the opposite sides, sayŽŽ . Ž .. ŽŽ . Ž .. Ž .i, 1 , i q 1, 1 and j, q , j q 1, q Fig. 4 ; then C can be one of

Ž .those h-cut k , where k lies between i and j, as those cuts have less< <capacity by j y i , while the demand can at most decrease by the same

amount.

4.2. Construction of Reachability Graphs

In this section we shall show how the reachability information of anauxiliary grid in a block is retained and represented by a reachability graphwhich replaces the part of the auxiliary grid inside a block.

�Ž .Let the boundary of the block be the set of vertices BB s i, j N i s 14or i s p or j s 1 or j s q . We say the set of incomingroutgoing edges,

< < < <II j OO, is ¨alid with respect to BB if, besides II s OO , each vertex in BB

can be associated with at most one incoming edge from II or one outgoing�Ž . Ž . Ž .edge from OO, except the corner vertices of BB, i.e., 1, 1 , 1, q , p, 1 ,

Ž .4p, q , which can be associated with up to two incomingroutgoing edges.Ž .The set of incomingroutgoing edges, II j OO, is sol able if all the h-cut i

Ž .for 1 F i F p y 1 and ¨-cut j for 1 F j F q y 1 are not oversaturatedŽ .refer to Lemma 4.1 .

During the search of an augmenting path in the auxiliary grid, if theaugmenting path can enter a block at boundary vertex x g BB and exit theblock at y g BB, we say that y is reachable from x. Moreover, theincorporation of an augmenting path from x to y with the existing set ofedge-disjoint paths will result in a new set of edge-disjoint paths with anew set of incomingroutgoing edges, II9 j OO9. In order for II9 j OO9 to bevalid, the entering vertex x cannot be originally associated with an

Ž .incoming edge or with two incoming edges if x is a corner vertex .Similarly, the exiting vertex y cannot be originally associated with an

Page 13: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 349

Ž .outgoing edge or two outgoing edges if y is a corner vertex . Now let usconsider the following cases to ensure validity of II9 j OO9:

Ž . Ž . ŽCase i If x or y was originally associated with an outgoing or. � 4 Ž �incoming edge, then OO9 s OO y the outgoing edge at x or II9 s II y the

4.incoming edge at y .Ž . Ž .Case ii If x or y was originally not associated with any

� 4 Žincomingroutgoing edge, then II9 s II j an incoming edge at x or� 4.OO9 s OO j an outgoing edge at y .

The following lemma states the condition for a boundary vertex y to bereachable from another boundary vertex x. Basically, it says that, givenII j OO, there is an augmenting path from x to y if and only if the newII9 j OO9 is solvable.

LEMMA 4.2. Gi en any rectangular block with a ¨alid and sol able set ofincomingroutgoing edges, II j OO, and letting a new ¨alid set ofincomingroutgoing edges II9 j OO9 be formed by incorporating x and y as theentering and exiting boundary ¨ertices, respecti ely, there exists an augmentingpath from x to y in the block with a set of edge-disjoint paths satisfying II j OO

Ž .i.e., y is reachable from x if and only if II9 j OO9 is sol able.

Proof. Only if part: If an augmenting path from x to y exists, a set ofedge-disjoint paths which satisfies II9 j OO9 exists and II9 j OO9 is solvable.

If part: Let the set of edge-disjoint paths already in the block be W.Since II9 j OO9 is valid and solvable, according to Lemma 4.1, there exists aset of edge-disjoint paths W9 which satisfies II9 j OO9 in the rectangularblock. Take the exclusi e-or of the directed edges in W and W9 and let theresultant set of directed edges be W0. Reversing the direction of thoseedges in W0 which were in W will result in an augmenting path fromboundary vertex x to boundary vertex y in the block with the set of

Žedge-disjoint paths W. Note that loops in the resultant set of directed.edges can be ignored.

Based on the above lemma and II j OO, we are able to determine thereachability from each boundary vertex of a block to others. If there are nosaturated cuts, every vertex is reachable from any other. If there is asaturated cut, vertices on one side of the cut cannot be reached fromvertices on the other side. The instances of the incomingroutgoing edges

Ž .II j OO are divided into three cases which can be determined in O p q qtime by evaluating the capacities and demands of all the h-cuts and v-cuts.We shall show the corresponding reachability graph of each case, such thatthere is a path from boundary vertex x to boundary vertex y if and only ifthe new set of incomingroutgoing edges II9 j OO9 which includes x and y

Page 14: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN350

as an entering and exiting vertex of an augmenting path is valid andsolvable.

Ž . Ž . Ž .Case a : None of the h-cut i and ¨-cut j is saturated. An augmentingpath should exist between any pair of boundary vertices as long asII9 j OO9 remains valid; e.g., those boundary vertices with an incomingŽ . Ž .outgoing edge cannot be used as entering exiting vertices of augmentingpaths. Therefore, the reachability graph should be similar to a star graphwith the center vertex g connecting to all the boundary vertices. For eachboundary vertex x eligible to be the entering vertex of an augmentingpath, there is an edge connecting x to g. Similarly, there is an edgeconnecting g to each boundary vertex eligible to be the exiting vertex. Anexample is given in Fig. 5a.

Ž . Ž . Ž .FIG. 5. Reachability graphs for Cases a , b , and c .

Page 15: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 351

Ž . Ž . Ž . Ž .Case b : Either h-cut i or ¨-cut j not both is saturated. The block ispartitioned into rectangular components by its saturated cuts. The reacha-

Ž .bility graph of each component is similar to that in Case a and isrepresented by a star graph containing the boundary vertices in thecomponent and a center vertex. Assume that the v-cut is saturated fromcomponent P to component P9 as shown in Fig. 5b. Then no augmenting

Ž .path can pass through the v-cut from P to P9 Lemma 4.2 , but augment-ing paths can pass from P9 to P, i.e., a directed edge from center vertex g2to center vertex g .1

Ž . Ž . Ž .Case c : Both saturated h-cut i and ¨-cut j exist. We shall prove thatwhen some of the h-cuts and some of the v-cuts are saturated, there is onlyone possible constellation of the incomingroutgoing edges as shown inFig. 6, and its corresponding reachability graph is given as shown in Fig. 5c.We shall prove the following lemma when both saturated h-cuts and v-cutsexist.

LEMMA 4.3. With reference to Fig. 6, gi en a p = q rectangular block witha ¨alid and sol able set of incomingroutgoing edges II j OO such that satu-

Ž . Ž .rated h-cut a and ¨-cut b are saturated, assume that another saturatedŽ . Ž .¨-cut b9 with b9 ) b exists in the block; then all in-between ¨-cut k s where

b F k F b9 must be saturated in the same direction. A similar result applies tosaturated h-cut.

Proof. Without loss of generality, assume the direction of saturationŽ . Ž . Ž .for h-cut a and ¨-cut b are as shown in Fig. 6. We can see that ¨-cut b9

Ž .has to be saturated in the same direction as ¨-cut b . Otherwise, theŽ .conservation of paths flow would be violated in the rectangular region

bounded by row a q 1 and row p and column b q 1 and column b9.

FIG. 6. Observation on the distribution of saturated cuts.

Page 16: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN352

Ž .Consider any other ¨-cut k where b F k F b9. Due to the conservationŽ . ŽŽ .of flow in region G1 in Fig. 6 , there is a path passing through i, k ,

Ž .. Ž .i, k q 1 in ¨-cut k for every i with 1 F i F a. Similarly, by the conser-Ž .vation of flow in region G2 in Fig. 6 , there is a path passing through

ŽŽ . Ž .. Ž .j, k , j, k q 1 in ¨-cut k for every j with a q 1 F j F p. Therefore,Ž .¨-cut k has to be saturated and it saturates in the same direction asŽ .¨-cut b .

Ž .By Lemma 4.3, we can assume that the saturated h-cuts are h-cut i forŽ .a F i F a9 and the saturated v-cuts are ¨-cut j for b F j F b9. Similar to

Ž .Case b , we partition the rectangular block by the set of saturated cutsŽ . Ž . Ž . Ž .h-cut i and ¨-cut j into a9 y a q 2 = b9 y b q 2 components. We

label the components by P , where 0 F i F a9 y a q 1 and 0 F j F b9 yi, jb q 1. We are only interested in the boundary components P , wherei, ji s 0 or i s a9 y a q 1 or j s 0 or j s b9 y b q 1, each of which, exceptthe corner boundary components, contains exactly one boundary vertex inBB. The reachability information of each of these four corner boundarycomponents will be represented by a star graph with a center vertex, in the

Ž . Ž .same way as in Case a or b . In addition, there will be directed edgesjoining g for the saturated v-cuts or h-cuts as shown in the example ini, jFig. 5c.

THEOREM 4.4. Gi en any rectangular p = q block with a ¨alid andsol able set of incomingroutgoing edges II j OO, the reachability graph of the

Ž .rectangular block can be constructed in O p q q time.

Proof. It is obvious that the reachability information for all cases canŽ .be properly represented by a reachability graph of size O p q q . After

Ž . Ž .finding the demands of h-cut i for 1 F i F p and ¨-cut j for 1 F j F qŽ .from the set of incomingroutgoing edges in O p q q time, one can

further determine to which case these h-cuts or v-cuts belong as well asŽ .their corresponding reachability graph in O p q q time.

4.3. Paths Construction

Lemma 4.1 provides the condition which ensures the existence of a setof edge-disjoint paths satisfying II j OO. Such a set of edge-disjoint pathscan be constructed inside the block by scanning each block vertex as wellas its adjacent edges one by one from left to right and row by row from top

Ž .to bottom. When the ith row of vertices is considered Fig. 7 , the flow onŽ .edge d , f d , for 1 F j F q, should have been determined. Note thatj j

Ž .f d ) 0 indicates a flow along the direction on edge d while a negativej jŽ . Ž .f d indicates a reverse flow. Initially, when i s 1, we have f d s 1, y1,j j

Ž .or 0 if the boundary vertex 1, j is associated with an incoming edge, anoutgoing edge, or none, respectively.

Page 17: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 353

Ž .FIG. 7. Finding edge-disjoint paths through vertex i, j .

�Ž . Ž .4Assume the set of vertices i, 1 , . . . , i, j y 1 has been considered;Ž . ŽŽ . Ž ..flow f a on edge a s i, j y 1 , i, j should have been determined.

Ž . Ž . Ž .When vertex i, j is considered, we can determine f b and f c on edgeŽŽ . Ž .. ŽŽ . Ž .. Ž .b s i, j , i q 1, j and edge c s i, j , i, j q 1 by ensuring that 1

Ž .the flow at vertex i, j is conserved, i.e., the amount of inflow equals theŽ Ž . Ž . Ž . Ž .. Ž .amount of outflow f a q f d s f b q f c , and 2 the new h-cutsj

Žand v-cuts in the remaining block are not oversaturated this ensures the.existence of edge-disjoint paths in the remaining block . A detailed de-

scription and proof of the algorithm can be found in Appendix B.

THEOREM 4.5. Gi en a rectangular p = q block with a ¨alid and sol ableset of incomingroutgoing edges II j OO, a set of edge-disjoint paths in the

Ž .block satisfying the incomingroutgoing edges II j OO can be found in O pqtime.

5. VERTEX-DISJOINT PATHS IN GRIDS

In the VDP problem, since every vertex can allow at most one path topass through, it is pertinent to consider vertex cuts, i.e., sets of verticeswhich disconnect a graph into components. Similarly to the EDP problem,we want to derive conditions for reachability. It is easy to see that, forsome sets of incomingroutgoing edges associated with a block, even whenall the vertical and horizontal vertex cuts are not oversaturated, vertex-dis-joint paths satisfying the set of incomingroutgoing edges might not exist.Consider the example given in Fig. 8. The vertex cut represented by thesequence of dots is oversaturated even though the vertical and horizontalvertex cuts are not. In the following, we shall show that the saturatedvertex cuts are always tilted and thus the study on the VDP problem willbe performed on a tilted platform accordingly.

Page 18: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN354

FIG. 8. A set of vertex-disjoint paths does not exist.

The framework of our algorithm to solve the VDP problem is similar tothat of the EDP algorithm, except that some steps need to be modified to

Ž .cope with the vertex-disjoint requirement. The differences are in 1 theŽ . Ž .definition of blocks, 2 the isolation of blocks in the grid, 3 the necessary

and sufficient conditions for the existence of vertex-disjoint paths inside aŽ . Ž .block, 4 the construction of reachability graphs, and 5 the construction

of the vertex-disjoint paths inside the blocks. In this section, we shall onlydescribe and prove the validity of these differences in the algorithm.

5.1. Tilted Rectangular Blocks

The type of block defined in the VDP problem is called a tiltedrectangular block. The shape of the blocks remains rectangular but they are

Ž . Ž .tilted at 458 to the horizontal grid line Fig. 9a . A tilted row tilted columnis a chain of vertices on a straight line tilted at an angle 458 clockwiseŽ .counterclockwise to the horizontal grid line. In particular, a set of

Ž . Ž . Ž X .vertices i, j is on a tilted row column if and only if i y j s c i q j s cŽ .where c c9 is a constant. A tilted rectangular block is a subgraph of the

grid bounded by two tilted rows and two tilted columns. In particular, atilted rectangular p = q block has the following properties:

v its four boundaries are two tilted rows and two tilted columnscorresponding to four equations i y j s c, i y j s c q p y 1, i q j s c9,and i q j s c9 q q y 1, respectively;

v its set of vertices V includes the grid vertices inside the rectangular�Ž .region bounded by the four tilted rowsrcolumns, i.e., V s i, j N c F i y j

4F c q p y 1 and c9 F i q j F c9 q q y 1 ;v Ž .the set of incomingroutgoing edges II and OO can only connect to

�Ž . Ž .its set of boundary vertices BB of the block where BB s i, j N i, j g V4and i y j s c or i y j s c q p y 1 or i q j s c9 or i q j s c9 q q y 1 ;

v Ž .the number of vertices in two different tilted rows columns maydiffer by at most one.

Page 19: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 355

Ž . Ž .FIG. 9. a Formation of a tilted rectangular block and b a block rotated at 458

counterclockwise.

For ease of visualization, imagine that tilted rectangular blocks are rotated458 counterclockwise so that the tilted rows and columns become horizon-

Ž .tal and vertical, respectively Fig. 9b . In the rest of this paper we designatea tilted rectangular block as a block and a tilted rowrcolumn as arowrcolumn unless otherwise specified.

5.2. Isolation of Tilted Rectangular Blocks

The isolation algorithm in Section 2.1 can be applied directly in thisvertex-disjoint case as long as the regular row and column are changed to atilted row and column. Figure 10a shows an example where the isolation ofa block is done in a tilted way in a grid. One more point to be mentioned isthat although the input grid is an infinite grid, it becomes a finite workinggrid after the preprocessing step. A block may not be fully inside the finiteworking grid and part of it may lie outside. However, it can be seen easilythat there is a one-to-one mapping between the boundary vertices of the

Page 20: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN356

Ž . Ž .FIG. 10. a The isolation of tilted rectangular blocks and b the execution of procedureRB-ISOLATION on a tilted grid, showing a block on the boundary of the grid.

block that are outside the grid and the actual boundary vertices of the gridŽ .Fig. 10b . That means the structure and the complexity of the block andthe corresponding reachability graph can remain unchanged.

5.3. Necessary and Sufficient Condition

Ž .A cut ¨ertex cut is defined as a set of vertices whose removal willŽ .divide the block into two or more components. In particular, h-cut i is aŽ .horizontal cut which denotes the ith row of vertices and ¨-cut j is aŽvertical cut which denotes the jth column of vertices. The capacity num-

. Ž . Ž Ž ..ber of vertices and the demand of h-cut i ¨-cut j are defined similarlyas in Section 4.1. However, special attention should be paid to the cuts thatinclude boundary vertices, because the demands of those cuts are affectedby how the incomingroutgoing edges at those boundary vertices are

Page 21: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 357

evaluated. If a cut includes a boundary vertex x, the demand of the cutwill take the maximum value by includingrexcluding the incoming edgeandror outgoing edge at x. This is because the boundary vertex x is usedby the path associated with that incomingroutgoing edge. For example, let

Ž .us consider the vertical cut, ¨-cut 7 , in Fig. 9b, which consists of twoboundary vertices, the upper one with one incoming edge and the lowerone with both incoming and outgoing edges. Excluding the incomingrout-going edges at these two boundary vertices, the demand of this v-cut is 3.

Ž .In order to achieve the maximum value, the demand of ¨-cut 7 shouldinclude the two incoming edges at the boundary vertices and exclude the

Ž .outgoing edge at the lower boundary vertex; thus, the demand of ¨-cut 7s 5, which matches the least number of paths that will pass through thecut.

We shall show in the following the necessary and sufficient conditionsfor the existence of a set of vertex-disjoint paths satisfying theincomingroutgoing edges II j OO in a tilted block. For a regular block, it isshown in Lemma 4.1 that we only need to consider those h-cuts and v-cuts

Ž .of the block Fig. 4 and any two of those edge cuts will not ‘‘intersect,’’i.e., contain any common edges. However, in a tilted block, two vertex cuts,in particular an h-cut and a v-cut, may intersect at a vertex, i.e., contain acommon vertex. Consider an example in Fig. 11a, where the two orthogo-nal dashed lines indicate an ‘‘intersecting’’ h-cut and v-cut. Since they havea vertex in common, the ‘‘combined’’ cut of the intersecting h-cut and v-cuthas one vertex less than the sum of the vertices in the two cuts. In thissituation, there exists a set of incomingroutgoing edges that only makesthis combined cut oversaturated but not any of the h-cuts or v-cuts. In Fig.

Ž11a, the combined cut consists of 11 vertices and its demand the number.of paths needed to pass through the cut is 12. This implies that there does

not exist a set of vertex-disjoint paths satisfying the incomingroutgoing

Ž . Ž .FIG. 11. a An oversaturated cross-cut and b two saturated cross-cuts.

Page 22: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN358

Ž .edges as given in Fig. 11a. A cross-cut i, j is defined as the combined cutof the vertices in the ith row and jth column of the block if the row and

Ž . Ž . Ž .column intersect at a vertex, i.e., cross-cut i, j s h-cut i j ¨-cut j ifŽ . Ž .h-cut i l ¨-cut j / B, and undefined otherwise. This is because if h-

Ž . Ž .cut i l ¨-cut j s B, the combined cut of vertices in the ith row and jthŽ .column will never be oversaturated. As usual, the capacity of cross-cut i, j

Ž .equals the number of vertices involved in cross-cut i, j , i.e., the sum of theŽ . Ž .capacities of h-cut i and ¨-cut j minus one. The demand of the cross-cut

is the difference between the number of incoming and outgoing edges inboth the top left and bottom right components. A cut is saturated if itsdemand equals its capacity and o¨ersaturated if its demand is larger thanits capacity. Given a block and set of incomingroutgoing edges, Fig. 11aillustrates the only scenario of an oversaturated cross-cut in which all theboundary vertices are associated with incomingroutgoing edges and itsdemands is exactly one more than its capacity. The next lemma will showthat in addition to h-cuts and v-cuts, cross-cuts are the only cases that needto be considered for oversaturation.

LEMMA 5.1. Gi en a tilted rectangular p = q block and a set ofincomingroutgoing edges, II and OO, there exists a set of ¨ertex-disjoint paths

Ž . Ž . Ž .satisfying II j OO if and only if all the h-cut i , ¨-cut j , and cross-cut i, jfor 2 F i F p y 1 and 2 F j F q y 1 are not o¨ersaturated.

Proof. Only if part: Obvious.

If part: If the required set of vertex-disjoint paths does not exist, thenthere must exist a vertex cut whose demand is larger than its capacity, i.e.,oversaturated. We will show that one of the cuts, i.e., h-cuts, v-cuts, orcross-cuts, will also be oversaturated. Let C be the minimal oversaturatedcut that is not an h-cut, a v-cut or a cross-cut. We ay that C is minimal inthe sense that no proper subset of C forms an oversaturated cut. Similarlyto the proof of Lemma 4.1, since C should not contain any ‘‘bends’’ asgiven in Fig. 4, the components disconnected by C are all rectangular. If Cdisconnects the block into exactly two components, similar to Lemma 4.1,one of the h-cuts or v-cuts will also be oversaturated. If C disconnects theblock into more than two components, for example in Figs. 12c and 12d, C

Ž .is not minimal and one of the h-cuts v-cuts must be oversaturated. Theother cases of C must contain a point, called the T-point, if the point is

Ž . Ž .shared by three components Fig. 12e , or the q cross -point, if the pointŽ .is shared by four components Figs. 12f and 12g .

If C contains a T-point, by the conservation of flow, not all of the threecomponents associated with the T-point have the property that the differ-ence in the number of incomingroutgoing edges, i.e., net inflowroutflow,is larger than the capacity of each component. Thus, C cannot be minimal.

Page 23: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 359

Ž . Ž .FIG. 12. Different decompositions of a block by different vertex cuts: a h-cut, b v-cut,Ž . Ž . Ž . Ž . Ž .c 2 h-cuts, d 2 v-cuts, e T-point, f q-point, and g two q-points.

In particular, in Fig. 12e, one of the three parts of C from the T-point tothe boundary is redundant.

ŽFinally, if C contains more than one q-point in particular two q-points. Ž .in Fig. 12g , the capacity number of vertices of the cut must be more than

half the number of boundary vertices of the block. That means C cannotbe oversaturated. If C has only one q-point, C can only be oversaturatedif the q-point is a common vertex intersected by an h-cut and a v-cut; i.e.,C is a cross-cut.

Similarly to the edge-disjoint version, given a set of incomingroutgoingedges, the demand of all h-cuts and v-cuts can be determined in timelinear to the number boundary vertices of the block. To incorporatecross-cut in the algorithm, we need to determine if there exist anysaturated cross-cuts in time linear in the number of boundary vertices of

Ž .the block as well. Although there are O pq cross-cuts in a p = q block,Ž .the number of saturated cross-cuts is at most two Fig. 11b .

Figure 11a gives the only scenario of incomingroutgoing edges of ablock with an oversaturated cross-cut; i.e., each component contains eitherall incoming edges or all outgoing edges but not both. In other words,there is one position on each boundary such that all boundary vertices onone side of this position are associated with incoming edges while allboundary vertices on the other side are associated with outgoing edges.The set of incomingroutgoing edges of a saturated cross-cut can be

Ž .constructed from an oversaturated cross-cut by 1 adding a new outgoingŽ .edge or deleting an existing incoming edge and 2 adding a new incoming

edge or deleting an existing outgoing edge from the set of incomingrout-going edges, in order to decrease the number of paths passing through the

Page 24: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN360

cross-cut by one. For example, in Fig. 11a, if we delete the incoming edgeu and outgoing edge w, the block contains no oversaturated cross-cut buttwo saturated cross-cuts as given in Fig. 11b. A separating position of asaturated cross-cut is the position at which the cross-cut intersects with theblock boundary. Since the set of incomingroutgoing edges of a saturatedcross-cut differs from the set of incomingroutgoing edges of an oversatu-rated cross-cut by at most a pair of incoming and outgoing edges, thepotential separating positions for the saturated cut on one boundary are atmost 5. This case can be realized when incoming edge ¨ and outgoing edge

Žw at vertex y are removed from the set of incomingroutgoing edges Fig..11a . The potential separating positions are the three boundary vertices x,

y, and z and the two positions in between. By scanning the incomingrout-going edges on a boundary, we can obtain at most five potential separatingpositions. By matching these positions on every boundary, we can deter-mine if there are any saturated cross-cuts.

5.4. Construction of Reachability Graphs

The construction of reachability graphs for blocks is the same as in theedge-disjoint case, except for the presence of saturated cross-cuts. Sincesaturated cross-cuts will not coexist with saturated h-cuts and v-cuts, weonly need to build the reachability graph to represent the saturatedcross-cuts. It can be seen in Fig. 11b that there are at most two saturatedcross-cuts in a block. Moreover, the two cross-cuts, if they exist, will sharea common rowrcolumn. In that case, six components will be formed by thecross-cuts. Similarly to the construction of a reachability graph in theedge-disjoint case, each component is represented by an internal vertexand the connection between the internal vertices does not violate thesaturated cross-cuts given in Fig. 11b. Figure 13 shows the connection of

Ž . Ž .FIG. 13. Reachability graph of a block with a 1 saturated cross-cut and b 2 saturatedŽ .cross-cuts Fig. 11b .

Page 25: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 361

FIG. 14. Construction of paths in a tilted rectangular block.

internal vertices in the reachability graphs generated from saturatedcross-cuts.

5.5. Paths Construction

Similar to the construction of paths in Section 4.3, the algorithmconsiders the vertices row by row from top to bottom. When a boundary

Ž . Ž . Ž .vertex x is considered, flows through edges y, x and x, z Fig. 14 haveŽ .to be determined. The assignment of flows depends on i flow f to y,y

Ž .where f s 0, 1, or y1, ii the existence of incoming edge f and outgoingy iŽ .edge f at x, where f , f s 0 or 1, iii the demand and capacity of v-cuto i o

Ž .through vertex x, iv the demand and capacity of h-cut through vertices yŽ . Ž .and z, v whether the cross-cut involving vertex x is saturated, and vi

whether the cross-cut involving vertices y and z is saturated. The assign-Ž .ment of flows would ensure that 1 the new h-cuts, v-cuts, and cross-cuts

Ž .in the remaining block are not oversaturated, 2 the flow at vertex x isŽ .conserved, and 3 at most one path passes through each of x, y, and z.

The idea for the assignment of flows is given below.

If the v-cut through vertex x is saturated or is part of a saturatedcross-cut,

Depending on the flow direction,make sure exactly one path is passing through x from left to right or

from right to left;Ž . Ž . Ž . Ž .i.e., f y, x s f x, z s 1 or f y, x s f x, z s y1.

If the h-cut through vertex y is saturated or is part of a saturatedcross-cut,

Ž .make sure exactly one path is passing through y, from f or f x, y .yOtherwise,

make sure the flow is conserved at vertex x.

Page 26: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN362

The correctness of the algorithm can be shown similarly as given in SectionŽ .4.3. The running time of the algorithm is also O pq .

6. CONCLUSION

wRouting problems have been studied widely by many researchers 7, 10,x16]18, 22, 23 . Much of the research is on specified routing. Given a set of

�Ž . Ž . Ž .4 Ž .nets s , t , s , t , . . . , s , t where s , t is a net such that s g SS1 1 2 2 N N i i iand t g TT with 1 F i F N, the specified routing problem is to find Nipairwise disjoint paths joining s and t , where 1 F i F N. In this paper, wei ihave investigated a particular routing problem on a rectangular grid, whichis called unspecified routing.

The unspecified routing problem is to find N disjoint paths pairingnodes in SS with nodes in TT, in the sense that a node in SS can beconnected to any node in TT as long as each node in SS is connected to adistinct node in TT. Defining TT as the set of boundary vertices of therectangular grid, this unspecified routing problem is a generalization of the

w x w xescape problem 5 , the breakout routing problem 9 in printed circuitw xboards, the single-layer fanout routing problem 24 for ball-grid array

w xpackages, and the reconfiguration problem 2, 4, 14, 19]21 on VLSIrWSIprocessor arrays in the presence of faulty processors. The algorithmspresented in this paper solve the unspecified routing problem in grids inŽ 2.5.O N time.

APPENDIX A

Preprocessing of the Grid

Ž .In the paper, we have assumed that the grid sizes, m and n, are O N .ŽHowever, this usually may not be the case. If the N nodes sources and

.sinks are sparsely located in the grid, the size of the grid enclosing theseN nodes can be arbitrarily large. In this section, we shall describe apreprocessing step which reduces the size of the grid to 2 N = 2 N byeliminating empty rowsrcolumns such that the resultant grid would retainthe same solution as the original grid. Out preprocessing step first deter-mines a reduced finite N = N grid containing all nodes such that themaximum number of disjoint paths connecting the nodes to the boundaryvertices is the same as the original embedding in the infinite grid.5 The

5We assume the boundary of the infinite grid to be the boundary of the smallest finiterectangular grid enclosing all nodes.

Page 27: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 363

Ž .second step is to provide enough space rowsrcolumns around the re-duced grid so that those boundary vertices associated with sources andsinks can be paired up by disjoint paths outside the reduced grid. Since thesize of the reduced grid in the first step is at most N = N, in the secondstep at most Nr2 columnsrrows will be added on each side of the reducedgrid; thus, the size of the working grid is at most 2 N = 2 N. Since thispreprocessing step works for vertex-disjoint paths, it works for the edge-disjoint path problem as well.

WLOG, let us first consider the removal of empty columns from thew xoriginal grid. The removal of empty rows can be done similarly. Let b, e

w xdenote a cluster of column i, b F i F e and let p b, e denote the numberw x w xof nodes in b, e . We say b, e is routable if and only if

w x w xp b , i F 2 i y b q 1 and p i , e F 2 e y i q 1Ž . Ž .for all i , b F i F e.

w xIntuitively, the nodes in a routable cluster b, e can be routed if there existŽdisjoint paths to the boundary vertices of the grid in particular, the top

. w xand bottom boundaries within columns in b, e . The two inequalitiesensure that there are enough columns on the left and right side of thecluster even when all the nodes are routed toward the same leftrright side.For example, in Fig. 15, a routable cluster would include at least columns 3

w x w x w x w xto 8, 2, 9 , 2, 8 , 3, 10 ; x, y with x F 3 and y G 8 are all routable.

LEMMA A.1. All nodes in a routable cluster that can be routed to theboundary can also be routed to the top and bottom boundary ¨ertices of thecluster.

w xProof. Consider a routable cluster c , c . For all the nodes that can be1 2routed to the boundary, we have a set of disjoint paths connecting them to

w xthe ‘‘destination’’ vertices on the four boundaries of c , c . Let us1 2consider the set of disjoint paths with the minimum number of horizontal

FIG. 15. Example of a routable cluster.

Page 28: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN364

edges; obviously, there will be no more than two destination verticesŽ . w xtoprbottom vertices on each of the columns in c , c except columns c1 2 1and c . WLOG, let us assume that column c contains more than two2 2destination vertices and that column k is the column with the maximumindex smaller than c and contains less than two destination vertices. The2routable property implies that

w xp k q 1, c F 2 c y k .Ž .2 2

w xSo there is at least one node located in cluster c , k but with its1w xdestination vertex in cluster k q 1, c . This implies at least one path2

w x w xpassing through column k from cluster c , k to k q 1, c . Therefore, we1 2can direct this path to a new destination vertex on column k and reduce

Ž .the number of horizontal edges supposed to be minimum . This leads to acontradiction.

Ž .In the following, we shall describe an O N algorithm to find a set ofdisjoint routable clusters of total width N to cover all N nodes in the grid.

w x w x ŽA cluster b, e is called right routable if for all i, b F i F e, p i, e F 2 e. w x Ž .y i q 1 . Similarly, it is called left routable if p b, i F 2 i y b q 1 for all

i, b F i F e.The basic technique to find a set of disjoint right or left routable clusters

is scanning. WLOG, the algorithm to find the right routable clusters startswith the leftmost nonempty column; i.e., the smallest indexed column

Ž .containing node s , say column b, tests each nonempty column one by onew x Ž .on its right until the first column e ) b such that p b, e F 2 e y b q 1 .

w xWe shall prove that b, e is the first right routable cluster in the set. Thealgorithm repeats itself to find the other right routable clusters by starting

w xat the first nonempty column to the right of b, e . Obviously, the algo-rithm takes linear time to find a set of disjoint right routable clusters tocover all nodes. Similarly, the left routable clusters can be found byscanning from the rightmost nonempty column.

w xLEMMA A.2. b, e is right routable.

w x w x w x ŽProof. For any b F i F e, p i, e s p b, e y p b, i y 1 - 2 e y b q. Ž . Ž . w x Ž . Ž .1 y 2 i y b s 2 e y i q 1 as p b, i y 1 ) 2 i y 1 y b q 1 s 2 i y bŽ .from the algorithm .

�w x 4LEMMA A.3. Assume b , e N 1 F i F k is a set of disjoint right routablei iw xclusters; then x, y is also a right routable cluster where e F y - b for allj jq1

1 F j F k and x F y.

w x ŽProof. We claim that for x F z F y, the number of nodes p z, y F 2 y.y z q 1 .

1. If e - z - b for some j9, the result follows.j9 j9q1

Page 29: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 365

w x2. If b F z F e for some j9, since b , e is a right routablej9 j9 j9 j9w x Ž . w x Ž .cluster, p z, e F 2 e y z q 1 . Therefore, p z, y F 2 y y z q 1 .j9 j9

�w X X x 4LEMMA A.4. Assume b , e N 1 F i F k is a set of disjoint left routablei iw x X Xclusters; then x, y is also a left routable cluster where e - x F b for allj jq1

1 F j F k and x F y.

Proof. The proof is similar to that of Lemma A.3.

w x w xWe define the operation union, j, of two clusters b , e and b , e ,1 1 2 2where b F b , as1 2

w x w x¡ b , e , b , e if e - b ,1 1 2 2 1 2~w xb , e if b F e - e ,w x w xb , e j b , e s 1 2 2 1 21 1 2 2 ¢w xb , e if e F e .1 1 2 1

For two sets of disjoint clusters C and C , we define the operation union1 2j as

w x w xC j C s b , e , where b , e g C or C .D1 2 1 2

�w x4Let RRC s b , e be the set of disjoint right routable clusters andi i�w X X x4LRC s b , e be the set of disjoint left routable clusters. We cani i

construct another set of disjoint routable clusters RC s RRC j LRC.

LEMMA A.5. RC is a set of disjoint routable clusters.

�w x4Proof. Let RC s b, e . By the definition of union, we have b s b oribX for some i and e s e or eX for some j. Moreover, eX - b F bX for alli j j k i kq1i; otherwise RC is not disjoint. Similarly, e F eX - b for all i. Then, wek i kq1have eX - b F bX for some i and e F e - bX for some j. By Lemmasi iq1 j jq1

w xA.3 and A.4, b, e is right and left routable, and hence it is routable.Therefore, RC is a set of disjoint routable clusters.

LEMMA A.6. The size of RC is at most N.

w xProof. Consider a cluster b, e g RC; assume it contains the clusters�w x 4 �w x 4b , e N i F k F j : RRC and b , e N i9 F k9 F j9 : LRC. By thek k k 9 k 9

w x Ž . Ž w xalgorithm, p b , e ) 2 e y b . Then we have e y b q 1 F p b , ek k k k k k k k.q 1 r2. Moreover, since this cluster contains at least one node, that

�w x4column containing node will be covered by a cluster in b , e . Simi-k 9 k 9

Ž w x . w xlarly, we have e y b q 1 F p b y e q 1 r2. This cluster b , ek 9 k 9 k 9 k 9 k 9 k 9

�w x4contains at least one column covered by a cluster in b , e . Thus, wek k

Page 30: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN366

have

j j9

e y b q 1 F e y b q 1 q e y b q 1Ž . Ž .Ý Ýk k k 9 k 9ksi ksi9

j y i q 1 j9 y i9 q 1y y

2 2j j9w x w xp b , e q 1 p b , e q 1k k k 9 k 9F qÝ Ýž / ž /2 2ksi ksi9

j y i q 1 j9 y i9 q 1y y

2 2

w xF p b , e .

ŽThe size of the set of disjoint routable clusters, RC, is Ý e y b qw b, e xg RC. w x1 , which is less than Ý p b, e , i.e., N.w b, e xg RC

APPENDIX B

Algorithm for Edge-Disjoint Path Construction in Rectangular Blocks

With reference to Fig. 7, in this section we exhaust the different casesŽ . Ž . Ž . Ž .on f a q f d in which we assign the flow f b and f c from vertexj

Ž . Ž .i, j . Denote h-cap the capacity of h-cut i which is q y j q 1, and ¨-capŽ .the capacity of ¨-cut j which is p y i q 1. Let h-dem be the signed

Ž . Ž .demand of h-cut i where h-dem ) 0 if paths are passing through h-cut iŽ .from top to bottom. Similarly, ¨-dem is the signed demand of ¨-cut j and

Ž .¨-dem ) 0 if paths are passing through ¨-cut j from left to right.

Ž . Ž .Case 1: f a q f d s 2.j

Ž . Ž .f b s f c s 1.Ž . Ž .Case 2: f a q f d s y2.j

Ž . Ž .f b s f c s y1.Ž . Ž .Case 3: f a q f d s 0.j

Ž . Ž .a If ¨-dem s ¨-cap or h-dem s yh-cap ,Ž . Ž .f b s y1 and f c s 1;

Ž . Ž .b If ¨-dem s y¨-cap or h-dem s h-cap ,Ž . Ž .f b s 1 and f c s y1;

Ž .c Otherwise,Ž . Ž .f b s f c s 0.

Page 31: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 367

Ž . Ž .Case 4: f a q f d s 1.j

Ž . Ž .a If ¨-dem s ¨-cap or h-dem s yh-cap q 1 ,Ž . Ž .f b s 0 and f c s 1;

Ž .b Otherwise,Ž . Ž .f b s 1 and f c s 0.

Ž . Ž .Case 5: f a q f d s y1.j

Ž . Ž .a If ¨-dem s y¨-cap or h-dem s h-cap y 1 ,Ž . Ž .f b s 0 and f c s y1;

Ž .b Otherwise,Ž . Ž .f b s y1 and f c s 0.

Ž .Proof Correctness of the Algorithm . We shall prove by induction onŽ . Ž .i, for 1 F i F p. Let h-cut9 i and ¨-cut9 j be the new cuts with respect to

Ž . Ž . Ž .h-cut i and ¨-cut j after considering the vertex i, j and let h-cap9,h-dem9, ¨-cap9, and ¨-dem9 be their corresponding capacities and demands.

Ž . Ž .Hypotheses. After we consider the vertex i, j , the new cuts h-cut9 iŽ . < <and ¨-cut9 j in the remaining block are not oversaturated, i.e., h-dem9 F

< < Ž .h-cap9 and ¨-dem9 F ¨-cap9, and the flow at vertex i, j is conserved.

Ž . Ž .Assume the hypotheses hold for the vertices i, 1 , . . . , i, j y 1 . Con-Ž . Žsider vertex i, j . Since there are many similarities in the proof of

correctness among the different cases, we show the typical arguments for.some cases only; other cases can be proved using similar arguments.

Ž Ž . Ž . . < <In Case 1 where f a q f d s 2 , we shall prove that ¨-dem9 F ¨-cap9jŽ . Ž .for the new cut ¨-cut9 j . First, consider the cut ¨-cut9 j y 1 which has

Ž .capacity p y i. Let x denote its signed demand. Since ¨-cut9 j y 1 is notŽ . Ž . Ž .oversaturated, we have x G y p y i . Moreover, as f a q f d s 2,j

Ž . Ž .¨-dem G x q 1, and thus ¨-dem y 1 G y p y i . Since ¨-cut j is also not< <oversaturated, we have ¨-dem F p y i q 1. As a result ¨-dem F p y i. By

< <the assignment of flow, ¨-dem9 s ¨-dem y 1, so ¨-dem9 F p y i s ¨-cap.< <A similar argument can also be applied to prove h-dem9 F h-cap9 in this

< < < <case and to prove ¨-dem9 F ¨-cap9 and h-dem9 F h-cap9 in Case 2Ž Ž . Ž . .where f a q f d s y2 .j

Ž Ž . Ž . . < <In Case 3 where f a q f d s 0 , we shall prove that ¨-dem9 F ¨-cap9j< <and h-dem9 F h-cap9 for the subcase where ¨-dem s ¨-cap only. The

correctness of the other subcases and the subcases in Cases 4 and 5 can beŽ .proved similarly. By the assignment of f c s 1, we have ¨-dem9 s ¨-dem

< < Ž .y 1 s p y i, and hence ¨-dem9 F ¨-cap9. For h-cut i , we claim thath-dem F q y j y 1. If h-dem G q y j, we have h-dem q ¨-dem G p q q yi y j q 1. That means the net number of incoming edges in II to the left

Ž . Ž .of ¨-cut i or on top of h-cut j is greater than p q q y i y j. However,Ž .the number of boundary vertices to the right of ¨-cut j and on top of

Page 32: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

CHAN AND CHIN368

FIG. 16. Formation of paths.

Ž .h-cut j is no greater than p q q y i y j. This makes a contradiction if theŽ .claim is not true. Moreover, since h-cut i is not oversaturated, we have

Ž . < < < <h-dem G y q y j q 1 . Therefore, we have h-dem9 s h-dem q 1 F p yj.

Ž .The conservation of flow at vertex i, j follows from the algorithmdirectly. It is also easy to see that the assignment of flow function at each

Ž .edge takes constant time and thus the whole algorithm takes O pq time.

Assuming all the vertices in the ith row have been considered where�ŽŽ . Ž .. ŽŽ .1 F i F p, the flow patterns of those edges i, 1 , i q 1, 1 , i, 2 ,

Ž .. ŽŽ . Ž ..4 Ž .i q 1, 2 , . . . , i, q , i q 1, q in the horizontal cut h-cut i for thep = q block have been determined and can be treated as the new incom-

Ž . wingroutgoing edges for the remaining p y i = q block denoted by i q 1x w x:: p = 1 :: q .

Once the flow patterns of all block edges are determined, we can followthe flow direction of each block edge to construct the set of edges-disjointpaths satisfying the incomingroutgoing edges II j OO. The edge-disjointpath corresponding to each flow pattern at each block vertex is as shown inFig. 16.

REFERENCES

1. R. K. Ahuja, T. L. Magnanti, and J. B. Orlin, ‘‘Network Flow: Theory, Algorithms andApplications,’’ Prentice Hall, Englewood Cliffs, NJ, 1993.

2. Y. Birk and J. B. Lotspiech, On finding non-intersecting straightline connections of gridŽ .points to the boundary, J. Algorithms 13 1992 , 636]656.

3. J. A. Bondy and U. S. R. Murty, ‘‘Graph Theory with Applications,’’ North-Holland,Amsterdam, 1977.

4. J. Bruck and V. P. Roychowdhury, How to play bowling in parallel on the grid, J.Ž .Algorithms 12 1991 , 516]529.

Page 33: Efficient Algorithms for Finding the Maximum Number of Disjoint Paths in Grids

FINDING DISJOINT PATHS IN GRIDS 369

5. T. H. Cormen, C. E. Leiserson, and R. L. Rivest, ‘‘Introduction to Algorithms,’’ MITPress, Cambridge, MA, 1991.

6. L. R. Ford and D. R. Fulkerson, Maximal flow through a network, Canad. J. Math. 8Ž .1956 , 399]404.

7. A. Frank, Packing paths, circuits, and cuts}A survey, in ‘‘Paths, Flows, and VLSI-Layout’’Ž .B. Korte, L. Lovasz, H. J. Promel, and A. Schrijiver, Eds. , pp. 47]100, Springer-Verlag,´ ¨Berlin, 1990.

8. M. R. Henzinger, P. Klein, S. Rao, and S. Subramanian, Faster shortest-path algorithmsŽ .for planar graphs, J. Comput. System Sci. 55 1997 , 3]23.

9. J. Hershberger and S. Suri, Efficient breakout routing in printed circuit boards, in‘‘Algorithms and Data Structures, 5th International Workshop,’’ Lecture Notes in Com-puter Science, Vol. 1272, pp. 462]471, Springer-Verlag, Berlin, 1997.

10. M. Kaufmann and K. Mehlhorn, Routing problems in grid graphs, in ‘‘Paths, Flows, andŽ .VLSI-Layout’’ B. Korte, L. Lovasz, H. J. Promel, and A. Schrijiver, Eds. , pp. 165]184,´ ¨

Springer-Verlag, Berlin, 1990.11. S. Khuller and J. Naor, Flow in planar graphs: A survey of recent results, DIMACS Ser.

Ž .Discrete Math. Theoret. Comput. Sci. 1993 , 59]84.12. S. Khuller and J. Naor, Flow in planar graphs with vertex capacities, Algorithmica 11

Ž .1994 , 200]225.13. G. L. Miller and J. S. Naor, Flow in planar graphs with multiple sources and sinks, SIAM

Ž .J. Comput. 24 1995 , 1002]1017.14. L. Palios, Connecting the maximum number of nodes in the grid to the boundary with

Ž .nonintersecting line segments, J. Algorithms 22 1997 , 57]92.15. C. H. Papadimitrious and K. Steiglitz, ‘‘Combinatorial Optimization: Algorithm and

Complexity,’’ Prentice Hall, Englewood Cliffs, NJ, 1982.16. H. Ripphausen-Lipa, D. Wagner, and K. Weihe, Efficient algorithms for disjoint paths in

Ž .planar graphs, DIMACS Ser. Discrete Math. Theoret. Comput. Sci. 1995 , 295]354.17. H. Ripphausen-Lipa, D. Wagner, and K. Weihe, The vertex-disjoint Menger problem in

Ž .planar graphs, SIAM J. Comput. 26 1997 , 331]349.18. N. Robertson and P. D. Seymour, An outline of a disjoint paths algorithm, in ‘‘Paths,

Ž .Flows, and VLSI-Layout’’ B. Korte, L. Lovasz, H. J. Promel, and A. Schrijiver, Eds. , pp.´ ¨267]292, Springer-Verlag, Berlin, 1990.

19. V. P. Roychowdhury and J. Bruck, On finding non-intersecting paths in grids and itsapplication in reconfiguring VLSIrWSI arrays, in ‘‘Proceedings of the First AnnualACM]SIAM Symposium on Discrete Algorithms, 1990,’’ pp. 454]464.

20. V. P. Roychowdhury, J. Bruck, and T. Kailath, Efficient algorithms for reconfiguration inŽ .VLSIrWSI arrays, IEEE Trans. Comput. 39 1990 , 480]489.

21. T. A. Varvarigou, V. P. Roychowdhury, and T. Kailath, Reconfigurating processor arraysusing multiple-track models: The 3-track-1-spare-approach, IEEE Trans. Comput. 42Ž .1993 , 1281]1292.

22. D. Wagner and K. Weihe, A linear-time algorithm for edge-disjoint paths in planarŽ .graphs, Combinatorica 15 1995 , 135]150.Ž .23. K. Weihe, Edge-disjoint s, t -paths in undirected planar graphs in linear time, J.

Ž .Algorithms 23 1997 , 121]138.24. M.-F. Yu and W. W.-M. Dai, Single-layer fanout routing and routability analysis for ball

grid arrays, in ‘‘Proceedings of IEEErACM International Conference on Computer-Aided Design, 1995,’’ pp. 581]586.