What's the most efficient way to enumerate all (ordered) subsets of an ordered set? So, for example, given the ordered set $\{2, 5, 6\}$ (using the normal ordering for integers), I need the following:$$\{\}, \{2\}, \{5\}, \{6\}, \{2, 5\}, \{2, 6\}, \{5, 6\}, \{2, 5, 6\}.$$Smaller subsets should come first, but the ordering of the subsets of equal size is not important.I'm looking for an algorithm that is efficient both in theory and in implementation (in a general purpose programming language) for very large sets.
Efficiently enumerate all subsets of an ordered set
combinatorics