Skip to main content

Parallel implementation of Guibas & Stolfi's divide-and-conquer algorithm for Delaunay triangulation, using MPI in Python.

Project description

delaunay-triangulation

This library is used for computing the Delaunay triangulation of 2D point sets.

An example Delaunay triangulation output for 32 points is shown below. drawing

Why is this library special?

Speed! This is a pure python implementation of the Guibas & Stolfi's divide and conquer algorithm. The divide and conquer algorithm has been shown to be the fastest DT generation technique, with O(n log n) running time. Furthermore, this code has been parallelised using the MPI for Python (mpi4py) library to utilise multiple CPU cores. This allows the algorithm to be efficiently scaled for distributed computing across supercomputer nodes.

Setup

  1. Install anaconda or miniconda
  2. Install git, then clone repository: git clone https://github.com/v-hill/delaunay-triangulation
  3. Create environment: conda create -n deltri python=3.9
  4. Activate environment: conda activate deltri
  5. Install dependencies: conda env update -f conda_env.yml --prune
  6. Run test: python src/triangulation_test.py

Benchmarking

Single core results

As seen in the graph below, this Delaunay triangulation implementation scales just as efficiently as the SciPy implementation. The SciPy library is written in C and wrapped in Python for ease of use. As a result, the SciPy DT algorithm is consistently around 40x faster for a given number of points. However, the benefit of my library is that it can take advantage of multiple CPU cores, offering a performance advantage unavailable to SciPy users. By utilising the multiple cores available in modern computers, the run time can be reduced linearly by a factor approximately equal to the number of available threads.

drawing

This graph can be reproduced by running python src/triangulation_benchmarks.py.

Structure

This repository is currently structured as follows.

├── src
    ├── triangulation_core
        ├── points_tools
            ├── generate_values.py
            └── split_list.py
        ├── edge_topology.py
        ├── linear_algebra.py
        ├── triangulation.py
        └── triangulation_primitives.py
    ├── utilities
        └── settings.py
    ├── triangulation_benchmarks.py
    ├── triangulation_cli.py
    ├── triangulation_mpi_test.py
    └── triangulation_test.py

References

[1] Guibas, Leonidas and Stolfi, Jorge 'Primitives for the Manipulation of General Subdivisions and the Computation of Voronoi' In: ACM Trans. Graph.4.2 (Apr.1985), pp. 74–123. issn: 0730-0301 doi:10.1145/282918.282923

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parallel_delaunay-0.1.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

parallel_delaunay-0.1.0-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file parallel_delaunay-0.1.0.tar.gz.

File metadata

  • Download URL: parallel_delaunay-0.1.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.1 CPython/3.10.10 Windows/10

File hashes

Hashes for parallel_delaunay-0.1.0.tar.gz
Algorithm Hash digest
SHA256 113ebdc1689d4e68140cf1ec3e7db3eb45aaef6a8873141fe07dca4fdd1b9f2a
MD5 c89c741970507aea80f823a8a75ae1f1
BLAKE2b-256 bdc9467a7100f6db741ae441921dc62b385c123f23b96eea8c6f778cddd22629

See more details on using hashes here.

File details

Details for the file parallel_delaunay-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for parallel_delaunay-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c99ddbf3dbfb6f325c92e87c81df6fba5c8def1f49f94f82f7267430ecdfc47e
MD5 0625e3602d4e107a71894dbecb688f5d
BLAKE2b-256 13d111702924984e7d8e4cbd6e9846426639f8c4b3d77cdb152b0c25f18fe486

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page