s 1 t 4 s 2 4 t 2 a b r 2 r 8 r10 g 4

Similar documents
Paradigm 5. Data Structure. Suffix trees. What is a suffix tree? Suffix tree. Simple applications. Simple applications. Algorithms

10.2 Graph Terminology and Special Types of Graphs

COMP108 Algorithmic Foundations

If you are at the university, either physically or via the VPN, you can download the chapters of this book as PDFs.

What are suffix trees?

Convex Hull Algorithms. Convex hull: basic facts

2 Computing all Intersections of a Set of Segments Line Segment Intersection

Width and Bounding Box of Imprecise Points

12/9/14. CS151 Fall 20124Lecture (almost there) 12/6. Graphs. Seven Bridges of Königsberg. Leonard Euler

Final Exam Review F 06 M 236 Be sure to look over all of your tests, as well as over the activities you did in the activity book

Lesson 4.4. Euler Circuits and Paths. Explore This

Ma/CS 6b Class 1: Graph Recap

Lecture 13: Graphs I: Breadth First Search

CS 241 Week 4 Tutorial Solutions

CS 551 Computer Graphics. Hidden Surface Elimination. Z-Buffering. Basic idea: Hidden Surface Removal

Adjacency. Adjacency Two vertices u and v are adjacent if there is an edge connecting them. This is sometimes written as u v.

Ma/CS 6b Class 1: Graph Recap

Greedy Algorithm. Algorithm Fall Semester

Lecture 8: Graph-theoretic problems (again)

MITSUBISHI ELECTRIC RESEARCH LABORATORIES Cambridge, Massachusetts. Introduction to Matroids and Applications. Srikumar Ramalingam

Problem Final Exam Set 2 Solutions

Calculus Differentiation

Internet Routing. IP Packet Format. IP Fragmentation & Reassembly. Principles of Internet Routing. Computer Networks 9/29/2014.

Duality in linear interval equations

Chapter 4 Fuzzy Graph and Relation

Chapter 9. Greedy Technique. Copyright 2007 Pearson Addison-Wesley. All rights reserved.

8.2 Areas in the Plane

Tight triangulations: a link between combinatorics and topology

Line The set of points extending in two directions without end uniquely determined by two points. The set of points on a line between two points

Computational geometry

Minimal Memory Abstractions

Journal of Combinatorial Theory, Series A

V = set of vertices (vertex / node) E = set of edges (v, w) (v, w in V)

A dual of the rectangle-segmentation problem for binary matrices

Lecture 12 : Topological Spaces

CS553 Lecture Introduction to Data-flow Analysis 1

Outline. Motivation Background ARCH. Experiment Additional usages for Input-Depth. Regular Expression Matching DPI over Compressed HTTP

MTH 146 Conics Supplement

Suffix trees, suffix arrays, BWT

Outline. Introduction Suffix Trees (ST) Building STs in linear time: Ukkonen s algorithm Applications of ST

Distance vector protocol

a c = A C AD DB = BD

COMP 423 lecture 11 Jan. 28, 2008

Tries. Yufei Tao KAIST. April 9, Y. Tao, April 9, 2013 Tries

Geometric Algorithms. Geometric Algorithms. Warning: Intuition May Mislead. Geometric Primitives

Geometrical reasoning 1

The Greedy Method. The Greedy Method

3D convex hulls. Convex Hull in 3D. convex polyhedron. convex polyhedron. The problem: Given a set P of points in 3D, compute their convex hull

Honors Thesis: Investigating the Algebraic Properties of Cayley Digraphs

Compact Drawings of 1-Planar Graphs with Right-Angle Crossings and Few Bends

CMPUT101 Introduction to Computing - Summer 2002

The Network Layer: Routing in the Internet. The Network Layer: Routing & Addressing Outline

INTEGRATED WORKFLOW ART DIRECTOR

F. R. K. Chung y. University ofpennsylvania. Philadelphia, Pennsylvania R. L. Graham. AT&T Labs - Research. March 2,1997.

Single-Layer Trunk Routing Using 45-Degree Lines within Critical Areas for PCB Routing

Information Retrieval and Organisation

Outline. CS38 Introduction to Algorithms. Graphs. Graphs. Graphs. Graph traversals

Graphs with at most two trees in a forest building process

Tiling Triangular Meshes

CS453 INTRODUCTION TO DATAFLOW ANALYSIS

Introduction to Algebra

Research Article Determining Sensor Locations in Wireless Sensor Networks

CS311H: Discrete Mathematics. Graph Theory IV. A Non-planar Graph. Regions of a Planar Graph. Euler s Formula. Instructor: Işıl Dillig

Quadrilateral and Tetrahedral Mesh Stripification Using 2-Factor Partitioning of the Dual Graph

Midterm Exam CSC October 2001

Intermediate Information Structures

A Tautology Checker loosely related to Stålmarck s Algorithm by Martin Richards

Parallelization Optimization of System-Level Specification

Position Heaps: A Simple and Dynamic Text Indexing Data Structure

Graph theory Route problems

Distributed Systems Principles and Paradigms. Chapter 11: Distributed File Systems

Distributed Systems Principles and Paradigms

Augmenting Sux Trees, with Applications Yossi Matias 1?, S. Muthukrishnan 2??,Suleyman Cenk Ṣahinalp 3???, and Jacob Ziv 4 y 1 Tel-Aviv University, an

Can Pythagoras Swim?

Tracking Hidden Agents Through Shadow Information Spaces

McAfee Web Gateway

Lily Yen and Mogens Hansen

COSC 6374 Parallel Computation. Non-blocking Collective Operations. Edgar Gabriel Fall Overview

4.3 Balanced Trees. let us assume that we can manipulate them conveniently and see how they can be put together to form trees.

A METHOD FOR CHARACTERIZATION OF THREE-PHASE UNBALANCED DIPS FROM RECORDED VOLTAGE WAVESHAPES

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2: Solutions. Please write your name in the upper corner of each page.

MA1008. Calculus and Linear Algebra for Engineers. Course Notes for Section B. Stephen Wills. Department of Mathematics. University College Cork

Doubts about how to use azimuth values from a Coordinate Object. Juan Antonio Breña Moral

PLANE 3-TREES: EMBEDDABILITY & APPROXIMATION

Suffix Tries. Slides adapted from the course by Ben Langmead

In the last lecture, we discussed how valid tokens may be specified by regular expressions.

Lecture 7: Integration Techniques

called the vertex. The line through the focus perpendicular to the directrix is called the axis of the parabola.

6.3 Volumes. Just as area is always positive, so is volume and our attitudes towards finding it.

String comparison by transposition networks

SOFTWARE-BUG LOCALIZATION WITH GRAPH MINING

and vertically shrinked by

The Fundamental Theorem of Calculus

FASTEST METHOD TO FIND ALTERNATIVE RE-ROUTE

PROBLEM OF APOLLONIUS

Graph Searching & Perfect Graphs

Product of polynomials. Introduction to Programming (in C++) Numerical algorithms. Product of polynomials. Product of polynomials

From Indexing Data Structures to de Bruijn Graphs

Containers: Queue and List

5 ANGLES AND POLYGONS

Transcription:

k-pirs Non-Crossing Shortest Pths in Simple Polgon Evnthi Ppdopoulou Northwestern Universit, Evnston, Illinois 60208, USA Astrt. This pper presents n O(n + k) time lgorithm to ompute the set of k non-rossing shortest pths etween k soure-destintion pirs of points on the oundr of simple polgon of n verties. Pths re llowed to overlp ut re not llowed to ross in the plne. A produt of this result is n O(n) time lgorithm to ompute lned geodesi tringultion whih is es to implement. The lgorithm extends to simple polgon with one hole where soure destintion pirs m pper on oth the inner nd outer oundr of the polgon. In the ltter se, the gol is to ompute olletion of non-rossing pths of minimum totl ost. 1 Introdution The k-pirs non-rossing shortest pth prolem in simple polgon is dened s follows. Given simple polgon P of n verties nd k soure-destintion pirs of points (s i ; t i ); i = 1; : : : ; k, long the oundr of P, nd the olletion of k non-rossing shortest pths onneting ever pir (s i ; t i ) tht lie entirel in P. Non-rossing pths re llowed to overlp i.e., shre verties or edges, ut the re not llowed to ross eh other. Note tht if the soure-destintion pirs re ritrril loted on the polgon oundr there need not e n set of non-rossing pths etween them. In the se where P ontins hole nd the k soure-destintion pirs of points m pper in oth the outer nd the inner oundr of P the prolem is to ompute the olletion of k non-rossing pths whose totl length is minimum. The non-rossing shortest pth prolem ws introdued D.T. Lee in [7]. In [12] Tkhshi et l onsidered the following prolem: Given n undireted plne grph with nonnegtive edge lengths, nd k terminl pirs on two speied fe oundries, nd k non-rossing pths in G, eh onneting terminl pir, whose totl length is minimum. The presented n O(n log n) time lgorithm, where n is the totl numer of verties in the grph (inluding terminl pirs), using divide nd onquer. In susequent pper [11, 10], Tkhshi et l onsider the non rossing shortest pth prolem in polgonl domin of n retngulr ostles nd the L 1 metri nd provide n O((n+k) log(n+k)) time lgorithm. Motivtion for non-rossing shortest pth prolems omes from VLSI lout design (see [7, 10, 12, 11]). In the se of simple polgon or simple polgon with one hole, we n otin n O(k + n log k) time lgorithm using divide nd onquer pproh

similr to [12, 11] nd the O(n) time lgorithm of Lee nd Preprt[8] for the single pir shortest pth prolem in simple polgon. Alterntivel, for simple polgon without holes, the prolem n e solved nswering k shortest pth queries using the dt struture of Guis nd Hersherger [4]. The dt struture of [4] n e onstruted in O(n) time nd spe nd n nswer shortest pth queries etween pirs of points in simple polgon in O(log n + l) time where l is the numer of links of the shortest pth. In this pper we present n O(n + k) time lgorithm for the k pirs nonrossing shortest pth prolem in simple polgon nd polgon with one hole. The olletion of non-rossing shortest pths is orgnied in forest tht llows shortest pth queries etween n given pir to e nswered in time proportionl to the sie of the pth. We lso mke n oservtion tht n redue the time omplexit of the lgorithm of Tkhshi et l [11, 10] from O((n + k) log(n + k)) to O(k + n log n). (Note tht k n e lrge ompred to n.) A produt of our lgorithm is simple O(n) method for omputing lned geodesi tringultion of simple polgon. A lned geodesi tringultion is deomposition of simple polgon into tringle-like regions, lled geodesi tringles, with the propert tht n line segment interior to P rosses onl O(log n) geodesi tringles [2, 3]. Suh deomposition nds often pplition in prolems involving simple polgons e.g., r shooting or shortest pth queries [2, 3] nd n e omputed in O(n) time [2]. The ide is to ompute the olletion of shortest pths etween the following pirs of verties (v 1 ; v n=3 ); (v n=3 ; v 2n=3 ); (v 2n=3 ; v 1 ); (v 1 ; v n=6 ); (v n=6 ; v n=3 ); (v n=3 ; v n=2 ), et. until pir onsists of onseutive verties. Our O(n) time lgorithm for omputing the olletion of non-rossing shortest pths mong the ove O(n) pirs of verties gives n lterntive method for omputing lned geodesi tringultion whih is simple to implement. In generl, olletion of non-rossing shortest pths etween pirs of points on the oundr of simple polgon n e used to otin useful polgon deompositions inluding in the deomposition shortest pths etween ertin oundr points. 2 Preliminries Let P e simple polgon nd let @P e its oundr. Given two points x; 2 P, (x; ) denotes the shortest pth from x to tht lies entirel in P. (x; ) is ssumed to e direted from x to. We re given set of k soure-destintion pirs long @P, ST = f(s i ; t i ); 1 i kg. We shll dopt the onvention tht soures s i ; 1 i k, re ordered lokwise long @P nd tht for n pir, s i ppers efore t i when we trverse @P lokwise strting t s 1. Soure s 1 is regrded s the strting point long @P. Unless otherwise noted, we ssume lokwise trversl of @P strting t s 1. Let @P e mpped onto unit irle. Then the k soure-destintion pirs of points get mpped to k irle hords, s i t i ; i = 1; : : : ; k. Figure 1 shows the mpping. If hord s i t i intersets s j t j then lerl (s i ; t i ) nd (s j ; t j ) must ross eh other. We s tht pirs (s i ; t i ) nd (s j ; t j ) re non-rossing, if nd onl if the orresponding hords in the unit irle s i t i nd s j t j do not interset. For

exmple, in gure 1, pirs (s 1 ; t 1 ); (s 2 ; t 2 ); (s 3 ; t 3 ) nd (s 5 ; t 5 ) re non-rossing while pirs (s 4 ; t 4 ) nd (s 5 ; t 5 ) re rossing. It is not diult to see tht shortest pths etween two pirs of points in ST re non-rossing if nd onl if the pirs re themselves non-rossing. s3 s 4 t 2 t 3 s5 t 4 s1 t5 t s 1 3 s 2 s 2 t 1 t 3 s4 t2 s5 t 4 Fig. 1. Mpping of k soure-destintion pirs of verties into k hords on the unit irle. slie t 5 s1 Lemm 1. Given simple polgon P of n verties nd k soure-destintion pirs long @P, (s i ; t i ); 1; : : : ; k, deteting if n two shortest pths onneting s i to t i ross eh other n e done in O(n + k) time. Given the unit irle representing @P nd pir (s i ; t i ), the region of the unit irle enlosed the hord s i t i nd the r from s i to t i is referred to s slie nd is denoted s sl(s i ; t i ). (A lokwise trversl is ssumed.) For the pir (s 1 ; t 1 ) we dene two slies, sl(s 1 ; t 1 ) nd sl 0 (s 1 ; t 1 ), where sl 0 (s 1 ; t 1 ) is the omplement of sl(s 1 ; t 1 ) i.e., the region of the unit irle enlosed the hord s i t i nd the r from t 1 to s 1. In gure 1, sl(s 1 ; t 1 ) is shown shded. Note tht pths (s i ; t i ) nd (s j ; t j ) re non-rossing if nd onl if the orresponding slies, sl(s i ; t i ) nd sl(s j ; t j ), do not interset or one of them totll ontins the other. In the former se, the two non-rossing pirs re sid to e in series, nd in the ltter, the re sid to e in prllel. The destintion points of pirs tht re in prllel re in reverse order s the soure points. Figure 2 shows n exmple of set of non-rossing slies; slies sl(s 1 ; t 1 ); sl(s 3 ; t 3 ); sl(s 6 ; t 6 ) re in series while sl(s 1 ; t 1 ); sl(s 2 ; t 2 ) re in prllel. Consider now tree, T sl, representing the set of non-rossing slies where the root orresponds to the unit disk nd eh node represents slie. The hildren of the root re sl(s 1 ; t 1 ) nd sl 0 (s 1 ; t 1 ). Slies tht re totll ontined in sl(s i ; t i ) re desendnts of sl(s i ; t i ) in the tree. The immedite hildren of sl(s i ; t i ) (resp. sl 0 (s 1 ; t 1 )) re those slies in series tht re totll ontined in sl(s i ; t i ) (resp. sl 0 (s 1 ; t 1 )) ut re not ontined in n other desendent of sl(s i ; t i ). Figure 2 shows the tree representtion of the orresponding slies. The nodes re leled the slie numer; slie 0 refers to the unit disk. Note tht T sl m e lned or ompletel unlned. Let R e the set of ll points in ST. We ssume tht R is ordered ording to lokwise trversl of @P strting t r 1 = s 1. Given n two points x; long @P, we s tht follows x, nd denote s x <, if nd onl if follows x in lokwise trversl of the polgon oundr strting t s 1. Given R 0 R

t3 t 5 s 5 t 4 s 6 t6 s 1 3 1 6 0 1 2 s 4 s 3 t 1 t 2 s 2 4 5 Fig. 2. Non-rossing slies nd the tree representtion. nd r j 2 R 0, let n R 0(r j ) denote the point in R 0 following r j nd p R 0(r j ) denote the point in R 0 preeding r j. For R 0 = R, n R (r j ) = r j+1 nd p R (r j ) = r j 1. Let R 0 R e suh tht the shortest pths etween n two pirs of distint points re disjoint. The re enlosed the olletion of (r j ; n R 0(r j )) for ever r j 2 R 0 is lled the geodesi polgon indued R 0. In gure 3, the shded re is the geodesi polgon indued R 0 = fr 1 ; r 4 ; r 6 ; r 7 ; r 10 g. The lst ommon vertex long (r j ; n R 0(r j )) nd (r j ; p R 0(r j )) is n pex of the geodesi polgon, nd is denoted s (r j ). If r j is the onl ommon point of (r j ; n R 0(r j )) nd (r j ; p R 0(r j )) then (r j ) = r j. In gure 3, (r 4 ) = nd (r 1 ) = r 1. The ommon prt of (r j ; n R 0(r j )) nd (r j ; p R 0(r j )) (i.e., (r j ; (r j ))) is referred to s the geodesi link of r j. Two onseutive pexes of the geodesi polgon, (r j ) nd (n R 0(r j )), re joined their shortest pth, ((r j ); (r j+1 )), whih is lerl onvex hin with onvexit fing towrds the interior of the geodesi polgon. r10 r 1 r2 r3 r4 r10 r r 2 1 g 1 g 2 r3 r4 r 9 r8 r7 r5 r6 r9 r 8 g 4 g 3 e d r7 r5 r6 Fig. 3. The geodesi polgon indued R 0 = fr 1 ; r 4 ; r 6 ; r 7 ; r 10 g. Fig. 4. The geodesi deomposition of R = fr 1 ; : : : ; r 10 g. If R 0 ontins pirs of distint points whose shortest pths shre some ommon prt, the olletion of (r j ; n R 0(r j )) indues more thn one geodesi polgon in P. In gure 4, set R = fr 1 ; : : : ; r 10 g indues four geodesi polgons g 1 ; g 2 ; g 3 ; g 4, where g 1 = fr 1 ; ; r 5 ; r 6 ; ; r 10 g, g 2 = f; r 2 ; r 3 ; g, g 3 = fd; e; r 9 g, nd g 4 = fe; r 7 ; r 8 g. Two pths (r i ; n R 0(r i )) nd (r j ; n R 0(r j )), j > i + 1, tht re not disjoint shre supth of t lest one vertex whih is referred to s geodesi link. For exmple in gure 4, segment d is ommon to (r 6 ; r 7 ) nd (r 9 ; r 10 ) i.e., d is geodesi link. Note tht geodesi link m onsist of single vertex in whih se the inident geodesi polgons hve ommon pex

(e.g., vertex in gure 4). The olletion of geodesi polgons nd links indued (r i ; n R 0(r i )) for ever r i 2 R 0 is lled the geodesi deomposition of P indued R 0 nd is denoted s (R 0 ). In gure 4, the geodesi deomposition of R onsists of four geodesi polgons g 1 ; g 2 ; g 3 ; g 4, The geodesi link joining g 1 nd g 2 is vertex, the geodesi link joining g 1 nd g 3 is (; d) = d nd the geodesi link joining g 3 nd g 4 is vertex e. The geodesi link of r 4 is (r 4 ; ). For ever r j ; j 6= 4, (r j ) = r j, nd (r 4 ) =. Apex (r 1 ) is onsidered to e the root of the geodesi deomposition. This indues unique direted pth from the root to ever geodesi polgon whih denes prent-hild reltion etween the geodesi polgons. The pex of geodesi polgon g inident to its prent is lled the min pex of g nd is denoted s (g). Given geodesi polgon g nd r j 2 R 0 let (r j ; g) e the pex of g tht elongs to ((g); r j ). (If g ontins (r j ) then (r j ; g) = (r j )). In gure 4, (r 4 ; g 1 ) = nd (r 4 ; g 3 ) = d. Given vertex v long onvex hin C nd point p, we s tht v is supporting (with respet to pv) or tht segment pv is supporting to C if the line ontining pv is tngent to C. 3 The Algorithm The olletion of shortest pths etween ever pir of points in ST (given tht ST is non-rossing) forms forest denoted s E. Our lgorithm omputes E in O(n + k) time nd proesses it to nswer shortest pth queries etween n pir in ST in time proportionl to the length of the pth. In prtiulr, n tree of E n e trnsformed into rooted tree ssigning the soure of minimum index s the root. Let n E (s i ; t i ); (s i ; t i ) 2 ST, denote the nerest ommon nestor of s i nd t i in E. (Note tht s i nd t i must elong to the sme tree of E.) Then (s i ; t i ) = (s i ; n E (s i ; t i ) [ (n E (s i ; t i ); t i ). Computing the nerest ommon nestor in E for ever pir (s i ; t i ) 2 ST n e esil done in liner time in ottom-up fshion using T sl s guide. If ll soure-destintion pirs re in series, we n esil ompute the olletion of shortest pths etween them in liner time using n ordinr shortest pth lgorithm for single pir of points[8, 1, 5]. In prtiulr, we n use the Lee-Preprt lgorithm [8] for eh pir independentl. The following lemm ssures tht the time omplexit remins liner. Lemm 2. The olletion of non-rossing shortest pths etween k soure-destintion pirs of points on @P n e found in liner time if the pirs re in series. In generl, we ompute E in ottom-up fshion using the tree of slies, T sl, s guide. In phse 1, we ompute the geodesi deomposition of P indued R. This revels the olletion of (s i ; t i ) for ever pir (s i ; t i ) t lef node of T sl. For n pir (s i ; t i ) t the ottom level of T sl, we olor ll edges long (s i ; t i ) red, nd dd them to E. The remining edges of the geodesi deomposition re ssumed to e white. Let R q, for 1 q h, where h is the height of T sl, denote the set of points ppering t levels 1 to (h q +1) in T sl. Note tht R 1 = R nd

R h = fs 1 ; t 1 g. In phse q, 1 < q h, we ompute the geodesi deomposition of P indued R q whih revels the olletion of (s i ; t i ) for ever pir (s i ; t i ) t level (h q + 1) of T sl. Edges of the deomposition t phse q re either red or white. Red edges re those tht hve een dded to E in some previous phse. At the end of phse q, we dd ll white edges long (s i ; t i ) to E nd olor them red, for ever pir (s i ; t i ) t level (h q + 1) of T sl. At ever phse q; 1 q h, the geodesi deomposition of R q is mintined. Geodesi polgons nd links re kept s doul linked list of their verties. In generl, n pex is djent to two verties in its geodesi polgon nd one vertex in the inident geodesi link. An exeption re pexes tht re ommon to two geodesi polgons (e.g. pex in gure 4), whih re inident to two verties in eh of the inident geodesi polgons. Edges of geodesi polgons nd geodesi links re mrked s red or white, where ll red edges hve een inluded in E. In order to hve the ilit to extrt the white edges of (s i ; t i ) for some pir (s i ; t i ) t level (h q+1) of T sl without visiting the red edges long (s i ; t i ), we lso mintin doul linked list of the polgon verties inident to white edges, referred to s the white-list. The white-list inludes (r j ) for ever r j 2 R q. Two verties v; u in the white-list re joined link if nd onl if v nd u elong to the shortest pth from (r j ) to (n R q (r j )) nd either vu is white edge or (v; u) is mximl red supth of ((r j ); (n R q (r j ))). Ever link of the white-list orresponds either to white edge of the deomposition, referred to s white link, or to mximl sequene of red edges, referred to s red link. Note tht white edge long geodesi link ppers twie in the white-list nd thus eh of the inident verties lso ppers twie. Let's onsider the geodesi deomposition of phse 1, i.e., the geodesi deomposition of R. Pirs (r i ; r i+1 ); 1 i 2k, re lerl in series nd therefore the olletion of (r i ; r i+1 ) n e omputed in O(n + k) time (lemm 2). One (r i ; r i+1 ) for ever i; 1 i 2k, hve een omputed, the geodesi deomposition of P n e esil otined in liner time. For ever pir of points (s i ; t i ) t the ottom level of T sl, we olor edges long (s i ; t i ) red nd dd them to E. We lso uild the white list simple sn strting t (r 1 ). To ompute the geodesi deomposition of R q ; q > 1, we use the geodesi deomposition of R q 1. To filitte updting we use the shortest pth tree from s 1 to ll points in R. Computing the shortest pth tree from s 1 n e done in liner time using the lgorithm of Guis et l [5] or the simpler to implement lgorithm of Hersherger nd Snoeink [6]. Given two points r i ; r j 2 R, the nerest ommon nestor of r i nd r j in the shortest pth tree from s 1 is denoted s n(r i ; r j ). Suppose tht the geodesi deomposition of P indued R q 1 hs een omputed, nd tht we wnt to ompute the geodesi deomposition indued R q. Let R 0q = R q 1 R q. For revit, we will use n(r j ) to denote n R q(r j ), p(r j ) to denote p R q(r j ), nd to denote the geodesi deomposition during phse q. At the end of phse q, = (R q ). Consider r j 2 R q suh tht n(r j ) 6= n R q 1(r j ). Sine r j nd n(r j ) re neighoring points in R q, we need to ompute ((r j ); (n(r j ))) nd updte the geodesi deomposition. For this purpose we inrementll ompute ((r j ); (r i ))

for ever r i 2 R 0q [ fn(r j )g with r j < r i n(r j ), updting t the sme time the geodesi deomposition. Suppose tht ((r j ); (r i )) hs een omputed for some r i 2 R 0q ; r j < r i < n(r j ), nd tht the geodesi deomposition hs een updted ordingl. i.e., = (R q [ fr 2 R q 1 ; r r i g). It is enough to updte the geodesi polgon g tht ontins (r i ) ording to ((r j ; g); (r l ; g)). (g) l j i (g) 5 4 j 3 2 1 i l Fig. 5. ((g); j ; i ; l ) Fig. 6. The updte of g in se 3. Let j ; i nd l denote (r j ; g); (r i ) nd (r l ; g) respetivel. Note tht j or l m oinide with the min pex of g. Consider the geodesi deomposition indued f(g); j ; i ; l g, denoted s ((g); j ; i ; l ). If (g) = j or (g) = l, ((g); j ; i ; l ) must form geodesi tringle (i.e., hve three pexes). Otherwise, ((g); j ; i ; l ) forms either geodesi qudrilterl (four pexes, gure 5) or two geodesi tringles (gure 7). In n se, let g( i ) denote the geodesi polgon of ((g); j ; i ; l ) ontining i. Let ; nd denote the pexes of ((g); j ; i ; l ), other thn i, suh tht is the lst ommon vertex long ((g); j ) nd ((g); l ), is the lst ommon vertex long ( j ; (g)) nd ( j ; i ), nd is the lst ommon vertex long ( l ; i ) nd ( l ; (g)). If (g) = j (resp. (g) = i ) then = (g) = (resp. = (g) = ). If g( i ) is geodesi tringle (see gure 7), let 0 denote the min pex of g( i ). Note tht 0 = n( j ; i ) or 0 = n( i ; l ). Furthermore, if g( i ) is geodesi qudrilterl then = n(r j ; r l ). To updte g, we need to ompute ( j ; l ) i.e., it is enough to ompute (; ). If g( i ) is geodesi qudrilterl (see gure 5) we sill need to ompute segment where 2 ( i ; ) [ (; ) nd 2 ( i ; ) [ (; ) suh tht nd re supporting nd lies entirel in P (see gure 8). Then (; ) = (; ) [ [ (; ), where (; ) nd (; ) re oth known. There re four possile ses for segment (see gure 8). Cse 1: 2 ( i ; ) nd 2 ( i ; ) (gure 8()). Cse 2: 2 (; ) nd 2 ( i ; ), 6= (gure 8()). Cse 3: 2 ( i ; ) nd 2 (; ), 6= (gure 8()). Cse 4: 2 (; ) nd 2 (; ), 6=, 6= (gure 8(d)). If g( i ) is geodesi tringle then ( j ; l ) is lred known. (Rell tht ((g); j ) nd ((g); l ) elong to the shortest pth tree from s 1 ). If 0 = n( j ; i ), let = 0 nd let e the vertex following long ( 0 ; ). Segment is supporting to oth ( 0 ; ) nd ( 0 ; i ). Sine 2 (; ) nd 2 ( i ; ), this n e regrded s se (2) for 6= or se (1) for =. If 0 = n( l ; i ), let = 0 nd e the following vertex long ( 0 ; ). Sine 2 (; i ) nd 2 (; ) this n e regrded s se (3) for 6= or se (1) for =.

(g) (g) j j l i l i Fig. 7. g( i ) is geodesi tringle. (g) l j i (g) j i l (g) l j i (g) j l i () () () (d) Fig. 8. The four ses for segment. To determine whih of the four ses is the one ourring nd determine verties nd, we dvne vrile vertex v long ( i ; ) [ (; ) nd vrile vertex u long ( i ; ) [ (; ) until v = nd u = (v nd u strt t i ). The prolem is tht verties ; nd s well s pexes j nd l nd (g) re not known in dvne. However, useful informtion n e otined while dvning v nd u using the shortest pth tree from s 1. In prtiulr, we n determine tht v = (resp. u = ) due to the following propert: v =, for v 2 ( i ; j ), (resp. u =, u 2 ( i ; l )) if nd onl if the predeessor of v (resp. u) on the shortest pth from s 1, denoted s pred(v), is supporting with respet to pred(v)v (resp. pred(u)u) nd pred(v) 62 ( i ; j ) (resp. pred(u) 62 ( i ; l )). Vertex needs to e known onl in se 4 in whih se = n(r j ; r l ). Segment vu is dvned so tht it lws lies entirel in the interior of g( i ). This n e esil enfored due to the following propert: vu intersets (; ) (resp. (; )) if nd onl if pred(u) (resp. pred(v)) lie t the sme side of vu s i. If t n point during the dvnement it is determined tht vu intersets (; ) (resp. (; )), we hve se 3 or se 4 (resp. se 2 or 4). After segment hs een determined the updte of g n e rie stted s follows: Cse 1: Remove (; i ) [ ( i ; ) nd dd =. Cse 2: Remove (; i ) [ ( i ; ) nd dd = (; ) [. Cse 3: Remove (; i )( i ; ) nd dd = (; ) [. Cse 4: Remove (; i )( i ; ) nd dd = (; ) [ [ (; ). To updte g in n of the four ses we wlk long the orresponding (; ) strting t verties or. (In se 4 we wlk long 1 = (; ) nd 2 = (; ) nd then onsider segment.) Figure 6 illustrtes the updte of g for se 3 i.e., = (; ). Note tht edge 2 3 nd vertex 4 eome geodesi links.

The edges visited the lgorithms to determine nd updte g re either deleted from g or the lie long (; ). For eh edge visited onl onstnt time is spent. Edges long re either new white edges to e dded to the geodesi deomposition or the eome prt of geodesi link. One n edge joins geodesi link t some phse, it is never visited gin until it gets output or deleted from the geodesi deomposition. Thus over ll phses, the time spent for updtes of the geodesi deomposition is proportionl to the totl numer of edges ppering in the geodesi deomposition throughout the lgorithm. Sine no two suh edges interset nd sine the re lws inident to verties or points in R, their numer is ounded O(n + k). To updte the white list, let 0 e the pth otined from sustituting n mximl sequene of red edges single red link. Let h 1 nd h 2 e the verties in the white-list preeding nd following (or oiniding) the endpoints of respetivel. (All verties in the white-list etween h 1 nd h 2 got deleted from during the updte.) Delete the prt of the white list etween h 1 nd h 2 nd merge 0. The time spent is proportionl to the numer verties deleted plus the sie of. Thus, Lemm 3. The totl time spent for updting the geodesi deomposition nd the white-list in ever phse of the lgorithm is O(n + k). To omplete the updte, we need to ompute n(r j ; r l ) sine r j nd r l eome neighors fter the deletion of r i. Clerl n(r j ; r l ) is the one etween n(r j ; r i ) nd n(r i ; r l ) tht ours rst long (s 1 ; r i ) i.e., the one nerest to the root. Assigning level numer to ll nodes of the shortest pth tree from s 1 llows to ompute n(r j ; r l ) from n(r j ; r i ) nd n(r i ; r l ) in onstnt time. After the geodesi deomposition indued R q hs een omputed, we need to extrt white edges of (s i ; t i ) for ever pir (s i ; t i ) t level (h q + 1) of T sl, dd them to E, olor them red, nd updte the white list. Strting t (s i ) we follow the white list until (t i ), dding the enountered white edges to E. Note tht white edges long (s i ; t i ) tht re prt of geodesi links pper twie long the white-list nd tht oth ourrenes must eome red. Finll, sustitute ((s i ); (t i )) single red link etween (s i ) nd (t i ). The time spent is proportionl to the numer of white edges tht get output to E i.e., eome red. We therefore onlude tht E n e omputed in O(n + k) time. 4 Conluding Remrks We hve given simple liner time lgorithm for the k-pirs non-rossing shortest pth prolem in simple polgon P. Similrl, to [12, 11, 10], this result n e extended to simple polgon P with one hole Q where soure-destintion pirs m pper on oth @P nd @Q. The min oservtion is tht one pth i etween s i 2 @P nd t i 2 @Q hs een routed there is onl one w (if n) to route the rest of the pirs. Furthermore, i n e routed in onl two ws: lokwise nd ounterlokwise round Q. If P is set of retngles enlosed n outer retngle nd points in ST pper on the outer retngle nd one inner retngle the shortest non-rossing

pth prolem n e solved in O((n + k) log(n + k)) time s shown in [11, 10] where n is the numer or retngles nd k is the numer of pirs. Note however tht k n e ritrril lrge ompred to n. Our oservtion is tht k need not pl role in the min prt of the lgorithm. The ide is s follows: Given ST nd the set of retngles, derive set ST 0 of O(minfn; kg) pirs, solve the prolem for ST 0 using the lgorithm of [11] in O(n log n) time, nd modif the solution in dditionl O(k) time to derive the set of non-rossing pths for ST. In prtiulr, onsider the prtition of the outer retngle into intervls derived the vertil nd horiontl vlid projetions of the inner retngles. (Vlid projetion lines do not interset ostles.) For (s i ; t i ) 2 ST, let I si nd I ti denote the intervls on the outer retngle ontining s i nd t i respetivel. Let ; nd ; d e the endpoints of I si nd I ti. Then ST 0 = f(i si ; I ti ); (s i ; t i ) 2 ST g, where (I si ; I ti ) = f(; ); (; d); (; ); (; d)g. Computing (s i ; t i ) for (s i ; t i ) 2 ST in [11] n now e sustituted omputing (; ); (; d); (; ), nd (; d). The detils re left for the full pper. Aknowledgment. I would like to thnk professor D.T. Lee for mn helpful disussions nd omments. Referenes 1. B. Chelle, \A theorem on polgon utting with pplitions," Pro. 23rd Annu. IEEE Smpos. Found. Comput. Si., 1982, pp. 339{349. 2. B. Chelle, H. Eddelsrunner, M. Grigni, L. Guis, J. Hersherger, M. Shrir, nd J. Snoeink, \R shooting in polgons using geodesi tringultions", Algorithmi, 12, 1994, 54-68. 3. M. T. Goodrih nd R. Tmssi, \Dnmi R Shooting nd Shortest Pths vi Blned Geodesi Tringultions", In Pro. 9th Annu. ACM Smpos. Comput. Geom, 1993, 318-327. 4. L.J. Guis nd J. Hersherger, \Optiml shortest pth queries in simple polgon", J. Comput. Sst. Si., 39, 1989, 126-152. 5. L.J. Guis, J. Hersherger, D. Leven, M. Shrir, nd R.E. Trjn, \Liner-time lgorithms for visiilit nd shortest pth prolems inside tringulted simple polgons". Algorithmi, 2, 209-233, 1987. 6. J. Hersherger nd J. Snoeink, \Computing Minimum Length Pths of given homotop lss", Comput. Geometr: Theor nd Applitions, 4, 1994, 63-97. 7. D.T. Lee, \Non-rossing pths prolems", Mnusript, Dept. of EECS, Northwestern Universit, 1991. 8. D. T. Lee nd F. P. Preprt, \Euliden Shortest Pths in the Presene of Retiliner Brriers", Networks, 14 1984, 393-410. 9. F.P. Preprt nd M. I. Shmos, Computtionl Geometr: n Introdution, Springer-Verlg, New York, NY 1985. 10. J. Tkhshi, H. Suuki, nd T. Nishieki, \Finding shortest non-rossing retiliner pths in plne regions", Pro. of ISAAC'93, Let. Notes in Computer Siene, Spinger-Verlg, 762, 1993, 98-107. 11. J. Tkhshi, H. Suuki, nd T. Nishieki, \Shortest non-rossing retiliner pths in plne regions", Algorithmi, to pper. 12. J. Tkhshi, H. Suuki, nd T. Nishieki, \Shortest non-rossing pths in plne grphs", Algorithmi, to pper.

This rtile ws proessed using the LA T EX mro pkge with LLNCS stle