I have a problem where I have a set of positive real numbers and must partition this set into two new sets such that:

1. The sum of the values in each set is as close as possible to the sum of the values in the other set. i.e. the difference is as close to zero as is possible.

2. A function f defined over the elements of each set is simultaneously minimized for both sets.

Essentially such that (Absolute value of difference of the sum in each set)+ (Sum of value of function in each set) is as small as possible. One condition may be more important than the other, so weights may be applied to both conditions to signify relative importance.

What techniques could I use for this? It would be great if someone could identify which branch of mathematics this falls under, as I would very much like to learn about it for myself, but am unable to determine were I should be looking.

Thanks very much in advance.