Knapsack heuristic solver