Next | You can't get there from here | 11 |
The problem is with this line:
for my $cargo (all_selections($items)) {
As @$items gets larger, the number of possible selections gets large very fast
Number of items Number of cargoes
1 1 2 3 3 7 4 15
10 1,023 15 32,767 20 1,048,575
30 1,073,741,823
100 1,267,650,600,228,229,401,496,703,205,375
For n items, this algorithm takes time proportional to 2n
Next | Copyright © 2005 M. J. Dominus |