English

Maintaining the cycle structure of dynamic permutations

Data Structures and Algorithms 2023-06-08 v1

Abstract

We present a new data structure for maintaining dynamic permutations, which we call a forest of splay trees (FST)\textit{forest of splay trees (FST)}. The FST allows one to efficiently maintain the cycle structure of a permutation π\pi when the allowed updates are transpositions. The structure stores one conceptual splay tree for each cycle of π\pi, using the position within the cycle as the key. Updating π\pi to τπ\tau\cdot\pi, for a transposition τ\tau, takes O(logn)\mathcal{O}(\log n) amortized time, where nn is the size of π\pi. The FST computes any π(i)\pi(i), π1(i)\pi^{-1}(i), πk(i)\pi^k(i) and πk(i)\pi^{-k}(i), in O(logn)\mathcal{O}(\log n) amortized time. Further, it supports cycle-specific queries such as determining whether two elements belong to the same cycle, flip a segment of a cycle, and others, again within O(logn)\mathcal{O}(\log n) amortized time.

Cite

@article{arxiv.2306.04470,
  title  = {Maintaining the cycle structure of dynamic permutations},
  author = {Zsuzsanna Lipták and Francesco Masillo and Gonzalo Navarro},
  journal= {arXiv preprint arXiv:2306.04470},
  year   = {2023}
}
R2 v1 2026-06-28T10:58:54.601Z