77
CONVEX HULLS Chan's optimal output sensitive algorithms for convex hulls Alberto Parravicini Université libre de Bruxelles December 15, 2016

Convex hulls & Chan's algorithm

Embed Size (px)

Citation preview

Page 1: Convex hulls & Chan's algorithm

CONVEX HULLSChan's optimal output sensitivealgorithms for convex hulls

Alberto ParraviciniUniversité libre de Bruxelles

December 15, 2016

Page 2: Convex hulls & Chan's algorithm

What's on themenu?

→ Basic notions

→ Algorithms for convex hulls

→ Optimal 2D algorithm

→ Optimal 3D algorithm

2

Page 3: Convex hulls & Chan's algorithm

What's on themenu?

→ Basic notions

→ Algorithms for convex hulls

→ Optimal 2D algorithm

→ Optimal 3D algorithm

2

Page 4: Convex hulls & Chan's algorithm

What's on themenu?

→ Basic notions

→ Algorithms for convex hulls

→ Optimal 2D algorithm

→ Optimal 3D algorithm

2

Page 5: Convex hulls & Chan's algorithm

What's on themenu?

→ Basic notions

→ Algorithms for convex hulls

→ Optimal 2D algorithm

→ Optimal 3D algorithm

2

Page 6: Convex hulls & Chan's algorithm

basic notions

Page 7: Convex hulls & Chan's algorithm

Crash course on convex hulls

A convex set S is a set in which, ∀ x, y ∈ S, thesegment xy ⊆ S.

Given a set of points P in d dimensions, theConvex Hull CH(P) of P is:

→ theminimal convex set containing P.

→ the union of all convex combinations ofpoints in P, i.e. the points CH(P) are s.t.|P|∑i=1

wi · xi, ∀xi ∈ P, ∀wi : wi ≥ 0 and|P|∑i=1

wi = 1

4

Page 8: Convex hulls & Chan's algorithm

Crash course on convex hulls

A convex set S is a set in which, ∀ x, y ∈ S, thesegment xy ⊆ S.

Given a set of points P in d dimensions, theConvex Hull CH(P) of P is:

→ theminimal convex set containing P.

→ the union of all convex combinations ofpoints in P, i.e. the points CH(P) are s.t.|P|∑i=1

wi · xi, ∀xi ∈ P, ∀wi : wi ≥ 0 and|P|∑i=1

wi = 1

4

Page 9: Convex hulls & Chan's algorithm

Crash course on convex hulls

A convex set S is a set in which, ∀ x, y ∈ S, thesegment xy ⊆ S.

Given a set of points P in d dimensions, theConvex Hull CH(P) of P is:

→ theminimal convex set containing P.

→ the union of all convex combinations ofpoints in P, i.e. the points CH(P) are s.t.|P|∑i=1

wi · xi, ∀xi ∈ P, ∀wi : wi ≥ 0 and|P|∑i=1

wi = 1

4

Page 10: Convex hulls & Chan's algorithm

Output sensitive algorithm

The complexity of an output-sensitivealgorithm is a function of both the input size

and the output size.

5

Page 11: Convex hulls & Chan's algorithm

algorithms for convex hulls

Page 12: Convex hulls & Chan's algorithm

Jarvis's march

→ Core idea: given an edge pq of the convexhull, the next edge qr to be added willmaximize the angle ∠∠∠pqr

→ At each step we scan all the n points.

→ How many steps? h, size of the hull.

→ Complexity: O(nh)

7

Page 13: Convex hulls & Chan's algorithm

Jarvis's march

→ Core idea: given an edge pq of the convexhull, the next edge qr to be added willmaximize the angle ∠∠∠pqr

→ At each step we scan all the n points.

→ How many steps? h, size of the hull.

→ Complexity: O(nh)

7

Page 14: Convex hulls & Chan's algorithm

Jarvis's march

→ Core idea: given an edge pq of the convexhull, the next edge qr to be added willmaximize the angle ∠∠∠pqr

→ At each step we scan all the n points.

→ How many steps? h, size of the hull.

→ Complexity: O(nh)

7

Page 15: Convex hulls & Chan's algorithm

Jarvis's march

→ Core idea: given an edge pq of the convexhull, the next edge qr to be added willmaximize the angle ∠∠∠pqr

→ At each step we scan all the n points.

→ How many steps? h, size of the hull.

→ Complexity: O(nh)

7

Page 16: Convex hulls & Chan's algorithm

One step, visually

Figure: A step of the Jarvis March. The red line is the nextsegment that will be added to the hull.

8

Page 17: Convex hulls & Chan's algorithm

Jarvis's march

Algorithm 1: Jarvis MarchInput: a list S of bidimensional points.Output: the convex hull of the set, sorted counterclockwise.hull =[]x0 = the leftmost point.hull.push(x0)Loop hull.last() != hull.first()

candidate = S.first()foreach p in S do

if p != hull.last() and p is on the right of the segment”hull.last(), candidate” thencandidate = p

if candidate != hull.first then hull.push(candidate) else breakreturn hull

9

Page 18: Convex hulls & Chan's algorithm

Graham's scan

→ Sort the points in clockwise order aroundthe leftmost point - Cost: O(n log n)

→ Keep the current hull in a stackH = {h0, . . . , hcurr}.

→ Inspect each point p in order - Cost: O(n)

→ While hcurr−1hcurrp is a right turn, pop hcurr.→ Push p to H.

→ Overall complexity: O(n log n)

10

Page 19: Convex hulls & Chan's algorithm

Graham's scan

→ Sort the points in clockwise order aroundthe leftmost point - Cost: O(n log n)

→ Keep the current hull in a stackH = {h0, . . . , hcurr}.

→ Inspect each point p in order - Cost: O(n)

→ While hcurr−1hcurrp is a right turn, pop hcurr.→ Push p to H.

→ Overall complexity: O(n log n)

10

Page 20: Convex hulls & Chan's algorithm

Graham's scan

→ Sort the points in clockwise order aroundthe leftmost point - Cost: O(n log n)

→ Keep the current hull in a stackH = {h0, . . . , hcurr}.

→ Inspect each point p in order - Cost: O(n)

→ While hcurr−1hcurrp is a right turn, pop hcurr.→ Push p to H.

→ Overall complexity: O(n log n)

10

Page 21: Convex hulls & Chan's algorithm

Graham's scan

→ Sort the points in clockwise order aroundthe leftmost point - Cost: O(n log n)

→ Keep the current hull in a stackH = {h0, . . . , hcurr}.

→ Inspect each point p in order - Cost: O(n)→ While hcurr−1hcurrp is a right turn, pop hcurr.

→ Push p to H.

→ Overall complexity: O(n log n)

10

Page 22: Convex hulls & Chan's algorithm

Graham's scan

→ Sort the points in clockwise order aroundthe leftmost point - Cost: O(n log n)

→ Keep the current hull in a stackH = {h0, . . . , hcurr}.

→ Inspect each point p in order - Cost: O(n)→ While hcurr−1hcurrp is a right turn, pop hcurr.→ Push p to H.

→ Overall complexity: O(n log n)

10

Page 23: Convex hulls & Chan's algorithm

Graham's scan

→ Sort the points in clockwise order aroundthe leftmost point - Cost: O(n log n)

→ Keep the current hull in a stackH = {h0, . . . , hcurr}.

→ Inspect each point p in order - Cost: O(n)→ While hcurr−1hcurrp is a right turn, pop hcurr.→ Push p to H.

→ Overall complexity: O(n log n)

10

Page 24: Convex hulls & Chan's algorithm

Graham's scan

Algorithm 2: Graham ScanInput: a list S of bidimensional points.Output: the convex hull of the set, sorted counterclockwise.hull =[]x0 = the leftmost point.Put x0 as the first element of S.Sort the remaining points in counter-clockwise order, withrespect to x0.Add the first 3 points in S to the hull.forall the remaining points in S do

while hull.second_to_last(), hull.last(), p form a right turn dohull.pop()

hull.push(p)return hull

11

Page 25: Convex hulls & Chan's algorithm

Canwe do better?

So far:

→ Jarvis’s march: O(nh)→ Graham’s scan: O(n log n)

→ How do we compare their complexity?

→ We would like to do even better!

Can we get to O(n log h)?

12

Page 26: Convex hulls & Chan's algorithm

Canwe do better?

So far:→ Jarvis’s march: O(nh)

→ Graham’s scan: O(n log n)

→ How do we compare their complexity?

→ We would like to do even better!

Can we get to O(n log h)?

12

Page 27: Convex hulls & Chan's algorithm

Canwe do better?

So far:→ Jarvis’s march: O(nh)→ Graham’s scan: O(n log n)

→ How do we compare their complexity?

→ We would like to do even better!

Can we get to O(n log h)?

12

Page 28: Convex hulls & Chan's algorithm

Canwe do better?

So far:→ Jarvis’s march: O(nh)→ Graham’s scan: O(n log n)

→ How do we compare their complexity?

→ We would like to do even better!

Can we get to O(n log h)?

12

Page 29: Convex hulls & Chan's algorithm

Canwe do better?

So far:→ Jarvis’s march: O(nh)→ Graham’s scan: O(n log n)

→ How do we compare their complexity?

→ We would like to do even better!

Can we get to O(n log h)?

12

Page 30: Convex hulls & Chan's algorithm

Canwe do better?

So far:→ Jarvis’s march: O(nh)→ Graham’s scan: O(n log n)

→ How do we compare their complexity?

→ We would like to do even better!

Can we get to O(n log h)?

12

Page 31: Convex hulls & Chan's algorithm

chan's 2d algorithm

Page 32: Convex hulls & Chan's algorithm

Chan's 2D algorithm

→ Idea: Some points will never be in the hull!Discard them to speed up Jarvis’s march.

→ Combine Jarvis’s march and Graham’s scan.

→ Algorithm (Chan 2D):

→ Split the n points in groups of sizem(⌈n/m⌉ groups).

→ Compute the hull Hi of each groupCost: O((n/m) · (m log m)) = O(n log m)

→ Until the hull is complete, repeat:

→ Given the current hull Htot = {h0, . . . , hcurr},find for each Hi the point right tangent tohcurr (binary search, O(log m)⌈n/m⌉).

→ Pick the tangent point p that maximizes∠hcurr−1hcurrp.

14

Page 33: Convex hulls & Chan's algorithm

Chan's 2D algorithm

→ Idea: Some points will never be in the hull!Discard them to speed up Jarvis’s march.

→ Combine Jarvis’s march and Graham’s scan.

→ Algorithm (Chan 2D):

→ Split the n points in groups of sizem(⌈n/m⌉ groups).

→ Compute the hull Hi of each groupCost: O((n/m) · (m log m)) = O(n log m)

→ Until the hull is complete, repeat:

→ Given the current hull Htot = {h0, . . . , hcurr},find for each Hi the point right tangent tohcurr (binary search, O(log m)⌈n/m⌉).

→ Pick the tangent point p that maximizes∠hcurr−1hcurrp.

14

Page 34: Convex hulls & Chan's algorithm

Chan's 2D algorithm

→ Idea: Some points will never be in the hull!Discard them to speed up Jarvis’s march.

→ Combine Jarvis’s march and Graham’s scan.

→ Algorithm (Chan 2D):→ Split the n points in groups of sizem

(⌈n/m⌉ groups).

→ Compute the hull Hi of each groupCost: O((n/m) · (m log m)) = O(n log m)

→ Until the hull is complete, repeat:

→ Given the current hull Htot = {h0, . . . , hcurr},find for each Hi the point right tangent tohcurr (binary search, O(log m)⌈n/m⌉).

→ Pick the tangent point p that maximizes∠hcurr−1hcurrp.

14

Page 35: Convex hulls & Chan's algorithm

Chan's 2D algorithm

→ Idea: Some points will never be in the hull!Discard them to speed up Jarvis’s march.

→ Combine Jarvis’s march and Graham’s scan.

→ Algorithm (Chan 2D):→ Split the n points in groups of sizem

(⌈n/m⌉ groups).→ Compute the hull Hi of each group

Cost: O((n/m) · (m log m)) = O(n log m)

→ Until the hull is complete, repeat:

→ Given the current hull Htot = {h0, . . . , hcurr},find for each Hi the point right tangent tohcurr (binary search, O(log m)⌈n/m⌉).

→ Pick the tangent point p that maximizes∠hcurr−1hcurrp.

14

Page 36: Convex hulls & Chan's algorithm

Chan's 2D algorithm

→ Idea: Some points will never be in the hull!Discard them to speed up Jarvis’s march.

→ Combine Jarvis’s march and Graham’s scan.

→ Algorithm (Chan 2D):→ Split the n points in groups of sizem

(⌈n/m⌉ groups).→ Compute the hull Hi of each group

Cost: O((n/m) · (m log m)) = O(n log m)→ Until the hull is complete, repeat:

→ Given the current hull Htot = {h0, . . . , hcurr},find for each Hi the point right tangent tohcurr (binary search, O(log m)⌈n/m⌉).

→ Pick the tangent point p that maximizes∠hcurr−1hcurrp.

14

Page 37: Convex hulls & Chan's algorithm

Chan's 2D algorithm

→ Idea: Some points will never be in the hull!Discard them to speed up Jarvis’s march.

→ Combine Jarvis’s march and Graham’s scan.

→ Algorithm (Chan 2D):→ Split the n points in groups of sizem

(⌈n/m⌉ groups).→ Compute the hull Hi of each group

Cost: O((n/m) · (m log m)) = O(n log m)→ Until the hull is complete, repeat:

→ Given the current hull Htot = {h0, . . . , hcurr},find for each Hi the point right tangent tohcurr (binary search, O(log m)⌈n/m⌉).

→ Pick the tangent point p that maximizes∠hcurr−1hcurrp.

14

Page 38: Convex hulls & Chan's algorithm

Chan's 2D algorithm

→ Idea: Some points will never be in the hull!Discard them to speed up Jarvis’s march.

→ Combine Jarvis’s march and Graham’s scan.

→ Algorithm (Chan 2D):→ Split the n points in groups of sizem

(⌈n/m⌉ groups).→ Compute the hull Hi of each group

Cost: O((n/m) · (m log m)) = O(n log m)→ Until the hull is complete, repeat:

→ Given the current hull Htot = {h0, . . . , hcurr},find for each Hi the point right tangent tohcurr (binary search, O(log m)⌈n/m⌉).

→ Pick the tangent point p that maximizes∠hcurr−1hcurrp.

14

Page 39: Convex hulls & Chan's algorithm

One step, visually

Figure: A step of Chan’s algorithm. In blue, the existinghull, in orange, the tangents, in red, the new edge thatwill be added.

15

Page 40: Convex hulls & Chan's algorithm

Chan's 2D algorithm, part 2

Complexity: O(n log m+ (h(n/m)log m))

What aboutm? Let’s pretend the size h ofthe final hull is know.Withm = h, we get complexityO(n log h+ (h(n/h)log h)) = O(n log h)But h is not known!

→ Reiterate the algorithm, withm = 22i

→ Iteration cost: O(n log H) = O(n2i)→ O

(∑⌈log log h⌉i=1 n2i

)= O(n2⌈log log h⌉+1) = O(n log h)

16

Page 41: Convex hulls & Chan's algorithm

Chan's 2D algorithm, part 2

Complexity: O(n log m+ (h(n/m)log m))

What aboutm? Let’s pretend the size h ofthe final hull is know.

Withm = h, we get complexityO(n log h+ (h(n/h)log h)) = O(n log h)But h is not known!

→ Reiterate the algorithm, withm = 22i

→ Iteration cost: O(n log H) = O(n2i)→ O

(∑⌈log log h⌉i=1 n2i

)= O(n2⌈log log h⌉+1) = O(n log h)

16

Page 42: Convex hulls & Chan's algorithm

Chan's 2D algorithm, part 2

Complexity: O(n log m+ (h(n/m)log m))

What aboutm? Let’s pretend the size h ofthe final hull is know.Withm = h, we get complexityO(n log h+ (h(n/h)log h)) = O(n log h)

But h is not known!

→ Reiterate the algorithm, withm = 22i

→ Iteration cost: O(n log H) = O(n2i)→ O

(∑⌈log log h⌉i=1 n2i

)= O(n2⌈log log h⌉+1) = O(n log h)

16

Page 43: Convex hulls & Chan's algorithm

Chan's 2D algorithm, part 2

Complexity: O(n log m+ (h(n/m)log m))

What aboutm? Let’s pretend the size h ofthe final hull is know.Withm = h, we get complexityO(n log h+ (h(n/h)log h)) = O(n log h)But h is not known!

→ Reiterate the algorithm, withm = 22i

→ Iteration cost: O(n log H) = O(n2i)→ O

(∑⌈log log h⌉i=1 n2i

)= O(n2⌈log log h⌉+1) = O(n log h)

16

Page 44: Convex hulls & Chan's algorithm

Chan's 2D algorithm, part 2

Complexity: O(n log m+ (h(n/m)log m))

What aboutm? Let’s pretend the size h ofthe final hull is know.Withm = h, we get complexityO(n log h+ (h(n/h)log h)) = O(n log h)But h is not known!→ Reiterate the algorithm, withm = 22

i

→ Iteration cost: O(n log H) = O(n2i)→ O

(∑⌈log log h⌉i=1 n2i

)= O(n2⌈log log h⌉+1) = O(n log h)

16

Page 45: Convex hulls & Chan's algorithm

Chan's 2D algorithm, part 2

Complexity: O(n log m+ (h(n/m)log m))

What aboutm? Let’s pretend the size h ofthe final hull is know.Withm = h, we get complexityO(n log h+ (h(n/h)log h)) = O(n log h)But h is not known!→ Reiterate the algorithm, withm = 22

i

→ Iteration cost: O(n log H) = O(n2i)

→ O(∑⌈log log h⌉

i=1 n2i)= O(n2⌈log log h⌉+1) = O(n log h)

16

Page 46: Convex hulls & Chan's algorithm

Chan's 2D algorithm, part 2

Complexity: O(n log m+ (h(n/m)log m))

What aboutm? Let’s pretend the size h ofthe final hull is know.Withm = h, we get complexityO(n log h+ (h(n/h)log h)) = O(n log h)But h is not known!→ Reiterate the algorithm, withm = 22

i

→ Iteration cost: O(n log H) = O(n2i)→ O

(∑⌈log log h⌉i=1 n2i

)= O(n2⌈log log h⌉+1) = O(n log h)

16

Page 47: Convex hulls & Chan's algorithm

Chan's 2D pseudo-code

Algorithm 3: ChanHullStep, a step of Chan’salgorithmInput: a list S of bidimensional points, the parametersm,HOutput: the convex hull of the set, sorted counterclockwise, or an empty list, if H

is < hPartition S into subsets S1, . . . , S⌈n/m⌉.for i = 1, . . . , ⌈n/m⌉ do

Compute the convex hull of Si by using Graham Scan, store the output in acounter-clockwise sorted list.

p0 = (0,−∞)p1 = the leftmost point of S.for k = 1, . . . , H do

for i = 1, . . . , ⌈n/m⌉ doCompute the points qi ∈ S that maximizes ∠pk−1pkqi, with qi ̸= pk, byperforming binary search on the vertices of the partial hull Si.

pk+1 = the point q ∈ {q1, . . . , q⌈n/m⌉}.if pk+1 = pt then return {p1, . . . , pk}

return incomplete

17

Page 48: Convex hulls & Chan's algorithm

Chan's 2D pseudo-code, reprise

Algorithm 4: Chan’s algorithmInput: a list S of bidimensional pointsOutput: the convex hull of the setfor i = 1, 2, . . . do

L = ChanHullStep(S, m, H), wherem = H = min{|S|, 22i}if L ̸= incomplete then return L

18

Page 49: Convex hulls & Chan's algorithm

Chan's 2D - Empirical analysisIs a real implementation O(n log h)?Test 1: fixed hull size (1000), increasing number ofpoints.

0

10

20

30

40

5050

000

1000

00

1500

00

2000

00

Number of Points

Exe

cutio

n tim

e [s

ec]

Linear Model Real Data

19

Page 50: Convex hulls & Chan's algorithm

Chan's 2D - Empirical analysisIs a real implementation O(n log h)?Test 2: fixed number of points (40000), increasinghull size.

8

9

10

1150

00

1000

0

1500

0

2000

0

Size of the Hull

Exe

cutio

n tim

e [s

ec]

Logarithmic Model Real Data

20

Page 51: Convex hulls & Chan's algorithm

chan's 3d algorithm

Page 52: Convex hulls & Chan's algorithm

Chan's 3D algorithm

→ Idea: The structure of the algorithm doesn’tchange, just the ingredients.

Given a set S of n points with an hull of size h:→ Jarvis's march −→ Chand and Kapur's gift

wrapping - O(nh).→ Graham's scan −→ Preparata and Hong 3D

Algorithm - O(n log n).→ Finding tangents in 2D −→ Supporting planes

in 3D with Dobkin-Kirkpatrick hierarchy -O(log n).

The overall complexity is still O(n log h).

22

Page 53: Convex hulls & Chan's algorithm

Chan's 3D algorithm

→ Idea: The structure of the algorithm doesn’tchange, just the ingredients.

Given a set S of n points with an hull of size h:

→ Jarvis's march −→ Chand and Kapur's giftwrapping - O(nh).

→ Graham's scan −→ Preparata and Hong 3DAlgorithm - O(n log n).

→ Finding tangents in 2D −→ Supporting planesin 3D with Dobkin-Kirkpatrick hierarchy -O(log n).

The overall complexity is still O(n log h).

22

Page 54: Convex hulls & Chan's algorithm

Chan's 3D algorithm

→ Idea: The structure of the algorithm doesn’tchange, just the ingredients.

Given a set S of n points with an hull of size h:→ Jarvis's march −→ Chand and Kapur's gift

wrapping - O(nh).

→ Graham's scan −→ Preparata and Hong 3DAlgorithm - O(n log n).

→ Finding tangents in 2D −→ Supporting planesin 3D with Dobkin-Kirkpatrick hierarchy -O(log n).

The overall complexity is still O(n log h).

22

Page 55: Convex hulls & Chan's algorithm

Chan's 3D algorithm

→ Idea: The structure of the algorithm doesn’tchange, just the ingredients.

Given a set S of n points with an hull of size h:→ Jarvis's march −→ Chand and Kapur's gift

wrapping - O(nh).→ Graham's scan −→ Preparata and Hong 3D

Algorithm - O(n log n).

→ Finding tangents in 2D −→ Supporting planesin 3D with Dobkin-Kirkpatrick hierarchy -O(log n).

The overall complexity is still O(n log h).

22

Page 56: Convex hulls & Chan's algorithm

Chan's 3D algorithm

→ Idea: The structure of the algorithm doesn’tchange, just the ingredients.

Given a set S of n points with an hull of size h:→ Jarvis's march −→ Chand and Kapur's gift

wrapping - O(nh).→ Graham's scan −→ Preparata and Hong 3D

Algorithm - O(n log n).→ Finding tangents in 2D −→ Supporting planes

in 3D with Dobkin-Kirkpatrick hierarchy -O(log n).

The overall complexity is still O(n log h).

22

Page 57: Convex hulls & Chan's algorithm

Chan's 3D algorithm

→ Idea: The structure of the algorithm doesn’tchange, just the ingredients.

Given a set S of n points with an hull of size h:→ Jarvis's march −→ Chand and Kapur's gift

wrapping - O(nh).→ Graham's scan −→ Preparata and Hong 3D

Algorithm - O(n log n).→ Finding tangents in 2D −→ Supporting planes

in 3D with Dobkin-Kirkpatrick hierarchy -O(log n).

The overall complexity is still O(n log h).

22

Page 58: Convex hulls & Chan's algorithm

Chan's 3D algorithm

→ 3D Gift wrapping

→ Pick an edge ej of a face f of the partial hull.→ Find p that maximizes the angle between f and

the new face given by ej and p. Repeat for the 3edges of f.

→ Use breadth first visit to build the entire hull.→ Preparata and Hong 3D algorithm, a

divide-and-conquer algorithm for convexhulls

→ Split the set of points S in S1 and S2.→ Recursively split until the base case, then build

the convex hull.→ Merge the partial hulls.

23

Page 59: Convex hulls & Chan's algorithm

Chan's 3D algorithm

→ 3D Gift wrapping→ Pick an edge ej of a face f of the partial hull.

→ Find p that maximizes the angle between f andthe new face given by ej and p. Repeat for the 3edges of f.

→ Use breadth first visit to build the entire hull.→ Preparata and Hong 3D algorithm, a

divide-and-conquer algorithm for convexhulls

→ Split the set of points S in S1 and S2.→ Recursively split until the base case, then build

the convex hull.→ Merge the partial hulls.

23

Page 60: Convex hulls & Chan's algorithm

Chan's 3D algorithm

→ 3D Gift wrapping→ Pick an edge ej of a face f of the partial hull.→ Find p that maximizes the angle between f and

the new face given by ej and p. Repeat for the 3edges of f.

→ Use breadth first visit to build the entire hull.→ Preparata and Hong 3D algorithm, a

divide-and-conquer algorithm for convexhulls

→ Split the set of points S in S1 and S2.→ Recursively split until the base case, then build

the convex hull.→ Merge the partial hulls.

23

Page 61: Convex hulls & Chan's algorithm

Chan's 3D algorithm

→ 3D Gift wrapping→ Pick an edge ej of a face f of the partial hull.→ Find p that maximizes the angle between f and

the new face given by ej and p. Repeat for the 3edges of f.

→ Use breadth first visit to build the entire hull.

→ Preparata and Hong 3D algorithm, adivide-and-conquer algorithm for convexhulls

→ Split the set of points S in S1 and S2.→ Recursively split until the base case, then build

the convex hull.→ Merge the partial hulls.

23

Page 62: Convex hulls & Chan's algorithm

Chan's 3D algorithm

→ 3D Gift wrapping→ Pick an edge ej of a face f of the partial hull.→ Find p that maximizes the angle between f and

the new face given by ej and p. Repeat for the 3edges of f.

→ Use breadth first visit to build the entire hull.→ Preparata and Hong 3D algorithm, a

divide-and-conquer algorithm for convexhulls

→ Split the set of points S in S1 and S2.→ Recursively split until the base case, then build

the convex hull.→ Merge the partial hulls.

23

Page 63: Convex hulls & Chan's algorithm

Chan's 3D algorithm

→ 3D Gift wrapping→ Pick an edge ej of a face f of the partial hull.→ Find p that maximizes the angle between f and

the new face given by ej and p. Repeat for the 3edges of f.

→ Use breadth first visit to build the entire hull.→ Preparata and Hong 3D algorithm, a

divide-and-conquer algorithm for convexhulls→ Split the set of points S in S1 and S2.

→ Recursively split until the base case, then buildthe convex hull.

→ Merge the partial hulls.

23

Page 64: Convex hulls & Chan's algorithm

Chan's 3D algorithm

→ 3D Gift wrapping→ Pick an edge ej of a face f of the partial hull.→ Find p that maximizes the angle between f and

the new face given by ej and p. Repeat for the 3edges of f.

→ Use breadth first visit to build the entire hull.→ Preparata and Hong 3D algorithm, a

divide-and-conquer algorithm for convexhulls→ Split the set of points S in S1 and S2.→ Recursively split until the base case, then build

the convex hull.

→ Merge the partial hulls.

23

Page 65: Convex hulls & Chan's algorithm

Chan's 3D algorithm

→ 3D Gift wrapping→ Pick an edge ej of a face f of the partial hull.→ Find p that maximizes the angle between f and

the new face given by ej and p. Repeat for the 3edges of f.

→ Use breadth first visit to build the entire hull.→ Preparata and Hong 3D algorithm, a

divide-and-conquer algorithm for convexhulls→ Split the set of points S in S1 and S2.→ Recursively split until the base case, then build

the convex hull.→ Merge the partial hulls.

23

Page 66: Convex hulls & Chan's algorithm

Chan's 3D algorithm→ To find supporting planes, store each partial

hull as a Dobkin-Kirkpatrick hierarchy

→ Sequence P0, . . . , Pk of increasingly smallerapproximations of a polyhedron P = P0.

→ Build Pi+1 from Pi by picking a maximal set ofindependent vertices of Pi.

→ Overall, building the hierarchies takes O(n).

→ Finding supporting planes in 3D

→ Goal: given an edge ej and the DK hierarchy of apartial hull Hi, find the plane passing through ejand tangent to Hi in pt.

→ Find pt in constant time in Pk→ Step up in the hierarchy: if pt changes, it will

move to a neighbour (constant time check).→ The DK hierarchy has O(log m) height.

24

Page 67: Convex hulls & Chan's algorithm

Chan's 3D algorithm→ To find supporting planes, store each partial

hull as a Dobkin-Kirkpatrick hierarchy→ Sequence P0, . . . , Pk of increasingly smaller

approximations of a polyhedron P = P0.

→ Build Pi+1 from Pi by picking a maximal set ofindependent vertices of Pi.

→ Overall, building the hierarchies takes O(n).

→ Finding supporting planes in 3D

→ Goal: given an edge ej and the DK hierarchy of apartial hull Hi, find the plane passing through ejand tangent to Hi in pt.

→ Find pt in constant time in Pk→ Step up in the hierarchy: if pt changes, it will

move to a neighbour (constant time check).→ The DK hierarchy has O(log m) height.

24

Page 68: Convex hulls & Chan's algorithm

Chan's 3D algorithm→ To find supporting planes, store each partial

hull as a Dobkin-Kirkpatrick hierarchy→ Sequence P0, . . . , Pk of increasingly smaller

approximations of a polyhedron P = P0.→ Build Pi+1 from Pi by picking a maximal set of

independent vertices of Pi.

→ Overall, building the hierarchies takes O(n).

→ Finding supporting planes in 3D

→ Goal: given an edge ej and the DK hierarchy of apartial hull Hi, find the plane passing through ejand tangent to Hi in pt.

→ Find pt in constant time in Pk→ Step up in the hierarchy: if pt changes, it will

move to a neighbour (constant time check).→ The DK hierarchy has O(log m) height.

24

Page 69: Convex hulls & Chan's algorithm

Chan's 3D algorithm→ To find supporting planes, store each partial

hull as a Dobkin-Kirkpatrick hierarchy→ Sequence P0, . . . , Pk of increasingly smaller

approximations of a polyhedron P = P0.→ Build Pi+1 from Pi by picking a maximal set of

independent vertices of Pi.→ Overall, building the hierarchies takes O(n).

→ Finding supporting planes in 3D

→ Goal: given an edge ej and the DK hierarchy of apartial hull Hi, find the plane passing through ejand tangent to Hi in pt.

→ Find pt in constant time in Pk→ Step up in the hierarchy: if pt changes, it will

move to a neighbour (constant time check).→ The DK hierarchy has O(log m) height.

24

Page 70: Convex hulls & Chan's algorithm

Chan's 3D algorithm→ To find supporting planes, store each partial

hull as a Dobkin-Kirkpatrick hierarchy→ Sequence P0, . . . , Pk of increasingly smaller

approximations of a polyhedron P = P0.→ Build Pi+1 from Pi by picking a maximal set of

independent vertices of Pi.→ Overall, building the hierarchies takes O(n).

→ Finding supporting planes in 3D

→ Goal: given an edge ej and the DK hierarchy of apartial hull Hi, find the plane passing through ejand tangent to Hi in pt.

→ Find pt in constant time in Pk→ Step up in the hierarchy: if pt changes, it will

move to a neighbour (constant time check).→ The DK hierarchy has O(log m) height.

24

Page 71: Convex hulls & Chan's algorithm

Chan's 3D algorithm→ To find supporting planes, store each partial

hull as a Dobkin-Kirkpatrick hierarchy→ Sequence P0, . . . , Pk of increasingly smaller

approximations of a polyhedron P = P0.→ Build Pi+1 from Pi by picking a maximal set of

independent vertices of Pi.→ Overall, building the hierarchies takes O(n).

→ Finding supporting planes in 3D→ Goal: given an edge ej and the DK hierarchy of a

partial hull Hi, find the plane passing through ejand tangent to Hi in pt.

→ Find pt in constant time in Pk→ Step up in the hierarchy: if pt changes, it will

move to a neighbour (constant time check).→ The DK hierarchy has O(log m) height.

24

Page 72: Convex hulls & Chan's algorithm

Chan's 3D algorithm→ To find supporting planes, store each partial

hull as a Dobkin-Kirkpatrick hierarchy→ Sequence P0, . . . , Pk of increasingly smaller

approximations of a polyhedron P = P0.→ Build Pi+1 from Pi by picking a maximal set of

independent vertices of Pi.→ Overall, building the hierarchies takes O(n).

→ Finding supporting planes in 3D→ Goal: given an edge ej and the DK hierarchy of a

partial hull Hi, find the plane passing through ejand tangent to Hi in pt.

→ Find pt in constant time in Pk

→ Step up in the hierarchy: if pt changes, it willmove to a neighbour (constant time check).

→ The DK hierarchy has O(log m) height.

24

Page 73: Convex hulls & Chan's algorithm

Chan's 3D algorithm→ To find supporting planes, store each partial

hull as a Dobkin-Kirkpatrick hierarchy→ Sequence P0, . . . , Pk of increasingly smaller

approximations of a polyhedron P = P0.→ Build Pi+1 from Pi by picking a maximal set of

independent vertices of Pi.→ Overall, building the hierarchies takes O(n).

→ Finding supporting planes in 3D→ Goal: given an edge ej and the DK hierarchy of a

partial hull Hi, find the plane passing through ejand tangent to Hi in pt.

→ Find pt in constant time in Pk→ Step up in the hierarchy: if pt changes, it will

move to a neighbour (constant time check).

→ The DK hierarchy has O(log m) height.

24

Page 74: Convex hulls & Chan's algorithm

Chan's 3D algorithm→ To find supporting planes, store each partial

hull as a Dobkin-Kirkpatrick hierarchy→ Sequence P0, . . . , Pk of increasingly smaller

approximations of a polyhedron P = P0.→ Build Pi+1 from Pi by picking a maximal set of

independent vertices of Pi.→ Overall, building the hierarchies takes O(n).

→ Finding supporting planes in 3D→ Goal: given an edge ej and the DK hierarchy of a

partial hull Hi, find the plane passing through ejand tangent to Hi in pt.

→ Find pt in constant time in Pk→ Step up in the hierarchy: if pt changes, it will

move to a neighbour (constant time check).→ The DK hierarchy has O(log m) height.

24

Page 75: Convex hulls & Chan's algorithm

THANK YOU!

Page 76: Convex hulls & Chan's algorithm

References I

[1] C. Bradford Barber, David P. Dobkin, and Huhdanpaa Hannu.The quickhull algorithm for convex hulls.1995.

[2] T. M. Chan.Optimal output-sensitive convex hull algorithms in two and threedimensions.Discrete & Computational Geometry, 16(4):361–368, 1996.

[3] Donald R. Chand and Sham S. Kapur.

[4] Ioannis Z. Emiris and John F. Canny.An efficient approach to removing geometric degeneracies.Technical report, 1991.

[5] Christer Ericson.Real-Time Collision Detection.CRC Press, Inc., Boca Raton, FL, USA, 2004.

[6] A. Goshtasby and G. C. Stockman.Point pattern matching using convex hull edges.IEEE Transactions on Systems, Man, and Cybernetics, SMC-15(5), 1985.

26

Page 77: Convex hulls & Chan's algorithm

References II

[7] David G. Kirkpatrick and Raimund Seidel.The ultimate planar convex hull algorithm ?Technical report, 1983.

[8] Joseph O’Rourke.Computational Geometry in C.Cambridge University Press, 2nd edition, 1998.

[9] F. P. Preparata and S. J. Hong.Convex hulls of finite sets of points in two and three dimensions.Commun. ACM, 20(2):87–93, February 1977.

[10] Franco P. Preparata and Michael I. Shamos.Computational Geometry: An Introduction.Springer-Verlag New York, Inc., 1985.

[11] Franco P. Preparata and Michael I. Shamos.Computational Geometry: An Introduction.Springer-Verlag New York, Inc., 1985.

Beamer theme: Presento, by Ratul Saha. The research system in Germany, byHazem Alsaied

27