1

I have been trying to find a solution for the following assignment problem:

  • There are "S" storage rooms. Each storage room, "s", has a capacity "Cs".
  • There are "P" packages. Each package, "p", has a size "Zp"
  • The cost to store a package "p" in a storage room "s" is "Tps"
  • One storage room can take multiple packages,as long as their total size don't exceed the room's capacity "Cs".
  • One package can't be split among multiple storage rooms.

The problem is to assign the packages to the storage room so as to minimise the total cost.

My thoughts:

  • I have made a cost matrix.
  • I have thought maybe it might be solved using the Hungarian algorithm. I think it is not applicable because there is an upper limit for the storage room capacity
  • I thought maybe it can be treated as a transportation optimisation problem. I think it is not applicable because the package can't be split among several storage rooms.
os12
  • 13
  • 3
  • Unfortunately I completely agree with your conclusions regarding writing this as an assignment problem or a flow problem. This looks very NP-complete in the general case. I suggest writing this as integer linear programming and letting a solver do the work. – Stef Sep 15 '22 at 14:09
  • Please also note that these kind of questions are super on-topic for https://or.stackexchange.com – Stef Sep 15 '22 at 14:10
  • @Stef thanks a lot for the reply and help. Should I ask it again in or.stackexchange.com ? or migrate the question there (how)? – os12 Sep 15 '22 at 15:21
  • First, try to implement ErwinKalvelagen's answer. – Stef Sep 16 '22 at 08:08

2 Answers2

1

A Mixed-Integer Programming model can look like:

 min sum((p,s),T[p,s]*x[p,s])
 sum(p, Z[p]*x[p,s]) <= C[s]    ∀s
 sum(s, x[p,s]) = 1             ∀p
 x[p,s] ∈ {0,1}

This can be solved with any MIP solver. These assignment models tend to be fairly easy to solve.

Erwin Kalvelagen
  • 15,677
  • 2
  • 14
  • 39
0

This problem is NP-hard by a reduction from the set partition problem. In that problem, you’re given a set S of positive integers, and the goal is to split it into two sets that have the same sum.

You can reduce that problem to this one as follows. Given a set S, sum up its elements to get their total 2n, which we assume is even. Now create three storage rooms, two of size n and one of size 2n. Call the two rooms of size n the “main rooms,” and the room of size 2n the “overflow room.” For each element of the set S, create an item to store whose size is equal to its value. Finally, assign costs as follows: the cost of placing any item into one of the two main rooms is zero, and the cost of placing any item into the overflow room is 1.

Now, think about the cheapest way to place items. If there is a partition of S into two equal sets, then you can place the items in the main rooms at cost 0 using that partition. Similarly, if you can place the items into the rooms at cost 0, then you must not have put any items into the overflow room, and so you have split the items in a way that perfectly fills the two main rooms - a partition.

templatetypedef
  • 362,284
  • 104
  • 897
  • 1,065