need an algorithm for optimization function

29 Views Asked by At

I'm not sure how to title this question, so any help in that regard is also appreciated. If I can edit the title to better reflect the question then I will do so.

Say I have a list of pairs (of anything eg socks, candy bars, etc.) eg:

a,b
g,h
f,a
a,f
g,b

I'll call this L.

I define two mutually exclusive sets A & B which together describe the list of pairs eg:

A = [a, h, g]
B = [b, f]

Then I define a function F(L, A, B ), which gives the percentage of pairs where both sets are required to complete the pair. In this example:

F(L, A, B ) = 0.8

How would you describe a function G(L,n ), which returns an A,B optimized to produce the highest value of F possible?

(n is a number 0 < n <= 1 which describes an upper bound on how many items A can contain of the union of the two sets.)