in reply to Seeking general directions for a Windows specific app
I'm not inclined to prove it, but your problem seems to be at least NP complete.# warning: untested! use List::Util 'sum'; use Math::Combinatorics 'combine'; # @edges is the sequence of operations # edge_value and has_common_drive are left as an excercise to the impl +ementer my %seen = (); my $fitness = sum( # sum up operations until blocking map { sum( map { edge_value($_) } @edges[ $_->[0] .. $_->[1] - 1 ] ) } # take only the first collision after an operation grep {not $seen{$_->[0]}++} # sort collisions by distance between sort { $a->[1] - $a->[0] <=> $b->[1] - $b->[0] } # find colliding operations grep { has_common_drive( @{$edges}[@$_] ) } # all combinations of operations combine(2, 0..$#edges) );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Seeking general directions for a Windows specific app
by Jenda (Abbot) on Aug 14, 2008 at 14:38 UTC | |
by blazar (Canon) on Aug 14, 2008 at 22:41 UTC |