0

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?

mkierc
  • 1,193
  • 2
  • 15
  • 28
  • What do the constraints mean? – harold Jan 13 '15 at 14:36
  • The constraint is that my solution set has to have every element of at least 1 row from each set so that my solution is a superset containing all of the elements of 1 row of each set. For example, if i just considered the sets I have listed, a possible solution would be solution=[A B C D E N H Q] since this covers the first row of sets 1 and 2 and the second row of set 7. I am trying to minimize the number of elements in the solution, while maximizing the sum of the corresponding values of the elements in the smallest solution – dconner Jan 13 '15 at 19:37

0 Answers0