English

Parallel and sequential in-place permuting and perfect shuffling using involutions

Data Structures and Algorithms 2015-03-20 v2

Abstract

We show that any permutation of 1,2,...,N{1,2,...,N} can be written as the product of two involutions. As a consequence, any permutation of the elements of an array can be performed in-place in parallel in time O(1). In the case where the permutation is the kk-way perfect shuffle we develop two methods for efficiently computing such a pair of involutions. The first method works whenever NN is a power of kk; in this case the time is O(N) and space O(log2N)O(\log^2 N). The second method applies to the general case where NN is a multiple of kk; here the time is O(NlogN)O(N \log N) and the space is O(log2N)O(\log^2 N). If k=2k=2 the space usage of the first method can be reduced to O(logN)O(\log N) on a machine that has a SADD (population count) instruction.

Keywords

Cite

@article{arxiv.1204.1958,
  title  = {Parallel and sequential in-place permuting and perfect shuffling using involutions},
  author = {Qingxuan Yang and John Ellis and Khalegh Mamakani and Frank Ruskey},
  journal= {arXiv preprint arXiv:1204.1958},
  year   = {2015}
}
R2 v1 2026-06-21T20:46:49.197Z