Chapter 6: 14E (page 169)
Cutting cloth. You are given a rectangular piece of cloth with dimensions , where and are positive integers, and a list of products that can be made using the cloth. For each product you know that a rectangle of cloth of dimensions is needed and that the final selling price of the product is . Assume the, and are all positive integers. You have a machine that can cut any rectangular piece of cloth into two pieces either horizontally or vertically. Design an algorithm that determines the best return on the piece of cloth, that is, a strategy for cutting the cloth so that the products made from the resulting pieces give the maximum sum of selling prices. You are free to make as many copies of a given product as you wish, or none if desired.
Short Answer
Using dynamic programming, the required algorithm can be implemented with time complexity .