Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7886155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:14:52+00:00 2026-06-03T05:14:52+00:00

I’m writing an application to use in the lumber yard. Given a number of

  • 0

I’m writing an application to use in the lumber yard. Given a number of board or beam lengths, the goal is to calculate the number of boards needed while minimizing waste. For example, one might have the following shopping list for one particular dimension:

3x 2.9 meters
5x 1.6 meters
21x 0.9 meters

At the lumber yard, one would check the available lengths of boards and enter it into the application. Lets say that this dimension is available in 4.8 meters lengths.

A simple approach would be to try and fit the remaining boards in descending lengths:

2.9 + 2.9 = 5.8 so that won’t fit on a 4.8 meter board
2.9 + 1.6 = 4.5 so that’s ok.

No length is less than the remaining 0.3 meters so this board is “full”. We will fit two more of this type, and then we have the following lengths left to fit:

2x 1.6 meters
21x 0.9 meters

Ok, so this algorithm works reasonably well. But what if we instead of fitting the 2.9 + 1.6, we fit 2.9 + 0.9 + 0.9 = 4.7 instead. We will then get 0.1 meters waste per board, instead of 0.3 meters.

One problem in enumerating all possible combinations is that each length might appear more than once in a board, and the number of lengths fitted in a board will vary as well. Is there a known algorithm I can use to minimize the total waste for all boards?

Also, what if there are two or more lengths available at the lumber yard? For instance 5.4, 4.8 and 3.6 meters? This will surely complicate things. One could run the selected algorithm for each available length and pick the length with the least amount of waste. But the most elegant solution would allow mixing the available lengths, so the optimum answer might be something like 1x 5.4, 3x 4.8, 6x 3.6. But for starters, I would be happy with limiting the the answer to one length.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:14:53+00:00Added an answer on June 3, 2026 at 5:14 am

    Your particular problem is a variant of the so-called "Cutting Stock" class of problems.
    Take a look at Wikipedia’s "Cutting Stock Problem" (CSP) page

    I like this explanation in plain English of a simpler version of the Cutting Stock Problem.
    From AIMMS:

    "Cutting stock problem: how to cut long rolls of material (referred to
    as raws) into smaller rolls of a prescribed size (referred to as
    finals), given a demand for each of the finals."

    This pdf by AIMMS is good.

    Note that there are quite a number of variations to the Basic Cutting Stock Problem that researchers have come up with. These Integer Programming lecture notes good formulation of the generalized Cutting Stock problem (see page 17)

    These MILP problems are not very difficult to formulate because the objective function and the constraints follow the basic pattern of the standard CSP. A huge body of research exists on techniques to solve them efficiently.

    If you have access to an LP/IP solver such as CPLEX, R, or the Excel Solver (for smaller problems), it is definitely worth formulating your problem and trying it on these solvers.

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am writing an app with both english and french support. The app requests
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.