Computing the Fréchet between Folded Polygons*

advertisement

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

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

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

Fr échet Distance for Surfaces

Let A,B: [0,1] 2

R d be two surfaces

 d

F

(A,B) = inf max ||A(p) – B( 

(p))||

: [0,1] 2

[0,1] 2 p

[0,1] 2 where

 ranges over orientation preserving homeomorphisms.

Usually: Piecewise linear surfaces in R 3 .

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

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

.

Simple Polygons Algorithm

Simple Polygons Algorithm

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 d

F

(∂P,∂Q)   diagonals in P to shortest paths in Q with Fréchet distance

 

Simple Polygons Algorithm

Simple Polygons Algorithm

Simple Polygons Algorithm

Simple Polygons Algorithm

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 d

F

(∂P,∂Q)   diagonals in P to shortest paths in Q with Fréchet distance

 

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”)

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.

Shortest Path Counter Example

 s

1 is the shortest path between a and b, but the diagonal d has smaller Fr échet distance to s

2 than to s

1

.

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 .

We prove that any Fr échet shortest path between those points crosses the exact same edge sequence .

Q

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.

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

 d

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.

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.

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., d

F

(∂P,∂Q)  1, and there exist Fr échet shortest paths with Fréchet distance 1 to the diagonals).

Problem of Tangled Image Curves

But the image curves for order along the edges e

1 d

1 and and e

2 d

2 must cross out of 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

.

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

1) Computing Tangle Constraints

Directly

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

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

2) Approximation Algorithm

Suppose P and Q pass the diagonal monotonicity test for

. We prove that d

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 d

F

(P,Q)

9

?

9-Approximation: Proof Sketch

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

To have a homeomorphism 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.

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?

9-Approximation: Proof Sketch

Consider the preimages 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.

9-Approximation: Proof Sketch

Consider mapping from a to a' and then to a

1

. Likewise from b to b' to b

1

.

From this follows that d

F

( ab , a

1 b

1

)

2

 .

9-Approximation: Proof Sketch

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

1 b

1 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*

 .

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 d

1

. Another from using it on d

2

.

9-Approximation: Proof Sketch

Nonetheless each preimage 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  .

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 and map to Q, in order to obtain an overall mapping witnessing d

F

(P,Q)

9

 .

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, yaxis, or z-axis.

Use the polynomial-time simple polygons algorithm

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

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.

Perpendicular Variant e d

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

Perpendicular Variant e d

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)

Perpendicular Variant

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

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)

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.

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.

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.

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 .

Parallel Variant: Proof Sketch

Again, b y using the halfspace 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).

Parallel Variant: Proof Sketch

Unlike in the perpendicular case, when using the shortest path, the preimages 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.

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.

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.

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 e

1

.

Parallel Variant: Proof Sketch

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

2

.

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.

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

Conclusion

We gave the first results to compute, or approximate, the Fréchet distance for a class of nonflat 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?

Thank you

Extra slides

Problem of Tangled Image Curves

The image curve for d

1 intersect e

2 in p

2 needs to

, because it has to map p

1 to e

1

The image curve for d

2 needs to

• intersect e

2

Thus d

2 in s intersects e

2 before d does, which is out of order

1

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.

Download