Drools Planner can solve this problem for you.
Here's a presentation that shows the code for a 3D bin packing problem:
  http://www.slideshare.net/ge0ffrey/judcon-london-2011-bin-packing-with-drools-planner-by-example
To try it yourself, download the planner zip and run the example "CloudBalance".

Note that A* can't solve bin packing in scalable manner, because bin packing is np complete.
Each change (movement of items between bins) has a certain cost, and I would like to have a list of the least-cost path.
The roaddef2012 machinereassignement example (new on master) has the same problem.
The trick is that each Assignment holds the time, changeCost, the originalBin and the newBin. The newBin is the planning variable.
Then just add score rules that add the changeCost to the score when originalBin != newBin.

Op 09-11-11 15:45, Itai Frenkel schreef:

Hello,

 

I would like to solve a 2D binpacking problem. I have an existing bin-packing solution and would like to make it more "optimized". Each change (movement of items between bins) has a certain cost, and I would like to have a list of the least-cost path. There is more than one solution that is optimal.

 

Given an existing bin-packing solution I can tell if it is the optimal solution, and if not I can have a gross estimate to the distance to the optimal solution (although it is not guaranteed to be less than the actual distance).

 

It sounds to me that I need something like the A-Star algorithm. Can Drools help me in solving this problem ?

 

Thanks,

Itai

_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users

-- 
With kind regards,
Geoffrey De Smet