Mon Apr 14 09:59:50 2025 knapsack_random_test(): python version: 3.10.12 numpy version: 1.26.4 Test knapsack_random() knapsack_random_test01(): knapsack_random() random selects a subset of n items and considers it as a solution to a knapsack problem. Maximize profit without exceeding weight limit. Weight limit is 170 Number of items is 7 Number of subsets is 128 Value array [442. 525. 511. 593. 546. 564. 617.] Weight array [41. 50. 49. 59. 55. 57. 60.] Selected items: [0 0 1 1 0 0 1] Weight 168.0 Value 1721.0 Ratio 10.244047619047619 Selected items: [0 1 0 0 0 1 1] Weight 167.0 Value 1706.0 Ratio 10.215568862275449 Selected items: [1 0 0 1 1 0 0] Weight 155.0 Value 1581.0 Ratio 10.2 Selected items: [0 0 1 1 1 0 0] Weight 163.0 Value 1650.0 Ratio 10.122699386503067 Selected items: [0 1 0 0 0 1 1] Weight 167.0 Value 1706.0 Ratio 10.215568862275449 Selected items: [1 0 0 0 0 1 1] Weight 158.0 Value 1623.0 Ratio 10.272151898734178 Selected items: [0 1 1 0 0 1 0] Weight 156.0 Value 1600.0 Ratio 10.256410256410257 Selected items: [0 1 0 0 0 1 1] Weight 167.0 Value 1706.0 Ratio 10.215568862275449 Selected items: [0 1 0 1 1 0 0] Weight 164.0 Value 1664.0 Ratio 10.146341463414634 Selected items: [1 0 1 0 1 0 0] Weight 145.0 Value 1499.0 Ratio 10.337931034482759 knapsack_random_test(): Normal end of execution. Mon Apr 14 09:59:50 2025