CS468, Mon. Oct. 2nd, 2006
From S. Har-Peled’s notes, Chapter 2
Quadtrees: Hierarchical Grids Steve Oudot From S. Har-Peleds notes, - - PowerPoint PPT Presentation
CS468, Mon. Oct. 2nd, 2006 Quadtrees: Hierarchical Grids Steve Oudot From S. Har-Peleds notes, Chapter 2 Outline Examples and preliminary results. (deterministic) Static setting: compressed quadtrees. Dynamic setting:
From S. Har-Peled’s notes, Chapter 2
1
(deterministic) (randomized) (deterministic)
2
explain why quadtree can be interes
2
explain why quadtree can be interes
2
(0, 0)
explain why quadtree can be interes
2
(0, 0) (0, 0) (0.1, 0.1) (0, 0.1) (0.1, 0)
explain why quadtree can be interes
2
(0, 0) (0, 0) (0.1, 0.1) (0, 0.1) (0.1, 0) (0, 0.11) (0.01, 0.11) (0.1, 0.11) (0.11, 0.11) (0, 0.1) (0.01, 0.1) (0.1, 0.1) (0.11, 0.1) (0, 0.01) (0.01, 0.01) (0.1, 0.01) (0.11, 0.01) (0, 0) (0.01, 0) (0.1, 0) (0.11, 0)
explain why quadtree can be interes
2
(0, 0) (0, 0) (0.1, 0.1) (0, 0.1) (0.1, 0)
explain why quadtree can be interes
2
(0, 0) (0, 0) (0.1, 0.1) (0, 0.1) (0.1, 0)
node v cell v
2
(0, 0) (0, 0) (0.1, 0.1) (0, 0.1) (0.1, 0)
v ∈ L that contains q, then check tri- angles that intersect v. ⇒ size O(|L|), time O(h)
Q can we do better? regular grid : size Θ(22h), time O(1)
morally, we chop off the digits of qx and qy after the (i + 1)th →
the recursive lexico give example with q = (0.10101, 0.1101) → v0 = (0.1, 0 = O(log log n) if T balanced
2
(0, 0) (0, 0) (0.1, 0.1) (0, 0.1) (0.1, 0)
⇒ ∀i, vi(q) = ` 2−i⌊2iqx⌋, 2−i⌊2iqy⌋ ´
Let i = hmax+hmin /2; if vi(q) = NULL, then search between i and hmax; else search between hmin and i;
⇒ O(log h)
3
3
3
1 point per leaf (⇒ |P| leaves) ⇒ |T| ≤ h|L| = h|P|.
3
1 point per leaf (⇒ |P| leaves) ⇒ |T| ≤ h|L| = h|P|. Query: go from root to leaves, stopping each time r ∩ v = ∅. ⇒ O(|r ∩ T|) ≤ O(h|r ∩ L|)
4
Def ∀p, q ∈ P, let h(p, q) be the small- est i s.t. vi(p) = vi(q). Prop ∀p, q ∈ [0, 1]2, h(p, q) = min{−⌈log(px
.
∨qx)⌉, −⌈log(py
.
∨qy)⌉} ≤ min{−⌈log |px−qx|, −⌈log |py−qy|} = −⌈log max{|px − qx|, |py − qy|}⌉ ≤ −⌈log
1 √ 2d(p, q)⌉ = 1 2 − log d(p, q)
p(0.0111, 0.0101) q(0.1001, 0.0101)
Observation: for every internal node v
⇒ l(v) ≤ h(p, q) − 1, ∀p, q ∈ v ⇒ h ≤ 1
2 − log min{d(p, q)|p, q ∈ P}
≤ 3
2 + log Φ(P)
∀i, vi(p) = ` 2−i⌊2ipx⌋, 2−i⌊2ipy⌋ ´
4
p(0.0111, 0.0101) q(0.1001, 0.0101)
5
5
5
Since some nodes are missing along the path
5
6
7
7
2 ≤ ropt(P, k) contain
7
2 ⇒ |Pin| ≥ k 25 = |P | 250.
5 .
2 ≤ ropt(P, k) contain
7
2 ⇒ |Pin| ≥ k 25 = |P | 250.
5 .
2 ≤ ropt(P, k) contain
7
2 ⇒ |Pin| ≥ k 25 = |P | 250.
5 .
8
8
3 5 7 9 11 13 15 1 1 1 1 1 1 1 1
8
3 5 7 9 11 13 15
1 1 1 1 1 1 1 1
8
3 5 7
1 1 1 1 1 1 1 1
2 4 6 8
8
8
→ Construction time: O(|T| log |T|) = O(|P| log |P|). → Finger tree has same size as T and is balanced, hence its height is O(log |T|). ⇒ pt location time: O(log |T|).
9
9
9
9
9
|Si−1| 2
2E[|Si−1|] = · · · = 1 2i−1 E[|S1|] = |P | 2i−1 .
2k ≤ |P | 211 log |P | = 1 |P |10
1
1 |P |10 .
9
9
9
9
9
9
9
1 2|Uj | + |Uj| 2|Uj |−1 1 2 = 1+|Uj| 2|Uj | ≤ 1+j 2j .
j E[Vj] = P j j+1 2j
9
9
1 2 per
i i 2i = O(1).
9
10
[D. Eppstein, M. Goodrich, J. Sun, SCG 2005] (deterministic quadtrees)
Idea:
1, there are ≥ 1 and ≤ 3 cells in Li−1 between any consecutive cells of Li. ⇒ O(log |P|) layers.
Ti for Si → same order of Si in Li and Ti.
Li and Ti. L1 L2 ⇒ search, insertion, deletion times: O(log(n)).
[J. Munro, T. Papadakis, R. Sedgewick, SODA 1992] (deterministic skip-lists)
11
11
11
11
11
11
11
11
11
11
⇒ time: O(|P| log |P| + |output|)
12