Sweep Algorithm



Now we take a look at a better way to calculate the 2D Voronoi diagram.  This algorithm was first introduced by Steven Fortune in [2] and is often referred to as Fortune’s Algorithm as a result.  This algorithm has complexity O(n log n), which is optimal for this problem.  The following sections introduce the different constructions and terminology that are used by the solution, followed by the algorithm itself.

 

Sections:

  1. Sweep Line
  2. Site Events
  3. Circle Events
  4. Sweep Algorithm
    1. Data structures
    2. Algorithm
    3. Complexity

 

 


Sweep Line

 

A common way to simplify a proximity related problem such as computing the Voronoi diagram is to use a sweep line construction.  A sweep line splits the problem domain into two regions, an explored region and an unexplored region.  It applies an ordering to the problem because we reason about the explored area based on what we’ve seen so far and ignore the unexplored area.  We can get away with not caring about the unexplored area by observing that only points that have reached the sweep line or crossed it can possibly affect the current computation since all other points are too far away.  The entire problem area is eventually examined by “sweeping" the line across the set of points from one extreme to another.

 

Let's look at an example of the sweep line applied to calculating the Voronoi diagram of a single site.  Imagine our sweep line, denoted s, starts at the top of the image and sweeps down as seen in Figure 2.  The point set contains only one site p1.  How can we reason about the area above the sweep line?  Before the first and only site is encountered, there is nothing to reason about.  Once the sweep line has passed below site p1, what area must be in the Voronoi cell of site p1?  Since there could be a new site lurking just beneath the surface of the sweep line we can only reason that any point closer to p1 than to the sweep line itself must be in the Voronoi cell of site p1 at this moment in time.  It could be that the Voronoi cell of site p1 is much larger than what we’re assigning to it at this moment, but the sweep will eventually account for this.

 

Reasoning in this way divides the area above the sweep line into two disjoint regions separated by a parabola.  Points on the parabola are equidistant to p1 and the sweep line.  This dividing line is termed the beach line (for reasons that will soon become apparent).  The algorithm for computing the Voronoi diagram of a set of points depends entirely on how this beach line changes as the sweep moves through the space.  The beach line’s topology changes when a new arc is added or deleted.  The following sections look at when these events can occur.


Read full article from Sweep Algorithm


No comments:

Post a Comment

Labels

Algorithm (219) Lucene (130) LeetCode (97) Database (36) Data Structure (33) text mining (28) Solr (27) java (27) Mathematical Algorithm (26) Difficult Algorithm (25) Logic Thinking (23) Puzzles (23) Bit Algorithms (22) Math (21) List (20) Dynamic Programming (19) Linux (19) Tree (18) Machine Learning (15) EPI (11) Queue (11) Smart Algorithm (11) Operating System (9) Java Basic (8) Recursive Algorithm (8) Stack (8) Eclipse (7) Scala (7) Tika (7) J2EE (6) Monitoring (6) Trie (6) Concurrency (5) Geometry Algorithm (5) Greedy Algorithm (5) Mahout (5) MySQL (5) xpost (5) C (4) Interview (4) Vi (4) regular expression (4) to-do (4) C++ (3) Chrome (3) Divide and Conquer (3) Graph Algorithm (3) Permutation (3) Powershell (3) Random (3) Segment Tree (3) UIMA (3) Union-Find (3) Video (3) Virtualization (3) Windows (3) XML (3) Advanced Data Structure (2) Android (2) Bash (2) Classic Algorithm (2) Debugging (2) Design Pattern (2) Google (2) Hadoop (2) Java Collections (2) Markov Chains (2) Probabilities (2) Shell (2) Site (2) Web Development (2) Workplace (2) angularjs (2) .Net (1) Amazon Interview (1) Android Studio (1) Array (1) Boilerpipe (1) Book Notes (1) ChromeOS (1) Chromebook (1) Codility (1) Desgin (1) Design (1) Divide and Conqure (1) GAE (1) Google Interview (1) Great Stuff (1) Hash (1) High Tech Companies (1) Improving (1) LifeTips (1) Maven (1) Network (1) Performance (1) Programming (1) Resources (1) Sampling (1) Sed (1) Smart Thinking (1) Sort (1) Spark (1) Stanford NLP (1) System Design (1) Trove (1) VIP (1) tools (1)

Popular Posts