I make a list of the permutations between the number of fruits available and the number of farmers. In the permutations it enters the (1,2,..,max_number of fruits) and number of farmers(3). This is the code I use:
action_list = list(permutations(no_fruits(list), no_farmers(just a number)))
Imagine there are 3 fruits are 3 farmers. Fruit number 1 is an apple, number 2 is another apple and number 3 a mango. The information of which fruit it is is inside the object 1.fruit= apple for example.I have already a lis that says which numbers have the same fruits. We have these 6 combinations: (1,2,3) (1,3,2) (2,1,3) (2,3,1) (3,1,2) (3,2,1)
But now I don't want to differenciate apple 1 from apple 2. So the final output should be: (1,2,3) (1,3,2) (3,1,2)
How can I remove the other combinations? In other words, how can I remove the combinations where only fruit number 1 and number 2 swap places with each other?
Other relevant information: The number of farmers can be superior to the number of available fruits. In that case there would be some farmers that wouldn't have a fruit and would be represented as '-'. here is an example:
(1,2,-)
This means farmer 3 doesn't have a fruit, while farmer 1 and 2 have fruits 1 and 2, respectively.