分治算法

定义
算法综述

    首先假设generator都已经按x坐标递增的顺序排好序P={ p1,…,pn }。用分治算法计算Voronoi图,有两个主要的步骤,一个是分治,一个是合并。下面就是这两个步骤的算法描述。

Algorithm 1:Divide-and-conquer method

Input: Number n of generators and list P={ p1,…,pn } of the generators arranged in increasing order of the x coordinates.

Output: Voronoi diagram V for P.

Procedure:

Step1. If n≤3, then construct the Voronoi diagram V for P directly and go to Step3.

Step2. Otherweise do the following.

     2.1. Let t be the integral part of n/2, and divide P into PL={ p1,…,pt } and PR={ pt+1,…,pn }.

     2.2. Construct the Voronoi diagram VL for PL by algorithm 2.

     2.3. Construct the Voronoi diagram VR for PR by algorithm 2.

     2.4. Merge VL and VR into the Voronoi diagram V for P(it can be done by Algorithm 2)。

Step3. Return V.

 

Algorithm 2:Merge of two Voronoi diagrams

Input: Two Voronoi diagrams VL and VR for generators sets PL and PR , respectively, such that the generators in VL have smaller x coordinates than those in VR .

Output: Voronoi diagram for PLPR

Procedure:

Step1. Construct the convex hull of PL and that of PR .

Step2. Find the lower common support L(PL, PR).

Step3. w0←the point at infinity downward on b(PL, PR),and i←0.

Step4. while L(PL, PR) is not the upper common support, repeat 4.1,…,4.4.

          4.1 i ←i+1.

4.2. Find the point aL(other than wi-1) of the intersection of b(PL, PR) with the boundary of V(PL).

4.3. Find the point aR(other than wi-1) of the intersection of b(PL, PR) with the boundary of V(PR).

4.4. If has aL smaller y coordinate than ,

wi←aL, and

PL←the generator on the other side of the Voronoi edge containing aL.

Otherwise

wi←aR, and

PR←the generator on the other side of the Voronoi edge containing aR.

Step5. m←i.

Wm+1←the point at infinity upward on b(PL, PR).

Step6. Add the polygonal line(w0w1,w1w2,…,wmwm+1),and delete from VL the part to the right of the polygonal line. Return the resultant diagram.

 

有关此站点的问题请向[lyq,ywj@keg.cs.tsinghua.edu.cn,

                   wpchen@cad.cs.tsinghua.edu.cn]发邮件。
上次更新时间: 2001年01月11日。