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

Slides:



Advertisements
Similar presentations
Xiaoming Sun Tsinghua University David Woodruff MIT
Advertisements

The LCA Problem Revisited Michael A. BenderMartin Farach-Colton Latin American Theoretical Informatics Symposium, pages 8894, Speaker:
Margherita Sini, FAO 1/ Multilingual Issues in Ontology Creation: Examples from NeOn and Concept Server Projects Margherita Sini.
Presentation Title Here 30pt Arial 41 st CEPIS COUNCIL – Nov 2008 Brussels.
Time-Space Trade-Offs for 2D Range Minimum Queries Gerth Stølting BrodalPooya Davoodi Aarhus University S. Srinivasa Rao Seoul National University 18 th.
110/6/2014CSE Suprakash Datta datta[at]cse.yorku.ca CSE 3101: Introduction to the Design and Analysis of Algorithms.
Lars Arge Gerth Stølting Brodal Algorithms and Data Structures Computer Science Day, Department of Computer Science, Aarhus University, May 31, 2013.
Succinct Data Structures for Permutations, Functions and Suffix Arrays
Gerth Stølting Brodal University of Aarhus Monday June 9, 2008, IT University of Copenhagen, Denmark International PhD School in Algorithms for Advanced.
Lower Bounds for Sorting, Searching and Selection
Langkawi National Observatory Longitude: E 99d 46m 52s Longitude: E 99d 46m 52s Latitude: N 06d 18m 25s Latitude: N 06d 18m 25s Altitude: 111m Altitude:
Engineering a Set Intersection Algorithm for Information Retrieval Alex Lopez-Ortiz UNB / InterNAP Joint work with Ian Munro and Erik Demaine.
Constant-Time LCA Retrieval
Suffix Sorting & Related Algoritmics Martin Farach-Colton Rutgers University USA.
Succinct Representations of Trees S. Srinivasa Rao Seoul National University.
Data Structures: Range Queries - Space Efficiency Pooya Davoodi Aarhus University PhD Defense July 4, 2011.
Gerth Stølting Brodal Universitets-Samvirket Århus, Statsbiblioteket, Århus, November 16, 2010 Udfordringer ved håndtering af massive datamængder: Forskingen.
Lecture 5: Linear Time Sorting Shang-Hua Teng. Sorting Input: Array A[1...n], of elements in arbitrary order; array size n Output: Array A[1...n] of the.
CS 253: Algorithms Chapter 8 Sorting in Linear Time Credit: Dr. George Bebis.
Lowest common ancestors. Write an Euler tour of the tree LCA(1,5) = 3 Shallowest node.
CSC 2300 Data Structures & Algorithms March 27, 2007 Chapter 7. Sorting.
Improvements on the Range-Minimum-Query- Problem
Sorting Lower Bound1. 2 Comparison-Based Sorting (§ 4.4) Many sorting algorithms are comparison based. They sort by making comparisons between pairs of.
Algorithm Engineering, September 2013Data Structures, February-March 2010Data Structures, February-March 2006 Cache-Oblivious and Cache-Aware Algorithms,
The Encoding Complexity of Two Dimensional Range Minimum Data Structures MADALGO, October 2, 2013 (Work presented at ESA 2013) 1234  n
The Encoding Complexity of Two Dimensional Range Minimum Data Structures European Symposium on Algorithms, Inria, Sophia Antipolis, France, September 3,
Mike 66 Sept Succinct Data Structures: Techniques and Lower Bounds Ian Munro University of Waterloo Joint work with/ work of Arash Farzan, Alex Golynski,
Succinct Representations of Trees
Introduction n – length of text, m – length of search pattern string Generally suffix tree construction takes O(n) time, O(n) space and searching takes.
Complexity of algorithms Algorithms can be classified by the amount of time they need to complete compared to their input size. There is a wide variety:
Juha Mykkänen University of Kuopio, HIS R&D Unit Health Kuopio seminar Brussels, 5 November 2004 SerAPI project: Service-oriented architecture and Web.
The LCA Problem Revisited
Sorting Fun1 Chapter 4: Sorting     29  9.
Tom Olszewski, CESEE Territory Manager Terex Financial Services Vendor finance Experience of equipment manufacturer.
Succinct Data Structures Ian Munro University of Waterloo Joint work with David Benoit, Andrej Brodnik, D, Clark, F. Fich, M. He, J. Horton, A. López-Ortiz,
Path Minima on Dynamic Weighted Trees Pooya Davoodi Aarhus University Aarhus University, November 17, 2010 Joint work with Gerth Stølting Brodal and S.
Succinct Dynamic Cardinal Trees with Constant Time Operations for Small Alphabet Pooya Davoodi Aarhus University May 24, 2011 S. Srinivasa Rao Seoul National.
Compressed Prefix Sums O’Neil Delpratt Naila Rahman Rajeev Raman.
International Federation of Accountants Translation Activities in IFAC – an Update Kelly Ånerud, Senior Technical ManagerKelly Ånerud, Senior Technical.
Bahareh Sarrafzadeh 6111 Fall 2009
1 Nearest Common Ancestors (NCA) Discrete Range Maximum Cartesian Tree [Vuillemin 1980] i j max(i, j) i.
CSCE 411H Design and Analysis of Algorithms Set 10: Lower Bounds Prof. Evdokia Nikolova* Spring 2013 CSCE 411H, Spring 2013: Set 10 1 * Slides adapted.
Lecture 9COMPSCI.220.FS.T Lower Bound for Sorting Complexity Each algorithm that sorts by comparing only pairs of elements must use at least 
Space Efficient and Output Sensitive Greedy Algorithms on Intervals Toshiki Saitoh (Kobe University) Joint work with ・ Takashi Horiyama (Saitama University)
Optimal Planar Orthogonal Skyline Counting Queries Gerth Stølting Brodal and Kasper Green Larsen Aarhus University 14th Scandinavian Workshop on Algorithm.
MotivationLocating the k largest subsequences: Main ideasResults Problem definitions Problem instance ( k=5 ) Bibliography
ENCODING NEAREST LARGER VALUES Pat Nicholson* and Rajeev Raman** * MPII ** University of Leicester.
Linear Sorting. Comparison based sorting Any sorting algorithm which is based on comparing the input elements has a lower bound of Proof, since there.
Sorting Lower Bounds n Beating Them. Recap Divide and Conquer –Know how to break a problem into smaller problems, such that –Given a solution to the smaller.
Attribute inheritance between country deliveries and Wise Main Rivers and Lakes version 0 Test case with Germany Walter Simonazzi ETCLUSI / Roger Milego.
Lecture 5 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
Dr. LEE Jong-wook Fellowship
David Kauchak cs062 Spring 2010
Data Structures: Disjoint Sets, Segment Trees, Fenwick Trees
Succinct Data Structures
Decision trees Polynomial-Time
Easy eBooks to Support Blended Learning
CPSC 411 Design and Analysis of Algorithms
Space-efficient graph algorithms
Data Structures: Segment Trees, Fenwick Trees
Lower Bound Theory.
STACS arxiv.org/abs/ y 3-sided x1 x2 x1 x2 top-k
(2,4) Trees 12/4/2018 1:20 PM Sorting Lower Bound Sorting Lower Bound.
Discrete Methods in Mathematical Informatics
TRAINING OFAC BIS DUAL-USE YOUR EXPORT SANCTIONS GOAL AGENT RISK
8th Workshop on Massive Data Algorithms, August 23, 2016
CPSC 411 Design and Analysis of Algorithms
David Kauchak cs302 Spring 2012
Discrete Range Maximum
Presentation transcript:

Time-Space Trade-Offs for 2D Range Minimum Queries Gerth Stølting Brodal Aarhus University Join work with Pooya Davoodi and S. Srinivasa Rao Dagstuhl Seminar on Data Structures, February 28 - March 5, 2010

The 2D Range Minimum Problem j’ i’ Matric is static Preprocess an m x n-matrix of size N = n ∙ m, m ≤ n, to efficiently support range minimum queries RMQ([i1, i2]x[j1, j2]) = (i’, j’) Ai’, j’ = min{ Ai’’, j’’ | (i’’, j’’ )[i1,i2] x [j1,j2] }, (i’, j’ )[i1,i2]x[j1,j2]

Models Encoding model Indexing model Queries can access data structure but not input matrix Indexing model Queries can access data structure and read input matrix Minimum j’ i’

Additional space (bits) Some Trivial Examples... Solution Additional space (bits) Query time Model No data structure O(N) Indexing Tabulate answers O(N 2 log N) O(1) Encoding Store permutation O(N log N) .... Minimum j’ i’

Results

1D Range Minimum Queries Fischer and Heun (2007) NEW (matching upper bound) Fischer & Heun: Show how to answer in O(1) time, but did still access input vector Fischer (2008): Avoided the lookup of the input vector. Fischer (Latin 2010)

2D Range Minimum Queries NEW NEW NEW Proof Demain et al. (2009)

1D 1D Encoding model Index Upper bound Lower

Lower Bound (1D, Encoding) For each input array consider the Cartesian tree Each binary tree is a possible Cartesian tree RMQ queries can reconstruct the Cartesian tree # Cartesian trees is # bits ≥ = 2n - Θ(log n) 1D Encoding model Index Upper bound Lower

Upper Bound (1D, Encoding) Fischer is a different approach, not using Cartesian tree For an input array consider the Cartesian tree Succint representation using 4n+o(n) bits and O(1) query time (Sadakane 2007) Improved to 2n+o(n) (Fischer 2010) 1D Encoding model Index Upper bound Lower

Upper Bounds (1D, Indexing) C 5 2 3 7 4 9 1 10 6 12 8 13 11 2 1 5 3 block minimums (implicit) Build encoding O(N/c) bit structure for block minimums RMQ = query to encoding structure + 3c elements, i.e. query time O(c) 1D Encoding model Index Upper bound Lower

Lower Bounds (1D, Indexing) Thm Space N/c bits implies Ω(c) query time Consider N/C queries for cN/c different {0,1} inputs with exactly one zero in each block cN/c / 2N/c inputs share some data structure Every query is a decision tree of height ≤ d N/c q1 q2 qN/c Fix algorithms Fix set of inputs 1D Encoding model Index Upper bound Lower

Lower Bounds (1D, Indexing) cont. Combine queries to decision tree identifying input Prune non-reachable branches # zeroes on any path ≤ N/c query time d = Ω(c) Fix algorithms Fix set of inputs qN/c q2 q1 N/c 1D Encoding model Index Upper bound Lower N

2D 2D Encoding model Index Upper bound Lower

Upper Bounds (2D, Indexing) O(1) time using O(N) words Atallah and Yuan (SODA 2010) Using two-levels of recursion, tabulating micro-blocks of size loglog m x loglog n O(1) time using O(N) bits 2D Encoding model Index Upper bound Lower

Upper Bounds (2D, Indexing) cont. Thm O(N/c ∙ log c) bits and O(c log c) query time Build log c indexing structures for compressed matrices for block sizes 2i x c/2i, each using O(N/c) bits and can locate O(1) blocks with minimum key in O(1) time Query: O(1) blocks for each block size in time O(c) + elements not covered by blocks in time O(c log c) 2D Encoding model Index Upper bound Lower

Lower Bounds (2D, Indexing) C 1 As for 1D consider {0,1} matrices and partition the array into blocks of c elements each containing exactly one zero As for 1D an algorithm being able to identify the zero in each block using N/c bits will require time Ω(c) 2D Encoding model Index Upper bound Lower

Upper Bounds (2D, Encoding) 29 -14 10 15 2 7 13 -4 -5 -1 21 5 20 -17 32 15 2 10 12 7 9 6 11 4 3 5 14 8 13 1 16 input matrix rank matrix Translate input matrix into rank matrix using O(N log N) bits Apply index structure to rank matrix using O(N) bits achieving O(1) query time 2D Encoding model Index Upper bound Lower

Lower Bound (2D, Encoding) Demaine et al. 2009 NEW Proof Lower Bound (2D, Encoding) Demaine et al. 2009 Define a set of matrices where the RMQ answers differ among all matrices Bits required is at least log = Ω(N log m) Grey arrea = N = MAX 2D Encoding model Index Upper bound Lower

Conclusion

1D Range Minimum Queries Fischer and Heun (2007) NEW (matching upper bound) Fischer (Latin 2010)

2D Range Minimum Queries NEW ? NEW Indexing lower bound, comes from 1D – could this be strengthened in 2D? Or is upper bound not optimal? Encoding model. Upper and lower bound are tight for squared matrices, but for other aspect ratios the bounds are not tight. Recall m≤n. ? NEW Proof Demain et al. (2009)

Thank You Tau ∙ Jërë-jëf ∙ Tashakkur ∙ S.aHHa ∙ Sag olun Giihtu ∙ Djakujo ∙ Dâkujem vám ∙ Thank you Tesekkür ederim ∙ To-siä ∙ Merci ∙ Tashakur Taing ∙ Dankon ∙ Efharisto´ ∙ Shukriya ∙ Kiitos Dhanyabad ∙ Rakhmat ∙ Trugarez ∙ Asante Köszönöm ∙ Blagodarya ∙ Dziekuje ∙ Eskerrik asko Grazie ∙ Tak ∙ Bayarlaa ∙ Miigwech ∙ Dank u Spasibo ∙ Dêkuji vám ∙ Ngiyabonga ∙ Dziakuj Obrigado ∙ Gracias ∙ A dank aych ∙ Salamat Takk ∙ Arigatou ∙ Tack ∙ Tänan ∙ Aciu Korp kun kah ∙ Multumesk ∙ Terima kasih ∙ Danke Rahmat ∙ Gratias ∙ Mahalo ∙ Dhanyavaad Paldies ∙ Faleminderit ∙ Diolch ∙ Hvala Kam-sa-ham-ni-da ∙ Xìe xìe ∙ Mèrcie ∙ Dankie Thank You