Geometric Path Problems with Violations

Similar documents
Algorithmic Discrete Mathematics 6. Exercise Sheet

Problem Set If all directed edges in a network have distinct capacities, then there is a unique maximum flow.

arxiv: v1 [cs.cg] 21 Mar 2013

1 Motivation and Basic Definitions

The Residual Graph. 12 Augmenting Path Algorithms. Augmenting Path Algorithm. Augmenting Path Algorithm

Randomized Perfect Bipartite Matching

The Residual Graph. 11 Augmenting Path Algorithms. Augmenting Path Algorithm. Augmenting Path Algorithm

Network Flows: Introduction & Maximum Flow

18 Extensions of Maximum Flow

Graphs III - Network Flow

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

Admin MAX FLOW APPLICATIONS. Flow graph/networks. Flow constraints 4/30/13. CS lunch today Grading. in-flow = out-flow for every vertex (except s, t)

2. VECTORS. R Vectors are denoted by bold-face characters such as R, V, etc. The magnitude of a vector, such as R, is denoted as R, R, V

CSC 364S Notes University of Toronto, Spring, The networks we will consider are directed graphs, where each edge has associated with it

CS 473G Lecture 15: Max-Flow Algorithms and Applications Fall 2005

Maximum Flow in Planar Graphs

Introduction to Congestion Games

Network Flow. Data Structures and Algorithms Andrei Bulatov

MAXIMUM FLOW. introduction Ford-Fulkerson algorithm maxflow-mincut theorem

Flow networks. Flow Networks. A flow on a network. Flow networks. The maximum-flow problem. Introduction to Algorithms, Lecture 22 December 5, 2001

Main Reference: Sections in CLRS.

Flow Networks. Ma/CS 6a. Class 14: Flow Exercises

Reminder: Flow Networks

Matching. Slides designed by Kevin Wayne.

Average Case Lower Bounds for Monotone Switching Networks

16 Max-Flow Algorithms and Applications

They were originally developed for network problem [Dantzig, Ford, Fulkerson 1956]

CSE 521: Design & Analysis of Algorithms I

Introduction to SLE Lecture Notes

4/12/12. Applications of the Maxflow Problem 7.5 Bipartite Matching. Bipartite Matching. Bipartite Matching. Bipartite matching: the flow network

Network Flows UPCOPENCOURSEWARE number 34414

5.2 GRAPHICAL VELOCITY ANALYSIS Polygon Method

Max Flow, Min Cut COS 521. Kevin Wayne Fall Soviet Rail Network, Cuts. Minimum Cut Problem. Flow network.

CHAPTER 7: SECOND-ORDER CIRCUITS

Basic Tools CMSC 641. Running Time. Problem. Problem. Algorithmic Design Paradigms. lg (n!) (lg n)! (lg n) lgn n.2

arxiv: v2 [cs.cg] 30 Apr 2015

Algorithms and Data Structures 2011/12 Week 9 Solutions (Tues 15th - Fri 18th Nov)

Soviet Rail Network, 1955

Soviet Rail Network, 1955

Algorithm Design and Analysis

Today: Max Flow Proofs

Maximum Flow and Minimum Cut

Longest Common Prefixes

Physics 240: Worksheet 16 Name

The multisubset sum problem for finite abelian groups

Generalized Orlicz Spaces and Wasserstein Distances for Convex-Concave Scale Functions

! Abstraction for material flowing through the edges. ! G = (V, E) = directed graph, no parallel edges.

Flow networks, flow, maximum flow. Some definitions. Edmonton. Saskatoon Winnipeg. Vancouver Regina. Calgary. 12/12 a.

Please Complete Course Survey. CMPSCI 311: Introduction to Algorithms. Approximation Algorithms. Coping With NP-Completeness. Greedy Vertex Cover

u(t) Figure 1. Open loop control system

EECE 301 Signals & Systems Prof. Mark Fowler

Wrap up: Weighted, directed graph shortest path Minimum Spanning Tree. Feb 25, 2019 CSCI211 - Sprenkle

NECESSARY AND SUFFICIENT CONDITIONS FOR LATENT SEPARABILITY

Greedy. I Divide and Conquer. I Dynamic Programming. I Network Flows. Network Flow. I Previous topics: design techniques

FLAT CYCLOTOMIC POLYNOMIALS OF ORDER FOUR AND HIGHER

On the N P-hardness of GRacSim drawing

Network flows. The problem. c : V V! R + 0 [ f+1g. flow network G = (V, E, c), a source s and a sink t uv not in E implies c(u, v) = 0

Discussion Session 2 Constant Acceleration/Relative Motion Week 03

Path Planning on Grids: The Effect of Vertex Placement on Path Length

COMPETITIVE LOCAL ROUTING WITH CONSTRAINTS

Computer-Aided Analysis of Electronic Circuits Course Notes 3

Inventory Analysis and Management. Multi-Period Stochastic Models: Optimality of (s, S) Policy for K-Convex Objective Functions

, the. L and the L. x x. max. i n. It is easy to show that these two norms satisfy the following relation: x x n x = (17.3) max

Analyze patterns and relationships. 3. Generate two numerical patterns using AC

Lecture 21: Bezier Approximation and de Casteljau s Algorithm. and thou shalt be near unto me Genesis 45:10

Stationary Distribution. Design and Analysis of Algorithms Andrei Bulatov

Algorithm Design and Analysis

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Civil and Environmental Engineering

Today s topics. CSE 421 Algorithms. Problem Reduction Examples. Problem Reduction. Undirected Network Flow. Bipartite Matching. Problem Reductions

Constant Acceleration

The Primal Simplex Approach to the QoS Routing Problem

Notes for Lecture 17-18

How to Solve System Dynamic s Problems

6.8 Laplace Transform: General Formulas

Random Walk with Anti-Correlated Steps

Robotics I. April 11, The kinematics of a 3R spatial robot is specified by the Denavit-Hartenberg parameters in Tab. 1.

Dynamic Programming 11/8/2009. Weighted Interval Scheduling. Weighted Interval Scheduling. Unweighted Interval Scheduling: Review

Timed Circuits. Asynchronous Circuit Design. Timing Relationships. A Simple Example. Timed States. Timing Sequences. ({r 6 },t6 = 1.

TRADITIONAL. MAP: Multi-Constrained Anypath Routing in Wireless Mesh Networks. 1 Introduction

What is maximum Likelihood? History Features of ML method Tools used Advantages Disadvantages Evolutionary models

FIXED POINTS AND STABILITY IN NEUTRAL DIFFERENTIAL EQUATIONS WITH VARIABLE DELAYS

We just finished the Erdős-Stone Theorem, and ex(n, F ) (1 1/(χ(F ) 1)) ( n

ARTIFICIAL INTELLIGENCE. Markov decision processes

IB Physics Kinematics Worksheet

WEEK-3 Recitation PHYS 131. of the projectile s velocity remains constant throughout the motion, since the acceleration a x

CHAPTER 12 DIRECT CURRENT CIRCUITS

23 Maximum Flows and Minimum Cuts

Optimal State-Feedback Control Under Sparsity and Delay Constraints

Designing Information Devices and Systems I Spring 2019 Lecture Notes Note 17

Mechtild Stoer * Frank Wagner** Abstract. fastest algorithm known. The runtime analysis is straightforward. In contrast to

Price of Stability and Introduction to Mechanism Design

Let. x y. denote a bivariate time series with zero mean.

Traversal of a subtree is slow, which affects prefix and range queries.

T L. t=1. Proof of Lemma 1. Using the marginal cost accounting in Equation(4) and standard arguments. t )+Π RB. t )+K 1(Q RB

Lecture 2-1 Kinematics in One Dimension Displacement, Velocity and Acceleration Everything in the world is moving. Nothing stays still.

Optimality Conditions for Unconstrained Problems

Research Article On Double Summability of Double Conjugate Fourier Series

1. VELOCITY AND ACCELERATION

On the Exponential Operator Functions on Time Scales

A Hop Constrained Min-Sum Arborescence with Outage Costs

Transcription:

Click here o view linked Reference 1 1 1 0 1 0 1 0 1 0 1 Geomeric Pah Problem wih Violaion Anil Mahehwari 1, Subha C. Nandy, Drimi Paanayak, Saanka Roy and Michiel Smid 1 1 School of Compuer Science, Carleon Univeriy, Oawa, Canada, {anil,michiel}@c.carleon.ca. Indian Saiical Iniue, Kolkaa, India, {nandyc,aanka}@iical.ac.in Chennai Mahemaical Iniue, Chennai, India, drimi@cmi.ac.in Abrac In hi paper, we udy varian of he claical geomeric hore pah problem inide a imple polygon, where we allow a par of he pah o go ouide he polygon. Le P be a imple polygon coniing of n verice and le, be a pair of poin in P. Le in(p ) repreen he inerior of P and le P repreen he exerior of P, i.e. in(p ) = P \ (P ) and P = R \ in(p ). For an ineger k 0, we define a k-violaion pah from o o be a pah connecing and uch ha i inerecion wih P coni of a mo k egmen. There i no rericion in erm of he number of egmen of he pah wihin P. The objecive i o compue a pah of minimum Euclidean lengh among all poible ( k)-violaion pah from o. In hi paper, we udy hi problem for k = 1 and propoe an algorihm ha compue he hore one-violaion pah in O(n ) ime. We how ha for recilinear polygon, he minimum lengh recilinear one-violaion pah can be compued in O(n log n) ime. We exend he concep of one-violaion pah o a one-rech violaion pah. In hi cae, he pah beween and i compoed of (a) a pah in P from o a verex u of P, (b) a pah in P beween u and a verex v of P, and (c) a pah in P beween v and. We how ha a minimum lengh one-rech violaion pah can be compued in O(n log n log log n) ime. Nex, we inroduce one- and wo-violaion monoone recilinear pah problem among a e of n dijoin axi-parallel recangular objec. Le, be wo poin in R ha are no in he inerior of any of he objec. In he cae of one-violaion monoone pah problem, he deired recilinear pah from o coni of horizonal edge ha are direced oward he righ and verical edge ha are direced upward, excep for a mo one edge. Similarly, in he cae of a wo-violaion monoone pah problem, all horizonal edge are direced oward he righ excep a mo one and all verical edge are direced upward excep a mo one. Our algorihm for boh of hee problem run in O(n log n) ime. Keyword: hore pah, violaion, imple polygon, recilinear polygon, graph, geomery Reearch uppored by NSERC and he Canadian Commonwealh Scholarhip. 1

1 1 0 1 0 1 0 1 0 1 1 Inroducion Le P be a imple polygon coniing of n verice and le, be a pair of poin in P. Le in(p ) repreen he inerior of P and le P repreen he exerior of P, i.e. in(p ) = P \ (P ) and P = R \ in(p ). In he radiional hore pah problem inide a imple polygon, he inpu coni of P and a pair of poin, P ; he objecive i o connec and by a pah in P of minimum lengh. Here a pah i a equence of line egmen, called he edge of he pah; he pah change he direcion (or urn) only a he verice of P. The lengh of a pah i he um of lengh of all he edge on ha pah. The hore pah problem inide a imple polygon ha a long and rich hiory. Inereed reader may ee [,, ] for an exhauive urvey of known reul. I i well-known ha he hore pah map from a poin o all he verice in P can be compued in O(n) ime []. In hi paper, we udy varian of he geomeric hore pah problem where we allow a par of he pah o go ouide P. For an ineger k 0, we define a k-violaion pah beween and o be a pah connecing and uch ha i inerecion wih P coni of a mo k egmen. There i no rericion in erm of he number of egmen of he pah wihin P. The objecive i o compue he pah of minimum Euclidean lengh among all poible ( k)-violaion pah from o. We udy he following varian: One-Violaion Pah Problem: Given a imple polygon P and a pair of poin, P, compue a hore one-violaion pah beween and. Noe ha he inerecion of a one-violaion pah wih P i a mo one egmen (ee Figure 1 for an illuraion). One-Srech Violaion Pah Problem: Given a imple polygon P and a pair of poin, P, a one-rech pah beween and i compoed of (a) a pah in P from o a verex u of P, (b) a pah in P beween u and a verex v of P, and (c) a pah in P beween v and. The one-rech violaion pah problem i o compue a hore pah among all one-rech pah beween and. Monoone Recilinear Pah Problem wih Violaion: Given a e R of dijoin axi-parallel recangular obacle in R, and a pair of poin, R \ R, a monoone recilinear pah from o coni of horizonal edge ha are direced oward he righ and verical edge ha are direced upward. A monoone recilinear pah from o may no alway exi. We how ha if we allow a mo one-violaion wih repec o he direcion of a horizonal or a verical edge, hen a pah from o alway exi. The objecive in hee problem i o compue a minimum lengh monoone recilinear pah beween and wih a mo one or wo violaion edge. In compuaional geomery, i i cuomary o udy claical opimizaion problem ha violae a given e of conrain in ome rericed way, ee e.g. [,, ]. Alo, here are everal udie in finding horcu for a given geomeric nework (pah, ree, cyclic, and plane nework) o a o reduce i diameer or he panning raio, ee e.g. [,, ]. An alernaive formulaion of he one-violaion pah problem i o find a horcu for a pah beween and in a imple polygon P, ubjec o he condiion ha he inerecion of he horcu wih P i a mo one egmen. Thee problem and heir varian moivaed u o eek algorihm for he radiional geomeric hore pah problem wih violaion.

1 1 0 1 0 1 0 1 0 1 1.1 New Reul In hi paper, we propoe algorihm for he following varian of he one-violaion pah problem: An algorihm for compuing a hore one-violaion pah beween a pair of poin inide a imple polygon wih n verice; i run in O(n ) ime. An algorihm for compuing a hore one-violaion recilinear pah beween a pair of poin inide a recilinear polygon; i run in O(n log n) ime. Exending one-violaion pah problem o one-rech violaion pah among a pair of poin inide a imple polygon. The ime complexiy of our propoed algorihm for hi problem i O(n log n log log n). For a given e R of dijoin axi-parallel recangular obacle and an arbirary pair of poin and in R \R, we how ha a monoone recilinear pah from o wih a mo one (rep. wo, where one i in horizonal direcion and he oher one i in verical direcion) violaion() alway exi, and a pah of minimum lengh among uch pah can be compued in O(n log n) ime. 1. Organizaion The paper i organized a follow. In Secion, we inroduce he hore pah problem wih violaion in a graph wih wo ype of edge, namely good and bad. We how ha Dijkra hore pah algorihm can be modified o work for hi problem. In Secion, he one-violaion hore pah problem in a imple polygon i udied. In Secion, we how ha for recilinear polygon, he ime complexiy of he one-violaion hore pah problem can be improved. In Secion, we exend he idea of one-violaion hore pah o one-rech violaion hore pah for imple polygon, and provide an algorihm wih improved ime complexiy. In Secion, we udy he one/wo violaion recilinear monoone hore pah problem among a e of dijoin recangular obacle. Finally, concluding remark appear in Secion. Shore pah wih violaion in a graph We fir inroduce he k-violaion hore pah problem in a imple graph G = (V, E = E 1 E ), where we have wo dijoin e of edge E 1 and E, named good and bad repecively. Each edge in (u, v) E 1 E i aigned wih a non-negaive co c(u, v). We can compue a pah from o by chooing a many good edge a required bu are allowed o ue a mo k bad edge o reduce he co of he pah. The objecive i o have a pah of minimum co from o. We how ha Dijkra algorihm can be ailored o work for hi problem uing Fibonacci heap 1 [] a he addiional daa rucure. Here 1 Each elemen of he heap i a uple (a, b, x), where a i he key and b i he prioriy field. Needle o ay, each key a A = {a 1, a,..., a N } ha a mo one repreenaion in he heap. Each elemen in he heap may conain ome oher informaion x, which can be null alo.

1 1 0 1 0 1 0 1 0 1 Algorihm 1: Dijkra-k-Violaion-Algorihm(G,, ) Inpu: The weighed digraph G = (V, E). An ineger k 0. Each edge (u, v) ha a weigh c(u, v) and a flag f(u, v) indicaing good or bad. Oupu: The k-violaion hore pah from o 1 iner((, 0, 0), H) // Iniialize he elemen of H forall v V \ {} do forall µ = 0, 1,,..., k do iner((v, µ, ), H) repea (u, µ, χ) = delee-min(h) // Delee he roo elemen from H if u = hen Repor χ and Exi; ele forall v Adj(u) //Adj(u): adjacency li of node u do 1 (* Proce he edge (u, v) *) 1 if f(u, v) = good hen Creae a uple (v, µ, χ ) = (v, µ, χ + c(u, v)) if f(u, v) = bad hen Creae a uple (v, µ, χ ) = (v, µ + 1, χ + c(u, v)) if µ k hen decreae-key((v, µ, χ ), H) unil H i empy; iner, decreae-key, find-min operaion can be performed in O(1) ime, and delee-min operaion need logarihmic ime on he ize of he heap. During he execuion of he algorihm, we ue a prioriy queue H mainained a a Fibonacci heap. Each node of H i a riple (v, µ, χ) ha correpond o a pah from o he node v wih violaion coun µ; χ denoe he lengh of hi pah. Here (v, µ) play he role of key and χ play he role of prioriy in he Fibonacci heap H. In addiion, we mainain k poiner C v (in an array) wih each node v V. The µ-h enry of C v ore he poiion of key value (v, µ) in H. The enrie of {C v, v V } are updaed during he iner, decreaekey and delee-min operaion in H. Iniially, he heap H conain n(k + 1) elemen for n(k + 1) poible key value {(v, µ) v V, µ = 0, 1,,..., k}. The χ value of each elemen i e o. The locaion C v, v V are e accordingly. In each ieraion of he modified Dijkra algorihm, we chooe an elemen of H having minimum co χ (ay) by invoking delee-min(h). Le i correpond o he node u V. We relax node u, or in oher word, proce he edge (u, v) for all verice in V adjacen o u. For each edge (u, v), i generae a uple (v, µ, χ ), where χ = χ + c(u, v) and iner(a, b, x) iner a uple in he heap H. decreae-key(a, b ) updae he b-value correponding o he key a in he heap H if he exiing b-value of he node having key a i greaer han b ; if he updae i done, hen i adju he heap H. find-min(h) reurn he enry wih minimum prioriy (b) in he heap H. delee-min(h) delee he elemen wih minimum prioriy from H, and hen adju he heap H.

1 1 0 1 0 1 0 1 0 1 µ = µ or µ + 1 depending on wheher he edge (u, v) i good or bad. If µ k and χ i le han he χ value aached o he (v, µ )-h node of H, we invoke decreaekey((v, µ, χ ). The algorihm erminae when i reached for he fir ime, or in oher word, when a uple (v, µ, χ) i aken from he heap wih v =. The peudo code of he propoed mehod i given in Algorihm 1. Theorem 1. The Dijkra-k-Violaion-Algorihm correcly compue a pah of minimum co coniing of a mo k violaion edge in O(mk + nk log n) ime uing O(m + nk) pace, where n = V and m = E 1 + E. Proof. The correcne of he algorihm follow from ha of he Dijkra hore pah algorihm, and he fac ha we are uing he uple (v, µ) a he key in he prioriy queue H. The fir par of he ime complexiy follow from he fac ha (i) each edge may need o be proceed a mo k ime, and we are uing Fibonacci heap for implemening he prioriy queue. The econd par of he ime complexiy follow from he fac ha a node of he graph may be conidered for relaxing a mo k ime wih k differen violaion coun. The delee-min operaion need o be invoked O(nk) ime, and each delee-min operaion need O(log(nk)) ime, where nk i he ize of H. Apar from oring he graph, which need O(max(m, n)) pace, he pace needed for oring C v for all v V i O(nk). Alo he prioriy queue H need O(nk) pace. Thu, he pace complexiy follow. One-violaion pah problem in a imple polygon We are given a imple polygon P coniing of n verice, and a pair of poin, P. The objecive i o compue a minimum lengh pah from o ha coni of a mo one edge of he pah or i porion ha pae hrough he ouide of he polygon P. From now onward, we ue P = R \ in(p ) o denoe he region ouide he polygon P, and he edge of a pah from o ha pae hrough P i referred o a he violaion edge. Noe ha, unlike he hore pah inide a imple polygon, here a bend in a pah may no alway be a a verex of he polygon (ee Figure 1). I i poible ha he violaion edge of he hore pah from o mee a a poin in he inerior of an edge of he polygon, from where he pah ener in (leave from) he polygon. Throughou he paper, x y i ued o indicae a polyline pah from x o y, and x y o indicae an edge of he pah. We ue Π in (x, y) o denoe he hore pah beween a pair of poin x, y P inide he polygon. Obervaion 1. Unle he line egmen lie compleely inide P, here exi a oneviolaion pah from o ha i horer han Π in (, ). Proof. Since he line egmen doe no lie compleely inide P, here exi a lea one urn a a verex, ay v, of Π in (, ). We chooe wo poin α and β a a very mall diance The µ -h enry of C v indicae hi poiion.

1 1 0 1 0 1 0 1 0 1 P a a b b P Figure 1: Illuraion of Π in (, ) (red pah) and he hore one-violaion pah beween and (green pah). The hore one-violaion pah ue egmen ab and bend a a and b. Poin a and b are in he inerior of edge. The violaion edge a b pae hrough he verice a and b. ɛ from v on he wo egmen of Π in (, ) adjacen o v uch ha he egmen αβ P form one conneced componen (i.e., αβ i a violaion edge). By riangle inequaliy, he pah obained by replacing he pah egmen α v β of Π in (, ) by α β i horer, and give a feaible one-violaion pah from o. Lemma 1. Le Π = a b c d be any opimum one-violaion pah from o coniing of a lea hree egmen, wih bc a he violaion edge and a and d are verice of P and b and c are poin on he boundary of P. Then, he violaion edge bc eiher (i) pae hrough a verex of P or (ii) poin {a, b, c} or {b, c, d} are collinear. Proof. We prove hi by conradicion. Le Π = a b c d be an opimum one-violaion pah where he violaion edge bc doe no pa hrough any verex of P and neiher {a, b, c} nor {b, c, d} are collinear. Depending on he lope of he edge ab and cd of Π, we need o conider wo cae a hown in Figure (a) and (b). Conider fir he cae ha he edge ab and cd of Π have lope of differen ign (i.e., ab, bc, and cd form a convex pah). In hi cae, he violaion edge bc can be moved o a new poiion b c, parallel o bc (ee Figure (a)), uch ha b c i a violaion edge and he new pah Π = a b c d i horer han Π. Thi conradic he minimaliy of Π. Noe ha we can coninue hi movemen unil bc eiher (i) ouche a verex of P, or (ii) b, c, and a and/or d become collinear. Now conider ha he edge ab and cd of Π have lope of he ame ign. Chooe a poin x on bc. Roae bc around x o ha he new egmen b c i a violaion edge and he pah Π = a b c d i a valid one violaion pah (ee Figure b). We claim ha we can alway roae bc uch ha he lengh of Π i le han he lengh of Π. Thi follow from he riangle inequaliy a he pah egmen a b x c d i horer han a b c d. Hence hi conradic he minimaliy of Π. Noe ha we can roae bc around x unil he line egmen b c eiher (i) ouche a verex of P or (ii) a, b, c, and d become collinear. We will ue he hore pah map of and in P, namely SP M and SP M, repecively, o compue an opimum one-violaion pah. Shore pah map are ypically ued for

1 1 0 1 0 1 0 1 0 1 a b c b c (a) d a b b x (b) Figure : Illuraion of he proof of Lemma 1 compuing he hore pah of all poin in P from ha ay wihin P. Thee map pli he boundary of he polygon ino open inerval, called componen-piece. None of he componen-piece conain any verex of P. Definiion 1. Each componen-piece i aociaed wih a verex of he polygon, called he paren verex, uch ha for every poin in ha componen piece, he hore pah from i reached from i paren verex. SP M can be viualized a a ree. I roo i, and componen-piece are leave. The verice of P may appear a boh leaf or non-leaf node in he ree. Each node p of SP M, ha i a verex of P, ore he lengh of he hore pah from o p inide he polygon. A imilar daa rucure i alo prepared for SP M. Lemma. [, 1] Afer a linear ime preproceing, he lengh of he hore pah Π in (, p) and Π in (, p) for any poin p on a componen-piece can be compued in O(1) ime. We conider he convex hull CH(P ) of P. Each edge of CH(P ), ha i no an edge of P, inroduce a pocke wih repec o P a defined below. Definiion. A pocke of a imple polygon P i defined by an edge e of CH(P ) ha i no an edge of P. I i a polygonal region ouide P bu inide CH(P ). I i bounded by e and a equence of conecuive edge of P where he fir and he la edge of he equence are inciden on he wo end poin of e. The wo end poin of e will be referred o a he fronier of he pocke. Le u name hee pocke a P 1, P,..., P k. Each pocke along wih he correponding edge of CH(P ) define a imple polygon ouide P. Le Π = a b c d be a one-violaion pah coniing of a lea hree egmen a aed in Lemma 1. In hi noaion, a and d are verice of P, bc i he violaion edge, where b and c are poin on he boundary of P. Le b belong o he componen piece I of SP M and le c belong o he componen piece J of SP M. Noe ha he paren of I in SP M i a and he paren of J in SP M i d. Oberve ha Π i compoed of up o five piece, namely (i) Π in (, a), (ii) Π in (, d), (iii) he egmen bc lying compleely wihin one of he pocke P i, where b c d c

1 1 0 1 0 1 0 1 0 1 and c are on he boundary of P, (iv) a egmen ab in P, and (v) a egmen cd in P. I i poible ha he egmen ab and bc may be collinear and/or he egmen bc and cd may be collinear. u φ0 x I φ φ1 Pocke Pi φm φi+1 φi y φm+1 P C z ψ0 ψ1 C1 J ψi ψi+1 ψm w Hourgla H(I, J) Figure : Proceing of a pair of componen-piece (I, J) Le I = [xy] and J = [wz] be wo componen piece of a pocke P i, wih heir paren verice u and v wih repec o SP M and SP M, repecively. We wan o compue an opimum one-violaion pah beween and, where he violaion edge bc i rericed o b I and c J. Aume ha in he raveral of he boundary of P i in counerclockwie order aring a y, he poin x, w, and z appear in hi order (ee Figure ). Conider he hore pah beween x and w and beween y and z rericed o lie wihin P i. Thee wo hore pah ogeher wih he componen piece I and J define an hourgla H(I, J) in P i [, ]. An hourgla i aid o be open, if he correponding hore pah do no hare any verex. Oherwie i i cloed. We make he following obervaion baed on he well eablihed connecion beween hore pah and hourglae (ee [, ]). Obervaion. For wo componen piece I and J of a pocke P i, here exi a egmen joining I and J ha lie compleely wihin P i if and only if H(I, J) i open. For a pair of componen piece I and J in a pocke P i, we fir check wheher H(I, J) i open by compuing he correponding hore pah in P i. If H(I, J) i open, we ay ha he componen piece I and J are valid, oherwie hey are invalid. From now on aume ha he componen piece are valid. In hi cae he hore pah beween x and w in P i i a convex chain (ay C 1 ). Similarly, he hore pah beween y and z in P i i a convex chain (ay C ). To compue he violaion edge bc, where b I and c J, we proceed a follow. We ubdivide componen piece I and J ino inerval, o ha for all poin wihin an inerval, he verex ha i angen on C 1 (and C ) i he ame. Thi i achieved by canning C 1 aring from x and drawing line ha are aligned wih he edge of C 1. The line ha inerec C are ignored, and he oher ha inerec wz are reained. (The line ha inerec wz correpond o he conecuive edge of C 1.) Le hee line inerec xy a ψm+1 v

1 1 0 1 0 1 0 1 0 1 poin φ 1, φ,..., φ m, and wz a poin ψ 1, ψ,..., ψ m, repecively (ee Figure ). We alo draw a pair of common angen of C 1 and C. Le hee inerec xy a φ 0, φ m+1 and wz a poin ψ 0, ψ m+1, repecively. By Lemma 1, he violaion edge of he hore one-violaion pah ha inerec I in he inerval [φ i, φ i+1 ] and J in he inerval [ψ i, ψ i+1 ], will pa hrough he ame verex w of P. For each inerval [φ i, φ i+1 ] and i correponding pair [ψ i, ψ i+1 ] we can compue he lengh of a hore one-violaion pah by opimizing he funcion ha i obained by adding he lengh of (a) Π in (, u), where u i he paren verex of I in SP M, (b) Π in (, v), where v i he paren verex of J in SP M, (c) he egmen bc, where b [φ i, φ i+1 ] and c [ψ i, ψ i+1 ], (d) he egmen ub, and (e) he egmen cv. Once we fix he locaion of b [φ i, φ i+1 ], everyhing ele can be deermined in O(1) ime from SP M and SP M. Therefore, for all b [φ i, φ i+1 ], he minimum of ub + bc + cv can be compued in O(1) ime. Hence he lengh of a hore one-violaion pah rericed o inerval b [φ i, φ i+1 ] and c [ψ i, ψ i+1 ] can be compued in O(1) ime. The ame mehod i applied o compue hore one-violaion pah ha pa hrough he verice of C. Finally, he hore one i conidered for a valid pair of componen-piece (I, J). Hence, he lengh of a hore one-violaion pah rericed o I and J can be compued in ime proporional o he number of verice of he pocke P i. Conidering all poible pair of componen-piece, we can idenify he hore one-violaion pah from o paing hrough he pocke P i. By repeaing hi compuaion for each pocke, we can compue a hore one violaion pah beween and. We ummarize he reul in he following heorem. Theorem. A hore one-violaion pah beween a pair of poin in a imple polygon P coniing of n verice can be compued in O(n ) ime uing O(n) pace. Proof. A hore one-violaion pah eiher coni of a direc egmen beween and, or a pah coniing of wo egmen, or a pah coniing of hree or more egmen. We fir e wheher he egmen i a valid one-violaion pah. Thi can be done in O(n) ime by canning he boundary of P and checking he number of inerecion beween he boundary and. Now conider he cae when a hore violaion pah coni of wo egmen. The urning poin of he pah canno be in he exerior of P. Moreover, he urning poin need o be a a verex of P, oherwie he lengh of he pah can be furher improved. For each verex v of P, we can ue he ray hooing daa rucure o find wheher he egmen v and v inerec he exerior of P a mo once. Among all uch valid wo egmen pah, we find he one ha ha he minimum lengh. The ray hooing daa rucure require O(n) ime and for each verex v we can find wheher v or v inerec P more han once in O(log n) ime. If a hore one violaion pah coni of hree or more egmen, we adop Lemma 1. The hore pah map SP M and SP M can be compued in O(n) ime and pace by he algorihm in [, 1]. We proce each pocke P i eparaely. Le he number of verice in P i be n i ; he number of componen-piece of SP M and SP M in P i be µ and ν repecively. We have conidered µ ν pair of componen-piece (I, J), where I SP M and J SP M. For each pair (I, J), in O(n i ) ime we ravere he enire P i o form he

1 1 0 1 0 1 0 1 0 1 convex chain C 1 and C. If a pair of componen-piece (I, J) i oberved o be valid, we again ravere C 1 and C in a merge-like fahion o pli boh I and J ino a mo n i inerval in he wor cae. A menioned earlier, ince he ime of proceing each pair of inerval [φ i, φ i+1 ] I and [ψ i, ψ i+1 ] J need O(1) ime, he proceing of a pair of componen piece (I, J) in a pocke P i need O(n i ) ime. The final reul i repored afer conidering all poible pair of valid componen piece. The reul follow from he fac ha he number of pair of componen-piece (I, J), I SP M and J SP M i O(n ) conidering all he pocke of P. One-violaion pah problem in a recilinear polygon Given a recilinear polygon P and a pair of poin, P, a one-violaion recilinear pah i a recilinear pah from o uch ha i ha a mo one horizonal or one verical violaion edge e ha goe ouide P, and he inerecion of e wih P i a mo one egmen. Our objecive i o compue a one-violaion recilinear pah of minimum lengh. We will ue Ψ in (, ) o denoe a hore recilinear pah from o ha ay inide P, and Ψ one (, ) o denoe a hore one-violaion recilinear pah from o. We ay, a line egmen l i aligned wih an edge e of he polygon P if a porion of l overlap wih a porion of e. Lemma. If and are on he boundary of he polygon P, hen here exi a minimum lengh recilinear pah from o uch ha each line egmen of hi pah i aligned wih ome edge of he polygon P. Proof. Le Ψ be a minimum lengh recilinear pah from o, and i ha a verical edge e ha doe no have any porion which i aligned wih ome edge of he polygon. Here we need o conider wo cae depending on wheher he nex verical edge e of Ψ i aligned wih ome edge of P or no. In he poiive cae, if we move he edge e horizonally oward e, he lengh of he pah remain unchanged. Afer being aligned wih e, he reul hold. In he negaive cae, he combined edge e e ar moving along i nex verical edge keeping he oal lengh of Ψ unchanged. Proceeding imilarly, he reul hold. Similarly, if a horizonal edge of Ψ i no aligned wih a horizonal edge of he polygon, i can be modified in a imilar manner o ha i align wih an edge of P. If and are no on he boundary of P, hen here exi a minimum lengh recilinear pah from o whoe all he edge are aligned wih edge of he polygon P excep poibly he edge ha are inciden on or. Lemma. If here exi a one-violaion recilinear pah whoe lengh i le han ha of Ψ in (, ), hen we can obain a minimum lengh one-violaion recilinear pah Ψ one (, ) whoe violaion edge i he exenion of an edge of P ouide he polygon. Proof. Le Ψ be a minimum lengh one-violaion recilinear pah whoe violaion edge e = [a, b] i horizonal, and i no aligned wih any edge of P. I adjacen verical edge a a and b mu be verically o he oppoie direcion. Oherwie, we can reduce he

1 1 0 1 0 1 0 1 0 1 pah lengh by moving [a, b] in ha (common) direcion. Now, we move [a, b] above or below mainaining he ame lengh unil i i aligned wih he previou or nex horizonal edge, ay e, of Ψ. If he combined horizonal edge e e i no aligned wih an edge of he polygon, hen i alo can be moved in one direcion (above or below) mainaining i lengh unchanged unil i become aligned wih anoher edge of Ψ or i mee an edge of he polygon. In he fir cae, he proce of moving he merged edge coninue, and in he econd cae, he proce op proving he reul. A a warm-up, we fir explain he mehod of compuing a hore recilinear pah Ψ in (, ) in he recilinear polygon P []. We draw a pair of orhogonal line egmen h() and v() (repecively, h() and v()) a he poin (repecively, ). Le he polygon be pli in wo par, namely P lef and P righ on he wo ide of v(). We ue ˆP lef and ˆP righ o denoe he verice of he polygon P lef and P righ repecively. Compue he hiogram pariioning of P lef and P righ []. Each window of a hiogram i he bae of he neighboring hiogram, and he adjacency relaionhip among he hiogram on each ide of v() can be repreened a a direced ree. We ue T lef o denoe he hiogram ree for he polygon P lef. The hiogram of a node v T lef will be denoed by H(v). In Figure, a hiogram pariioning and i correponding ree repreenaion are hown for P lef. Nex we will conider a mehod for compuing a hore pah from o. Le P lef. We ue H() and H() o denoe he hiogram conaining and, repecively; H() i he roo of he hiogram ree for P lef. The hore pah from o will navigae from H() o H() in he hiogram ree, and he correponding pah will bend a he projecion of an edge of he hiogram o i bae, a hown in Figure (a). The hiogram pariioning of P and he compuaion of he hiogram ree require O(n) ime []. The bae of each hiogram i projeced o he bae of i paren hiogram. Thee creae a e of Seiner poin Q lef. The bend can ake place a he verice ˆP lef of P lef and a Seiner poin in Q lef. v v v v v v 1 v v v v v v v v v P lef v v v 1 (a) v v 1 v v v P righ v 1 v v v v v v v v v v 1 v v v v v v v v (b) v v 1 v v Figure : Hiogram decompoiion of P lef, and (b) i hiogram ree Now, if and lie in he ame hiogram, heir hore pah i an axi-parallel L-pah connecing hem. Oherwie, he fir bend of he o pah will be a he projecion of An L-pah coni of a horizonal and a verical egmen inciden a a common bend (urn) poin

1 1 0 1 0 1 0 1 0 1 on he bae of H() []. Nex ime onward he bend are a he poin of ˆP lef Q lef. We conruc a graph G = (V, E), where V = ˆP lef Q lef {, i, i {N, S, E, W }} {, i, i {N, S, E, W }}, where { i, i, i {N, S, E, W }} are he orhogonal projecion of and on he boundary of P along he four direcion (namely norh, ouh, ea and we), repecively. An edge e E join a pair of poin α, β ˆP lef Q lef uch ha α and β have he ame x (or y) coordinae and here i no oher poin() of ˆPlef Q lef in he inerval [α, β]. The hore pah from o can be compued by running Dijkra algorihm on he graph G. Oberve ha V = O(n) ince each window conribue a mo wo member o Q and he number of window in he hiogram of P lef i equal o he number of node in T lef, which i a mo ˆP lef, he number of verice in P lef. The number of edge i alo O(n) ince each verex of P i inciden on a mo edge and each member of Q i inciden on a mo edge. Thu, Dijkra algorihm run in O(n log n) ime. We now decribe our mehod for compuing a one-violaion pah of minimum lengh. By Lemma, a violaion edge can be he exenion ê of an edge e of P. The exenion ê mee he boundary of P from ouide. Noe ha he exenion of e can inerec an edge e from inide, hen i goe ouide, and hen i inerec anoher edge e. Here we need o menion ha he violaion edge from he boundary of P lef may reach a poin on he boundary of P righ. So, in he graph formulaion of compuing Ψ one (, ), we need o handle boh P lef and P righ imulaneouly. A in he hore pah problem, we creae a graph G one = (V one, E one ), where V one = ˆP Q R {, ( i, σ i ), i {N, S, E, W }} {, ( i, τ i ), i {N, S, E, W }}. Here (i) ˆP = ˆP lef ˆP righ, (ii) Q i he e of verice generaed from he projecion of he bae of he hiogram on heir paren bae repecively, a decribed for he hore pah problem, (iii) R i he orhogonal projecion of he verice in ˆP on he boundary of P from ouide, (iv) i (rep. i ) i he orhogonal projecion of (rep. ) on he boundary of he polygon from inide in he i-h ide and (v) σ i (rep. τ i ) i he poin of inerecion of he exended line from (rep. ) wih he boundary of he polygon from ouide on he i-h ide. The edge E one = Ê E violaion. The edge in Ê are hoe defined in he hore pah problem conidering he verice ˆP Q and hee are agged a good. E violaion i he e of all violaion edge and hee are agged a bad. For each verex of P a mo wo violaion edge may exi. Each edge of E violaion connec a verex of ˆP and i orhogonal projecion ( R) on he boundary of P from ouide. The verice in R and he edge in E violaion are generaed by weeping a horizonal (rep. verical) line over he polygon in O(n log n) ime. Noe ha, an edge in E violaion may inerec many edge in E violaion. Thu, unlike G, G one may no be a planar graph. However, (i) he number of verice in R i O(n) ince each edge in P i exended in a mo wo direcion, and (ii) he number of edge in E one = O(n) ince each verex of P can define a mo wo edge of E violaion. We run Algorihm 1, wih number of violaion k = 1, o compue Ψ one (, ) and obain he following reul. Theorem. Given a imple recilinear polygon P wih n verice and wo poin and inide i, he hore one-violaion recilinear pah from o can be compued in O(n log n) ime uing O(n) pace. 1

1 1 0 1 0 1 0 1 0 1 One-rech violaion pah problem in a imple polygon Given a imple polygon P and a pair of poin and, we will conider he pah from o ha bend (change direcion) a only he verice of he polygon. We ay a pah i a one rech violaion pah beween and if i i compoed of (a) a pah in P from o a verex u of P, (b) a pah in P beween u and a verex v of P, and (c) a pah in P beween v and. In order o characerize uch pah, conider he convex hull CH(P ) of he polygon P, and he aociaed pocke (ee Definiion ). Definiion. The exernal rech of an one-rech violaion pah from o i a equence of line egmen connecing he verice of he polygon uch ha no par of each egmen lie in he proper inerior of he polygon. Obervaion. A one-rech violaion pah Π(, ) from o coni of hree par Π 1 Π Π. The edge of Π 1 and Π compleely lie inide he polygon, and Π i he exernal rech. Noe ha, any one of Π 1, Π or Π may be empy. Obervaion. If u and v are he wo end-verice of an exernal-rech of an one-rech violaion pah, hen i i one of he following wo ype: Type-1: Boh u and v are verice of he ame pocke P α of P, and he enire exernalrech i inide ha pocke (ee Figure (a)), or Type : If hey belong o differen pocke P α and P β, hen he exernal-rech can be pli ino hree par π 1 π π, where π 1 i a pah from u o a fronier of he pocke P α, π i a pah from v o a fronier of he pocke P β and π connec hee wo fronier via he convex hull edge (ee Figure (b)). CH(P ) P Π in (, ).1 Algorihm (a) pocke P α Π α (, ) CH(P ) P pocke P α (b) Figure : (a) Type-1 Π o (, ), and (b) Type- Π o (, ) Π o (, ) = Π αβ Π in (, ) pocke P β We compue he convex hull of he polygon P. Suppoe, hi generae k pocke, namely P 1, P..., P k. We will ue Π α o denoe he minimum lengh Type-1 pah whoe rech ee Definiion 1

1 1 0 1 0 1 0 1 0 1 lie enirely inide he pocke P α, and Π αβ o denoe he minimum lengh Type- pah whoe exernal rech connec wo verice of he pocke P α and P β. Thu he lengh of a hore one-rech violaion pah, denoed by Π o (, ), from o i given by Π o (, ) = min{ Π in (, ), min Π α, min Π αβ }. α {1,,k} α,β {1,,k},α β We fir compue Π in (, ), and he hore pah ree from and wihin P. We ue wo array SP and SP. For i = 1,..., n, he array enry SP [i] (repecively, SP [i]) ore he lengh of he hore pah of he verex p i of P from (repecively, ). In he following wo ubecion we explain he mehod of compuing Π α and Π αβ, repecively..1.1 Type-1 hore one-rech violaion pah Le u conider he pocke P α. Le he number of verice in P α be m and le he verice be {p 1, p,..., p m 1, p m } in counerclockwie order. Conider a marix B, whoe row correpond o he verice {p 1, p,..., p m 1 } of P α in counerclockwie order and he column correpond o he verice {p m, p m 1,..., p } in clockwie order. Thu, he row are numbered a {1,,..., m 1} from op o boom and column are numbered a {m, m 1,..., } from lef o righ (ee Figure (a)). The enrie of he marix B are defined a follow: { SP [i] + SP B[i, j] = [j] + χ ij if i < j, and undefined oherwie Here, χ ij = he lengh of he hore pah π ij beween he verice p i, p j P α inide he pocke P α. The objecive i o find he minimum valued elemen in hi marix. We now how ha he marix B i a parially monoone revere riing aircae marix (ee Definiion ). Thu, if we can compue χ ij on demand in O(f(m)) ime uing a daa rucure ha can be compued in g(m) ime, hen he malle enry of he marix B can be compued in O(g(m) + mf(m) log log m) ime [1]. Similarly, defining he marix enrie a { SP [i] + SP B[i, j] = [j] + χ ij if i < j, and undefined oherwie, we execue he ame procedure. The minimum of hee wo value will be he reul of proceing he pocke P α. In order o explain he ub-quadraic ime proceing of he marix B, we need he following concep from [1]. [ ] a b Definiion. A marix i aid o be monoone if b < a and c < d canno c d occur imulaneouly. Definiion. A marix B i aid o be parially monoone if i every ub-marix of B ha coni of all defined enrie, i a monoone marix. Definiion. [1] A marix i aid o be a revere riing aircae marix if (i) he valid enrie in each row are conecuive, and (ii) if he valid enrie in he i-h row pan in he column poiion from α i o β i, hen α i = 1 and β i are non-increaing for every i = 1,,..., n (ee Figure (a)).

1 1 0 1 0 1 0 1 0 1 p 1 p p m 1 p m p m 1 p (a) SP enrie p j p i Pocke Figure : (a) Revere riing aircae marix, (b) Illuraion of he proof of Lemma Lemma. The marix B i a revere riing parial monoone marix. Proof. The rucure of he marix indicae ha i i a revere riing aircae marix (ee Figure (a)). In order o prove ha i i a parially monoone marix, we need o how ha in every ub-marix of B, if all he enrie are defined, hen i i a monoone marix. For a conradicion, le for a ub-marix wih row i < j and column k > l, B[i, l] > B[i, k] and B[j, k] > B[j, l] hold imulaneouly. Thu, we have SP [i] + SP [l] + χ il > SP [i] + SP [k] + χ ik.................. (1) SP [j] + SP [k] + χ jk > SP [j] + SP [l] + χ jl.................. () In oher word, we have SP [l] + χ il > SP [k] + χ ik.................................... (1 ) SP [k] + χ jk > SP [l] + χ jl.................................... ( ) Adding he inequaion (1 ) and ( ), we have χ il + χ jk > χ ik + χ jl. Due o he configuraion of poin p i, p j, p k, and p l along he boundary of P i, he pah π ik and π jl mu inerec a lea a a poin, ay θ (ee Figure (b)). The pah π il may may overlap he pah from p i θ along π ik and θ p l along π jl. Similarly, he pah π jk may overlap he pah egmen p j θ along π jl and θ p k along π ik. Combining hee wo, we have χ ik + χ jl > χ il + χ jk. Thu, we have a conradicion, and he reul follow. The pocke P α can be preproceed in g(m) = O(m) ime for he hore pah querie []. Thi preproceed daa rucure along wih he array SP and SP enable u o compue B[i, j] in f(m) = O(log m) ime for any i and j for which B[i, j] i defined. Thu, Π ik Π il θ Π jk (b) Π jl P α p k p l SP enrie

1 1 0 1 0 1 0 1 0 1 compuing Π α, or in oher word, finding he minimum enry in he marix B require O(g(m) + mf(m) log log m) = O(m log m log log m) ime [1]. Since he ime for proceing he pocke are addiive, we have he following reul: Lemma. The oal ime required for compuing a minimum lengh Type-1 one-rech violaion pah i O(n log n log log n)..1. Type- hore one-rech violaion pah Lemma. A Type- one-rech violaion pah Π αβ, α β, wih he wo end-poin of i exernal rech in wo differen pocke P α and P β, repecively, mu pa hrough one of he fronier of boh he pocke. Proof. Follow from he fac ha he exernal rech of Π αβ exi from pocke P α hrough one of i fronier, goe along he boundary of he convex hull, and hen ener he pocke P β hrough one of i fronier (ee Figure (b)). A menioned earlier, he array SP and SP conain he lengh of he hore pah of every verex of he polygon P (inide P ) from and, repecively. We aach wo co C (q) and C (q) wih each verex q of he convex hull CH(P ). Thee are he minimum co of connecing q wih and repecively wih a one-rech violaion pah hrough he pocke adjacen o i. If a convex hull verex q i adjacen o wo pocke, hen we conider i a wo verice, and wo enrie are creaed for hi verex in he array C and C. We conider each pocke P α eparaely; le q and q be he fronier (convex-hull verice) aociaed o he pocke P α. For each verex p i P α, we compue he lengh of he hore pah δ(p i, q) from p i o q inide P α. Nex, we compue C (q) = min pi P α SP [i] + δ(p i, q), and C (q) = min pi P α SP [i] + δ(p i, q). Our nex ak i o compue min α β Π αβ. We conider all he hull verice {q 1, q,..., q k } of he k pocke in clockwie order. Oberve ha, min α β Π αβ = min(min i j π 1(q i, q j ), min i j π (q i, q j )) where π 1 (q i, q j ) = C (q i ) + C (q j ) + he lengh of he clockwie pah from q i o q j along he boundary of CH(P ), π (q i, q j ) = C (q i ) + C (q j ) + he lengh of he aniclockwie pah from q i o q j along he boundary of CH(P ), We explain he mehod of compuing min i j π 1 (q i, q j ) uing he mehod of earching for he minimum enry in a parially monoone revere riing aircae marix. We define a k k marix D whoe row correpond o he verice {q 1, q,..., q k } in order, and whoe column correpond o {q k, q k 1,... q 1 } in order. A in he earlier ubecion, he enrie D[i, j] are undefined if j i; oherwie D[i, j] = π 1 (q i, q j ). Lemma. The marix D i a parially monoone revere riing aircae marix.

1 1 0 1 0 1 0 1 0 1 [ Proof. A ] in he proof of Lemma, we prove ha for any arbirary ub-marix a b, if all he enrie are defined, hen i i monoone. In oher word, if a, b, c, d are c d all defined hen a > b and c < d can no happen imulaneouly. Oherwie, he um of lengh of he clockwie pah q i q k and q j q l hould be ricly greaer ha he um of lengh of he clockwie pah q i q l and q j q k. Thi i impoible ince boh he um are exacly equal. Lemma. The ime complexiy for compuing min α β Π αβ i O(n log log n). Proof. The proceing of a pocke P α involve compuing he hore pah of all i verice from boh of i fronier. Thi can be done in O(m) ime, where m = P α. Since he verice of each pocke i dijoin from ha of oher pocke, C (q i ) and C (q i ) enrie of all he hull verice q i, i = 1,,..., k of he polygon P can be compued in O(n) ime. Uing he C and C array for he hull verice, each enry of he marix D can be obained in O(1) ime. Finding he minimum elemen in he marix D need O(n log log n) ime [1]. Thu, he reul follow.. Complexiy reul Lemmaa and lead o he following reul. Theorem. Given a imple polygon P wih n verice and a pair of poin, P, he ime complexiy for compuing a minimum lengh one-rech violaion pah from o i O(n log n log log n). Monoone recilinear pah wih violaion among recangular obacle In hi ecion, we conider he one-violaion monoone recilinear pah problem beween a pair of poin, among a e of dijoin axi-parallel recangular obacle R = {R 1, R,..., R n } inide an axi-parallel recangle B in R. We borrow he following definiion from []. Definiion. [] (x-monoone Pah) A recilinear pah from p o q i aid o be x- monoone if all horizonal direced edge are from lef o righ. The verical egmen in he pah may be direced in any direcion. Similarly, we can define ( x)-monoone, y-monoone, and ( y)-monoone pah. Definiion. [] (xy-monoone Pah) A recilinear pah from p o q i aid o be xymonoone if all horizonal direced edge are from lef o righ, and all verical direced edge are from boom o op. Similarly we can define ( x)y, x( y), and ( x)( y)-monoone pah.

1 1 0 1 0 1 0 1 0 1 Definiion. [] (Preferred Pah) A y-preferred xy-pah from p i an xy-monoone pah which follow he +y direcion whenever poible. If i encouner an obacle i follow he +x-direcion unil he end of he obacle i reached. Again i reume o move in he +y direcion. The movemen coninue unil i mee he op boundary of he bounding box B. Such a pah i denoed by Π y 1 (p), where 1 in he ubcrip indicae he fir quadran wih repec o p (i.e., xy-monoone pah), and y in he upercrip indicae he y-preferred pah. Similarly, Π x 1 (p), Πy (p), Π x (p), Π x (p), Π y (p), Π y (p), (p) are defined. Π x Here by a violaion we mean a direced line egmen ha goe from righ o lef or from op o boom. We conider he following wo variaion of he problem. P1: Compuing he hore x-monoone pah from o wih a mo one violaion. In oher word, all he horizonal edge are direced from lef o righ excep a mo one edge ha i direced from righ o lef. There i no rericion on he direcion of he verical line egmen. P: Compuing he hore xy-monoone pah from o wih a mo wo violaion. In oher word, all he horizonal edge on he pah from o are direced from lef o righ excep a mo one edge ha i direced from righ o lef, and all he verical edge are direced from boom o op excep a mo one edge ha i direced from op o boom. For a given pair of poin and a he ource and arge of he deired pah, we ue he noaion S 1 o denoe he region bounded by he wo aircae pah Π x 1 () and Πy 1 (). Similarly, he region S i defined by Π y () and Π x (); he region S i defined by Π x () and Π y (); he region S i defined by Π y () and Πx (). The compuaion of each of hee aircae pah and region need oring of he member of R wih repec o heir boom or op boundarie depending on he repecive cae, and i need O(n log n) ime in he wor cae..1 Problem P1: one-violaion recilinear pah Lemma. For any e R of dijoin axi parallel recangular obacle and any pair of poin, in R \ R, here alway exi a x-monoone pah from o wih a mo one violaion. Proof. Le B be an axi-parallel recangle ha conain all he recangle in R. We compue Π y 1 () and Πy () up o he op boundary of B. Le hee mee he op boundary of B a poin α and β, repecively. Now, if α i o he lef of β hen he pah α β ha no violaion edge; oherwie α β i he only violaion edge. Noe ha, hi pah may be elf-inerecing.

1 1 0 1 0 1 0 1 0 1.1.1 Compuaion of hore one-violaion recilinear pah Conider he polygonal line Π y () = Πy 1 () Π y (). If he poin lie o he righ of Π y () (ee Figure (a)), hen he recilinear hore pah from o i x-monoone, and i can be compued in O(n log n) ime (ee de Rezende e al. []). Thu, we need o conider he cae where lie o he lef of he poly-line Π y () (ee Figure (b)). Le u conider he poly-line Π y () = Πy () Π y (). Now, conider a horizonal line egmen l, ha weep along verical direcion, keeping i wo end-poin on Π y () and Π y () repecively. A each inance, if l i no inereced by any one of he member in R, hen we compue he lengh of he recilinear pah a b, where he pah egmen a and b are along Π y (), and Πy () repecively. During hi compuaion, we mainain he minimum lengh pah, and he correponding horizonal line egmen connecing Π y () and Πy () in a emporary orage l = [a, b ]. A he end of he weep, he pah a b i repored. Π y 1() Π y () (a) Figure : Compuaion of hore one-violaion recilinear pah among obacle Theorem. The recilinear hore one-violaion x-monoone pah for a pair of poin and among a e of dijoin recangular obacle can be compued in O(n log n) ime in he wor cae. Proof. If he poin i o he righ of Π y (), hen boh he correcne and ime complexiy reul follow from de Rezende e al. []. If i o he lef of Π y (), hen a feaible oneviolaion pah coni of hree par P 1, P, P, where P 1 i a aircae pah from o a poin in S 1 S, P i a horizonal line egmen direced from righ o lef, and P i a aircae pah from a poin in S S o. Such a pah mu inerec he lef (aircae) boundary of he region S 1 S and he righ (aircae) boundary of he region S S. The correcne follow from he fac ha we have conidered all uch pah, and choen he one having he minimum lengh. Noe ha Π y (), Πy (), and l can be compued in O(n log n) ime by performing a plane weep uing a horizonal weep line. Thu, he reul follow. (b)

1 1 0 1 0 1 0 1 0 1. Problem P: wo-violaion recilinear pah Lemma. For any e R of axi parallel recangular obacle and a pair of poin, R \ R, here alway exi an xy-monoone pah from o wih a mo one violaion in he horizonal direcion and a mo one violaion in he verical direcion. Proof. Le B be an axi-parallel recangular box conaining all he member of R, and le o be i op-lef corner. We compue a xy-monoone pah Ψ 1 from up o a poin b on he op boundary of B in he region S 1, and anoher ( x)( y)-monoone pah Ψ from up o a poin c on he lef boundary of B in he region S. If x() < x() hen hee wo pah may or may no inerec; however if x() > x() hen hee pah will never inerec. If Ψ 1 and Ψ inerec a a poin a, hen he pah a doe no have any violaion. Oherwie, he pah b o c ha one horizonal violaion edge b o and one verical violaion edge o c...1 Compuaion of hore wo-violaion recilinear pah A menioned earlier, if he poin lie in he region S 1 bounded by he aircae Π y 1 () and Π x 1 (), hen he hore pah from o ha no violaion edge []. Thu, we now concenrae on he cae where S 1. b d c θ (a) a Figure : Demonraion of Lemma 1 Lemma 1. If he hore wo violaion xy-monoone pah conain exacly wo violaion (one in boh horizonal and verical direcion), hen he violaion edge are conecuive in he pah. Proof. On he conrary, le he violaion edge are no conecuive, and i of he form: a b c d, where a i a xy-monoone pah, a b i a horizonal (or verical) violaion edge, b c i a xy-monoone pah, and c d i a verical (or horizonal) violaion edge, and d i a x-monoone pah. Here, if he violaion edge inerec (a a poin, ay θ), hen we can horen he pah uing a θ d θ b (b) c a

1 1 0 1 0 1 0 1 0 1 (ee Figure (a)). If he violaion edge do no inerec, hen conider he region S 1 and S. Noe ha he fir violaion edge a b emerge ou of he region S 1, and imilarly, he econd violaion edge c d ener ino he region S. Oberve ha, in hi cae, he pah can be horened and one of he violaion edge can be removed by uing par () or Π x () of he region S. (For an illuraion, conider Figure of he boundarie Π y (b), where uch a wo violaion pah a b c i hown uing olid line, and he correponding horened pah a b θ i hown uing doed line, where θ i a xy-monoone pah on he boundary of S.) By Lemma 1, he violaion edge occur in pair. We now decribe wo ype of violaion pah, where he violaion are (a) a horizonal edge followed by a verical edge (ee Figure (a)) or (b) a verical edge followed by a horizonal edge (ee Figure (b)). (a) Figure : Minimum lengh wo violaion pah - demonraion of Cae (a) and (b) We now explain he mehod of generaing he hore wo violaion pah of ype (a). Le Ψ 1 be a xy-monoone pah from in he region S 1, and Ψ be a ( x)( y)-monoone pah from in he region S. A menioned in Lemma, any L-pah ha connec Ψ 1 and Ψ produce a feaible xy-monoone pah from o wih wo conecuive violaion edge - one in horizonal followed by he oher one in he verical direcion. In order o have he minimum lengh pah among he poible pah of ype (i) we will connec he lef boundary of S 1 (i.e., Ψ 1 = Π y 1 ()) and he lef boundary of S (i.e. Ψ = Π x ()) by an L-pah compoed of a horizonal violaion edge and a verical violaion edge. Thu, we generae a equence Φ 1 of horizonal violaion edge and a equence Φ of verical violaion edge (hown by blue horizonal line and green verical line repecively, in Figure ). Each member of Φ 1 (horizonal violaion edge) originae from Ψ 1, no inereced by any member of R, and end a he righ boundary of a member of R or he lef boundary of B. Thee egmen are generaed by weeping a horizonal line upward from or depending on which one i above, and heir righ-end move along Ψ 1. During he generaion of hee horizonal violaion edge, we ore only hoe which form a ricly decreaing equence wih repec o he x-coordinae of heir lef end-poin from boom o op. The reaon i ha, if a member of v Φ doe no inerec a member h Φ 1 wih i lef end-poin a x = α, hen i canno inerec anoher member h Φ 1 above If i above, hen any one-violaion pah, if exi, will be of maller lengh han any wo violaion pah, and we can ge an one-violaion pah of minimum lengh (if exi) a in Subecion.1.1. (b)

1 1 0 1 0 1 0 1 0 1 h wih lef end-poin a x > α. The generaion of Φ 1 need a heigh-balanced binary ree for oring he member of R encounered during he weep a an inance of ime in order of heir righ boundarie. The generaed egmen in Φ 1 are ored in he form of a ack. Similarly, anoher equence Φ of verical violaion edge are generaed, which are aached o Ψ and he y-coordinae of heir op end-poin are ricly decreaing from lef o righ. The member of Φ are alo ored in he form of a ack. Nex, in a linear can over Φ 1 and Φ we can idenify a member Φ 1 wih minimum y-coordinae ha inerec a member of Φ wih maximum x-coordinae. Le ab Φ 1 and bc Φ be hee ick. Thu, we have a wo violaion pah a b c (ee Figure, where he L-pah correponding o he wo violaion edge are hown uing bold red line). The enire proce ake O(n log n) ime. b c Ψ L-pah Figure : Generaion of a wo violaion pah in Cae (a) Similarly, we can compue he hore pah of ype (b) by proceing Ψ 1 = Π x 1 () and Ψ = Π y (). Finally, he hore one among he pah obained in Cae (a) and Cae (b) i repored. Theorem. The minimum lengh wo violaion xy-monoone pah from o among a e of dijoin recangular obacle can be compued in O(n log n) ime. Concluion In hi paper, we inroduced a new concep of hore pah wih violaion wih an aim o reduce he co of he pah. To he be of our knowledge hi i he fir aemp of udying hee varian of he claical geomeric hore pah problem. We preened an O(n ) ime algorihm for compuing a one-violaion hore pah beween a pair of poin inide a imple polygon. I will be inereing if a ub-cubic ime algorihm for hi problem can be devied. Anoher inereing problem in hi conex i o compue he hore one-violaion pah map for poin, where he inpu i he imple polygon P and he poin, and he oupu i a daa rucure which, for a given query poin q P, can repor he lengh of he hore one-violaion pah from o q efficienly. We alo how ha, for a given pair of poin and in recilinear polygon, he hore one-violaion pah from o can be repored in O(n log n) ime. We define he a Ψ 1