Shortest Vertex-Disjoint Two-Face Paths in Planar Graphs

Let $G$ be a directed planar graph of complexity $n$, each arc having a nonnegative length. Let $s$ and $t$ be two distinct faces of $G$; let $s_1,...,s_k$ be vertices incident with $s$; let $t_1,...,t_k$ be vertices incident with $t$. We give an alg…

Authors: Eric Colin De Verdi`ere (LIENS), Alex, er Schrijver (CWI)

Shortest Vertex-Disjoint Two-Face Paths in Planar Graphs
Symposium on Theoretical Aspects of Computer Science 2008 (Bordeaux), pp. 181-192 www .stacs-conf .org SHOR TEST VER TEX-DISJOI NT TW O-F A CE P A THS IN PLANAR GRAPHS ´ ERIC COLIN DE VER DI ` ERE 1 AND ALEXA NDER SCHRIJVER 2 1 Lab oratoire d’informatique ´ Ecole normale sup´ erieure, CNRS 45, rue d’Ulm 75005 Paris F rance E-mail addr ess : Eric.Colin .de.Verdiere@ens. fr URL : http://www.d i.ens.fr/~colin/ 2 Cen tru m voor Wiskunde en Informatica Kruislaan 413 1098 SJ Amsterdam Netherlands E-mail addr ess : lex@cwi.nl URL : http://homep ages.cwi.nl/~lex/ Abstra ct. Let G b e a directed planar gra p h of complexit y n , each arc ha ving a non- negative length. Let s and t b e tw o distinct faces of G ; let s 1 , . . . , s k b e vertices incident with s ; let t 1 , . . . , t k b e vertices incident w ith t . W e give an algo rithm to compu te k pair- wise vertex-disjoin t p aths connecting the pairs ( s i , t i ) in G , with minimal total length, in O ( k n log n ) time. 1. In tro du ct ion The vertex-disjoint p aths pr oblem is describ ed as follo ws: giv en an y (directed or un di- rected) graph and k pairs ( s 1 , t 1 ) , . . . , ( s k , t k ) of v ertices, find k pairwise ve r tex-disjoin t paths connecting the pairs ( s i , t i ), if they exist. This problem is we ll-known also b ecause of its motiv ation by VLSI-design. F or a fixed num b er k of pairs of terminals, this problem is p olynomial-time solv able in a directed planar graph, as sho wn by Sc h rijv er [Sc h94], and in any undir ected graph, as sho wn b y Rob ertson and Seymour [RS95]. Ho we ver, Ragha v an [Rag86] and Kramer and v an Leeu we n [K vL84] p ro ved that it is NP-hard when k is not fi xed, eve n on a planar und ir ected 1998 A CM Subje ct Classific ation: F.2.2 [Analysis of Algorithms and Problem Complexity]: Nonnumerical algorithms and problems— Computations on discr ete structur es; r outing and layout ; G.2.2 [Mathematics of Computing]: Graph theory— Gr aph algorithms; network pr oblems; p ath and cir cuit pr oblems . Key wor ds and phr ases: algorithm, planar graph, disjoin t paths, shortest path . Most of this work w as d one while the first author w as visiting the second auth or at CWI Amsterdam. c  ´ Eric Colin de V erdi ` ere and Alexander Schrijver CC  Creative Commons Attribution-NoDer ivs License 182 ´ ERIC COLIN DE VERDI ` ERE AN D ALEXANDER SCHRIJVER P S f r a g r e p l a c e m e n t s s 1 s 2 s 3 s 4 t 1 t 2 t 3 t 4 Figure 1: An instance of the problem and a solution (in b old lines). graph; it b elongs to the more general class of inte g e r multic ommo dity flow pr oblems [Sc h03, Chapter 70], man y v ariants of w hic h are NP-hard. If the graph is planar, t wo sp ecial cases are solv able in time linear in the complexit y of the graph, ev en if k is not fixed: (a) if all terminals lie on the outer face, as p ro ve d b y Suzuk i et al. [SAN90]; (b) if the terminals s 1 , . . . , s k are inciden t with a common face s , the terminals t 1 , . . . , t k are inciden t with a common face t , and the faces s and t are distinct, as prov ed by Ripphausen-Lip a et al. [RL WW96]. In th is pap er, we consider a graph where eac h edge has a nonnegativ e length, and we wish to solv e the v ertex-disjoint paths problem u sing paths with min imal total length. Of course, this is h ard er than the v ertex-disjoint p aths problem. In ca se (a), the problem is kno wn to b e solv ab le in p olynomial time (ev en if k is not fixed) if the cyclic order of the terminals is s 1 , . . . , s k , t k , . . . , t 1 (b y redu ction to the max-flo w p r oblem, after replacing eac h v ertex by t wo v ertices conn ected by an arc, so that the problem is to find arc-disjoint paths in this new graph) [vdHd P02]. Our goal is to solv e the v ertex-disjoint paths pr oblem with minimal total length in case (b). W e giv e an algorithm to do this in O ( k n log n ) time (see Figure 1): Theorem 1.1. L et G b e a planar dir e cte d gr aph with n vertic es and ar cs, e ach ar c having a nonne gative length. L et s and t b e two distinct f ac es of G ; let s 1 , . . . , s k b e vertic e s incident with s ; let t 1 , . . . , t k b e vertic es incident with t . Then we c an c ompute k p airwise vertex- disjoint p aths c onne cting the p airs ( s i , t i ) in G , with minimal total length, in O ( k n log n ) time. The v alue of k is not fixed in this result. Note th at this theorem also holds if G is an undir ected graph: simply replace every edge of this graph by t wo opp ositely directed arcs an d app ly th e p revious r esult to this n ew graph. Th e same p roblem f or non-cr ossing shortest paths, that is, p aths that are allo w ed to o v erlap alo n g v ertices and edges but not to cross in the plane, is solv able in O ( n log n ) time, as sho wn by T ak ahashi et al. [TSN96]. SHOR TEST VER TEX-DISJOINT TWO-F ACE P A THS IN PLANAR GRAPHS 183 P S f r a g r e p l a c e m e n t s s 1 s 2 s 3 s 4 t 1 t 2 t 3 t 4 Figure 2: Cons tr uction of the graph D = ( W, A ) from the graph G . The thin arcs on the rings ha v e length zero. The h igh-lev el approac h of our algorithm is the follo wing. W e fir st sho w that w e may assume without loss of generalit y that G satisfies s ome additional prop erties and trans- form G into another planar directed graph D ; in this graph, it suffices to solv e the same problem for ar c-disjoint instead of vertex- disjoint paths (S ection 2 ). Then we translate our problem in terms of flo ws in the graph D (Section 3). In Section 4, we in tro duce the residual graph and state some of its prop erties that w e will use. In Section 5, we explain how to increase the v alue of an in teger fl o w. By rep eated app lications of this algorithm, w e obtain v ertex-disjoint paths in G b et we en the terminals, but they ma y fail to connect the p airs ( s i , t i ). W e sho w that it suffices to “rotate” the fl ow a few times to change the connections b et ween the terminals (Section 6) and explain ho w to do that efficien tly (Section 7). A generalizat ion of th e notion of p oten tial allo ws us to assume that all lengths in th e residual graph are nonnegativ e, which mak es th e algorithm efficien t. 2. Preliminaries W e assume that we are giv en an em b edding of the directed graph G in the plane. More precisely , only a c ombinatorial emb e dding of G is necessary , whic h means th at the cyclic order of th e arcs around a v ertex is kno wn . W e can assu me th at G is connected and that t is the outer face of the em b edd ing of G . Up to re-indexing th e pairs ( s i , t i ), we ma y assume that s 1 , . . . , s k and t 1 , . . . , t k are in cloc kwise order: indeed, if suc h a r eordering does not exist, then there cannot exist v ertex-disjoint p aths connecting the pairs ( s i , t i ). W e ma y assu me that eac h te r minal verte x has degree one as follo ws: to eac h terminal v ertex s i (resp. t i ), attac h an arc (of length zero, f or example) ( s ′ i , s i ) (r esp . ( t i , t ′ i )) ins ide s (resp. t ), where s ′ i (resp. t ′ i ) is a new v ertex; use the s ′ i and the t ′ i as termin als, ins tead of the s i and the t i . Clearly , an y solution to the problem in this augmen ted graph yields a solution in the original grap h G . W e transform G into another d ir ected planar graph D = ( W, A ) by replacing eac h non- terminal ve r tex v of G by a small clo ckwise “ring” of arcs; see Figure 2. Eve r y arc a of D that is on no rin g corresp ond s to an arc of G and its length, λ ( a ), is the length of this arc 184 ´ ERIC COLIN DE VERDI ` ERE AN D ALEXANDER SCHRIJVER in G ; it is thus non n egativ e. T h e length λ ( a ) of an arc a on a rin g is zero. The fu nction λ is fixed in th is whole pap er. An ( s, t ) -p ath in D or G is a path from some v ertex in { s 1 , . . . , s k } to some v ertex in { t 1 , . . . , t k } ; an ( s i , t i ) -p ath is a p ath connecting some pair of terminals ( s i , t i ). Prop osition 2.1. L et P b e a minimum-length set of k vertex-disjoint ( s i , t i ) -p aths in D . Then P gives, in O ( n ) time, a minimum-length set of k vertex-disjoint ( s i , t i ) -p aths in G . If no suc h set P exists, then the original pr oblem i n G has no solution. Pr o of. Consid er suc h a set of ( s i , t i )-paths P in D . W e claim that a giv en ring r of D can b e used by at most one path in P . Indeed, since s and t are distinct faces, R 2 \ { s ∪ t } is an annulus. Since the p aths in P are vertex-disjoin t and connect s to t , ev ery p oin t of the ann ulu s that do es not b elong to a path in P is on the left of exactly one p ath and on the righ t of exactly one path in P . In particular, the center c of r is on the right of exactly one path in P . But ev ery path using r has c on its righ t, b ecause the arcs of r are oriented clockwise. This prov es the claim. Th u s, P corresp onds, in G , to k pairwise v ertex-disjoin t ( s i , t i )-w alks. Remo ving the lo ops from these walks in O ( n ) time d o es not in crease the total length and giv es a set of k v ertex-disjoint ( s i , t i )-paths in G . Con versely , an y s olution of the original vertex- d isjoin t problem in G give s a set of k v ertex-disjoint paths in D , of the same length, connecting the app ropriate pairs of terminals. So the paths obtained in the p revious paragraph hav e minimal total length; f urthermore, if no suc h set of paths P exists, then the p r oblem in G adm its no solution. So w e reduced the p roblem in G to the same problem in the graph D . The p oin t no w is that the vertice s of D ha ve degree thr ee, except the termin als, which ha ve degree one; b ecause of these degree conditions, a set of ar c -disjoint ( s, t )-paths or circuits in D is actually a set of vertex -disjoin t ( s, t )-paths or circuits in D , so we n o w ha v e to solv e a problem on ar c -d isjoin t paths. This enables a flo w ap p roac h on D , wh ic h we will d ev elop in the next s ection. 3. Flo ws and winding n um b ers In this pap er, a flow in D = ( W , A ) is an elemen t x ∈ R A suc h that: (1) for eac h arc a ∈ A , 0 ≤ x ( a ) ≤ 1; (2) for eac h non -termin al v ertex v , the follo win g flow c onservation law holds: X a | v =source ( a ) x ( a ) = X a | v =target( a ) x ( a ) . The value of a flo w x equals the tota l flow lea vin g th e vertice s s 1 , . . . , s k : if a i is the arc inciden t with s i , then the v alue of x equals P k i =1 x ( a i ). A cir culation is a flow of v alue zero. A length function (or c ost function ) κ on D is an element of R A ; λ is a length function. The length (or c ost ) of a flow x with resp ect to κ is defined to b e κ ⊤ x . An inte ger flow is a flow in { 0 , 1 } A ; it is a set of arc-disjoint ( s, t )-paths and circuits in D . Actually , by the d egree conditions on D , it is a set of vertex-disjoint ( s, t )-paths and circuits. Let A − 1 b e th e set of arcs in A with rev erse orien tation. If κ ∈ R A is a length fun ction, w e defin e the length of an arc a − 1 ∈ A − 1 to b e κ ( a − 1 ) = − κ ( a ). SHOR TEST VER TEX-DISJOINT TWO-F ACE P A THS IN PLANAR GRAPHS 185 P S f r a g r e p l a c e m e n t s s 1 s 2 s 3 s 4 t 1 t 2 t 3 t 4 +1 +1 − 1 − 1 − 1 U Figure 3: Th e path U in the d ual graph D ∗ and the corresp onding v alue of u on the arcs of D . Only th e non-zero v alues of u are ind icated, on the arcs in b old lines. Here m = m s − m t = 3 − 1 = 2. Let X ∈ R A ∪ A − 1 ; w e defin e z X ∈ R A b y z X ( a ) = X ( a ) − X ( a − 1 ). If γ is a w alk in ( W , A ∪ A − 1 ), b y a slight abuse of notation, w e define z γ to b e z X , where X ( a ) (resp. X ( a − 1 )) is the n umb er of times γ tr av els thr ough the arc a (resp. a − 1 ). Th e length of γ with resp ect to a length f unction κ is thus κ ⊤ z γ . W e now wan t to tak e in to account h ow a fl ow “turn s around” the inner face s of G . T o do this, consid er the (undirected) dual graph D ∗ of D , that is, the p lanar graph that h as one vertex f ∗ inside eac h face f of D and suc h that f ∗ 1 and f ∗ 2 are connected b y an edge e ∗ if and only if f 1 and f 2 are separated by an arc e in D ; in th at case, e ∗ crosses e b ut n o other arc of D . L et U b e a path (fixed in th is wh ole pap er) from s ∗ to t ∗ in D ∗ (Figure 3). F or eac h arc a in A , defin e u ( a ) to b e 0 if a do es not cross U , +1 if a crosses U from left to righ t, and − 1 if a crosses U from righ t to left. Th is defin es an elemen t u ∈ R A . The winding numb er of a fl o w x equals u ⊤ x , the v alue of the fl o w thr ough u coun ted algebraically . Also, for an y X ∈ R A ∪ A − 1 , the winding n umb er of X is u ⊤ z X . Let m s ∈ [1 , k ] b e such that th e fi rst arc of U is, in the cyclic order around the face s , b et ween s m s and s m s +1 mo d k . S imilarly , let m t b e suc h that the last arc of U is b et we en t m t and t m t +1 mod k . Let m = m s − m t . The follo w ing lemma will b e used rep eatedly . Lemma 3.1. L et γ b e any cir cuit in ( W , A ∪ A − 1 ) . Then the winding numb er of γ b elongs to {− 1 , 0 , +1 } . If γ encloses s in the plane, then it has winding numb er +1 if i t is clo ckwise and − 1 if it is c ounter-clo ckwise. Otherwise, γ has winding numb er 0 . Pr o of. This is a consequence of the Jord an cur v e theorem. The w inding num b er of γ is the n umb er of times the path U crosses γ from the right to the left, min u s the num b er of times U crosses γ f rom the left to the right. Assume γ is clo c kwise, the other case b eing analogous. Th e winding n umber of γ is the n umber of times U exits the region enclosed b y γ min us the num b er of times it enters th is region. If γ do es not enclose s , then b oth end p oints of U are outside γ , so the win ding n umb er is zero. If γ encloses s , the sour ce of U is inside the region enclosed by γ w hile its target is outside, so the winding n umb er is +1. 186 ´ ERIC COLIN DE VERDI ` ERE AN D ALEXANDER SCHRIJVER W e can no w reformulate our arc-disjoint p aths problem in D in terms of flows in D : Prop osition 3.2. L et x b e an inte ger flow in D of v alue k with minimal c ost su bje ct to the c ondition that its winding numb er, mo dulo k , e quals m . Then x gives, in O ( n ) time, k vertex-disjoint ( s i , t i ) -p aths in D of minimal total length. If ther e exists no such flow, then ther e do es not exi st k vertex-disjoint ( s i , t i ) -p aths in D . Pr o of. As noted ab o ve , the d egree conditions on D imply th at the fl o w x is a set of vertex - disjoin t ( s, t )-paths or circuits in D . Let γ b e a circuit in x . If γ has n on-zero win ding n umb er, then γ separates s and t , whic h implies th at x has v alue zero, a contradict ion. If γ h as winding n umb er zero, th en remo ving it fr om x yields another fl o w w ith the same prop er ties. Since w e can remov e su c h circu its in O ( n ) time, w e ma y assume that x con tains only ( s, t )-paths. By the assumption on the wind ing num b er, these p aths connect the pairs ( s i , t i ), f or i = 1 , . . . , k . F urthermore, any k verte x-disj oin t ( s i , t i )-paths in D corresp ond to a flo w in D of v alue k and of win ding num b er equ al, modu lo k , to m . It follo ws th at the paths obtained ha ve m inimal tota l length. By Prop ositions 2.1 and 3.2, to prov e Theorem 1.1, it suffices to sho w that we can, in O ( k n log n ) time, fin d an intege r flo w in D of v alue k and w ith min imal cost sub ject to the condition that its winding n umber, mo dulo k , equals m . 4. The residual graph In this sectio n, we in tr o duce the r esidual gr aph of D in the sp ecial case of in teger flo ws; it is a classical to ol for dealing with maximal flo ws and flo ws of minimal cost [Sc h03, Chapters 10–12] . Let x b e an intege r flow on D = ( W, A ). Let A x b e the subset of A ∪ A − 1 defined b y A x = { a | x ( a ) = 0 } ∪ { a − 1 | x ( a ) = 1 } . The r esidual gr aph of D with resp ect to x is the directed graph D x = ( W , A x ); it is th u s the graph obtained from D b y reve r s ing th e sign of the length and windin g num b er and the orien tation of the arcs a suc h that x ( a ) = 1. The follo wing lemma explains the interest of th e resid ual graph; the first tw o assertions are w ell-kno wn. Lemma 4.1. L et x b e an inte ger flow i n D . (i) D x has no ( s, t ) -p ath if and only if x has maximal value in D among al l flows. (ii) Assume that x has maximal value in D ; let κ b e a length function. Then D x has no ne gative-length dir e cte d cir cuit with r esp e ct to κ if and only if x has minimal c ost, with r esp e c t to κ , among al l flows in D with the same value. (iii) Assume x has maximal value in D . Then D x has no dir e cte d cir cuit with wind ing numb er one if and only if x has maximal winding nu mb er among al l flows in D with the same value. Pr o of. In these three assertions, the “if ” part is easy: If D x has an ( s, t )-path or circuit γ , then, by construction of D x , y := x + z γ is an in teger flo w in D ; its cost equ als the cost of x in D plus the cost of γ in D x ; its wind ing num b er equals the winding n umb er of x plus the winding n umb er of γ ; and its v alue equ als the v alue of x plus one if γ is a path, or th e v alue of x if γ is a circuit. SHOR TEST VER TEX-DISJOINT TWO-F ACE P A THS IN PLANAR GRAPHS 187 Con versely , let x b e an int eger flo w in D and let y b e an y flo w in D . C onsider y − x in the graph D . By construction of D x , this is a flo w in D x , in the sense that the flo w conserv ation la w holds at eac h v ertex of D (except at the terminals) and that, for eac h arc a ∈ A , w e h a ve ( y − x )( a ) ≥ 0 if a ∈ A x and ( y − x )( a ) ≤ 0 if a − 1 ∈ A x . In particular, y − x can b e written as P γ ∈ Z α γ z γ , wh ere Z is a set of ( s, t )-paths, ( t, s )-paths, an d circuits in D x , and the α γ are p ositiv e real num b ers. No w, to pro v e the “only if ” p art of (i), simply n ote that, if D x has n o ( s, t )-path, then there is no ( s, t )-path in Z ; th us, the v alue of y cannot b e greater than the v alue of x . T o pro ve the “only if ” part of (ii) and (iii), assume that x and y b oth ha ve maximal v alue in D . Then, b y (i), Z co ntains no ( s, t )-path, hence also n o ( t, s )-path, h en ce only circuits. If D x has no negativ e-length directed circu it, the cost of y is at least the cost of x ; this p ro ve s (ii). If D x has no directed circuit with winding num b er one, th en y cannot hav e winding n u m b er higher than x , for otherw ise y − x would con tain at least one circuit with p ositiv e winding n umb er, h ence with winding n umber one (Lemma 3.1). This prov es (iii). A length f unction κ is nonne gative on D x if κ is nonn egativ e on ev ery arc in A x ; th at is, for eac h a ∈ A , κ ( a ) ≥ 0 if x ( a ) = 0 and κ ( a ) ≤ 0 if x ( a ) = 1. 5. Increasing the flo w in D In this section, w e explain ho w to compute a minim um-cost flo w in D in O ( k n log n ) time. The algorithm uses only very classical minim u m-cost flow tec hn iqu es, but we ind icate it for completeness and b ecause Section 7 will u se some similar ideas. Let p ∈ Z . A p -flow is an inte ger flow in D of v alue p . Let κ and κ ′ b e t wo length functions on D ; w e write κ ≃ κ ′ if κ ⊤ z γ = κ ′⊤ z γ for eac h closed wal k γ in ( W , A ∪ A − 1 ). (This notion is equiv alen t to the notion of p otent ial.) Lemma 5.1. L et κ ≃ κ ′ . Then any minimum-c ost k - flow with r esp e ct to κ is also a minimum-c ost k -flow with r esp e ct to κ ′ . Pr o of. By Lemma 4.1(ii), a k -flo w x has minimum cost with resp ect to κ if and only if D x has no negativ e-length circuit with resp ect to κ . Since κ ≃ κ ′ , circuits in D x ha ve the same length with resp ect to κ and to κ ′ . The follo w ing result follo ws from classical minim u m-cost flo w tec h niques. Lemma 5.2. L et x b e a p -flow in D and let κ b e a length function that is nonne gative on D x . Then, in O ( n log n ) time, we c an find a ( p + 1) -flow x ′ and a length fu nction κ ′ ≃ κ that i s nonne gative on D x ′ , unless x has maximal v alue. Pr o of. W e temp orarily add to D x t wo vertice s s and t , and arcs ( s, s i ) and ( t i , t ) of length zero, for i = 1 , . . . , k . Let D ′ x b e the resulting graph. W e compu te a s hortest path tree of D ′ x with r o ot s , with resp ect to κ , in O ( n log n ) time us in g Dijkstra’s algorithm [Dij59] sp eeded up with Fib onacci h eaps [FT87], b ecause all lengths are nonnegativ e 1 . If there is no path f rom s to t in D ′ x , then D x has no ( s, t )-path, hence, by Lemma 4.1(i), x has maximal v alue. Otherwise, for eac h v ertex v of D ′ x , let d ( v ) b e the distance from s to v with resp ect to κ , as compu ted b y Dijkstra’s algorithm ab o ve. F or eac h arc a = ( u, v ) of A x , w e h a v e 1 W e could do that in O ( n ) time using the algorithm by Henzinger et al. [HKRS97], but that w ould not change th e asymptotic complexity of the entire algorithm. 188 ´ ERIC COLIN DE VERDI ` ERE AN D ALEXANDER SCHRIJVER d ( v ) ≤ d ( u ) + κ ( a ) by the triangle inequalit y , w ith equalit y if a is on the shortest path tree. F or eac h arc a = ( u, v ) of A x , let κ ′ ( a ) = κ ( a ) + d ( u ) − d ( v ); clearly , κ ′ ≃ κ . W e h av e κ ′ ( a ) ≥ 0, and κ ′ ( a ) = 0 if a is on the shortest path tree. L et γ b e th e ( s, t )-path in D x corresp ondin g to the path from s to t in D ′ x in the shortest path tree. No w, let x ′ = x + z γ ; since κ ′ is nonn egativ e on the arcs of D x and is zero on the arcs of γ , it is nonnegativ e on D x ′ . Starting w ith the zero flo w x (for which D x = D ) and the length function κ = λ , w e rep eatedly app ly Lemma 5.2. W e obta in a flow x 0 with maximal v alue p and a length function κ 0 ≃ λ suc h th at κ 0 is nonn egativ e on D x 0 . Th is tak es O ( pn log n ) = O ( k n log n ) time. If p < k , then the original problem has no solution, hence we stop here. Otherwise, Lemmas 4.1(i) and 5.1 imp ly that x 0 is a minimum-co st k -flow w ith resp ect to λ . Let w 0 b e th e w in ding num b er of x 0 . If w 0 ≡ m (mo d k ), then w e are done b y P rop ositions 2.1 and 3.2; so we henceforth assu me w 0 6≡ m (mo d k ). 6. Finding the winding n um b er A ( k , w ) -flow is an in teger flo w in D of v alue k and wind ing n umb er w . Let w 1 and w 2 b e the in tegers equal, mo dulo k , to m that are the closest to w 0 and s atisfy w 1 < w 0 < w 2 . The follo wing prop osition states that the problem b oils do wn to finding minimum-cost ( k , w )-flows, for w = w 1 and w = w 2 : Prop osition 6.1. Ther e is a minimum-c ost inte ger flow in D (with r esp e c t to λ ) of value k and winding numb er e qu al, mo dulo k , to m that is either a ( k , w 1 ) -flow or a ( k , w 2 ) -flow. Pr o of. F or eve r y integer w , let µ w b e the minimal cost of the ( k , w )-flows. (It is infinite if no ( k, w )-flo w exists.) By Lemma 4.1(iii), the set { w | µ w < ∞} is an interv al of in tegers. W e show that for ev ery integ er w suc h that µ w − 1 , µ w , and µ w +1 are finite, w e hav e 2 µ w ≤ µ w − 1 + µ w +1 . (6.1) Indeed, let x and x ′ b e minim u m -cost ( k , w − 1)- and ( k , w + 1)-flo ws, resp ectiv ely . Then x ′ − x giv es a nonn egativ e in teger circulation in D x of w inding num b er 2, i.e., a fl o w y of v alue zero in D suc h that, for eac h a ∈ A , y ( a ) ≥ 0 if a ∈ A x and y ( a ) ≤ 0 if a − 1 ∈ A x . So the supp ort of x ′ − x cont ains a directed circuit γ in D x of p ositiv e win ding n umber, hence 1. Then x + z γ and x ′ − z γ are b oth ( k , w )-flows. Thus 2 µ w ≤ λ ⊤ ( x + z γ ) + λ ⊤ ( x ′ − z γ ) = λ ⊤ x + λ ⊤ x ′ = µ w − 1 + µ w +1 , whic h prov es (6.1 ). So µ w is monotonical ly non-increasing for w ≤ w 0 and monotonica lly non-decreasing for w ≥ w 0 . Thus Prop osition 6.1 h olds. 7. Rotating the flo w in D Let κ and κ ′ b e t wo length functions on D ; w e write κ ∼ κ ′ if κ ⊤ z γ = κ ′⊤ z γ for eac h closed w alk γ with winding numb er zer o in ( W , A ∪ A − 1 ). Clearly , κ ≃ κ ′ implies κ ∼ κ ′ . Prop osition 7.1. L et κ ∼ κ ′ . Then any minimum-c ost ( k , w ) -flow with r esp e ct to κ is also a minimum-c ost ( k , w ) -flow with r esp e ct to κ ′ . SHOR TEST VER TEX-DISJOINT TWO-F ACE P A THS IN PLANAR GRAPHS 189 P S f r a g r e p l a c e m e n t s s t Figure 4: Illustr ation of Lemma 7.2: A minimal cut in H ∗ corresp onds to a circuit with winding num b er one in H . The primal graph H is d epicted in blac k lines, with thic k er lin es for the arcs of the circuit. Th e d ual graph H ∗ is d epicted in ligh t color, with thic k er lines for th e arcs of the cut. Pr o of. Let x and y b e tw o ( k, w )-flo ws in D . Then y − x is a circulation in ( W, A ∪ A − 1 ), i.e., a su m of terms of the form z γ , where γ is a circuit in ( W, A ∪ A − 1 ). F urthermore, there are as m any circuits with winding num b er +1 as with wind ing num b er − 1 in this sum. W e hav e ( κ ′ − κ ) ⊤ z γ = 0 for eve ry s uc h circuit with windin g num b er zero. Moreo ver, if γ h as windin g n umb er +1 and γ ′ has win ding num b er − 1, it follo w s from the definition of “ ∼ ” that κ ⊤ ( z γ + z γ ′ ) = κ ′⊤ ( z γ + z γ ′ ). W e th us hav e κ ⊤ ( y − x ) = κ ′⊤ ( y − x ), implying the result. W e view D as an und irected p lanar graph H ; s and t are tw o faces of H . Let H ∗ b e its dual graph. If e is an oriente d edge of H , then e ∗ is the dual edge orient ed so that e ∗ crosses e f rom righ t to left. A cut of H ∗ is a set X ∗ of oriente d edges of H ∗ suc h that an y dir ected path fr om s ∗ to t ∗ uses at least one orien ted edge of X ∗ . The follo w ing lemma is inspired by Reif [Rei83, Prop ositions 1 and 2]. See Figure 4. Lemma 7.2. L et X b e a set of oriente d e dges of H . Then X c ontains the oriente d e dges of some cir cuit with winding numb er one in H if and only if X ∗ is a cu t of H ∗ . Pr o of. If we ha ve a directed circuit γ with winding n umb er one, then its dual is a cut. Indeed, consider an ( s ∗ , t ∗ )-path π in H ∗ . The face s b elongs to the in terior of γ , while th e face t b elongs to the exterior of γ ; let e ∗ b e the first oriented edge of π that crosses γ ; its source is inside γ while its target is outside γ . By our choic e of orien tation, e b elongs to γ . Con versely , let X ∗ b e a cut of H ∗ ; w e will p ro ve that X con tains a circuit with wind ing n umb er on e. Without loss of generalit y , we m a y assum e that X ∗ is a cut that is minimal with resp ect to inclusion. First, lab el “S” a face f of H if there is, in H ∗ , a path from s ∗ to f ∗ that do es not use an y orien ted edge of X ∗ . Similarly , label “T” a f ace f of H if th er e is, in H ∗ , a path from f ∗ to t ∗ that do es not use any oriented edge of X ∗ . Sin ce X ∗ is a cut, n o face of H is lab eled b oth “S” and “T”. W e cla im that X is precisely the set of orien ted edges of H whose right face is lab eled “S” and whose left face is lab eled “T”. Clearly , suc h edges m us t b elong to X . Conv ersely , let e b e an orien ted edge of X ; by minimalit y of X , there is an 190 ´ ERIC COLIN DE VERDI ` ERE AN D ALEXANDER SCHRIJVER ( s ∗ , t ∗ )-path in H ∗ that a vo id s ( X \ e ) ∗ and uses e ∗ exactly once. Thus th e source of e ∗ is r eac hable from s ∗ without using any orien ted edge of X ∗ , and t ∗ is r eac hable from the target of e ∗ without usin g an y orien ted edge of X ∗ . This p ro ves the claim. In p articular, ev ery face of H is lab eled either “S” or “T”. Let S b e the sub set of th e plane made of the faces lab eled “S”, together with the op en edges w h ose b oth incident faces are lab eled “S”. S imilarly , let T b e the u n ion of the faces lab eled “T” toget h er with the op en edges whose b oth inciden t faces are lab eled “T”. By the previous paragraph, S and T are disjoint subsets of the plane, and they are connected. Let v b e a verte x of H . W e claim that there cannot be four faces incident with v , in this cyclic order aroun d v , th at b elong resp ectiv ely to S , T , S , and T . Th is follo ws fr om th e Jordan curve theorem: assume that w e h a ve suc h faces. Then , by connectivit y of S , there is a s imple closed curve in S ∪ { v } that go es through v and has f aces of T on b oth sides of it at v . Th is curve do es not inte rs ect T and separates T , con tradicting its conn ectivit y . The tw o previous p aragraphs together imply that either X has no edge incident with v , or X h as exactly one orient ed edge whose target is v and one orient ed edge whose sour ce is v . Thus X is a union of ve rtex-disjoint circuits. Let γ b e su c h a circuit; since S and T are connected, and since the faces on the left (resp. right) of γ are in T (resp . S ), γ has winding n umb er one. Hence X contai n s a circuit with wind ing num b er one. Prop osition 7.3. L et x b e a ( k, w ) -flow in D and let κ b e a length function that is non- ne gative on D x . Then, in O ( n log n ) time, we c an find a ( k , w + 1) -flow x ′ and a length function κ ′ ∼ κ that is nonne gative on D x ′ , unless ther e is no ( k , w ′ ) -flow with w ′ > w . Pr o of. Let e b e an orien ted edge of H ; if e co r r esp ond s to an arc a of A x , then w e define the length of e in H to b e κ ( a ) ≥ 0; otherwise, we defi n e th e length of e to b e ∞ . So a w alk in D x corresp onds to a w alk in H of the same lengt h , and a walk in H corresp onds to a wa lk in D x if and only if it has finite length. Defin e the c ap acity c ( e ∗ ) of an oriented edge e ∗ of H ∗ to b e the length of e . W e can detect in O ( n ) time whether the orient ed edges of fi nite capacit y constitute a cut in H ∗ . If this is not the case, th en ev ery cut m ust use an orien ted edge of infinite capacit y , hence, b y L emma 7.2, D x has no circuit of wind ing n umber one. It follo ws that x h as maximal win ding num b er among all k -flows, by Lemma 4.1(iii). Otherwise, w e compu te a minimal cut in H ∗ , wh ic h corresp onds to a s hortest circuit with winding num b er one in D x , as follo w s. A flow in H ∗ is a function ϕ that asso ciates, to eac h orient ed edge e ∗ of H ∗ , a real n umb er th at is n onnegativ e and no greater than c ( e ∗ ), suc h that the flo w conserv ation la w holds at eac h v ertex of H ∗ except at s ∗ and t ∗ . The value of ϕ is the tota l flo w leavi n g s ∗ . In O ( n log n ) time, we compute a flo w ϕ of maximal v alue in H ∗ with resp ect to these capacitie s, using the algo rithm b y Borradaile and Klein [BK06]. It is well- kn o wn, b y the “max-flo w min-cut” th eorem [Sc h03, Theorem 10.3], that ϕ corresp onds to a cut of minimal cost in H ∗ : the cut is the set of orien ted edges that lea ve the set of ve rtices reac hable from s ∗ b y using only orien ted edges e ∗ of H ∗ suc h that ϕ ( e ∗ ) < c ( e ∗ ) or ϕ ( e ∗− 1 ) > 0. Suc h a cut X ∗ can b e computed in O ( n ) time. Moreo ver, b y replacing all the zero capacitie s in H ∗ b y infinitesimally small capacities b efore app lying the maximal flo w al- gorithm, we ma y assume that X ∗ is a cut that is minimal with resp ect to inclusion. By Lemma 7.2, we th us obtain a circuit γ of win d ing n umb er one that has m inimal length in D x . SHOR TEST VER TEX-DISJOINT TWO-F ACE P A THS IN PLANAR GRAPHS 191 F or eac h arc a of A ∪ A − 1 , let κ ′ ( a ) = κ ( a ) − ϕ ( a ∗ ) + ϕ ( a ∗− 1 ); we h a ve κ ′ ( a ) = − κ ′ ( a − 1 ), hence th is defin es a length function. If a ∈ A x , w e ha v e ϕ ( a ∗ ) ≤ κ ( a ), so κ ′ ( a ) ≥ 0. If a b elongs to γ , w e hav e ϕ ( a ∗ ) = κ ( a ) and ϕ ( a ∗− 1 ) = 0, so κ ′ ( a ) = 0. W e claim that κ ′ ∼ κ . By the flo w conserv ation la w in H ∗ , κ ′ − κ is a linear com bination of fun ctions of the form z γ , where γ ∗ is an ( s ∗ , t ∗ )-path or a circuit in H ∗ ; s o it su ffices to pro ve th at z γ ⊤ δ = 0 f or eac h closed w alk δ w ith windin g num b er zero. But z γ ⊤ δ equals the n umb er of times δ crosses γ ∗ from left to right minus the n umb er of times δ crosses γ ∗ from righ t to left. This alw ays equals zero if γ is a circuit; if γ is an ( s ∗ , t ∗ )-path, this equ als zero b ecause δ has wind ing num b er zero (as in the pro of of Lemm a 3.1). This prov es κ ′ ∼ κ . No w, let x ′ = x + z γ . Th e length function κ ′ is nonnegativ e on the arcs of D x and is zero on th e arcs of γ , so it is nonnegativ e on D x ′ . T o conclude, recall that the k -flo w x 0 and the length f unction κ 0 ha ve b een computed in Section 5; κ 0 ∼ λ is nonnegativ e on D x 0 ; the integ er w 0 is the winding num b er of x 0 and w e hav e w 0 − k < w 1 < w 0 < w 2 < w 0 + k . Applying iterativ ely Prop osition 7.3, we can find a ( k, w 2 )-flo w x 2 and a length fun ction κ 2 ∼ λ that is nonnegativ e on D x 2 ; thus, x 2 is a ( k , w 2 )-flo w of minimal cost with resp ect to λ , b y Lemma 4.1(ii) and Prop osition 7.1; if no suc h flo w exists, we detect it during the course of th e algorithm. Simila r ly , we can find a minim u m -cost ( k, w 1 )-flo w. This tak es O ( k n log n ) time. By P r op ositions 6.1, 2.1, and 3.2, the cheapest of these tw o flo ws corresp onds to the solution. This concludes the pro of of Theorem 1.1. Conclusion W e ha v e giv en an algorithm to compute minim um-length v ertex-disjoin t paths co n - necting p rescrib ed pairs ( s i , t i ) of terminals in a planar graph, w h ere the s i and th e t i are inciden t, resp ectiv ely , with give n faces s and t . T he r unnin g time is O ( k n log n ), where k is the n umb er of pairs of terminals and n is the complexit y of the graph. W e note that the techniques dev elop ed ab ov e allo w to solv e the same problem, but fixing, in addition, the winding num b er of the set of paths (or, equiv alent ly , the h omotop y classes of the p aths in the ann ulu s R 2 \ { s ∪ t } ). Th is can b e done by computing a minimum- cost flo w in the directed graph D and by rotating the flow un til ac hieving the correct winding n umb er. S ince th e absolute v alue of th e winding n um b er of a flo w is at most n , the complexit y of the algorithm is O ( n 2 log n ). Finally , the result of this p ap er suggests some op en questions. Ho w hard is it to solve the minim um-length v ertex-disjoin t p aths in case (a) of the in tro du ction, namely , if al l terminals lie on the outer face (n ot necessarily in the order s 1 , . . . , s k , t k , . . . , t 1 )? And in the case where all the terminals lie on t wo faces, but a p ath ma y ha ve its tw o endp oints on the same face ? The pr oblem extends to v ertex-disjoint tr e es whose lea v es are fixed on t wo faces of the graph (suc h trees, not necessarily of minimal length, can b e computed efficien tly [SAN90]). Also, do es our problem remain p olynomial-time solv able if eac h of the terminals has to b e incident with one of p pr escrib ed faces of the graph, if p is fixed? What ab out the same problem for a graph embedd ed on a su rface of fixed gen u s? 192 ´ ERIC COLIN DE VERDI ` ERE AN D ALEXANDER SCHRIJVER Ac knowled gemen t s W e would like to thank Dion Gijswijt and G ¨ unt er Rote for stim u lating discussions. References [BK06] G. Borradaile and P . Klein. An O ( n log n ) algorithm for maximum st -flow in a directed pla- nar graph. In Pr o c e e dings of the 17th Annual A CM -SIAM Symp osium on Discr ete Algorithms (SOD A) , p ages 524–533, 2006. [Dij59] E. W. D ijkstra. A note on tw o problems in connexion with graphs. Numerische Mathematik 1 , pages 269–271 , 1959. [FT87] M. L. F redman and R. E. T arjan. Fib onacci heaps and their u ses in impro ved n etw eok optimiza- tion algorithms. Journal of the Asso ciation for Computing Machinery , 34:596–615, 1987. [HKRS97] M. Henzinger, P . Klein, S. Rao, and S. Su bramanian. F aster sh ortest-path algorithms for planar graphs. Journal of Computer and System Scienc es , 55(1, part 1):3–23, 1997. [KvL84] M. R. Kramer and J. v an Leeuw en. The complexity of wire-routing and fin ding minimum area la youts for arbitrary V LSI circuits. In F. P . Preparata, editor, VLSI-The ory , vol um e 2 of A d- vanc es i n Computing R ese ar ch , pages 129–146 . JAI Press, Greenwic h, Connecticut, 1984. [Rag86] P . Ragha va n. Ra ndomi ze d r ounding and discr ete ham-sandwich the or ems: pr ovably go o d algo- rithms for r outing and p acking pr oblems . PhD thesis, Universi ty of Califo rnia, Berkele y , Califor- nia, 1986. Rep ort No. UCB/CSD 87/312. [Rei83] J. H. Reif. M inimum s − t cut of a planar undirected net work in O ( n log 2 ( n )) time. SIAM Journal on Computing , 12(1):71–81 , 1983. [RL WW96] H. R ipphausen-Lipa, D. W agner, and K. W eihe. Linear-time algorithms for disjoin t tw o-face paths problems in p lanar graphs. I nternational Journal of F oundations of Computer Scienc e , 7(2):95–11 0, 1996 . [RS95] N. Rob ertson an d P . D. Seymour. Graph minors. XI I I: t he disjoin t paths p roblem. Journal of Combinatorial T he ory, Series B , 63(1):65–1 10, 1995. [SAN90] H. Suzuki, T. Ak ama, and T. Nishizeki. Finding Steiner forests in planar graphs. In Pr o c e e dings of the 1st Annua l ACM-SIAM Symp osium on D i scr ete Algorithms (SOD A) , pages 444– 453, 1990. [Sch94 ] A. Sc hrijver. Finding k d isjoin t paths in a d irected p lanar graph. SIAM Journal on Computing , 23(4):780– 788, 1994. [Sch03 ] A. Sc hrijver. Combinatorial optimization. Polyhe dr a and efficiency , vo lume 24 of A lgorithms and Combinatorics . Springer-V erlag, 2003. [TSN96] J. T ak ahashi, H. Su zu ki, and T. N ishizeki. Shortest noncrossing paths in plane graphs. Algo- rithmic a , 16:339–3 57, 1996. [vdHdP02] H. van der Holst and J. C. d e Pina. Length-b ounded disjoin t paths in planar graphs. Discr ete Applie d M athematics , 120(1–3):251–2 61, August 2002. This wor k is licensed unde r the Creative Commons Attribution-NoDer ivs License. T o view a copy of this license, visit http://c reativecommons.org/licenses/by- nd/3.0/ .

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment