I am looking for non-canonical sorts of lists. A function that would give:
With order_type = Lex, Colex, Revlex, etc.
Your question title says "generate subsets" but your question body asks for and shows pseudocode for sorting. These seem to me related but different problems.
I believe you can effect any of the lex, colex, revlex, revcolex sorts by reversing elements and lists in the proper sequence.
The simplest variation, merely reverse the list after sorting:
Reverse the elements before sorting, then again afterward to restore them:
This will be more efficient without
Or as I prefer with infix notation:
Simply reverse the entire list in addition to the steps for the colex sort:
A visualization function:
A random shuffle of subsets:
A comparative graphic: