Branch boundary thinking solution 0-1 knapsack algorithm