Looking for Bin Packing example in C#

790 views
Skip to first unread message

Andrew Bibik

unread,
May 19, 2017, 2:11:27 PM5/19/17
to or-tools-discuss
Hi everyone,

I have a business problem which requires load N items into bins. I have to use as small as possible number of bins, the items are defined by volume and weight. The bins are all the same size and have max volume and max weight defined.

How can I program this problem in OR-Tools? I would really appreciate an example - I have been searching for it for a while.

Thanks!

Andrew Bibik

unread,
May 23, 2017, 4:20:59 PM5/23/17
to or-tools-discuss
Is this task solvable at all with OR-Tools?

Lukas H

unread,
May 24, 2017, 2:35:32 AM5/24/17
to or-tools-discuss

Andrew Bibik

unread,
May 25, 2017, 11:08:22 AM5/25/17
to or-tools-discuss
Unfortunately no. This is the Knapsacks problem - I can't re-use for my task.

Laurent Perron

unread,
May 25, 2017, 12:18:08 PM5/25/17
to or-tools-discuss
just create a linear model.

xij: item i in bin j (boolean)
bj: bin j is occupied (boolean)
sum over j xij = 1  // put each item in one bin
for each j, sum xij * weight(i) <= max_weight_of_a_bin
for each j, sum xij * volume(i) <= max_volume_in_one_bin

for each j, for each i, bj >= xij

minimize sum bj 
you can solve with CBC, SCIP if installed, BOP

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Bibik

unread,
May 25, 2017, 1:28:26 PM5/25/17
to or-tools-discuss

Hi Laurent,

Thanks, but here is the problem: I have 25 years experience in "traditional" software development, but found myself really struggling with this task - I just do not have enough knowledge in this area, and I do not have 1-2 weeks to read a couple of books. I just need help.

I am willing to hire somebody and pay a consulting fee if I get help to program a model to solve Bin Packing problem in OR-Tools, preferably in C#.

Because I have no idea what "CBC, SCIP if installed, BOP" stands for. I just a have business problem, which I need to solve.
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages