21
Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa [email protected] 1

Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa [email protected] 1

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Overmars and van Leeuwen(1981)Algorithm

For online convex hull computation

Michal [email protected]

1

Page 2: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Contents

• Dynamic convex hull• Algorithmic approach• Data structure• Challenges• Example• Conclusion• Questions?

2

Page 3: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Convex hull• Smallest convex set, which is superset of given set.

• Convex set: Set of points:∀u,v∈A, k ∈ <0,1>: u.k+v(1-k) ∈ A,

• We are looking for boundary

3

Page 4: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Algorithm properties

• Online construction• Dynamic convex hull• Point removal – must store all the points in convenient way– Could be done by reconstructing whole structure from scratch (expensive)

• 2D only• Query in O( lg(n)), Update in O( lg2(n))

4

Page 5: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Construction• Solve upper(UH) and lower(LH) convex hull separately

• Final CH is union of UH and LH

• Construction is symmetric

ymin

ymax

5

Page 6: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Data structure – Binary tree• Each interior node of the tree represents UH

• Only leaves are pointsBridge

[g, h]

• Each node keeps information about points of CH, which are not in parent CH.

• Concatenable queue(also tree, insert,delete,find,concat,cut in lg(n))

• Queue in root contains all points of upper(lower) convex hull

[d]

[Q1⋃Q4]

h

d

g

Q1

Q4

13

Page 7: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Data structure – Binary tree

[1] {128}

7

Page 8: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Construction ‐ Bridging• Bridging problem• From two distinct CH create one.

• Apply binary search on both CH

[1] {127}

[1] {127}67

Page 9: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Update• Add and delete, Similar operations

• Algorithm:– Descend (Splitting)

– Update– Ascend (reconstruct)

[g, h]

hd

g

[d]

[Q1⋃Q4]

Q1

[g, h, Q4]

h

d g

[Q1 ,d]

Q4

Descend

Ascend

Nope

Page 10: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Update

11 4 3 129 61 7 82 510

[2]

[11,4,1,5,12]

[7]

[10]

[6][8]

[][]

[][]

[3, 9]

• Add and delete, Similar operations

10

• Example inspired by   [1] {131}

Page 11: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Update

11 4 3 129 61 7 82 510

[2]

[11,4,1,5,12]

[7]

[10]

[6][8]

[][]

[][]

[3, 9]

• Add and delete, Similar operations

carrot

Page 12: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Update

11 4 3 129 61 7 82 510

[2, 5, 12][11,4,1,7]

[10]

[6][8]

[][]

[][]

[3, 9]

12

Page 13: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Update

11 4 3 129 61 7 82 510

[11,4,1,7]

[6][8]

[5,12][]

[][]

[3, 9]

13

Hello

Page 14: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Update

11 4 3 129 61 7 82 510

[11,4,1,7]

[6][8]

[5,12][]

[][]

[3, 9]

13

[10,13]

14

Page 15: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Update

11 4 3 129 61 7 82 510

[11,4,1,7]

[2,13]

[6][8]

[5,12][]

[][]

[3, 9]

13

[10]

π

Page 16: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Update

11 4 3 129 61 7 82 510

[11,4,1,7]

[]

[6][8]

[5][]

[][]

[3, 9]

13

[10]

[2,13, 12]

16

Page 17: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Update

11 4 3 129 61 7 82 510

[7]

[]

[6][8]

[5][]

[][]

[3, 9]

13

[10]

[2]

[11,4,1,13,12]

17

Done

Page 18: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Complexity

• Add and delete are almost the same• Descending: log(n)• Update: 1• Ascend and reconstruction: log(n)* log(k)

• Ascend + Bridging,  k<n

• Query: O(log(n))• Update: O(log2(n))• Build: O(n. log2(n))     !• Space: O(n)

18

Page 19: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

• Unsurpassed until T. M. Chan. Dynamic planar convex hull operations in near‐logarithmic amortized time(log(1+ε)(n)) – after 20 years

• Current optimal algorithm have log(n) update time.(Brodal,Jacob), [3]

666

Page 20: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

Pseudo‐code

[1] {131}20

Page 21: Overmars and van Leeuwen(1981) Algorithm · Overmars and van Leeuwen(1981) Algorithm For online convex hull computation Michal Fuksa fuksamic@fel.cvut.cz 1

References

• [1] Computational Geometry, An Introduction: Franco P. Preparata, Michael Ian Shamos {1985}

• [2] Time‐Space Optimal Convex Hull Algorithms, Hla Min, S. Q. Zheng

• [3] Dynamic Planar Convex Hull, Gerth StøltingBrodal, Riko Jacob

42