A knapsack problem generator