The Skirting Board Problem

John 'Jake' JacobAPLLeave a Comment

The object of this weeks problem is to find the best way to cut the boards as purchased into lengths of skirting so that joins in the skirting are avoided when fitted to the walls.

For example:


⍝ from boards in metres
b←5.2 4.6 4.3 4.3 4 3.8
⍝ cut skirts in metres
s←3.2 1.2 0.25 0.15 0.15 0.25 1.2 0.8 0.3 1 1.4 1 0.3 0.8 3.6 3.6 2

Write a routine to calculate the optimum cutting pattern to produce un-jointed skirts from boards. Allow 40 mm at each end of a skirt for any mitring. The optimum cut will have the largest off-cut leftover.