test knapsack based on decision tree