Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Hi Limbic. Good to speak to you again. :-) I don't understand some things you have said.

With the Huffman Coding problem I wanted to take any "holes" in the tree and plug them with some high frequency character tuples.

The reason I don't get this is because normally there are no holes in a properly constructed huffman tree. The tree is "full", that is every node either has two child nodes or is a leaf node with no children, or in other words there are no nodes with only 1 child. This is a necessary aspect of huffman encoding.

Your updates seem to suggest that you aren't going to be doing huffman encoding at all, but some kind of dictionary mapping to fixed size output tokens. Also you said:

when comparing the frequencies 'HE' is the biggest bang for the buck. After substituting it, THEN needs to be knocked out of the list entirely.

It is not clear why this is so. Is this because you aren't allowed overlapping sequences? Or some other reason. Can you explain more?

Anyway, it sounds like this problem is NP hard, so if you really want the perfect solution you will have to brute force it. IMO you dont need to, you can find a "good enough" solution with a couple of iterations I should think. Especially as you say a certain set must appear in the table.


In reply to Re: Dynamically Updating Frequency Analysis by demerphq
in thread Dynamically Updating Frequency Analysis by Limbic~Region

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (4)
    As of 2017-12-17 08:40 GMT
    Find Nodes?
      Voting Booth?
      What programming language do you hate the most?

      Results (462 votes). Check out past polls.