Walking Algorithms for Point Location Roman Soukal Ivana Kolingerová.

24
Walking Algorithms for Point Location Roman Soukal Ivana Kolingerová

Transcript of Walking Algorithms for Point Location Roman Soukal Ivana Kolingerová.

Walking Algorithms for Point Location

Roman Soukal

Ivana Kolingerová

Roman Soukal – Walking Algorithms for Point Location

2 / 24Roman Soukal – Walking Algorithms for Point Location

Point Location Fundamental problem in Computational Geometry Triangulations, Tetrahedronizations,

Pseudotriangulations, Voronoi Diagrams etc. A lot of applications

Geographic Information Systems (GIS) Computer Aided Design (CAD) Computer Graphics Motion Planning Etc.

Figure 1: Point Location in Triangulation

Query TriangleQuery Point

Explanation of Figure 1.:

Roman Soukal – Walking Algorithms for Point Location

3 / 24Roman Soukal – Walking Algorithms for Point Location

The most effective solutions

Expected computation complexity O(log n) where n is a number of elements in a mesh

Sophisticated structures are required DAG, skip list, quadtree, octree, random sampling Disadvantages

Memory demands (usually O(n)) Difficult implementation (especially implementation of modifications) Etc.

Alternative solutions Walking location algorithms Computational complexity to [De01] 3 nO 2 nO

Roman Soukal – Walking Algorithms for Point Location

4 / 24Roman Soukal – Walking Algorithms for Point Location

Walking algorithms

Location of an element (the element which contains the query point) using walking through neighboring elements No extra data structures – it needs only information about

connectivity Types of walking algorithms

Visibility walk Straight walk Orthogonal walk

Visited TriangleQuery PointPath of walking algorithm

Explanation of Figure 2.:

Figure 2: Point location in triangulation using walking algorithms

Roman Soukal – Walking Algorithms for Point Location

5 / 24Roman Soukal – Walking Algorithms for Point Location

Performed research Triangulation

Visibility walk Straight walk Orthogonal walk

Tetrahedronisation Visibility walk

Pseudotriangulation Special modification of Visibility walk [Tr08]

Choice of the first element[Mu99]

Roman Soukal – Walking Algorithms for Point Location

6 / 24Roman Soukal – Walking Algorithms for Point Location

Visibility walk in E2

Fixed orientation of Δ Determinant test

Simple implementation

MyQyMyNy

MxQxMxNx

f

QN,M,

Figure 3: Point location in triangulation using Visibility walk algorithm

Roman Soukal – Walking Algorithms for Point Location

7 / 24Roman Soukal – Walking Algorithms for Point Location

Remembering Stochastic walk in E2

“Stochastic” – otherwise only Delaunay Triangulation

“Remembering”

Figure 5: Visibility walk may loop on a non-Delaunay triangulation

Figure 4: Point location in the triangulation using Remembering Stochastic walk algorithm

Roman Soukal – Walking Algorithms for Point Location

8 / 24Roman Soukal – Walking Algorithms for Point Location

Improvement of Remembering Stochastic walk by I. Kolingerova Remembering

Stochastic walk 1 or 2 edge tests

per triangle Average 1,4

Improvement 1 edge test per triangle

(about 40% fewer edge tests)

How to find the query triangle?

Figure 6: Looping in Improvement of Remembering Stochastic walk

DirectionQuery Point

Loop

Roman Soukal – Walking Algorithms for Point Location

9 / 24

Improvement of Remembering Stochastic walk by [Ko06]

Existed solutions for looping [Ko06] – Using standard Remembering

Stochastic walk algorithm for final locationFlag – Needs modification of structure

SolutionDistance control after A iterations where A is

a constant depended on N New possible solutions?

Roman Soukal – Walking Algorithms for Point Location

Roman Soukal – Walking Algorithms for Point Location

10 / 24

Original Straight walk Two steps of algorithm

Initialization step Straight walk step

Determinant orientation test is used

Goals

Simplify initialization step Use faster tests than determinant orientation tests

Roman Soukal – Walking Algorithms for Point Location

11 / 24

Straight walk example

Figure 7: Original Straight walk

Triangle on Straight walk

Triangle on Initialization step

Path of Straight walk

Explanation of Figure 5.:

Path of Initialization step

Line pq

Initialization step - 1 Determinant orientation test Straight walk step – 2 Determinant orientation tests

Roman Soukal – Walking Algorithms for Point Location

12 / 24

Modified Straight walk

The initialization step is simplified to constant number of operations

Implicit line equation test is used

Roman Soukal – Walking Algorithms for Point Location

13 / 24

Modified Straight walk Example Initialization step Implicit line equation test for pq Problem and solution

Triangle on Visibility walk

Triangle on Straight walk

Path of Visibility walk

Explanation of Figure 6.:

Path of Straight step

Line pq

Figure 8: Modified Straight walk

Normal line

Roman Soukal – Walking Algorithms for Point Location

14 / 24

Length of Remembering Stochastic Walk in Straight walk

Table 1: The properties of final location with Remembering Stochastic walk

Roman Soukal – Walking Algorithms for Point Location

15 / 24

Solution

Remembering Stochastic walk for final location

2 solutions Distance Normal

Normal is faster

Path of Remembering

Stochastic walk

Path of Straight walk

Pilot line

Starting point

Pilot point of the last triangle in Straight walk

Last triangle of Straight walk

Query point

Control normal

Direction of walking

Figure 9: Normal Straight walk

Roman Soukal – Walking Algorithms for Point Location

16 / 24Roman Soukal – Walking Algorithms for Point Location

Orthogonal walk Best result Why? Practical application

Dynamic Delaunay triangulation for kinetic data

Terrain deformation for virtual reality

Faster up to 15 %

Path of Remembering Stochastic walk

Query point

Starting point of walking for ax X

Last triangle of walking in X and starting triangle of

walking in Y

Ax of walking in Y

Path of Orthogonal walk

Ax of walking in

XWalking direction

Figure 10: Point location in triangulation using Orthogonal walk

Roman Soukal – Walking Algorithms for Point Location

17 / 24

How to choose the first element?

[Mu99] – We choose the closest element from the set

The set contains some randomly selected elements from mesh

How big must be this set? Depends on the speed of the algorithm The size of the set:

Roman Soukal – Walking Algorithms for Point Location

bna 5,3

Roman Soukal – Walking Algorithms for Point Location

18 / 24

Is there a speedup on all types of datasets?

Tests on DT made on different datasetsRandom generated points in squareClustersGridGaussArc

100, 200, 500, 1000, 2000, 5000, 104, 2*104, 5*104, 105, 2*105, 5*105, 106, 2*106 points in dataset

Roman Soukal – Walking Algorithms for Point Location

Direction of walking

Query point

Figure 11: Point location in triangulation made on Arc

Roman Soukal – Walking Algorithms for Point Location

19 / 24

Results Speedup up to 350-550%

Roman Soukal – Walking Algorithms for Point Location

Algorithmn=2000 n=20000 n=200000 n=2000000

N[ms] O[ms] N[ms] O[ms] N[ms] O[ms] N[ms] O[ms]

Remembering walk 164,9 84,1 566,4 241,2 2582,7 672 8450 1625

Flag Fast walk 156,1 94,2 498,4 243,6 2075,3 651,5 7742 1531

Rem. Stochastic walk 218,6 104,8 778,2 299,8 3187,4 825,7 9652 1969,3

Flag Fast walk (Stoch.) 231,1 126,6 764,6 313,7 2906,2 781,4 8864,6 1802,6

Normal Straight walk 127,1 79,3 435 224,3 2018,5 608 6921,8 1462,4

Orthogonal walk 73,3 57 263,6 174,1 1175,1 527,1 4578,2 1291,2

Table 2: Speedup with the optimal choice of the first element (time of location of 10000 points)Intel Pentium D 3GHz 2x2MB L2 Cache, 3GB RAM

Roman Soukal – Walking Algorithms for Point Location

20 / 24

Remembering Stochastic walk in E3

Roman Soukal – Walking Algorithms for Point Location

MzQzMzOzMzNz

MyQyMyOyMyNy

MxQxMxOxMxNx

f

QON,M, , Determinant test

Figure 12: Walking in tetrahedra mesh

Roman Soukal – Walking Algorithms for Point Location

21 / 24Roman Soukal – Walking Algorithms for Point Location

Conclusion

E2

The best is Orthogonal walk

Expected computational complexity down to

E3

The best is Remembering Stochastic walk for E3

Expected computational complexity down to

Pseudotriangulations

4 nO

3 nO

Figure 13: Results of chosen algorithms

Roman Soukal – Walking Algorithms for Point Location

22 / 24

Future work

Tests of properties on non-Delaunay triangulations (regular, greedy, etc.)

Tests of hierarchical structures

Roman Soukal – Walking Algorithms for Point Location

23 / 24Roman Soukal – Walking Algorithms for Point Location

The most important references [De01] Devillers, O., Pion, S., Teillaud, M. , 2001. Walking in a Triangulation.

International Journal of Foundations of Computer Science. [Fl91] L. D. Floriani, B. Falcidieno, G. Nagy, C. Pienovi: On sorting triangles in

Delaunay tessellation, Algorithmica 6, 1991 [Mu99] Mücke, E. P., Saias, I., Zhu, B., 1999. Fast Randomized Point Location

without Preprocessing in Two- and Three-dimensional Delaunay Triangulations. Computational Geometry: Theory and Applications.

[Ko06] Kolingerová, I., 2006. A Small Improvement in the Walking Algorithm for Point Location in a Triangulation. 22nd European Workshop on Computational Geometry.

[Tr08] Trčka, J., Kolingerová, I., 2008. The Stochastic Walk Algorithm for Pseudotriangulations. Draft.

Roman Soukal – Walking Algorithms for Point Location

24 / 24Roman Soukal – Walking Algorithms for Point Location

Thank you for your attention…

Questions?