Search⌘ K
AI Features

Rod Cutting Problem

Understand how to solve the rod cutting problem by applying recursive dynamic programming. Explore how to find maximum revenue by considering all possible rod piece combinations and learn the impact of exponential time complexity on the solution.

We'll cover the following...

Problem statement

You are given a rod of size n > 1, it can be cut into any number of pieces k. The price for each piece of size i is represented as price(i) and the maximum revenue from a rod of size i is r(i) (could be split into multiple pieces). Find r(n) for the rod of size n.

Consider that the length of the rod is 6. The price of size is given below:

Length 1 2 3 4 5 6
Price(p) 2 5 8 9 10 11

The possible number of rods after cutting can give the following price:

Rod(6) 1*6 1*4, 2 1*3, 3 1, 2, 3 1*2, 4 1, 5 2*3 2, 4 3, 3
Price(p) 12 13 14 15 13 12 15 13 16

So the ...