I am working on a self-study project but I cannot come up with a reliable answer.

Here is the deal:

I start with 500cm sticks. I have orders from customers who want smaller sticks. I am willing to cut my 500cm stick into as many as 7 pieces.

How can I determine which combination of customer orders to use for each stick to minimize waste?

This is some sample customer order data:

+-----------+--------+
| Firm Name | Length |
+-----------+--------+
| "firm1",  | 34,    |
| "firm2",  | 43,    |
| "firm3",  | 52,    |
| "firm4",  | 61,    |
| "firm5",  | 62,    |
     ...
| "firm26", | 102,   |
| "firm27", | 152,   |
| "firm28", | 153,   |
| "firm29", | 163,   |
| "firm30", | 202,   |
+-----------+--------+

The important part is the algorithm should give minimize scrap.

I thought that I could use a genetic algorithm but it does not return the correct solution every time.

The important thing is all cutting to pieces work orders must be 500cm in total. Or it should be near to that length according to given waste length. Quantity could be higher than the order and can be put to the stock.

7

This particular problem is a variation on a well known (and well studied) problem known as the cutting stock problem.

In the classic definition of this problem, consider that you have large rolls of product of a given width. You need to cut them into the smaller width rolls with minimum waste (and knife changes):

rolls of paper cut

The reason that this is so well studied is that it has huge impacts on industrial processes with even small gains in efficiency. It shows up in paper (rolls of paper), film (rolls of film), and metal industries with additional interesting variations for each of them (cutting paper to A4 size involves two cuts on different machines that can have different specifications (one being cheaper). The glass industry has another similar problem known as the guillotine problem because it needs to get cut into rectangular pieces rather than working with rolls.

This problem is also equivalent to the knapsack problem.

Knowing these things, there are a number of different algorithms that attempt to solve this class of problem that goes into a too many funky math symbols, conjectures, and other papers.

Good enough answers are possible quickly, perfect answers take a long time because you will need to enumerate most if not all of the possibilities.

1

I did some work in a college operating systems class about allocation of memory blocks with different sized files using the best-fit, worst-fit, first-fit algorithms, which if you think about it is essentially the same process for this problem. The overarching theme was without knowing all of the requests ahead of time you can’t go through all the possible orientations and find the ‘least’ scrap. You can get close using something like best-fit but then a different set of orders could make that worse than first-fit and so on as you can’t guarantee to look forward far enough to optimize everything fully in a realistic system.

Just doing some quick situations with a few sticks and a few orders and varying the order in which the orders come in should explain why any algorithm you have might not always return the ‘most correct’ solution.

You’re asking about a class of equivalent problems i.e. the bin-packing algorithm (which is NP hard see http://en.wikipedia.org/wiki/Bin_packing_problem). You can’t guarantee a perfect solution for any number of customers and sticks within a (reasonable) linear amount of time. What you can do is use heuristics to get a ‘best effort’ solution.

Check out bin packing and think about how to map your problem to the usual best effort solutions is probably the best approach.

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