Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solver Foundation Optimization - 1D Bin Packing

I want to optimize loading marble blocks into trucks. I do not know, if I can use Solver Foundation class for that purpose. Before, I start writing code, I wanted to ask it here.

  • Marble can be in any weight between 1 to 24 Tons.
  • A truck can hold maximum of 24 Tons.
  • It can be loaded as many marble cubes, as it can take up to 24 tones, which means there is no Volume limitation.
  • There can be between 200 up to 500 different marble blocks depending on time.

GOAL - The goal is to load marble blocks in minimum truck shipment.

How can I do that without writing a lot of if conditions and for loops?

Can I use Microsoft Solver Foundation for that purpose?

I read the documentation provided by Microsoft however, I could not find a scenario similar to mine.

M1+ M2 + M3 + .... Mn <=24 this is for one truck shipment.

Let say there are 200 different Marble weights and Marble weights are Float.

Thanks

like image 610
Val Nolav Avatar asked Apr 14 '12 21:04

Val Nolav


People also ask

What is an optimal solution in bin packing?

An optimal solution to a bin-packing problem uses the fewest number of bins possible. For example, given the set of elements 6, 12, 15, 40, 43, 82, and a bin capacity of 100, we can assign 6, 12, and 82 to one bin, and 15, 40, and 43 to another, for a total of two bins.

Is bin packing a decision problem?

The BIN PACKING decision problem asks the question whether – given a set of objects of distinct sizes, and a set of bins with specific capacity – there is a distribution of items to bins such that no item is left unpacked nor the capacity of any bin is exceeded.

What is vector bin packing?

A set of bins, each assigned a bin type and a set of item incarnations, such that exactly one incarnation of each item is assigned to any bin, and such that the total size of incarnations assigned to a bin does not exceed its capacity in any dimension.

What is 3D bin packing problem?

The 3D Bin Packing Problem (3D-BPP) is one of the most frequent problems in warehousing and logistics. Its solution is filling a container (a box or pallet) with items as closely to each other as possible to minimize the number of required containers.


1 Answers

You can use Microsoft Solver Foundation to solve this problem. An example of such a solution can be found here where the OML for the bin packing problem is as follows:

Model[ 
  Parameters[Sets,Items,Bins], 
  Parameters[Integers,OrderWidth[Items],BinWidth[Bins]], 

  Decisions[Integers[0,1],x[Items,Bins]], 
  Decisions[Integers[0,1],y[Bins]], 

  Constraints[    
    Foreach[{i,Items},Sum[{j,Bins}, x[i,j]]==1 ], 
    Foreach[{j,Bins}, Sum[{i,Items}, OrderWidth[i]*x[i,j]] <= BinWidth[j]], 
    Foreach[{i,Items},{j,Bins}, y[j] >= x[i,j]] 
  ], 

  Goals[Minimize[UsedBins->Sum[{j,Bins},y[j]]]] 
]

It would be easy to change OrderWidth to MarbleWeight and BinWidth to TruckCapacity (or just 24 in your case)

like image 70
Dave Maff Avatar answered Sep 30 '22 00:09

Dave Maff