8 my ($src, $dst) = /(\d+)/g;
9 push @{ $neigh{$src} }, $dst;
10 push @{ $neigh{$dst} }, $src;
17 my ($score, @path) = @_;
19 if (!$mlen || $mlen < @path) {
22 } elsif ($mlen && $mlen == @path) {
23 $max = $score if $max < $score;
25 # say "$score: ", join(' ', @path);
26 for my $next (@{ $neigh{$now} }) {
27 next if $used{$now,$next} || $used{$next,$now};
28 $used{$now,$next} = 1;
29 walk ($score + $now + $next, @path, $next);
30 delete $used{$now,$next};