Compact Encodings and Indexes for the Nearest Larger Neighbor Problem

Given a d-dimensional array, for any integer d > 0, the nearest larger value (NLV) query returns the position of the element which is closest, in L1 distance, to the query position, and is larger than the element at the query position. We consider the problem of preprocessing a given array, to construct a data structure that can answer NLV queries efficiently. In the 2-D case, given an n ×n array A, we give an asymptotically optimal O(n2)-bit encoding that answers NLV queries in O(1) time. When A is a binary array, we describe a simpler O(n2)-bit encoding that also supports NLV queries in O(1) time. Using this, we obtain an index of size O(n2/c) bits that supports NLV queries in O(c) time, for any parameter c, where 1 ≤ c ≤ n, matching the lower bound. For the 1-D case we consider the nearest larger right value (NLRV) problem where the nearest larger value to the right is sought. For an array of length n, we obtain an index that takes O((n/c) logc) bits, and supports NLRV queries in O(c) time, for any any parameter c, where 1 ≤ c ≤ n, improving the earlier results of Fischer et al. and Jayapaul et al.

[1]  S. Srinivasa Rao,et al.  Space Efficient Data Structures for Nearest Larger Neighbor , 2014, IWOCA.

[2]  Gerth Stølting Brodal,et al.  The Encoding Complexity of Two Dimensional Range Minimum Data Structures , 2013, ESA.

[3]  S. Srinivasa Rao,et al.  On Space Efficient Two Dimensional Range Minimum Data Structures , 2011, Algorithmica.

[4]  Gad M. Landau,et al.  On Cartesian Trees and Range Minimum Queries , 2009, Algorithmica.

[5]  Leah Epstein,et al.  Algorithms – ESA 2012 , 2012, Lecture Notes in Computer Science.

[6]  Uzi Vishkin,et al.  Optimal Doubly Logarithmic Parallel Algorithms Based on Finding All Nearest Smaller Values , 1993, J. Algorithms.

[7]  Johannes Fischer Combined data structure for previous- and next-smaller-values , 2011, Theor. Comput. Sci..

[8]  Kunihiko Sadakane,et al.  Practical Entropy-Compressed Rank/Select Dictionary , 2006, ALENEX.

[9]  Niklaus Wirth,et al.  Algorithms and Data Structures , 1989, Lecture Notes in Computer Science.

[10]  Gonzalo Navarro,et al.  Compressed representations of sequences and full-text indexes , 2007, TALG.

[11]  David G. Kirkpatrick,et al.  Time-Space Tradeoffs for All-Nearest-Larger-Neighbors Problems , 2013, WADS.

[12]  Guy Jacobson,et al.  Space-efficient static trees and graphs , 1989, 30th Annual Symposium on Foundations of Computer Science.

[13]  Giuseppe F. Italiano,et al.  Algorithms – ESA 2013 , 2013, Lecture Notes in Computer Science.

[14]  Sergey Bereg,et al.  Finding Nearest Larger Neighbors , 2009, Efficient Algorithms.

[15]  Gonzalo Navarro,et al.  Faster entropy-bounded compressed suffix trees , 2009, Theor. Comput. Sci..

[16]  Moshe Lewenstein,et al.  Two dimensional range minimum queries and Fibonacci lattices , 2012, Theor. Comput. Sci..