1 / 54

Classroom Examples of Robustness Problems in Geometric Computations

Classroom Examples of Robustness Problems in Geometric Computations. Lutz Kettner , Kurt Mehlhorn MPI f ü r Informatik, Saarbr ü cken Stefan Schirra Otto-von-Guericke-Universit ät, Magdeburg. Sylvain Pion INRIA, Sophia Antipolis Chee Yap New York University. Overview. Motivation

kbrewster
Download Presentation

Classroom Examples of Robustness Problems in Geometric Computations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Classroom Examples of Robustness Problems in Geometric Computations Lutz Kettner, Kurt Mehlhorn MPI für Informatik, Saarbrücken Stefan Schirra Otto-von-Guericke-Universität, Magdeburg Sylvain Pion INRIA, Sophia Antipolis Chee Yap New York University

  2. Overview • Motivation • 2D Convex Hull Algorithm • Constructing Bad Input Examples • Analysis Classroom Examples ESA'04

  3. Motivation • The algorithms of computational geometry are designed for a machine model with exact real arithmetic. • Substituting floating point arithmetic for the assumed real arithmetic may cause implementations to fail. • Although this is well known, it is not common knowledge. • There is no good material for the classroom to show the inadequacy of floating point arithmetic. Classroom Examples ESA'04

  4. Example • Arrangements of circular arcs Seen in Antibes, France, during SGP’04 Classroom Examples ESA'04

  5. Example • Arrangements of circular arcs, with double arithmetic Classroom Examples ESA'04

  6. Example • Arrangements of circular arcs, with float arithmetic Classroom Examples ESA'04

  7. Motivation • Let’s be more serious … Classroom Examples ESA'04

  8. Intersection of Four Simple Solids • Rhino3D: • ((( s1∩ s2) ∩ c2) ∩ c1) → successful • ((( c1∩ c2) ∩ s1) ∩ s2) → ``Boolean operation failed'' Classroom Examples ESA'04

  9. Intersection of Four Simple Solids • Rhino3D: • ((( s1∩ s2) ∩ c2) ∩ c1) → successful • ((( c1∩ c2) ∩ s1) ∩ s2) → ``Boolean operation failed'' • output is a combinatorial object plus coordinates (not a point set) Classroom Examples ESA'04

  10. Motivation • Let’s be more serious … • …, but that is hard to explain in all detail in class. • Let’s do a really simple 2D convex hull algorithm. Classroom Examples ESA'04

  11. 2D-Orientation of Three Points Orientation( p, q, r) = sign Orientation( p, q, r) = sign((qx-px)(ry-py) – (qy-py)(rx-px)) Implemented with IEEE 784 double precision  float_orient (p, q, r) Classroom Examples ESA'04

  12. Convex Hulls in the Plane v3 • maintain current hull as a circular list L=(v0,v1,...,vk-1) of its extreme points in counter-clockwise order • start with three non-collinear points in S. • consider the remaining points r one by one. v1 r v2 Classroom Examples ESA'04

  13. Convex Hulls in the Plane v4 • maintain current hull as a circular list L=(v0,v1,...,vk-1) of its extreme points in counter-clockwise order • start with three non-collinear points in S. • consider the remaining points r one by one. v1 v3 v2 Classroom Examples ESA'04

  14. Convex Hulls in the Plane v4 • maintain current hull as a circular list L=(v0,v1,...,vk-1) of its extreme points in counter-clockwise order • start with three non-collinear points in S. • consider the remaining points r one by one. v1 v3 v2 Classroom Examples ESA'04

  15. Convex Hulls in the Plane v4 • maintain current hull as a circular list L=(v0,v1,...,vk-1) of its extreme points in counter-clockwise order • start with three non-collinear points in S. • consider the remaining points r one by one. r v1 v3 v2 Classroom Examples ESA'04

  16. Convex Hulls in the Plane v4 • [Property A] A point r is outside CH iff there is an i such that the edge (vi, vi+1) is visible for r. (orientation(vi,vi+1,r) > 0) r v1 v3 v2 Classroom Examples ESA'04

  17. Convex Hulls in the Plane v4 • [Property A] A point r is outside CH iff there is an i such that the edge (vi, vi+1) is visible for r. (orientation(vi,vi+1,r) > 0) r v1 v3 v2 Classroom Examples ESA'04

  18. Convex Hulls in the Plane v4 • [Property A] A point r is outside CH iff there is an i such that the edge (vi, vi+1) is visible for r. (orientation(vi,vi+1,r) > 0) r v1 v3 v2 Classroom Examples ESA'04

  19. Convex Hulls in the Plane v4 • [Property A] A point r is outside CH iff there is an i such that the edge (vi, vi+1) is visible for r. (orientation(vi,vi+1,r) > 0) • [Property B] If r is outside CH, then the set of edges that are weakly visible (= orientation is non-negative) from r forms a non-empty consecutive subchain; so does the set of edges that are not weakly visible from r. r v1 v3 v2 Classroom Examples ESA'04

  20. Convex Hulls in the Plane v4 • [Property A] A point r is outside CH iff there is an i such that the edge (vi, vi+1) is visible for r. (orientation(vi,vi+1,r) > 0) • [Property B] If r is outside CH, then the set of edges that are weakly visible (= orientation is non-negative) from r forms a non-empty consecutive subchain; so does the set of edges that are not weakly visible from r. r v1 v3 v2 Classroom Examples ESA'04

  21. Convex Hulls in the Plane v4 • [Property A] A point r is outside CH iff there is an i such that the edge (vi, vi+1) is visible for r. (orientation(vi,vi+1,r) > 0) • [Property B] If r is outside CH, then the set of edges that are weakly visible (= orientation is non-negative) from r forms a non-empty consecutive subchain; so does the set of edges that are not weakly visible from r. r v1 v3 v2 Classroom Examples ESA'04

  22. Convex Hulls in the Plane v4 • [Property A] A point r is outside CH iff there is an i such that the edge (vi, vi+1) is visible for r. (orientation(vi,vi+1,r) > 0) • [Property B] If r is outside CH, then the set of edges that are weakly visible (= orientation is non-negative) from r forms a non-empty consecutive subchain; so does the set of edges that are not weakly visible from r. r v1 v3 v2 Classroom Examples ESA'04

  23. Convex Hulls in the Plane v4 • [Property A] A point r is outside CH iff there is an i such that the edge (vi, vi+1) is visible for r. (orientation(vi,vi+1,r) > 0) • [Property B] If r is outside CH, then the set of edges that are weakly visible (= orientation is non-negative) from r forms a non-empty consecutive subchain; so does the set of edges that are not weakly visible from r. r v1 v3 v2 Classroom Examples ESA'04

  24. Convex Hulls in the Plane v4 • [Property A] A point r is outside CH iff there is an i such that the edge (vi, vi+1) is visible for r. (orientation(vi,vi+1,r) > 0) • [Property B] If r is outside CH, then the set of edges that are weakly visible (= orientation is non-negative) from r forms a non-empty consecutive subchain; so does the set of edges that are not weakly visible from r. r v1 v3 v2 Classroom Examples ESA'04

  25. Convex Hulls in the Plane v4 • [Property A] A point r is outside CH iff there is an i such that the edge (vi, vi+1) is visible for r. (orientation(vi,vi+1,r) > 0) • [Property B] If r is outside CH, then the set of edges that are weakly visible (= orientation is non-negative) from r forms a non-empty consecutive subchain; so does the set of edges that are not weakly visible from r. v3 v1 v2 Classroom Examples ESA'04

  26. Devil’s Advocate • Systematic construction of instances leading to violations of properties (A) and (B) when executed with double’s • and in all possible ways • a point outside sees no edge • a point inside sees an edge • a point outside sees all edges • a point outside sees a non-contiguous set of edges • examples involve nearly collinear points, of course • examples are realistic as many real-life instances contain collinear points (which become nearly collinear by conversion to double’s) Classroom Examples ESA'04

  27. Global Consequences • A point outside sees no edge of the current hull. p1=(7.3000000000000194, 7.3000000000000167) p2=(24.000000000000068, 24.000000000000071) p3=(24.00000000000005, 24.000000000000053) p4=(0.50000000000001621, 0.50000000000001243) p5=(8, 4) p6=(4, 9) p7=(15, 27) p8=(26, 25) p9=(19, 11) float_orient(p1,p2,p3) > 0 float_orient(p1,p2,p4) > 0 float_orient(p2,p3,p4) > 0 float_orient(p3,p1,p4) > 0 Classroom Examples ESA'04

  28. Global Consequences • A point outside sees all edges of the current hull. p1=(200, 49.200000000000003) p2=(100, 49.600000000000001) p3=(-233.33333333333334, 50.93333333333333) p4=(166.66666666666669, 49.333333333333336) float_orient(p1,p2,p3) > 0 float_orient(p1,p2,p4) < 0 float_orient(p2,p3,p4) < 0 float_orient(p3,p1,p4) < 0 Classroom Examples ESA'04

  29. Global Consequences • A point outside sees all edges of the current hull. p1=(200, 49.200000000000003) p2=(100, 49.600000000000001) p3=(-233.33333333333334, 50.93333333333333) p4=(166.66666666666669, 49.333333333333336) float_orient(p1,p2,p3) > 0 float_orient(p1,p2,p4) < 0 float_orient(p2,p3,p4) < 0 float_orient(p3,p1,p4) < 0 Depending on the implementation: • Algorithm does not terminate! • Algorithm crashes! Classroom Examples ESA'04

  30. Global Consequences • A point inside sees an edge of the current hull. p1=(24.00000000000005, 24.000000000000053) p2=(24.0, 6.0) p3=(54.85, 6.0) p4= (54.850000000000357, 61.000000000000121) p5=(24.000000000000068, 24.000000000000071) (p1,p2,p3,p4) form a convex quadrilateral p4 is truly inside this quadrilateral, but float_orient(p4,p1,p5) > 0 p4 p5 p1 p2 p3 Classroom Examples ESA'04

  31. Global Consequences p4 • A point inside sees an edge of the current hull. p1=(24.00000000000005, 24.000000000000053) p2=(24.0, 6.0) p3=(54.85, 6.0) p4= (54.850000000000357, 61.000000000000121) p5=(24.000000000000068, 24.000000000000071) (p1,p2,p3,p4) form a convex quadrilateral p4 is truly inside this quadrilateral, but float_orient(p4,p1,p5) > 0 p5 p1 p4 p2 p5 p1 p2 p3 Classroom Examples ESA'04

  32. Global Consequences • A point outside sees a non-contiguous set of edges p1=(24.00000000000005, 24.000000000000053) p2=(24.0, 6.0) p3=(54.85, 6.0) p4= (54.850000000000357, 61.000000000000121) p5=(24.000000000000068, 24.000000000000071) p6=(6, 6) p4 p5 p1 p6 p2 p3 Classroom Examples ESA'04

  33. Global Consequences p4 • A point outside sees a non-contiguous set of edges p1=(24.00000000000005, 24.000000000000053) p2=(24.0, 6.0) p3=(54.85, 6.0) p4= (54.850000000000357, 61.000000000000121) p5=(24.000000000000068, 24.000000000000071) p6=(6, 6) p5 p1 p4 p2 p5 p1 p6 p2 p3 Classroom Examples ESA'04

  34. Global Consequences p4 • A point outside sees a non-contiguous set of edges p1=(24.00000000000005, 24.000000000000053) p2=(24.0, 6.0) p3=(54.85, 6.0) p4= (54.850000000000357, 61.000000000000121) p5=(24.000000000000068, 24.000000000000071) p6=(6, 6) float_orient(p4,p5,p6) < 0 float_orient(p5,p1,p6) > 0 float_orient(p1,p2,p6) < 0 p5 p1 p4 p2 p5 p1 p6 p2 p3 Classroom Examples ESA'04

  35. Global Consequences p4 • A point outside sees a non-contiguous set of edges p1=(24.00000000000005, 24.000000000000053) p2=(24.0, 10.0) p3=(54.85, 6.0) p4= (54.850000000000357, 61.000000000000121) p5=(24.000000000000068, 24.000000000000071) p6=(6, 6) p5 p1 p4 p2 p5 p1 p6 p2 p3 Classroom Examples ESA'04

  36. Global Consequences • A point outside sees a non-contiguous set of edges p1=(24.00000000000005, 24.000000000000053) p2=(24.0, 10.0) p3=(54.85, 6.0) p4= (54.850000000000357, 61.000000000000121) p5=(24.000000000000068, 24.000000000000071) p6=(6, 6) p4 p5 p1 p6 p2 p3 Classroom Examples ESA'04

  37. Global Consequences p4 • A point outside sees a non-contiguous set of edges p1=(24.00000000000005, 24.000000000000053) p2=(24.0, 10.0) p3=(54.85, 6.0) p4= (54.850000000000357, 61.000000000000121) p5=(24.000000000000068, 24.000000000000071) p6=(6, 6) p5 p1 p6 p4 p5 p1 p6 p2 p3 Classroom Examples ESA'04

  38. Global Consequences Classroom Examples ESA'04

  39. Global Consequences p4 • A point outside sees a non-contiguous set of edges p1=(24.00000000000005, 24.000000000000053) p2=(24.0, 6.0) p3=(54.85, 6.0) p4= (54.850000000000357, 61.000000000000121) p5=(24.000000000000068, 24.000000000000071) p6=(6, 6) p5 p1 p4 p2 p5 p1 p6 p2 p3 Classroom Examples ESA'04

  40. Global Consequences • A point outside sees a non-contiguous set of edges p1=(24.00000000000005, 24.000000000000053) p2=(24.0, 6.0) p3=(54.85, 6.0) p4= (54.850000000000357, 61.000000000000121) p5=(24.000000000000068, 24.000000000000071) p6=(6, 6) p4 p5 p1 p6 p2 p3 Classroom Examples ESA'04

  41. Global Consequences p4 • A point outside sees a non-contiguous set of edges p1=(24.00000000000005, 24.000000000000053) p2=(24.0, 6.0) p3=(54.85, 6.0) p4= (54.850000000000357, 61.000000000000121) p5=(24.000000000000068, 24.000000000000071) p6=(6, 6) p6 p5 p1 p4 p6 p5 p1 p6 p2 p3 Classroom Examples ESA'04

  42. Global Consequences Classroom Examples ESA'04

  43. 2D-Orientation of Three Points Orientation( p, q, r) = sign((qx-px)(ry-py) – (qy-py)(rx-px)) Classroom Examples ESA'04

  44. 2D-Orientation of Three Points Orientation( p, q, r) = sign((qx-px)(ry-py) – (qy-py)(rx-px)) 256x256 pixel image red=pos., yellow=0, blue=neg. orientation evaluated with double Classroom Examples ESA'04

  45. 2D-Orientation of Three Points Orientation( p, q, r) = sign((qx-px)(ry-py) – (qy-py)(rx-px)) 256x256 pixel image red=pos., yellow=0, blue=neg. orientation evaluated with double Classroom Examples ESA'04

  46. 2D-Orientation of Three Points Orientation( p, q, r) = sign((qx-px)(ry-py) – (qy-py)(rx-px)) Keep y-coordinate fix Classroom Examples ESA'04

  47. 2D-Orientation of Three Points Orientation( p, q, r) = sign((qx-px)(ry-py) – (qy-py)(rx-px)) Keep y-coordinate fix: block sizes of 25 and 24 Classroom Examples ESA'04

  48. 2D-Orientation of Three Points Orientation( p, q, r) = sign((qx-px)(ry-py) – (qy-py)(rx-px)) 256x256 pixel image red=pos., yellow=0, blue=neg. orientation evaluated with double Classroom Examples ESA'04

  49. 2D-Orientation of Three Points Orientation( p, q, r) = sign((qx-px)(ry-py) – (qy-py)(rx-px)) 256x256 pixel image red=pos., yellow=0, blue=neg. orientation evaluated with double Classroom Examples ESA'04

  50. 2D-Orientation of Three Points Orientation( p, q, r) = sign((qx-px)(ry-py) – (qy-py)(rx-px)) 256x256 pixel image red=pos., yellow=0, blue=neg. orientation evaluated with ext double Classroom Examples ESA'04

More Related