1 the online labeling problem jan bulánek (institute of math, prague) martin babka (charles...

18
1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký (Institute of Math, Prague) Michael Saks (Rutgers University)

Upload: willis-mathews

Post on 08-Jan-2018

226 views

Category:

Documents


6 download

DESCRIPTION

Storing elements in the array … 14 Stream of n elements Array of size Θ(n) Gaps in the array Muze pohnout co chce

TRANSCRIPT

Page 1: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

1

The Online Labeling Problem

Jan Bulánek(Institute of Math, Prague)

Martin Babka (Charles University)Vladimír Čunát (Charles University)

Michal Koucký (Institute of Math, Prague)Michael Saks (Rutgers University)

Page 2: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

2

Sorted Arrays Basis of many algorithms Easy to work with

Dynamization?Online Labeling

Page 3: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

Storing elements in the array

3

12

3 1915117 12

1 -5 32 7… 14

Stream of n elements

Array of size Θ(n)

Gaps in the arrayMuze pohnout co chce

Page 4: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

4

Online labelingInput:

A stream of n numbers An array of size m

For the size Θ(n) File maintenance problem

Want: maintain a sorted array of all already seen items minimize the total number of item moves (cost)

Naïve solution O(n) per insertion

Page 5: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

ApplicationsMany applications, e.g.:

[Bender, Demaine, Farach-Colton ’00] Cache-oblivous B-trees

[Emek, Korman ’11] Distributed Controllers Lower bounds

5

Page 6: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

6

Linear array algorithm [Itai, Konheim, Rodeh ’81] O(log2 n) per insertion, amortized[Itai, Katriel ’07] Simpler algorithm

Basic ideas Small gaps Spread items evenly Density threshold function

Page 7: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

7

Algorithm for linear arrays – cont.How to find segment to rearrange

Too denseGood densityRearrange items evenly

Page 8: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

Array size (m) Amortized insertion costm=n O(log3 n) [Z 93]

m=Θ(n) O(log2 n) [IKR 81][W92, BCD+02]*m=n1+o(1) O( ) [IKR 81]m=n1+ℇ O(log n)m=nΩ(log n) O( ) [BKS 12]

9

Upper bounds

TIGHT!

!

Page 9: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

10

Lower Bounds[Zhang ’93] m=O(n) Ω(log2 n) per insertion, amortized Only smooth strategies

[Dietz, Seiferas, Zhang ’94] m=n1+Θ(1) Ω(log n) per insertion, amortized Proof contains a gap

Page 10: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

11

Lower Bounds – cont.[B., Koucký, Saks STOC’12] All strategies Uses some ideas from [Zhang 93]

m=n Ω(log3 n)m=Θ(n) Ω(log2 n)

Page 11: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

Lower Bounds – proof techniqueAdversary Generates input stream Reacts on the state of the array Inserts to dense areas

Only deterministic case

12

Page 12: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

13

Lower Bounds – cont.[Babka, B., Čunát, Koucký, Saks ESA’12] All strategies Fills the gap in [DSZ ’04] and extends their result Tight bounds for the bucketing game

m=n1+Θ(1) Ω()m=n1+Ω (1) Ω( )

Page 13: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

14

Lower Bounds – cont.[Babka, B., Čunát, Koucký, Saks 12, manuscript] All strategies Extends results of [BKS 12]

m=n1+o(1) Ω( )

Page 14: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

15

Lower Bounds – Sumary

Array size (m) Insertion cost

m=n+a(n) Ω(log2 n )m=cn Ω()m=n∙f(n)f(n)∊o(n) Ω( )m=ne(n)e(n)∊Ω(1) Ω( )

Page 15: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

Trivial for r<mLimited universe

16

m …

1 2 3 4 … r-1 rU

Page 16: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

Maybe easier for r small

Limited universe – cont.

17

3 4 …

1 2 3 4 … r-1 rU

Page 17: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

Limited universe – cont.

18

Page 18: 1 The Online Labeling Problem Jan Bulánek (Institute of Math, Prague) Martin Babka (Charles University) Vladimír Čunát (Charles University) Michal Koucký

Open problems Randomized algorithms? Limited universe m log n

19

The End!