knapsack and primalgorithm