Given a set of constraints, how would you implement a solution to a variation of the Knapsack problem?