On the Succinct Representation of Equivalence Classes

Given a partition of an n element set into equivalence classes, we study the problem of assigning unique labels to these elements in order to support the query that asks whether the elements corresponding to two given labels belong to the same equivalence class. This has various applications including for testing whether two vertices are in the same connected component in an undirected graph or in the same strongly connected component in a directed graph. We consider the problem in several models.Concerning labeling schemes where we assign labels to elements and the query is to be answered just by examining the labels of the queried elements (without any extra space): if each vertex is required to have a unique label, then we show that a label space of $$\sum _{i=1}^n \lfloor {n \over i} \rfloor $$∑i=1n⌊ni⌋ is necessary and sufficient. In other words, $$\lg n + \lg \lg n + O(1)$$lgn+lglgn+O(1) bits of space are necessary and sufficient for representing each of the labels. This slightly strengthens the known lower bound and is in contrast to the known necessary and sufficient bound of $$\lceil \lg n \rceil $$⌈lgn⌉ for the label length, if each vertex need not get a unique label.Concerning succinct data structures for the problem when the n elements are to be uniquely assigned labels from label set $$\{1,\ldots , n\}$${1,…,n}, we first show that $$\varTheta (\sqrt{n})$$Θ(n) bits are necessary and sufficient to represent the equivalence class information. This space includes the space for implicitly encoding the vertex labels. We can support the query in such a structure in O(1) time in the standard word RAM model. We also develop a dynamic structure that uses $$O(\sqrt{n} \lg n)$$O(nlgn) bits to support equivalence queries and unions in $$O(\lg n/\lg \lg n)$$O(lgn/lglgn) worst case time or $$O(\alpha (n))$$O(α(n)) expected amortized time where $$\alpha (n)$$α(n) is the inverse Ackermann function.Concerning succinct data structures for the problem when the n elements are to be uniquely assigned labels from label set $$\{1,\ldots , cn\}$${1,…,cn} for any constant $$c > 1$$c>1, we show that $$\varTheta (\lg n)$$Θ(lgn) bits are necessary and sufficient to represent the equivalence class information. Moreover, we can support the query in such a structure in O(1) time in the standard word RAM model. We believe that our work can trigger further work on tradeoffs between label space and auxiliary data structure space for other labeling problems.

[1]  Torben Hagerup,et al.  Sorting and Searching on the Word RAM , 1998, STACS.

[2]  Naila Rahman,et al.  Compressed Prefix Sums , 2007, SOFSEM.

[3]  J. Ian Munro,et al.  Succinct Posets , 2012, ESA.

[4]  Dan E. Willard Log-Logarithmic Worst-Case Range Queries are Possible in Space Theta(N) , 1983, Inf. Process. Lett..

[5]  Philip Bille,et al.  Labeling schemes for small distances in trees , 2003, SODA '03.

[6]  Norbert Blum,et al.  On the Single-Operation Worst-Case Time Complexity of the Disjoint Set Union Problem , 1986, SIAM J. Comput..

[7]  Rajeev Raman,et al.  Eliminating Amortization: On Data Structures with Guaranteed Response Time , 1993 .

[8]  Friedhelm Meyer auf der Heide,et al.  Dynamic perfect hashing: upper and lower bounds , 1988, [Proceedings 1988] 29th Annual Symposium on Foundations of Computer Science.

[9]  Kesav V. Nori,et al.  Foundations of Software Technology and Theoretical Computer Science , 1991, Lecture Notes in Computer Science.

[10]  Rajeev Raman Generating Random Graphs Efficiently , 1991, ICCI.

[11]  Guy E. Blelloch,et al.  Compact representations of ordered sets , 2004, SODA '04.

[12]  Wiebe van der Hoek,et al.  SOFSEM 2007: Theory and Practice of Computer Science , 2007 .

[13]  Mark H. Overmars,et al.  The Design of Dynamic Data Structures , 1987, Lecture Notes in Computer Science.

[14]  G. Hardy,et al.  Asymptotic Formulaæ in Combinatory Analysis , 1918 .

[15]  Rajeev Raman,et al.  Succinct ordinal trees with level-ancestor queries , 2004, SODA '04.

[16]  Wing-Kai Hon,et al.  Compressed data structures: dictionaries and data-aware measures , 2006, Data Compression Conference (DCC'06).

[17]  Dan E. Willard,et al.  Log-logarithmic worst-case range queries are possible in space ⊕(N) , 1983 .

[18]  Rajeev Raman,et al.  Succinct indexable dictionaries with applications to encoding k-ary trees, prefix sums and multisets , 2007, ACM Trans. Algorithms.

[19]  Moshe Lewenstein,et al.  Succinct Data Structures for Representing Equivalence Classes , 2013, ISAAC.

[20]  J. Ian Munro,et al.  Succinct Representations of Arbitrary Graphs , 2008, ESA.

[21]  Rajeev Raman,et al.  More Haste, Less Waste: Lowering the Redundancy in Fully Indexable Dictionaries , 2009, STACS.

[22]  Stephen Alstrup,et al.  Worst-case and amortised optimality in union-find (extended abstract) , 1999, STOC '99.

[23]  Peter Elias,et al.  Universal codeword sets and representations of the integers , 1975, IEEE Trans. Inf. Theory.

[24]  Guy Joseph Jacobson,et al.  Succinct static data structures , 1988 .

[25]  John L. Smith Tables , 1969, Neuromuscular Disorders.

[26]  J. Ian Munro,et al.  A Uniform Paradigm to Succinctly Encode Various Families of Trees , 2012, Algorithmica.

[27]  S. Srinivasa Rao,et al.  Space Efficient Suffix Trees , 1998, J. Algorithms.

[28]  David Peleg,et al.  Labeling schemes for flow and connectivity , 2002, SODA '02.

[29]  Venkatesh Raman,et al.  Succinct representation of balanced parentheses, static trees and planar graphs , 1997, Proceedings 38th Annual Symposium on Foundations of Computer Science.

[30]  Gianni Franceschini,et al.  Radix Sorting with No Extra Space , 2007, ESA.

[31]  Rajeev Raman,et al.  Representing Trees of Higher Degree , 2005, Algorithmica.

[32]  Michael L. Fredman,et al.  Surpassing the Information Theoretic Bound with Fusion Trees , 1993, J. Comput. Syst. Sci..

[33]  Peter Bro Miltersen,et al.  Fusion Trees can be Implemented with AC0 Instructions Only , 1999, Theor. Comput. Sci..

[34]  Jérémy Barbay,et al.  Succinct Representation of Labeled Graphs , 2007, Algorithmica.

[35]  G. Hardy,et al.  Asymptotic formulae in combinatory analysis , 1918 .

[36]  J. Ian Munro,et al.  Membership in Constant Time and Almost-Minimum Space , 1999, SIAM J. Comput..

[37]  Moni Naor,et al.  Implicit Representation of Graphs , 1992, SIAM J. Discret. Math..

[38]  Alfred V. Aho,et al.  The Design and Analysis of Computer Algorithms , 1974 .