Optimal Finger Search Trees in the Pointer Machine Gerth Stlting - - PowerPoint PPT Presentation

optimal finger search trees in the pointer machine
SMART_READER_LITE
LIVE PREVIEW

Optimal Finger Search Trees in the Pointer Machine Gerth Stlting - - PowerPoint PPT Presentation

Optimal Finger Search Trees in the Pointer Machine Gerth Stlting Brodal BRICS University of Aarhus George Lagogiannis Christos Makris Athanasios Tsakalidis Kostas Tsichlas University of Patras Dagstuhl seminar on Data Structures,


slide-1
SLIDE 1

Optimal Finger Search Trees in the Pointer Machine

Gerth Stølting Brodal

BRICS

University of Aarhus

George Lagogiannis Christos Makris Athanasios Tsakalidis Kostas Tsichlas

University of Patras

Dagstuhl seminar on “Data Structures”, March 1, 2002

slide-2
SLIDE 2

Finger Search Trees

1 2 4 8 10 13 16 17 19 22 23 25 26 29 31 32 35 37 39

✻ p1 ❄ Insert(p1, 3) ✻ p2 Delete(p2) ✻ p3 ✻ Search(p3, 36)

  • d = 8

Gerth Stølting Brodal Optimal Finger Search Trees in The Pointer Machine

1

slide-3
SLIDE 3

Finger Search Trees

1 2 4 8 10 13 16 17 19 22 23 25 26 29 31 32 35 37 39

✻ p1 ❄ Insert(p1, 3) ✻ p2 Delete(p2) ✻ p3 ✻ Search(p3, 36)

  • d = 8

Insert, Delete O(1) Search O(log d)

1 2 3 4

❄ Ω(2h)        h ✻ p Search(p, 24)

1 2 4 8 10 13 16 17 19 22 23 25 26 29 31 32 35 37 39

Huddleston, Mehlhorn ’82

Gerth Stølting Brodal Optimal Finger Search Trees in The Pointer Machine

1

slide-4
SLIDE 4

Finger Search Trees

1 2 4 8 10 13 16 17 19 22 23 25 26 29 31 32 35 37 39

✻ p1 ❄ Insert(p1, 3) ✻ p2 Delete(p2) ✻ p3 ✻ Search(p3, 36)

  • d = 8

Insert, Delete O(1) Amortized Search O(log d)

1 2 3 4

❄ Ω(2h)        h ✻ p Search(p, 24)

1 2 4 8 10 13 16 17 19 22 23 25 26 29 31 32 35 37 39

Huddleston, Mehlhorn ’82

Gerth Stølting Brodal Optimal Finger Search Trees in The Pointer Machine

1

slide-5
SLIDE 5

History

Insert Delete Search AVL-trees, (2,3)-trees a) log n log n Red-black-trees, (2,4)-trees a) 1b) log n Levcopoulos, Overmars ’88 a) 1 log n Guibas et al. ’77, Tsakalidis ’85 a) 1c) log d Harel, Lucker ’79 a) log∗ n log d Huddleston, Mehlhorn ’82 a) 1b) log d Brodal ’98 a) 1 log∗ n log d This talk a) 1 log d Dietz, Raman ’94 d) 1 log d Andersson, Thorup ’00 e) 1

  • log d

log log d a)Pointer machine b)Amortized c) O(1) movable fingers d)Comparison RAM e)Word RAM

Gerth Stølting Brodal Optimal Finger Search Trees in The Pointer Machine

2

slide-6
SLIDE 6

This Talk

Insert O(1) Delete O(1) Search O(log d) Worst-case Pointer machine

  • Level dependent degrees (Andersson ’96)
  • Components (Brodal ’96)
  • Multi-split and multi-join
  • Incremental (pre)processing

Gerth Stølting Brodal Optimal Finger Search Trees in The Pointer Machine

3

slide-7
SLIDE 7

Level Dependent Degrees

1 2 3 1 2 4 8 10 13 16 17 19 22 23 25 26 29 31 32 35 37 39

  • Level i nodes (except root) have degree [ ai : ai3 ]
  • Each node represented by Levcopoulos, Overmars ’88

Gerth Stølting Brodal Optimal Finger Search Trees in The Pointer Machine

4

slide-8
SLIDE 8

Level Dependent Degrees

1 2 3

Ω h

i=1 ai

  • h

❄ ✻ p Search(p, 24)

1 2 4 8 10 13 16 17 19 22 23 25 26 29 31 32 35 37 39

  • Level i nodes (except root) have degree [ ai : ai3 ]
  • Each node represented by Levcopoulos, Overmars ’88
  • Search O(

h+1

i=1 log ai) = O(log d) if ah+1 = aO(1) h

Gerth Stølting Brodal Optimal Finger Search Trees in The Pointer Machine

4

slide-9
SLIDE 9

Components

✻ p ✠rebalance

1 2 4 8 10 13 16 17 19 22 23 25 26 29 31 32 35 37 39

  • Mechanisme to identify where to rebalance
  • Components = partition of internal nodes into subtrees

Gerth Stølting Brodal Optimal Finger Search Trees in The Pointer Machine

5

slide-10
SLIDE 10

Components

✻ p ✠rebalance

1 2 4 8 10 13 16 17 19 22 23 25 26 29 31 32 35 37 39

  • Mechanisme to identify where to rebalance
  • Components = partition of internal nodes into subtrees

✛link(v)

v r

break(r)

link(v)

Gerth Stølting Brodal Optimal Finger Search Trees in The Pointer Machine

5

slide-11
SLIDE 11

Components

✻ p ✠rebalance

1 2 4 8 10 13 16 17 19 22 23 25 26 29 31 32 35 37 39

  • Mechanisme to identify where to rebalance
  • Components = partition of internal nodes into subtrees
  • component records with root pointers (nil if singleton)

✛link(v)

v r

break(r)

link(v)

Gerth Stølting Brodal Optimal Finger Search Trees in The Pointer Machine

5

slide-12
SLIDE 12

Updates

Insert(p, e) r = component root create-leaf(p, e) break(r) rebalance(r) Delete(p) r = component root remove-leaf(p) break(r) rebalance(r)

r r p

?

rebalance(r) break(r)

Gerth Stølting Brodal Optimal Finger Search Trees in The Pointer Machine

6

slide-13
SLIDE 13

rebalance(r)

degree(r) > 3ai2

  • link(r)
  • split r into at most ai nodes of degree [ai2 : 3ai2]

. . . . . .

r multi-split(r)

degree(r) < ai2

  • ∀v ∈ G : break(v), G total degree [ai2 : 3ai2]
  • fusion r with all nodes in G
  • link(r)

r multi-fusion(r) fusion group G

Gerth Stølting Brodal Optimal Finger Search Trees in The Pointer Machine

7

slide-14
SLIDE 14

Proof of Degree [ai : ai3]

Assumption : Nodes at level i − 1 have degree [ai−1 : ai−13] ≤ ai3

  • split at level i − 1 generates ≤ ai−1 nodes
  • degree at level i ≤ 3ai2 · ai−12 ≤ ai3

. . . . . . . . .

≤ 3ai2 ≤ 3ai2 · ai−1 ≤ 3ai2 · ai−12 ≤ 3ai2 ≤ 3ai2

  • ≥ ai
  • fusion at level i − 1 fusions ≤ 3ai−1 nodes
  • degree at level i ≥ ai2/(3ai−1)2 = ai

ai = 9 · ai−12

Gerth Stølting Brodal Optimal Finger Search Trees in The Pointer Machine

8

slide-15
SLIDE 15

Incremental Processing

. . . . . . . . . . . . . . . block . . . . . . new/old node group . . . . . .

  • ld/new node

Internal representation of a node

  • Blocks (pairs of)
  • Nodes (pairs of)
  • Splitting groups
  • Fusion groups (pairs of)
  • Fusion/splitting group records

Gerth Stølting Brodal Optimal Finger Search Trees in The Pointer Machine

9

slide-16
SLIDE 16

Conclusion and Open Problems

Insert O(1) Delete O(1) Search O(log d) Worst-case Pointer machine

  • Simpler construction ?
  • Direct binary tree solution ?
  • (a, b)-trees with worst-case update time ?
  • Components usefull for deamortization of other structures ?

Gerth Stølting Brodal Optimal Finger Search Trees in The Pointer Machine

10