Permutation.cyclic_form() : cyclic_form() is a sympy Python library function that returns the cyclic notation from the canonical notation, by omitting the singletons.
cyclic notation from the canonical notation
Code #1 : cyclic_form() Example
Permutation a – cyclic_form form : [[0, 2, 3, 1], [4, 5]]
Permutation b – cyclic_form form : [[0, 3, 5]]
Code #2 : cyclic_form() Example – 2D Permutation
Permutation a – cyclic_form form : [[0, 3, 5, 6, 1, 2, 4]]
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course