Linear formulation for the knapsack problem