PermutationCycles[perm]
给出置换 perm 的一个不相交轮换表示.
PermutationCycles
PermutationCycles[perm]
给出置换 perm 的一个不相交轮换表示.
更多信息
- 输入置换 perm 可以是一个置换列表或不相交轮换形式.
- 一个置换列表是连续整数 {1,2,…,n} 的一个重新排序.
- PermutationCycles[perm] 返回一个头部为包含一个轮换列表的 Cycles 的表达式. 每个轮换具有 {p1,p2,…,pn} 的形式,代表一个从 pi 到 pi+1 的映射. 最后一点 pn 被映射到 p1.
- PermutationCycles[perm,h] 返回一个头部为 h 的表达式.
- 在每个轮换中,将最小的点置于第一个位置,因而可以根据第一个点对轮换进行排序,由此,PermutationCycles 的结果被自动标准化.
范例
打开所有单元 关闭所有单元基本范例 (2)
范围 (4)
PermutationCycles[{6, 3, 2, 5, 4, 1}]用 Cycles 以外的头部时,单元集将被保留:
PermutationCycles[{2, 5, 3, 6, 1, 8, 7, 9, 4, 10}, head]PermutationCycles[{1, 2, 3, 4, 5}, Identity]PermutationCycles[Cycles[{{1, 3, 5}, {2, 4, 6}}]]PermutationCycles 对于大的置换列表很高效:
First@PermutationCycles[RandomSample[Range[1000000]]] // Length应用 (2)
PermutationCycles[{2, 3, 1, 4, 5, 6, 7, 8, 9, 10, 12, 11, 13, 14, 15, 16, 17, 18, 19, 20}]list = RandomSample[Range[100000]];Signature[list] == Apply[Times, (-1) ^ (Length /@ PermutationCycles[list, Identity] - 1)]属性和关系 (6)
由 PermutationCycles 返回的轮换集对应于从有序排列生成的列表:
list = {7, 15, 1, 9, 11, 2, 12, 13, 4, 6, 14, 10, 5, 3, 8};cycs = PermutationCycles[list]Permute[Sort[list], cycs] === listPermutationList 给出了 PermutationCycles 的逆运算:
list = {15, 7, 2, 12, 11, 5, 6, 8, 3, 14, 13, 10, 9, 1, 4};list === PermutationList[PermutationCycles[list]]一个 PermutationCycles 和 PermutationList 的组合可加入单元集:
cycs = Cycles[{{1, 5, 6}, {10, 7}}]PermutationCycles[PermutationList[cycs], Identity]PermutationMatrix[{4, 5, 1, 3, 2}]用 PermutationMatrix 的 "PermutationCycles" 属性获取对应的不相交轮换表示:
%["PermutationCycles"]这相当于对置换列表直接应用 PermutationCycles:
PermutationCycles[{4, 5, 1, 3, 2}]PermutationCycles 的一个 Wolfram 语言实现:
combinatoricatocycles[p_] := Module[{k, j, first, np = p, q = Table[0, {Length[p]}], i}, DeleteCases[Table[If[np[[i]] == 0, {}, j = 1;first = np[[i]];np[[i]] = 0;
k = q[[j++]] = first;
While[np[[k]] ≠ 0, q[[j++]] = np[[k]];np[[k]] = 0;k = q[[j - 1]]];
Take[q, j - 1]], {i, Length[p]}], _ ? (# === {}&)]]list = RandomSample[Range[10000]];First[Timing[PermutationCycles[list]]] / First[Timing[combinatoricatocycles[list]]]Tally[Length /@ (PermutationCycles[#, Identity]& /@ Permutations[{1, 2, 3, 4, 5, 6}])]Total[Apply[#2 (-x) ^ #1&, %, {1}]]这与 FactorialPower 等价:
FactorialPower[x, 6] == %//FunctionExpand//SimplifyFactor[%%]StirlingS1[6, Range[6]]技术笔记
-
▪
- 置换列表
相关指南
-
▪
- 置换
文本
Wolfram Research (2010),PermutationCycles,Wolfram 语言函数,https://reference.wolfram.com/language/ref/PermutationCycles.html (更新于 2012 年).
CMS
Wolfram 语言. 2010. "PermutationCycles." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2012. https://reference.wolfram.com/language/ref/PermutationCycles.html.
APA
Wolfram 语言. (2010). PermutationCycles. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/PermutationCycles.html 年
BibTeX
@misc{reference.wolfram_2026_permutationcycles, author="Wolfram Research", title="{PermutationCycles}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/PermutationCycles.html}", note=[Accessed: 28-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_permutationcycles, organization={Wolfram Research}, title={PermutationCycles}, year={2012}, url={https://reference.wolfram.com/language/ref/PermutationCycles.html}, note=[Accessed: 28-November-2026]}