Generating Voronoi Diagrams with Fortune's Algorithm: An O(n log n) Headache

2025-02-08

This article dives deep into the complexities of generating Voronoi diagrams using Fortune's Algorithm in O(n log n) time. The author admits the implementation was far more challenging than anticipated and recommends using a simpler O(n²) approach or a library unless you need to process many large diagrams per second. The article thoroughly explains Voronoi diagrams, the principles of Fortune's Algorithm (including sweep line, beach line, event queue, parabolas, etc.), and the algorithm's data structures and event handling, such as site events, circle events, incomplete edges, half-edges, etc. Despite its complexity, the algorithm produces visually stunning Voronoi diagrams.

Read more