inlove...@gmail.com
unread,Jul 11, 2012, 1:03:48 PM7/11/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I've been searching the net for any good example or explanation on how to use the Package-Merge algorithm to create huffman codes limiting their maximum length.
I understand the Package-Merge algorithm when it's explained with coins of denominational value and "collector's" value. That much is simple and makes sense to me.
I don't quite yet see the jump from coins to huffman codes. Explanations suggest creating X coins for each symbol, where each coin has 2^(-x) denominational value and F (frequency) "collector's" value. OK, but when I start going through the process in my head, I end up with packages that contain coins that reference the same symbol, which doesn't make sense to me.
I looked at the bzip2 source code and how they handle huffman codes that are too long. They just re-adjust the weights (basically divide all by 2) and regenerate the huffman tree until the maximum length is short enough. It's ridiculously simple.
Anyway, is there any explanations, examples, code samples, that actually use the Package-Merge algorithm to generate huffman codes? I'd love to learn more but it seems the net is lacking on good explanations.
Thanks!
Jeremiah