Highlighted
New Contributor

Optimization Problem with Fixed Discreet Variables

Hello!
My problem is relatively simple, but I can't find a way to make it.
I have 14 parts of type A and 14 parts of type B and their weights. I need to group they in 7 sets containing 2 of each (each part can be used only once).
I want to group the parts so all sets are as close as possible in weight. Would mean targeting the smallest StdDev of the total weight of each set:

Anyone can help?
5 Replies
Highlighted

Re: Optimization Problem with Fixed Discreet Variables

@Telles65 See attached. Next time, please upload an Excel file rather than a screen-shot.

Highlighted

Re: Optimization Problem with Fixed Discreet Variables

Thank you for the attempt!

On the file you've sent the sets have the biggest possible StdDev of the totals.

I would like to be able to combine to find the smallest possible StdDev.

I've also tried to use the Solver, did not work because I need it to iterate using fixed specific values of the table.

The file is attached this time!

Regards,

Highlighted

Re: Optimization Problem with Fixed Discreet Variables

Is set A always smaller than set B? If so your second table is likely to be the best solution.

Re: Optimization Problem with Fixed Discreet Variables

@Jan Karel Pieterse No, not always.

I'm still stuck with this...

Highlighted

Re: Optimization Problem with Fixed Discreet Variables

I think it is like this:
Either you write VBA code that tries all possible combinations and picks the best (complicated to do and due to the many possibilities probably very slow), or you accept the second best solution which is where you try to create sets where you try to create pairs of both columns which are both as close to the column average as you can get. This is done by combining the largest with the smallest of A, then the one-but largest and one-but smallest, and etcetera. Depending on the precise numbers another strategy may potentially give a better result, but this strategy will likely work in more cases.