Optimality Principle 2
The second lowest probability is a sibling of the the smallest in some optimal Huffman tree.
If not, we can move it there not raising the cost.
p
q
T
p smallest
q 2nd smallest
q < r
r
p
r
T’
q
C(T’) = C(T) + 4q - 4r + 2r - 2q = C(T) - 2(r-q) > C(T)
Previous slide
Next slide
Back to first slide
View graphic version