@chaley - actually I think I found another issue with that algorithm. I don't it actually "works".
For instance if I set
dups = [(3,4),(3,5)]
initial_dups=[1,2,3,4,5,6]
The results it gives me are:
[1,2,3,4,5],[1,2,4,5,6]
Look at the first group - it has 3 and 4 together. Yet they are specifically exempted from appearing together in a group, and instead 6 has been removed?