<?xml version="1.0" encoding="windows-1252"?>
<node id="80295" title="Re: (Golf) Minimizing the Bacon Number" created="2001-05-14 19:08:09" updated="2005-07-29 06:19:28">
<type id="11">
note</type>
<author id="17251">
MeowChow</author>
<data>
<field name="doctext">
Damn you and your &lt;strike&gt;NP-complete&lt;/strike&gt; problems! =) Well, I'm lazy, and decided to implement a greedy, suboptimal heuristic:
&lt;code&gt;
sub bacon {
  my%t=@_;(sort{@{$t{$b}}&lt;=&gt;@{$t{$a}}}keys%t)[0]
}
&lt;/code&gt;
At least it's fast, if not correct. :)
&lt;pre&gt;
  &lt;a href="/index.pl?node=MeowChow"&gt; MeowChow                                   &lt;/a&gt;
               s aamecha.s a..a\u$&amp;owag.print&lt;/pre&gt;</field>
<field name="root_node">
80272</field>
<field name="parent_node">
80272</field>
</data>
</node>
