• Keine Ergebnisse gefunden

• Computaitonal model, input and output

N/A
N/A
Protected

Academic year: 2021

Aktie "• Computaitonal model, input and output"

Copied!
109
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Convex hulls in R

3

S´ andor Kisfaludi-Bak

Computaional Geometry Summer semester 2020

(2)

Overview

• Computaitonal model, input and output

(3)

Overview

• Computaitonal model, input and output

• Preparata–Hong divide&conquer algorithm (1977)

(4)

Overview

• Computaitonal model, input and output

• Preparata–Hong divide&conquer algorithm (1977)

• Clarkson–Shor randomized incremental construction (1989)

(5)

Overview

• Computaitonal model, input and output

• Chan’s algorithm in R

3

(1996)

• Preparata–Hong divide&conquer algorithm (1977)

• Clarkson–Shor randomized incremental construction (1989)

(6)

Overview

• Computaitonal model, input and output

• Chan’s algorithm in R

3

(1996)

• Preparata–Hong divide&conquer algorithm (1977)

• Clarkson–Shor randomized incremental construction (1989)

• Higher-dimensional convex hulls

(7)

Convex hull: input and output

Input: Points with coordianate pairs (x, y, z ) ∈ R

3

(e, π, 1), (3, 3, √

5), (2.95, 2.9, 2

1.2

), ( √

11, 3.05, √

3

3)

(8)

Convex hull: input and output

Input: Points with coordianate pairs (x, y, z ) ∈ R

3

(e, π, 1), (3, 3, √

5), (2.95, 2.9, 2

1.2

), ( √

11, 3.05, √

3

3)

Output: planar graph of the vertices and edges of conv(P )

(9)

Convex hull: input and output

Input: Points with coordianate pairs (x, y, z ) ∈ R

3

(e, π, 1), (3, 3, √

5), (2.95, 2.9, 2

1.2

), ( √

11, 3.05, √

3

3)

Output: planar graph of the vertices and edges of conv(P )

p

1

p

2

p

3

p

4

p

1

p

2

p

3

p

4

Doubly connected edge list, facets are ccw cycles from outside arcs know: opposite, next, prev arc

e

Opp(e) N ext(e)

P rev(e)

(10)

Convex hull: complexity

(11)

Convex hull: complexity

• Euler’s formula: h − #(edges) + #(f aces) = 2.

Claim A convex hull with h vertices has complexity O(h).

(12)

Convex hull: complexity

• Euler’s formula: h − #(edges) + #(f aces) = 2.

• Each face has ≥ 3 incident edges.

Each edge is incident to 2 faces.

2 · #(edges) ≥ 3 · #(f aces)

Claim A convex hull with h vertices has complexity O(h).

(13)

Convex hull: complexity

• Euler’s formula: h − #(edges) + #(f aces) = 2.

• Each face has ≥ 3 incident edges.

Each edge is incident to 2 faces.

2 · #(edges) ≥ 3 · #(f aces)

⇒ #(edges) = h + #(f aces) − 2

≤ h + 2

3 #(edges) − 2

Claim A convex hull with h vertices has complexity O(h).

(14)

Convex hull: complexity

• Euler’s formula: h − #(edges) + #(f aces) = 2.

• Each face has ≥ 3 incident edges.

Each edge is incident to 2 faces.

2 · #(edges) ≥ 3 · #(f aces)

⇒ #(edges) = h + #(f aces) − 2

≤ h + 2

3 #(edges) − 2

⇒ #(edges) ≤ 3h − 6

Claim A convex hull with h vertices has complexity O(h).

(15)

Convex hull: complexity

• Euler’s formula: h − #(edges) + #(f aces) = 2.

• Each face has ≥ 3 incident edges.

Each edge is incident to 2 faces.

2 · #(edges) ≥ 3 · #(f aces)

⇒ #(edges) = h + #(f aces) − 2

≤ h + 2

3 #(edges) − 2

⇒ #(edges) ≤ 3h − 6

Total complexity (vertices+edges): ≤ 4h − 6 = O(h).

Claim A convex hull with h vertices has complexity O(h).

(16)

Basic operation and naive approach

Suppose no 3 pts on one line, no 4 pts in one plane.

(17)

p

00

Basic operation and naive approach

Suppose no 3 pts on one line, no 4 pts in one plane.

p p

0

q

In O(1) time, decide if q is above/below/on plane pp

0

p

00

(18)

p

00

Basic operation and naive approach

Suppose no 3 pts on one line, no 4 pts in one plane.

p p

0

q

In O(1) time, decide if q is above/below/on plane pp

0

p

00

p

1

p

2

p

3

1 p

01

p

02

p

03

1 p

001

p

002

p

003

1 q

1

q

2

q

3

1

(19)

p

00

Basic operation and naive approach

Suppose no 3 pts on one line, no 4 pts in one plane.

p p

0

q

In O(1) time, decide if q is above/below/on plane pp

0

p

00

Running time:

n3

· (n − 3) · O(1) = O(n

4

) Naive Convex Hull in R

3

For each p, p

0

, p

00

∈ P ,

check if all q ∈ P \ {p, p

0

, p

00

} is on same side of plane pp

0

p

00

. If yes, then pp

0

p

00

is a face.

p

1

p

2

p

3

1 p

01

p

02

p

03

1 p

001

p

002

p

003

1 q

1

q

2

q

3

1

(20)

R 3 convex hull with divide and conquer

(Preparata–Hong, 1977)

(21)

Divide and conquer

(p

1

, . . . , p

n

) = LexicographicSort (P ) H = Hull3dim ((p

1

, . . . , p

n

)

function Hull3dim ((p

1

, . . . , p

n

)) if n ≤ 4 then

return NaiveHull ((p

1

, . . . , p

n

)) H

1

= Hull3dim ((p

1

, . . . , p

bn/2c

)) H

2

= Hull3dim ((p

bn/2c+1

, . . . , p

n

)) H = Merge (H

1

, H

2

)

return H

(22)

Divide and conquer

(p

1

, . . . , p

n

) = LexicographicSort (P ) H = Hull3dim ((p

1

, . . . , p

n

)

function Hull3dim ((p

1

, . . . , p

n

)) if n ≤ 4 then

return NaiveHull ((p

1

, . . . , p

n

)) H

1

= Hull3dim ((p

1

, . . . , p

bn/2c

)) H

2

= Hull3dim ((p

bn/2c+1

, . . . , p

n

)) H = Merge (H

1

, H

2

)

return H

O(n log n)

(23)

Divide and conquer

(p

1

, . . . , p

n

) = LexicographicSort (P ) H = Hull3dim ((p

1

, . . . , p

n

)

function Hull3dim ((p

1

, . . . , p

n

)) if n ≤ 4 then

return NaiveHull ((p

1

, . . . , p

n

)) H

1

= Hull3dim ((p

1

, . . . , p

bn/2c

)) H

2

= Hull3dim ((p

bn/2c+1

, . . . , p

n

)) H = Merge (H

1

, H

2

)

return H

O(n log n)

T (n) = 2T (n/2) + O(n)

Recursion depth= O(log n) ⇒ T (n) = O(n log n)

(24)

Divide and conquer

(p

1

, . . . , p

n

) = LexicographicSort (P ) H = Hull3dim ((p

1

, . . . , p

n

)

function Hull3dim ((p

1

, . . . , p

n

)) if n ≤ 4 then

return NaiveHull ((p

1

, . . . , p

n

)) H

1

= Hull3dim ((p

1

, . . . , p

bn/2c

)) H

2

= Hull3dim ((p

bn/2c+1

, . . . , p

n

)) H = Merge (H

1

, H

2

)

return H

O(n log n)

T (n) = 2T (n/2) + O(n)

Recursion depth= O(log n) ⇒ T (n) = O(n log n)

We need to merge in O(n) time!

(25)

Starting the merge

H

1

H

2

x y

z

(26)

Starting the merge

H

1

H

2

x y

z

Project H

1

and H

2

to xy plane

Get common tangents (as in Assignment 1/7) → O(n)

(27)

Starting the merge

H

1

H

2

x y

z

Project H

1

and H

2

to xy plane

Get common tangents (as in Assignment 1/7) → O(n)

π(pi) π(pj)

π(p

i

)π(p

j

) is segment of π(conv(H

1

)) ∪ π(conv(H

2

))

⇒ p

i

p

j

is a segment of conv(P ).

pi

pj

(28)

Merging naively

p0

Find q ∈ P s.t. plane pp0q has smallest angle with plane pp0π(p).

p

(29)

Merging naively

p0

Find q ∈ P s.t. plane pp0q has smallest angle with plane pp0π(p).

p

q

(30)

Merging naively

p0

Find q ∈ P s.t. plane pp0q has smallest angle with plane pp0π(p).

Last face found:Fi, last edge found: ei Repeat: Find p ∈ P maximizing ^

(plane eip), (plane Fi) p

Fi q ei

(31)

Merging naively

p0

Find q ∈ P s.t. plane pp0q has smallest angle with plane pp0π(p).

Last face found:Fi, last edge found: ei Repeat: Find p ∈ P maximizing ^

(plane eip), (plane Fi) p

q

(32)

Merging naively

p0

Find q ∈ P s.t. plane pp0q has smallest angle with plane pp0π(p).

Last face found:Fi, last edge found: ei Repeat: Find p ∈ P maximizing ^

(plane eip), (plane Fi) p

q

(33)

Merging naively

p0

Find q ∈ P s.t. plane pp0q has smallest angle with plane pp0π(p).

Last face found:Fi, last edge found: ei Repeat: Find p ∈ P maximizing ^

(plane eip), (plane Fi) p

q

(34)

Merging naively

p0

Find q ∈ P s.t. plane pp0q has smallest angle with plane pp0π(p).

Last face found:Fi, last edge found: ei Repeat: Find p ∈ P maximizing ^

(plane eip), (plane Fi) p

q

→ O(n)

Naive runtime: O(n2)

The result is a “cylinder”.

(35)

ei

Smart merge idea

maxp∈P ^

(plane uvp), (plane Fi)

→ p must be neighbor of u or v u

Fi v

(36)

ei

Smart merge idea

maxp∈P ^

(plane uvp), (plane Fi)

→ p must be neighbor of u or v u

Fi v

Maximize in N(u) and N(v) separately.

Let p0 ∈ N(v) s.t. vp0 ∈ conv(P) is already known

v

p

0

= v

1

v

2

v

3

v

4

v

5

(37)

ei

Smart merge idea

maxp∈P ^

(plane uvp), (plane Fi)

→ p must be neighbor of u or v u

Fi v

Maximize in N(u) and N(v) separately.

Let p0 ∈ N(v) s.t. vp0 ∈ conv(P) is already known

v

p

0

= v

1

v

2

v

3

v

4

v

5

Check angles of N (v ) in cw order.

(38)

ei

Smart merge idea

maxp∈P ^

(plane uvp), (plane Fi)

→ p must be neighbor of u or v u

Fi v

Maximize in N(u) and N(v) separately.

Let p0 ∈ N(v) s.t. vp0 ∈ conv(P) is already known

v

p

0

= v

1

v

2

v

3

v

4

v

5

Check angles of N (v ) in cw order.

If v

i

∈ p has largest angle

⇒ v

2

, . . . , v

i−1

are inside conv(P )!

= p

(39)

Smart merge

function Merge(H1, H2)

uv = starting edge (form common tangent of π(H1) and π(H2)) ˆ

u = argmaxu0∈N(u) ^ uvu0, uvπ(u) ˆ

v = argmaxv0∈N(v) ^ uvv0, uvπ(u) repeat

if vˆ has larger angle than uˆ then vprev = v, v = ˆv

Add face F = uvvprev to H

If F is coplanar with previous face, merge.

for i = 2 to |N(v)| do . in cw order if ^ uvvi, uvvprev

> ^ uvvi−1, uvvprev

then Remove edge vvi−1 from H2

else ˆ

v = vi−1, Break else

(same, but swap v and u, H2 and H1, cw and ccw) until uv = starting edge

return merge of cylinder H with H1 and H2

(40)

Smart merge

function Merge(H1, H2)

uv = starting edge (form common tangent of π(H1) and π(H2)) ˆ

u = argmaxu0∈N(u) ^ uvu0, uvπ(u) ˆ

v = argmaxv0∈N(v) ^ uvv0, uvπ(u) repeat

if vˆ has larger angle than uˆ then vprev = v, v = ˆv

Add face F = uvvprev to H

If F is coplanar with previous face, merge.

for i = 2 to |N(v)| do . in cw order if ^ uvvi, uvvprev

> ^ uvvi−1, uvvprev

then Remove edge vvi−1 from H2

else ˆ

v = vi−1, Break else

(same, but swap v and u, H2 and H1, cw and ccw) until uv = starting edge

return merge of cylinder H with H1 and H2

init

Step Face add

Cylinder merge

(41)

Smart merge analysis

Init: O(n)

Face add: O (1) (overall O(n))

(42)

Smart merge analysis

Init: O(n)

Face add: O (1) (overall O(n))

Step: Each comparison results in either

→ deleting an edge

→ making the step

(43)

Smart merge analysis

Init: O(n)

Face add: O (1) (overall O(n))

Step: Each comparison results in either

→ deleting an edge

→ making the step

H

1

, H

2

have O(n) edges Final cylinder has size O(n)

⇒ Amortized O (1) (overall O(n)) time.

(44)

Smart merge analysis

Init: O(n)

Face add: O (1) (overall O(n))

Step: Each comparison results in either

→ deleting an edge

→ making the step

H

1

, H

2

have O(n) edges Final cylinder has size O(n)

⇒ Amortized O (1) (overall O(n)) time.

Cylinder merge: O(1) time per cylinder boundary edge.

Boundary has size O(n).

(45)

Smart merge analysis

Init: O(n)

Face add: O (1) (overall O(n))

Step: Each comparison results in either

→ deleting an edge

→ making the step

H

1

, H

2

have O(n) edges Final cylinder has size O(n)

⇒ Amortized O (1) (overall O(n)) time.

Cylinder merge: O(1) time per cylinder boundary edge.

Boundary has size O(n).

⇒ Merge takes O(n) time.

(46)

Smart merge analysis

Init: O(n)

Face add: O (1) (overall O(n))

Step: Each comparison results in either

→ deleting an edge

→ making the step

H

1

, H

2

have O(n) edges Final cylinder has size O(n)

⇒ Amortized O (1) (overall O(n)) time.

Cylinder merge: O(1) time per cylinder boundary edge.

Boundary has size O(n).

⇒ Merge takes O(n) time.

Preparata–Hong divide&conquer takes O(n log n) time.

(47)

R

3

Convex hull with rand. incremental construction

(Clarkson and Shor 1989)

(48)

Ideas

• Add points one at a time, update

H

i

= planar graph for conv(p

1

, . . . , p

i

).

(49)

Ideas

• Add points one at a time, update

H

i

= planar graph for conv(p

1

, . . . , p

i

).

• Maintain a conflict graph: C

i

p

i+1

p

n

unprocessed pts

faces of H

i

(50)

Ideas

• Add points one at a time, update

H

i

= planar graph for conv(p

1

, . . . , p

i

).

• Maintain a conflict graph: C

i

p

i+1

p

n

unprocessed pts

faces of H

i

Conflict edge from p

i+j

to face F of H

i

iff plane of F separates p

i+j

from conv(p

1

, . . . , p

i

) p

i+j

F

(51)

Ideas

• Add points one at a time, update

H

i

= planar graph for conv(p

1

, . . . , p

i

).

• Maintain a conflict graph: C

i

p

i+1

p

n

unprocessed pts

faces of H

i

Conflict edge from p

i+j

to face F of H

i

iff plane of F separates p

i+j

from conv(p

1

, . . . , p

i

) p

i+j

F

⇒ if we add p

i+j

, we must delete F

(52)

Algorithm overview

Find 4 points forming a tetrahedron, set up H

4

(53)

Algorithm overview

Find 4 points forming a tetrahedron, set up H

4

Randomly permute the other points: p

4

, . . . , p

n

, and set up C

4

n − 4 unproc. pts 4 faces ⇒ O(n)

(54)

Algorithm overview

Find 4 points forming a tetrahedron, set up H

4

Randomly permute the other points: p

4

, . . . , p

n

, and set up C

4

n − 4 unproc. pts 4 faces ⇒ O(n)

”Randomized incremental construction”

(55)

Algorithm overview

Find 4 points forming a tetrahedron, set up H

4

Randomly permute the other points: p

4

, . . . , p

n

, and set up C

4

n − 4 unproc. pts 4 faces ⇒ O(n)

”Randomized incremental construction”

p

i

Adding p

i

:

horizon

(56)

Algorithm overview

Find 4 points forming a tetrahedron, set up H

4

Randomly permute the other points: p

4

, . . . , p

n

, and set up C

4

n − 4 unproc. pts 4 faces ⇒ O(n)

”Randomized incremental construction”

p

i

Adding p

i

:

horizon

conflicting faces

new faces to add

(57)

Algorithm overview

Find 4 points forming a tetrahedron, set up H

4

Randomly permute the other points: p

4

, . . . , p

n

, and set up C

4

n − 4 unproc. pts 4 faces ⇒ O(n)

”Randomized incremental construction”

p

i

Adding p

i

:

horizon

conflicting faces

new faces to add → remove conflicting faces

using conflict graph

(58)

Algorithm overview

Find 4 points forming a tetrahedron, set up H

4

Randomly permute the other points: p

4

, . . . , p

n

, and set up C

4

n − 4 unproc. pts 4 faces ⇒ O(n)

”Randomized incremental construction”

p

i

Adding p

i

:

horizon

conflicting faces

new faces to add → remove conflicting faces using conflict graph

→ walk horizon and

add new faces

(59)

Algorithm overview

Find 4 points forming a tetrahedron, set up H

4

Randomly permute the other points: p

4

, . . . , p

n

, and set up C

4

n − 4 unproc. pts 4 faces ⇒ O(n)

”Randomized incremental construction”

p

i

Adding p

i

:

horizon

conflicting faces

new faces to add → remove conflicting faces using conflict graph

→ walk horizon and add new faces

if coplanar face:

merge faces.

same conflict list!

(60)

Updating conflict lists

• Remove p

i

from conflict graph

(61)

Updating conflict lists

• Remove p

i

from conflict graph

• Add new face F :

F p

i

horizon edge F

1

F

2

Conf (F ) ⊆ Conf (F

1

) ∪ Conf (F

2

)

e

(62)

Updating conflict lists

• Remove p

i

from conflict graph

• Add new face F :

F p

i

horizon edge F

1

F

2

Conf (F ) ⊆ Conf (F

1

) ∪ Conf (F

2

)

For each p ⊆ U

ie

that sees F , add conflict edge (F, p)

e

(63)

Running time analysis - lemmas

Theorem The Clarkson-Shor 3d convex hull algorithm works

in O(n log n) time.

(64)

Running time analysis - lemmas

Theorem The Clarkson-Shor 3d convex hull algorithm works in O(n log n) time.

Lemma The algo. creates at most 6n − 20 faces in

expectation.

(65)

Running time analysis - lemmas

Lemma We have

E

n

X

i=5

X

e∈horizon(i)

|U

ie

|

 = O(n log n).

Theorem The Clarkson-Shor 3d convex hull algorithm works in O(n log n) time.

Lemma The algo. creates at most 6n − 20 faces in

expectation.

(66)

Running time analysis - lemmas

Lemma We have

E

n

X

i=5

X

e∈horizon(i)

|U

ie

|

 = O(n log n).

Theorem The Clarkson-Shor 3d convex hull algorithm works in O(n log n) time.

Lemma The algo. creates at most 6n − 20 faces in expectation.

Long proof, see Dutch book

(67)

Lemma The algo. creates at most 6n − 20 faces in expectation.

Backwards analysis

(68)

Lemma The algo. creates at most 6n − 20 faces in expectation.

Backwards analysis

Imagine removing p

n

, then p

n−1

, . . . , p

5

from conv(P ). Fix i.

deg

i

(p) := degree of p in the convex hull of p

1

, . . . , p

i

(69)

Lemma The algo. creates at most 6n − 20 faces in expectation.

Backwards analysis

Imagine removing p

n

, then p

n−1

, . . . , p

5

from conv(P ). Fix i.

deg

i

(p) := degree of p in the convex hull of p

1

, . . . , p

i

• conv(p

1

, . . . , p

i

) has ≤ 3i − 6 edges

⇒ P

i

j=1

deg

i

(p

j

) ≤ 6i − 12.

(70)

Lemma The algo. creates at most 6n − 20 faces in expectation.

Backwards analysis

Imagine removing p

n

, then p

n−1

, . . . , p

5

from conv(P ). Fix i.

deg

i

(p) := degree of p in the convex hull of p

1

, . . . , p

i

• conv(p

1

, . . . , p

i

) has ≤ 3i − 6 edges

⇒ P

i

j=1

deg

i

(p

j

) ≤ 6i − 12.

• deg(p

1

) + deg(p

2

) + deg(p

3

) + deg(p

4

) ≥ 12

(71)

Lemma The algo. creates at most 6n − 20 faces in expectation.

Backwards analysis

Imagine removing p

n

, then p

n−1

, . . . , p

5

from conv(P ). Fix i.

deg

i

(p) := degree of p in the convex hull of p

1

, . . . , p

i

• conv(p

1

, . . . , p

i

) has ≤ 3i − 6 edges

⇒ P

i

j=1

deg

i

(p

j

) ≤ 6i − 12.

• deg(p

1

) + deg(p

2

) + deg(p

3

) + deg(p

4

) ≥ 12

• p

i

is a random element of {p

5

, . . . , p

i

}

E (deg

i

(p

i

)) =

P

i

j=5

deg(p

j

)

i − 4 ≤ 6i − 12 − 12

i − 4 = 6

(72)

Lemma The algo. creates at most 6n − 20 faces in expectation.

Backwards analysis

Imagine removing p

n

, then p

n−1

, . . . , p

5

from conv(P ). Fix i.

deg

i

(p) := degree of p in the convex hull of p

1

, . . . , p

i

• conv(p

1

, . . . , p

i

) has ≤ 3i − 6 edges

⇒ P

i

j=1

deg

i

(p

j

) ≤ 6i − 12.

• deg(p

1

) + deg(p

2

) + deg(p

3

) + deg(p

4

) ≥ 12

• p

i

is a random element of {p

5

, . . . , p

i

}

E (deg

i

(p

i

)) =

P

i

j=5

deg(p

j

)

i − 4 ≤ 6i − 12 − 12

i − 4 = 6

⇒ E (total #created faces) = 4 +

n

X

j=5

E (deg

j

(p

j

)) ≤ 6n − 20.

(73)

Chan’s algorithm in R 3

(74)

Chan’s algorithm recap and changes

P into size m groups P

j

(j = 1, . . . , dn/me)

Precompute each conv(P

j

) in O(m log m)

(75)

Chan’s algorithm recap and changes

P into size m groups P

j

(j = 1, . . . , dn/me) Precompute each conv(P

j

) in O(m log m) Run modified gift wrapping for m steps:

Find tangent q

j

in each P

j

in O(log m)

Wrap to largest angle tangent among q

j

(76)

Chan’s algorithm recap and changes

P into size m groups P

j

(j = 1, . . . , dn/me) Precompute each conv(P

j

) in O(m log m) Run modified gift wrapping for m steps:

Find tangent q

j

in each P

j

in O(log m) Wrap to largest angle tangent among q

j

i = 1, . . . , dlog log ne m = 22i

(77)

Chan’s algorithm recap and changes

P into size m groups P

j

(j = 1, . . . , dn/me) Precompute each conv(P

j

) in O(m log m) Run modified gift wrapping for m steps:

Find tangent q

j

in each P

j

in O(log m) Wrap to largest angle tangent among q

j

i = 1, . . . , dlog log ne m = 22i

Graham’s scan

Preparata–Hong

(78)

Chan’s algorithm recap and changes

P into size m groups P

j

(j = 1, . . . , dn/me) Precompute each conv(P

j

) in O(m log m) Run modified gift wrapping for m steps:

Find tangent q

j

in each P

j

in O(log m) Wrap to largest angle tangent among q

j

i = 1, . . . , dlog log ne m = 22i

Graham’s scan Preparata–Hong

Wrap done on edge e as in cylinder of Preparata–Hong BFS on faces: new face → find neighboring edges

BFS has |E (H

)| = |E (H )| ≤ 3h − 6 steps

(79)

Chan’s algorithm recap and changes

P into size m groups P

j

(j = 1, . . . , dn/me) Precompute each conv(P

j

) in O(m log m) Run modified gift wrapping for m steps:

Find tangent q

j

in each P

j

in O(log m) Wrap to largest angle tangent among q

j

i = 1, . . . , dlog log ne m = 22i

Graham’s scan Preparata–Hong

Wrap done on edge e as in cylinder of Preparata–Hong BFS on faces: new face → find neighboring edges

BFS has |E (H

)| = |E (H )| ≤ 3h − 6 steps

Needs Dobkin–Kirkpatrick hierarchical representation for P

j

→ computing in O(n) coming up!

(80)

Chan’s algorithm recap and changes

P into size m groups P

j

(j = 1, . . . , dn/me) Precompute each conv(P

j

) in O(m log m) Run modified gift wrapping for m steps:

Find tangent q

j

in each P

j

in O(log m) Wrap to largest angle tangent among q

j

i = 1, . . . , dlog log ne m = 22i

Graham’s scan Preparata–Hong

Wrap done on edge e as in cylinder of Preparata–Hong BFS on faces: new face → find neighboring edges

BFS has |E (H

)| = |E (H )| ≤ 3h − 6 steps

Needs Dobkin–Kirkpatrick hierarchical representation for P

j

→ computing in O(n) coming up!

3n − 6

(81)

Chan’s algorithm recap and changes

P into size m groups P

j

(j = 1, . . . , dn/me) Precompute each conv(P

j

) in O(m log m) Run modified gift wrapping for m steps:

Find tangent q

j

in each P

j

in O(log m) Wrap to largest angle tangent among q

j

i = 1, . . . , dlog log ne m = 22i

Graham’s scan Preparata–Hong

Wrap done on edge e as in cylinder of Preparata–Hong BFS on faces: new face → find neighboring edges

BFS has |E (H

)| = |E (H )| ≤ 3h − 6 steps

Needs Dobkin–Kirkpatrick hierarchical representation for P

j

→ computing in O(n) coming up!

3n − 6

Running time analysis remains unchanged. O(n log h)

(82)

Dobkin–Kirkpatrick hierarchy

Given convex polytope Q in R

3

, a polytope sequence Q

1

, Q

2

, . . . , Q

k

is a DK hierarchy of Q if

1. Q

1

= Q and Q

k

is a tetrahedron 2. Q

i

⊃ Q

i+1

and V (Q

i

) ⊃ V (Q

i+1

)

3. V (Q

i

) \ V (Q

i+1

) is an independent set in G(Q

i

).

(83)

Dobkin–Kirkpatrick hierarchy

Given convex polytope Q in R

3

, a polytope sequence Q

1

, Q

2

, . . . , Q

k

is a DK hierarchy of Q if

1. Q

1

= Q and Q

k

is a tetrahedron 2. Q

i

⊃ Q

i+1

and V (Q

i

) ⊃ V (Q

i+1

)

3. V (Q

i

) \ V (Q

i+1

) is an independent set in G(Q

i

).

Q = Q

1

(84)

Dobkin–Kirkpatrick hierarchy

Given convex polytope Q in R

3

, a polytope sequence Q

1

, Q

2

, . . . , Q

k

is a DK hierarchy of Q if

1. Q

1

= Q and Q

k

is a tetrahedron 2. Q

i

⊃ Q

i+1

and V (Q

i

) ⊃ V (Q

i+1

)

3. V (Q

i

) \ V (Q

i+1

) is an independent set in G(Q

i

).

Q = Q

1

(85)

Dobkin–Kirkpatrick hierarchy

Given convex polytope Q in R

3

, a polytope sequence Q

1

, Q

2

, . . . , Q

k

is a DK hierarchy of Q if

1. Q

1

= Q and Q

k

is a tetrahedron 2. Q

i

⊃ Q

i+1

and V (Q

i

) ⊃ V (Q

i+1

)

3. V (Q

i

) \ V (Q

i+1

) is an independent set in G(Q

i

).

Q

2

(86)

Dobkin–Kirkpatrick hierarchy

Given convex polytope Q in R

3

, a polytope sequence Q

1

, Q

2

, . . . , Q

k

is a DK hierarchy of Q if

1. Q

1

= Q and Q

k

is a tetrahedron 2. Q

i

⊃ Q

i+1

and V (Q

i

) ⊃ V (Q

i+1

)

3. V (Q

i

) \ V (Q

i+1

) is an independent set in G(Q

i

).

Q

2

(87)

Dobkin–Kirkpatrick hierarchy

Given convex polytope Q in R

3

, a polytope sequence Q

1

, Q

2

, . . . , Q

k

is a DK hierarchy of Q if

1. Q

1

= Q and Q

k

is a tetrahedron 2. Q

i

⊃ Q

i+1

and V (Q

i

) ⊃ V (Q

i+1

)

3. V (Q

i

) \ V (Q

i+1

) is an independent set in G(Q

i

).

Q

3

(88)

Dobkin–Kirkpatrick hierarchy

Given convex polytope Q in R

3

, a polytope sequence Q

1

, Q

2

, . . . , Q

k

is a DK hierarchy of Q if

1. Q

1

= Q and Q

k

is a tetrahedron 2. Q

i

⊃ Q

i+1

and V (Q

i

) ⊃ V (Q

i+1

)

3. V (Q

i

) \ V (Q

i+1

) is an independent set in G(Q

i

).

Q

3

(89)

Dobkin–Kirkpatrick hierarchy

Given convex polytope Q in R

3

, a polytope sequence Q

1

, Q

2

, . . . , Q

k

is a DK hierarchy of Q if

1. Q

1

= Q and Q

k

is a tetrahedron 2. Q

i

⊃ Q

i+1

and V (Q

i

) ⊃ V (Q

i+1

)

3. V (Q

i

) \ V (Q

i+1

) is an independent set in G(Q

i

).

Q

4

(90)

Dobkin–Kirkpatrick hierarchy

Given convex polytope Q in R

3

, a polytope sequence Q

1

, Q

2

, . . . , Q

k

is a DK hierarchy of Q if

1. Q

1

= Q and Q

k

is a tetrahedron 2. Q

i

⊃ Q

i+1

and V (Q

i

) ⊃ V (Q

i+1

)

3. V (Q

i

) \ V (Q

i+1

) is an independent set in G(Q

i

).

Q

4

(91)

Dobkin–Kirkpatrick hierarchy

Given convex polytope Q in R

3

, a polytope sequence Q

1

, Q

2

, . . . , Q

k

is a DK hierarchy of Q if

1. Q

1

= Q and Q

k

is a tetrahedron 2. Q

i

⊃ Q

i+1

and V (Q

i

) ⊃ V (Q

i+1

)

3. V (Q

i

) \ V (Q

i+1

) is an independent set in G(Q

i

).

Q

5

(92)

Theorem Given Q, a DK hierarchy with k = O(log n), size P

k

i=1

(|V (Q

i

)|) = O(n) and degree max

i

max{deg

G(Q

i)

(v ) | v ∈ V (Q

i

) \ V (Q

i+1

)} ≤ 11 can be computed in O (n) time.

Constructing the DK hierarchy

(93)

Theorem Given Q, a DK hierarchy with k = O(log n), size P

k

i=1

(|V (Q

i

)|) = O(n) and degree max

i

max{deg

G(Q

i)

(v ) | v ∈ V (Q

i

) \ V (Q

i+1

)} ≤ 11 can be computed in O (n) time.

Proof. Iteratively remove set S , a greedy maximal independent set among vertices of degree ≤ 11.

Claim: |S | ≥ |V (Q)|/24.

Suppose not: |S | < |V (Q)|/24

⇒ S

s∈S

N [s] < |V (Q)|/2

⇒ G(Q) has ≥ |V (Q)|/2 vertices of degree ≥ 12

⇒ G(Q) has ≥ (|V (Q)|/2) · 12/2 = 3|V (Q)| edges

Constructing the DK hierarchy

(94)

Theorem Given Q, a DK hierarchy with k = O(log n), size P

k

i=1

(|V (Q

i

)|) = O(n) and degree max

i

max{deg

G(Q

i)

(v ) | v ∈ V (Q

i

) \ V (Q

i+1

)} ≤ 11 can be computed in O (n) time.

Proof. Iteratively remove set S , a greedy maximal independent set among vertices of degree ≤ 11.

Claim: |S | ≥ |V (Q)|/24.

Suppose not: |S | < |V (Q)|/24

⇒ S

s∈S

N [s] < |V (Q)|/2

⇒ G(Q) has ≥ |V (Q)|/2 vertices of degree ≥ 12

⇒ G(Q) has ≥ (|V (Q)|/2) · 12/2 = 3|V (Q)| edges

Euler’s formula:

E (Q) ≤ 3|V (Q)|− 6 Euler’s formula:

E (Q) ≤ 3|V (Q)|− 6

Constructing the DK hierarchy

(95)

for i = 1 to dlog log(3n − 6)e do m = 2

2i

for j = 1 to dn/me do Create group P

j

H

j

=Preparata–Hong(P

j

)

Compute dual D–K hierarchy of H

j

F

0

= starting face, e

1

, e

2

, e

3

: ccw arcs of E (F ),

H.add(F

0

), Queue = (e

1

,e

2

,e

3

), Seen = {e

1

,e

2

,e

3

}, for s = 2 to m do

e = Queue.next

for j = 1 to dn/me do

q

j

= T angentF ind(e, dualDK (H

j

))

q = point q

j

maximizing ^ (plane e, q

j

), F (e)

H.add(face e, q), e

0

, e

00

= next arcs of face e, q

if e

0

6∈ Seen then Queue.add(e

0

), Seen.add(e

0

)

if e

00

6∈ Seen then Queue.add(e

00

), Seen.add(e

00

)

return H

(96)

for i = 1 to dlog log(3n − 6)e do m = 2

2i

for j = 1 to dn/me do Create group P

j

H

j

=Preparata–Hong(P

j

)

Compute dual D–K hierarchy of H

j

F

0

= starting face, e

1

, e

2

, e

3

: ccw arcs of E (F ),

H.add(F

0

), Queue = (e

1

,e

2

,e

3

), Seen = {e

1

,e

2

,e

3

}, for s = 2 to m do

e = Queue.next

for j = 1 to dn/me do

q

j

= T angentF ind(e, dualDK (H

j

))

q = point q

j

maximizing ^ (plane e, q

j

), F (e) H.add(face e, q), e

0

, e

00

= next arcs of face e, q if e

0

6∈ Seen then Queue.add(e

0

), Seen.add(e

0

) if e

00

6∈ Seen then Queue.add(e

00

), Seen.add(e

00

) return H

dn/me · O(m)

(97)

for i = 1 to dlog log(3n − 6)e do m = 2

2i

for j = 1 to dn/me do Create group P

j

H

j

=Preparata–Hong(P

j

)

Compute dual D–K hierarchy of H

j

F

0

= starting face, e

1

, e

2

, e

3

: ccw arcs of E (F ),

H.add(F

0

), Queue = (e

1

,e

2

,e

3

), Seen = {e

1

,e

2

,e

3

}, for s = 2 to m do

e = Queue.next

for j = 1 to dn/me do

q

j

= T angentF ind(e, dualDK (H

j

))

q = point q

j

maximizing ^ (plane e, q

j

), F (e) H.add(face e, q), e

0

, e

00

= next arcs of face e, q if e

0

6∈ Seen then Queue.add(e

0

), Seen.add(e

0

) if e

00

6∈ Seen then Queue.add(e

00

), Seen.add(e

00

) return H

dn/me · O(m)

Self-balancing BST

max size= h

(98)

Handling degeneracies

u

v e

F (e)

(99)

Handling degeneracies

u

v e

F (e)

Among Q = argmax

q0

^ F (e), (plane uvq

0

) q should maximze ^ (uvq )

and among these maximize dist(v, q)

(100)

Handling degeneracies

u

v e

F (e)

Among Q = argmax

q0

^ F (e), (plane uvq

0

) q should maximze ^ (uvq )

and among these maximize dist(v, q)

q

(101)

Handling degeneracies

u

v e

F (e)

Among Q = argmax

q0

^ F (e), (plane uvq

0

) q should maximze ^ (uvq )

and among these maximize dist(v, q)

q

(102)

Handling degeneracies

u

v e

F (e)

Among Q = argmax

q0

^ F (e), (plane uvq

0

) q should maximze ^ (uvq )

and among these maximize dist(v, q)

q

(103)

Handling degeneracies

u

v e

F (e)

Among Q = argmax

q0

^ F (e), (plane uvq

0

) q should maximze ^ (uvq )

and among these maximize dist(v, q)

q

H is a triangulation of the hull.

Postprocess: merge at edge if neighboring faces are coplanar

(→ O(n))

(104)

Higher-dimensional convex hulls

(105)

Many faces, many facets

In R

d

, we have 0, 1, . . . , (d − 1)-dimensional faces.

vertices edges facets

(106)

Many faces, many facets

In R

d

, we have 0, 1, . . . , (d − 1)-dimensional faces.

vertices edges facets

Given a set P of n points in R

d

, compute:

(a) all facets of conv(P )

(b) all vertices of conv(P )

(c) all faces of conv(P )

(107)

Many faces, many facets

In R

d

, we have 0, 1, . . . , (d − 1)-dimensional faces.

vertices edges facets

Given a set P of n points in R

d

, compute:

(a) all facets of conv(P ) (b) all vertices of conv(P ) (c) all faces of conv(P )

There can be up to Θ(n

bd/2c

) facets!

(108)

Many faces, many facets

In R

d

, we have 0, 1, . . . , (d − 1)-dimensional faces.

vertices edges facets

Given a set P of n points in R

d

, compute:

(a) all facets of conv(P ) (b) all vertices of conv(P ) (c) all faces of conv(P )

There can be up to Θ(n

bd/2c

) facets!

Let P be distinct points on the moment curve {(x, x

2

, x

3

, . . . , x

d

) | x ∈ R }.

Then conv(P ) has the maximum number of k-faces

for all k ∈ [d].

(109)

Many faces, many facets

In R

d

, we have 0, 1, . . . , (d − 1)-dimensional faces.

vertices edges facets

Given a set P of n points in R

d

, compute:

(a) all facets of conv(P ) (b) all vertices of conv(P ) (c) all faces of conv(P )

There can be up to Θ(n

bd/2c

) facets!

Let P be distinct points on the moment curve {(x, x

2

, x

3

, . . . , x

d

) | x ∈ R }.

Then conv(P ) has the maximum number of k-faces for all k ∈ [d].

O(n log n + n

bd/2c

) achieved by many algorithms

Referenzen

ÄHNLICHE DOKUMENTE

Views or opinions expressed herein do not necessarily represent those of the Institute, its National Member Organizations, or other organi- zations supporting the

Working Papers are interim reports on work of the International Institute for Applied Systems Analysis and have received only limited review. Views or opinions expressed herein

In this work, we present the Food and Agriculture Biomass Input Output model (FABIO), a global set of trade-linked PSUTs and PIOTs capturing detailed supply chain information for

An H -polyhedron is an intersection of finitely many closed half-spaces in

– R¨ ander haben entweder h¨ ochsten zwei Kreuzungen – Oder R¨ ander haben h¨ ochstens einen Ber¨ uhrpunkt... Umweg:

The TACTE (Time Anchoring Component for Textual Entailment) module was proposed by Wang and Zhang (2008). The basic process consists of three main steps: 1) extracting and

These are the two main requirements we are going to follow while designing our solution for data input and output – modularity of the functionality for handling different data

1 They reached three general conclusions: (1) employer discrimination is not consistent with perfect competition, although some forms of employee discrimination