My code is being written in Matlab, but I am hoping to find some ideas for a better algorithm. The gist of the problem is: We have a list of variables (unspecified length) of
x = [A B C D E .. N]
each variable has a corresponding value (ranging from 1E-7 to 1) of
xvals = [1 1 .95 .94 .8 ... .3]
I have multiple sets of constraints (of unequal size) such as
set1 = [A B C D E N;
A B C E F Q]
set2 = [A B D Q;
A B F G;
A B E F]
(...)
set7 = [A B F H J;
A B D H Q]
I am trying to find a solution of the smallest size that satisfies at least 1 row of constraints from each set that would have the largest possible sum of corresponding values. I have tried a brute force method that uses a recursive function to examine each distinct combination of a specific size and then pulling out the answer with the highest sum, but can anyone think of a better way to solve this?