57
Giulio Ermanno Pibiri University of Pisa and ISTI-CNR Pisa, Italy [email protected] 1 Dynamic Elias-Fano Representation 06/07/2017 Rossano Venturini University of Pisa and ISTI-CNR Pisa, Italy [email protected] The 28-th Annual Symposium on Combinatorial Pattern Matching (CPM 2017) Warsaw, Poland

Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Giulio Ermanno Pibiri University of Pisa and ISTI-CNR

Pisa, Italy [email protected]

1

Dynamic Elias-Fano Representation

06/07/2017

Rossano Venturini University of Pisa and ISTI-CNR

Pisa, Italy [email protected]

The 28-th Annual Symposium on Combinatorial Pattern Matching (CPM 2017)

Warsaw, Poland

Page 2: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

2

Introduction

A dynamic ordered set S is a data structure representing n objects and supporting the following operations: • Insert(x) inserts x in S

• Delete(x) deletes x from S

• Search(x) checks whether x belongs to S • Minimum() returns the minimum element of S • Maximum() returns the maximum element of S • Predecessor(x) returns max{y ∈ S : y < x}

• Successor(x) returns min{y ∈ S : y ≥ x}

Page 3: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

2

Introduction

A dynamic ordered set S is a data structure representing n objects and supporting the following operations: • Insert(x) inserts x in S

• Delete(x) deletes x from S

• Search(x) checks whether x belongs to S • Minimum() returns the minimum element of S • Maximum() returns the maximum element of S • Predecessor(x) returns max{y ∈ S : y < x}

• Successor(x) returns min{y ∈ S : y ≥ x}

In the comparison model this is solved optimally by any self-balancing tree data structure in O(log n) time and

O(n) space.

Page 4: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

2

Introduction

A dynamic ordered set S is a data structure representing n objects and supporting the following operations: • Insert(x) inserts x in S

• Delete(x) deletes x from S

• Search(x) checks whether x belongs to S • Minimum() returns the minimum element of S • Maximum() returns the maximum element of S • Predecessor(x) returns max{y ∈ S : y < x}

• Successor(x) returns min{y ∈ S : y ≥ x}

In the comparison model this is solved optimally by any self-balancing tree data structure in O(log n) time and

O(n) space.

More efficient solutions there exist if the considered objects are integers drawn from a bounded universe of size u.

Page 5: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

2

Introduction

A dynamic ordered set S is a data structure representing n objects and supporting the following operations: • Insert(x) inserts x in S

• Delete(x) deletes x from S

• Search(x) checks whether x belongs to S • Minimum() returns the minimum element of S • Maximum() returns the maximum element of S • Predecessor(x) returns max{y ∈ S : y < x}

• Successor(x) returns min{y ∈ S : y ≥ x}

ChallengeHow to optimally solve the integer dynamic ordered set problem in compressed space?

In the comparison model this is solved optimally by any self-balancing tree data structure in O(log n) time and

O(n) space.

More efficient solutions there exist if the considered objects are integers drawn from a bounded universe of size u.

Page 6: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

3

Motivation

Integer Data Structures

• van Emde Boas Trees• X/Y-Fast Tries• Fusion Trees• Exponential Search Trees• …

Elias-Fano Encoding• EF(S(n,u)) = n log(u/n) + 2n bits to

encode an ordered integer sequence S

• O(1) Access• O(1 + log(u/n)) Predecessor

Page 7: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

3

Motivation

Integer Data Structures

• van Emde Boas Trees• X/Y-Fast Tries• Fusion Trees• Exponential Search Trees• …

Elias-Fano Encoding• EF(S(n,u)) = n log(u/n) + 2n bits to

encode an ordered integer sequence S

• O(1) Access• O(1 + log(u/n)) Predecessor

space+ time -

dynamic+

Page 8: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

3

Motivation

Integer Data Structures

• van Emde Boas Trees• X/Y-Fast Tries• Fusion Trees• Exponential Search Trees• …

Elias-Fano Encoding• EF(S(n,u)) = n log(u/n) + 2n bits to

encode an ordered integer sequence S

• O(1) Access• O(1 + log(u/n)) Predecessor

space+ time -

dynamic+space+static-

+ time

Page 9: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

3

Motivation

Integer Data Structures

• van Emde Boas Trees• X/Y-Fast Tries• Fusion Trees• Exponential Search Trees• …

Elias-Fano Encoding• EF(S(n,u)) = n log(u/n) + 2n bits to

encode an ordered integer sequence S

• O(1) Access• O(1 + log(u/n)) Predecessor

space+ time -

dynamic+space+static-

+ time

Page 10: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

3

Motivation

Integer Data Structures

• van Emde Boas Trees• X/Y-Fast Tries• Fusion Trees• Exponential Search Trees• …

Elias-Fano Encoding• EF(S(n,u)) = n log(u/n) + 2n bits to

encode an ordered integer sequence S

• O(1) Access• O(1 + log(u/n)) Predecessor

space+ time -

dynamic+space+static-

+ time

?

Page 11: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

3

Motivation

Integer Data Structures

• van Emde Boas Trees• X/Y-Fast Tries• Fusion Trees• Exponential Search Trees• …

Elias-Fano Encoding• EF(S(n,u)) = n log(u/n) + 2n bits to

encode an ordered integer sequence S

• O(1) Access• O(1 + log(u/n)) Predecessor

space+ time -

dynamic+space+static-

+ time

Can we grab the best from both?

?

Page 12: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

4

Objectives

1. Predecessor

2. Access/Insert/Delete

Extend the static Elias-Fano representation of S as to support

in optimal time and using n log(u/n) + 2n bits

Page 13: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

4

Objectives

o(n) bits+

sublinear redundancy

1. Predecessor

2. Access/Insert/Delete

Extend the static Elias-Fano representation of S as to support

in optimal time and using n log(u/n) + 2n bits

Page 14: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

4

Objectives

o(n) bits+

sublinear redundancy

1. Predecessor

2. Access/Insert/Delete

Extend the static Elias-Fano representation of S as to support

in optimal time and using n log(u/n) + 2n bitsWhat is optimal?

Page 15: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

4

Objectives

o(n) bits+

sublinear redundancy

1. Predecessor

2. Access/Insert/Delete

Extend the static Elias-Fano representation of S as to support

in optimal time and using n log(u/n) + 2n bitsWhat is optimal?

Lower bounds

Page 16: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

1. [Patrascu and Thorup, STC 2007] • Optimal space/time trade-off

• m bits, where a = log(m/n) − log w

4

Objectives

o(n) bits+

sublinear redundancy

1. Predecessor

2. Access/Insert/Delete

Extend the static Elias-Fano representation of S as to support

in optimal time and using n log(u/n) + 2n bitsWhat is optimal?

Lower bounds

Page 17: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

1. [Patrascu and Thorup, STC 2007] • Optimal space/time trade-off

• m bits, where a = log(m/n) − log w

4

Objectives

o(n) bits+

sublinear redundancy

1. Predecessor

2. Access/Insert/Delete

Extend the static Elias-Fano representation of S as to support

in optimal time and using n log(u/n) + 2n bitsWhat is optimal?

Lower bounds

2. [Fredman and Saks, STC 1989] Dynamic List Representation Problem: • Access/Insert/Delete in Ω(log n / loglog n)

amortized time • w ≤ logγ n for some γ

Page 18: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

1. [Patrascu and Thorup, STC 2007] • Optimal space/time trade-off

• m bits, where a = log(m/n) − log w

4

Objectives

o(n) bits+

sublinear redundancy

1. Predecessor

2. Access/Insert/Delete

Extend the static Elias-Fano representation of S as to support

in optimal time and using n log(u/n) + 2n bitsWhat is optimal?

Lower bounds - polynomial universes

2. [Fredman and Saks, STC 1989] Dynamic List Representation Problem: • Access/Insert/Delete in Ω(log n / loglog n)

amortized time • w ≤ logγ n for some γ

Page 19: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

1. [Patrascu and Thorup, STC 2007] • Optimal space/time trade-off

• m bits, where a = log(m/n) − log w

4

Objectives

o(n) bits+

sublinear redundancy

1. Predecessor

2. Access/Insert/Delete

Extend the static Elias-Fano representation of S as to support

in optimal time and using n log(u/n) + 2n bits

For Elias-Fano, a = log(log(u/n) + 2) bits: the second branch becomes O(loglog n)

What is optimal?

Lower bounds - polynomial universes

2. [Fredman and Saks, STC 1989] Dynamic List Representation Problem: • Access/Insert/Delete in Ω(log n / loglog n)

amortized time • w ≤ logγ n for some γ

Page 20: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access• O(min{1+log(u/n), loglog n}) Predecessor

5

Results - Static Elias-Fano Optimal Predecessor Queries 1

Page 21: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access• O(min{1+log(u/n), loglog n}) Predecessor

S

EF(S(n,u)) = n log(u/n) + 2n bits

5

Results - Static Elias-Fano Optimal Predecessor Queries 1

Page 22: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access• O(min{1+log(u/n), loglog n}) Predecessor

S

EF(S(n,u)) = n log(u/n) + 2n bits

5

Results - Static Elias-Fano Optimal Predecessor Queries 1

log2 u

Page 23: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access• O(min{1+log(u/n), loglog n}) Predecessor

S

EF(S(n,u)) = n log(u/n) + 2n bits

5

Results - Static Elias-Fano Optimal Predecessor Queries 1

log2 uPredecessor in O(loglog n)

by binary search

Page 24: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access• O(min{1+log(u/n), loglog n}) Predecessor

S

EF(S(n,u)) = n log(u/n) + 2n bits

5

Results - Static Elias-Fano Optimal Predecessor Queries 1

log2 u

Y-fasttrie

Predecessor in O(loglog n) by binary search

Page 25: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access• O(min{1+log(u/n), loglog n}) Predecessor

S

EF(S(n,u)) = n log(u/n) + 2n bits

5

Results - Static Elias-Fano Optimal Predecessor Queries 1

log2 u

Y-fasttrie

Predecessor in O(loglog n) by binary search

Page 26: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access• O(min{1+log(u/n), loglog n}) Predecessor

S

EF(S(n,u)) = n log(u/n) + 2n bits

5

Results - Static Elias-Fano Optimal Predecessor Queries 1

log2 u

Y-fasttrie

O(loglog n)

Predecessor in O(loglog n) by binary search

Page 27: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access• O(min{1+log(u/n), loglog n}) Predecessor

S

EF(S(n,u)) = n log(u/n) + 2n bits

5

Results - Static Elias-Fano Optimal Predecessor Queries 1

log2 u

Y-fasttrie

O(loglog n)

Predecessor in O(loglog n) by binary search

O(n / log2 u) x O(log u)

o(n) bits

Page 28: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access• O(min{1+log(u/n), loglog n}) Predecessor

S

EF(S(n,u)) = n log(u/n) + 2n bits

5

Results - Static Elias-Fano Optimal Predecessor Queries 1

log2 u

Y-fasttrie

O(loglog n)

Predecessor in O(loglog n) by binary search

for the tiny range 1 ≤ γ ≤ 1 + loglog n / log n

O(n / log2 u) x O(log u)

o(n) bits

Page 29: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

6

Results - Extensible Elias-Fano 2

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access • O(1) Append (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 30: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

6

Results - Extensible Elias-Fano 2

log2 u

buffer

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access • O(1) Append (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 31: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

6

S

Results - Extensible Elias-Fano 2

log2 u

buffer

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access • O(1) Append (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 32: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

6

S

Results - Extensible Elias-Fano 2

log2 u

buffer

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access • O(1) Append (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 33: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

6

S

Results - Extensible Elias-Fano 2

log2 u

buffer

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access • O(1) Append (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 34: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

6

S

Results - Extensible Elias-Fano 2

log2 u

buffer

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access • O(1) Append (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 35: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

6

S

Results - Extensible Elias-Fano 2

log2 u

buffer

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access • O(1) Append (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 36: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

6

S

Results - Extensible Elias-Fano 2

log2 u

buffer

O(loglog n) Y-fasttrie

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access • O(1) Append (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 37: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

6

S

Results - Extensible Elias-Fano 2

log2 u

buffer

O(loglog n) Y-fasttrie

O(n / log2 u) x O(log u)

o(n) bits

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access • O(1) Append (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 38: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

6

S

Results - Extensible Elias-Fano 2

log2 u

buffer

O(loglog n) Y-fasttrie

EF(S(n,u)) = n log(u/n) + 2n bits

The encoding of the blocks takes≤ EF(S(n,u)) bits

O(n / log2 u) x O(log u)

o(n) bits

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access • O(1) Append (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 39: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

6

S

Results - Extensible Elias-Fano 2

log2 u

buffer

O(loglog n) Y-fasttrie

EF(S(n,u)) = n log(u/n) + 2n bits

The encoding of the blocks takes≤ EF(S(n,u)) bits

O(n / log2 u) x O(log u)

o(n) bits

S S1 S2

EF(S1) + EF(S2) ≤ EF(S)

Property

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(1) Access • O(1) Append (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 40: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Results - Dynamic Elias-Fano 3

7

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 41: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

7

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 42: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

block of log2 n

mini blocks

T

7

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 43: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

block of log2 n

mini blocks

T T T T

7

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 44: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

block of log2 n

mini blocks

T T T T lower levelT is a k-ary tree of constant height: • O(loglog n) time • O(log2 n loglog n) bits

7

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 45: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

block of log2 n

mini blocks

T T T T lower levelT is a k-ary tree of constant height: • O(loglog n) time • O(log2 n loglog n) bits

7

o(n) bits

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 46: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

Yblock of log2 n

mini blocks

T T T T lower levelT is a k-ary tree of constant height: • O(loglog n) time • O(log2 n loglog n) bits

7

o(n) bits

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 47: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

Yblock of log2 n

mini blocks

T T T T lower levelT is a k-ary tree of constant height: • O(loglog n) time • O(log2 n loglog n) bits

7

o(n) bits

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 48: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

Yblock of log2 n

mini blocks

T T T T lower levelT is a k-ary tree of constant height: • O(loglog n) time • O(log2 n loglog n) bits

7

o(n) bits

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 49: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

PYblock of

log2 n mini blocks

T T T T lower levelT is a k-ary tree of constant height: • O(loglog n) time • O(log2 n loglog n) bits

7

o(n) bits

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 50: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Y is an Y-fast trie • O(loglog n) time

P is a dynamic prefix-sums DS [1] • O(b) time

O(n / (b x log2 n)) x O(log u) = o(n) bits each

upper level

[1] Philip Bille, Patrick Hagge Cording, Inge Li Gørtz, Frederik Rye Skjoldjensen, Hjalte Wedel Vildhøj, and Søren Vind. Dynamic relative compression. CoRR, abs/1504.07851, 2015. [2] J. Jansson, K. Sadakane, and Wing-Kin Sung. CRAM: Compressed random access memory. ICALP 2012. [3] R. Raman, V. Raman, and S. Srinivasa Rao. Succinct dynamic data structures. WADS 2001.

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

PYblock of

log2 n mini blocks

T T T T lower levelT is a k-ary tree of constant height: • O(loglog n) time • O(log2 n loglog n) bits

7

o(n) bits

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 51: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Y is an Y-fast trie • O(loglog n) time

P is a dynamic prefix-sums DS [1] • O(b) time

O(n / (b x log2 n)) x O(log u) = o(n) bits each

upper level

[1] Philip Bille, Patrick Hagge Cording, Inge Li Gørtz, Frederik Rye Skjoldjensen, Hjalte Wedel Vildhøj, and Søren Vind. Dynamic relative compression. CoRR, abs/1504.07851, 2015. [2] J. Jansson, K. Sadakane, and Wing-Kin Sung. CRAM: Compressed random access memory. ICALP 2012. [3] R. Raman, V. Raman, and S. Srinivasa Rao. Succinct dynamic data structures. WADS 2001.

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

PYblock of

log2 n mini blocks

T T T T lower levelT is a k-ary tree of constant height: • O(loglog n) time • O(log2 n loglog n) bits

7

o(n) bits

o(n) bits

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 52: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Y is an Y-fast trie • O(loglog n) time

P is a dynamic prefix-sums DS [1] • O(b) time

O(n / (b x log2 n)) x O(log u) = o(n) bits each

upper level

[1] Philip Bille, Patrick Hagge Cording, Inge Li Gørtz, Frederik Rye Skjoldjensen, Hjalte Wedel Vildhøj, and Søren Vind. Dynamic relative compression. CoRR, abs/1504.07851, 2015. [2] J. Jansson, K. Sadakane, and Wing-Kin Sung. CRAM: Compressed random access memory. ICALP 2012. [3] R. Raman, V. Raman, and S. Srinivasa Rao. Succinct dynamic data structures. WADS 2001.

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

PYblock of

log2 n mini blocks

T T T T lower levelT is a k-ary tree of constant height: • O(loglog n) time • O(log2 n loglog n) bits

7

The encoding of the mini blocks takes

≤ EF(S(n,u)) + o(n) bits

o(n) bits

o(n) bits

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 53: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Y is an Y-fast trie • O(loglog n) time

P is a dynamic prefix-sums DS [1] • O(b) time

O(n / (b x log2 n)) x O(log u) = o(n) bits each

upper level

[1] Philip Bille, Patrick Hagge Cording, Inge Li Gørtz, Frederik Rye Skjoldjensen, Hjalte Wedel Vildhøj, and Søren Vind. Dynamic relative compression. CoRR, abs/1504.07851, 2015. [2] J. Jansson, K. Sadakane, and Wing-Kin Sung. CRAM: Compressed random access memory. ICALP 2012. [3] R. Raman, V. Raman, and S. Srinivasa Rao. Succinct dynamic data structures. WADS 2001.

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

PYblock of

log2 n mini blocks

T T T T lower levelT is a k-ary tree of constant height: • O(loglog n) time • O(log2 n loglog n) bits

7

The encoding of the mini blocks takes

≤ EF(S(n,u)) + o(n) bits

o(n) bits

o(n) bits

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 54: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Y is an Y-fast trie • O(loglog n) time

P is a dynamic prefix-sums DS [1] • O(b) time

O(n / (b x log2 n)) x O(log u) = o(n) bits each

upper level

[1] Philip Bille, Patrick Hagge Cording, Inge Li Gørtz, Frederik Rye Skjoldjensen, Hjalte Wedel Vildhøj, and Søren Vind. Dynamic relative compression. CoRR, abs/1504.07851, 2015. [2] J. Jansson, K. Sadakane, and Wing-Kin Sung. CRAM: Compressed random access memory. ICALP 2012. [3] R. Raman, V. Raman, and S. Srinivasa Rao. Succinct dynamic data structures. WADS 2001.

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

PYblock of

log2 n mini blocks

T T T T lower levelT is a k-ary tree of constant height: • O(loglog n) time • O(log2 n loglog n) bits

7

The encoding of the mini blocks takes

≤ EF(S(n,u)) + o(n) bits

o(n) bits

o(n) bits

Theorem 6 from [2]: address and allocate the high part of a mini block in O(1).

Corollary 3 from [3]: random Access in O(1).

Memory management for the mini blocks:

b log(u/b) + 2b bits

The overall redundancy is o(n) bits.

LOW HIGH

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 55: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Y is an Y-fast trie • O(loglog n) time

P is a dynamic prefix-sums DS [1] • O(b) time

O(n / (b x log2 n)) x O(log u) = o(n) bits each

upper level

[1] Philip Bille, Patrick Hagge Cording, Inge Li Gørtz, Frederik Rye Skjoldjensen, Hjalte Wedel Vildhøj, and Søren Vind. Dynamic relative compression. CoRR, abs/1504.07851, 2015. [2] J. Jansson, K. Sadakane, and Wing-Kin Sung. CRAM: Compressed random access memory. ICALP 2012. [3] R. Raman, V. Raman, and S. Srinivasa Rao. Succinct dynamic data structures. WADS 2001.

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

PYblock of

log2 n mini blocks

T T T T lower levelT is a k-ary tree of constant height: • O(loglog n) time • O(log2 n loglog n) bits

7

The encoding of the mini blocks takes

≤ EF(S(n,u)) + o(n) bits

o(n) bits

o(n) bits

Theorem 6 from [2]: address and allocate the high part of a mini block in O(1).

Corollary 3 from [3]: random Access in O(1).

Memory management for the mini blocks:

b log(u/b) + 2b bits

The overall redundancy is o(n) bits.

LOW HIGH

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 56: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Y is an Y-fast trie • O(loglog n) time

P is a dynamic prefix-sums DS [1] • O(b) time

O(n / (b x log2 n)) x O(log u) = o(n) bits each

upper level

[1] Philip Bille, Patrick Hagge Cording, Inge Li Gørtz, Frederik Rye Skjoldjensen, Hjalte Wedel Vildhøj, and Søren Vind. Dynamic relative compression. CoRR, abs/1504.07851, 2015. [2] J. Jansson, K. Sadakane, and Wing-Kin Sung. CRAM: Compressed random access memory. ICALP 2012. [3] R. Raman, V. Raman, and S. Srinivasa Rao. Succinct dynamic data structures. WADS 2001.

Results - Dynamic Elias-Fano 3

S

EF(S(n,u)) = n log(u/n) + 2n bits mini block of size b = log n / loglog n

PYblock of

log2 n mini blocks

T T T T lower levelT is a k-ary tree of constant height: • O(loglog n) time • O(log2 n loglog n) bits

7

The encoding of the mini blocks takes

≤ EF(S(n,u)) + o(n) bits

o(n) bits

o(n) bits

S S1 S2

EF(S1) + EF(S2) ≤ EF(S)

Property

Theorem 6 from [2]: address and allocate the high part of a mini block in O(1).

Corollary 3 from [3]: random Access in O(1).

Memory management for the mini blocks:

b log(u/b) + 2b bits

The overall redundancy is o(n) bits.

LOW HIGH

For u = nγ, γ = (1):• EF(S(n,u)) + o(n) bits• O(log n / loglog n) Access

• O(log n / loglog n) Insert/Delete (amortized)• O(min{1+log(u/n), loglog n}) Predecessor

Page 57: Dynamic Elias-Fano Representationpages.di.unipi.it/pibiri/slides/CPM17-slides.pdf · 2 Introduction A dynamic ordered set S is a data structure representing n objects and supporting

Thanks for your attention, time, patience!

Any questions?

8