computing the fréchet distance between folded polygons carola wenk university of texas at san...

58
Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV, Anne Driemel, Sariel Har-Peled

Upload: oliver-stafford

Post on 17-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Computing the Fréchet Distance Between Folded Polygons

Carola WenkUniversity of Texas at San Antonio

Joint work with Jessica Sherette, Atlas F. Cook IV, Anne Driemel,Sariel Har-Peled

Page 2: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Outline Preliminaries

Simple Polygons Algorithm

Folded Polgons

Diagonal Monotonicity Test

Untangling Image Curves

Folded Polygons Algorithms

Fixed Parameter Tractable Algorithm

Approximation Algorithm

Special Variants of Folded Polgons

Conclusion

Page 3: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Fréchet Distance for Curves

• Dog walking example– Person is walking a dog (person on one curve, dog on the

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

A

B

Page 4: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Fréchet Distance for Surfaces

where ranges over orientation preserving homeomorphisms.

Usually: Piecewise linear surfaces in R3.

Let A,B: [0,1]2 Rd be two surfaces

F(A,B) = inf max ||A(p) – B((p))||: [0,1]2 [0,1]2 p [0,1]2

Page 5: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Fréchet Distance between Surfaces Computing the Fréchet distance between surfaces is NP-

hard One triangle, one triangulated surface [G98]

Two polygons with holes or two terrains [BBS10]

The Fréchet distance between surfaces is upper semi-computable [AB10]. It is not known whether it is computable.

The Fréchet distance between two simple polygons can be computed in polynomial time [BBW08] We extend this algorithm to “folded” polygons

Page 6: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Simple Polygons Algorithm [BBW08] It is easy to compute the Fréchet distance between closed

polygonal curves

The Fréchet distance between a convex polygon and a simple polygon is the same is that between their boundary curves.

Idea: Restrict the class of mappings to consider

Given two simple polygons P and Q

Divide them up into matched pairs of convex polygons and simple polygons.

Then use the approach above to check whether the distance is within some .

Page 7: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Simple Polygons Algorithm

Page 8: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Simple Polygons Algorithm

Page 9: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Simple Polygons Algorithm

“diagonals” in P are the line segments in a convex subdivision of P

“edges” in Q are the line segments in a convex subdivision of Q

[BBW08] demonstrate that it suffices to consider mappings that map

∂P onto ∂Q such that F(∂P,∂Q)

diagonals in P to shortest paths in Q with Fréchet distance

Page 10: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Simple Polygons Algorithm

Page 11: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Simple Polygons Algorithm

Page 12: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Simple Polygons Algorithm

Page 13: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Simple Polygons Algorithm

Page 14: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Simple Polygons Algorithm

“diagonals” in P are the line segments in a convex subdivision of P

“edges” in Q are the line segments in a convex subdivision of Q

[BBW08] demonstrate that it suffices to consider mappings that map

∂P onto ∂Q such that F(∂P,∂Q)

diagonals in P to shortest paths in Q with Fréchet distance

Page 15: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Folded Polygons

We extend this algorithm to non-flat surfaces.

Specifically, we consider piecewise linear surfaces with a convex subdivision which has an acyclic dual graph (“folded polygons”)

Page 16: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Shortest Paths?

The simple polygons algorithm maps diagonals in one surface to shortest paths in the other surface.

For folded polygons, mapping a diagonal onto a shortest path is not necessarily optimal.

Page 17: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Shortest Path Counter Example

s1 is the shortest path between a and b,

but the diagonal d has smaller Fréchet distance to s2 than to s1.

Page 18: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Fréchet Shortest Paths

Fréchet shortest paths = paths with Fréchet distance to a given diagonal

The shortest path between two points on the boundary of Q crosses some sequence of edges.

Q We prove that any Fréchet shortest path

between those points crosses the exact same edge sequence.

Page 19: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Fréchet Shortest Paths

Like the shortest path, we can prove that the portion of a Fréchet shortest path between two adjacent edges in Q consists of a line segment.

Page 20: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Diagonal Monotonicity Test

Greedy O(n) algorithm to decide if there exists a path between two points on Q within Fréchet distance of a diagonal. (n = # edges in Q).

P and Q “pass the diagonal monotonicity test for ” iff F(∂P,∂Q) (this specifies a mapping of the

diagonal endpoints)

For every diagonal in P, a Fréchet shortest path with distance at most to the diagonal exists.

Page 21: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Problem of Tangled Image Curves

The image curves may cross (“tangle”)

In this case, the subdivision of Q is no longer valid.

We need to ensure that these image curves can be untangled.

Page 22: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Problem of Tangled Image Curves Unfortunately, there exist cases were these image

curves are forced to tangle.

In the example pictured below P and Q pass the diagonal monotonicity test for = 1 (i.e., F(∂P,∂Q)

and there exist Fréchet shortest paths with Fréchet distance 1 to the diagonals).

Page 23: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Problem of Tangled Image Curves But the image curves for d1 and d2 must cross out of

order along the edges e1 and e2 for =1. Thus we do

not have a homeomorphism between P and Q.

Therefore, even if P and Q pass the diagonal monotonicity test for , the Fréchet distance between P and Q may be greater than

Page 24: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Results

To ensure a homeomorphism exists between the surfaces we must address such tangles. We consider three approaches:

1.Compute the constraints posed by such tangles directly. fixed parameter tractable algorithm

2.Use an approximation algorithm which avoids the tangles altogether. poly-time approx. algorithm

3. Consider a special non-trivial class of folded polygons for which we can use shortest paths instead of Fréchet shortest paths. poly-time algorithm

Page 25: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

1) Computing Tangle Constraints Directly

Fixed parameter tractable algorithm, assumes constant number of edges and diagonals.

A point is in the “untanglea-bility space” for an edge e iff the image curves can be untangled on e for the specified points.

Page 26: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

2) Approximation Algorithm

Suppose P and Q pass the diagonal monotonicity test for . We prove that F(P,Q) 9

We can then optimize this in polynomial time using binary search and the diagonal monotonicity test. Thus, we have a 9-approximation algorithm.

Plug the diagonal monotonicity test into the polynomial-time simple polygons algorithm

So, how do we prove F(P,Q) 9?

Page 27: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

9-Approximation: Proof Sketch

Choose a diagonal d in P which cuts off an ear.

To have a homeomorph-ism between P and Q the image curve of d in Q, call it d', must also cut off an ear.

If another image curve d’1

crosses d‘ then we no longer have a homeomorphism.

Page 28: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

9-Approximation: Proof Sketch

Idea: Let's map d to the “upper envelope” of the image curves, call it d’’ .

How much do we need to increase to do this?

Page 29: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

9-Approximation: Proof Sketch

Consider the pre-images of the points where d' and d'1

cross.

We can use these to bound how far d is from the part of d'1

that crosses above it.

Page 30: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

9-Approximation: Proof Sketch

Consider mapping from a to a' and then to a1. Likewise from b

to b' to b1.

From this follows that F(ab,a1b1) 2

Page 31: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

9-Approximation: Proof Sketch

Thus for each point on ab we can first map it to a point on a1b1 within

distance 2* and then map it to a point on d’1

within distance . Therefore, ab can be

mapped to the part of d’1

between a' and b' within distance 3*

Page 32: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

9-Approximation: Proof Sketch

If d’1 then crosses another image curve d’2 this poses a problem.

Their crossing will have two pre-images on d. One from using the previous reasoning on d1. Another from using

it on d2.

Page 33: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

9-Approximation: Proof Sketch

Nonetheless each pre-image on d of the crossing cannot be more than 3 away from it.

Thus they cannot be separated along d by more than 6.

We can approximate all these intersections away with a total of 9.

Page 34: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

9-Approximation: Proof Sketch

We must also show that if these 6-regions occur out of order on d we can approximate them away as well.

Can be proven through technical case analysis.

In the end, incrementally cut off ears from P andmap to Q, in order to obtain an overall mapping witnessing F(P,Q) 9

Page 35: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

3) Special Variants of Folded Polygons

We show that in the following special variants of folded polygons, using L∞, we can map diagonals to shortest

paths rather than Fréchet shortest paths.

Perpendicular: All diagonals of P are parallel to one axis, and all edges of Q are perpendicular to this axis (and parallel to one of the other axes)

Parallel: All diagonals of P and Q are parallel to one axis.

Mixed: All diagonals of P and Q are parallel to the x-axis, y-axis, or z-axis.

Use the polynomial-time simple polygons algorithm

Page 36: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Half-Space Lemma

Let R be a half space with boundary parallel to the xy-, xz-, or yz-plane.

Let Q be a folded polygon with edges parallel to one axis

If a (Fréchet shortest) path between two points is completely contained in R so is the shortest path.

Q

Page 37: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Half-Space Lemma

The proof of the lemma involves checking a few cases to show that no positioning of the edges can “force” the shortest path to go outside of R.

Page 38: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Perpendicular Variant

Let P be a folded polygon with all of its diagonals parallel to one axis.

Let Q be a folded polygon with all of its edges perpendicular to this axis, and parallel to one of the other axes.

For a given diagonal d in P and a Fréchet shortest path, consider any edge e in Q that is crossed by the image curve of d.

e

d

Page 39: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Perpendicular Variant

Take a point on d. Either: It is within distance

to no points on e.

It is within distance to some fixed set of points on e.

(2D pictures but similar in 3D)

e

d

e

d

Page 40: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Perpendicular Variant

We can prove that the shortest path will always cross in the reachable regions on each of the edges using the half-space lemma.

Page 41: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Perpendicular Variant: Proof Sketch

The idea is we use these half spaces to represent constraints on the diagonal d that can be mapped to.

In the picture the intersection of the half spaces contains exactly those points within distance of some point on the diagonal d. (using L∞;

similar in 3D)

Page 42: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Perpendicular Variant: Proof Sketch

Since we know some path between these points exists which is completely inside the intersection, we also know that the shortest path between the points is completely inside the intersection.

Page 43: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Perpendicular Variant

We can then change the pre-image point of each crossing for an edge so that it maps to the crossing for the shortest path.

Page 44: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Perpendicular Variant

We can then change the pre-image point of each crossing for an edge so that it maps to the crossing for the shortest path.

Thus, if a diagonal is within Fréchet distance of any path between two points, then it is also within Fréchet distance of the shortest path.

Page 45: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Parallel Variant

Let P and Q be two folded polygons with all of their diagonals and edges parallel to an axis.

For a given diagonal d in P and a Fréchet shortest path, consider any edge e in Q that is crossed by the image curve of d.

Page 46: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Parallel Variant: Proof Sketch

Again, by using the half-space lemma we can then show that if some path crosses each edge at a point within distance of some point on d, so does the shortest path.

(Where d is the diagonal we want to map to the shortest path).

Page 47: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Parallel Variant: Proof Sketch

Unlike in the perpendicular case, when using the shortest path, the pre-images of the resulting crossing points on the diagonal may occur out of order.

If this happens we would no longer have a monotone mapping between the diagonal and the shortest path.

Page 48: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Parallel Variant: Proof Sketch

This is similar to the problem we had in the approximation algorithm proof.

Unlike before, when we approximated them away, we can actually show that these points can be chosen in order along the diagonal.

Page 49: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Parallel Variant: Proof Sketch

This problem arises when the shortest path zigzags back and forth.

Using two applications of our lemma we can show that for any pair of edges this zigzag will be no worse for the shortest path than it is for any other path between the same points.

Page 50: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Parallel Variant: Proof Sketch

We first choose a point b which lies on the shortest path between a and c and between the problem edges.

We can then show the shortest path can't go too far to the right on e1.

Page 51: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Parallel Variant: Proof Sketch

Likewise the shortest path can't go too far to the left on e2.

Page 52: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Parallel Variant: Proof Sketch

Thus the zigzag of the shortest path is minimal among all paths which cross these edges.

We can therefore map diagonals to shortest paths for this variant as well.

Page 53: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Combined Variant

This extends to the following case for L∞ :

P and Q are folded polygons with all of diagonals and edges parallel to the x-axis, y-axis or z-axis.

This variant requires some additional case analysis but is largely similar to the parallel case.

Use the polynomial-time simple polygons algorithm

Page 54: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Conclusion

We gave the first results to compute, or approximate, the Fréchet distance for a class of non-flat surfaces (“folded polygons”)

Can the approximation factor be improved?

Is there a poly-time algorithm for folded polygons?

Develop a completely different approach for computing/approximating the Fréchet distance for surfaces?

Page 55: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Thank you

Page 56: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Extra slides

Page 57: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Problem of Tangled Image Curves

• The image curve for d1 needs to

intersect e2 in p2, because it has

to map p1 to e1

•The image curve for d2 needs to

intersect e2 in s•Thus d2 intersects e2 before d1

does, which is out of order

Page 58: Computing the Fréchet Distance Between Folded Polygons Carola Wenk University of Texas at San Antonio Joint work with Jessica Sherette, Atlas F. Cook IV,

Half-Space Lemma

The key to proving that shortest paths can be used for these variants lies in showing that this somewhat technical lemma holds.