A file compressor is great for shrinking stored files, but it depresses me whenever I see a file grow instead of shrink. So what I am looking for is a file compression algorithm that never inflates any files, although it is allowed that some files (not all of course!) have the same length after "compression". Ideally it should work on files of all sizes, but I would be satisfied with a compressor that operates only on files larger than 1MB.
Can you provide such an algorithm? No programming knowledge is required for this problem.
The zipper replaces one (arbitrarily chosen but fixed) file by a file of length 0, and leaves all others unchanged. The unzipper knows that the compression only works for files above a certain minimum size (say, 1MB) and has the special fixed file hard-coded into it, so it can restore all files.
This method analogously works for files which are at least 1 byte in length. And because we map one file to a zero-length file, not all files remain the same size after compression.
The requested compression algorithm is a one-to-one map from files above a certain size to the set of all files, which is its (genuine) superset. So by imposing a minimum uncompressed file size, one can fulfil the criteria requested in the problem.
|
Posted by vswitchs
on 2006-10-20 16:50:57 |