computational geometry
play

Computational Geometry Lecture 6: Smallest enclosing circles and - PowerPoint PPT Presentation

Smallest enclosing circles and more Computational Geometry Lecture 6: Smallest enclosing circles and more Computational Geometry Lecture 6: Smallest enclosing circles and more Facility location Given a set of houses and farms in an isolated


  1. Smallest enclosing circles and more Computational Geometry Lecture 6: Smallest enclosing circles and more Computational Geometry Lecture 6: Smallest enclosing circles and more

  2. Facility location Given a set of houses and farms in an isolated area. Can we place a helicopter ambulance post so that each house and farm can be reached within 15 minutes? Where should we place an antenna so that a number of locations have maximum reception? Computational Geometry Lecture 6: Smallest enclosing circles and more

  3. Facility location in geometric terms Given a set of points in the plane. Is there any point that is within a certain distance of these points? Where do we place a point that minimizes the maximum distance to a set of points? Computational Geometry Lecture 6: Smallest enclosing circles and more

  4. Facility location in geometric terms Given a set of points in the plane, compute the smallest enclosing circle Computational Geometry Lecture 6: Smallest enclosing circles and more

  5. Smallest enclosing circle Observation: It must pass through some points, or else it cannot be smallest Take any circle that encloses the points, and reduce its radius until it contains a point p Move center towards p while reducing the radius further, until the circle contains another point q Computational Geometry Lecture 6: Smallest enclosing circles and more

  6. Smallest enclosing circle Move center on the bisector of p and q towards their midpoint, until: (i) the circle contains a third point, or (ii) the center reaches the midpoint of p and q Computational Geometry Lecture 6: Smallest enclosing circles and more

  7. Smallest enclosing circle Question: Does the “algorithm” of the previous slide work? Computational Geometry Lecture 6: Smallest enclosing circles and more

  8. Smallest enclosing circle Observe: A smallest enclosing circle has (at least) three points on its boundary, or only two in which case they are diametrally opposite Computational Geometry Lecture 6: Smallest enclosing circles and more

  9. Randomized incremental construction Construction by randomized incremental construction incremental construction: Add points one by one and maintain the solution so far randomized: Use a random order to add the points Computational Geometry Lecture 6: Smallest enclosing circles and more

  10. Adding a point Let p 1 ,..., p n be the points in random order Let C i be the smallest enclosing circle for p 1 ,..., p i Suppose we know C i − 1 and we want to add p i If p i is inside C i − 1 , then C i = C i − 1 If p i is outside C i − 1 , then C i will have p i on its boundary Computational Geometry Lecture 6: Smallest enclosing circles and more

  11. Adding a point C i − 1 C i − 1 p i p i Computational Geometry Lecture 6: Smallest enclosing circles and more

  12. Adding a point Question: Suppose we remembered not only C i − 1 , but also the two or three points defining it. It looks like if p i is outside C i − 1 , the new circle C i is defined by p i and some points that defined C i − 1 . Why is this false? Computational Geometry Lecture 6: Smallest enclosing circles and more

  13. Adding a point Computational Geometry Lecture 6: Smallest enclosing circles and more

  14. Adding a point How do we find the smallest enclosing circle of p 1 ..., p i − 1 with p i on the boundary? We study the new(!) geometric problem of computing the smallest enclosing circle with a given point p p on its boundary Computational Geometry Lecture 6: Smallest enclosing circles and more

  15. Smallest enclosing circle with point Given a set P of points and one special point p , determine the smallest enclosing circle of P that must have p on the boundary Question: How do we solve it? p Computational Geometry Lecture 6: Smallest enclosing circles and more

  16. Randomized incremental construction Construction by randomized incremental construction incremental construction: Add points one by one and maintain the solution so far randomized: Use a random order to add the points Computational Geometry Lecture 6: Smallest enclosing circles and more

  17. Adding a point Let p 1 ,..., p i − 1 be the points in random order Let C ′ j be the smallest enclosing circle for p 1 ,..., p j ( j ≤ i − 1 ) and with p on the boundary Suppose we know C ′ j − 1 and we want to add p j If p j is inside C ′ j − 1 , then C ′ j = C ′ j − 1 If p j is outside C ′ j − 1 , then C ′ j will have p j on its boundary (and also p of course!) Computational Geometry Lecture 6: Smallest enclosing circles and more

  18. Adding a point C ′ C ′ j − 1 j − 1 p j p p p j Computational Geometry Lecture 6: Smallest enclosing circles and more

  19. Adding a point How do we find the smallest enclosing circle of p 1 ..., p j − 1 with p and p j on the boundary? We study the new(!) geometric problem of computing the smallest q enclosing circle with two given points p on its boundary Computational Geometry Lecture 6: Smallest enclosing circles and more

  20. Smallest enclosing circle with two points Given a set P of points and two special points p and q , determine the smallest enclosing circle of P that must have p and q on the boundary q Question: How do we solve it? p Computational Geometry Lecture 6: Smallest enclosing circles and more

  21. Two points known p p q q Computational Geometry Lecture 6: Smallest enclosing circles and more

  22. Two points known p p q q Computational Geometry Lecture 6: Smallest enclosing circles and more

  23. Algorithm: two points known Assume w.lo.g. that p and q lie on a vertical line. Let ℓ be the line through p and q and let ℓ ′ be their bisector For all points left of ℓ , find the one that, together with p and q , defines a circle whose center is leftmost → p l For all points right of ℓ , find the one that, together with p and q , defines a circle whose center is rightmost → p r Decide if C ( p , q , p l ) or C ( p , q , p r ) or C ( p , q ) is the smallest enclosing circle Computational Geometry Lecture 6: Smallest enclosing circles and more

  24. Two points known C ( p, q, p r ) p p p p p l p r q q q q C ( p, q, p l ) Computational Geometry Lecture 6: Smallest enclosing circles and more

  25. Analysis: two points known Smallest enclosing circle for n points with two points already known takes O ( n ) time, worst case q p Computational Geometry Lecture 6: Smallest enclosing circles and more

  26. Algorithm: one point known Use a random order for p 1 ,..., p n ; start with C 1 = C ( p , p 1 ) for j ← 2 to n do If p j in or on C j − 1 then C j = C j − 1 ; otherwise, solve smallest enclosing circle for p 1 ,..., p j − 1 with two points known ( p and p j ) C ′ C ′ j − 1 j − 1 p j p p p j Computational Geometry Lecture 6: Smallest enclosing circles and more

  27. Analysis: one point known If only one point is known, we used randomized incremental construction, so we need an expected time analysis C ′ C ′ j − 1 j − 1 p j p p p j Computational Geometry Lecture 6: Smallest enclosing circles and more

  28. Analysis: one point known Backwards analysis: Consider the situation after adding p j , so we have computed C j p p C j C j Computational Geometry Lecture 6: Smallest enclosing circles and more

  29. Analysis: one point known The probability that the j -th addition was expensive is the same as the probability that the smallest enclosing circle changes (decreases in size) if we remove a random point from the j points p p C j C j Computational Geometry Lecture 6: Smallest enclosing circles and more

  30. Analysis: one point known This probability is 2 / j in the left situation and 1 / j in the right situation p p C j C j Computational Geometry Lecture 6: Smallest enclosing circles and more

  31. Analysis: one point known The expected time for the j -th addition of a point is j − 2 · Θ ( 1 )+ 2 j · Θ ( j ) = O ( 1 ) j or j − 1 · Θ ( 1 )+ 1 j · Θ ( j ) = O ( 1 ) j The expected running time of the algorithm for n points is: n ∑ Θ ( n )+ Θ ( 1 ) = Θ ( n ) j = 2 Computational Geometry Lecture 6: Smallest enclosing circles and more

  32. Analysis: one point known Smallest enclosing circle for n points with one point already known takes Θ ( n ) time, expected p Computational Geometry Lecture 6: Smallest enclosing circles and more

  33. Algorithm: smallest enclosing circle Use a random order for p 1 ,..., p n ; start with C 2 = C ( p 1 , p 2 ) for i ← 3 to n do If p i in or on C i − 1 then C i = C i − 1 ; otherwise, solve smallest enclosing circle for p 1 ,..., p i − 1 with one point known ( p i ) C i − 1 C i − 1 p i p i Computational Geometry Lecture 6: Smallest enclosing circles and more

  34. Analysis: smallest enclosing circle For smallest enclosing circle, we used randomized incremental construction, so we need an expected time analysis C i − 1 C i − 1 p i p i Computational Geometry Lecture 6: Smallest enclosing circles and more

  35. Analysis: smallest enclosing circle Backwards analysis: Consider the situation after adding p i , so we have computed C i C i C i Computational Geometry Lecture 6: Smallest enclosing circles and more

  36. Analysis: smallest enclosing circle The probability that the i -th addition was expensive is the same as the probability that the smallest enclosing circle changes (decreases in size) if we remove a random point from the i points C i C i Computational Geometry Lecture 6: Smallest enclosing circles and more

Recommend


More recommend