knaptime/continuousthreshold/mod.rs
1//! # Continuous Threshold Knapsack
2//! A variant of the knapsack problem.
3//!
4//! Normally you need to have fixed precision in order to calculate the optimal solution. Floating point numbers have too much precision.
5//! You might be able to get away with using dpwalkback, but not when there's a lot of items.
6//!
7//! An alternative approach is to use probability to find a solution that has some % chance of fitting/being the optimal solution.
8//! There's a percentage chance that it'll be the optimal solution/undershoot/overshoot, but the distribution should be centered around the optimal solution.
9//!
10//! TODO: Do the actual math/experimentally verify this
11//!
12//! Given a list of items with associated weights and values.
13//! Maximize the value while ensuring the weight is minimal (weight must be greater than or equal to a given threshold).