home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!seismo!darwin.sura.net!gatech!usenet.ins.cwru.edu!agate!doc.ic.ac.uk!pipex!demon!genesis.demon.co.uk!fred
- From: fred@genesis.demon.co.uk (Lawrence Kirby)
- Newsgroups: comp.compression
- Subject: Re: Unix release? (Was etc.
- Message-ID: <727889693snz@genesis.demon.co.uk>
- Date: 24 Jan 93 15:34:53 GMT
- References: <9cl333-@rpi.edu>
- Sender: usenet@demon.co.uk
- Organization: BT
- Lines: 33
- X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
-
- In article <9cl333-@rpi.edu> sigma@degas.ipl.rpi.edu writes:
-
- >madler@cco.caltech.edu (Mark Adler) writes:
- >>Or perhaps you think that the other zipsplit optimizes the chunks
- >>better. I don't know what algorithm the other zipsplit uses, but
- >>our's uses a simple "greedy" algorithm that achieves the optimum in
- >>nearly all cases with typical distributions of entry sizes. The
- >>chunk optimization is an NP-complete problem, so there are lots of
- >>approximate approaches to the solution.
- >
- >This is what's called the Knapsack Problem. It's NP-complete, but since
- >your knapsack is usually relatively small compared to the total size of the
- >files, an early-out algorithm which avoids combinations which will
- >obviously not fit actually has to check very few combinations. Even with
- >four hundred files, I've never had to check more than 30000 combinations
- >(well, my program does - not myself by hand) to get a perfect fit.
- >
-
- The knapsack problem deals with a single knapsack (i.e. disk) and is NOT
- NP-complete. It's a common example of dynamic programming where the optimal
- solution can be derived in order NM time where N is the number of items
- (files) and M is the knapsack size (i.e. number of disk allocation units). To
- put it another way for a fixed disk size (such as 1.44MB) the algorithm is
- linear in N.
-
- Optimising allocation over multiple volumes is more complex and the solution
- isn't in general the same as optimising each volume in sequence. This *may*
- be NP-complete, but I would need to be convinced!
-
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-