Time space trade offs for 2d range minimum queries
This presentation is the property of its rightful owner.
Sponsored Links
1 / 23

Time-Space Trade-Offs for 2D Range Minimum Queries PowerPoint PPT Presentation


  • 39 Views
  • Uploaded on
  • Presentation posted in: General

Time-Space Trade-Offs for 2D Range Minimum Queries. Joint work with Gerth Stølting Brodal and S. Srinivasa Rao. Pooya Davoodi Aarhus University. Aarhus University, September 1, 2010. The 2D Range Minimum Problem. j ’. Input: an m x n - matrix of size N = m ∙ n , m ≤ n.

Download Presentation

Time-Space Trade-Offs for 2D Range Minimum Queries

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Time space trade offs for 2d range minimum queries

Time-SpaceTrade-Offs for 2D Range Minimum Queries

Joint work with Gerth Stølting Brodal and S. SrinivasaRao

Pooya Davoodi

Aarhus University

AarhusUniversity, September 1, 2010


The 2d range minimum problem

The 2D Range Minimum Problem

j’

  • Input: an m x n-matrix of size N = m ∙ n, m ≤ n.

  • Preprocess the matrix s.t. range minimum queries are efficiently supported.

i’

Minimum


Models

Models

j’

Encoding model

  • Queries can access data structure but not input matrix

Indexingmodel

  • Queriescanaccessdata structureand readinput matrix

i’

Minimum


Some trivial examples

Some Trivial Examples...

j’

i’

Minimum


Results

Results


1d range minimum queries

1D Range Minimum Queries

Fischer and Heun (2007)

NEW

NEW

Fischer (Latin 2010)


Time space trade offs for 2d range minimum queries

2D Range Minimum Queries

NEW

NEW

NEW Proof

Demain et al. (2009)


Time space trade offs for 2d range minimum queries

1D


Lower bound 1d encoding

LowerBound (1D, Encoding)

  • For each input array consider the Cartesiantree

  • Eachbinarytree is a possibleCartesiantree

  • RMQ queriescanreconstruct the Cartesiantree

  • # Cartesiantrees is

  • # bits ≥ = 2n - Θ(log n)


Upper bound 1d encoding

Upper Bound (1D, Encoding)

  • For an input array consider the Cartesiantree

  • Succintrepresentationusing4n+o(n) bits and O(1) query time (Sadakane 2007)

  • Improved to 2n+o(n) (Fischer 2010)


Upper bounds 1d indexing

Upper Bounds (1D, Indexing)

C

  • Build encoding O(n/c) bit structure for block minimums

  • RMQ = query to encodingstructure + 3c elements, i.e. query time O(c)

block minimums (implicit)


Lower bounds 1d indexing

LowerBounds (1D, Indexing)

ThmSpace N/cbits impliesΩ(c)query time

  • Consider N/cqueries for cN/c different {0,1} inputs with exactly one zero in each block

  • cN/c / 2N/c inputs sharesome data structure

  • Everyquery is a

    decision tree of

    height≤d

N/c

q1

q2

qN/c


Lower bounds 1d indexing1

LowerBounds (1D, Indexing)

cont.

  • Combinequeries to decision treeidentifying input

  • Prunenon-reachable branches

    # zeroesonanypath ≤ N/c

  • query time d = Ω(c)

N/c

q1

q2

qN/c

  • N


Time space trade offs for 2d range minimum queries

2D


Lower bounds 2d indexing

LowerBounds (2D, Indexing)

C

  • As for 1D consider {0,1} matrices and partition the array intoblocks of c elements eachcontainingexactlyonezero

  • As for 1D an algorithmbeingable to identify the zero in eachblockusingN/c bits willrequiretime Ω(c)


Upper bounds 2d indexing

Upper Bounds (2D, Indexing)

  • O(1) time using O(N)words Atallahand Yuan (SODA 2010)

  • Usingtwo-levels of

    recursion, tabulating

    micro-blocks of size

    loglogmxloglogn

    O(1) time usingO(N) bits


Upper bounds 2d indexing1

Upper Bounds (2D, Indexing)

cont.

  • Thm O(N/c ∙ log c) bits and O(c logc)query time

  • Buildlog cindexingstructures for compressed matrices for blocksizes2i x c/2i, eachusingO(N/c) bits and canlocateO(1)blockswith minimum key in O(1) time

  • Query: O(1) blocks for eachblocksize in time O(c) + elements not covered by blocks in time O(c log c)


Upper bounds 2d encoding

Upper Bounds (2D, Encoding)

  • Translate input matrix into rank matrix using O(N log n) bits

  • Applyindexstructure to rank matrix usingO(N) bits achievingO(1)query time

input matrix

rank matrix


Lower bound 2d encoding demaine et al 2009

NEW Proof

LowerBound (2D, Encoding)Demaine et al. 2009

  • Define a set of

    matrices where the RMQ answersdifferamong all matrices

  • Bits required is at least

    log = Ω(N log m)


Conclusion

Conclusion


1d range minimum queries1

1D Range Minimum Queries

Fischer and Heun (2007)

NEW

(matching upper bound)

Fischer (Latin 2010)


Time space trade offs for 2d range minimum queries

2D Range Minimum Queries

NEW

?

NEW

?

NEW Proof

Demain et al. (2009)


Time space trade offs for 2d range minimum queries

ThankYou


  • Login