Computational Movement Analysis Lecture 3:

Slides:



Advertisements
Similar presentations
Routing Complexity of Faulty Networks Omer Angel Itai Benjamini Eran Ofek Udi Wieder The Weizmann Institute of Science.
Advertisements

Review: Search problem formulation
Great Theoretical Ideas in Computer Science
Trajectory Segmentation Marc van Kreveld. Algorithms Researchers … … want their problems to be well-defined (fully specified) … care about efficiency.
1/22 Worst and Best-Case Coverage in Sensor Networks Seapahn Meguerdichian, Farinaz Koushanfar, Miodrag Potkonjak, and Mani Srivastava IEEE TRANSACTIONS.
Incremental Linear Programming Linear programming involves finding a solution to the constraints, one that maximizes the given linear function of variables.
Minimum Vertex Cover in Rectangle Graphs
WSPD Applications.
Introduction to Computer Science 2 Lecture 7: Extended binary trees
Nearest Neighbor Search in High Dimensions Seminar in Algorithms and Geometry Mica Arie-Nachimson and Daniel Glasner April 2009.
Fundamental tools: clustering
Sub Exponential Randomize Algorithm for Linear Programming Paper by: Bernd Gärtner and Emo Welzl Presentation by : Oz Lavee.
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Fast Algorithms For Hierarchical Range Histogram Constructions
Approximations of points and polygonal chains
 Distance Problems: › Post Office Problem › Nearest Neighbors and Closest Pair › Largest Empty and Smallest Enclosing Circle  Sub graphs of Delaunay.
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
On Map-Matching Vehicle Tracking Data
How should we define corner points? Under any reasonable definition, point x should be considered a corner point x What is a corner point?
A (1+  )-Approximation Algorithm for 2-Line-Center P.K. Agarwal, C.M. Procopiuc, K.R. Varadarajan Computational Geometry 2003.
Computing the Fréchet Distance Between Folded Polygons
Zoo-Keeper’s Problem An O(nlogn) algorithm for the zoo-keeper’s problem Sergei Bespamyatnikh Computational Geometry 24 (2003), pp th CGC Workshop.
1 s-t Graph Cuts for Binary Energy Minimization  Now that we have an energy function, the big question is how do we minimize it? n Exhaustive search is.
Lasse Deleuran 1/37 Homotopic Polygonal Line Simplification Lasse Deleuran PhD student.
Delaunay Triangulation Computational Geometry, WS 2006/07 Lecture 11 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Data Transmission and Base Station Placement for Optimizing Network Lifetime. E. Arkin, V. Polishchuk, A. Efrat, S. Ramasubramanian,V. PolishchukA. EfratS.
Counting and Representing Intersections Among Triangles in R 3 Esther Ezra and Micha Sharir.
Totally Unimodular Matrices Lecture 11: Feb 23 Simplex Algorithm Elliposid Algorithm.
1 Introduction to Linear and Integer Programming Lecture 9: Feb 14.
Duality and Arrangements Computational Geometry, WS 2007/08 Lecture 6 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Trajectory Simplification
Prune-and-search Strategy
Lecture 10 : Delaunay Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Overview Motivation. Triangulation of Planar Point Sets. Definition.
A general approximation technique for constrained forest problems Michael X. Goemans & David P. Williamson Presented by: Yonatan Elhanani & Yuval Cohen.
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann Polygon Triangulation Motivation: Guarding art galleries Art gallery theorem.
CSE 421 Algorithms Richard Anderson Lecture 4. What does it mean for an algorithm to be efficient?
Lecture 8 : Arrangements and Duality Computational Geometry Prof. Dr. Th. Ottmann 1 Duality and Arrangements Duality between lines and points Computing.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
1 Matching Shapes with a Reference Point Volkan Çardak.
Improved Approximation Bounds for Planar Point Pattern Matching (under rigid motions) Minkyoung Cho Department of Computer Science University of Maryland.
Duality and Arrangements Computational Geometry, WS 2006/07 Lecture 7 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Well Separated Pair Decomposition 16 GigaYears and 3.3 Million Light Years Playing.
Surface Simplification Using Quadric Error Metrics Michael Garland Paul S. Heckbert.
CSIE in National Chi-Nan University1 Approximate Matching of Polygonal Shapes Speaker: Chuang-Chieh Lin Advisor: Professor R. C. T. Lee National Chi-Nan.
© The McGraw-Hill Companies, Inc., Chapter 6 Prune-and-Search Strategy.
4/28/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Shape Matching Carola Wenk A B   (B,A)
Computational Geometry Piyush Kumar (Lecture 10: Point Location) Welcome to CIS5930.
알고리즘 설계 및 분석 Foundations of Algorithm 유관우. Digital Media Lab. 2 Chap4. Greedy Approach Grabs data items in sequence, each time with “best” choice, without.
1 Prune-and-Search Method 2012/10/30. A simple example: Binary search sorted sequence : (search 9) step 1  step 2  step 3  Binary search.
Stabbing balls and simplifying proteins Ovidiu Daescu and Jun Luo Department of Computer Science University of Texas at Dallas Richardson, TX
Efficient Computing k-Coverage Paths in Multihop Wireless Sensor Networks XuFei Mao, ShaoJie Tang, and Xiang-Yang Li Dept. of Computer Science, Illinois.
Geodesic Fréchet Distance Inside a Simple Polygon Atlas F. Cook IV & Carola Wenk Proceedings of the 25th International Symposium on Theoretical Aspects.
Complexity and Efficient Algorithms Group / Department of Computer Science Testing the Cluster Structure of Graphs Christian Sohler joint work with Artur.
15.082J & 6.855J & ESD.78J September 30, 2010 The Label Correcting Algorithm.
1 Schematization of Networks Rida Sadek. 2 This talk discusses: An algorithm that is studied in the following papers:  S. Cabello, M. de Berg, and M.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. Fast.
Curve Simplification under the L 2 -Norm Ben Berg Advisor: Pankaj Agarwal Mentor: Swaminathan Sankararaman.
TU/e Algorithms (2IL15) – Lecture 12 1 Linear Programming.
Approximation Algorithms based on linear programming.
2IMA20 Algorithms for Geographic Data Spring 2016 Lecture 5: Simplification.
Polygonal Curve Simplification
Haim Kaplan and Uri Zwick
Enumerating Distances Using Spanners of Bounded Degree
Randomized Algorithms CS648
2IMG15 Algorithms for Geographic Data
Kinetic Collision Detection for Convex Fat Objects
Clustering.
Presentation transcript:

Computational Movement Analysis Lecture 3: Curve simplification Joachim Gudmundsson

Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information.

Problem Many algorithms handling movement data are slow, e.g. - - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

Problem Many algorithms handling movement data are slow, e.g. - similarity O(nm log nm) - approximate clustering O(n2+nml) - … Observation: Many trajectories can be simplified without losing much information. Example:

Example Generated trajectory: Universe: 400x400 Number of points: 10K Error: 5 units  278 points 10 units   174 points Time: ~15ms Car trajectory: Universe: ~20km  20km Number of points: 85K Error: 5 meter  2601 points 10 meter   1728 points Time: ~200ms

Outline Simplifying polygonal curves Ramer–Douglas–Peucker 1973 Driemel, Har-Peled and Wenk, 2010 Imai-Iri 1988 Agarwal, Har-Peled, Mustafa and Wang, 2005 Take time into consideration

Ramer-Douglas-Peucker 1972 by Urs Ramer and 1973 by David Douglas and Thomas Peucker The most successful simplification algorithm. Used in GIS, geography, computer vision, pattern recognition… Very easy to implement and works well in practice. p

Ramer-Douglas-Peucker Input polygonal path P = p1,…,pn and threshold  Initially i=1 and j=n Algorithm DP(P,i,j) Find the vertex vf between pi and pj farthest from pipj. dist := the distance between vf and pipj. if dist >  then DP(P, vi , vf) DP(P, vf , vj) else Output(vivj) pj pi

Ramer-Douglas-Peucker Input polygonal path P = p1,…,pn and threshold  Initially i=1 and j=n Algorithm DP(P,i,j) Find the vertex vf between pi and pj farthest from pipj. dist := the distance between vf and pipj. if dist >  then DP(P, vi , vf) DP(P, vf , vj) else Output(vivj) pj pi dist

Ramer-Douglas-Peucker q > e > e > e > e > e p > e

Ramer-Douglas-Peucker q p

Ramer-Douglas-Peucker Time complexity? Testing a shortcut between pi and pj takes O(j-i) time. Worst-case recursion? Algorithm DP(P,i,j) Find the vertex vf farthest from pipj. dist := the distance between vf and pipj. if dist >  then DP(P, vi , vf) DP(P, vf , vj) else Output(vivj) DP(P, vi , vi+1) DP(P, vi+1 , vj) Time complexity T(n) = O(n) + T(n-1) = O(n2)

Summary: Ramer-Douglas-Peucker Worst-case time complexity: O(n2) In most realistic cases: T(n) = T(n1) +  T(n2) + O(n) = O(n log n), where n1 and n2 are smaller than n/c for some constant c. If the curve is in 2D and it does not self-intersect then the algorithm can be implemented in O(n log* n) time. [Hershberger & Snoeiynk’98] Does not give any bound on the complexity of the simplification!

Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pn s.t. |q-pi|>  if no such vertex then set i:=n add pi to P’ end return P’ 

Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pn s.t. |q-pi|>  if no such vertex then set i:=n add pi to P’ end return P’ 

Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pn s.t. |q-pi|>  if no such vertex then set i:=n add pi to P’ end return P’ 

Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pn s.t. |q-pi|>  if no such vertex then set i:=n add pi to P’ end return P’ 

Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pn s.t. |q-pi|>  if no such vertex then set i:=n add pi to P’ end return P’ 

Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pn s.t. |q-pi|>  if no such vertex then set i:=n add pi to P’ end return P’ 

Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pn s.t. |q-pi|>  if no such vertex then set i:=n add pi to P’ end return P’ 

Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pn s.t. |q-pi|>  if no such vertex then set i:=n add pi to P’ end return P’ 

Driemel et al. Simple simplification(P = p1,…,pn, ) P’:= p1 i:=1 while i<n do q := pi pi := first vertex pi in q,…,pn s.t. |q-pi|>  if no such vertex then set i:=n add pi to P’ end return P’

Driemel et al. Simple simplification(P = p1,…,pn, ) Property 1: All edges (except the last one) have length at least . Property 2: F(P,P’)  

Driemel et al. Simple simplification(P = p1,…,pn, ) Property 1: All edges (except the last one) have length at least . Property 2: F(P,P’)   Definition: A curve P is c-packed, if has finite length, and for any ball b(p,r) it holds |P b(p,r)| < cr. Property 3: If P is c-packed then P’ is 6c-packed.

Driemel et al. Aim: Prove Property 3 If P is c-packed then P’ is 6c-packed. We need the following observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+ )|  |P’  B(p,r)| for any ball B(p,r) Proof: B(p,r)

Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)|  |P’  B(p,r)| for any ball B(p,r) Proof: Pu B(p,r) u

Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)|  |P’  B(p,r)| for any ball B(p,r) Proof: Hu Pu B(p,r) u  Pu must lie inside Hu

Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)|  |P’  B(p,r)| for any ball B(p,r) Proof: |B(p,r)  u| = |v| lv rv Hu Pu B(p,r) u v  Pu must intersect lv and rv  |PuHv|  |v|

Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)| v |P’  B(p,r)| for any ball B(p,r) Proof: |B(p,r)  u| = |v| lv rv Hu Pu B(p,r) u v  v  B(p,r)

Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)|  |P’  B(p,r)| for any ball B(p,r) Proof: |B(p,r)  u| = |v| B(p,r+) lv rv Hu Hv Pu B(p,r) u v  v  B(p,r)

Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)|  |P’  B(p,r)| for any ball B(p,r) Proof: |B(p,r)  u| = |v| B(p,r+) lv rv Hu Hv Pu B(p,r) u v  v  B(p,r)  Hv  B(p,r+)

Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)|  |P’  B(p,r)| for any ball B(p,r) Proof: |B(p,r)  u| = |v| B(p,r+) lv rv Hu Hv Pu B(p,r) u v  v  B(p,r)  Hv  B(p,r+)  Pu  Hv  B(p,r+)

Driemel et al. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+)|  |P’  B(p,r)| for any ball B(p,r) Proof: |B(p,r)  u| = |v| B(p,r+) lv rv Hu Hv Pu B(p,r) u v  v  B(p,r)  Hv  B(p,r+)  Pu  Hv  B(p,r+)  |Pu  B(p,r+)|  |v|

Driemel et al. Theorem: If P is c-packed then P’ is 6c-packed. Observation: Let P be a curve and let P’ be an -simplification of P |P  B(p,r+ )|  |P’  B(p,r)| for any ball B(p,r)

Driemel et al. Theorem: If P is c-packed then P’ is 6c-packed. Proof: Proof by contradiction. Assume |P’B(p,r)|>6cr for some B(p,r) Two cases: r   or r< Case r  : |P  B(p,2r)|

Driemel et al. Theorem: If P is c-packed then P’ is 6c-packed. Proof: Proof by contradiction. Assume |P’B(p,r)|>6cr for some B(p,r) Two cases: r   or r< Case r  : |P  B(p,2r)|  |P  B(p,r+)|

According to observation Driemel et al. Theorem: If P is c-packed then P’ is 6c-packed. Proof: Proof by contradiction. Assume |P’B(p,r)|>6cr for some B(p,r) Two cases: r   or r< Case r  : |P  B(p,2r)|  |P  B(p,r+)|  |P’  B(p,r)| According to observation

According to observation Driemel et al. Theorem: If P is c-packed then P’ is 6c-packed. Proof: Proof by contradiction. Assume |P’B(p,r)|>6cr for some B(p,r) Two cases: r   or r< Case r  : |P  B(p,2r)|  |P  B(p,r+)|  |P’  B(p,r)| > 6cr According to observation

According to observation Driemel et al. Theorem: If P is c-packed then P’ is 6c-packed. Proof: Proof by contradiction. Assume |P’B(p,r)|>6cr for some B(p,r) Two cases: r   or r< Case r  : |P  B(p,2r)|  |P  B(p,r+)|  |P’  B(p,r)| > 6cr |P  B(p,2r)| > 6cr  |P  B(p,r’)| > 3cr’ which contradicts that P is c-packed According to observation

According to observation Driemel et al. Theorem: If P is c-packed then P’ is 6c-packed. Proof: Proof by contradiction. Assume |P’B(p,r)|>6cr for some B(p,r) Two cases: r   or r< Case r  : |P  B(p,2r)|  |P  B(p,r+)|  |P’  B(p,r)| > 6cr |P  B(p,2r)| > 6cr  |P  B(p,r’)| > 3cr’ which contradicts that P is c-packed Case r < : Proof is similar. According to observation

Summary: Driemel et al. Simple simplification: can be computed in O(n) time Property 1: All edges (except the last one) have length at least . Property 2: F(P,P’)   Definition: A curve P is c-packed, if has finite length, and for any ball b(p,r) it holds |P b(p,r)| < cr. Property 3: If P is c-packed then P’ is 6c-packed.

Imai-Iri Both previous algorithms are simple and fast but do not give a bound on the complexity of the simplification! Imai-Iri 1988 gave an algorithm that produces a -simplification with the minimum number of links.

Imai-Iri Input polygonal path P = p1,…,pn and threshold  Build a graph G containing all valid shortcuts. Find a minimum link path from p1 to pn in G

Imai-Iri Input polygonal path P = p1,…,pn and threshold  Build a graph G containing all valid shortcuts. Find a minimum link path from p1 to pn in G

Imai-Iri Find all possible valid shortcuts

Imai-Iri Find all possible valid shortcuts > e

Imai-Iri Find all possible valid shortcuts <e <e

Imai-Iri Find all possible valid shortcuts >e

Imai-Iri Find all possible valid shortcuts >e

Imai-Iri Find all possible valid shortcuts >e

Imai-Iri Find all possible valid shortcuts >e

Imai-Iri Find all possible valid shortcuts >e

Imai-Iri Find all possible valid shortcuts >e

Imai-Iri Find all possible valid shortcuts

Imai-Iri Find all possible valid shortcuts

Imai-Iri Find all possible valid shortcuts

Imai-Iri Find all possible valid shortcuts

Imai-Iri Find all possible valid shortcuts

Imai-Iri Find all possible valid shortcuts

Imai-Iri All possible shortcuts!

Imai-Iri 1. Build a directed graph of valid shortcuts. 2. Compute a shortest path from p1 to pn using breadth-first search.

Imai-Iri 1. Build a directed graph of valid shortcuts. 2. Compute a shortest path from p1 to pn using breadth-first search.

Imai-Iri Brute force running time: ? #possible shortcuts ?

Summary: Imai-Iri Running time: O(n3) O(n2) possible shortcuts O(n) per shortcut  O(n3) to build graph O(n2) BFS in the graph Output: A path with minimum number of edges Improvements: Chan and Chin’92: O(n2)

Results so far RDP: O(n2) time (simple and fast in practice) Output: A path with no bound on the size of the path SS: O(n) time (simple and fast in practice) Imai-Iri: O(n2) time by Chan and Chin (complicated) Output: A path with minimum number of edges RDP and II use the Hausdorff error measure, SS use Fréchet Can we get something that is simple, fast and has a worst-case bound using the Fréchet error measure?

Agarwal et al. Agarwal, Har-Peled, Mustafa and Wang, 2002 Time: Running time O(n log n) Measure: Fréchet distance Output: Path has at most the same complexity as a minimum link (/2)-simplification

Analysis - Agarwal et al. pi pm pj pl Let P = p1, p2, ... , pn be a polygonal curve Notation: Let (pipj) denote the Fréchet distance between (pi,pj) and the subpath (pi,pj) of P between pi and pj.

Algorithm - Agarwal et al. Algorithm(P = p1,…,pn, ) i := 1 P’= p1 while i < n do find any j>i such that ((pi,pj)   and ((pi,pj+1) > ) or ((pi,pj)   and j=n) P’= concat(P,pj) i := j end return P’

Algorithm - Agarwal et al. p1 Algorithm(P = p1,…,pn, ) i := 1 P’= p1 while i < n do find any j>i such that ((pi,pj)   and ((pi,pj+1) > ) or ((pi,pj)   and j=n) P’= concat(P,pj) i := j end return P’ pj Pj+1

Algorithm - Agarwal et al. p1 Algorithm(P = p1,…,pn, ) i := 1 P’= p1 while i < n do find any j>i such that ((pi,pj)   and ((pi,pj+1) > ) or ((pi,pj)   and j=n) P’= concat(P,pj) i := j end return P’ pj Pj+1

Algorithm - Agarwal et al. pi pj Pj+1 Efficient algorithm? Recall: Computing the Fréchet distance between (pi,pj) and (pi,pj) can be done in O(j-i) time (Lecture 1).

Algorithm - Agarwal et al. pi pj Pj+1 Efficient algorithm? Recall: Computing the Fréchet distance between (pi,pj) and (pi,pj) can be done in O(j-i) time (Lecture 1). Finding the first j such that (pi,pj)   and (pi,pj+1) >  takes O(n2) time.

Algorithm - Agarwal et al. How can we speed up the search for pj? Note that it is enough to find any vertex pj such that (pi,pj)   and (pi,pj+1) >  Idea: Search for pj using exponential search followed by binary search!

Algorithm - Agarwal et al. Exponential search: Test pi+1, pi+2, pi+4, pi+8… until found pi+2k, such that (pi,pi+2k) > . Binary search: Search for pj between pi+2k-1 and pi+2k s.t. (pi,pj)   and (pi,pj+1) > .   >  i+2k-1 i+2k

Algorithm - Agarwal et al. Exponential search: Test pi+1, pi+2, pi+4, pi+8… until found pi+2k, such that (pi,pi+2k) > . Binary search: Search for pj between pi+2k-1 and pi+2k s.t. (pi,pj)   and (pi,pj+1) > . if   then search right   >  i+2k-1 i+2k

Algorithm - Agarwal et al. Exponential search: Test pi+1, pi+2, pi+4, pi+8… until found pi+2k, such that (pi,pi+2k) > . Binary search: Search for pj between pi+2k-1 and pi+2k s.t. (pi,pj)   and (pi,pj+1) > . if >  then search left   >  i+2k-1 i+2k

Algorithm - Agarwal et al. Exponential search: Test pi+1, pi+2, pi+4, pi+8… until found pi+2k, such that (pi,pi+2k) > . Binary search: Search for pj between pi+2k-1 and pi+2k s.t. (pi,pj)   and (pi,pj+1) > .   >   > pj pj+1 i+2k-1 i+2k

Algorithm - Agarwal et al. Exponential search: Test pi+1, pi+2, pi+4, pi+8… until found pi+2k, such that (pi,pi+2k) > . Iterations: O(log n) Binary search: Search for pj between pi+2k-1 and pi+2k s.t. (pi,pj)   and (pi,pj+1) > . Iterations: O(log n) Total time: O(n log n)

Analysis - Agarwal et al. pi pm pj pl Lemma 1: Let P = p1, p2, ... , pn be a polygonal curve. For l ≤ i ≤ j ≤ m, (pipj) ≤ 2·(plpm).

Analysis - Agarwal et al. pi pm pj pl Lemma 1: Let P = p1, p2, ... , pn be a polygonal curve. For l ≤ i ≤ j ≤ m, (pipj) ≤ 2·(plpm). Proof: Fix matching that realises (plpm). Set  = (plpm). qi qj

Analysis - Agarwal et al. pi pm pj pl Lemma 1: Let P = p1, p2, ... , pn be a polygonal curve. For l ≤ i ≤ j ≤ m, (pipj) ≤ 2·(plpm). Proof: Fix matching that realises (plpm). Set  = (plpm). ((pipj),(qiqj)) ≤  qi qj

Analysis - Agarwal et al. Lemma 1: Let P = p1, p2, ... , pn be a polygonal curve. For l ≤ i ≤ j ≤ m, (pipj) ≤ 2·(plpm). Proof: Fix matching that realises (plpm). Set  = (plpm). ((pipj),(qiqj)) ≤  qi pi pj (pipj) qj

Analysis - Agarwal et al. pi pm pj pl Lemma 1: Let P = p1, p2, ... , pn be a polygonal curve. For l ≤ i ≤ j ≤ m, (pipj) ≤ 2·(plpm). Proof: Fix matching that realises (plpm). Set  = (plpm). ((pipj),(qiqj)) ≤  ((qiqj),(pipj)) ≤  qi qj

Analysis - Agarwal et al. Lemma 1: Let P = p1, p2, ... , pn be a polygonal curve. For l ≤ i ≤ j ≤ m, (pipj) ≤ 2·(plpm). Proof: Fix matching that realises (plpm). Set  = (plpm). ((pipj),(qiqj)) ≤  ((qiqj),(pipj)) ≤  ≤  qi pi pj qj ≤ 

Analysis - Agarwal et al. pi pm pj pl Lemma 1: Let P = p1, p2, ... , pn be a polygonal curve. For l ≤ i ≤ j ≤ m, (pipj) ≤ 2·(plpm). Proof: Fix matching that realises (plpm). Set  = (plpm). ((pipj),(qiqj)) ≤  ((qiqj),(pipj)) ≤  ((pipj),pipj) ≤ ≤ ((pipj),(qiqj)) + ((qiqj),(pipj)) ≤ 2 qi (pipj) qj □

Analysis - Agarwal et al. Theorem: (P,P’)   and |P’|  Popt(/2) Proof: (P,P’)   follows by construction.

Analysis - Agarwal et al. pim-1 Theorem: |P’|  Popt(/2) Proof: Q = p1= pj1,…, pjl=pn - optimal (/2)-simplification P’ = p1= pi1,…, pik=pn Prove (by induction) that im  jm , m  1. pjm pim

Analysis - Agarwal et al. pjm-1 pim-1 Theorem: |P’|  Popt(/2) Proof: Q = p1= pj1,…, pjl=pn - optimal (/2)-simplification P’ = p1= pi1,…, pik=pn Prove (by induction) that im  jm , m  1. Assume im-1  jm-1 and let i’ = im+1. pjm pim pi’

Analysis - Agarwal et al. pjm-1 pim-1 Theorem: |P’|  Popt(/2) Proof: Q = p1= pj1,…, pjl=pn - optimal (/2)-simplification P’ = p1= pi1,…, pik=pn Prove (by induction) that im  jm , m  1. Assume im-1  jm-1 and let i’ = im+1. By construction we have: (pim-1pi’) >  and (pim-1pi’-1)    > pjm pim If i’ > jm then we are done! pi’

Analysis - Agarwal et al. pjm-1 pim-1 Theorem: |P’|  Popt(/2) Proof: Q = p1= pj1,…, pjl=pn - optimal (/2)-simplification P’ = p1= pi1,…, pik=pn (pim-1pi’) >  and (pim-1pi’-1)   Assume the opposite i.e. i’  jm pim pi’ pjm

Analysis - Agarwal et al. pjm-1 pim-1 Theorem: |P’|  Popt(/2) Proof: Q = p1= pj1,…, pjl=pn - optimal (/2)-simplification P’ = p1= pi1,…, pik=pn (pim-1pi’) >  and (pim-1pi’-1)   Assume the opposite i.e. i’  jm Q is an (/2)-simplification  (pjm-1pjm)  /2 pim pi’ pjm

Analysis - Agarwal et al. pjm-1 pim-1 Theorem: |P’|  Popt(/2) Proof: Q = p1= pj1,…, pjl=pn - optimal (/2)-simplification P’ = p1= pi1,…, pik=pn (pim-1pi’) >  and (pim-1pi’-1)   Assume the opposite i.e. i’  jm Q is an (/2)-simplification  (pjm-1pjm)  /2 According to Lemma 1: (pim-1pi’)  2 (pjm-1pjm)   pim pi’ pjm

Analysis - Agarwal et al. pjm-1 pim-1 Theorem: |P’|  Popt(/2) Proof: Q = p1= pj1,…, pjl=pn - optimal (/2)-simplification P’ = p1= pi1,…, pik=pn According to Lemma 1: (pim-1pi’)  2 (pjm-1pjm)   This is a contradiction since (pjm-1pjm) >  by construction.  i’ > jm and we are done! pjm pim □ pi’

Summary - Agarwal et al. Theorem: Given a polygonal curve P in Rd and a parameter   0, an -simplification of P of size at most Popt(/2) can be constructed in O(n log n) time and O(n) space.

Summary Ramer–Douglas–Peucker 1973 Used very often in practice. Easy to implement and fast in practice. Hausdorff error Simple Simplification O(n) time - simple and fast Several nice properties. Fréchet error Imai-Iri 1988 Gives an optimal solution but slow. Hausdorff error Agarwal, Har-Peled, Mustafa and Wang 2005 Fast and easy to implement. Gives a worst-case performance guarantee. Fréchet error

Handle time? Compress trajectories s.t. standard database queries are “sound” after compression. The five standard database operations on a trajectory T are: where-at(T,t): location of e at time t. when-at(T,(x,y),L): time at which e is within distance L of (x,y) intersect: nearest-neighbour: spatial-join:

time at which e is within distance L of (x,y). Handle time? where-at(T,t): location of e at time t. time t when-at(T,(x,y),L): time at which e is within distance L of (x,y). point (x,y)

Define distance between simplification and original trajectory. Soundness  Define distance between simplification and original trajectory. Definition: A distance function is sound for a query q, if for each >0 there exists a >0, s.t. for every trajectory T and its -simplification T’ we have ||q(T)-q(T’)||< . [Cao, Wolfson & Trajcevski’06]

Path simplification Input path Traditional path simplification Aim 1 2 7 6 1 4 5 3 2 7 6 1 2 7 6? Input path Traditional path simplification Aim

Soundness Theorem: Trajectory = Polygonal path in 3D (x,y,time) Transform time units into space units (x,y,z), where z = time   and  is the maximum speed along the trajectory. Use the Euclidean distance function. Theorem: Where-at, spatial-join, NN, intersect are sound When-at is NOT sound p q r t Where-at(T,t): Spatial error = |pq| = |pr|/sin(rqp)  2  

Soundness Theorem: Where-at, spatial-join, NN, intersect are sound When-at is approximately sound Apx-When-at(T,(x,y),L): When within distance L from (x,y)? Set-Apx-when-at(T,(x,y),L) Set of time points when T is within distance L from (x, y) Given a query point q=(x, y), let t1 be the time reported by apx-when-at(T’,(x, y), L+). There exists a time point t2 in set-apx-when-at (T, (x, y), L+2) such that |t1 − t2| / and |T(t1) − T’(t2)|  .

Simplifying polygonal curves Summary Simplifying polygonal curves Ramer–Douglas–Peucker 1973 Driemel, Har-Peled and Wenk 2010 Imai-Iri 1988 Agarwal, Har-Peled, Mustafa and Wang 2005 Take time into consideration Other interesting simplification algorithms Abam, de Berg, Hachenberger, Zarei 2007

Constraint FSD Recall the free space diagram (fsd) Consider the fsd of two curves P and Q with respect to a distance r. (qQ,pP) in the fsd is in the free space iff dist(q,p)  r. Can we use it for other measures? (q1,p1) (qm,pn) P Q q p

Constraint FSD Example: (qQ,pP) in the fsd is in the free space iff p can “see” q. q p Can the owner and the dog walk along P and Q such that they always see each other?

Constraint FSD Example: (qQ,pP) in the fsd is in the free space iff p can “see” q. q p Can the owner and the dog walk along P and Q such that they always see each other? Yes!

Constraint FSD Example: The entities must walk with similar speed (similar ~ within a factor of 2?). P Q Can the entities walk along P and Q with similar speed while keeping a distance of at most r?

Constraint FSD Example: The entities must walk with similar speed (similar ~ within a factor of 2?). P Q Can the entities walk along P and Q with similar speed while keeping a distance of at most r?

Constraint FSD Example: The entities must walk with similar speed (similar ~ within a factor of 2?). P Q Can the entities walk along P and Q with similar speed while keeping a distance of at most r?

Constraint FSD Example: The entities must walk with similar speed (similar ~ within a factor of 2?). P Q Can the entities walk along P and Q with similar speed while keeping a distance of at most r?

Constraint FSD Example: The entities must walk with similar speed (similar ~ within a factor of 2?). P Q Can the entities walk along P and Q with similar speed while keeping a distance of at most r? No!

Open Problem Can we find a subquadtratic algorithm that computed a simplification with a minimal number of edges, or within a constant factor?

References A. Driemel, S. Har-Peled and C. Wenk. Approximating the Fréchet Distance for Realistic Curves in Near Linear Time. Discrete & Computational Geometry , 2012. H. Cao, O. Wolfson, and G. Trajcevski. Spatio-temporal data reduction with deterministic error bounds. The VLDB Journal, 2006. W. S. Chan and F. Chin. Approximation of polygonal curves with minimum number of line segments. In Proceedings of the 3rd International Symposium on Algorithms and Computation, 1992. D. H. Douglas and T. K. Peucker. Algorithms for the reduction of the number of points required to represent a digitized line or its caricature. The Canadian Cartographer, 1973. J. Gudmundsson, J. Katajainen, D. Merrick, C. Ong and T. Wolle. Compressing spatio- temporal trajectories. Computational Geometry - Theory and Applications, 2009. P. K. Agarwal, S. Har-Peled, N. Mustafa, and Y. Wang. Near-linear time approximation algorithms for curve simplication in two and three dimensions. Algorithmica, 2005.