# How to calculate the optimal distribution of lines with different lengths into larger lines with fixed lengths

Background: DYI project with floorboards. Floorboard is sold in 3m pieces. I need lots of smaller cuts with different lengths.

Now I need a way to calculate the optimal distribution of floorboard-cuts per 3m floorboard unit, so the least material is wasted.

It’s probably really simple, but my math knowledge is basically nonexistent.

Thanks! 🙂

Here’s the data, if you’re interested:

16x 800
9x 762
4x 210
2x 371
4x 800
4x 380
2x 698
8x 736

=================

DYI = Do Yourself In? 🙂 I expect that you really want DIY.
– Brian M. Scott
2 days ago

Is the unit cm at your table ?
– callculus
2 days ago

What do the numbers in your table mean? Does “1616x 800800” mean you need sixteen pieces that are each 800800 centimeters long? You can’t cut those from three-meter pieces. The nice thing about floorboards is you can use multiple pieces in line with each other. After cutting the last piece in the line to fit you can use the cut-off piece to start the next row, and so forth. You could try making a scale model of the boards and the floor to lay them on if you want to see how it works without cutting actual boards.
– David K
2 days ago

@DavidK: Ah, sorry, no. It means 16 pieces of 800mm floorboard. Only the length is relevant, the width and depth is always the same (95×19, but completely irrelevant here). Thing is, I go to the hardware store, take out the needed number of “raw” floorboards, and tell them exactly how to cut them. So I should have it all planned out in advance.
– kraligor
2 days ago

@callculus: It’s mm. quantity times length in mm.
– kraligor
2 days ago

=================

=================