Possibility Program for number of pieces

Posted by Brad on Programmers See other posts from Programmers or by Brad
Published on 2011-11-29T14:46:31Z Indexed on 2011/11/29 18:01 UTC
Read the original article Hit count: 152

Filed under:
|

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?

© Programmers or respective owner

Related posts about database

Related posts about algorithms