arxiv: v2 [cs.cg] 10 Apr 2018

Size: px
Start display at page:

Download "arxiv: v2 [cs.cg] 10 Apr 2018"

Transcription

1 Fast Fréchet Distance Between Curves with Long Edges Joachim Gudmundsson 1, Majid Mirzanezhad 2, Ali Mohades 3, and Carola Wenk 2 1 University of Sydney, Australia, joachim.gudmundsson@sydney.edu.au 2 Tulane University, New Orleans, USA {mmirzane,cwenk}@tulane.edu 3 Amirkabir University of Technology, Tehran, Iran, mohades@aut.ac.ir arxiv: v2 [cs.cg] 10 Apr 2018 Abstract Computing the Fréchet distance between two polygonal curves takes roughly quadratic time. In this paper, we show that for a special class of curves the Fréchet distance computations become easier. Let and Q be two polygonal curves in R d with n and m vertices, respectively. We prove four results for the case when all edges of both curves are long compared to the Fréchet distance between them: (1) a linear-time algorithm for deciding the Fréchet distance between two curves, (2) an algorithm that computes the Fréchet distance in O((n + m) log(n + m)) time, (3) a linear-time d -approximation algorithm, and (4) a data structure that supports O(m log 2 n)- time decision queries, where m is the number of vertices of the query curve and n the number of vertices of the preprocessed curve ACM Subject Classification F.2.2 [Nonnumerical Algorithms and roblems] Geometrical problems and computations Keywords and phrases Computational Geometry - Fréchet distance - Approximation algorithm - Data structure Digital Object Identifier /LIIcs.CVIT Introduction Measuring the similarity between two curves is an important problem that has applications in many areas, e.g., in morphing [11], movement analysis [12], handwriting recognition [18] and protein structure alignment [16]. Fréchet distance is one of the most popular similarity measures which has received considerable attentions in recent years. It is intuitively the minimum length of the leash that connects a man and dog walking across the curves without going backward. The classical algorithm of computing the Fréchet distance between curve with total complexity n runs in O(n 2 log n) time [2]. The major goal of this paper is to focus on computing the Fréchet distance for a reasonable special class of curves in significantly faster than quadratic time. 1.1 Related Work Buchin et al [7] gave an Ω(n log n) lower bound for computing the Fréchet distance. Then Bringmann [5] showed that, assuming the Strong Exponential Time Hypothesis, the Fréchet distance cannot be computed in strongly subquadratic time, i.e., in time O(n 2 ɛ ) for any ɛ > 0. For the discrete Fréchet distance, which considers only distances between the vertices, Agarwal et al. [1] gave an algorithm with a (mildly) subquadratic running time of 2 log log n O(n ). Buchin et al. [8] showed that continuous Fréchet distance can be computed log n Joachim Gudmundsson, Majid Mirzanezhad, Ali Mohades, and Carola Wenk; licensed under Creative Commons License CC-BY 42nd Conference on Very Important Topics (CVIT 2016). Editors: John Q. Open and Joan R. Acces; Article No. 23; pp. 23:1 23:20 Leibniz International roceedings in Informatics Schloss Dagstuhl Leibniz-Zentrum für Informatik, Dagstuhl ublishing, Germany

2 23:2 Fast Fréchet Distance Between Curves with Long Edges in O(n 2 log n(log log n) 3/2 ) expected time. Bringmann and Mulzer [6] gave a O(n 2 /φ + n log n)-time algorithm to compute a φ-approximation of the discrete Fréchet distance for any integer 1 φ n. Therefore, an n ɛ -approximation for any ɛ > 0 can be computed in (strongly) subquadratic time. For the continuous Fréchet distance, there are also a few subquadratic algorithms known for restricted classes of curves such as κ-bounded, backbone and c-packed curves. Alt et al. [3] considered κ-bounded curves and they gave an O(n log n) time algorithm to κ-approximate the Fréchet distance. A curve is κ-bounded if for any two points x, y, the union of the balls with radii r centered at x and y contains the whole [x, y] where r is equal to (κ/2) times the Euclidean distance between x and y. For any ɛ > 0, Aronov et al. [4] provided a near-linear time (1 + ɛ)-approximation algorithm for the discrete Fréchet distance for socalled backbone curves that have essentially constant edge length and require a minimum distance between non-consecutive vertices. For c-packed curves a (1 + ɛ)-approximation can be computed in O(cn/ɛ+cn log n) time [10]. A curve is c-packed if for any ball B, the length of the portion of contained in B is at most c times the diameter of B. 1.2 Our Contribution In this paper, we study a new class of curves, namely curves with long edges, and we show that for these curves the Fréchet distance can be computed significantly faster than quadratic time. In a particular application, one might be interested in detecting groups of different movement patterns in migratory birds that fly very long distances. As shown in Fig. 1, different flyways are comparatively straight and the trajectory data of individual birds usually consists of only one GS sample per day in order to conserve battery power. Infrequent sampling and the straight flyways therefore result in curves with long edges, and it is desirable to compare the routes of different animals in order to identify common flyways. Figure 1 There are four typical flyways across the U.S.. Clustering the trajectories by similarity between them provides us to realize the most common movement pattern [17]. We consider the decision, optimization, approximation and data structure problems for the Fréchet distance between two polygonal curves and Q in R d with n and m vertices, respectively, all for the case where all edges of both curves are long compared to the Fréchet distance between them. In Section 3 we present a greedy linear-time algorithm for deciding whether the Fréchet distance is at most ε, as long as all edges in are at least 2ε long and edges in Q are at least (1 + d)ε long. In Section 4 we give an algorithm for computing the Fréchet distance in O((n + m) log(n + m)) time and a linear-time algorithm to approximate the Fréchet distance up to a factor of d. In Section 5 we give a data structure that

3 J. Gudmundsson, M. Mirzanezhad, A. Mohades, and C. Wenk 23:3 decides Fréchet distance in O(m log 2 n) query time using O(n log n) space and preprocessing time, where m is the number of vertices of the query curve and n the number of vertices of the preprocessed curve. 2 reliminaries In this section we provide notations and definitions that will be required in the next sections. Let : [1, n] R d and Q : [1, m] R d be two polygonal curves with vertices p 1,, p n and q 1,, q m, respectively. We treat a polygonal curve as a continuous map : [1, n] R d where (i) = p i for an integer i, and the i-th edge is linearly parametrized as (i + λ) = (1 λ)p i + λp i+1, for integer i and 0 < λ < 1. A re-parametrization σ : [0, 1] [1, n] of is any continuous, non-decreasing function such that σ(0) = 1 and σ(1) = n. We denote a re-parametrization of Q by θ : [0, 1] [1, m]. We denote the length of the shortest edge in and the length of the shortest edge in Q by l and l Q, respectively. For two points x, y R d, let x y denote the Euclidean distance between the points. For 1 a b n, [a, b] denotes the subcurve of starting in (a) and ending in (b). Let ε > 0 be a real number. Consider an edge e = Q[1, 2] of length e > 2ε. Let B(p, ε) = {x R d p x ε} be the ball with radius ε that is centered at a point p. The cylinder C(e, ε) is the set of points in R d within distance ε from e, i.e. C(e, ε) = x e B(x, ε). is (e, ε)-monotone if (1) p 1 B(e 1, ε) and p n B(e 2, ε), (2) C(e, ε), and (3) is monotone with respect to the line supporting e. A curve is monotone with respect to a line l if it intersects any hyperplane perpendicular to l at most once. 2.1 Fréchet Distance and Free-Space Diagram To compute the Fréchet distance between and Q, Alt and Godau [2] introduced the notion of free-space diagram. For any ε > 0, we denote the free-space diagram between and Q q 7 q 8 p 10 q p 6 q p 9 8 p 5 q 4 q 3 7 p 6 p 5 q 1 Q(t) p 1 Q q p 2 2 p 4 (s) Q t 2 p 3 ε s Figure 2 (s, t) is a free point on a reachable path in FSD ε (, Q), where white space contains free points and gray space contains blocked points. There are a quadratic number of cells containing free space as well as a quadratic number of cells containing blocked space in FSD ε (, Q) and all of them may need to be checked to decide reachability for (n, m). Note that curves contain short edges as well as long edges compared to ε and some consecutive purple vertical intervals intersects which cause many possibilities for searching for the reachable path. C V I T

4 23:4 Fast Fréchet Distance Between Curves with Long Edges by FSD ε (, Q). This diagram has the domain of [0, n] [0, m] and it consists of n m cells, where each point (s, t) in the diagram corresponds to two points (s) and Q(t). A point (s, t) in FSD ε (, Q) is called free if (s) Q(t) ε and blocked, otherwise. The union of all free points is referred to as the free space. A monotone matching between and Q is a pair of re-parameterizations (σ, θ) corresponding to an xy-monotone path from [0, 0] to [n, m] within the free space in FSD ε (, Q). The Fréchet distance between two curves is defined as δ F (, Q) = inf (σ,θ) max 0 t 1 (σ(t)) Q(θ(t)), where (σ, θ) is a monotone matching and max 0 t 1 (σ(t)) Q(θ(t)) is called the width of the matching. A monotone matching realizing δ F (, Q) is called a Fréchet matching. A point (s, t) is reachable if there exists a Fréchet matching from [0, 0] to [s, t] in FSD ε (, Q). A Fréchet matching in FSD ε (, Q) from (0, 0) to (s, t) is also called a reachable path for (s, t) (see Fig. 2). Alt and Godau [2] compute a reachable path by propagating reachable points across free space cell boundaries in a dynamic programming manner, which requires the exploration of the entire FSD ε (, Q) and takes O(mn) time. 2.2 The Main Idea We set out to provide faster algorithms for the Fréchet distance using implicit structural properties of the free-space diagram of curves with long edges. These properties will allow us to develop greedy algorithms that construct valid re-parameterizations by repeatedly computing a maximally reachable subcurve on one of the curves. Like the greedy algorithm proposed by Bringmann and Mulzer [6], we compute prefix subcurves that have a valid Fréchet distance. However, while the approximation ratio of their greedy algorithm is exponential, the approximation ratio of the algorithm we present in Section 4.2 is constant, because we can take advantage of the curves having long edges. Our assumption on edge lengths is more general than backbone curves, since we do not require that non-consecutive vertices be far away from each other and we do not require any upper bound on the length of the edges. The free space diagram for curves with long edges is simpler, and intuitively seems to have fewer reachable paths (see Fig. 3). In the remainder of this paper we show that indeed we can exploit this simpler structure to compute reachable paths in a simple greedy manner which results in runtimes that are significantly faster than quadratic. We show that by setting up a greedy-based approach the reachable path, if it exists, can be found efficiently. 3 A Greedy Decision Algorithm In this section we give a linear time algorithm for deciding whether the Fréchet distance between two polygonal curves and Q in R d with relatively long edges is at most ε. In Section 3.1, we first prove a structural property for the case that each edge in is longer than 2ε and Q is a single segment. Afterwards in Section 3.2, we consider the extension to the case that and Q are two polygonal curves with edges longer than 2ε and (1 + d)ε, respectively. In Section 3.3, we present our greedy algorithm, which is based on computing longest reachable prefixes in with respect to each segment in Q. In Section 3.4, we provide a critical example in which our greedy algorithm fails when the assumption on the edge lengths does not hold.

5 J. Gudmundsson, M. Mirzanezhad, A. Mohades, and C. Wenk 23:5 Q 7 6 Q q 7 q 5 5 p 6 p 5 q 6 4 q 1 p 1 q 4 p 3 p 4 q 2 3 q 3 p 2 2 ε Figure 3 FSD ε (, Q) for curves with long edges results in fewer reachable paths for (n, m). In the remainder of this paper we show how to find such a path without requiring to check the entire free space diagram. Consider the vertical (free) intervals on the lines that correspond to vertices of. The intervals shown in purple are the ones that intersect the green reachable path. Since l > 2ε, no consecutive purple intervals intersect which is a property we exploit. 3.1 A Simple Fréchet Matching for a Single Segment In this section we start by introducing the crucial notion of orthogonal matching between a polygonal curve and a single line segment e. An orthogonal matching projects each point from to its closest point on e. In particular, it maps vertices of either orthogonally to the segment e or directly to the endpoints of e. Definition 1 (Orthogonal Matching). Let ε > 0, : [1, n] R d be a polygonal curve, and e : [1, 2] R d be a line segment. A Fréchet matching (σ, θ) realizing δ F (, e) ε is called an orthogonal matching of width ε if and only if for all t [0, 1], (σ(t)) e(θ(t)) = min 1 s 2 (σ(t)) e(s) ε; see Fig. 4(a). p 1 e 2 e 1 e ε p n (a) H e 2 p 1 p i+1 p n e e e 2 1 I i+1 I i p i ε b i a i p b i+1 a i+1 e 1 I i I i+1 i i + 1 (b) Figure 4 (a) In this example is (e, ε)-monotone and the green arrows indicate an orthogonal matching between and e. (b) Illustration of the case H e = in the proof of Lemma 2 (1) (2). Now we state a key lemma that demonstrates that the orthogonal matching between the curve with long edges and the segment e exits if and only if δ F (, e) ε, and this is equivalent to being (e, ε)-monotone. C V I T

6 23:6 Fast Fréchet Distance Between Curves with Long Edges Lemma 2 (Orthogonal Matching and Monotonicity). Let ε > 0, : [1, n] R d be a polygonal curve such that l > 2ε, and e : [1, 2] R d be a line segment. Then the following three are equivalent: 1. δ F (, e) ε, 2. is (e, ε)-monotone, 3. and e admit an orthogonal matching of width at most ε. roof. For all i = 1,, n, define I i = B(p i, ε) e = e[a i, b i ]. Because l > 2ε, we know that I i I i+1 =. Note that (3) implies (1) by Definition 1. To prove (1) (2), if δ F (, e) ε, then it is obvious to see that p 1 B(e 1, ε), p n B(e 2, ε), and C(e, ε). It remains to show that is monotone with respect to the line l supporting e. Let (σ, θ) be a monotone matching realizing δ F (, e) ε. For sake of contradiction assume there exists a hyperplane H perpendicular to l such that intersects H in at least two points (x) and (y), where x < y. Let p i be the last vertex along [x, y], and recall that e 1 and e 2 are the two vertices of e. First assume that H e. Then p i lies on the e 2 -side of H and p i+1 lies on the e 1 -side of H. Therefore, because I i I i+1 =, we know that a i > b i+1. Let t i, t i+1 [0, 1] be two values such that p i = (σ(t i )) and p i+1 = (σ(t i+1 )), where t i < t i+1. From σ(t i ) a i and σ(t i+1 ) b i+1, we know that σ(t i ) > σ(t i+1 ), which violates the monotonicity of (σ, θ), see Fig. 4(b). Now consider the case that H e =. Then p i lies on one side of H, and e lies entirely on the other side. If H B(e 1, ε), then we know that [1, y] B(e 1, ε). But this is not possible since all edges of are longer than 2ε. The same argument holds if H B(e 2, ε). To prove (2) (3), let H be an arbitrary hyperplane perpendicular to l which splits at some point (x). Let p i be the last vertex along [1, x]. By construction, p i and p i+1 are on opposite sides of H. Since p 1 is on the e 1 -side of H, p i must also lie on the e 1 -side of H, because otherwise H would intersect at least twice. On the other hand, I i I i+1 =, therefore, b i < a i+1. Now, let (σ, θ) be a matching of width at most ε such that for all t [0, 1], (σ(t)) e(θ(t)) = min 1 s 2 (σ(t)) e(s) ε. Then let t i [0, 1] be values such that (σ(t i )) = p i for all i = 1, n. Note that θ(t i ) I i = [a i, b i ] and b i < a i+1, therefore, θ(t i ) < θ(t i+1 ) where t i < t i+1. This indicates that (σ, θ) is a monotone matching of width ε, therefore (σ, θ) is an orthogonal matching width ε. In fact Lemma 2 shows that for a curve with long edges, the Fréchet distance to a line segment e is determined by examining whether is (e, ε)-monotone or not. 3.2 A Simple Fréchet Matching for More than One Segment In this section, we extend the matching between a curve and a single line-segment e to a matching between two curves and Q. Definition 3 (Longest ε-refix). Let ε > 0, : [1, n] R d be a polygonal curve, and e : [1, 2] R d be a line segment. Define γ = max{ t 1 t n and δ F ( [1, t], e) = ε}. We call [1, γ] the longest ε-prefix of with respect to e. We now use the longest ε-prefix to define an extension of the matching introduced in Definition 1. Definition 3 is the basis of our greedy algorithm (Algorithm 1) which is presented in the next section. We show that if there exists a matching between two curves, then one can necessarily cut it into m orthogonal matchings between each segment in Q and the corresponding longest ε-prefix. Before we reach this property, we need the following technical lemma:

7 J. Gudmundsson, M. Mirzanezhad, A. Mohades, and C. Wenk 23:7 Lemma 4 (( dε)-ball). Let ε > 0 and let : [1, n] R d be a polygonal curve such that l > 2ε. Let e : [1, 2] R d where e > 2ε. Assume that [1, γ] is the longest ε-prefix of with respect to e, and α be a parameter such that (α) is the first point along that intersects B(e 2, ε). Then [α, γ] B(e 2, dε). roof. By assumption e > 2ε, we know that B(e 1, ε) B(e 2, ε) =, thus α exists. Notice that [α, γ] C(e, ε). Let H be the hyperplane intersecting Q[i 1, i] that is perpendicular to e and is tangent to B(e 2, ε). Hence H splits [1, γ] into two parts, the part on e 1 -side and the part that on e 2 - side. Let (x) be the last vertex before (γ). By Definition 3, δ F ( [1, γ], e) ε, and if (x) B(e 2, ε), then Lemma 2 [1, x] is (e, ε)-monotone. Thus [α, γ] must lie on the e 2 -side of H 2, and in particular inside the cube enclosing B(e 2, ε) (see Fig. 5). Therefore the maximum possible distance between any point in [α, γ] and e 2 is dε. If (x) / B(e2, ε), then [α, γ] is a line segment and lies trivially inside B(e 2, ε). H p 1 e e 2 e 1 (α) ε (x) (γ) Figure 5 The farthest point in [α, γ] from e 2 must lie inside the cube enclosing B(e 2, ε). Corollary 5 ((3ε)-Ball). Let ε > 0 and let : [1, n] R d be a polygonal curve. Let e : [1, 2] R d where e > 2ε. Assume that [1, γ] is the longest ε-prefix of with respect to e and (α) is the first point along that intersects B(e 2, ε). Then [α, γ] B(e 2, 3ε). roof. Although there exists a similar proof in Lemma 11 of Gudmunsson and Smid [14], we describe a slight modification of the proof that is necessary for our setting. Suppose (σ, θ) is a Fréchet matching realizing δ F ( [1, γ], e) ε. Let x [α, γ] such that (x) is the farthest point to e 2. We need to show that (x) e 2 3ε which concludes [α, γ] B(e 2, 3ε). Let t α, t γ [0, 1] be two values such that α = σ(t α ) and γ = σ(t γ ). Note that there exists some t x [t α, t γ ] such that x = σ(t x ). By the triangle inequality we have: (x) e 2 (x) e(θ(t x )) + e(θ(t x )) e 2 ε + e(θ(t x )) e 2. Note that t x > t α and we can have e(θ(t x )) e 2 e(θ(t α )) e 2, hence: (x) e 2 ε + e(θ(t α )) e 2. By applying triangle inequality once more the we have: (x) e 2 ε + e(θ(t α )) (α) + (α) e 2 3ε. Therefore, (x) e 2 3ε. Now we show that if δ F (, Q) ε, then the two polygonal curves and Q admit a piecewise orthogonal matching, which can be obtained by computing longest ε-prefixes of with respect to each segment of Q. This lemma is the foundation of our greedy algorithm (Algorithm 1). C V I T

8 23:8 Fast Fréchet Distance Between Curves with Long Edges Q 3 q 1 Q (α 2) q 2 ε θ(t γ ) 2 q 3 (γ 3) (α 3) (γ 2) 1 1 σ(t 2 ) σ(t γ ) = γ σ(t 3 ) Figure 6 Given an arbitrary matching (the concatenation of the light and dark green reachable paths), the orthogonal matching (the brown reachable path) between [p 1, γ 2] and Q[1, 2] exists. We construct a matching realizing δ F ( [γ, n], Q[2, m]) ε as the concatenation of the pink and the dark green reachable paths. Lemma 6 (The Cutting Lemma). Let ε > 0, and let : [1, n] R d and Q : [1, m] R d be two polygonal curves such that l > 2ε and l Q > (1 + d)ε. If δ F (, Q) ε, then [1, γ] as the longest ε-prefix of with respect to Q[1, 2] exists, δ F ( [1, γ], Q[1, 2]) ε and δ F ( [γ, n], Q[2, m]) ε. roof. Let (σ, θ) be any Fréchet matching realizing δ F (, Q) ε. This corresponds to a reachable path, which shown as the concatenation of light and dark green in the example in Fig. 6. Let t 2 [0, 1] be the largest value such that Q(θ(t 2 )) = q 2, hence δ F ( [1, σ(t 2 )], Q[1, 2]) ε. By Definition 3, γ exists with γ σ(t 2 ), and δ F ( [1, γ], Q[1, 2]) ε. See the brown reachable path corresponding to the orthogonal matching realizing δ F ( [1, γ], Q[1, 2]) ε in Fig. 6. In the remainder of this proof we construct a matching to prove that δ F ( [γ, n], Q[2, m]) ε (the concatenation of pink and dark green paths). Let t γ [0, 1] be the largest value such that (σ(t γ )) = (γ). By Lemma 4, [σ(t 2 ), γ] B(q 2, dε). Now let t 3 [0, 1] be the smallest value such that Q(θ(t 3 )) = q 3. We have q 2 q 3 > (1 + d)ε, therefore B(q 2, dε) B(q 3, ε) = and thus (σ, θ) cannot match q 3 to any point in [σ(t 2 ), γ]. Therefore, σ(t 2 ) γ = σ(t γ ) < σ(t 3 ), and correspondingly θ(t 2 ) θ(t γ ) < θ(t 3 ). Now we construct a new matching ( σ, θ) realizing δ F ( [γ, n], Q[2, m]) ε as follows: σ(t) = σ(t) and θ(t) = θ(t) for all t γ t 1 (the dark green reachable path). On the other hand, since (γ) q 2 ε (pink point) and (γ) Q(θ(t γ )) ε (the dark green point), we know that Q[2, θ(t γ )] B( (γ), ε) i.e., the pink vertical segment is free. We set, σ(t) = γ and θ(t) = tγ t t γ 2 + t t γ θ(t γ ) for all t 2 t t γ (the pink reachable path). Therefore, we have δ F ( [γ, n], Q[2, m]) ε, which completes the proof. Now since by Lemma 6 we have δ F ( [1, γ], Q[1, 2]) ε, Lemma 2 implies that the matching between [1, γ] and Q[1, 2] is orthogonal. Note that if the last edge in [1, γ] is shorter than 2ε, we can adjust the orthogonal matching by simply mapping all points on the last edge to q 2. In addition, if and Q have long edges then the free-space diagram is simpler than in the general case, since the entire vertical space (the pink segment in Fig. 6) between two points (γ, 2) and (γ, θ(t γ )) has to be free and cannot contain any blocked points.

9 J. Gudmundsson, M. Mirzanezhad, A. Mohades, and C. Wenk 23:9 3.3 The Algorithm In this section we present a linear time algorithm using the properties provided in Section 3.1. At the heart of our decision algorithm is the greedy algorithm presented in Algorithm 1. The input to this DecisionAlgorithm is two polygonal curves and Q, and ε > 0. The algorithm assumes that and Q have long edges. In each iteration the function LongestEpsilonrefix returns γ, where [s, γ] is the longest ε-prefix of [s, n] with respect to Q[i 1, i], if it exists. Here, s is the parameter of where (s) is the endpoint of the previous longest ε-prefix with respect to Q[i 2, i 1]. At any time in the algorithm, if γ = null, this means that the corresponding longest ε-prefix does not exist and then No is returned. Otherwise, the next edge of Q is processed. This continues iteratively until all edges have been processed, or until no γ exists. Algorithm 1: Decide whether δ F (, Q) ε 1 DecisionAlgorithm( [1, n], Q[1, m], ε) 2 // Assumes l > 2ε and l Q > (1 + d)ε 3 s 1 4 for i 2 to m do 5 γ LongestEpsilonrefix( [s, n], Q[i 1, i], ε) 6 if γ = null then return No 7 s γ 8 if γ < n then return No 9 return Yes Computing the Longest ε-refix: Consider a segment Q[i 1, i] of Q in the (i 1)st iteration of Algorithm 1 and let γ i be the value of γ computed in the i-th iteration of the for loop in line 5 of the algorithm. From Lemma 2 follows that [γ i 1, γ i ] and Q[i 1, i] admit the orthogonal matching if and only if [γ i 1, γ i ] is (e, ε)-monotone, i.e., (1) (γ i 1 ) B(q i 1, ε) and (γ i ) B(q i, ε), (2) [γ i 1, γ i ] C(Q[i 1, i], ε), and (3) [γ i 1, γ i ] is monotone with respect to the line supporting Q[i 1, i]. Now Lemma 2 can be used to implement the LongestEpsilonrefix procedure as follows: Determine the first edge on [γ i 1, n] which violates three above with respect to Q[i 1, i]. If the violation occurs before reaching B(q i, ε), then obviously γ i = null. Otherwise we intersect the first violating edge along [γ i 1, n] with the boundary of B(q i, ε) to find γ. Clearly, the whole process takes linear time. Now we prove the correctness of our decision algorithm: Theorem 7 (Correctness). Let ε > 0, and let : [1, n] R d and Q : [1, m] R d be two polygonal curves such that l > 2ε and l Q > (1+ d)ε. Then DecisionAlgorithm(, Q, ε) returns Yes if and only if δ F (, Q) ε. roof. If the algorithm returns Yes then the sequence {(q i, γ i )} for all i = 1,, m with γ 1 = p 1 and γ m = n describes a monotone matching that realizes δ F (, Q) ε. If δ F (, Q) ε, then we use Lemma 6 to prove by induction on i that the algorithm returns Yes, i.e., all longest ε-prefixes ( [1, γ 2 ], [γ 2, γ 3 ],, [γ m 1, γ m ]) of with respect to the corresponding segments of Q exist. For i = 2, following Lemma 6, γ 2 exists and can be found by the algorithm. For any i > 2, the algorithm has determined γ 2,, γ i 1 already and by Lemma 6, δ F ( [γ i 1, n], Q[i 1, m]) ε. Another application of Lemma 6 yields that δ F ( [γ i 1, γ i ], Q[i 1, i]) ε and δ F ( [γ i, n], Q[i, m]) ε. C V I T

10 23:10 Fast Fréchet Distance Between Curves with Long Edges In the case that i = m 1 it remains to prove that γ i+1 = γ m = n. For the sake of contradiction, assume γ m < n. Since [γ m 1, γ m ] is the longest ε-prefix, there is no other γ m (γ m, n] such that δ F ( [γ m 1, γ m], Q[m 1, m]) ε. Consequently, δ F ( [γ m 1, γ m], Q[m 1, m]) > ε and therefore δ F ( [γ m 1, n], Q[m 1, m]) > ε. Applying the contrapositive of Lemma 6 to [γ m 1, n] and Q[m 1, m] yields δ F (, Q) > ε, which is a contradiction. Therefore γ m = n and the algorithm returns Yes as claimed. Observation 8 (iecewise Orthogonal Matching). If δ F (, Q) ε, then the sequence {γ 1, γ 2,, γ n } computed by Algorithm 1 induces a Fréchet matching that maps (γ i ) to q i, for all i = 2,, m. Lemma 2 implies that the matching between [γ i 1, γ i ] and Q[i 1, i] is the orthogonal matching. We summarize this section with the following theorem: Theorem 9 (Runtime). Let ε > 0, and let : [1, n] R d and Q : [1, m] R d be two polygonal curves such that l > 2ε and l Q > (1 + d)ε. Then there exists a greedy decision algorithm, Algorithm 1, that can determine whether δ F (, Q) ε in O(n + m) time. roof. The number of vertices in [γ i 1, γ i ] is at most γ i γ i The algorithm greedily finds the longest ε-prefix per edge Q[i 1, i] by calling LongestEpsilonrefix( [s, n], Q[i 1, i], ε) in O( γ i γ i 1 +1) time. The for-loop iterates over m 1 edges, thus the runtime is m i=2 ( γ i γ i 1 +1) < m i=2 (γ i γ i 1 +2) = γ m γ 1 +2(m 1) = n 1+2m 2 = O(n+m). Our algorithm also can be applied to the case that one curve has arbitrary edge lengths and the other curve has edge length greater than 4ε. Corollary 10 (Single Curve with Long Edges). Let ε > 0, and let : [1, n] R d and Q : [1, m] R d be two polygonal curves such that l > 0 and l Q > 4ε. Then there exists a greedy decision algorithm, Algorithm 1, that can determine δ F (, Q) ε in O(n + m) time. roof. In the proof of Lemma 6, we can replace Lemma 4 with Corollary 5, and realize that Lemma 6 also holds for the case l > 0 and l Q > 4ε. However, we cannot implement LongestEpsilonrefix as stated before because Lemma 2 does not hold if has arbitrary edge lengths. However, we can perform a simple reachability propagation in the free space in FSD ε ( [γ i 1, n], Q[i 1, i]), and determine γ i as the rightmost reachable point on the top boundary of the free space. This takes linear time per edge. The rest follows from Theorem Necessity of the Assumption As we have seen so far, Algorithm 1 greedily constructs a feasible Fréchet matching by linearly walking on curve to find all longest ε-prefixes on it with respect to the corresponding edges of Q. Unfortunately, this property is not always true for curves with short edges. In general, there can be (combinatorially) quadratically many blocked points (regions) in the free space diagram of two curves; see Fig. 7 as an example of two curves in R 2 that have edges of length exactly equal 2ε except for some edges of lengths in [2ε, (1 + 2)ε]. This example demonstrates that our simple greedy construction of a Fréchet matching is unlikely to work if the edges are shorter than the assumptions we made. It also shows that our greedy construction does not work if both curves have edge lengths of at least 2ε.

11 J. Gudmundsson, M. Mirzanezhad, A. Mohades, and C. Wenk 23:11 ε p 1, p 3, p 7 p 6 Q q 1, q 7 q 3 Q q 4, q 6 1.9ε p 2, p 4 p ε λ ε q 2 q 5 γ 2 Figure 7 An example in which the greedy algorithm fails to realize the Fréchet matching highlighted in green. Here, [1, γ 2] is the longest ε-prefix in with respect to Q[1, 2], as illustrated by the red reachable path. Also Q[1, λ] is the longest ε-prefix in Q with respect to [1, 2] as illustrated by the blue reachable path. Every edge is 2ε long, except for the edges Q[1, 2] and Q[2, 3] that have lengths 2.02ε and 2.005ε, respectively. The latter values are still in the range [2ε, (1 + 2)ε]. 4 Optimization and Approximation In this section, we present two algorithms for computing and approximating the Fréchet distance between two curves with long edges, respectively. First we give an exact algorithm which runs in O((n + m) log(n + m)) time. Afterwards, we present a linear time algorithm which is similar to the greedy decision algorithm, but it uses the notion of minimum prefix to approximate the Fréchet distance. 4.1 Optimization The main idea of our algorithm is that we compute critical values of the Fréchet distance between two curves and then perform binary search on these to find the optimal value acquired by the decision algorithm. In general, there are a cubic number of critical values, which are candidate values for the Fréchet distance between two polygonal curves. These critical values are those ε for which p 1 B(q 1, ε) or p n B(q m, ε), or when decreasing ε slightly a free space interval disappears on the boundary of a free space cell or a monotone path in the free space becomes non-monotone. See Alt and Godau [2] for more details on critical values. In our case we can show that it suffices to consider only a linear number of critical values, because the assumption on the edge lengths of the curves implies that a piecewise orthogonal matching exists, which reduces the number of possible critical values. Our optimization algorithm consists of the following three steps: 1. Run DecisionAlgorithm(, Q, ε 0 ) with ε 0 = min{l /2, l Q /(1+ d)} and store all γ i = LongestEpsilonrefix( [γ i 1, n], Q[i 1, i], ε 0 ). Only proceed if DecisionAlgorithm(, Q, ε 0 ) returns Yes. 2. Compute C := m i=2 C i, where C i is the set of all critical values for [α i 1, γ i ] and Q[i 1, i]. Here, α i is the parameter such that (α i ) is the first point along [γ i 1, n] that intersects B(q i, ε 0 ). C V I T

12 23:12 Fast Fréchet Distance Between Curves with Long Edges 3. Sort C and perform binary search on C using DecisionAlgorithm(, Q, ) to find ε = δ F (, Q). Let γi = LongestEpsilonrefix( [γi 1, n], Q[i 1, i], ε ), for all i = 1,, m. By Observation 8, we know that there exists a piecewise orthogonal matching that maps [γi 1, γ i ] to Q[i 1, i]. Therefore we only need to consider those critical values that occur between each segment in Q and its corresponding longest ε -prefix in. However, the value ε and correspondingly, γi are not known beforehand. We can show that it suffices to consider [α i 1, γ i ] instead of [γi 1, γ i ] when computing critical values with respect to Q[i 1, i]. Here, αi is defined with respect to ε. Observe that α i αi γ i γ i for all i = 1,, m, by definition of αi, γ i and because B(q i, ε ) B(q i, ε 0 ), see Fig. 8. Therefore, [γi 1, γ i ] is a subcurve of [α i 1, γ i ]. Now it can be easily seen that all critical values for [γi 1, γ i ] and Q[i 1, i] are contained in the set C i which are the critical values for [α i 1, γ i ] and Q[i 1, i]. The orthogonal matching of width ε between [γi 1, γ i ] and Q[i 1, i] maps points in such a way that there are three types of point-to-point distances: Some of these distances are obtained by an orthogonal projection of vertices from to Q[i 1, i], some by mapping vertices from to endpoints in Q[i 1, i], and some by an orthogonal projection of vertices from Q to edges in [α i, γ i ]. Let H 1 be the hyperplane intersecting Q[i 1, i] that is perpendicular to Q[i 1, i] and tangent to B(q i 1, ε 0 ). Similarly, define H 2 with respect to B(q i, ε 0 ), see Fig. 8. For any vertex p j [α i 1, γ i ] do the following: (1) If p j lies between H 1 and H 2, then the orthogonal matching of width ε maps p j to its orthogonal projection on Q[i 1, i]. We store the (orthogonal) distance p j Q[i 1, i] in the set C i. (2) If p j lies on the q i 1 -side of H 1, then an orthogonal matching of width ε can map p j either to q i 1 or to its orthogonal projection on Q[i 1, i]. In this case we therefore store both p j Q[i 1, i] and p j q i 1 in C i. Similarly, if p j lies on the q i -side of H 2 then we store p j Q[i 1, i] and p j q i in C i. Finally, for each edge e in [α i, γ i ], (3) we store q i e. Now, the call to DecisionAlgorithm(, Q, ε 0 ) in step (1) ensures that and Q satisfy the constraint l > 2ε 0 and l Q > (1 + d)ε 0. Consequently, for any ε C, we know that l > 2ε and l Q > (1 + d)ε because ε ε 0, and therefore DecisionAlgorithm(, Q, ε) in step (3) is runnable. We have the following theorem: H1 H2 H1 H2 (α i 1) (αi) pj (α i ) Q (γ i 1) qi 1 (αi ), (γi ) (γi 1) (αi) pj (γi) Q (αi 1) qi 1 (γ i 1) (γi 1) ε0 ε qi (γi ) (γi) (αi 1) (α i 1) qi ε0 ε (a) (b) Figure 8 The orthogonal matching of width ε between [γi 1, γi ] and Q[i 1, i] causes three types of point-to-point distances. We show cylinders C(Q[i 1, i], ε 0) and C(Q[i 1, i], ε ), where ε 0 ε, but ε is not known beforehand. (a) Vertex p j falls into case (2), when the orthogonal matching maps p j either to q i (p j lies inside B(q i, ε )) or orthogonally to Q[i 1, i] (p j lies outside B(q i, ε )). (b) If an edge of is tangent to B(q i, ε ), then a distance of type (3) can occur. In this case, the orthogonal matching has to map q i to an edge e in [α i, γ i].

13 J. Gudmundsson, M. Mirzanezhad, A. Mohades, and C. Wenk 23:13 Theorem 11 (Optimization). Let : [1, n] R d and Q : [1, m] R d be two polygonal curves. If δ F (, Q) < min{l /2, l Q /(1 + d)}, then δ F (, Q) can be computed in O((n + m) log(n + m)) time. roof. First we show that the number of critical values is linear. Given the segment Q[i 1, i], we have three types of distances for computing C i that need to be counted: (1) If vertex p j lies between H 1 and H 2, then the number of the distance values is at most α i γ i Note that this value is an upper bound for the number of vertices in [γ i 1, α i ]. (2) If vertex p j lies on the q i 1 -side of H 1, the number of values is at most 2( γ i 1 α i 1 + 1), and similarly if p j lies on the q i -side of H 2, the number of values is at most 2( γ i α i + 1). (3) For each edge e in [α i, γ i ] the number is at most γ i α i. Now the summation of all three types of values is: C i (γ i α i ) + (γ i 1 α i 1 ) + (γ i α i 1 ) + 11 < 2(γ i α i 1 )+11 = 2(γ i γ i 1 )+2(γ i 1 α i 1 )+11. The second inequality follows because α i 1 γ i 1 α i γ i, see Fig. 8. Note that m i=2 (γ i γ i 1 ) = γ m γ 1 = n 1, and m i=2 (γ i 1 α i 1 ) < n, therefore, C = m i=2 C i < 2(n 1) + 2n + 11(m 1) = O(n + m). The optimization algorithm first runs the decision algorithm (Algorithm 1) in O(m + n) time, then computes C in O(n + m) time, and finally sorts C in O((n + m) log(n + m) time and performs binary search on C using the decision algorithm in O((n +m) log(n +m) time. Therefore, the runtime is O((n + m) log(n + m)). 4.2 Approximation Algorithm In this section we present a d-approximation algorithm running in linear time. As a counterpart to the notion of longest ε-prefix we now introduce the notion of minimum prefix, which is the longest prefix of with minimum Fréchet distance to a line segment e. Definition 12 (Minimum refix). Let : [1, n] R d be a polygonal curve and e : [1, 2] R d be a segment. Define γ = max argmin 1 t n δ F ( [1, t], e). We call [1, γ ] the minimum prefix of with respect to e. Note that in the definition above, (γ ) necessarily lies on the boundary of B(e 2, ε ), where ε = min 1 t n δ F ( [1, t], e). The approximation algorithm is presented in Algorithm 2. First, for an initial threshold ε 0 less than but sufficiently close to min{l /(2 d), l Q /(2d)}, it runs DecisionAlgorithm(, Q, ε 0 ). Typically, ε 0 can be set to min{l /(2 d), l Q /(2d)} ɛ, where ɛ is the floating-point precision of the machine. The algorithm only continues if Yes gets returned. This ensures that and Q have long edges, with l > 2 dε > 2ε and l Q > 2dε > (1 + d)ε. Then, similar to the decision algorithm, the approximation algorithm greedily searches for longest ε-prefixes with respect to each segment of Q. However, it updates the current value of ε in each step, by computing the minimum prefix and its associated Fréchet distance to the portion of Q considered so far. Now we are ready to prove the correctness of Algorithm 2: Lemma 13 (The Approximation). Let = [1, n] and Q = Q[1, m] be two polygonal curves and let ε = δ F (, Q). If ε < min{l /(2 d), l Q /(2d)} then ApproximationAlgorithm(, Q) returns a value between ε and dε. Otherwise it returns I don t know.. roof. From Algorithm 2 we have that ε i = δ F ( [γ i 1, γ i ], Q[i 1, i]). Now suppose δ F (, Q) = ε. We prove by induction on i that ε i dε. For i = 2, ε 2 is being minimized and obviously ε 2 ε < dε. For any i > 2, there are two possible cases: If ε i ε, then trivially ε i < dε. In the remainder of the proof we consider the case that ε i > ε. We know from Theorem 7 that all γi = LongestEpsilonrefix( [γi 1, n], Q[i 1, i], ε ) for all i = 1, 2,, m exist. And by inductive hypothesis we know that max{ε 2,, ε i 1 } dε. C V I T

14 23:14 Fast Fréchet Distance Between Curves with Long Edges Algorithm 2: Compute δ F (, Q) 1 ApproximationAlgorithm( [1, n], Q[1, m]) 2 ε 0 min{l /2 d, l Q /2d} ɛ 3 if DecisionAlgorithm(, Q, ε 0 )= No then return I don t know. 4 (γ 2, ε 2 ) Minimumrefix( [1, n], Q[1, 2]) 5 ε ε 2 6 s γ 2 7 for i 3 to m do 8 (γ i, ε i ) Minimumrefix( [s, n], Q[i 1, i]) 9 ε max{ε, ε i } 10 s γ i 11 if γ m = n then 12 return ε 13 else 14 ε max{ε, δ F ( [γ m, n], q m )} 15 return ε We know from line 8 of Algorithm 2 that ε i = δ F ( [γ i 1, γ i ], Q[i 1, i]) and [γ i 1, γ i ] is the minimum prefix with respect to Q[i 1, i]. For the sake of contradiction we assume ε i > dε > ε. We now distinguish two cases: (a) If γ i 1 < γi 1, then by Lemma 4 we have δ F ( [γ i 1, γi 1 ], q i 1) dε. Also δ F ( [γi 1, γ i ], Q[i 1, i]) ε, hence δ F ( [γ i 1, γi ], Q[i 1, i]) dε < ε i. This contradicts that [γ i 1, γ i ] is the minimum prefix of [γ i 1, n] with respect to Q[i 1, i], see Fig. 9(a). (b) Now for the case that γi 1 < γ i 1, consider the matching (σ, θ) realizing δ F (, Q) = ε. There exists some t [0, 1] such that γ i 1 = σ(t). We can see that Q(θ(t)) Q[i 1, i] as follows: We know that B(q i 1, ε i 1 ) B(q i, ε ) = since q i 1 q i > 2d and ε i 1 dε. This implies γ i 1 < γi and therefore γi 1 < γ i 1 < γi, and correspondingly q i 1 Q(θ(t)) q i. By inductive hypothesis we know that ε i 1 = q i 1 (γ i 1 ) dε, thus Q[i 1, θ(t)] B( (γ i 1 ), dε ) which implies δ F ( (γ i 1 ), Q[i 1, θ(t)]) dε. Combining this with δ F ( [γ i 1, γi ], Q[θ(t), i]) ε from the optimal matching yields δ F ( [γ i 1, γi ], Q[i 1, i]) dε < ε i. This contradicts that [γ i 1, γ i ] is the minimum prefix of [γ i 1, n] with respect to Q[i 1, i], see Fig. 9(b). At the end, if γ m < n = γm, then Lemma 4 again implies δ F ( [γ m, n], q m ) dε as claimed. The algorithm returns max{ε 2,..., ε m }. Since there has to be some ε j > ε, and we proved by induction that all ε i dε, the algorithm returns a value between ε and dε. The Minimumrefix rocedure: Given a polygonal curve : [1, n] R d and a segment e : [1, 2] R d, we implement Minimumrefix(, e) as follows: For every i = 1,..., n 1, let c i be the distance associated with a minimum prefix ending on the segment [i, i + 1]. Formally, c i = min t [i,i+1] δ F ( [1, t], e). Algorithm 3 computes all the c i in a dynamic programming fashion. The minimum of the c i is the desired ε, and the LongestEpsilon- refix computes the corresponding γ. Before to prove the correctness of Algorithm 3, we need the following technical lemma that states when ε is increased, the longest ε-prefix can only get longer.

15 J. Gudmundsson, M. Mirzanezhad, A. Mohades, and C. Wenk 23:15 (γ i 1) (γ i 1) (γ i ) (γ i) (γ i 1) (γ i 1) (γ i ) (γ i) q i 1 Q q i qi 1 Q(θ(t)) Q q i (a) (b) Figure 9 Illustration for the proof of Lemma 13 when ε i > ε. (a) γ i 1 < γ i 1 (b) γ i 1 > γ i 1. Algorithm 3: Compute Minimumrefix( [1, n], e[1, 2]) 1 Minimumrefix( [1, n], e[1, 2]) 2 c p 1, e 1 3 ε min{l /2, e /(2 d)} ɛ 4 γ LongestEpsilonrefix( [1, n], e[1, 2], ε ) 5 for i 1 to γ do 6 c i max{c, [i, i + 1], e 2 } 7 c max{c, p i+1, e[1, 2] } 8 ε = min γ i=1 c i 9 return (ε, LongestEpsilonrefix( [1, n], e[1, 2], ε)) Lemma 14 (refix monotonicity). Let : [1, n] R d and Q : [1, m] R d be two polygonal curves and ε > ε > 0. Let γ 1 = γ 1 = 1 and for all i = 2,, m let γ i = LongestEpsilonrefix( [γ i 1, n], Q[i 1, i], ε)) and γ i = LongestEpsilonrefix( [γ i 1, n], Q[i 1, i], ε ). Then γ i < γ i for all i = 2,, m. roof. The proof is by induction. For i = 2, we know that δ F ( [1, γ 2], Q[1, 2]) ε < ε. Let x be a parameter such that (x) is the first intersection point between [γ 2, n] and the boundary of B(q 2, ε), thus γ 2 < x. Now observe that δ F ( [γ 2, x], q 2 ) ε. Combining this with the latter value yields δ F ( [1, x], Q[1, 2]) ε. Since γ 2 is the longest ε-prefix with respect to Q[1, 2], we have γ 2 < x γ 2, and therefore γ 2 < γ 2. Now for i > 2, by inductive hypothesis we have γ i 1 < γ i 1. It remains to show γ i < γ i. Consider a matching (σ, θ) realizing δ F ( [γ i 1, γ i ], Q[i 1, i]) ε. Let t be the value such that σ(t) = γ i 1. Now we construct a new matching for [γ i 1, x], where x is defined as in the inductive base, but with respect to B(q i, ε). We know that δ F ( [γ i 1 ], Q[i 1, θ(t)]) ε. Also we have δ F ( [γ i 1, γ i ], Q[θ(t), i]) ε < ε by (σ, θ). Observe that δ F ( [γ i, x], q i) ε. Thus, δ F ( [γ i 1, x], Q[i 1, i]) ε and using a similar argument as in the inductive base we have γ i < x γ i, therefore γ i < γ i. Now we are ready to prove the correctness of Algorithm 3: Lemma 15 (Correctness). Let e : [1, 2] R d be a line segment and let : [1, n ] R d be a polygonal curve monotone with respect to the line supporting e[1, 2]. The distance returned by Minimumrefix(, e) is min 1 t n δ F ( [1, t], e[1, 2]). roof. According to the algorithm: c i = max{ p 1 e 1, max p j+1, e, [i, i + 1] q 2 }. 1 j i 1 C V I T

16 23:16 Fast Fréchet Distance Between Curves with Long Edges Since e[1, 2] is a segment and [1, n ] is monotone with respect to the line supporting e, the statement below follows for the existence of the orthogonal matching (Lemma 2) which maps each point on to its closest point on Q: δ F ( [1, t], e) = max{ p 1 e 1, max p j+1 e, (t) e 2 } 1 j i 1 By taking the minimum on both sides, we get min i t i+1 δ F ( [1, t], e) = max{ p 1 e 1, max 1 j i 1 p j+1 e, min i t i+1 (t) e 2 } = c i. It suffices to run the for-loop until n = γ, since by the assumption we only compute the minimum ε-prefix [1, γ] if its distance is at most ε (line 3 of Algorithm 3), and from Lemma 14 follows γ < γ. Therefore, ε = min γ i=1 c i = min n i=1 c i = min 1 t n δ F ( [1, t], e). Theorem 16 (Runtime). Let : [1, n] R d and Q : [1, m] R d be two polygonal curves. If δ F (, Q) < min{l /(2 d), l Q /(2d)}, then Algorithm 2 approximates δ F (, Q) in O(n+m) time within an approximation factor of d. roof. Let ε = δ F (, Q). The algorithm only proceeds past line 3 if ε ε 0 = min{l /(2 d), l Q /(2d)} ɛ and DecisionAlgorithm(, Q, ε 0 ) returns Yes. Now, let ε = dε 0, γ 1 = 1, and for all i = 2,, m let γ i = LongestEpsilonrefix( [γ i 1, n], Q[i 1, i], ε ). Note that by definition of ε, both curves have long edges, i.e., l > 2 dε 0 > 2ε and l Q > 2dε 0 = 2 dε > (1+ d)ε. From the proof of Lemma 13 we know that ε i dε dε 0 = ε and since q i 1 q i > 2 dε, we have that B(q i 1, ε ) B(q i, ε i ) =. Therefore, γ i 1 < γ i. Lemma 14 implies that γ i γ i due to ε i ε, therefore γ i 1 < γ i 1 < γ i < γ i for all i = 2,, m. The for-loop in Algorithm 2 has m 2 iterations. In iteration i, the algorithm calls Minimumrefix( [γ i 1, γ i ], Q[i 1, i]) in line 8. The for-loop in Algorithm 3 has γ i γ i iterations, where γ i γ i is the upper bound for the number of vertices in [γ i 1, γ i ]. Therefore, the runtime of Algorithm 2 is: m i=2 γ i γ i m i=2 (γ i γ i 1 + 2) = m i=2 (γ i γ i) + m i=2 (γ i γ i 1 ) + 2(m 1). Since γ i 1 γ i, we have m i=2 (γ i γ i) m i=2 (γ i γ i 1 ). Thus, m i=2 (γ i γ i) + m i=2 (γ i γ i 1 ) + 2(m 1) m i=2 (γ i γ i 1 ) + m i=2 (γ i γ i 1 ) + 2(m 1) = γ m γ 1 + γ m γ 1 + 2(m 1) = 2(n 1) + 2(n 1) + 2(m 1) = O(n + m). 5 Data Structure For Longest ε-refix Queries In this section, we consider query variants of the setting in Section 3 for curves in the plane. We wish to solve the following problem: reprocess a polygonal curve : [1, n] R 2 into a data structure such that for any polygonal query curve Q : [1, m] R 2 and a positive ε < min{l /2, l Q /(1 + 2)} one can efficiently decide whether δ F (, Q) ε. Note that throughout this section we assume, as before, that and Q have long edges, i.e., l > 2ε and l Q > (1 + 2)ε. Our query algorithm is identical to Algorithm 1. However, the key idea for speeding up the query algorithm is to efficiently compute LongestEpsilonrefix( [1, n], Q[1, 2], ε) for a given query segment Q[1, 2] in sublinear time. Our algorithm to compute the longest ε-prefix with respect to Q[1, 2] is shown in Algorithm 4. Here, LongestMonotonerefix returns λ, where (λ) is the endpoint of the longest subcurve of [1, n] that starts in p 1 and is monotone with respect to the line supporting Q[1, 2]. FirstIntersection returns α, where (α) is the first intersection point between

17 J. Gudmundsson, M. Mirzanezhad, A. Mohades, and C. Wenk 23:17 Algorithm 4: Compute LongestEpsilonrefix( [1, n], Q[1, 2], ε) 1 LongestEpsilonrefix( [1, n], Q[1, 2], ε) 2 if p 1 / B(q 1, ε) then return null 3 λ LongestMonotonerefix( [1, n], Q[1, 2]) 4 α FirstIntersection( [1, λ], B(q 2, ε)) 5 if α = null then return null 6 β LastIntersection( [1, λ], B(q 2, ε)) 7 r CylinderIntersection( [1, λ], C(Q[1, 2], ε)) 8 if r = null then return min(λ, β) 9 if r < α or λ < α then return null 10 if α < r < β or α < λ < β then return min(r, λ) 11 if r > β and λ > β then return β [1, λ] and B(q 2, ε). Similarly, LastIntersection returns β, where (β) is the last intersection point. CylinderIntersection finds r where (r) is the first point along that leaves C(Q[1, 2], ε). Similar to the way we computed LongestEpsilonrefix in Section 3, Algorithm 4 also checks the conditions provided in Lemma 2. We now preprocess as follows to speed up the LongestEpsilonrefix procedure: Computing LongestMonotonerefix: We store all the edges of in the leaves of a binary tree T ordered with respect to their indices. Each internal node stores the pair of minimum/maximum slopes among all edges in its canonical subset. Once given a query slope Φ and a starting point p 1, we retrieve O(log n) many leftmost (starting with p 1 ) canonical nodes of T whose union of corresponding subtrees spans all edges that satisfy monotonicity with respect to Φ. This can simply be done by recursively searching children of a node v violating the slope condition with respect to Φ. Once satisfying the condition, we already have O(log n) internal nodes to report their leaves as [1, λ]. Both processes of searching children and reporting nodes take O(log n) time altogether using O(n) space and O(n log n) preprocessing time. Computing FirstIntersection and LastIntersection: Let H be the hyperplane intersecting Q[1, 2] that is perpendicular to Q[1, 2] and is tangent to B(q 2, ε). Let H be the other hyperplane perpendicular to Q[1, 2] and tangent to B(q 2, ε). Since [1, λ] is monotone with respect to the line supporting Q[1, 2], we know that λ must lie on the q 2 -side of H. And (α) [1, λ] must be located on the first edge intersecting H 2. We start from p 1 and perform an exponential search on the edges of [1, λ] to find the first edge that intersects H. Once the edge is found, we can find (α) in constant time since each edge of is longer than 2ε which is the diameter of B(q 2, ε). Using the same method we can find (β) [1, λ], if we consider H instead of H. If λ is on q 2 -side of H, we perform the exponential search on [1, λ] to find (β). If λ is on q 1 -side of H then there is no (β) [1, λ] and the algorithm does not require it. The whole process takes O(log n) time. Computing CylinderIntersection: Similar to Gudmundsson and Smid [13], we construct a balanced binary search tree storing the points p 1, p 2,, p n in its leaves (sorted by their indices). At each node of this tree, we store the convex hull of all points stored in C V I T

18 23:18 Fast Fréchet Distance Between Curves with Long Edges its subtree. Given a query range [1, λ], we can retrieve O(log n) many canonical nodes of the tree containing convex hulls whose leaves span the whole range. For each convex hull we only need to compute extreme points with respect to the slope of Q[1, 2]. If all extreme points lie inside C(Q[1, 2], ε), then r = null, otherwise we consider the first extreme point (x) of some convex hull which is outside C(Q[1, 2], ε). erforming exponential search on [1, x] will find the first point outside the corresponding boundary of C(Q[1, 2], ε) for which (x) is obtained. This structure needs O(n log n) space and preproccessing time and answers queries in O(log 2 n) time. lugging Algorithm 4 into the decision algorithm (Algorithm 1), we obtain the following theorem: Theorem 17 (General Curves). Let : [1, n] R 2 be a polygonal curve. A data structure of O(n log n) size can be built in O(n log n) time such that for any query curve Q : [1, m] R 2 and a positive constant ε < min(l /2, l Q /(1+ 2)), it can be decided in O(m log 2 n) time whether δ F (, Q) ε. roof. The correctness of the query algorithm follows from Theorem 7. As we mentioned, the space and preprocessing time of the whole data structure is O(n log n). Using Algorithm 4, the longest ε-prefix can be computed in O(log 2 n) time per segment, and hence the query algorithm runs in O(m log 2 n) time. When is an x-monotone curve, we can handle queries in an slightly faster query time and also smaller space. In this case, we assume that ε is given at the preprocessing stage. The x-monotonicity of allows us to use a different data structure for supporting the CylinderIntersection procedure, since the query time and space of this structure dominates the cost of our entire data structure. H 2 r H 1 Q q 2 (λ) r q 1 p 1 Figure 10 Illustrating how combining the straight and circular line ray shooting queries can find the first point along [1, λ] that leaves C(Q[1, 2], ε). We implement the CylinderIntersection procedure by performing two types of ray shooting queries, straight and circular, along the boundary of C(Q[1, 2], ε). It is easy to see that it suffices to perform at most two straight ray shooting queries and four circular ray shooting queries since is x-monotone. See Fig. 10 for an illustration of the queries for the top part of the boundary of C(Q[1, 2], ε). For straight ray shooting queries we use the data structure by Hershberger and Suri [15]. Given a simple polygon, their structure returns the first point on the boundary of the polygon that is hit by a query ray ρ. It can be built in O(n log n) time using O(n) space and answer queries in O(log n) time. However, to be able to use this structure we need to reduce our problem to ray shooting in a simple polygon. Let H be the (unbounded) polygon bounded from below by, from the left by a vertical

Lecture 23: Hausdorff and Fréchet distance

Lecture 23: Hausdorff and Fréchet distance CPS296.2 Geometric Optimization 05 April, 2007 Lecture 23: Hausdorff and Fréchet distance Lecturer: Pankaj K. Agarwal Scribe: Nihshanka Debroy 23.1 Introduction Shape matching is an important area of research

More information

Why walking the dog takes time: Fréchet distance has no strongly subquadratic algorithms unless SETH fails

Why walking the dog takes time: Fréchet distance has no strongly subquadratic algorithms unless SETH fails Why walking the dog takes time: Fréchet distance has no strongly subquadratic algorithms unless SETH fails Karl Bringmann April 10, 2014 Abstract The Fréchet distance is a well-studied and very popular

More information

Fast algorithms for collision and proximity problems involving moving geometric objects

Fast algorithms for collision and proximity problems involving moving geometric objects Fast algorithms for collision and proximity problems involving moving geometric objects Prosenjit Gupta Ravi Janardan Michiel Smid August 22, 1995 Abstract Consider a set of geometric objects, such as

More information

Shortest paths with negative lengths

Shortest paths with negative lengths Chapter 8 Shortest paths with negative lengths In this chapter we give a linear-space, nearly linear-time algorithm that, given a directed planar graph G with real positive and negative lengths, but no

More information

Computing the Fréchet Gap Distance

Computing the Fréchet Gap Distance Computing the Fréchet Gap Distance Chenglin Fan 1 and Benjamin Raichel 1 1 Department of Computer Science, University of Texas at Dallas Richardson, TX 75080, USA cxf160130@utdallas.edu, benjamin.raichel@utdallas.edu.

More information

Approximating the Minimum Closest Pair Distance and Nearest Neighbor Distances of Linearly Moving Points

Approximating the Minimum Closest Pair Distance and Nearest Neighbor Distances of Linearly Moving Points Approximating the Minimum Closest Pair Distance and Nearest Neighbor Distances of Linearly Moving Points Timothy M. Chan Zahed Rahmati Abstract Given a set of n moving points in R d, where each point moves

More information

Improved Approximation Bounds for Planar Point Pattern Matching

Improved Approximation Bounds for Planar Point Pattern Matching Improved Approximation Bounds for Planar Point Pattern Matching Minkyoung Cho Department of Computer Science University of Maryland College Park, Maryland, USA David M Mount Department of Computer Science

More information

Computing a Minimum-Dilation Spanning Tree is NP-hard

Computing a Minimum-Dilation Spanning Tree is NP-hard Computing a Minimum-Dilation Spanning Tree is NP-hard Otfried Cheong Herman Haverkort Mira Lee Dept. of Computer Science, Korea Advanced Institute of Science & Technology, Daejeon, South Korea. Email:

More information

arxiv: v1 [cs.dm] 26 Apr 2010

arxiv: v1 [cs.dm] 26 Apr 2010 A Simple Polynomial Algorithm for the Longest Path Problem on Cocomparability Graphs George B. Mertzios Derek G. Corneil arxiv:1004.4560v1 [cs.dm] 26 Apr 2010 Abstract Given a graph G, the longest path

More information

Dominating Set Counting in Graph Classes

Dominating Set Counting in Graph Classes Dominating Set Counting in Graph Classes Shuji Kijima 1, Yoshio Okamoto 2, and Takeaki Uno 3 1 Graduate School of Information Science and Electrical Engineering, Kyushu University, Japan kijima@inf.kyushu-u.ac.jp

More information

A Decidable Class of Planar Linear Hybrid Systems

A Decidable Class of Planar Linear Hybrid Systems A Decidable Class of Planar Linear Hybrid Systems Pavithra Prabhakar, Vladimeros Vladimerou, Mahesh Viswanathan, and Geir E. Dullerud University of Illinois at Urbana-Champaign. Abstract. The paper shows

More information

arxiv: v1 [cs.ds] 9 Apr 2018

arxiv: v1 [cs.ds] 9 Apr 2018 From Regular Expression Matching to Parsing Philip Bille Technical University of Denmark phbi@dtu.dk Inge Li Gørtz Technical University of Denmark inge@dtu.dk arxiv:1804.02906v1 [cs.ds] 9 Apr 2018 Abstract

More information

Computing a Minimum-Dilation Spanning Tree is NP-hard

Computing a Minimum-Dilation Spanning Tree is NP-hard Computing a Minimum-Dilation Spanning Tree is NP-hard Otfried Cheong 1 Herman Haverkort 2 Mira Lee 1 October 0, 2008 Abstract In a geometric network G = (S, E), the graph distance between two vertices

More information

arxiv: v4 [cs.cg] 31 Mar 2018

arxiv: v4 [cs.cg] 31 Mar 2018 New bounds for range closest-pair problems Jie Xue Yuan Li Saladi Rahul Ravi Janardan arxiv:1712.9749v4 [cs.cg] 31 Mar 218 Abstract Given a dataset S of points in R 2, the range closest-pair (RCP) problem

More information

Faster Algorithms for some Optimization Problems on Collinear Points

Faster Algorithms for some Optimization Problems on Collinear Points Faster Algorithms for some Optimization Problems on Collinear Points Ahmad Biniaz Prosenjit Bose Paz Carmi Anil Maheshwari J. Ian Munro Michiel Smid June 29, 2018 Abstract We propose faster algorithms

More information

A Streaming Algorithm for 2-Center with Outliers in High Dimensions

A Streaming Algorithm for 2-Center with Outliers in High Dimensions CCCG 2015, Kingston, Ontario, August 10 12, 2015 A Streaming Algorithm for 2-Center with Outliers in High Dimensions Behnam Hatami Hamid Zarrabi-Zadeh Abstract We study the 2-center problem with outliers

More information

Algorithms for pattern involvement in permutations

Algorithms for pattern involvement in permutations Algorithms for pattern involvement in permutations M. H. Albert Department of Computer Science R. E. L. Aldred Department of Mathematics and Statistics M. D. Atkinson Department of Computer Science D.

More information

Topological properties of Z p and Q p and Euclidean models

Topological properties of Z p and Q p and Euclidean models Topological properties of Z p and Q p and Euclidean models Samuel Trautwein, Esther Röder, Giorgio Barozzi November 3, 20 Topology of Q p vs Topology of R Both R and Q p are normed fields and complete

More information

On Two Class-Constrained Versions of the Multiple Knapsack Problem

On Two Class-Constrained Versions of the Multiple Knapsack Problem On Two Class-Constrained Versions of the Multiple Knapsack Problem Hadas Shachnai Tami Tamir Department of Computer Science The Technion, Haifa 32000, Israel Abstract We study two variants of the classic

More information

The Fast Optimal Voltage Partitioning Algorithm For Peak Power Density Minimization

The Fast Optimal Voltage Partitioning Algorithm For Peak Power Density Minimization The Fast Optimal Voltage Partitioning Algorithm For Peak Power Density Minimization Jia Wang, Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University Houghton, Michigan

More information

Geometric Optimization Problems over Sliding Windows

Geometric Optimization Problems over Sliding Windows Geometric Optimization Problems over Sliding Windows Timothy M. Chan and Bashir S. Sadjad School of Computer Science University of Waterloo Waterloo, Ontario, N2L 3G1, Canada {tmchan,bssadjad}@uwaterloo.ca

More information

Metric Spaces and Topology

Metric Spaces and Topology Chapter 2 Metric Spaces and Topology From an engineering perspective, the most important way to construct a topology on a set is to define the topology in terms of a metric on the set. This approach underlies

More information

1 Some loose ends from last time

1 Some loose ends from last time Cornell University, Fall 2010 CS 6820: Algorithms Lecture notes: Kruskal s and Borůvka s MST algorithms September 20, 2010 1 Some loose ends from last time 1.1 A lemma concerning greedy algorithms and

More information

Günter Rote. Freie Universität Berlin

Günter Rote. Freie Universität Berlin Algorithms for Isotonic Regression a i Günter Rote Freie Universität Berlin i Algorithms for Isotonic Regression a i x i Günter Rote Freie Universität Berlin Minimize n i=1 i h( x i a i ) subject to x

More information

On improving matchings in trees, via bounded-length augmentations 1

On improving matchings in trees, via bounded-length augmentations 1 On improving matchings in trees, via bounded-length augmentations 1 Julien Bensmail a, Valentin Garnero a, Nicolas Nisse a a Université Côte d Azur, CNRS, Inria, I3S, France Abstract Due to a classical

More information

Dispersing Points on Intervals

Dispersing Points on Intervals Dispersing Points on Intervals Shimin Li 1 and Haitao Wang 1 Department of Computer Science, Utah State University, Logan, UT 843, USA shiminli@aggiemail.usu.edu Department of Computer Science, Utah State

More information

1 Matchings in Non-Bipartite Graphs

1 Matchings in Non-Bipartite Graphs CS 598CSC: Combinatorial Optimization Lecture date: Feb 9, 010 Instructor: Chandra Chekuri Scribe: Matthew Yancey 1 Matchings in Non-Bipartite Graphs We discuss matching in general undirected graphs. Given

More information

Generating p-extremal graphs

Generating p-extremal graphs Generating p-extremal graphs Derrick Stolee Department of Mathematics Department of Computer Science University of Nebraska Lincoln s-dstolee1@math.unl.edu August 2, 2011 Abstract Let f(n, p be the maximum

More information

Testing Problems with Sub-Learning Sample Complexity

Testing Problems with Sub-Learning Sample Complexity Testing Problems with Sub-Learning Sample Complexity Michael Kearns AT&T Labs Research 180 Park Avenue Florham Park, NJ, 07932 mkearns@researchattcom Dana Ron Laboratory for Computer Science, MIT 545 Technology

More information

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved. Chapter 11 Approximation Algorithms Slides by Kevin Wayne. Copyright @ 2005 Pearson-Addison Wesley. All rights reserved. 1 Approximation Algorithms Q. Suppose I need to solve an NP-hard problem. What should

More information

Spring 2017 CO 250 Course Notes TABLE OF CONTENTS. richardwu.ca. CO 250 Course Notes. Introduction to Optimization

Spring 2017 CO 250 Course Notes TABLE OF CONTENTS. richardwu.ca. CO 250 Course Notes. Introduction to Optimization Spring 2017 CO 250 Course Notes TABLE OF CONTENTS richardwu.ca CO 250 Course Notes Introduction to Optimization Kanstantsin Pashkovich Spring 2017 University of Waterloo Last Revision: March 4, 2018 Table

More information

Dynamic Programming: Shortest Paths and DFA to Reg Exps

Dynamic Programming: Shortest Paths and DFA to Reg Exps CS 374: Algorithms & Models of Computation, Spring 207 Dynamic Programming: Shortest Paths and DFA to Reg Exps Lecture 8 March 28, 207 Chandra Chekuri (UIUC) CS374 Spring 207 / 56 Part I Shortest Paths

More information

THE CAPORASO-HARRIS FORMULA AND PLANE RELATIVE GROMOV-WITTEN INVARIANTS IN TROPICAL GEOMETRY

THE CAPORASO-HARRIS FORMULA AND PLANE RELATIVE GROMOV-WITTEN INVARIANTS IN TROPICAL GEOMETRY THE CAPORASO-HARRIS FORMULA AND PLANE RELATIVE GROMOV-WITTEN INVARIANTS IN TROPICAL GEOMETRY ANDREAS GATHMANN AND HANNAH MARKWIG Abstract. Some years ago Caporaso and Harris have found a nice way to compute

More information

CSE 417T: Introduction to Machine Learning. Final Review. Henry Chai 12/4/18

CSE 417T: Introduction to Machine Learning. Final Review. Henry Chai 12/4/18 CSE 417T: Introduction to Machine Learning Final Review Henry Chai 12/4/18 Overfitting Overfitting is fitting the training data more than is warranted Fitting noise rather than signal 2 Estimating! "#$

More information

BMO Round 2 Problem 3 Generalisation and Bounds

BMO Round 2 Problem 3 Generalisation and Bounds BMO 2007 2008 Round 2 Problem 3 Generalisation and Bounds Joseph Myers February 2008 1 Introduction Problem 3 (by Paul Jefferys) is: 3. Adrian has drawn a circle in the xy-plane whose radius is a positive

More information

LECTURE 15: COMPLETENESS AND CONVEXITY

LECTURE 15: COMPLETENESS AND CONVEXITY LECTURE 15: COMPLETENESS AND CONVEXITY 1. The Hopf-Rinow Theorem Recall that a Riemannian manifold (M, g) is called geodesically complete if the maximal defining interval of any geodesic is R. On the other

More information

CHAPTER 8: EXPLORING R

CHAPTER 8: EXPLORING R CHAPTER 8: EXPLORING R LECTURE NOTES FOR MATH 378 (CSUSM, SPRING 2009). WAYNE AITKEN In the previous chapter we discussed the need for a complete ordered field. The field Q is not complete, so we constructed

More information

Linear-Time Algorithms for Finding Tucker Submatrices and Lekkerkerker-Boland Subgraphs

Linear-Time Algorithms for Finding Tucker Submatrices and Lekkerkerker-Boland Subgraphs Linear-Time Algorithms for Finding Tucker Submatrices and Lekkerkerker-Boland Subgraphs Nathan Lindzey, Ross M. McConnell Colorado State University, Fort Collins CO 80521, USA Abstract. Tucker characterized

More information

Branch-and-cut Approaches for Chance-constrained Formulations of Reliable Network Design Problems

Branch-and-cut Approaches for Chance-constrained Formulations of Reliable Network Design Problems Branch-and-cut Approaches for Chance-constrained Formulations of Reliable Network Design Problems Yongjia Song James R. Luedtke August 9, 2012 Abstract We study solution approaches for the design of reliably

More information

Bichain graphs: geometric model and universal graphs

Bichain graphs: geometric model and universal graphs Bichain graphs: geometric model and universal graphs Robert Brignall a,1, Vadim V. Lozin b,, Juraj Stacho b, a Department of Mathematics and Statistics, The Open University, Milton Keynes MK7 6AA, United

More information

The 2-Center Problem in Three Dimensions

The 2-Center Problem in Three Dimensions The 2-Center Problem in Three Dimensions Pankaj K. Agarwal Rinat Ben Avraham Micha Sharir Abstract Let P be a set of n points in R 3. The 2-center problem for P is to find two congruent balls of minimum

More information

Strategies for Stable Merge Sorting

Strategies for Stable Merge Sorting Strategies for Stable Merge Sorting Preliminary version. Comments appreciated. Sam Buss sbuss@ucsd.edu Department of Mathematics University of California, San Diego La Jolla, CA, USA Alexander Knop aknop@ucsd.edu

More information

Complexity Theory of Polynomial-Time Problems

Complexity Theory of Polynomial-Time Problems Complexity Theory of Polynomial-Time Problems Lecture 1: Introduction, Easy Examples Karl Bringmann and Sebastian Krinninger Audience no formal requirements, but: NP-hardness, satisfiability problem, how

More information

Lecture 14 - P v.s. NP 1

Lecture 14 - P v.s. NP 1 CME 305: Discrete Mathematics and Algorithms Instructor: Professor Aaron Sidford (sidford@stanford.edu) February 27, 2018 Lecture 14 - P v.s. NP 1 In this lecture we start Unit 3 on NP-hardness and approximation

More information

(x 1, y 1 ) = (x 2, y 2 ) if and only if x 1 = x 2 and y 1 = y 2.

(x 1, y 1 ) = (x 2, y 2 ) if and only if x 1 = x 2 and y 1 = y 2. 1. Complex numbers A complex number z is defined as an ordered pair z = (x, y), where x and y are a pair of real numbers. In usual notation, we write z = x + iy, where i is a symbol. The operations of

More information

General Methods for Algorithm Design

General Methods for Algorithm Design General Methods for Algorithm Design 1. Dynamic Programming Multiplication of matrices Elements of the dynamic programming Optimal triangulation of polygons Longest common subsequence 2. Greedy Methods

More information

arxiv:cs/ v1 [cs.cg] 7 Feb 2006

arxiv:cs/ v1 [cs.cg] 7 Feb 2006 Approximate Weighted Farthest Neighbors and Minimum Dilation Stars John Augustine, David Eppstein, and Kevin A. Wortman Computer Science Department University of California, Irvine Irvine, CA 92697, USA

More information

The Great Wall of David Shin

The Great Wall of David Shin The Great Wall of David Shin Tiankai Liu 115 June 015 On 9 May 010, David Shin posed the following puzzle in a Facebook note: Problem 1. You're blindfolded, disoriented, and standing one mile from the

More information

Lecture 18: March 15

Lecture 18: March 15 CS71 Randomness & Computation Spring 018 Instructor: Alistair Sinclair Lecture 18: March 15 Disclaimer: These notes have not been subjected to the usual scrutiny accorded to formal publications. They may

More information

Algorithms (II) Yu Yu. Shanghai Jiaotong University

Algorithms (II) Yu Yu. Shanghai Jiaotong University Algorithms (II) Yu Yu Shanghai Jiaotong University Chapter 1. Algorithms with Numbers Two seemingly similar problems Factoring: Given a number N, express it as a product of its prime factors. Primality:

More information

An efficient approximation for point-set diameter in higher dimensions

An efficient approximation for point-set diameter in higher dimensions CCCG 2018, Winnipeg, Canada, August 8 10, 2018 An efficient approximation for point-set diameter in higher dimensions Mahdi Imanparast Seyed Naser Hashemi Ali Mohades Abstract In this paper, we study the

More information

The Minimum Speed for a Blocking Problem on the Half Plane

The Minimum Speed for a Blocking Problem on the Half Plane The Minimum Speed for a Blocking Problem on the Half Plane Alberto Bressan and Tao Wang Department of Mathematics, Penn State University University Park, Pa 16802, USA e-mails: bressan@mathpsuedu, wang

More information

Spanning and Independence Properties of Finite Frames

Spanning and Independence Properties of Finite Frames Chapter 1 Spanning and Independence Properties of Finite Frames Peter G. Casazza and Darrin Speegle Abstract The fundamental notion of frame theory is redundancy. It is this property which makes frames

More information

CSC 2414 Lattices in Computer Science September 27, Lecture 4. An Efficient Algorithm for Integer Programming in constant dimensions

CSC 2414 Lattices in Computer Science September 27, Lecture 4. An Efficient Algorithm for Integer Programming in constant dimensions CSC 2414 Lattices in Computer Science September 27, 2011 Lecture 4 Lecturer: Vinod Vaikuntanathan Scribe: Wesley George Topics covered this lecture: SV P CV P Approximating CVP: Babai s Nearest Plane Algorithm

More information

ITERATIVE USE OF THE CONVEX CHOICE PRINCIPLE

ITERATIVE USE OF THE CONVEX CHOICE PRINCIPLE ITERATIVE USE OF THE CONVEX CHOICE PRINCIPLE TAKAYUKI KIHARA Abstract. In this note, we show that an iterative use of the one-dimensional convex choice principle is not reducible to any higher dimensional

More information

The Triangle Closure is a Polyhedron

The Triangle Closure is a Polyhedron The Triangle Closure is a Polyhedron Amitabh Basu Robert Hildebrand Matthias Köppe November 7, 21 Abstract Recently, cutting planes derived from maximal lattice-free convex sets have been studied intensively

More information

Separating Bichromatic Point Sets by L-shapes

Separating Bichromatic Point Sets by L-shapes Separating Bichromatic Point Sets by L-shapes Farnaz Sheikhi Ali Mohades Mark de Berg Mansoor Davoodi August 28, 2013 Abstract Given a set R of red points and a set B of blue points in the plane, we study

More information

A Polynomial-Time Algorithm for Pliable Index Coding

A Polynomial-Time Algorithm for Pliable Index Coding 1 A Polynomial-Time Algorithm for Pliable Index Coding Linqi Song and Christina Fragouli arxiv:1610.06845v [cs.it] 9 Aug 017 Abstract In pliable index coding, we consider a server with m messages and n

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms CSE 101, Winter 2018 Design and Analysis of Algorithms Lecture 5: Divide and Conquer (Part 2) Class URL: http://vlsicad.ucsd.edu/courses/cse101-w18/ A Lower Bound on Convex Hull Lecture 4 Task: sort the

More information

MAT1000 ASSIGNMENT 1. a k 3 k. x =

MAT1000 ASSIGNMENT 1. a k 3 k. x = MAT1000 ASSIGNMENT 1 VITALY KUZNETSOV Question 1 (Exercise 2 on page 37). Tne Cantor set C can also be described in terms of ternary expansions. (a) Every number in [0, 1] has a ternary expansion x = a

More information

Dynamic Programming: Shortest Paths and DFA to Reg Exps

Dynamic Programming: Shortest Paths and DFA to Reg Exps CS 374: Algorithms & Models of Computation, Fall 205 Dynamic Programming: Shortest Paths and DFA to Reg Exps Lecture 7 October 22, 205 Chandra & Manoj (UIUC) CS374 Fall 205 / 54 Part I Shortest Paths with

More information

Proclaiming Dictators and Juntas or Testing Boolean Formulae

Proclaiming Dictators and Juntas or Testing Boolean Formulae Proclaiming Dictators and Juntas or Testing Boolean Formulae Michal Parnas The Academic College of Tel-Aviv-Yaffo Tel-Aviv, ISRAEL michalp@mta.ac.il Dana Ron Department of EE Systems Tel-Aviv University

More information

A strongly polynomial algorithm for linear systems having a binary solution

A strongly polynomial algorithm for linear systems having a binary solution A strongly polynomial algorithm for linear systems having a binary solution Sergei Chubanov Institute of Information Systems at the University of Siegen, Germany e-mail: sergei.chubanov@uni-siegen.de 7th

More information

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler Complexity Theory Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 15 May, 2018 Reinhard

More information

arxiv: v2 [cs.ds] 3 Oct 2017

arxiv: v2 [cs.ds] 3 Oct 2017 Orthogonal Vectors Indexing Isaac Goldstein 1, Moshe Lewenstein 1, and Ely Porat 1 1 Bar-Ilan University, Ramat Gan, Israel {goldshi,moshe,porately}@cs.biu.ac.il arxiv:1710.00586v2 [cs.ds] 3 Oct 2017 Abstract

More information

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181. Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität

More information

Aditya Bhaskara CS 5968/6968, Lecture 1: Introduction and Review 12 January 2016

Aditya Bhaskara CS 5968/6968, Lecture 1: Introduction and Review 12 January 2016 Lecture 1: Introduction and Review We begin with a short introduction to the course, and logistics. We then survey some basics about approximation algorithms and probability. We also introduce some of

More information

Discrete Geometry. Problem 1. Austin Mohr. April 26, 2012

Discrete Geometry. Problem 1. Austin Mohr. April 26, 2012 Discrete Geometry Austin Mohr April 26, 2012 Problem 1 Theorem 1 (Linear Programming Duality). Suppose x, y, b, c R n and A R n n, Ax b, x 0, A T y c, and y 0. If x maximizes c T x and y minimizes b T

More information

Lecture 10 February 4, 2013

Lecture 10 February 4, 2013 UBC CPSC 536N: Sparse Approximations Winter 2013 Prof Nick Harvey Lecture 10 February 4, 2013 Scribe: Alexandre Fréchette This lecture is about spanning trees and their polyhedral representation Throughout

More information

Additive Combinatorics and Szemerédi s Regularity Lemma

Additive Combinatorics and Szemerédi s Regularity Lemma Additive Combinatorics and Szemerédi s Regularity Lemma Vijay Keswani Anurag Sahay 20th April, 2015 Supervised by : Dr. Rajat Mittal 1 Contents 1 Introduction 3 2 Sum-set Estimates 4 2.1 Size of sumset

More information

COS597D: Information Theory in Computer Science October 19, Lecture 10

COS597D: Information Theory in Computer Science October 19, Lecture 10 COS597D: Information Theory in Computer Science October 9, 20 Lecture 0 Lecturer: Mark Braverman Scribe: Andrej Risteski Kolmogorov Complexity In the previous lectures, we became acquainted with the concept

More information

Math 341: Convex Geometry. Xi Chen

Math 341: Convex Geometry. Xi Chen Math 341: Convex Geometry Xi Chen 479 Central Academic Building, University of Alberta, Edmonton, Alberta T6G 2G1, CANADA E-mail address: xichen@math.ualberta.ca CHAPTER 1 Basics 1. Euclidean Geometry

More information

Finite Metric Spaces & Their Embeddings: Introduction and Basic Tools

Finite Metric Spaces & Their Embeddings: Introduction and Basic Tools Finite Metric Spaces & Their Embeddings: Introduction and Basic Tools Manor Mendel, CMI, Caltech 1 Finite Metric Spaces Definition of (semi) metric. (M, ρ): M a (finite) set of points. ρ a distance function

More information

k-protected VERTICES IN BINARY SEARCH TREES

k-protected VERTICES IN BINARY SEARCH TREES k-protected VERTICES IN BINARY SEARCH TREES MIKLÓS BÓNA Abstract. We show that for every k, the probability that a randomly selected vertex of a random binary search tree on n nodes is at distance k from

More information

Straight-Path Queries in Trajectory Data

Straight-Path Queries in Trajectory Data Straight-Path Queries in Trajectory Data Mark de Berg and Ali D. Mehrabi Department of Computer Science TU Eindhoven Abstract. Inspired by sports analysis, we study data structures for storing a trajectory

More information

Rectangles as Sums of Squares.

Rectangles as Sums of Squares. Rectangles as Sums of Squares. Mark Walters Peterhouse, Cambridge, CB2 1RD Abstract In this paper we examine generalisations of the following problem posed by Laczkovich: Given an n m rectangle with n

More information

Lecture 2: Divide and conquer and Dynamic programming

Lecture 2: Divide and conquer and Dynamic programming Chapter 2 Lecture 2: Divide and conquer and Dynamic programming 2.1 Divide and Conquer Idea: - divide the problem into subproblems in linear time - solve subproblems recursively - combine the results in

More information

Optimal Tree-decomposition Balancing and Reachability on Low Treewidth Graphs

Optimal Tree-decomposition Balancing and Reachability on Low Treewidth Graphs Optimal Tree-decomposition Balancing and Reachability on Low Treewidth Graphs Krishnendu Chatterjee Rasmus Ibsen-Jensen Andreas Pavlogiannis IST Austria Abstract. We consider graphs with n nodes together

More information

CMSC 451: Lecture 7 Greedy Algorithms for Scheduling Tuesday, Sep 19, 2017

CMSC 451: Lecture 7 Greedy Algorithms for Scheduling Tuesday, Sep 19, 2017 CMSC CMSC : Lecture Greedy Algorithms for Scheduling Tuesday, Sep 9, 0 Reading: Sects.. and. of KT. (Not covered in DPV.) Interval Scheduling: We continue our discussion of greedy algorithms with a number

More information

Algorithms for Picture Analysis. Lecture 07: Metrics. Axioms of a Metric

Algorithms for Picture Analysis. Lecture 07: Metrics. Axioms of a Metric Axioms of a Metric Picture analysis always assumes that pictures are defined in coordinates, and we apply the Euclidean metric as the golden standard for distance (or derived, such as area) measurements.

More information

arxiv: v1 [cs.ds] 20 Nov 2016

arxiv: v1 [cs.ds] 20 Nov 2016 Algorithmic and Hardness Results for the Hub Labeling Problem Haris Angelidakis 1, Yury Makarychev 1 and Vsevolod Oparin 2 1 Toyota Technological Institute at Chicago 2 Saint Petersburg Academic University

More information

arxiv: v1 [cs.cg] 29 Jun 2012

arxiv: v1 [cs.cg] 29 Jun 2012 Single-Source Dilation-Bounded Minimum Spanning Trees Otfried Cheong Changryeol Lee May 2, 2014 arxiv:1206.6943v1 [cs.cg] 29 Jun 2012 Abstract Given a set S of points in the plane, a geometric network

More information

CS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs. Instructor: Shaddin Dughmi

CS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs. Instructor: Shaddin Dughmi CS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs Instructor: Shaddin Dughmi Outline 1 Introduction 2 Shortest Path 3 Algorithms for Single-Source Shortest

More information

25 Minimum bandwidth: Approximation via volume respecting embeddings

25 Minimum bandwidth: Approximation via volume respecting embeddings 25 Minimum bandwidth: Approximation via volume respecting embeddings We continue the study of Volume respecting embeddings. In the last lecture, we motivated the use of volume respecting embeddings by

More information

CMPS 6610 Fall 2018 Shortest Paths Carola Wenk

CMPS 6610 Fall 2018 Shortest Paths Carola Wenk CMPS 6610 Fall 018 Shortest Paths Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk Paths in graphs Consider a digraph G = (V, E) with an edge-weight function w

More information

Strategies for Stable Merge Sorting

Strategies for Stable Merge Sorting Strategies for Stable Merge Sorting Sam Buss Alexander Knop Abstract We introduce new stable natural merge sort algorithms, called -merge sort and -merge sort. We prove upper and lower bounds for several

More information

Minimum-Dilation Tour (and Path) is NP-hard

Minimum-Dilation Tour (and Path) is NP-hard Minimum-Dilation Tour (and Path) is NP-hard Panos Giannopoulos Christian Knauer Dániel Marx Abstract We prove that computing a minimum-dilation (Euclidean) Hamilton circuit or path on a given set of points

More information

Copyright 2013 Springer Science+Business Media New York

Copyright 2013 Springer Science+Business Media New York Meeks, K., and Scott, A. (2014) Spanning trees and the complexity of floodfilling games. Theory of Computing Systems, 54 (4). pp. 731-753. ISSN 1432-4350 Copyright 2013 Springer Science+Business Media

More information

On the decidability of termination of query evaluation in transitive-closure logics for polynomial constraint databases

On the decidability of termination of query evaluation in transitive-closure logics for polynomial constraint databases Theoretical Computer Science 336 (2005) 125 151 www.elsevier.com/locate/tcs On the decidability of termination of query evaluation in transitive-closure logics for polynomial constraint databases Floris

More information

Proving languages to be nonregular

Proving languages to be nonregular Proving languages to be nonregular We already know that there exist languages A Σ that are nonregular, for any choice of an alphabet Σ. This is because there are uncountably many languages in total and

More information

Entropy-Preserving Cuttings and Space-Efficient Planar Point Location

Entropy-Preserving Cuttings and Space-Efficient Planar Point Location Appeared in ODA 2001, pp. 256-261. Entropy-Preserving Cuttings and pace-efficient Planar Point Location unil Arya Theocharis Malamatos David M. Mount Abstract Point location is the problem of preprocessing

More information

Bi-Arc Digraphs and Conservative Polymorphisms

Bi-Arc Digraphs and Conservative Polymorphisms Bi-Arc Digraphs and Conservative Polymorphisms Pavol Hell Arash Rafiey arxiv:1608.03368v3 [cs.ds] 29 Dec 2016 Abstract We introduce the class of bi-arc digraphs, and show they coincide with the class of

More information

Convexity in R N Supplemental Notes 1

Convexity in R N Supplemental Notes 1 John Nachbar Washington University November 1, 2014 Convexity in R N Supplemental Notes 1 1 Introduction. These notes provide exact characterizations of support and separation in R N. The statement of

More information

CSE 206A: Lattice Algorithms and Applications Spring Basis Reduction. Instructor: Daniele Micciancio

CSE 206A: Lattice Algorithms and Applications Spring Basis Reduction. Instructor: Daniele Micciancio CSE 206A: Lattice Algorithms and Applications Spring 2014 Basis Reduction Instructor: Daniele Micciancio UCSD CSE No efficient algorithm is known to find the shortest vector in a lattice (in arbitrary

More information

Santa Claus Schedules Jobs on Unrelated Machines

Santa Claus Schedules Jobs on Unrelated Machines Santa Claus Schedules Jobs on Unrelated Machines Ola Svensson (osven@kth.se) Royal Institute of Technology - KTH Stockholm, Sweden March 22, 2011 arxiv:1011.1168v2 [cs.ds] 21 Mar 2011 Abstract One of the

More information

SMT Power Round Solutions : Poles and Polars

SMT Power Round Solutions : Poles and Polars SMT Power Round Solutions : Poles and Polars February 18, 011 1 Definition and Basic Properties 1 Note that the unit circles are not necessary in the solutions. They just make the graphs look nicer. (1).0

More information

Optimal Fractal Coding is NP-Hard 1

Optimal Fractal Coding is NP-Hard 1 Optimal Fractal Coding is NP-Hard 1 (Extended Abstract) Matthias Ruhl, Hannes Hartenstein Institut für Informatik, Universität Freiburg Am Flughafen 17, 79110 Freiburg, Germany ruhl,hartenst@informatik.uni-freiburg.de

More information

arxiv: v1 [cs.ds] 15 Feb 2012

arxiv: v1 [cs.ds] 15 Feb 2012 Linear-Space Substring Range Counting over Polylogarithmic Alphabets Travis Gagie 1 and Pawe l Gawrychowski 2 1 Aalto University, Finland travis.gagie@aalto.fi 2 Max Planck Institute, Germany gawry@cs.uni.wroc.pl

More information

Floodlight Illumination of Infinite Wedges

Floodlight Illumination of Infinite Wedges Floodlight Illumination of Infinite Wedges Matthew Cary Atri Rudra Ashish Sabharwal Erik Vee Computer Science and Engr, Box 352350, University of Washington, Seattle, WA 98195-2350 IBM Almaden Research

More information

Fall 2017 November 10, Written Homework 5

Fall 2017 November 10, Written Homework 5 CS1800 Discrete Structures Profs. Aslam, Gold, & Pavlu Fall 2017 November 10, 2017 Assigned: Mon Nov 13 2017 Due: Wed Nov 29 2017 Instructions: Written Homework 5 The assignment has to be uploaded to blackboard

More information