Ranking and unranking permutations in linear time

被引:53
|
作者
Myrvold, W [1 ]
Ruskey, F [1 ]
机构
[1] Univ Victoria, Dept Comp Sci, Victoria, BC V8W 3P6, Canada
基金
加拿大自然科学与工程研究理事会;
关键词
permutation; ranking; unranking; algorithms; combinatorial problems;
D O I
10.1016/S0020-0190(01)00141-7
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
A ranking function for the permutations on n symbols assigns a unique integer in the range [0, n! - 1] to each of the n! permutations. The corresponding unranking function is the inverse: given an integer between 0 and n! - 1, the value of the function is the permutation having this rank. We present simple ranking and unranking algorithms for permutations that can be computed using 0(n) arithmetic operations. (C) 2001 Elsevier Science B.V. All rights reserved.
引用
收藏
页码:281 / 284
页数:4
相关论文
共 50 条