Given a list of n distinct items, how can I step through each permutation of the items swapping just one pair of values at a time? (I assume it is possible, it certainly fee
You could have a look at https://sourceforge.net/projects/swappermutation/ which is a Java implementation of exactly you requirements: an Iterator that generates Swaps. Created this some time ago an recently updated.