Finds
the subset of the specified *File-path*s, which fits into the specified space
with least room to spare, whilst also meeting the minimum usage-requirements;
i.e. a degenerate instance of the "0-1 Knapsack-problem".

Any directories amongst
the specified *File-path*s are treated as atomic units, & therefore only solutions
which involve either all or none of the files contained, are returned.

Because of its exponential time-complexity, solutions of increasing suitability are produced lazily, rather than waiting until the optimal solution is known (which might take an inordinately long time).

**--verbosity=**(**Silent**|**Normal**|**Verbose**|**Deafening**)- Produces additional explanatory output where appropriate.

CAVEAT: to be effective, this option must precede others.

**-v**,**--version**- Outputs version-information, & then exits.
**-?**,**--help**- Displays help, & then exits.

**-M***Bytes*,**--maximumBytes=***Bytes*- Defines the maximum available
space, in bytes; defaulting to the space available on a DVD, i.e.
**4700000000**bytes. **-m***Float*,**--minimumUsageRatio=’***Float***’**- Defines the minimum acceptable usage-ratio
(in the closed unit-interval [0,1]); defaulting to ’
**0.99**’, i.e. 99% of**maximumBytes**. **-z**[*Bool*],**--includeEmpty**[**=***Bool*]- When "
**True**", any empty file or directory, can be a member of all solutions.

The default value, in the absence of this option, is "**False**", but in the absence of only the boolean argument, "**True**" will be inferred.

CAVEAT: for*n*such files or directories, a factor of*2^n*times more viable solutions exist, obscuring the minimal solutions on which they’re based.

**-r**[*Int*],**--randomSeed**[**=***Int*]- This option takes an optional integral argument
with which to seed the unique random-number generator used for all random
operations.

In the absence of this option, the random-number generator will be seeded unpredictably from the operating-system, but in the absence of only the integral argument, "**0**" will be inferred.

CAVEAT: to be effective, this option must precede either "**testPerformanceContinuous**" or "**testPerformanceDiscrete**". **--testPerformanceContinuous=’(***Integer***,****LogNormalDistribution***location**scale^2***)’**- Measures the CPU-time required to find the best fit, for
the specified number of randomly generated virtual files, the size of which
conform to the specified continuous probability-distribution; & then exits.

"*A Large-Scale Study of File-System Contents by John R. Douceur and William J. Bolosky*" concludes that for arbitrary file-types, the frequency of file-sizes matches this distribution. **--testPerformanceDiscrete=’(***Integer***,****PoissonDistribution***lambda***)’**- Measures the CPU-time required to find the best fit, for the specified
number of randomly generated virtual files, the size of which conform to
the specified discrete probability-distribution; & then exits.

CAVEAT: the standard-deviation for this distribution is narrower than observed.

- If
*File-path*is a single hyphen-minus ("**-**"), then the list of file-paths will be read from standard-input.

**ls -p**

We want to find which combinations can be stored on a CD without wasting inordinate amounts of space.

**squeeze -M 700000000 -m 0.999 ***

Note that the proposed solutions don’t split any of the directories, into their constituent files.

We can confirm the validity of the optimal result:

**find ArabStrap BobDylan JoniMitchell ReservoirDogsOST SethLakeman TeddyThompson Vangelis -type f -print | perl -e ’use List::Util qw(sum); printf(qq(%d\n), sum map { chomp; (stat)[7] } <>);’**

N.B.: "**du**" will return a slightly larger size, since it includes the space
required for directory-structures.

N.B.: from version

**squeeze -M 700000000 -m 0.99999 ArabStrap BobDylan/* JeffBuckley JohnMartyn JoniMitchell ReservoirDogsOST RichardThompson SethLakeman SusheelaRaman TeddyThompson Vangelis +RTS -N**

**squeeze -M 700000000 -m 0.9999999 ArabStrap BobDylan/* JeffBuckley JohnMartyn JoniMitchell ReservoirDogsOST $(find RichardThompson -type f) SethLakeman SusheelaRaman TeddyThompson Vangelis**

**^C**

The exact match isn’t unexpected, given the 2^71 possible combinations. The process was terminated after this solution was found, though where time permits, one may choose to wait for alternative exact matches.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should
have received a copy of the GNU General Public License along with this
program. If not, see **<https://www.gnu.org/licenses/
>**.

- Home-page:
**https://functionalley.com/Squeeze/squeeze.html** **https://hackage.haskell.org/package/squeeze****https://github.com/functionalley/Squeeze**- Source-documentation is generated by "
**Haddock**", & is available in the distribution. **https://www.haskell.org/haddock/****https://en.wikipedia.org/wiki/Log-normal_distribution****https://en.wikipedia.org/wiki/Poisson_distribution**