in reply to Re^3: Help required in optimizing the output (PERL)
in thread Help required in optimizing the output (PERL)

a hash containing - which words are contained in a paragraph another hash containing - which paragraphs contains which words.

As worded, both those hashes contain the same information? Please clarify.

Also, how many paras (not lines, or GB)? And how many (key)words?

Finding the optimal solution is NP-hard--brute force is essentially the only way. But there are some efficient mechanisms for testing permutations; and others that can help prune the search space; but we need to know the scale of the parameters.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy
  • Comment on Re^4: Help required in optimizing the output (PERL)