English

Sorting and Ranking of Self-Delimiting Numbers with Applications to Outerplanar Graph Isomorphism

Data Structures and Algorithms 2024-09-04 v4

Abstract

Assume that an NN-bit sequence SS of kk numbers encoded as Elias gamma codes is given as input. We present space-efficient algorithms for sorting, dense ranking and competitive ranking on SS in the word RAM model with word size Ω(logN)\Omega(\log N) bits. Our algorithms run in O(k+NlogN)O(k + \frac{N}{\log N}) time and use O(N)O(N) bits. The sorting algorithm returns the given numbers in sorted order, stored within a bit-vector of NN bits, whereas our ranking algorithms construct data structures that allow us subsequently to return the dense/competitive rank of each number xx in SS in constant time. For numbers xNx \in \mathbb{N} with x>Nx > N we require the position pxp_x of xx as the input for our dense-/competitive-rank data structure. As an application of our algorithms above we give an algorithm for tree isomorphism, which runs in O(n)O(n) time and uses O(n)O(n) bits on nn-node trees. Finally, we generalize our result for tree isomorphism to forests and outerplanar graphs, while maintaining a space-usage of O(n)O(n) bits. The previous best linear-time algorithms for trees, forests and outerplanar graph isomorphism all use Θ(nlogn)\Theta(n \log n) bits.

Keywords

Cite

@article{arxiv.2002.07287,
  title  = {Sorting and Ranking of Self-Delimiting Numbers with Applications to Outerplanar Graph Isomorphism},
  author = {Frank Kammer and Johannes Meintrup and Andrej Sajenko},
  journal= {arXiv preprint arXiv:2002.07287},
  year   = {2024}
}