16 November 2024 10:04:29 AM knapsack_rational_test(): C++ version Test knapsack_rational(). knapsack_reorder_test(): knapsack_reorder() reorders the knapsack data. Object, Profit, Mass, Profit Density 0 24 12 2 1 13 7 1.85714 2 23 11 2.09091 3 15 8 1.875 4 16 9 1.77778 After reordering by Profit Density: Object, Profit, Mass, Profit Density 0 23 11 2.09091 1 24 12 2 2 15 8 1.875 3 13 7 1.85714 4 16 9 1.77778 knapsack_rational_test(): knapsack_rational() solves the rational knapsack problem. Object, Profit, Mass, Profit Density 1 24 12 2 2 13 7 1.85714 3 23 11 2.09091 4 15 8 1.875 5 16 9 1.77778 After reordering by Profit Density: Object, Profit, Mass, Profit Density 1 23 11 2.09091 2 24 12 2 3 15 8 1.875 4 13 7 1.85714 5 16 9 1.77778 Total mass restriction is 26 Object, Density, Choice, Profit, Mass 1 2.09091 23 11 2 2 24 12 3 1.875 5.625 3 4 1.85714 0 0 5 1.77778 0 0 Total: 52.625 26 knapsack_rational_test(): Normal end of execution. 16 November 2024 10:04:29 AM