Advanced Algo v2: optimize all feasible subsets and then choose one of them instead of first choosing and then optimizing: terribly slow
Advanced Algo finalized