61
Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational Geometry Lecture 6: Smallest enclosing circles and more Computational Geometry Lecture 6: Smallest enclosing circles and more

Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Smallest enclosing circles and more

Computational Geometry

Lecture 6: Smallest enclosing circles and more

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 2: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Facility locationProperties of the smallest enclosing circle

Facility location

Given a set of houses and farmsin an isolated area. Can we placea helicopter ambulance post sothat each house and farm can bereached within 15 minutes?

Where should we place anantenna so that a number oflocations have maximumreception?

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 3: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Facility locationProperties of the smallest enclosing circle

Facility location in geometric terms

Given a set of points in the plane.Is there any point that is within acertain distance of these points?

Where do we place a point thatminimizes the maximum distanceto a set of points?

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 4: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Facility locationProperties of the smallest enclosing circle

Facility location in geometric terms

Given a set of points in theplane, compute the smallestenclosing circle

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 5: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Facility locationProperties of the smallest enclosing circle

Smallest enclosing circle

Observation: It must pass throughsome points, or else it cannot besmallest

Take any circle that encloses thepoints, and reduce its radiusuntil it contains a point p

Move center towards p whilereducing the radius further, untilthe circle contains anotherpoint q

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 6: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Facility locationProperties of the smallest enclosing circle

Smallest enclosing circle

Move center on the bisector of pand q towards their midpoint,until:(i) the circle contains a thirdpoint, or(ii) the center reaches themidpoint of p and q

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 7: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Facility locationProperties of the smallest enclosing circle

Smallest enclosing circle

Question: Does the “algorithm” ofthe previous slide work?

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 8: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Facility locationProperties of the smallest enclosing circle

Smallest enclosing circle

Observe: A smallest enclosing circlehas (at least) three points on itsboundary, or only two in which casethey are diametrally opposite

Question: What is the extraproperty when there are three pointson the boundary?

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 9: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Randomized incremental construction

Construction by randomized incremental construction

incremental construction: Add points one by one andmaintain the solution so far

randomized: Use a random order to add the points

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 10: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Adding a point

Let p1, . . . ,pn be the points in random order

Let Ci be the smallest enclosing circle for p1, . . . ,pi

Suppose we know Ci−1 and we want to add pi

If pi is inside Ci−1, then Ci = Ci−1

If pi is outside Ci−1, then Ci will have pi on its boundary

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 11: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Adding a point

Ci−1

pi

Ci−1

pi

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 12: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Adding a point

Question: Suppose we remembered not only Ci−1, but alsothe two or three points defining it. It looks like if pi is outsideCi−1, the new circle Ci is defined by pi and some points thatdefined Ci−1. Why is this false?

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 13: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Adding a point

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 14: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Adding a point

How do we find the smallestenclosing circle of p1 . . . ,pi−1 with pi

on the boundary?

We study the new(!) geometricproblem of computing the smallestenclosing circle with a given point pon its boundary

p

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 15: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Smallest enclosing circle with point

Given a set P of points and onespecial point p, determine thesmallest enclosing circle of P thatmust have p on the boundary

Question: How do we solve it? p

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 16: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Randomized incremental construction

Construction by randomized incremental construction

incremental construction: Add points one by one andmaintain the solution so far

randomized: Use a random order to add the points

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 17: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Adding a point

Let p1, . . . ,pi−1 be the points in random order

Let C′j be the smallest enclosing circle for p1, . . . ,pj (j≤ i−1)and with p on the boundary

Suppose we know C′j−1 and we want to add pj

If pj is inside C′j−1, then C′j = C′j−1

If pj is outside C′j−1, then C′j will have pj on its boundary(and also p of course!)

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 18: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Adding a point

C ′j−1

pj

C ′j−1

pj

p p

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 19: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Adding a point

How do we find the smallestenclosing circle of p1 . . . ,pj−1 with pand pj on the boundary?

We study the new(!) geometricproblem of computing the smallestenclosing circle with two given pointson its boundary

pq

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 20: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Smallest enclosing circle with two points

Given a set P of points and twospecial points p and q, determine thesmallest enclosing circle of P thatmust have p and q on the boundary

Question: How do we solve it? pq

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 21: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Two points known

p

q q

p

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 22: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Two points known

p

q q

p

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 23: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Algorithm: two points known

Assume w.lo.g. that p and q lie on a vertical line. Let ` be theline through p and q and let `′ be their bisector

For all points left of `, find the one that, together with p andq, defines a circle whose center is leftmost → pl

For all points right of `, find the one that, together with pand q, defines a circle whose center is rightmost → pr

Decide if C(p,q,pl) or C(p,q,pr) or C(p,q) is the smallestenclosing circle

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 24: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Two points known

p

q q

p p

qq

p

pl pr

C(p, q, pr)

C(p, q, pl)

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 25: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Analysis: two points known

Smallest enclosing circle for n pointswith two points already known takesO(n) time, worst case

pq

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 26: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Algorithm: one point known

Use a random order for p1, . . . ,pn; start withC1 = C(p,p1)for j← 2 to n doIf pj in or on Cj−1 then Cj = Cj−1; otherwise, solvesmallest enclosing circle for p1, . . . ,pj−1 with two pointsknown (p and pj)

C ′j−1

pj

C ′j−1

pj

p p

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 27: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Analysis: one point known

If only one point is known, we used randomized incrementalconstruction, so we need an expected time analysis

C ′j−1

pj

C ′j−1

pj

p p

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 28: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Analysis: one point known

Backwards analysis: Consider the situation after adding pj,so we have computed Cj

p Cjp Cj

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 29: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Analysis: one point known

The probability that the j-th addition was expensive is thesame as the probability that the smallest enclosing circlechanges (decreases in size) if we remove a random point fromthe j points

p Cjp Cj

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 30: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Analysis: one point known

This probability is 2/j in the left situation and 1/j in the rightsituation

p Cjp Cj

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 31: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Analysis: one point known

The expected time for the j-th addition of a point is

j−2j·Θ(1)+

2j·Θ(j) = O(1)

or

j−1j·Θ(1)+

1j·Θ(j) = O(1)

The expected running time of the algorithm for n points is:

Θ(n)+n

∑j=2

Θ(1) = Θ(n)

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 32: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Analysis: one point known

Smallest enclosing circle for n pointswith one point already known takesΘ(n) time, expected

p

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 33: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Algorithm: smallest enclosing circle

Use a random order for p1, . . . ,pn; start withC2 = C(p1,p2)for i← 3 to n doIf pi in or on Ci−1 then Ci = Ci−1; otherwise, solvesmallest enclosing circle for p1, . . . ,pi−1 with one pointknown (pi)

Ci−1

pi

Ci−1

pi

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 34: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Analysis: smallest enclosing circle

For smallest enclosing circle, we used randomized incrementalconstruction, so we need an expected time analysis

Ci−1

pi

Ci−1

pi

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 35: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Analysis: smallest enclosing circle

Backwards analysis: Consider the situation after adding pi,so we have computed Ci

Ci Ci

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 36: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Analysis: smallest enclosing circle

The probability that the i-th addition was expensive is thesame as the probability that the smallest enclosing circlechanges (decreases in size) if we remove a random point fromthe i points

Ci Ci

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 37: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Analysis: smallest enclosing circle

This probability is 3/i in the left situation and 2/i in the rightsituation

Ci Ci

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 38: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Analysis: smallest enclosing circle

The expected time for the i-th addition of a point is

i−3i·Θ(1)+

3i·Θ(i) = O(1)

or

i−2i·Θ(1)+

2i·Θ(i) = O(1)

The expected running time of the algorithm for n points is:

Θ(n)+n

∑i=3

Θ(1) = Θ(n)

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 39: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

Randomized incremental constructionA more restricted problemA yet more restricted problemEfficiency analysis

Result: smallest enclosing circle

Theorem The smallest enclosingcircle for n points in plane can becomputed in O(n) expected time

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 40: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

When does it work?

Randomized incremental construction algorithms of this sort(compute an ‘optimal’ thing) work if:

The test whether the next input object violates thecurrent optimum must be possible and fast

If the next input object violates the current optimum,finding the new optimum must be an easier problem thanthe general problem

The thing must already be defined by O(1) of the inputobjects

Ultimately: the analysis must work out

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 41: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Diameter, closest pair

Diameter: Given a set of n points inthe plane, compute the two pointsfurthest apart

Closest pair: Given a set of n pointsin the plane, compute the two pointsclosest together

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 42: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Width

Width: Given a set of n points in theplane, compute the smallest distancebetween two parallel lines thatcontain the points (narrowest strip)

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 43: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Rotating callipers

The width can be computed using the rotating callipersalgorithm

Compute the convex hull

Find the highest and lowest point on it; they define twohorizontal lines that enclose the points

Rotate the lines together while proceeding along theconvex hull

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 44: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Rotating callipers

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 45: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Rotating callipers

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 46: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Rotating callipers

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 47: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Rotating callipers

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 48: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Rotating callipers

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 49: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Rotating callipers

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 50: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Width

Property: The width is alwaysdetermined by three points of the set

Theorem: The rotating callipersalgorithm determines the width (andthe diameter) in O(n logn) time

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 51: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Width by RIC?

Property: The width is alwaysdetermined by three points of the set

We can maintain the two linesdefining the width to have a fast testfor violation

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 52: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Adding a point

Question: How about adding apoint? If the new point lies insidethe narrowest strip we are fine, butwhat if it lies outside?

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 53: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Adding a point

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 54: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Adding a point

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 55: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Width

A good reason to be very suspiciousof randomized incrementalconstruction as a working approachis non-uniqueness of a solution

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 56: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Minimum bounding box

Question: Can we compute theminimum axis-parallel bounding boxby randomized incrementalconstruction?

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 57: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Minimum bounding box

Yes, in O(n) expected time

. . . but a normal incrementalalgorithm does it in O(n) worst casetime

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 58: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Lowest point in circles

Problem 1: Given n disks in theplane, can we compute the lowestpoint in their common intersectionefficiently by randomized incrementalconstruction?

Problem 2: Given n disks in theplane, can we compute the lowestpoint in their union efficiently byrandomized incrementalconstruction?

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 59: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

Red-blue separation

Problem: Given a set of n red andblue points in the plane, can wedecide efficiently if they have aseparating line?

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 60: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

One-guardable polygons

Problem: Given a simple polygonwith n vertices, can we decideefficiently if one guard is enough?

Computational Geometry Lecture 6: Smallest enclosing circles and more

Page 61: Lecture 6: Smallest enclosing circles and more · Introduction Smallest enclosing circle algorithm Randomized incremental construction Smallest enclosing circles and more Computational

IntroductionSmallest enclosing circle algorithm

Randomized incremental construction

ConditionsDiameter and closest pairWidthMore examples

One-guardable polygons

It can easily happen that aproblem is an instance of linearprogramming

Then don’t devise a newalgorithm, just explain how totransform it, and show that it iscorrect (that your problem isreally solved that way)

Computational Geometry Lecture 6: Smallest enclosing circles and more