Problem. Given a list nums of distinct integers, return all possible subsets (the power set), in any order.
nums = [1, 2, 3] → [], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]
Each item is either in or out: 2ⁿ subsets, each up to n long. Any method must produce Θ(n · 2ⁿ) output, so "optimising" here means three different things: not doing much more than that, using little memory beyond the output, and, in the constrained versions, not generating subsets you'll throw away.
ML context. Subsets of features, of data sources, of ensemble members, of augmentations: "which combination works best?" is a subset search. Real versions come with constraints (a cost budget, a fixed size), and the art is pruning whole families of subsets at once (Changes A and B). Past n ≈ 25, exhaustive search is out and you split the problem or sample (Changes C and D).