I would like to put a program together to calculate the number of 60' pieces would be needed from a list of shorter pieces. For example, I sell rebar cut to length from our standard length of 60'-0". Now the length the customer requires are as follows:
343 pc @ 12.5' 35 pc @ 13' 10 pc @ 15' 63 pc @ 15.5'.......
There are 56 total lengths ranging from 12.5' to 30.58'
The idea is to limit the amount of waste from the 60' piece. The input from the user would be:
- number of differnt lengths
- Length of piece to cut from
- count of different lengths
The result would be the number of prime pieces needed to fulfill the order.
What well-known algorithms exist that could help me solve this problem?