Algorithm to maximize function of subsets
The algorithm that iterates through every $2^{1000}$ subsets.  Sorry, but stated like this, the answer is that there is no solution.

For every algorithm you come up with, I can come up with a subset $T \subseteq S$ such that $T$ is the last of all sets to be tested, and be the max of $f$.