testcase01.txt 7 11 XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX testcase02.txt 107 7 XXXXXXXXXX XXXXXXXXXX testcase03.txt 31 7 XXXXXXXXXX XXXXXXXXXX testcase04.txt 32 7 XXXXXXXXXX XXXXXXXXXX testcase05.txt 42 11...

http://marvin.cs.uidaho.edu/Teaching/CS472/pas02.pdf


testcase01.txt 7 11 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 0.0 testcase02.txt 107 7 1.0 2.0 4.0 8.0 16.0 32.0 64.0 testcase03.txt 31 7 1.0 2.0 4.0 8.0 16.0 32.0 64.0 testcase04.txt 32 7 1.0 2.0 4.0 8.0 16.0 32.0 64.0 testcase05.txt 42 11 2.0 3.0 5.0 7.0 11.0 13.0 17.0 19.0 23.0 29.0 31.0 testcase06.txt 107 11 2.0 3.0 5.0 7.0 11.0 13.0 17.0 19.0 23.0 29.0 31.0 testcase07.txt 500 20 109.60 125.48 52.16 195.55 58.67 61.87 92.95 93.14 155.05 110.89 13.34 132.49 194.03 121.29 179.33 139.02 198.78 192.57 81.66 128.90 // Data from Chapter 10 of Machine Learning: An Algorithmic Perspective (2nd Edition) // by Stephen Marsland (http://stephenmonika.net) testcase08.txt 500 10 193.71 60.15 89.08 88.98 15.39 238.14 68.78 107.47 119.66 183.78 // Data from Chapter 10 of Machine Learning: An Algorithmic Perspective (2nd Edition) // by Stephen Marsland (http://stephenmonika.net) testcase09.txt 666 25 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 testscript #!/bin/sh # usage: knapsack echo echo knapsack 20 100 3 0 < testcase01.txt="" knapsack="" 20="" 100="" 3="" 0="">< testcase01.txt="" echo="" echo="" knapsack="" 20="" 100="" 3="" 0="">< testcase02.txt="" knapsack="" 20="" 100="" 3="" 0="">< testcase02.txt="" echo="" echo="" knapsack="" 20="" 100="" 3="" 0="">< testcase03.txt="" knapsack="" 20="" 100="" 3="" 0="">< testcase03.txt="" echo="" echo="" knapsack="" 20="" 200="" 3="" 0="">< testcase04.txt="" knapsack="" 20="" 200="" 3="" 0="">< testcase04.txt="" echo="" echo="" knapsack="" 20="" 100="" 3="" 0="">< testcase05.txt="" knapsack="" 20="" 100="" 3="" 0="">< testcase05.txt="" echo="" echo="" knapsack="" 20="" 100="" 3="" 0="">< testcase06.txt="" knapsack="" 20="" 100="" 3="" 0="">< testcase06.txt="" echo="" echo="" knapsack="" 100="" 500="" 3="" 0="">< testcase08.txt="" knapsack="" 100="" 500="" 3="" 0="">< testcase08.txt="" echo="" echo="" knapsack="" 10="" 500="" 3="" 0="">< testcase09.txt="" knapsack="" 10="" 500="" 3="" 0="">< testcase09.txt="" echo="" echo="" knapsack="" 100="" 5000="" 3="" 0="">< testcase07.txt="" knapsack="" 100="" 5000="" 3="" 0="">< testcase07.txt="" echo="" echo="" knapsack="" 100="" 5000="" 3="" 0.2="">< testcase07.txt="" knapsack="" 100="" 5000="" 3="" 0.2="">< testcase07.txt="" echo="" echo="" knapsack="" 100="" 5000="" 3="" 0.5="">< testcase07.txt="" knapsack="" 100="" 5000="" 3="" 0.5="">< testcase07.txt="" echo="" echo="" knapsack="" 100="" 5000="" 3="" 0.8="">< testcase07.txt="" knapsack="" 100="" 5000="" 3="" 0.8="">< testcase07.txt="" echo="" echo="" knapsack="" 100="" 5000="" 3="" 1="">< testcase07.txt="" knapsack="" 100="" 5000="" 3="" 1="">< testcase07.txt testscript.out knapsack 20 100 3 0 .x....x.xxx 4.000000 x..xxx..... 4.000000 x.xxxx.x.x. 7.000000 x.xx...x.xx 5.000000 x.x.x.....x 3.000000 .x.x.xxx.xx 6.000000 xxx.xxx.xx. 6.000000 xx.x...xxx. 6.000000 x..xx.x..xx 5.000000 ..xxx.x..xx 5.000000 x..xxxxx.x. 7.000000 x.xxxxxxx.. 6.000000 .........x. 1.000000 x..xxx.x..x 5.000000 xxx.xxxxx.. 6.000000 xx..x...xxx 5.000000 ...xx.x.xxx 5.000000 x...x.x.... 3.000000 .x.xxxxx... 6.000000 .....xx..x. 3.000000 found gen 1 :x.xxxx.x.x. 7.000000 knapsack 20 100 3 0 x.xx.xx 105.000000 x.xx.xx 105.000000 xx.x.xx 107.000000 x.xx.x. 45.000000 x.xx..x 77.000000 ..xx.xx 106.000000 xx.xxxx 91.000000 ..xx..x 76.000000 x.xx.xx 105.000000 xxxx..x 79.000000 x.x..xx 101.000000 x.x.x.x 85.000000 .x...xx 98.000000 .xxx.xx 104.000000 .xx..x. 38.000000 x.xx.xx 105.000000 x.xx.xx 105.000000 .xx..xx 102.000000 .xxxxxx 88.000000 ..xx.xx 106.000000 found gen 5 :xx.x.xx 107.000000 knapsack 20 100 3 0 x....x. 29.000000 x....x. 29.000000 xxx..x. 23.000000 xx...x. 27.000000 x.x..xx -39.000000 xxxxx.. 31.000000 .x.xx.. 26.000000 .x....x -4.000000 ..x..x. 26.000000 x....x. 29.000000 .x..... 2.000000 x...... 1.000000 xxx.... 7.000000 .xxx... 14.000000 xx.x... 11.000000 x....x. 29.000000 x....xx -35.000000 x....x. 29.000000 xx...x. 27.000000 .xxx.x. 16.000000 found gen 3 :xxxxx.. 31.000000 knapsack 20 200 3 0 x....x. 31.000000 .x...x. 30.000000 .....x. 32.000000 .xx..xx -38.000000 xxx.xx. 9.000000 .x...x. 30.000000 xx..... 3.000000 .x...xx -34.000000 ....xxx -48.000000 xx..... 3.000000 xx...x. 29.000000 xx...x. 29.000000 .x...x. 30.000000 x..xxx. 7.000000 .xx..x. 26.000000 xx...x. 29.000000 xx.xxx. 5.000000 x....xx -33.000000 xx..x.. 19.000000 .x...xx -34.000000 found gen 8 :.....x. 32.000000 knapsack 20 100 3 0 xx.x.....x. 41.000000 xx.x.....x. 41.000000 xx.xx....x. 32.000000 .xx......x. 37.000000 xx.x.....x. 41.000000 xx.x.....xx 12.000000 x...x....x. 42.000000 xxxx..xx.x. 2.000000 xx.x.x...x. 30.000000 xx.xx...xx. 9.000000 .x.x..x..x. 28.000000 .xx.x...x.. 42.000000 xx......xx. 27.000000 xx.x..x..x. 26.000000 ...x.....x. 36.000000 xx......... 5.000000 xxxx.....x. 38.000000 xx.......x. 34.000000 xx.......x. 34.000000 .x.x......x 41.000000 found gen 16 :x...x....x. 42.000000 knapsack 20 100 3 0 xx.x.x..xxx 106.000000 xx.x.x..xxx 106.000000 xx.x.x....x 56.000000 xx.xxx..x.x 90.000000 xx.x.x..xxx 106.000000 x..x.x..xxx 105.000000 x.xxxx..x.x 92.000000 xx.x.x..xxx 106.000000 xx.x.xx.xxx 89.000000 ...x.x..xxx 103.000000 xx.x.x.xxxx 87.000000 .x.x.x..xxx 106.000000 xx.xxx..xxx 95.000000 xx.x.xx.xxx 89.000000 xx.x.xxxxxx 70.000000 xx.x.x..xxx 106.000000 xx.xxx.xxx. 107.000000 x..x....xxx 92.000000 x....x..xxx 98.000000 x..x.x.xxx. 93.000000 found gen 7 :xx.xxx.xxx. 107.000000 knapsack 100 500 3 0 .x..xxx.x. 497.880000 ..xxx...xx 496.890000 x...xx.x.. 445.290000 ..x.xx.... 342.610000 .xxxx..x.x 455.150000 ..x...x..x 341.640000 xx..x..x.. 376.720000 x.xx....x. 491.430000 .x.....xxx 471.060000 xx.x.xxx.. 242.770000 .xx..x.xxx 201.720000 ..x....xxx 499.990000 ..xxx...xx 496.890000 xx.xx..x.. 465.700000 xxx.x.xxxx 161.980000 ..x.x.xx.x 464.500000 x..x..x..x 464.750000 xxx.x.x... 427.110000 .x...xx.xx 329.490000 ..xx.xxx.. 407.550000 ...x.xxx.. 496.630000 ..xxx...xx 496.890000 x..x...xx. 490.180000 ..x.x.xx.. 280.720000 .....xxxxx 282.170000 ....xxxx.x 386.440000 .x.x...x.. 256.600000 .x...xxxxx 222.020000 x..xx.xx.x 341.890000 ..xxx..x.. 300.920000 ...xxxx.x. 469.050000 .x...x..xx 398.270000 ......xxxx 479.690000 .x......x. 179.810000 .xxxx..x.x 455.150000 .x.....x.x 351.400000 .xx....xx. 376.360000 x.x..x..xx 175.630000 x..x..x... 351.470000 xxx.x...x. 477.990000 ....x.xx.x 375.420000 ..x.x.xx.x 464.500000 x.xxx.xx.. 436.590000 .xxxx..x.. 361.070000 x.x..x.... 479.070000 x..x...xx. 490.180000 .xxxxx.x.x 217.010000 ..x.xx.... testcase07.txt="" testscript.out="" knapsack="" 20="" 100="" 3="" 0="" .x....x.xxx="" 4.000000="" x..xxx.....="" 4.000000="" x.xxxx.x.x.="" 7.000000="" x.xx...x.xx="" 5.000000="" x.x.x.....x="" 3.000000="" .x.x.xxx.xx="" 6.000000="" xxx.xxx.xx.="" 6.000000="" xx.x...xxx.="" 6.000000="" x..xx.x..xx="" 5.000000="" ..xxx.x..xx="" 5.000000="" x..xxxxx.x.="" 7.000000="" x.xxxxxxx..="" 6.000000="" .........x.="" 1.000000="" x..xxx.x..x="" 5.000000="" xxx.xxxxx..="" 6.000000="" xx..x...xxx="" 5.000000="" ...xx.x.xxx="" 5.000000="" x...x.x....="" 3.000000="" .x.xxxxx...="" 6.000000="" .....xx..x.="" 3.000000="" found="" gen="" 1="" :x.xxxx.x.x.="" 7.000000="" knapsack="" 20="" 100="" 3="" 0="" x.xx.xx="" 105.000000="" x.xx.xx="" 105.000000="" xx.x.xx="" 107.000000="" x.xx.x.="" 45.000000="" x.xx..x="" 77.000000="" ..xx.xx="" 106.000000="" xx.xxxx="" 91.000000="" ..xx..x="" 76.000000="" x.xx.xx="" 105.000000="" xxxx..x="" 79.000000="" x.x..xx="" 101.000000="" x.x.x.x="" 85.000000="" .x...xx="" 98.000000="" .xxx.xx="" 104.000000="" .xx..x.="" 38.000000="" x.xx.xx="" 105.000000="" x.xx.xx="" 105.000000="" .xx..xx="" 102.000000="" .xxxxxx="" 88.000000="" ..xx.xx="" 106.000000="" found="" gen="" 5="" :xx.x.xx="" 107.000000="" knapsack="" 20="" 100="" 3="" 0="" x....x.="" 29.000000="" x....x.="" 29.000000="" xxx..x.="" 23.000000="" xx...x.="" 27.000000="" x.x..xx="" -39.000000="" xxxxx..="" 31.000000="" .x.xx..="" 26.000000="" .x....x="" -4.000000="" ..x..x.="" 26.000000="" x....x.="" 29.000000="" .x.....="" 2.000000="" x......="" 1.000000="" xxx....="" 7.000000="" .xxx...="" 14.000000="" xx.x...="" 11.000000="" x....x.="" 29.000000="" x....xx="" -35.000000="" x....x.="" 29.000000="" xx...x.="" 27.000000="" .xxx.x.="" 16.000000="" found="" gen="" 3="" :xxxxx..="" 31.000000="" knapsack="" 20="" 200="" 3="" 0="" x....x.="" 31.000000="" .x...x.="" 30.000000="" .....x.="" 32.000000="" .xx..xx="" -38.000000="" xxx.xx.="" 9.000000="" .x...x.="" 30.000000="" xx.....="" 3.000000="" .x...xx="" -34.000000="" ....xxx="" -48.000000="" xx.....="" 3.000000="" xx...x.="" 29.000000="" xx...x.="" 29.000000="" .x...x.="" 30.000000="" x..xxx.="" 7.000000="" .xx..x.="" 26.000000="" xx...x.="" 29.000000="" xx.xxx.="" 5.000000="" x....xx="" -33.000000="" xx..x..="" 19.000000="" .x...xx="" -34.000000="" found="" gen="" 8="" :.....x.="" 32.000000="" knapsack="" 20="" 100="" 3="" 0="" xx.x.....x.="" 41.000000="" xx.x.....x.="" 41.000000="" xx.xx....x.="" 32.000000="" .xx......x.="" 37.000000="" xx.x.....x.="" 41.000000="" xx.x.....xx="" 12.000000="" x...x....x.="" 42.000000="" xxxx..xx.x.="" 2.000000="" xx.x.x...x.="" 30.000000="" xx.xx...xx.="" 9.000000="" .x.x..x..x.="" 28.000000="" .xx.x...x..="" 42.000000="" xx......xx.="" 27.000000="" xx.x..x..x.="" 26.000000="" ...x.....x.="" 36.000000="" xx.........="" 5.000000="" xxxx.....x.="" 38.000000="" xx.......x.="" 34.000000="" xx.......x.="" 34.000000="" .x.x......x="" 41.000000="" found="" gen="" 16="" :x...x....x.="" 42.000000="" knapsack="" 20="" 100="" 3="" 0="" xx.x.x..xxx="" 106.000000="" xx.x.x..xxx="" 106.000000="" xx.x.x....x="" 56.000000="" xx.xxx..x.x="" 90.000000="" xx.x.x..xxx="" 106.000000="" x..x.x..xxx="" 105.000000="" x.xxxx..x.x="" 92.000000="" xx.x.x..xxx="" 106.000000="" xx.x.xx.xxx="" 89.000000="" ...x.x..xxx="" 103.000000="" xx.x.x.xxxx="" 87.000000="" .x.x.x..xxx="" 106.000000="" xx.xxx..xxx="" 95.000000="" xx.x.xx.xxx="" 89.000000="" xx.x.xxxxxx="" 70.000000="" xx.x.x..xxx="" 106.000000="" xx.xxx.xxx.="" 107.000000="" x..x....xxx="" 92.000000="" x....x..xxx="" 98.000000="" x..x.x.xxx.="" 93.000000="" found="" gen="" 7="" :xx.xxx.xxx.="" 107.000000="" knapsack="" 100="" 500="" 3="" 0="" .x..xxx.x.="" 497.880000="" ..xxx...xx="" 496.890000="" x...xx.x..="" 445.290000="" ..x.xx....="" 342.610000="" .xxxx..x.x="" 455.150000="" ..x...x..x="" 341.640000="" xx..x..x..="" 376.720000="" x.xx....x.="" 491.430000="" .x.....xxx="" 471.060000="" xx.x.xxx..="" 242.770000="" .xx..x.xxx="" 201.720000="" ..x....xxx="" 499.990000="" ..xxx...xx="" 496.890000="" xx.xx..x..="" 465.700000="" xxx.x.xxxx="" 161.980000="" ..x.x.xx.x="" 464.500000="" x..x..x..x="" 464.750000="" xxx.x.x...="" 427.110000="" .x...xx.xx="" 329.490000="" ..xx.xxx..="" 407.550000="" ...x.xxx..="" 496.630000="" ..xxx...xx="" 496.890000="" x..x...xx.="" 490.180000="" ..x.x.xx..="" 280.720000="" .....xxxxx="" 282.170000="" ....xxxx.x="" 386.440000="" .x.x...x..="" 256.600000="" .x...xxxxx="" 222.020000="" x..xx.xx.x="" 341.890000="" ..xxx..x..="" 300.920000="" ...xxxx.x.="" 469.050000="" .x...x..xx="" 398.270000="" ......xxxx="" 479.690000="" .x......x.="" 179.810000="" .xxxx..x.x="" 455.150000="" .x.....x.x="" 351.400000="" .xx....xx.="" 376.360000="" x.x..x..xx="" 175.630000="" x..x..x...="" 351.470000="" xxx.x...x.="" 477.990000="" ....x.xx.x="" 375.420000="" ..x.x.xx.x="" 464.500000="" x.xxx.xx..="" 436.590000="" .xxxx..x..="" 361.070000="" x.x..x....="" 479.070000="" x..x...xx.="" 490.180000="" .xxxxx.x.x="" 217.010000="">
Jul 22, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here