Brain Dump

Rod Cutting Problem

Tags
comp-sci

Is a [see page 9, problem] where we have to cut a steel rod of length \( n \) into pieces in order to maximise revenue from selling all the pieces. The cost of each cut is free, rod lengths are an integral number of cm and each rod length \( i \) has its own price.

Rod Cutting Solution example

Table 1: Table of rewards for cutting each rod of length \( i \). tbl:rod-reward
Length \( i \)12345678910
Price \( p_i \)1589101717202430

For a rod of length \( n \) there're \( 2^{n-1} \) [see page 10, ways] to cut it. If we [see page 11, let] \( r_i \) be the maximum revenue for a rod of length \( i \), then the profit from such a cut is \( p_i \) and we are left with a rod of length \( n-i \).

This problem demonstrates optimal substructure:

We get an optimal revenue if:

  • We make an optimal decision for the first cut of length \( i \), and
  • We get an optimal revenue for the remaining rod of length \( n-i \).

This leads to the bellman equation: \[ r_n = \max \{\ p_i + r_{n-i} \; | \; 1 \leq i \leq n \} \]

See [see page 13, bottom up cut rod] and [see page 15, extended bottom up cut rod].