how to generate permutations of array in python? -


I have an array of 27 elements, and I do not want to generate all the permutations of the array (27!) I need 5000 randomly selected permutations, any tip will be useful ...

using a permutation Repeat this operation in a loop and check the duplicate every time you use it to copy and archive the result (there is probably none) Will be). Your results set contains 5000 items, stop.

To address the point in the comment, it is based on Python and it has a duration of 2 ** 19937-1 , which is 27! , it should be appropriate for your use.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -