Back to Browse

2D Delaunay Triangulation: parallel divide & conquer

830 views
Feb 20, 2021
6:55

The code is available here: https://drive.google.com/file/d/1MemLbI6YIqo-7sRyD3ykxJMZsKmWatOz/view?usp=sharing A triangulation algorithm creates a set of triangles whose vertices come from a set of point. No point should remain unused and the triangles must not overlap. The triangulation should also be maximal: no triangle can be added without overlapping previous triangles. This condition is simply a way to state that there should be no holes. A Delaunay triangulation has the additional property that the circumscribed circle of each triangle is empty: it does not contain any point from the point cloud except the 3 vertices of its triangle. Such a triangulation can easily be converted into a Voronoï diagram. Each Voronoï cell contains only one vertex and is defined as the set of points being closest to that particular vertex. A Delaunay triangulation and its associated Voronoï diagram can be computed in any dimension. However, the algorithm used here only works in 2D. This implementation written in c++ and OpenGL is based on the following paper: "An Improved Parallel Algorithm for Delaunay Triangulation on Distributed Memory Parallel Computers" from 1997. This paper describes an efficient divide and conquer approach for this problem but does not indicate how to cope with inaccuracies due to floating point computations. I had to make several modifications to alleviate this problem but it would be too long to explain them in detail here. In the end, the technique works well for point clouds of moderate size (a few thousands of points) but can fail if some points are very close to each other (which becomes increasingly common as the number of points grows). The algorithm is recursive in nature which enables an easy parallelization with OpenMP. Each recursive call dividing the point cloud into two partitions is assigned to a task. The final triangulation of each partition is simply carried out by a "parallel for" preprocessor directive. The impact of switching from a single thread to several ones isn't very clear in the video because of the recording software using the CPU in parallel. My tests show that using 2 threads is about twice as efficient as using only one. Using more threads does not increase nor worsen the performance on my computer. This behavior could be explained by the fact that my processor has 4 cores thanks to hyper-threading but only two physical cores. Overall, the algorithm is fast enough for real-time performance up to a few thousand points with a theoretical complexity of O(n log(n)) which is in accordance with the implementation.

Download

0 formats

No download links available.

2D Delaunay Triangulation: parallel divide & conquer | NatokHD