| 1 | initial version |
This can be done via reduced words:
P = Permutation([4, 8, 3, 1, 9, 2, 6, 7, 5])
r = P.reduced_word()
q = [(i,i+1) for i in r]
assert prod(Permutation(str(i)) for i in q[::-1]) == P
print(q)
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.