2IMA20 Algorithms for Geographic Data Spring 2016 Lecture 5: Simplification.

Slides:



Advertisements
Similar presentations
Great Theoretical Ideas in Computer Science
Advertisements

Incremental Linear Programming Linear programming involves finding a solution to the constraints, one that maximizes the given linear function of variables.
Computational Movement Analysis Lecture 3:
Fundamental tools: clustering
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.
Approximations of points and polygonal chains
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.
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.
Lasse Deleuran 1/37 Homotopic Polygonal Line Simplification Lasse Deleuran PhD student.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Convex Hulls Today: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness,
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.
. Hidden Markov Model Lecture #6 Background Readings: Chapters 3.1, 3.2 in the text book, Biological Sequence Analysis, Durbin et al., 2001.
Shortest Paths Definitions Single Source Algorithms –Bellman Ford –DAG shortest path algorithm –Dijkstra All Pairs Algorithms –Using Single Source Algorithms.
Divide-and-Conquer1 7 2  9 4   2  2 79  4   72  29  94  4.
Trajectory Simplification
CSE115/ENGR160 Discrete Mathematics 03/03/11 Ming-Hsuan Yang UC Merced 1.
Prune-and-search Strategy
1.4 Exercises (cont.) Definiton: A set S of points is said to be affinely (convex) independent if no point of S is an affine combination of the others.
A general approximation technique for constrained forest problems Michael X. Goemans & David P. Williamson Presented by: Yonatan Elhanani & Yuval Cohen.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Jean-Charles REGIN Michel RUEHER ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining.
CSE 421 Algorithms Richard Anderson Lecture 4. What does it mean for an algorithm to be efficient?
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
Job Scheduling Lecture 19: March 19. Job Scheduling: Unrelated Multiple Machines There are n jobs, each job has: a processing time p(i,j) (the time to.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
Ch. 8 & 9 – Linear Sorting and Order Statistics What do you trade for speed?
Chapter 5 Algorithm Analysis 1CSCI 3333 Data Structures.
C&O 355 Mathematical Programming Fall 2010 Lecture 17 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A.
C&O 355 Lecture 2 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A.
Minimal Spanning Trees What is a minimal spanning tree (MST) and how to find one.
Analysis of Algorithms
© The McGraw-Hill Companies, Inc., Chapter 6 Prune-and-Search Strategy.
Jessie Zhao Course page: 1.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
Approximation algorithms for TSP with neighborhoods in the plane R 郭秉鈞 R 林傳健.
CSIS7101 – Advanced Database Technologies Spatio-Temporal Data (Part 1) On Indexing Mobile Objects Kwong Chi Ho Leo Wong Chi Kwong Simon Lui, Tak Sing.
Discrete Structures Lecture 12: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
Computational Geometry Piyush Kumar (Lecture 10: Point Location) Welcome to CIS5930.
CSC 211 Data Structures Lecture 13
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.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
2/19/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Voronoi Diagrams Carola Wenk Based on: Computational Geometry:
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Stabbing balls and simplifying proteins Ovidiu Daescu and Jun Luo Department of Computer Science University of Texas at Dallas Richardson, TX
UNC Chapel Hill M. C. Lin Introduction to Motion Planning Applications Overview of the Problem Basics – Planning for Point Robot –Visibility Graphs –Roadmap.
CMPS 3130/6130 Computational Geometry Spring 2015
15.082J & 6.855J & ESD.78J September 30, 2010 The Label Correcting Algorithm.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
Curve Simplification under the L 2 -Norm Ben Berg Advisor: Pankaj Agarwal Mentor: Swaminathan Sankararaman.
C&O 355 Lecture 19 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
Common Intersection of Half-Planes in R 2 2 PROBLEM (Common Intersection of half- planes in R 2 ) Given n half-planes H 1, H 2,..., H n in R 2 compute.
Approximation Algorithms based on linear programming.
Proof of correctness of Dijkstra’s algorithm: Basically, we need to prove two claims. (1)Let S be the set of vertices for which the shortest path from.
Discrete Mathematics Chapter 2 The Fundamentals : Algorithms, the Integers, and Matrices. 大葉大學 資訊工程系 黃鈴玲.
Advanced Algorithms Analysis and Design
Polygonal Curve Simplification
2IMA20 Algorithms for Geographic Data
Enumerating Distances Using Spanners of Bounded Degree
Instructor: Shengyu Zhang
Dijkstra’s Algorithm for the Shortest Path Problem
2IMG15 Algorithms for Geographic Data
On the Geodesic Centers of Polygonal Domains
CMPS 3130/6130 Computational Geometry Spring 2017
Haitao Wang Utah State University WADS 2017, St. John’s, Canada
Kinetic Collision Detection for Convex Fat Objects
Clustering.
Presentation transcript:

2IMA20 Algorithms for Geographic Data Spring 2016 Lecture 5: Simplification

Problem Many algorithms handling movement data are slow, e.g. similarity O(nm log nm) grouping O(t n 3 ) general segmentation O(n 2 ) … 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) grouping O(t n 3 ) general segmentation O(n 2 ) … 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) grouping O(t n 3 ) general segmentation O(n 2 ) … 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) grouping O(t n 3 ) general segmentation O(n 2 ) … 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) grouping O(t n 3 ) general segmentation O(n 2 ) … 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) grouping O(t n 3 ) general segmentation O(n 2 ) … 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) grouping O(t n 3 ) general segmentation O(n 2 ) … 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) grouping O(t n 3 ) general segmentation O(n 2 ) … 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) grouping O(t n 3 ) general segmentation O(n 2 ) … Observation: Many trajectories can be simplified without losing much information. Example:

A sequence of steps to solve a problem  Understand the input  Understand what you really want from the output  Write an input and output specification and double-check it!  Find geometric properties of the desired output  Construct an algorithm  Verify that it actually solves the problem you specified  Analyze the efficiency

Assumptions  Due to lack of further information: constant speed (and velocity) on each segment ➨ location changes continuously, but speed/velocity is piecewise constant and changes “in jumps” (x i,y i ),t i (x 2,y 2 ),t 2 (x 1,y 1 ),t 1 (x n,y n ),t n

Assumptions  We do not want to assume that … sampling occurred at regular intervals no data is missing the object is only present at the measured locations but not in between A B How much did A deviate from the route of B?

A sequence of steps to solve a problem  Understand the input  Understand what you really want from the output  Write an input and output specification and double-check it!  Find geometric properties of the desired output  Construct an algorithm  Verify that it actually solves the problem you specified  Analyze the efficiency 

Specifying the output  We want a trajectory with the smallest number of vertices and with error at most   Without thinking about the output, one could say: “Just use a line simplification method” assume the numbers correspond to minutes we have made speed uniform! correct!

Specifying the output  We want a trajectory with the smallest number of vertices and with error at most  … but what do we mean with “error” ? Option 1: the maximum error in location for any moment of time: max distance( T(t), S(t) ) time t T input trajectory S simplified trajectory T S1S1 S2S2 (3) (5)

Specifying the output  We want a trajectory with the smallest number of vertices and with error at most  … but what do we mean with “error” ? Option 2: the error in speed as a multiplicative factor, for any moment Option 3: the error in velocity (speed and heading combined) … or any combination of the above

But …  it is important to start simple  therefore in this lecture mostly: curve simplification  you will see in Assignment 3, Exercise 3 an example of how to incorporate time

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

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

Input polygonal path P =  p 1,…,p n  and threshold  Initially i=1 and j=n Algorithm DP(P,i,j) Find the vertex v f between p i and p j farthest from p i p j. dist := the distance between v f and p i p j. if dist >  then DP(P, v i, v f ) DP(P, v f, v j ) else Output(v i v j ) pjpj pipi Ramer-Douglas-Peucker

Input polygonal path P =  p 1,…,p n  and threshold  Initially i=1 and j=n Algorithm DP(P,i,j) Find the vertex v f between p i and p j farthest from p i p j. dist := the distance between v f and p i p j. if dist >  then DP(P, v i, v f ) DP(P, v f, v j ) else Output(v i v j ) Ramer-Douglas-Peucker pjpj pipi dist

Ramer-Douglas-Peucker    p q      

Time complexity? Testing a shortcut between p i and p j takes O(j-i) time. Worst-case recursion? DP(P, v i, v i+1 ) DP(P, v i+1, v j ) Time complexity T(n) = O(n) + T(n-1) = O(n 2 ) Algorithm DP(P,i,j) Find the vertex v f farthest from p i p j. dist := the distance between v f and p i p j. if dist >  then DP(P, v i, v f ) DP(P, v f, v j ) else Output(v i v j )

Summary: Ramer-Douglas-Peucker  Worst-case time complexity: O(n 2 )  In most realistic cases: T(n) = T(n 1 ) + T(n 2 ) + O(n) = O(n log n), where n 1 and n 2 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 & Snoeyink’98]  Does not give any bound on the complexity of the simplification!    p

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

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

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

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

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

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

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

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

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

Driemel et al. Simple simplification (P =  p 1,…,p n ,  ) Property 1: All edges (except the last one) have length at least . Property 2:  Fréchet (P,P’)   Running time: O(n) Simplification maintains packedness, but gives no bound on size. 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.

Imai-Iri  Both previous algorithms are simple and fast but do not give a bound on the complexity of the simplification!  Examples for which they perform poorly?

Imai-Iri  Both previous algorithms are simple and fast but do not give a bound on the complexity of the simplification!  Examples for which they perform poorly? εεε Douglas-PeuckerOptimal

Imai-Iri  Both previous algorithms are simple and fast but do not give a bound on the complexity of the simplification!  Examples for which they perform poorly?  Imai-Iri 1988 gave an algorithm that produces an  -simplification with the minimum number of links.  Generally, two variants Min-vertices (for given ε): this is the one we mostly consider Min-ε (for given length of simplification): often uses binary search with Min-vertices as subroutine  Another distinction: Does the simplification only use vertices of the input or not? In lecture only input vertices, but see Ass. 3, Ex. 1

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

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

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 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 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 p 1 to p n using breadth-first search.

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

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

Analysis: Imai-Iri Brute force running time: ? #possible shortcuts ? Running time: O(n 3 ) O(n 2 ) possible shortcuts O(n) per shortcut  O(n 3 ) to build graph O(n 2 ) BFS in the graph Output: A path with minimum number of edges Improvements: Chan and Chin’92: O(n 2 ) for Min-ε: O(n 2 log n)

Speeding up Imai-Iri  The graph can have ~n 2 edges; testing one shortcut takes time linear in the number of vertices in between  The Imai-Iri algorithm avoids spending ~n 3 time by testing all shortcuts from a single vertex in linear time

Speeding up Imai-Iri A shortcut (p i p j ) is feasible iff it intersects all ε-disks of vertices inbetween (i+1,…,j-1) iff both rays (from p i through p j and from p j through p i ) intersect all ε- disks of vertices inbetween Checking if a ray intersects all disks can be done efficiently: Algorithm for i=1,...,n W i,i = whole plane for j = i+1,...,n W i,j = W i,j-1 intersect wedge w i,j defined by p i and ε-disk around p j if W i,j = empty then break if ray r i,j in W i,j then (p i p j ) is feasible O(n 2 ) Note: after projecting you can see this as interval intersection problem

Imai-Iri with Fréchet distance The framework of Imai-Iri can also be used for simplification under the Fréchet distance  Min-vertices (for given ε) : solve decision problem for each edge: O(n 3 )  Min-ε (for given length of simplification): solve computation problem for each edge: O(n 3 log n)

Results so far  RDP: O(n 2 ) time (simple and fast in practice)  SimpleSimp: O(n) time (simple and fast in practice)  Output: A path with no bound on the size of the path  Imai-Iri: O(n 2 ) time by Chan and Chin  Output: A path with minimum number of edges  RDP and II use the Hausdorff error measure, SimpleSimp uses Fréchet, II can use Fréchet but slow  Question: 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

Algorithm - Agarwal et al.  Let P =  p 1, p 2,..., p n  be a polygonal curve  Notation: Let  (p i p j ) denote the Fréchet distance between (p i,p j ) and the subpath  (p i,p j ) of P between p i and p j. pipi pmpm pjpj plpl

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

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

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

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

Algorithm - Agarwal et al.  Efficient algorithm?  Recall: Computing the Fréchet distance between (p i,p j ) and  (p i,p j ) can be done in O(j-i) time  Finding the first j such that  (p i,p j )   and  (p i,p j+1 ) >  takes O(n 2 ) time. pipi pjpj P j+1

Algorithm - Agarwal et al.  How can we speed up the search for p j ?  Note that we just want to find any vertex p j such that  (p i,p j )   and  (p i,p j+1 ) >  Idea: search for p j using exponential search followed by binary search (double&search)

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

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

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

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

Algorithm - Agarwal et al.  Exponential search: Test p i+1, p i+2, p i+4, p i+8 … until found p i+2 k, such that  (p i,p i+2 k ) > . Iterations: O(log n)  Binary search: Search for p j between p i+2 k-1 and p i+2 k s.t.  (p i,p j )   and  (p i,p j+1 ) > . Iterations: O(log n)  The algorithm computes indices i j = i j-1 + r j with r j in [2 l,2 l+1 ] and ∑r j = n.  To compute i j requires l = O(log n) iterations of both searches, costing O(l∙2 l ) : sums to overall O(n log n)

Analysis - Agarwal et al. Lemma 1: Let P =  p 1, p 2,..., p n  be a polygonal curve. For l ≤ i ≤ j ≤ m,  (p i p j ) ≤ 2·  (p l p m ). pipi pmpm pjpj plpl

Analysis - Agarwal et al. Lemma 1: Let P =  p 1, p 2,..., p n  be a polygonal curve. For l ≤ i ≤ j ≤ m,  (p i p j ) ≤ 2·  (p l p m ). Proof: Fix matching that realises  (p l p m ). Set =  (p l p m ). pipi pmpm pjpj plpl

Analysis - Agarwal et al. Lemma 1: Let P =  p 1, p 2,..., p n  be a polygonal curve. For l ≤ i ≤ j ≤ m,  (p i p j ) ≤ 2·  (p l p m ). Proof: Fix matching that realises  (p l p m ). Set =  (p l p m ). 1.  (  (p i p j ),(q i q j )) ≤ pipi pmpm pjpj plpl qjqj qiqi

Analysis - Agarwal et al. Lemma 1: Let P =  p 1, p 2,..., p n  be a polygonal curve. For l ≤ i ≤ j ≤ m,  (p i p j ) ≤ 2·  (p l p m ). Proof: Fix matching that realises  (p l p m ). Set =  (p l p m ). 1.  (  (p i p j ),(q i q j )) ≤ pipi pjpj qjqj qiqi  (p i p j )

Analysis - Agarwal et al. Lemma 1: Let P =  p 1, p 2,..., p n  be a polygonal curve. For l ≤ i ≤ j ≤ m,  (p i p j ) ≤ 2·  (p l p m ). Proof: Fix matching that realises  (p l p m ). Set =  (p l p m ). 1.  (  (p i p j ),(q i q j )) ≤ 2.  ((q i q j ),(p i p j )) ≤ pipi pmpm pjpj plpl qjqj qiqi

Analysis - Agarwal et al. Lemma 1: Let P =  p 1, p 2,..., p n  be a polygonal curve. For l ≤ i ≤ j ≤ m,  (p i p j ) ≤ 2·  (p l p m ). Proof: Fix matching that realises  (p l p m ). Set =  (p l p m ). 1.  (  (p i p j ),(q i q j )) ≤ 2.  ((q i q j ),(p i p j )) ≤ pipi pjpj qjqj qiqi ≤ ≤

Analysis - Agarwal et al. Lemma 1: Let P =  p 1, p 2,..., p n  be a polygonal curve. For l ≤ i ≤ j ≤ m,  (p i p j ) ≤ 2·  (p l p m ). Proof: Fix matching that realises  (p l p m ). Set =  (p l p m ). 1.  (  (p i p j ),(q i q j )) ≤ 2.  ((q i q j ),(p i p j )) ≤  (  (p i p j ),p i p j ) ≤  (  (p i p j ),(q i q j )) +  ((q i q j ),(p i p j )) ≤ 2 pipi pmpm pjpj plpl qjqj qiqi □  (p i p j )

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

Analysis - Agarwal et al. Theorem: |P’|  P opt (  /2) Proof: Q =  p 1 = p j 1,…, p j l =p n  - optimal (  /2)-simplification P’ =  p 1 = p i 1,…, p i k =p n  Prove (by induction) that i m  j m,  m  1. p i m-1 pjmpjm pimpim

Analysis - Agarwal et al. Theorem: |P’|  P opt (  /2) Proof: Q =  p 1 = p j 1,…, p j l =p n  - optimal (  /2)-simplification P’ =  p 1 = p i 1,…, p i k =p n  Prove (by induction) that i m  j m,  m  1. Assume i m-1  j m-1 and let i’ = i m +1. p i m-1 pjmpjm pimpim p i’ p j m-1

Analysis - Agarwal et al. Theorem: |P’|  P opt (  /2) Proof: Q =  p 1 = p j 1,…, p j l =p n  - optimal (  /2)-simplification P’ =  p 1 = p i 1,…, p i k =p n  Prove (by induction) that i m  j m,  m  1. Assume i m-1  j m-1 and let i’ = i m +1. By construction we have:  (p i m-1 p i’ ) >  and  (p i m-1 p i’-1 )   If i’ > j m then we are done! p i m-1 pjmpjm pimpim p i’ p j m-1  >>

Analysis - Agarwal et al. Theorem: |P’|  P opt (  /2) Proof: Q =  p 1 = p j 1,…, p j l =p n  - optimal (  /2)-simplification P’ =  p 1 = p i 1,…, p i k =p n  Prove (by induction) that i m  j m,  m  1. Assume i m-1  j m-1 and let i’ = i m +1. By construction we have:  (p i m-1 p i’ ) >  and  (p i m-1 p i’-1 )   Assume the opposite i.e. i’  j m p i m-1 pjmpjm pimpim p i’ p j m-1

Analysis - Agarwal et al. Theorem: |P’|  P opt (  /2) Proof: Q =  p 1 = p j 1,…, p j l =p n  - optimal (  /2)-simplification P’ =  p 1 = p i 1,…, p i k =p n  Prove (by induction) that i m  j m,  m  1. Assume i m-1  j m-1 and let i’ = i m +1. By construction we have:  (p i m-1 p i’ ) >  and  (p i m-1 p i’-1 )   Assume the opposite i.e. i’  j m Q is an (  /2)-simplification   (p j m-1 p j m )   /2 p i m-1 pjmpjm pimpim p i’ p j m-1

Analysis - Agarwal et al. Theorem: |P’|  P opt (  /2) Proof: Q =  p 1 = p j 1,…, p j l =p n  - optimal (  /2)-simplification P’ =  p 1 = p i 1,…, p i k =p n  Assume the opposite i.e. i’  j m Q is an (  /2)-simplification   (p j m-1 p j m )   /2 p i m-1 pjmpjm pimpim p i’ p j m-1

Analysis - Agarwal et al. Theorem: |P’|  P opt (  /2) Proof: Q =  p 1 = p j 1,…, p j l =p n  - optimal (  /2)-simplification P’ =  p 1 = p i 1,…, p i k =p n  Assume the opposite i.e. i’  j m Q is an (  /2)-simplification   (p j m-1 p j m )   /2 According to Lemma 1:  (p i m-1 p i’ )  2  (p j m-1 p j m )   p i m-1 pjmpjm pimpim p i’ p j m-1

Analysis - Agarwal et al. Theorem: |P’|  P opt (  /2) Proof: Q =  p 1 = p j 1,…, p j l =p n  - optimal (  /2)-simplification P’ =  p 1 = p i 1,…, p i k =p n  Assume the opposite i.e. i’  j m Q is an (  /2)-simplification   (p j m-1 p j m )   /2 According to Lemma 1:  (p i m-1 p i’ )  2  (p j m-1 p j m )   This is a contradiction since  (p j m-1 p j m ) >  by construction.  i’ > j m and we are done! p i m-1 pjmpjm pimpim p i’ p j m-1

Summary - Agarwal et al. Theorem: Given a polygonal curve P in R d and a parameter   0, an  - simplification of P of size at most P opt (  /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/ Fréchet error Agarwal, Har-Peled, Mustafa and Wang 2005  Fast and easy to implement. Gives a worst-case performance guarantee. Fréchet error

More Algorithms Simplifying trajectories Time has to be incorporated, possibly as third dimension Gudmundsson et al based on Ramer–Douglas–Peucker Assignment3, Exercise 3: Imai-Iri Streaming setting Abam, de Berg, Hachenberger, Zarei 2007 Non-vertex constrained Guibas, Hershberger, Mitchell, Snoeyink, 1993 … and more, e.g. topological or geometric constraints t Where-at (t)

t

References A. Driemel, S. Har-Peled and C. Wenk. Approximating the Fréchet Distance for Realistic Curves in Near Linear Time. Discrete & Computational Geometry, 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, 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, P. K. Agarwal, S. Har-Peled, N. Mustafa, and Y. Wang. Near- linear time approximation algorithms for curve simplification in two and three dimensions. Algorithmica, 2005.