simple problem that can be solved manually but its impossible to come up with a mathematical solution

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.

New contributor

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.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật