my @order = sort {
$Costs[$a]+$Trims[$a]*$Costs[$b] <=> $Costs[$b]+$Trims[$b]*$Costs[
+ $a]
} 0..$#Costs;

I'm pretty sure that this is the optimal solution, but I'm too lazy to write down the complete mathematical proof.

The basic idea is that the terms represent the general cost difference of swapping the first and the second filter¹!

So by sorting you get a solution which can't be improved by a pairwise swapping and any permutation can be represented by a sequence of pairwise swaps.

¹) see restructured formula for c in Re^2: Evolving a faster filter? (combinatorics) and you will notice that these are the first elements and the rest is fix.

UPDATE:

basic transformations lead to a simpler solution:

my @order = sort {
$Costs[$a]/(1-$Trims[$a]) <=> $Costs[$b]/(1-$Trims[$b])
} 0..$#Costs;

which can be precalculated to save calculation time

my @order = sort {
$weight[$a] <=> $weight[$b]
} 0..$#Costs;

(the edge case of a division by zero must be handled as practically infinity)

Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
& &
< <
> >
[ [
] ]

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 ^{?}

remember me
What's my password?
Create A New User
Chatterbox ^{?}

and the web crawler heard nothing...
How do I use this? | Other CB clients
Other Users ^{?}
Others having an uproarious good time at the Monastery: (9)As of 2015-07-30 10:13 GMT
Sections ^{?}
Information ^{?}
Find Nodes ^{?}
Leftovers ^{?}
Voting Booth ^{?}
The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...

Priority 1, Priority 2, Priority 3
Priority 1, Priority 0, Priority -1
Urgent, important, favour
Data loss, bug, enhancement
Out of scope, out of budget, out of line
Family, friends, work
Impossible, inconceivable, implemented
Other priorities

Results (271 votes) ,
past polls