Quadratic Knapsack Problem Algorithm