We help IT Professionals succeed at work.
Get Started

One dimensional linear stock cutting problem

troyd1 asked
Last Modified: 2008-02-01
Our company does counter tops and I need to write a program to minimize scrap. Before I re-invent the wheel, does someone already have and code or psuedo code for this. Here is the parameters for the subroutine I need to write for this project:

Inputs Arrays(assume all input is in inches:
P.LENS - Pieces to be cut lengths
B.LENS - Blanks available lengths
B.QTYS - Blanks available quantities

Outputs(assume all output is in inches):
For each length in the P.LENS array
P.LENS - See above
B.LENS.USED - the blank length used to cut the piece.
SCRAP - Scrap inches.

I am looking for an optimization solution or one that checks every combination. The number of pieces I have is relatively small so a brute force solution is possible. The max I will have is 3 or 4 blanks sizes and 12 required cut pieces.

Thanks, Troy
Watch Question
This problem has been solved!
Unlock 4 Answers and 12 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE