Given a rod of length n inches and an array of prices (pi, for i = 1...n)
Fantastic news! We've Found the answer you've been seeking!
Question:
a) Describe a greedy algorithm to determine a set of piece sizes to cut up a rod to maximize the value when selling the pieces. For example, given p = [1, 3, 4, 5], the optimal solution would be [2, 2]. That is, a 4- inch rod is divided into two 2-inch pieces worth 3 each, for a total of
6.a) Give a set of prices for which the greedy algorithm does not yield an optimal solution. Show the solution your algorithm yields along with an optimal solution.
Related Book For
Spreadsheet Modeling & Decision Analysis A Practical Introduction to Management Science
ISBN: 978-0324656633
5th edition
Authors: Cliff T. Ragsdale
Posted Date: