computational movement analysis lecture 1: similarity joachim gudmundsson

109
Computational Movement Analysis Lecture 1: Similarity Joachim Gudmundsson

Upload: zared

Post on 23-Feb-2016

42 views

Category:

Documents


1 download

DESCRIPTION

Computational Movement Analysis Lecture 1: Similarity Joachim Gudmundsson. Aim . Goal: Extract and make sense of information from trajectories (GPS, mobile, video, rfid …). Provide fundamental software tools to simplify and support qualitative analysis. Our model. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Computational Movement Analysis

Lecture 1: SimilarityJoachim Gudmundsson

Page 2: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Aim

Goal: Extract and make sense of information from trajectories (GPS, mobile, video, rfid…).

Provide fundamental software tools to simplify and support qualitative analysis.

Page 3: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Our model

Input: Locations sampled over time

0

53 4748 16

25

285

12 38

31 30

6

Page 4: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Our model

Input: Locations sampled over timeAssumptions:

a) Straight-line movement between consecutive samplesb) Constant velocity

0

53 4748 16

25

285

12 38

31 30

6

Page 5: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Brownian bridge movement model

Input: Locations sampled over timeOther models? Brownian bridge

Brownian motion conditioned under starting and ending position

Probability that object visits region A

Page 6: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Our model

Input: a sequence of (x,y,t) - coordinates and a time stamp for example GPS data, mobile phone, radar, …

Page 7: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Additional information

Input: a sequence of (x, y, t, z, temperature, speed, direction…)

Page 8: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Trajectory data 2005

Animal Country Number Frequency

Wolves Spain 15 DailyWolves Finland 16 4 hours

Elks Sweden 25 30 minReindeer Finland 19 8 hoursRed deer Germany 7 4 hoursLeopards South

Africa32 Daily

Mountain Goats

USA 32 3 hours

Page 9: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Objects Number

Frequency

Football 23 25HzSupermarke

tlarge 100Hz

Mobile phones

huge 5 min

Trajectory data 2011

Page 10: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Applications: Behavioural ecology

› Migration patterns› “Popular places”› Home region› …

Page 11: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Applications: Behavioural ecology

› Migration patterns› “Popular places”› Home range› Flock movements› …

Page 12: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Applications: Behavioural ecology

[Joint work: Georgina Wilcox, Kevin buchin, Maike Buchin,

Ran Nathan and Anael Engel]

• Interaction between jackdaws? • Effect of external factors ?

Page 13: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Applications: Behavioural ecology

Behavioural ecology

Short term:- Annual migration behaviour- Automatically detect activity- Home range

Long term:

- Foraging search strategies - Factors that may influence animal movement - How changes in the environment affects wildlife

Page 14: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Applications: Sport

Data Accuracy: 100 mm Frequency: 25Hz

[Joint work: Thomas Wolle and many others]

Page 15: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Applications: Sport

Tools to support sports analysts and coaches• Evaluate a players ability to pass (receive, execute…)• Evaluate a players ability to move into open areas• Evaluate a players ability to follow instructions

• Detect frequent movement patterns• Detect correlations between players’ movement• Detect frequent passing patterns

• Analyse turn-overs • Which events change the intensity of the game?• …

Page 16: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Applications: Hurricanes

Goal: Early detection of hurricanes that may hit land

Page 17: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Applications: Transport

› Collision prevention› Maximize unloading/loading

Page 18: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Applications: Shopping behaviour

› Detect movement patterns› Change structure of shop to

increase sales?

Page 19: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Examples of general problems

General problems • Repetitive patterns • Popular places• Trajectory segmentation• Trajectory simplification• Trajectory clustering• Subtrajectory clustering• Movement patterns

• Single file• Formations• Leadership• Meetings

• …

Page 20: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Seminar schedule

Lecture 1: Similarity

Lecture 2: Curve clustering

Lecture 3: Simplification

Lecture 4: Movement patterns

Lecture 5: Trajectory segmentation

Page 21: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Fundamental tools: clustering

When are two trajectories similar?

In most cases the spatial similarity is much more important than the temporal aspect.

Page 22: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Similarity of curves…measurements

Agrawal, Lin, Sawhney & Shim, 1995 Alt & Godau, 1995Yi, Jagadish & Faloutsos, 1998Gaffney & Smyth, 1999Kalpakis, Gada & Puttagunta, 2001Vlachos, Gunopulos & Kollios, 2002Gunopoulos, 2002Mamoulis, Cao, Kollios, Hadjieleftheriou, Tao & Cheung, 2004Chen, Ozsu & Oria, 2005Nanni & Pedreschi, 2006Van Kreveld & Luo, 2007Gaffney, Robertson, Smyth, Camargo & Ghil, 2007Lee, Han & Whang, 2007Buchin, Buchin, van Kreveld & Luo, 2009Agarwal, Aranov, van Kreveld, Löffler & Silveira, 2010Sankaraman, Agarwal, Molhave, Pan and Boedihardjo, 2013...

Page 23: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Similarity measures

Input: Two polygonal curves P and Q of size m in Rd

Approach: Map curve into a point in dm-dimensional space

2D

10D

Page 24: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Similarity measures

Input: Two polygonal curves P and Q of size m in Rd

Approach: Map curve into a point in dm-dimensional space

2D

10D

Similar?

Page 25: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Similarity measures

Input: Two polygonal curves P and Q of size m in Rd

Approach: Map curve into a point in dm-dimensional space

Drawbacks: P and Q must have same number points Only takes the vertices into consideration

2D

6D

Not similar

Page 26: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Similarity measures: Hausdorff

Input: Two polygonal curves P and Q in Rd

Distance: Hausdorff distance

H(PQ) = maxpP minqQ |p-q|

dH(P,Q) = max [H(PQ), H(QP)]

Page 27: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Similarity measures: Hausdorff

P P

Q Q

Input: Two polygonal curves P and Q in Rd

Distance: Hausdorff distance

H(PQ) = maxpP minqQ |p-q|

dH(P,Q) = max [H(PQ), H(QP)]

Page 28: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Similarity measures: Hausdorff

Drawbacks: Fail to capture the distance between curves.

P

Q

Input: Two polygonal curves P and Q in Rd

Distance: Hausdorff distance

H(PQ) = maxpP minqQ |p-q|

dH(P,Q) = max [H(PQ), H(QP)]

Page 29: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Similarity measures: Fréchet

Input: Two polygonal curves P and Q in Rd

Other interesting measures are:• Dynamic Time Warping (DTW)• Longest Common Subsequence (LCSS)• Model-Driven matching (MDM)

Drawback: Non-metrics (triangle inequality does not hold) which makes clustering complicated.

Page 30: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Similarity measure: Fréchet Distance

Fréchet Distance measures the similarity of two curves.

Dog walking example- Person is walking his dog (person on one curve and the dog on other)- Allowed to control their speeds but not allowed to go backwards!- Fréchet distance of the curves: minimal leash length necessary for

both to walk the curves from beginning to end

Page 31: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Fréchet Distance

Fréchet Distance measures the similarity of two curves.

Dog walking example- Person is walking his dog (person on one curve and the dog on other)- Allowed to control their speeds but not allowed to go backwards!- Fréchet distance of the curves: minimal leash length necessary for

both to walk the curves from beginning to end

Page 32: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

The Fréchet distance between P and Q is:

where and range over all continuous non-decreasing reparametrizations.

Note that (0)=p1, (1)=pn, (0)=q1 and (1)=qm.

Well-suited for the comparison of curves since it takes the continuity of the curves into account.

Fréchet Distance

(P,Q) =

Page 33: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

The discrete Fréchet distance considers only positions of the leash where its endpoints are located at vertices of the two polygonal curves and never in the interior of an edge.

Discrete Fréchet Distance

May give large errors!

Page 34: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the continuous Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

P

Page 35: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

P

Page 36: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

P

Page 37: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

P

r

Page 38: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

P

Page 39: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

Pr

Page 40: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

Pr

Page 41: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

P

Page 42: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

P

Page 43: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

P

Page 44: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

P

Page 45: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

P

Page 46: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

P

Page 47: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

P

Page 48: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

P

Page 49: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

P

Q

Q

P

Page 50: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

Q

P

Freespace diagram of P and Qfree spac

e

Page 51: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

How do we find a reparametrization between P and Q that realises the Fréchet distance r?

Q

P

Page 52: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Input: Two polygonal chains P=p1, … , pn and Q=q1, … , qm in Rd.

Decision problem: F(P, Q) ≤ r ?

How do we find a reparametrization between P and Q that realises the Fréchet distance r?

Recall that it has to be continuous, non-decreasing, q1 p1 and qm pn. Q

P

Page 53: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

› q1 p1

Q

P

Page 54: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

› q1 p1

› qm pn

Q

P

Page 55: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

› q1 p1

› qm pn

› must lie in the free space

Q

P

Not valid!

Page 56: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

› q1 p1

› qm pn

› must lie in the free space

› continuous

Q

P

Page 57: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Q

P

› q1 p1

› qm pn

› must lie in the free space

› continuous

› non-decreasing

Page 58: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

› q1 p1

› qm pn

› must lie in the free space

› continuous

› non-decreasing

If there exists an xy-non-decreasing path inside the freespace from the bottom left to the top right corner of the diagram then the Fréchet distance is at most r.

Q

P

Page 59: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Free Space Diagram

Decision version Is the Fréchet distance between two paths at

most r?

r

P

P

Q

Q

Page 60: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Free Space Diagram

Decision version Is the Fréchet distance between two paths at

most r?

r

P

Q

Page 61: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Free Space Diagram

If there exists a non-decreasing path in the free space from (q1,p1) to (qm,pn) which is non-decreasing in both coordinates, then curves P and Q have Fréchet distance at most r.

(q1,p1)

(qm, pn)

r

P

Q

P

Q

Page 62: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Free Space Diagram

If there exists a non-decreasing path in the free space from (q1,p1) to (qm,pn) which is non-decreasing in both coordinates, then curves P and Q have Fréchet distance at most r.

(q1,p1)

(qm, pn)

r

P

Q

P

Q

Page 63: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Free Space Diagram

If there exists a non-decreasing path in the free space from (q1,p1) to (qm,pn) which is non-decreasing in both coordinates, then curves P and Q have Fréchet distance at most r.

(q1,p1)

(qm, pn)

r

P

Q

P

Q

Page 64: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Free Space Diagram

If there exists a non-decreasing path in the free space from (q1,p1) to (qm,pn) which is non-decreasing in both coordinates, then curves P and Q have Fréchet distance at most r.

(q1,p1)

(qm, pn)

r

P

Q

P

Q

Page 65: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Free Space Diagram

If there exists a non-decreasing path in the free space from (q1,p1) to (qm,pn) which is non-decreasing in both coordinates, then curves P and Q have Fréchet distance at most r.

(q1,p1)

(qm, pn)

r

P

Q

P

Q

Page 66: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Free Space Diagram

If there exists a non-decreasing path in the free space from (q1,p1) to (qm,pn) which is non-decreasing in both coordinates, then curves P and Q have Fréchet distance at most r.

(q1,p1)

(qm, pn)

r

P

Q

P

Q

Page 67: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Free Space Diagram

If there exists a non-decreasing path in the free space from (q1,p1) to (qm,pn) which is non-decreasing in both coordinates, then curves P and Q have Fréchet distance at most r.

(q1,p1)

(qm, pn)

r

P

Q

P

Q

Page 68: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Free Space Diagram

If there exists a non-decreasing path in the free space from (q1,p1) to (qm,pn) which is non-decreasing in both coordinates, then curves P and Q have Fréchet distance at most r.

(q1,p1)

(qm, pn)

r

P

Q

P

Q

Page 69: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Free Space Diagram

If there exists a non-decreasing path in the free space from (q1,p1) to (qm,pn) which is non-decreasing in both coordinates, then curves P and Q have Fréchet distance at most r.

(q1,p1)

(qm, pn)

r

P

Q

P

Q

Page 70: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Decision algorithm: free space diagram

Algorithm:

1. Compute Free Space diagram O(mn) time

A square and an ellipsoid can intersect in at most 8 points. (critical points)

The free space in a cell is a convex region. One cell can be constructed in time O(1).

Page 71: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

One cell can be constructed in time O(1). How?

Note that we do not need the exact shape. We only need the intersection points between the cell boundary and the ellipsoid.

P

Q

Q

P

Page 72: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

One cell can be constructed in time O(1). How?

Note that we do not need the exact shape. We only need the intersection points between the cell boundary and the ellipsoid.

P

Q

Q

P

Page 73: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

One cell can be constructed in time O(1). How?

Note that we do not need the exact shape. We only need the intersection points between the cell boundary and the ellipsoid.

P

Q

Q

P

Page 74: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

One cell can be constructed in time O(1). How?

Note that we do not need the exact shape. We only need the intersection points between the cell boundary and the ellipsoid.

P

Q

Q

P

Page 75: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

One cell can be constructed in time O(1). How?

Note that we do not need the exact shape. We only need the intersection points between the cell boundary and the ellipsoid.

P

Q

Q

P

Page 76: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

One cell can be constructed in time O(1). How?

Note that we do not need the exact shape. We only need the intersection points between the cell boundary and the ellipsoid.

P

Q

Q

P

Page 77: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Decision algorithm: free space algorithm

Algorithm: 1. Compute Free Space diagram

O(mn) time

A square and an ellipsoid can intersect in at most 8 points.The free space in a cell is a convex region. One cell can be constructed in time O(1).

Critical points

Page 78: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Decision algorithm: compute path

(q1,p1)

(qm,pn)

P

Q

Algorithm: 1. Compute Free Space diagram mn cells O(mn) time 2. Compute a non-xy-decreasing path from (q1,p1) to (qm,pn).

Page 79: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Decision algorithm: compute path

(q1,p1)

(qm,pn)

P

Q

Algorithm: 1. Compute Free Space diagram mn cells O(mn) time 2. Compute a non-xy-decreasing path from (q1,p1) to (qm,pn).

Page 80: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Decision algorithm: compute path

Algorithm: 1. Compute Free Space diagram mn cells O(mn) time 2. Compute a non-xy-decreasing path from (q1,p1) to (qm,pn).

(q1,p1)

(qm,pn)

P

Q

Page 81: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Decision algorithm: compute path

Algorithm: 1. Compute Free Space diagram mn cells O(mn) time 2. Compute a non-xy-decreasing path from (q1,p1) to (qm,pn).

(q1,p1)

(qm,pn)

P

Q

Page 82: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Decision algorithm: compute path

Algorithm: 1. Compute Free Space diagram mn cells O(mn) time 2. Compute a non-xy-decreasing path from (q1,p1) to (qm,pn).

(q1,p1)

(qm,pn)

P

Q

Page 83: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Decision algorithm: compute path

Algorithm: 1. Compute Free Space diagram mn cells O(mn) time 2. Compute a non-xy-decreasing path from (q1,p1) to (qm,pn).

(q1,p1)

(qm,pn)

P

Q

Page 84: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Decision algorithm: compute path

Algorithm: 1. Compute Free Space diagram mn cells O(mn) time 2. Compute a non-xy-decreasing path from (q1,p1) to (qm,pn).

(q1,p1)

(qm,pn)

P

Q

Page 85: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Decision algorithm: compute path

Algorithm: 1. Compute Free Space diagram mn cells O(mn) time 2. Compute a non-xy-decreasing path from (q1,p1) to (qm,pn).

(q1,p1)

(qm,pn)

P

Q

Page 86: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Decision algorithm: compute path

Algorithm: 1. Compute Free Space diagram mn cells O(mn) time 2. Compute a non-xy-decreasing path from (q1,p1) to (qm,pn).

(q1,p1)

(qm,pn)

P

Q

Page 87: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Decision algorithm: compute path

Algorithm: 1. Compute Free Space diagram mn cells O(mn) time 2. Compute a non-xy-decreasing path from (q1,p1) to (qm,pn). Build network O(mn) time.

(q1,p1)

(qm,pn)

P

Q

Page 88: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Decision algorithm: compute path

Algorithm: 1. Compute Free Space diagram mn cells O(mn) time 2. Compute a non-xy-decreasing path from (q1,p1) to (qm,pn). Build network O(mn) time. Find a path O(mn) time.

(q1,p1)

(qm,pn)

P

Q

Page 89: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Theorem: Given two polygonal curves P, Q and r0 one can decide in O(mn) time, whether (P,Q) r.

How can we use the algorithm to compute the Fréchet distance?

Binary search on r?

But what do we do binary search on?

Page 90: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Theorem: Given two polygonal curves P, Q and r0 one can decide in O(mn) time, whether (P,Q) r.

How can we use the algorithm to compute the Fréchet distance?

In practice: Determine r bit by bit

O(mn log “accuracy”) time.

Page 91: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Assume r=0 and the let r grow. The free space will become larger and larger.

Aim: Determine the smallest r such that it contains a montone path from (q1,p1) to (qm,pn).

This can only occur when:1. r is minimal with (q1,p1) to (qm,pn) in the free space, 2. r is minimal when a new vertical or horizontal passage

opens up between two adjacent cells in the free space.3. r is minimal when a new vertical or horizontal passage

opens up between two non-adjacent cells in the free space.

Page 92: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

1. r is minimal with (q1,p1) to (qm,pn) in the free space, 2. r is minimal when a new vertical or horizontal passage

opens up between two adjacent cells in the free space.3. r is minimal when a new vertical or horizontal passage

opens up between two non-adjacent cells in the free space.

Case 1 is easy to test in constant time.

Page 93: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

1. r is minimal with (q1,p1) to (qm,pn) in the free space, 2. r is minimal when a new vertical or horizontal passage

opens up between two adjacent cells in the free space.3. r is minimal when a new vertical or horizontal passage

opens up between two non-adjacent cells in the free space.

Case 1 is easy to test in constant time.

Case 2:

Page 94: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

1. r is minimal with (q1,p1) to (qm,pn) in the free space, 2. r is minimal when a new vertical or horizontal passage

opens up between two adjacent cells in the free space.3. r is minimal when a new vertical or horizontal passage

opens up between two non-adjacent cells in the free space.

Case 1 is easy to test in constant time.

Case 2:

Page 95: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

1. r is minimal with (q1,p1) to (qm,pn) in the free space, 2. r is minimal when a new vertical or horizontal passage

opens up between two adjacent cells in the free space.3. r is minimal when a new vertical or horizontal passage

opens up between two non-adjacent cells in the free space.

Case 1 is easy to test in constant time.

Case 2:

Page 96: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

1. r is minimal with (q1,p1) to (qm,pn) in the free space, 2. r is minimal when a new vertical or horizontal passage

opens up between two adjacent cells in the free space.3. r is minimal when a new vertical or horizontal passage

opens up between two non-adjacent cells in the free space.

Case 1 is easy to test in constant time.

Case 2:

Number of events?

Page 97: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

1. r is minimal with (q1,p1) to (qm,pn) in the free space, 2. r is minimal when a new vertical or horizontal passage

opens up between two adjacent cells in the free space.3. r is minimal when a new vertical or horizontal passage

opens up between two non-adjacent cells in the free space.

Case 1 is easy to test in constant time.

Case 2:

Number of events: O(mn)

Page 98: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

1. r is minimal with (q1,p1) to (qm,pn) in the free space, 2. r is minimal when a new vertical or horizontal passage

opens up between two adjacent cells in the free space.3. r is minimal when a new vertical or horizontal passage

opens up between two non-adjacent cells in the free space.

Case 1 is easy to test in constant time.Case 2: O(mn) eventsCase 3:

Page 99: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

1. r is minimal with (q1,p1) to (qm,pn) in the free space, 2. r is minimal when a new vertical or horizontal passage

opens up between two adjacent cells in the free space.3. r is minimal when a new vertical or horizontal passage

opens up between two non-adjacent cells in the free space.

Case 1 is easy to test in constant time.Case 2: O(mn) eventsCase 3:

Page 100: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

1. r is minimal with (q1,p1) to (qm,pn) in the free space, 2. r is minimal when a new vertical or horizontal passage

opens up between two adjacent cells in the free space.3. r is minimal when a new vertical or horizontal passage

opens up between two non-adjacent cells in the free space.

Case 1 is easy to test in constant time.Case 2: O(mn) eventsCase 3: Number of events?

Page 101: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

1. r is minimal with (q1,p1) to (qm,pn) in the free space, 2. r is minimal when a new vertical or horizontal passage

opens up between two adjacent cells in the free space.3. r is minimal when a new vertical or horizontal passage

opens up between two non-adjacent cells in the free space.

Case 1 is easy to test in constant time.Case 2: O(mn) eventsCase 3: O(m2n+mn2)

Page 102: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Case 1: easy to test in constant time.

Case 2: O(mn) possible events

Case 3: O(m2n+mn2) possible events

Perform binary search on the events O((m2n+mn2) log mn) time.

Page 103: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Case 1: easy to test in constant time.

Case 2: O(mn) possible events

Case 3: O(m2n+mn2) possible events

Improvement: Use parametric search [Meggido’83, Cole’88]

O(mn log mn) time.

Page 104: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Parametric search

The decision version F(r) of the Fréchet distance depends on theparameter r, and it is monotone in r.

Aim: Find minimum r such that F(r) is true.

Our algorithm As can solve F(r) in Ts=O(mn) time.

Meggido’83 and Cole’88 (simplified): If there exists a parallel algorithm Ap that can solve F(r) in Tp time using P processors then there exists a sequential algorithm with running time O(PTp+TpTs+Ts log P).

For our problem we get: O(mn log mn) time using a parallel sorting network [n processors and O(log n) time]

Page 105: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Compute the Fréchet distance

Case 1: easy to test in constant time.

Case 2: O(mn) possible events

Case 3: O(m2n+mn2) possible events

Improvement: Use parametric search [Meggido’83, Cole’88]

O(mn log mn) time.

Page 106: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Summary: Lecture 1

Many different similarity measures.

We use the Fréchet distance!

Theorem: Given two polygonal curves P, Q and r 0 one can decide in O(mn) time, whether (P,Q) r.

Theorem: The Fréchet distance between two polygonal curves P and Q can be computed in O(mn log mn) time.

Page 107: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Open problems

1. Can the Fréchet distance be computed in subquadratic time or is there an (n2) lower bound?

2. Approximate the Fréchet distance in subquadratic time?3. Special cases in subquadratic time? If the curves are c-packed then a (1+ )-approximation of the Fréchet distance can be computed in O(cn/+cn log n). similar results for low density.

[Driemel, Har-Peled and Wenk’12]

Page 108: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

Open problems

1. Can the Fréchet distance be computed in subquadratic time or is there an (n2) lower bound?

2. Approximate the Fréchet distance in subquadratic time?3. Special cases in subquadratic time? If the curves are c-packed then a (1+ )-approximation of the Fréchet distance can be computed in O(cn/+cn log n). similar results for low density.

[Driemel, Har-Peled and Wenk’12]

Part of P inside any ball B is at most c times the radius of B.

Page 109: Computational Movement Analysis Lecture 1: Similarity Joachim  Gudmundsson

References

H. Alt and M. Godau.Computing the Fréchet distance between two polygonal curves. IJCGA, 1995.

K. Buchin, M. Buchin, W. Meulemans and W. Mulzer.Four Soviets Walk the Dog - with an Application to Alt's ConjectureSODA, 2014Time: O(n2 (log n)1/2 (loglog n)3/2)

R. van Oostrum and R. Veltkamp. Parametric search made practical. CGTA, 2004