I am having a general problem finding a good algorithm for generating each possible assignment for some integers in different arrays.
Lets say I have n arrays and m
It breaks down in this case to where the 2 partitions are. There are 4 possible locations so that would be 16 combinations but it isn't because you remove "duplicates". A bit like domino tiles. You have 4 "doubles" here and the 12 singles reduce to 6 so you have 10 combinations.
You can generate it selecting the first one, then generating the second as >= the first.
The first can be 0, 1, 2 or 3. 0 means it appears before the 1. 3 means it appears after the 3.
In your 10 solutions above the partitions are at:
1: 3 and 3 2: 0 and 3 3: 0 and 0 4: 2 and 3 5: 2 and 2 6: 0 and 2 7: 1 and 3 8: 1 and 1 9: 0 and 1 10: 1 and 2
If you generated in algorithmic order you would probably produce them 0 and 0, 0 and 1, 0 and 2, 0 and 3, 1 and 1, 1 and 2, 1 and 3, 2 and 2, 2 and 3, 3 and 3 although you could of course do them in reverse order.
In your examples above look at the positions of the commas and the number immediately to their left. If there are no numbers immediately to their left then it is 0.