Tue May 20 21:46:01 2025 knapsack_random_test(): python version: 3.10.12 numpy version: 1.26.4 Test knapsack_random() subset_random_test(): Test subset_random() Subsets will be of size n = 5 7 : [0 0 1 1 1] 2 : [0 0 0 1 0] 29 : [1 1 1 0 1] 12 : [0 1 1 0 0] 0 : [0 0 0 0 0] 31 : [1 1 1 1 1] 3 : [0 0 0 1 1] 13 : [0 1 1 0 1] 25 : [1 1 0 0 1] 20 : [1 0 1 0 0] knapsack_random_test01(): knapsack_random() randomly selects a subset of n items and considers it as a solution to a knapsack problem. Maximize profit without exceeding weight limit. Number of items is 5 Value array [24 13 23 15 16] Weight array [12 7 11 8 9] Weight limit is 26 Selected items: [1 0 1 0 0] Weight 23 Value 47 Ratio 2.0434782608695654 Selected items: [1 1 1 0 0] Weight 30 exceeds weight limit 26 Selected items: [0 1 0 0 0] Weight 7 Value 13 Ratio 1.8571428571428572 Selected items: [0 1 1 0 1] Weight 27 exceeds weight limit 26 Selected items: [0 1 1 0 0] Weight 18 Value 36 Ratio 2.0 Selected items: [1 1 1 0 1] Weight 39 exceeds weight limit 26 Selected items: [1 1 0 0 1] Weight 28 exceeds weight limit 26 Selected items: [1 0 1 0 1] Weight 32 exceeds weight limit 26 Selected items: [0 0 1 0 1] Weight 20 Value 39 Ratio 1.95 Selected items: [0 0 0 1 0] Weight 8 Value 15 Ratio 1.875 knapsack_random_test(): Normal end of execution. Tue May 20 21:46:01 2025