I am trying to use Python itertools.product to come up with all possible combinations of a long list of long lists. I do have criteria that no element of any list can be repeated. (Possible values are integers 0 to 349.)
The list to iterate contains 50 other lists.
Each of the 50 lists is shaped somewhere between (1,2) up to maxs of (57,2), (18,3), (49,4), and (5,5). These sizes will change as input data changes, but this gives you an idea of what I am dealing with to start.
Combo = list(itertools.product(*test))
remove_index = []
for i in range(0,len(Combo)): # look for duplicates in iterations, then remove
if DupTest(Combo[i]) == True:
remove_index.append(i)
for j in sorted(remove_index, reverse = True):
del Combo[j]
These are too large to be able to run itertools.product without crashing. I tried breaking it up into smaller groups (I can process 10 groups of 5 each pretty easily), but then I still can't process the next iteration with those results.
Any ideas for how to test for duplicate elements before creating the list of all the products?