0/1 knapsack

staym at accessdata.com staym at accessdata.com
Tue Nov 17 11:08:52 PST 1998



A knapsack is a container that can only hold so much of something.  You
have a collection of objects with a weight and/or volume and a value. 
You want to maximize the value.  Fractional knapsack problems concern
things like flour and sugar, that you can measure out a fractional unit
of.  In 0/1 knapsack problems, you have a collection of objects: either
you put in the TV or you don't; no half-TV's.

Quoting from _Introduction to Algorithms_ (Cormen, Leiserson, & Rivest),
'Dynamic programming, like the divide-and-conquer method, solves
problems by combining the solutions to subproblems. ("Programming" in
this context refers to a tabular method, not to writing computer code.)
... Divide-and-conquer algorithms partition the problem into independant
subproblems, solve the problems recursively, and then combine their
solutions to solve the original problem.  In contrast, dynamic
programming is applicable when the subproblems are not independent..."
-- 
Mike Stay
Cryptographer / Programmer
AccessData Corp.
mailto:staym at accessdata.com






More information about the cypherpunks-legacy mailing list