# Combinatorial optimization problem - What would you call this?

I'm trying to solve an optimization problem which can be described as follows.

• There are four sets objects. For simplicity, let's call them :
1. Apples
2. Oranges
3. Pears
4. Lemons
• The sets can contain unequal numbers of their respective objects
• These objects must be organized into groups containing exactly one of each object
• Each possible group can be evaluated by some merit function (ie: function of the difference between the masses of the constituent objects of the group, say)
• The maximum number of groups with a merit function below some threshold must be formed with the objects in the input sets.
• In the above set of groups, no object can be duplicated - it must belong uniquely to one group.

My question is not necessarily how to solve this problem - this is no doubt an extremely broad question. What I would like to know is whether or not this problem has, or is of a class of problem, with some formal name.

Primarily, I'm looking for search terms to help research similar problems (and the types of solutions that are known for it).

• Seems like a complicated version of the knapsack problem. Commented May 11, 2015 at 21:07
• @AndréSouzaLemos That actually got me started down the right road, I think. This is perhaps closer to the Stable Marriage problem, albeit with a marriage of four genders rather than two. en.wikipedia.org/wiki/Stable_marriage_problem#Similar_problems
– J...
Commented May 11, 2015 at 21:25
• The thing is, you are selecting a subset of the total number of possible matches, according to an decision function. That's what brings it closer to knapsack. Appearances deceive. Commented May 11, 2015 at 21:29
• @AndréSouzaLemos Yes, but with many knapsacks...the number of which is also a parameter to be optimized. I'll keep reading, this is a good start, thanks!
– J...
Commented May 11, 2015 at 21:41

It's called four-dimensional matching and it's NP-complete.

• I was pretty certain from the formulation that it must be NP-complete. At best I'm hoping to find some workable approximations. I'll look this up!
– J...
Commented May 11, 2015 at 22:12
• You might find more information on three-dimensional matching, which might still be helpful. Commented May 11, 2015 at 22:17
• Indeed, reading up on it now...
– J...
Commented May 11, 2015 at 22:17
• It seems that n-Dim matching assumes T (set of n-ples) is given as input. In my case this is not so - all I have are the initial disjoint sets. I suppose the problem would reduce to first a knapsack-type problem for the generation of the initial set of T, followed by a weighted form of maximum n-Dim matching to reduce T.
– J...
Commented May 12, 2015 at 9:10
• In your case, $T$ is just the set $\mathrm{Apples}\times\mathrm{Oranges}\times\mathrm{Pears}\times\mathrm{Lemons}$. Worst case, you could generate this list; I don't know what algorithms for 4DM look like but it's possible that you could do something smarter than that and use the "implicit" representation for the set of tuples and their weights throughout your algorithm. Commented May 12, 2015 at 9:25