Consider a set $A$ containing $N$ real numbers. Let $f(X_{r,k})$ represent a function, where $X_{r,k}\subseteq A$ denotes the $k$th combination of $r$ elements from $A$, with $1 \leq k \leq \binom{N}{r}$ and $0 \leq r \leq N$. What is the most efficient method to compute $f(X_{r,k})$ for all possible values of $r$ and $k$?
Since the number of possible $k$s is maximal when $r= \lfloor N/2\rfloor$, one could start by evaluating those combinations and then using them as seeds to sequentially add and remove smaller ones, making use of the symmetry given by the fact that for a given $X_{r,k}$ there is a $X_{N-r,k'}$ such that $X_{r,k}\cup X_{N-r,k'}=A$.
Is this suggestion sensible? Can it be further optimized? Is there an altogether better approach?