1 / 48

Point Location Strategies

Point Location Strategies. Idit Haran 13.4.2005. Outline. Problem Description Other strategies Our strategy - Landmarks Benchmark Working with conic arrangements and some number theory Future work Summary. Point Location – Problem Description. Given

amyrtle
Download Presentation

Point Location Strategies

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. Point Location Strategies Idit Haran 13.4.2005

  2. Outline • Problem Description • Other strategies • Our strategy - Landmarks • Benchmark • Working with conic arrangementsand some number theory • Future work • Summary

  3. Point Location – Problem Description • Given • A map (which divides space of interest into regions) • A query point q (specified by coordinates) • Find the region of the map containing q • Requirement: • (segments/conics) • Fast query • Reasonable preprocess time • Good data structure (small space) INPUT OUTPUT

  4. Other Strategies • Strategies implemented in CGAL: • Naïve • Walk along line • Random Incremental Algorithm (Trapezoidal) • Triangulation • Other strategies: • Persistent search trees

  5. Naïve Approach (CGAL)

  6. q Walk Along a Line

  7. Random Incremental Algorithm (Trapezoidal)

  8. Vertical Decomposition • Assume a bounding box. • Extend the vertical line from each vertex upward and downward, until it touches another segment.

  9. Trapezoidal Maps • Contains triangles and trapezoids. • Each trapezoid or triangle is determined by two vertices and two segments. • A refinement of the original subdivision.

  10. Trapezoidal Maps • Theorem: In a trapezoidal map of n segments, there are at most 6n+4 vertices, and at most 3n+1 faces. • Proof: Vertices: • 2n– original vertices • 4n– 2 extensions for each original vertex. • 4 – Vertices of the bounding box. • Total: 6n+4 Faces: Similar

  11. Trapezoidal Map Data Structure • For each Trapezoid store: • The vertices that define its right and left sides. • The (up to two) neighboring trapezoids on right and left. • (Optional) The neighboring trapezoids from above and below. This number might be linear, so we store only the leftmost of these.

  12. D Q1 Q3 S3 B P3 A H E K Q2 J P1 S1 Q1 F P1 Q2 S2 A S1 Q3 S3 P2 C G P3 P2 S3 S2 S3 C S2 B J K H D E F G D The DAG Search Structure DAG = Directed Acyclic Graph

  13. D Q1 Q3 S3 B P3 A H E K Q2 J P1 S1 Q1 F P1 Q2 S2 A S1 S3 Q3 P2 C G P3 P2 S3 S2 S3 C S2 B J D E F G D H K Using the DAG Search Structure

  14. Triangulation

  15. A B Persistent Search Trees (Sarnak-Tarjan)

  16. Other Strategies - Summary More Algorithms on Delaunay Triangulations: The Delaunay Hierarchy, Jump & Walk

  17. q Point location using Landmarks l

  18. l l q q Choosing the Landmarks • Number of landmarks • Distribution of the landmarks in the arrangement: • Geometric entities of the arrangement: • Vertices • Edge Midpoints • Points inside the faces: Preprocess the arrangement into trapezoids and triangles • Independent of the arrangement geometry: Grid Random

  19. v p Quality of the landmarks –Arrangement Distance (AD) • The Arrangement Distance (AD) between two points is the number pf faces in which the straight line segment that connect these points passes. • Arrangement Distance ≠ Euclidean Distance AD = 0 AD = 4 v p

  20. Nearest Neighbor Search Structure • Input: • Landmarks • Query point q • Question: • Find nearest landmark l to the query point q • Answer: • Voronoi? - Again, point location problem !

  21. 4 6 l1 l9 7 l5 l6 8 l3 l2 5 9 10 3 l10 l8 l7 2 5 4 11 8 2 1 l4 11 1 3 9 10 6 7 Kd-trees • The kd-tree is a powerful data structure that is based on recursively subdividing a set of points with alternating axis-aligned hyper-planes. l1 l3 l2 l4 l5 l7 l6 l8 l10 l9

  22. 4 6 l1 7 8 5 9 10 3 2 1 11 2 5 4 11 8 1 3 9 10 6 7 Kd-trees - Construction l1 l9 l3 l2 l5 l6 l3 l2 l4 l5 l7 l6 l10 l8 l7 l8 l10 l9 l4

  23. l1 q 2 5 4 11 8 1 3 9 10 6 7 Kd-trees - Query l1 4 6 l9 7 l3 l2 l5 l6 8 l3 l2 5 l4 l5 l7 l6 9 10 3 l10 l8 l7 l8 l10 l9 2 1 l4 11

  24. Using Kd-trees with the landmarks • Quick: • Approximate nearest neighbor • Operations on points only • Round all points to double – Inexact computation. Final result is always exact !

  25. Landmarks point location – Query Find Nearest Landmark Walk Decide on Startup Face Is query point in face ? Cross to Next Face No Yes Query Point Located

  26. Decide on startup face: From vertex: Check all incident face to the vertex, and find the face in q’s direction. From Edge: Choose between the two incident face to the edge. From Face: This is the startup face. Find Nearest Landmark Walk Decide on Startup Face Is query point in face ? Cross to Next Face No l l l q q q Yes Query Point Located Landmarks point location – Query

  27. Is query point in face? Count the number of edges on f’s boundary that are above q. Odd–q is inside f– found ! Even–need to cross to the next face. Find Nearest Landmark Walk Decide on Startup Face Is query point in face ? Cross to Next Face No Yes Query Point Located Landmarks point location – Query q

  28. Cross to next face: Create a segment s from the landmark l to the query point q find the edge ein fthat intersects s flip eto get a new face f’. check if q is in f’… Find Nearest Landmark Walk Decide on Startup Face Is query point in face ? Cross to Next Face No l Yes Query Point Located Landmarks point location – Query f’ f e s q

  29. Benchmark • Categories: Query & Preprocess time • Algorithms: Naïve, Walk, Triangle, RIC, 2 variants of landmarks algorithm. • Arrangements: random and degenerate. similar results. Random Onebig

  30. Benchmark: Query Arrangements of random line segments Time in milliseconds

  31. Benchmark: Preprocess Arrangements of random line segments Time in seconds Naïve and Walk algorithms do not require any specific preprocessing besides constructing the arrangement

  32. Landmarks Algorithm Analysis Algorithm performance for varying number of random landmarks Results on an arrangement of 500 original segments, include ~56,000 edges and ~28,000 vertices

  33. l v q p Landmarks Algorithm Analysis Algorithm performance vs. the type of landmarks used

  34. Landmarks Algorithm Analysis

  35. Conics • Differences from segments • Bench results • Problems invoked, and their solutions • Cross to next face • The chord method • Number type theory

  36. Conics – differences from segments • More complex curves (every operator on the curves takes longer) • Working with irrational number types • Basically the same methods work (except triangle)

  37. Benchmark: Query Arrangements of random conic arcs Time in seconds

  38. Find exact intersection point – a complex operation on conics ! Instead – use a simple method to decide what edge to flip. The idea: check vertical order on the left and right boundaries of the common x-range. e e q q s s L L x-range x-range Conics - Cross to Next Face e l l e s e s q q q s l x-range x-range x-range (a) (b) (c)

  39. v’Properties: • Rational • On the conic • Close to the v The chord method:given a rationl point r on the conic, we can use the chord method to find v’ v’ r Problem 2:finding the intersection between vp and other curves What’s the problem with the vertices in an arrangement of conic arcs ? v p Problem 1:vertex may be complex irrational number (algebraic with degree 4)

  40. The Chord Method Given: • Unit circle equation: x2 + y2 = 1 • The point (-1,0) is on the circle Find: • Rational point v’ close to v Solution: • Every line passing through this point is:y = t(x+1)where t is the slope of the line. • solve x2 + (t(x+1))2 = 1 x2+y2=1 v y=t(x+1) (-1,0)

  41. One Rational Point • Apparently, not all conics with rational (or even integer) coefficients have rational points on them • For example, the circle x2 + y2 = 3does not have any rational points on it.

  42. Does a conic have rational solution? Change the equation into homogenic coordinates: A:r x2 + s y2 + t xy + u x + v y + w = 0 ⇓(x→x/z, y→y/z)B: r x2 + s y2 + t xy + u xz + v yz + wz2 = 0 (Rational solution to A ⇔ Integer solution to B) Theory 1: if there is a solution for every congruence modulo pk for every prime p and every k, then there is a solution. Theory 2: Check only p=2 and p’s that divide the determinant of the equation coefficients. It is also sufficient to check only for k <= 3 + the largest exponent in the determinant factorization. 3 Variables

  43. How to find a rational solution (if there is one) Theorem:if a conic equation has an integer solution, then the size of the solution  (3F), where F is the sum of the absolute value of the coefficients.

  44. What to do in practice? • Change the equation into homogenic coordinates • Go over all small pk and check if there is a solution modulo pk. • One NO – no solution. • All Yes – • search for pairs (x,y) so that |x|<3F, |y|<3F • check whether z is also an integer. • YES – we found a solution. • All NO – there is no solution. • Complexity: (3F)2

  45. Euclid’s algorithm to approximate real number x into rational number r: If there are no rational points on the conic? x = a0 + 1/x1, x1>1, a0 - integer x1 = a1 + 1/x2, x2>1, a1 - interger … Finally, r = a0 + 1/(a1 + (1/ (a2 + ….) ) ) = pn/qn. If x is irrational, and the algorithm ends after n stages, then: | x - pn/qn | < 1/qn2

  46. How to find ? •  = the approximation value.should stay “close” to the vertex. • Find the minimum distance between v and other vertices.or • Find the minimum distance to all edges/vertices in the adjacent faces to the vertex.

  47. Landmarks – future work • Rationalization of the vertices • More types of landmarks: • Combination of different landmarks types • Memory usage of the algorithms Halton sequenceHammersley Points

  48. Summary • Point location using landmarks – • Fast query • Efficient preprocess, using inexact computation • Low memory • Simple to understand and implement • Many ways to improvements: different search structure, other choice of points

More Related