Bowyer-Watson algorithm how to fill holes left by removing triangles with super triangle vertices
Data Structures & Algorithms practice on Codemia
Step through 300+ coding interview problems with animated visualisers that show the data structure changing as the code runs. The Blind 75 are free.
Introduction to the Bowyer-Watson Algorithm
The Bowyer-Watson algorithm is a widely-used method for constructing Delaunay triangulations. The process begins with a "super triangle," a single, large triangle that encompasses all the points in a given set. As points are added, the algorithm removes triangles that violate the Delaunay property—specifically, those whose circumcircles contain the new point—and replaces them with new triangles. This article will delve into the intricacies of managing the "holes" formed when removing these triangles, particularly those involving vertices of the super triangle.
Fundamentals of Delaunay Triangulation
Delaunay triangulation involves connecting a set of points in such a way that no point is inside the circumcircle of any triangle. This maximizes the minimum angle of the triangles, avoiding skinny triangles and resulting in a more natural shape.
The Super Triangle
The algorithm starts with a super triangle that contains all the given points in a dataset. This super triangle is fundamental because:
- Initialization: It serves as the starting point for the algorithm.
- Boundaries: It helps define the boundary for edge connections as points are added.
Generating a Super Triangle
The vertices of the super triangle are often placed at extreme coordinates, far enough from the datasets to ensure encapsulation. For a set of 2D points, the super triangle can be constructed using:
- Identify extremes: Calculate the bounding box of the data points with a margin to ensure encapsulation.
- Form triangle: Place vertices at the bounding box corners or points extended from these corners.
Bowyer-Watson Algorithm Steps
- Initialization: Start with the super triangle covering all points.
- Insert Points:
- For each new point, identify all triangles whose circumcircle contains this point.
- Remove these triangles, creating a hole.
- Fill the Hole:
- Form new triangles by connecting the point to the edges of the hole.
- Repeat: Continue inserting points until all are included in the triangulation.
Filling "Holes" in Triangulation
When you remove triangles that include the new point inside their circumcircle, you essentially create a "hole." This section will describe the process of filling these holes, focusing on handling the super triangle vertices.
Challenges with Super Triangle Vertices
The vertices of the super triangle are not part of the actual data set and must eventually be removed. Thus, triangles associated with these vertices also need to be replaced carefully:
- Identify Boundary Edges: When removing a triangle, identify the edges but consider only those not forming part of the super triangle.
- Connect: Link the new point to the identified boundary edges, ensuring none of the resulting triangles include super triangle vertices.
- Removal: After all data points are processed, remove triangles associated with super triangle vertices, leaving the valid Delaunay triangulation.
Example
Consider a dataset of four points within a super triangle:
- Initial Setup:
- Super triangle vertices: , ,
- Data points: , , ,
- Step-by-step:
- Add , check triangles , update.
- Add , check and remove overlapping circumcircle with , add , , , and update.
- Continue with and , always forming new triangles using boundary edges.
- Finally, remove triangles associated with , , and .
Filling the Final "Hole"
As the algorithm progresses, remaining triangles involving super triangle vertices are inherently removed. This maintains the Delaunay criteria by ensuring all triangles are part solely of the data points.
Key Points Summary
| Step | Process | Purpose |
| Step 1 | Initialize with a super triangle containing all points. | Provides a starting boundary for Delaunay triangulation. Keeps edge constraints manageable. |
| Step 2 | Insert each data point sequentially. | Identify circumcircles containing new points. Remove corresponding triangles. |
| Step 3 | Fill 'holes' by forming triangles with boundary edges. | Ensures each triangle satisfies Delaunay conditions. |
| Step 4 | Remove super triangle vertices and associated triangles upon completion. | Produces the final Delaunay triangulation without artifacts from initial construction. |
Extensions: Handling Degenerate Cases
In practice, various complications can arise, such as:
- Collinear Points: Special attention is required to handle situations where points are collinear.
- Numerical Precision: Small numerical errors can lead to difficulties in checking circumcircle properties.
In these cases, robust algorithms and data structures, such as the use of floating-point arithmetic with precision control, can help ensure the algorithm's correctness and efficiency.
Conclusion
The Bowyer-Watson algorithm is an efficient method for constructing Delaunay triangulations, particularly helpful in applications such as finite element methods, meshing, and geographic information systems. By managing the initial super triangle and correctly handling the removal and addition of triangles, the algorithm ensures a correct and optimized boundary for any given dataset.
Related reading
- Box stacking problem
- Boyer-Moore good-suffix heuristics
- Boyer-Moore Practical in C?
- Boyer Moore Algorithm Understanding and Example?
- Breadth first search the timing of checking visitation status
- Breadth First Search time complexity analysis
- Bron-Kerbosch algorithm for clique finding
- Brute-force, single-threaded prime factorization

DSA Fundamentals
Master algorithmic patterns and data structures through hands-on LeetCode-style problems - from arrays and hashing to dynamic programming and advanced graphs.
View the courseData Structures & Algorithms practice on Codemia
Step through 300+ coding interview problems with animated visualisers that show the data structure changing as the code runs. The Blind 75 are free.