May 2019
Intermediate to advanced
698 pages
17h 21m
English
The knapsack problem is very real: any time you fly with a cheap airline with cabin baggage only, things get complicated. Do I really need this? I could just leave my DSLR at home and use my phone for pictures, right?
These are statements that express the potential value of an item and the considerations regarding its weight (or volume on these flights), and we typically want to bring the most valuable (to us) items on a trip. While this smells like an algorithmic problem, it's far from simple. Let's start with the goal:
Given n items (with weights and values), find the subset of items providing the highest value without exceeding the knapsack's capacity, W.
Derived from this, the way to implement ...
Read now
Unlock full access