Algorithm to Optimize Label Making Machine Configurations
Hello everyone,
I’m currently facing a challenge with optimizing the configurations for our label making machines and would appreciate any help or insights. Here’s a brief overview of the situation:
Background:
We have label making machines with a width of 20cm.
Based on the width of the label, we can determine the number of slots available. For instance, if the label’s width is 2.5cm, then we have 8 slots (20cm / 2.5cm).
Orders from customers include different types of labels with varying quantities.
Our goal is to minimize the excess of labels produced or minimize the number of machines used.
Typically, we divide the order across 3 machines, every machine has 8 slots (24 total slots), but sometimes we can manage with 2 or even 1 machine if the order is not complicated.
For every turn, the machine produces the labels placed in its slots. We need to set the number of times the machine has to turn, and what labels to place on the slots to meet the order requirements.
Example Order:
Here’s an example order from a customer and how I manually configured the machines:
MODEL COLOR LABELTYPE QUANTITY REQUIRED
750 SLIM FIT LACIVERT 2829 1148
750 SLIM FIT LACIVERT 3031 4816
750 SLIM FIT LACIVERT 3131 2405
750 SLIM FIT LACIVERT 3229 2405
750 SLIM FIT LACIVERT 3231 7228
750 SLIM FIT LACIVERT 3233 2405
750 SLIM FIT LACIVERT 3331 2405
750 SLIM FIT LACIVERT 3429 2405
750 SLIM FIT LACIVERT 3431 7228
750 SLIM FIT LACIVERT 3433 2405
750 SLIM FIT LACIVERT 3631 4816
750 SLIM FIT LACIVERT 3633 4816
750 SLIM FIT LACIVERT 3833 2405
My Configuration:
First Machine (8 Slots, 2.5cm each, 2405 turns):
Slot formation: 3031, 3031, 3131, 3229, 3233, 3331, 3429, 3433
Second Machine (8 Slots, 2.5cm each, 2405 turns):
Slot formation: 3431, 3431, 3431, 3631, 3631, 3633, 3633, 3833
Third Machine (8 Slots, 2.5cm each, 1148 turns):
Slot formation: 2829, 3231, 3231, 3231, 3231, 3231, 3231, 3231
We are okay with having a %0.1 / %0.2 deficit of labels produced for a specific label type, and okay with having %5 / %10 excess of total labels produced.
We can place the same labeltype on the slots multiple times, but all slots must be filled.
With this example configuration,
Excess/Deficit Analysis:
Total Ordered: 46,816
Total Produced: 47,664
Excess: 848 labels
An other simple example, if we had a customer order of 1000 XL labels, 500 L labels, 250 XS labels and 1000 M labels, with the labels with of 2.5cm, we could do this configuration for the slots:
Use 1 machine, have 8 slots: [XL], [L], [L], [XS], [XS], [XS], [XS], [M] and make the machine turn 1000 times, so we would have in total the required amount of all the labels.
Problem:
I’m looking for a formula or algorithm to find the best possible configuration for our label making machines. The aim is to minimise the excess labels produced or minimise the number of machines used. This formula will have as variables, the slots available per machine (i can calculate that with ease) and the labeltypes and their quantities needed. It would be great to have also a variable to set a max % deficit for a specific order and a max % excess for the total number of labels produced. Using multiple machines are expensive so we would prefer using for example 2 machines instead of 3 even if it results in having more % excess labels produced, when it exceeds %10 we prefer adding an other machine so that is our limit. My goal is to create at the end an excel file where when i input the order and the slots it gives me the best configurations, but for now a simple formula or algorithm would be of great help. Any guidance or suggestions on how to approach this problem would be highly appreciated!
Thank you in advance!
I tried to create a python script but my best attempt was to just bruteforce the calculations and that estimably will take 2+ trillion years per order, so no luck there. Tried ChatGPT and Gemini but they were not consistent and could not be of any help.
Adahan Onur Uğuz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.