I am writing because I have a discrete optimization problem which I have to solve, and I think there might be already some theoretical results or even libraries in Python implementing it (such as OR-Tool from Google).
The problem is the following: I have different objects that are printed using different molds. You can think of objects being little soldiers or anything else. There is a different mold for every kind of object. In total, I have 3 different printers, 2 of which can use (at the same time) 8 molds and 1 which can use 10 molds. When an order for different objects arrives, I have to print all of them trying to minimize the number of prints. There is another side-constraint, which is very important, but which does not have to enter directly the theoretical formulation of the problem: every time I change the molds, I have a huge loss of the printing mater ial. Therefore, minimizing the number of mold replacements is even more relevant than minimizing the number of prints (in other words, it is better to print more times than required the same objects, if I may change the molds one time less).
Here is an example which might help the comprehension:
- Orders:
- Object A: 80
- Object B: 95
- Object C: 101
- ….
- Object Z: 71
- Molds:
- A: 1
- B: 2
- C: 3
- ….
- Z: 1
- Available printers (quantity of molds they handle):
- P1: 8
- P2: 8
- P3 10
Note: a printer always need to be fully loaded with molds.
I thought of a simple algorithm to arrive to a solution for a single printer, exploiting the ratio order/number_of_molds per each object, but I am confident there is something better, even to consider multiple “printer” at the same time. In some sense, it is similar to a bin-packing problem, but it is a bit more complex, with more conditions.