Top "Knapsack-problem" questions

The knapsack problem is a problem in combinatorial optimization: Given a set of items with associated weights and values, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and it maximizes the total value.

How do I solve the 'classic' knapsack algorithm recursively?

This is my task The Knapsack Problem is a classic in computer science. In its simplest form it involves trying …

java algorithm knapsack-problem
Why is the knapsack problem pseudo-polynomial?

I know that Knapsack is NP-complete while it can be solved by DP. They say that the DP solution is …

language-agnostic complexity-theory dynamic-programming knapsack-problem
Multiple Constraint Knapsack Problem

If there is more than one constraint (for example, both a volume limit and a weight limit, where the volume …

algorithm recursion knapsack-problem
C++ implementation of knapsack branch and bound

I am trying to a C++ implementation of this knapsack problem using branch and bounding. There is a Java version …

c++ knapsack-problem branch-and-bound
Why does this DP solution to the 0/1 Knapsack Problem not give the correct output with GCC?

#include<stdio.h> int max(int a,int b) { if(a>b) return a; else return b; } …

c knapsack-problem
Solving the Integer Knapsack

I a new to dynamic programing and have tried the integer knapsack problem here at SPOJ (http://www.spoj.pl/…

c++ algorithm dynamic-programming knapsack-problem
How to implement the Sum of Subsets problem in Java

Does anyone know how to implement the Sum-of-Subsets problem in Java from this pseudo code? w = an array of positive …

java knapsack-problem subset-sum
Algorithm design: can you provide a solution to the multiple knapsack problem?

I am looking for a pseudo-code solution to what is effectively the Multiple Knapsack Problem (optimisation statement is halfway down …

algorithm knapsack-problem
Optimal way of filling 2 knapsacks?

The dynamic programming algorithm to optimally fill a knapsack works well in the case of one knapsack. But is there …

algorithm dynamic-programming graph-algorithm knapsack-problem
Calculate a rough estimate for shipping box size

I'm trying to find the best way to calculate the box size needed for shipping. I have 3 shipping containers with …

php shipping knapsack-problem