Propagating knapsack constraints in sublinear time
Irit Katriel, Meinolf Sellmann, Eli Upfal, Pascal Van Hentenryck · 2007
We develop an efficient incremental version of an existing cost-based filtering algorithm for the Knapsack constraint. On a universe of n elements, m invocations of the algorithm require a total of O(nlog n + mk log(n/k)) time, where k ≤ n depends on the instance. We show that the expected value of k is significantly smaller than n on several interesting input distributions, hence while keeping the same worstcase complexity, on expectation the new algorithm is faster than the previously best solution which runs in amortized linear time. After a theoretical study, we introduce heuristic enhancements and demonstrate the new algorithm’s performance experimentally.