of 42 /42
UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 7 Lecture 7 Geometric Modeling Geometric Modeling Approximate Nearest Neighbor Approximate Nearest Neighbor Searching Searching Monday, 4/23/01 Monday, 4/23/01

Lecture 7 Geometric Modeling Approximate Nearest Neighbor Searching Monday, 4/23/01

  • Author

  • View

  • Download

Embed Size (px)


UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001. Lecture 7 Geometric Modeling Approximate Nearest Neighbor Searching Monday, 4/23/01. Part 2. Advanced Topics Applications Manufacturing Modeling/Graphics - PowerPoint PPT Presentation

Text of Lecture 7 Geometric Modeling Approximate Nearest Neighbor Searching Monday, 4/23/01

  • UMass Lowell Computer Science 91.504 Advanced AlgorithmsComputational Geometry Prof. Karen Daniels Spring, 2001Lecture 7Geometric ModelingApproximate Nearest Neighbor SearchingMonday, 4/23/01

  • Part 2 Advanced TopicsApplicationsManufacturingModeling/GraphicsWireless NetworksVisualizationTechniques(de)RandomizationApproximationRobustnessRepresentationsEpsilon-netDecomposition tree

  • Literature for Part II

    Aspect Milenkovic/Daniels Wu/LiArya et al. Goodrich/Ramos Shewchuck


    Translational Polygon Containment and Minimal Enclosure using Mathematical Programming

    On calculating connected dominating set for efficient routing in ad hoc wireless networks

    An optimal algorithm for approximate nearest neighbor searching in fixed dimensions

    Bounded-Independence Derandomization of Geometric Partitioning with Applications to Parallel Fixed-Dimensional Linear Programming

    Triangle: Engineering a 2D Quality Mesh Generator and Delaunay Triangulator


    Journal: ITOR

    Conf: Workshop on Discrete Alg and Methods for MOBILE Computing & Communications

    Journal: ACM

    Journal: Discrete & Comp Geom

    Conf: 1st Workshop on Applied CG




    dynamic wireless communications

    knowledge discovery; data mining; pattern recognition; classification; machine learning; data compression; multimedia databases; document retrieval; statistics

    linear programming

    geometric modeling; graphics

    Input Objects

    2D nonconvex polygons

    2D points representing hosts

    d-dimensional points

    range space

    PSLG of object

  • Literature for Part II

    Aspect Milenkovic/Daniels Wu/LiArya et al. Goodrich/Ramos Shewchuck







    Problem/ Task

    translational containment; overlap elimination; distance-based subdivision; minimal enclosure; visibility

    dominating set

    partitioning; nearest-neighbor query

    geometric randomization; geometric derandomization

    (constrained) Delaunay triangulation; robustness

    Theory? Implementation?


    some experiments




    ADTs & Data Structures

    convex hull; visibility polygon

    undirected graph

    balanced box-decomposition tree

    epsilon-net; epsilon-approximation

    triangular mesh; (constrained) Delaunay triangulation; Voronoi diagram; convex hulls; Guibas/Stolfi quad-edge; triangular data structure; PSLG; splay tree; heap


    Paradigms & Techniques

    subdivision; approximate algorithm; binary search

    distributed; heuristic

    geometric preprocessing; approximation algorithm

    randomization; derandomization; parallel

    sweep-line; geometric divide-and-conquer; incremental insertion

    Math Topics

    Minkowski sum; linear programming; monotonicity; convex distance function

    graph theory: dominating set

    Minkowski metric; probability

    VC-dimension; linear programming; probability


  • Geometric ModelingTriangle: Engineering a 2D Quality Mesh Generator and Delaunay TriangulatorJonathan Richard Shewchuckhttp://www.cs.cmu.edu/~jrs/jrspapers.html

  • GoalsConstruct 2D mesh of triangles for geometric modeling that:avoids small anglesconstrained Delaunay triangulationis efficient in time and spacecareful choice of data structures & algorithmis robustadaptive exact arithmeticC code at http://www.cs.cmu.edu/~quake/triangle.html

  • Approach: OverviewBased on Rupperts Delaunay Refinement AlgorithmInput: Planar Straight Line Graph (PSLG)collection of vertices and segmentsStep 1: Construct Delaunay triangulation of point set

  • Approach: Overview (continued)Step 2: Start with the Delaunay triangulation of the point setAdd input segmentssegments become constraintsconstrained Delaunay triangulation

    some differences

  • Approach: Overview (continued)Step 3: Remove triangles from concavitiestriangle-eating virusStep 4: Refine mesh to satisfy additional constraints on triangles minimumangle sizearea

  • Step 1: Construct Delaunay Triangulation of Point SetDelaunay Triangulation Algorithms:O(nlogn) expected time:Randomized incremental insertionEdge flipping restores empty circle propertyO(nlogn) worst-case time:Compute Voronoi diagram, then dualizeFortunes plane sweep (parabolic front)O(nlogn) worst-case time:Divide-and-Conqueralternating cuts

    Shewchuck experimental comparison [speed, correctness]fastestslowest[point location bottleneck]deBerg handout

  • Delaunay Triangulation Algorithms: Divide-and-ConquerO(nlogn) worst-case timeRecursively halve input vertex setStop when size = 2 or 3Triangulate small setforms edge(s) or triangleMerge 2 triangulationsGhost triangles allow fast convex hull traversalFit together like gear teeth

  • Step 2: Constrained Delaunay TriangulationForce mesh to conform to input line segmentsUser Chooses Approach:Recursive segment subdivisionInsert segment midpointFlip edges to restore Delaunay (empty circle) propertyConstrained Delaunay triangulation (default)Insert entire segmentDelete triangles it overlapsRetriangulate regions on each side of segmentNo new vertices are inserted

  • Step 4: Mesh Refinement Refine mesh to satisfy additional constraints on minimum triangleangle sizeareaInsert new verticesFlip edges to restore Delaunay (empty circle) propertyHalting Issue:Halts for angle constraint = 33.9o

  • Step 4: Mesh Refinement (continued)Vertex Insertion Rules:Segments Diametral Circlesmallest circle containing segmentany point in the circle encroaches on segmentsplit encroached segmentinsert vertex at midpointTriangles Circumcirclecircle through all 3 verticesbad triangle:angle too smallarea too largesplit bad triangleinsert vertex at circumcenter

  • Step 4: Mesh Refinement (continued)

  • Implementation Issues: RepresentationGhost triangles:connected in ring about a vertex at infinityfacilitate convex hull traversalShewchuck preference

  • Implementation Issues: RobustnessTests Can influence program flow of controlCan classify entities (e.g. sweep-line events)Depend on correctness of geometric predicatesOrientation (left/right/on)In-Circle (in/out/on)Each computes sign of a determinantConstructions Represent geometric objectsOften determine outputincorrectness can be serioussome incorrectness can sometimes be tolerated

  • Implementation Issues: Robustness (continued)Ideal Goal: real arithmetic for some operationsChallenge: compounded roundoff error in floating-point arithmetic calculations:Tests: can cause programto hangto crashto produce incorrect outputwrong topologyConstructions:can cause approximate resultsWhat causes incorrectness?

  • Implementation Issues: Robustness (continued)Arithmetic Alternatives to Floating-Point:Integer or rational exact arithmeticfixed precisionextended precisionFloating point + e-testingrobust topological decisionsfilter: identify adequate precision for an operation (bit complexity) if expressible as multivariate polynomial, degree gives cluefloating-point comparisons except when correctness is threatenedadaptive precision: compute quantity (e.g. sign of determinant) via successively more accurate approximationsstop when uncertainty in result is small

    No single solution fits all needs. Collection of techniques is needed.

  • Implementation Issues: Robustness (continued)Shewchuck uses:multi-stage adaptive precision for geometric primitivesOrientation (left/right/on)In-Circle (in/out/on)Eachcomputes sign of a determinanttakes floating-pt inputsstops when uncertainty in result is smallcan reuse previous, less accurate approximationsfast arbitrary precision arithmeticfor small (yet extended) precision valuesFor general discussion of robustness issues and alternatives, see Strategic Directions in Computational Geometry Working Group Report

  • Approximate Nearest Neighbor SearchingAn Optimal Algorithm for Approximate Nearest Neighbor Searching in Fixed DimensionsArya, Mount, Netanyahu, Silverman, Wu

  • GoalsFast nearest neighbor query in d-dimensional set of n points:approximate nearest neighbordistance within factor of (1+e) of true closest neighborpreprocess using O(dnlogn) time, O(dn) spaceBalanced-Box Decomposition (BDD) treenote that space, time are indepenent of equery in O(cd,e logn) time

    C++ code for simplified version is at http://www.cs.umd.edu/~mount/ANN

  • Approach: Distance AssumptionsUse Lp (also called Minkowski) metricassume it can be computed in O(d) timepth root need not be computed when comparing distances

    Approximate nearest neighbordistance within factor of (1+e) of true closest neighbor p*Can change e or metric without rebuilding data structure

  • Approach: OverviewPreprocess points:Balanced-Box Decomposition (BDD) treeQuery algorithm: for query point qLocate leaf cell containing q in O(log n) timePriority search: Enumerate leaf cells in increasing distance order from qFor each leaf cell, calculate distance from q to cells pointKeep track of closest point p seen so farStop when distance from q to leaf > dist(q,p)/(1+e)Return p as approximate nearest neighbor to q.

  • Balanced Box Decomposition(BBD) TreeSimilar to kd-tree [Samet handout]Binary treeTree structure stored in main memoryCutting planes are orthogonal to axesAlternating dimensionsO(log n) heightSubdivides space into regions of O(d) complexity using d-dimensional rectanglesCan be built in O(dn log n) timeOne possible kd-like tree for the above points(not a BDD tree, though)

  • Balanced Box Decomposition(BBD) Tree (continued)Distinguishing features of BBD tree:Cell is eitherd-dimensional rectangle ordifference of 2 d-dimensional nested rectangles In this sense, BDD tree is like:Optimized kd-tree: partition points into roughly = sized setsWhile descending in tree, number of points on path decreases exponentiallySpecialized Quadtree: aspect ratio of box is bounded by a constantWhile descending in tree, size of region on path decreases exponentiallyLeaf may be associated with more than 1 point in/on cell: O(n) nodeInner boxes are sticky: if it is close to edge, it stickssubdivisiontreesplitshrink

  • Splitting a Box: Midpoint

  • Splitting a Box: Middle-Interval

  • Packing Constraint

  • Priority Search from Query Point

  • Incremental Distance [Arya, Mount93]Incrementally update distance from parent box to each child when split is performedMaintain sum of appropriate powers of coordinate differences between query point and nearest point of outer boxSplit: Closer child has same distance as parentFurther childs distance needs only 1-coordinate update (along splitting dimension)Makes a difference in higher dimensions!

  • ExperimentsExperiments generated points from a variety of probability distributions:UniformGaussianLaplaceCorrelated GaussianCorrelated LaplacianClustered GaussianClustered Segments

  • Experiments

  • Experiments

  • Experiments

  • ConclusionsAlgorithm is not necessarily practical for large dimensionsBut, for dimensions
  • Project Update

  • ProjectProposalMonday, 4/92%Interim ReportMonday, 4/235%Final PresentationMonday, 5/78%Final SubmissionMonday, 5/1410%25% of course gradeDeliverableDue Date Grade %

  • Guidelines: Final SubmissionAbstract: Concise overview (at most 1 page)Introduction: Motivation: Why did you choose this project?Related Work: Context with respect to CG literatureSummary of ResultsMain Body of Paper: (one or more sections)Conclusion:Summary: What did you accomplish?Future Work: What would you do if you had more time?References: Bibliography (papers, books that you used)Well- written final submissions with research content may be eligible for publishing as UMass Lowell CS technical reports.

  • Guidelines: Final SubmissionMain Body of Paper: If your project involves Theory/ Algorithm:Informal algorithm description (& example)PseudocodeAnalysis:CorrectnessSolutions generated by algorithm are correct account for degenerate/boundary/special casesIf a correct solution exists, algorithm finds itControl structures (loops, recursions,...) terminate correctly Asymptotic Running Time and/or Space Usage

  • Guidelines: Final SubmissionMain Body of Paper:If your project involves Implementation:Informal descriptionResources & Environment: what language did you code in?what existing code did you use? (software libraries, etc.)what equipment did you use? (machine, OS, compiler)Assumptionsparameter valuesTest casestables, figuresrepresentative examples

  • Guidelines: Interim ReportStructured like Final Submission, except: no Abstract or Conclusionfill in only what youve done so farcan be revised laterinclude a revised proposal if neededidentify any issues you have encountered and your plan for resolving them