The discounted {0-1} knapsack problem (DKP01) is a kind of knapsack problem with group structure and discount relationships among items. It is more challenging than the classical 0-1 knapsack problem. In this paper, we study binary particle swarm optimization (PSO) algorithms with different transfer functions and a new encoding scheme for DKP01. An effective binary vector with shorter length is used to represent a solution for new binary PSO algorithms. Eight transfer functions are used to design binary PSO algorithms for DKP01. A new repair operator is developed to handle isolation solution while improving its quality. Finally, we conducted extensive experiments on four groups of 40 instances using our proposed approaches. The experience results show that the proposed algorithms outperform the previous algorithms named FirEGA and SecEGA . Overall, the proposed algorithms with a new encoding scheme represent a potential approach for solving the DKP01.

The discounted 0-1 knapsack problem (DKP01) is a new kind of knapsack problem proposed by Guldan [

Assume that there are

Recently, He et al. 2016 also had a detailed study of the algorithms of the DKP01 and proposed brand new deterministic algorithm and approximation algorithms. A new exact algorithm and two approximation algorithms with a greedy repair operator were proposed to solve DKP01 [

Many algorithms were proposed to solve DKP01, and each of them has its advantages and disadvantages. Further study on this problem is necessary. In this paper, we study binary particle swarm optimization (PSO) algorithms with different transfer function and a new encoding scheme for DKP01. An effective binary vector with

Binary particle swarm optimization algorithms with difference binary transfer functions and new solution presentation are proposed to solve the discounted {0-1} knapsack problem.

A new encoding scheme has shorter binary vector (the length is 2

A new repair operator is developed to handle isolation solution while improving its quality.

The rest of this paper is organized as follows: Section

The PSO implements a population of particles. A population of particles is randomly created initially [

The pseudocode of the PSO is given in Algorithm

Initialize particle

Evaluate objective function

current value is replace by

Calculate the

Calculate particle velocity by equation (

Update particle position by equation (

The binary particle swarm optimization algorithm was introduced by Bansal and Deep to allow the PSO algorithm to operate in binary problem spaces [

In this section, we propose 8 binary algorithms based on BSO named BPSO1 to BPSO8. The algorithm BPSO_{x} uses transfer function _{x} (where

At present, there are two methods to encode a solution which are using a binary vector with length equal to the

In this paper, a new binary encode scheme with length

New binary encoding scheme.

No. | Binary encoding scheme | Meaning |
---|---|---|

1 | 00 | No item of group is chosen |

2 | 01 | First item of group is chosen |

3 | 10 | Third item of group is chosen |

4 | 11 | Fourth item of group is chosen |

The new encoding scheme automatically satisfies constraint 2. To handle constraint 3 and improve the quality of solution, a new repair based on the idea in [

This repair operator consists of two phases. The first phase (called repair phase) examines each variable in increasing order of

% Repair phase

% Optimization phase

The overall pseudocode of the BPSO algorithms for DKP01 is given in Algorithm

Initialize particle

Evalute objective function

current value is replace by

Caculate the

Calculate particle velocity by equation (

Caculate

Update particle position by equations (

Apply repair operator for current particle position.

In this paper, the experience results of eight BPSO algorithms are compared to find out the best one among them to solve DKP01. The best proposed BPSO is used to compare the results of two algorithms taken from [

All experiments of the proposed algorithms are performed on a Dell Vostro 5471 VTI5207W laptop with an Intel (R) Core (TM) i5-8250u CPU-1.6 GHz and 8 GB DDR3 memory. The operating system is Microsoft Windows 10. All the algorithms are implemented using MATLAB R2018a.

The parameters of FirEGA and SecEGA are shown in [

Tables

Comparison of 8 BPSO algorithms on IDKP1–IDKP10.

BPSO1 | BPSO2 | BPSO3 | BPSO4 | BPSO5 | BPSO6 | BPSO7 | BPSO8 | ||
---|---|---|---|---|---|---|---|---|---|

IDKP1 | Best | 67982 | 65735 | 66130 | 65215 | 69940 | 69944 | 69905 | |

AVE | 66360.4 | 65219.1 | 64523.1 | 64206.4 | 69650.5 | 69689.3 | 69652.8 | ||

Worst | 65724 | 64686 | 63911 | 63583 | 69345 | 69069 | 69348 | ||

Std. dev | 450.89 | 285.19 | 468.09 | 367.69 | 127.49 | 184.26 | 151.25 | 109.15 | |

Gap | 5.34 | 6.97 | 7.96 | 8.42 | 0.65 | 0.59 | 0.65 | 0.49 | |

IDKP2 | Best | 111220 | 109980 | 107920 | 106690 | 117840 | 117700 | 117960 | |

AVE | 109885.7 | 108308.3 | 106567.0 | 105800.3 | 117157.7 | 117265.3 | 117237.7 | ||

Worst | 108670 | 107420 | 105580 | 104920 | 116530 | 116690 | 116880 | ||

Std. dev | 526.83 | 583.77 | 527.62 | 375.53 | 317.69 | 220.23 | 250.72 | 228.83 | |

Gap | 7.09 | 8.42 | 9.89 | 10.54 | 0.94 | 0.85 | 0.87 | 0.72 | |

IDKP3 | Best | 223100 | 220370 | 217660 | 217270 | 234550 | 234510 | 234540 | |

AVE | 221673.7 | 219018.7 | 216489.0 | 215686.7 | 234234.0 | 234193.3 | 234192.3 | ||

Worst | 220330 | 218260 | 215340 | 214360 | 233740 | 233820 | 233800 | ||

Std. dev | 655.53 | 522.10 | 621.85 | 588.95 | 170.00 | 194.82 | 196.90 | 192.52 | |

Gap | 5.59 | 6.72 | 7.80 | 8.14 | 0.24 | 0.26 | 0.26 | 0.23 | |

IDKP4 | Best | 262250 | 261600 | 256030 | 254560 | 281630 | 281460 | 281560 | |

AVE | 260578.7 | 257426.7 | 254213.0 | 253443.3 | 280915.7 | 280937.0 | 280926.7 | ||

Worst | 259350 | 255980 | 253070 | 251990 | 280230 | 280210 | 280220 | ||

Std. dev | 680.61 | 1036.33 | 669.28 | 545.32 | 370.76 | 298.83 | 381.13 | 328.28 | |

Gap | 7.79 | 8.90 | 10.04 | 10.31 | 0.59 | 0.59 | 0.59 | 0.58 | |

IDKP5 | Best | 306710 | 304080 | 300290 | 299740 | 334080 | 334370 | 334330 | |

AVE | 305651.3 | 302176.0 | 298676.3 | 297292.7 | 333196.0 | 333450.7 | 333380.7 | ||

Worst | 304530 | 300500 | 297810 | 296300 | 331670 | 332140 | 331700 | ||

Std. dev | 627.16 | 837.40 | 572.50 | 822.63 | 558.47 | 545.39 | 595.10 | 479.64 | |

Gap | 8.92 | 9.96 | 11.00 | 11.41 | 0.71 | 0.61 | 0.64 | 0.66 | |

IDKP6 | Best | 424860 | 420840 | 414340 | 414270 | 451120 | 451180 | 451390 | |

AVE | 422738.0 | 418002.7 | 412954.3 | 410614.0 | 450450.0 | 450227.7 | 450455.0 | ||

Worst | 420920 | 416490 | 411800 | 409440 | 449230 | 449230 | 448980 | ||

Std. dev | 1094.93 | 1134.30 | 671.58 | 922.85 | 476.18 | 491.61 | 468.12 | 563.12 | |

Gap | 6.57 | 7.62 | 8.73 | 9.25 | 0.44 | 0.44 | 0.49 | 0.44 | |

IDKP7 | Best | 445470 | 440660 | 437100 | 434590 | 485500 | 485610 | 485920 | |

AVE | 443578.0 | 438952.7 | 434153.7 | 432156.0 | 484123.3 | 484322.3 | 484205.7 | ||

Worst | 441760 | 437450 | 432760 | 430820 | 482580 | 482450 | 482400 | ||

Std. dev | 973.40 | 1031.28 | 1060.95 | 965.40 | 741.76 | 739.59 | 938.96 | 879.02 | |

Gap | 9.32 | 10.26 | 11.24 | 11.65 | 0.98 | 1.03 | 0.99 | 1.01 | |

IDKP8 | Best | 476350 | 469590 | 465180 | 462400 | 528810 | 528720 | 528450 | |

AVE | 473369.7 | 467065.0 | 462243.3 | 460488.7 | 526535.3 | 526150.3 | 526356.7 | ||

Worst | 470860 | 465310 | 459400 | 459070 | 524250 | 523860 | 524150 | ||

Std. dev | 1361.11 | 1059.54 | 1294.50 | 853.73 | 1377.91 | 1070.18 | 1437.35 | 1268.72 | |

Gap | 11.33 | 12.51 | 13.41 | 13.74 | 1.29 | 1.37 | 1.44 | 1.40 | |

IDKP9 | Best | 467480 | 460890 | 456610 | 452870 | 521210 | 521390 | 520960 | |

AVE | 463983.7 | 458418.0 | 453862.3 | 451666.0 | 516689.3 | 517894.3 | 518507.0 | ||

Worst | 460970 | 456540 | 451430 | 450200 | 513400 | 514390 | 514080 | ||

Std. dev | 1575.60 | 1013.39 | 1205.04 | 700.42 | 1976.73 | 1723.29 | 1353.10 | 1726.89 | |

Gap | 12.15 | 13.20 | 14.06 | 14.48 | 2.17 | 1.94 | 1.82 | 1.76 | |

IDKP10 | Best | 512140 | 505660 | 503250 | 500520 | 571780 | 572250 | 572260 | |

AVE | 509844.0 | 503661.7 | 498110.3 | 495816.3 | 568518.7 | 569094.3 | 568045.0 | ||

Worst | 506800 | 501750 | 495910 | 493320 | 564150 | 564620 | 563900 | ||

Std. dev | 1072.29 | 996.78 | 1548.61 | 1635.38 | 1711.13 | 1681.26 | 1724.57 | 1446.41 | |

Gap | 12.28 | 13.35 | 14.30 | 14.70 | 2.19 | 2.09 | 2.27 | 2.04 |

Comparison of 8 BPSO algorithms on SDKP1–SDKP10.

BPSO1 | BPSO2 | BPSO3 | BPSO4 | BPSO5 | BPSO6 | BPSO7 | BPSO8 | ||
---|---|---|---|---|---|---|---|---|---|

SDKP1 | Best | 91046 | 90103 | 90067 | 89558 | 94300 | 94414 | 94363 | |

AVE | 90484.4 | 89446.6 | 88655.5 | 88449.9 | 94089.3 | 94112.7 | 94174.4 | ||

Worst | 89964 | 88772 | 87835 | 87847 | 93687 | 93807 | 93897 | ||

Std. dev | 240.44 | 312.35 | 513.73 | 422.86 | 152.07 | 128.84 | 103.15 | 113.74 | |

Gap | 4.21 | 5.31 | 6.14 | 6.36 | 0.39 | 0.37 | 0.30 | 0.29 | |

SDKP2 | Best | 152080 | 149910 | 148440 | 148320 | 160470 | 160490 | 160430 | |

AVE | 150627.7 | 148857.0 | 147307.0 | 146598.3 | 160058.0 | 160033.3 | 160127.0 | ||

Worst | 149590 | 148000 | 146410 | 145830 | 159730 | 159380 | 159480 | ||

Std. dev | 591.17 | 505.77 | 535.13 | 595.93 | 190.92 | 237.35 | 214.82 | 182.33 | |

Gap | 6.33 | 7.43 | 8.39 | 8.83 | 0.46 | 0.48 | 0.42 | 0.42 | |

SDKP3 | Best | 225340 | 222940 | 220310 | 218570 | 237350 | 237430 | 237370 | |

AVE | 223456.7 | 221130.0 | 218620.0 | 217727.3 | 236629.7 | 236821.0 | 236778.3 | ||

Worst | 222120 | 219740 | 217530 | 217020 | 235770 | 236110 | 235960 | ||

Std. dev | 617.52 | 777.22 | 567.24 | 435.05 | 359.95 | 265.44 | 352.00 | 314.48 | |

Gap | 6.21 | 7.18 | 8.24 | 8.61 | 0.68 | 0.60 | 0.60 | 0.62 | |

SDKP4 | Best | 317610 | 313630 | 310850 | 310020 | 338360 | 338480 | 338240 | |

AVE | 315521.0 | 311837.3 | 308411.3 | 306979.7 | 337381.0 | 337525.0 | 337433.0 | ||

Worst | 314020 | 310180 | 306940 | 305490 | 336270 | 336440 | 336210 | ||

Std. dev | 938.08 | 789.99 | 1010.63 | 1074.09 | 501.50 | 524.94 | 540.16 | 495.98 | |

Gap | 7.21 | 8.29 | 9.30 | 9.72 | 0.78 | 0.74 | 0.73 | 0.76 | |

SDKP5 | Best | 438720 | 431560 | 427340 | 425190 | 459900 | 459890 | 459970 | |

AVE | 435066.7 | 429523.7 | 424714.0 | 422803.3 | 458421.7 | 458479.3 | 458292.0 | ||

Worst | 432570 | 427170 | 422560 | 421120 | 456570 | 456980 | 457130 | ||

Std. dev | 1412.53 | 1057.97 | 1127.73 | 833.64 | 724.35 | 669.22 | 548.81 | 802.76 | |

Gap | 6.04 | 7.24 | 8.28 | 8.69 | 1.00 | 0.98 | 0.98 | 1.02 | |

SDKP6 | Best | 428070 | 424110 | 417840 | 415960 | 463040 | 462310 | 462650 | |

AVE | 424916.3 | 420600.0 | 415690.3 | 413662.3 | 461229.3 | 461288.0 | 461310.7 | ||

Worst | 423230 | 418080 | 414020 | 412230 | 459870 | 459390 | 459610 | ||

Std. dev | 1121.73 | 1370.31 | 1020.89 | 994.05 | 759.15 | 708.60 | 789.20 | 680.64 | |

Gap | 8.84 | 9.76 | 10.81 | 11.25 | 1.04 | 1.03 | 1.01 | 1.03 | |

SDKP7 | Best | 580940 | 574630 | 567460 | 562990 | 615640 | 615100 | 614830 | |

AVE | 578574.3 | 571778.7 | 564752.3 | 561783.7 | 613474.3 | 613242.0 | 613182.7 | ||

Worst | 576180 | 569410 | 563080 | 560270 | 611790 | 611180 | 610700 | ||

Std. dev | 1210.37 | 1118.88 | 1034.42 | 708.71 | 955.25 | 1000.74 | 953.90 | 984.83 | |

Gap | 6.75 | 7.84 | 8.98 | 9.45 | 1.12 | 1.11 | 1.16 | 1.17 | |

SDKP8 | Best | 619660 | 613680 | 605780 | 602220 | 665340 | 665070 | 665230 | |

AVE | 616572.0 | 609950.0 | 603096.3 | 600201.3 | 663703.3 | 663633.7 | 663681.7 | ||

Worst | 614660 | 607940 | 601290 | 598950 | 661970 | 661310 | 661500 | ||

Std. dev | 1288.63 | 1507.53 | 1244.25 | 876.08 | 772.79 | 865.64 | 806.70 | 925.22 | |

Gap | 8.07 | 9.06 | 10.08 | 10.51 | 1.01 | 1.04 | 1.05 | 1.05 | |

SDKP9 | Best | 679360 | 672620 | 664590 | 661320 | 732790 | 732800 | 732910 | |

AVE | 676278.0 | 668958.7 | 661978.0 | 659159.0 | 731057.0 | 731107.0 | 730950.3 | ||

Worst | 671400 | 667010 | 659530 | 657170 | 729290 | 728590 | 728990 | ||

Std. dev | 1620.02 | 1566.35 | 1313.95 | 1201.62 | 645.22 | 869.96 | 892.30 | 1024.07 | |

Gap | 8.50 | 9.49 | 10.44 | 10.82 | 1.04 | 1.09 | 1.08 | 1.11 | |

SDKP10 | Best | 691200 | 681980 | 677280 | 672420 | 758000 | 757900 | 758090 | |

AVE | 687130.3 | 679407.7 | 672908.3 | 669316.7 | 756100.0 | 756291.0 | 756337.3 | ||

Worst | 684090 | 676750 | 669860 | 667010 | 754250 | 754150 | 753730 | ||

Std. dev | 1737.15 | 1527.54 | 1694.79 | 1452.26 | 837.73 | 993.51 | 1023.71 | 1038.86 | |

Gap | 10.22 | 11.23 | 12.07 | 12.54 | 1.20 | 1.18 | 1.16 | 1.17 |

Comparison of 8 BPSO algorithms on WDKP1–WDKP10.

BPSO1 | BPSO2 | BPSO3 | BPSO4 | BPSO5 | BPSO6 | BPSO7 | BPSO8 | ||
---|---|---|---|---|---|---|---|---|---|

WDKP1 | Best | 80619 | 79846 | 79486 | 78556 | 83086 | 83083 | 83083 | |

AVE | 80013.7 | 79208.4 | 78425.3 | 78067.9 | 82977.3 | 83001.4 | 82995.0 | ||

Worst | 79143 | 78770 | 77952 | 77505 | 82783 | 82866 | 82649 | ||

Std. dev | 344.73 | 308.46 | 352.70 | 246.35 | 81.16 | 59.47 | 61.93 | 82.14 | |

Gap | 3.71 | 4.68 | 5.62 | 6.05 | 0.15 | 0.12 | 0.12 | 0.10 | |

WDKP2 | Best | 129590 | 127850 | 126590 | 126010 | 138020 | 138040 | 138060 | |

AVE | 128602.7 | 126549.3 | 124836.0 | 124143.0 | 137769.7 | 137740.0 | 137814.3 | ||

Worst | 127680 | 125580 | 123800 | 123260 | 137390 | 137420 | 137270 | ||

Std. dev | 534.56 | 561.11 | 643.57 | 620.55 | 154.53 | 128.04 | 171.26 | 161.59 | |

Gap | 6.95 | 8.44 | 9.68 | 10.18 | 0.32 | 0.34 | 0.29 | 0.28 | |

WDKP3 | Best | 243760 | 240740 | 239080 | 237110 | 256120 | 256320 | 256330 | |

AVE | 242457.7 | 239491.0 | 236892.0 | 235980.0 | 255743.0 | 255603.0 | 255778.7 | ||

Worst | 241370 | 238570 | 235560 | 235110 | 254750 | 254910 | 254850 | ||

Std. dev | 661.12 | 581.07 | 749.34 | 481.79 | 330.32 | 377.36 | 351.57 | 325.67 | |

Gap | 5.52 | 6.67 | 7.69 | 8.04 | 0.34 | 0.39 | 0.31 | 0.33 | |

WDKP4 | Best | 296760 | 293210 | 289800 | 288090 | 315040 | 315020 | 315040 | |

AVE | 294886.7 | 291169.0 | 287984.7 | 286589.7 | 314392.0 | 314413.3 | 314340.7 | ||

Worst | 293860 | 289950 | 286820 | 285510 | 313470 | 313160 | 313360 | ||

Std. dev | 660.30 | 638.33 | 728.30 | 541.86 | 360.52 | 318.05 | 423.15 | 471.89 | |

Gap | 6.58 | 7.76 | 8.77 | 9.21 | 0.40 | 0.38 | 0.39 | 0.42 | |

WDKP5 | Best | 402060 | 397880 | 393220 | 392120 | 427390 | 427280 | 427390 | |

AVE | 400608.7 | 395759.3 | 391217.7 | 389422.0 | 426337.3 | 426314.7 | 426349.7 | ||

Worst | 398530 | 394270 | 389620 | 387990 | 425140 | 424980 | 424950 | ||

Std. dev | 909.19 | 915.60 | 995.13 | 928.49 | 570.29 | 569.34 | 507.68 | 640.64 | |

Gap | 6.51 | 7.64 | 8.70 | 9.12 | 0.50 | 0.51 | 0.47 | 0.50 | |

WDKP6 | Best | 432220 | 427900 | 421630 | 419290 | 464440 | 464430 | 464040 | |

AVE | 429596.3 | 424036.7 | 419191.3 | 417385.0 | 463214.7 | 463201.7 | 463228.3 | ||

Worst | 428160 | 421740 | 417910 | 416010 | 461760 | 461920 | 461980 | ||

Std. dev | 1087.14 | 1200.48 | 892.42 | 762.16 | 666.55 | 627.89 | 555.16 | 487.82 | |

Gap | 7.82 | 9.01 | 10.05 | 10.44 | 0.61 | 0.60 | 0.61 | 0.61 | |

WDKP7 | Best | 506860 | 503130 | 495310 | 494200 | 545570 | 545570 | 545270 | |

AVE | 505569.3 | 499531.0 | 493412.7 | 491195.3 | 544235.3 | 544057.0 | 544006.7 | ||

Worst | 503840 | 496860 | 491740 | 489660 | 542560 | 542170 | 542140 | ||

Std. dev | 786.27 | 1319.85 | 847.95 | 1281.14 | 620.46 | 884.96 | 783.31 | 779.24 | |

Gap | 7.69 | 8.79 | 9.91 | 10.31 | 0.61 | 0.63 | 0.66 | 0.67 | |

WDKP8 | Best | 521960 | 515930 | 509890 | 508840 | 574580 | 573780 | 574290 | |

AVE | 519367.7 | 513180.0 | 507473.7 | 505650.3 | 572645.7 | 572513.7 | 572652.7 | ||

Worst | 515830 | 510670 | 505790 | 503570 | 571260 | 570240 | 570270 | ||

Std. dev | 1441.06 | 1205.03 | 1069.10 | 1391.39 | 797.36 | 771.39 | 705.13 | 693.20 | |

Gap | 9.98 | 11.05 | 12.04 | 12.36 | 0.75 | 0.75 | 0.77 | 0.75 | |

WDKP9 | Best | 584160 | 577510 | 571210 | 568630 | 646730 | 646690 | 646910 | |

AVE | 580843.3 | 574534.3 | 568415.0 | 566222.3 | 645331.7 | 645101.0 | 645133.0 | ||

Worst | 576840 | 572340 | 566130 | 564130 | 643790 | 642660 | 642980 | ||

Std. dev | 1659.97 | 1273.19 | 1136.32 | 1116.77 | 811.74 | 901.38 | 900.69 | 923.83 | |

Gap | 10.73 | 11.70 | 12.64 | 12.98 | 0.82 | 0.80 | 0.85 | 0.85 | |

WDKP10 | Best | 592210 | 585730 | 580200 | 578010 | 675100 | 675310 | 675460 | |

AVE | 589632.0 | 582542.0 | 576737.3 | 574541.0 | 672859.7 | 673296.3 | 673135.3 | ||

Worst | 586780 | 580160 | 574670 | 572440 | 669350 | 671090 | 670990 | ||

Std. dev | 1281.47 | 1245.80 | 1511.33 | 1320.04 | 1249.33 | 1078.37 | 959.27 | 1171.04 | |

Gap | 13.15 | 14.20 | 15.05 | 15.38 | 0.90 | 0.80 | 0.83 | 0.86 |

Comparison of 8 BPSO algorithms on UDKP1–UDKP10.

Algorithm | BPSO1 | BPSO2 | BPSO3 | BPSO4 | BPSO5 | BPSO6 | BPSO7 | BPSO8 | |
---|---|---|---|---|---|---|---|---|---|

UDKP1 | Best | 79070 | 77244 | 75113 | 74482 | 85728 | 85728 | ||

AVE | 77771.0 | 75977.2 | 74212.6 | 73635.3 | 85526.1 | 85555.0 | 85532.2 | ||

Worst | 76454 | 74811 | 72928 | 72824 | 85193 | 85282 | 85026 | ||

Std. dev | 618.95 | 667.48 | 534.68 | 487.81 | 135.12 | 130.18 | 184.05 | ||

Gap | 9.29 | 11.39 | 13.44 | 14.12 | 0.25 | 0.22 | 0.24 | 0.17 | |

UDKP2 | Best | 145300 | 143840 | 138350 | 136930 | 163560 | 163500 | 163560 | |

AVE | 143420.3 | 139566.3 | 136063.0 | 134346.3 | 162678.3 | 162878.7 | 163061.7 | ||

Worst | 141530 | 137850 | 134630 | 132520 | 161520 | 161760 | |||

Std. dev | 1032.82 | 1243.82 | 741.11 | 1018.84 | 466.99 | 399.78 | 304.90 | 314.45 | |

Gap | 12.41 | 14.77 | 16.91 | 17.95 | 0.65 | 0.53 | 0.45 | 0.42 | |

UDKP3 | Best | 236780 | 231160 | 227280 | 224910 | 268270 | 267810 | 268430 | |

AVE | 233404.0 | 228742.0 | 224682.7 | 222441.0 | 266421.0 | 266729.3 | 266814.3 | ||

Worst | 231530 | 226860 | 222570 | 220600 | 264740 | 265150 | 264980 | ||

Std. dev | 1247.53 | 1053.30 | 1101.78 | 1077.08 | 864.86 | 715.80 | 805.32 | 681.78 | |

Gap | 13.36 | 15.09 | 16.60 | 17.43 | 1.10 | 0.99 | 0.96 | 0.89 | |

UDKP4 | Best | 301870 | 295140 | 290750 | 288990 | 345340 | 345110 | 345980 | |

AVE | 299048.3 | 292933.7 | 287865.0 | 285816.7 | 343429.7 | 343510.3 | 343789.0 | ||

Worst | 296850 | 290590 | 285580 | 284460 | 341160 | 341330 | 341800 | ||

Std. dev | 1338.88 | 1104.72 | 1178.90 | 1126.14 | 999.47 | 848.45 | 1036.98 | 924.93 | |

Gap | 13.97 | 15.73 | 17.18 | 17.77 | 1.20 | 1.18 | 1.05 | 1.10 | |

UDKP5 | Best | 377980 | 370780 | 363930 | 362700 | 436440 | 437610 | 437610 | |

AVE | 374958.3 | 367368.0 | 361415.3 | 358738.3 | 434067.0 | 434640.7 | 435053.0 | ||

Worst | 372200 | 363700 | 358340 | 354560 | 430540 | 431110 | 431500 | ||

Std. dev | 1687.23 | 1465.29 | 1430.94 | 1788.70 | 1415.51 | 1410.72 | 1362.97 | 1572.94 | |

Gap | 15.29 | 17.01 | 18.35 | 18.96 | 1.94 | 1.81 | 1.58 | 1.71 | |

UDKP6 | Best | 460830 | 452640 | 441270 | 439260 | 528730 | 529110 | 528940 | |

AVE | 455015.3 | 446125.3 | 438852.3 | 435647.0 | 525352.3 | 525774.0 | 525666.0 | ||

Worst | 451680 | 443210 | 435620 | 432550 | 521500 | 522460 | 519710 | ||

Std. dev | 2176.80 | 1998.82 | 1368.33 | 1766.47 | 1682.21 | 1691.98 | 2340.59 | 1877.81 | |

Gap | 15.20 | 16.86 | 18.21 | 18.81 | 2.09 | 2.01 | 2.03 | 1.78 | |

UDKP7 | Best | 545040 | 537910 | 525410 | 521590 | 624860 | 624300 | 626480 | |

AVE | 542066.3 | 531413.7 | 522129.3 | 518659.0 | 620906.0 | 620467.7 | 621875.3 | ||

Worst | 539210 | 527820 | 518860 | 515290 | 616570 | 615210 | 617290 | ||

Std. dev | 1425.63 | 2665.99 | 1579.61 | 1717.16 | 1898.05 | 2135.62 | 2122.03 | 2120.14 | |

Gap | 14.75 | 16.43 | 17.89 | 18.43 | 2.35 | 2.42 | 2.09 | 2.20 | |

UDKP8 | Best | 551650 | 540430 | 532270 | 533240 | 638060 | 638320 | 637900 | |

AVE | 546316.3 | 536630.3 | 528103.7 | 524527.7 | 633762.3 | 635553.7 | 634388.3 | ||

Worst | 543810 | 532280 | 524740 | 521420 | 630280 | 630150 | 629600 | ||

Std. dev | 1938.41 | 1996.29 | 1807.58 | 2466.31 | 2124.68 | 1784.87 | 2357.17 | 2121.45 | |

Gap | 15.98 | 17.47 | 18.78 | 19.33 | 2.53 | 2.25 | 2.24 | 2.43 | |

UDKP9 | Best | 594880 | 582140 | 570220 | 565930 | 702810 | 704700 | 704350 | |

AVE | 588958.7 | 577306.7 | 566914.3 | 561907.7 | 699517.7 | 699452.3 | 699156.3 | ||

Worst | 584970 | 574490 | 561620 | 558820 | 692160 | 693090 | 693320 | ||

Std. dev | 2264.91 | 1811.95 | 1962.56 | 1931.90 | 2335.85 | 2628.18 | 3132.54 | ||

Gap | 18.03 | 19.65 | 21.10 | 21.80 | 2.65 | 2.66 | 2.49 | 2.70 | |

UDKP10 | Best | 633620 | 619750 | 604900 | 598780 | 763810 | 760920 | 762640 | |

AVE | 627361.3 | 612962.3 | 598703.3 | 593618.7 | 756328.3 | 757261.7 | 756768.3 | ||

Worst | 620570 | 608500 | 594060 | 589560 | 751310 | 749190 | 749330 | ||

Std. dev | 3489.47 | 2565.51 | 2702.42 | 2415.98 | 3078.53 | 2348.74 | 3148.56 | 3865.48 | |

Gap | 19.51 | 21.36 | 23.19 | 23.84 | 2.97 | 2.85 | 2.79 | 2.91 |

The results show that BPSO7 and BPSO8 have better performance compared to the other six algorithms. Table

Average ranks of 8 BPSO algorithms on 40 instances.

Index | Algorithm | Average best rank | Average mean rank | Average worst rank |
---|---|---|---|---|

1 | BPSO1 | 5.0 | 5.1 | 4.8 |

2 | BPSO2 | 6.1 | 5.9 | 5.3 |

3 | BPSO3 | 6.9 | 6.7 | 5.8 |

4 | BPSO4 | 8.0 | 7.2 | 6.3 |

5 | BPSO5 | 2.7 | 3.1 | 3.4 |

6 | BPSO6 | 2.5 | 2.6 | 3.6 |

7 | BPSO7 | 2.5 | 3.4 | 3.4 |

8 | BPSO8 |

Comparison of BPSO8, SecEGA, and FirEGA on IDKP1–IDKP10.

Index | Instance | OPT | Algorithm | Best | Average | Worst | Std. dev | Gap |
---|---|---|---|---|---|---|---|---|

1 | IDKP1 | 70106 | FirEGA | 7 | 0.01 | |||

SecEGA | 68663 | 68000 | 67369 | 328 | 3.00 | |||

BPSO8 | 69950 | 69761 | 69521 | 109 | 0.49 | |||

2 | IDKP2 | 118268 | FirEGA | 102.59 | 0.34 | |||

SecEGA | 114434 | 113385 | 112307 | 7446.67 | 4.13 | |||

BPSO8 | 118000 | 117418.0 | 117040 | 228.83 | 0.72 | |||

3 | IDKP3 | 234804 | FirEGA | 234497 | 233997 | 233666 | 175.42 | 0.34 |

SecEGA | 220096 | 217982 | 216313 | 835.83 | 7.16 | |||

BPSO8 | 192.52 | 0.23 | ||||||

4 | IDKP4 | 282591 | FirEGA | 280695 | 278881 | 827.63 | 0.67 | |

SecEGA | 263238 | 260425 | 258922 | 933.4 | 7.84 | |||

BPSO8 | 281560 | 328.28 | 0.58 | |||||

5 | IDKP5 | 335584 | FirEGA | 329621 | 1173.9 | 0.63 | ||

SecEGA | 309573 | 306878 | 304881 | 907.19 | 8.55 | |||

BPSO8 | 334330 | 333380.7 | 479.64 | 0.66 | ||||

6 | IDKP6 | 452463 | FirEGA | 449863 | 446704 | 1161.52 | 0.58 | |

SecEGA | 414090 | 411367 | 408788 | 1099.31 | 9.08 | |||

BPSO8 | 451390 | 563.12 | 0.44 | |||||

7 | IDKP7 | 489149 | FirEGA | 476385 | 2294.28 | 0.73 | ||

SecEGA | 451528 | 444316 | 442133 | 1280.31 | 9.17 | |||

BPSO8 | 485920 | 484205.7 | 879.02 | 1.01 | ||||

8 | IDKP8 | 533841 | FirEGA | 514196 | 2308.11 | 0.72 | ||

SecEGA | 490494 | 481831 | 478035 | 2215.66 | 9.74 | |||

BPSO8 | 528450 | 526356.7 | 1268.72 | 1.40 | ||||

9 | IDKP9 | 528144 | FirEGA | 511651 | 2216.13 | 0.79 | ||

SecEGA | 489661 | 477001 | 471848 | 3656.22 | 9.68 | |||

BPSO8 | 522140 | 518834.7 | 1726.89 | 1.76 | ||||

10 | IDKP10 | 581244 | FirEGA | 1905.18 | 0.77 | |||

SecEGA | 535541 | 521604 | 516445 | 4265.07 | 10.26 | |||

BPSO8 | 572260 | 569364.7 | 566140 | 1446.41 | 2.04 |

Comparison of BPSO8, SecEGA, and FirEGA on SDKP1–SDKP10

Index | Instance | OPT | Algorithm | Best | Average | Worst | Std. dev | Gap |
---|---|---|---|---|---|---|---|---|

1 | SDKP1 | 94459 | FirEGA | 93235 | 93171 | 93070 | 42.15 | 1.36 |

SecEGA | 89769 | 88832 | 87463 | 594.91 | 5.96 | |||

BPSO8 | 113.74 | 0.29 | ||||||

2 | SDKP2 | 160805 | FirEGA | 159159 | 159004 | 158859 | 61.54 | 1.12 |

SecEGA | 153821 | 152059 | 150753 | 489.39 | 5.44 | |||

BPSO8 | 182.33 | 0.42 | ||||||

3 | SDKP3 | 238248 | FirEGA | 235454 | 235241 | 235043 | 79.86 | 1.26 |

SecEGA | 224997 | 223580 | 221918 | 543.38 | 6.16 | |||

BPSO8 | 314.48 | 0.62 | ||||||

4 | SDKP4 | 340027 | FirEGA | 336353 | 335963 | 335709 | 122.41 | 1.20 |

SecEGA | 318510 | 315513 | 313747 | 851.14 | 7.21 | |||

BPSO8 | 495.98 | 0.76 | ||||||

5 | SDKP5 | 463033 | FirEGA | 452900 | 447587 | 444255 | 1974.99 | 3.34 |

SecEGA | 420238 | 416964 | 413933 | 1291.65 | 9.95 | |||

BPSO8 | 802.76 | 1.02 | ||||||

6 | SDKP6 | 466097 | FirEGA | 459254 | 458893 | 458584 | 162.94 | 1.55 |

SecEGA | 430738 | 427304 | 425504 | 1031.12 | 8.32 | |||

BPSO8 | 680.64 | 1.03 | ||||||

7 | SDKP7 | 620446 | FirEGA | 599361 | 592279 | 579673 | 3949.03 | 4.54 |

SecEGA | 561224 | 556083 | 552007 | 1926.26 | 10.37 | |||

BPSO8 | 984.83 | 1.17 | ||||||

8 | SDKP8 | 670697 | FirEGA | 661276 | 660104 | 659367 | 426.06 | 1.58 |

SecEGA | 611644 | 606263 | 603774 | 1446.94 | 9.61 | |||

BPSO8 | 925.22 | 1.05 | ||||||

9 | SDKP9 | 739121 | FirEGA | 729135 | 727544 | 727064 | 343.67 | 1.57 |

SecEGA | 674885 | 667900 | 664580 | 1614.04 | 9.64 | |||

BPSO8 | 1024.07 | 1.11 | ||||||

10 | SDKP10 | 765317 | FirEGA | 756205 | 753394 | 750757 | 985.46 | 1.56 |

SecEGA | 708935 | 695557 | 691994 | 2956.08 | 9.12 | |||

BPSO8 | 1038.86 | 1.17 |

Comparison of BPSO8, SecEGA, and FirEGA on WDKP1–WDKP10.

Index | Instance | OPT | Algorithm | Best | Average | Worst | Std. dev | Gap |
---|---|---|---|---|---|---|---|---|

1 | WDKP1 | 83098 | FirEGA | 82803 | 82693 | 82592 | 52.04 | 0.49 |

SecEGA | 80014 | 79022 | 78096 | 473.67 | 4.91 | |||

BPSO8 | 82.14 | 0.10 | ||||||

2 | WDKP2 | 138215 | FirEGA | 137704 | 137584 | 63.23 | 0.46 | |

SecEGA | 133315 | 132276 | 131337 | 415.62 | 4.30 | |||

BPSO8 | 137270 | 161.59 | 0.28 | |||||

3 | WDKP3 | 256616 | FirEGA | 254120 | 253657 | 253307 | 173.01 | 1.15 |

SecEGA | 238331 | 235721 | 234025 | 873.58 | 8.14 | |||

BPSO8 | 325.67 | 0.33 | ||||||

4 | WDKP4 | 315657 | FirEGA | 313966 | 312849 | 311998 | 484.76 | 0.89 |

SecEGA | 293640 | 290851 | 288764 | 950.06 | 7.86 | |||

BPSO8 | 471.89 | 0.42 | ||||||

5 | WDKP5 | 428490 | FirEGA | 426311 | 424548 | 423058 | 798.53 | 0.92 |

SecEGA | 393617 | 390014 | 387992 | 1059.83 | 8.98 | |||

BPSO8 | 640.64 | 0.50 | ||||||

6 | WDKP6 | 466050 | FirEGA | 463185 | 461672 | 457718 | 1107.57 | 0.94 |

SecEGA | 429208 | 425112 | 423269 | 1058.37 | 8.78 | |||

BPSO8 | 487.82 | 0.61 | ||||||

7 | WDKP7 | 547683 | FirEGA | 544019 | 541949 | 538126 | 1224.68 | 1.05 |

SecEGA | 501557 | 496134 | 493845 | 1230.94 | 9.41 | |||

BPSO8 | 779.24 | 0.67 | ||||||

8 | WDKP8 | 576959 | FirEGA | 573427 | 571559 | 563253 | 1495.36 | 0.94 |

SecEGA | 530971 | 523203 | 520350 | 2157.09 | 9.32 | |||

BPSO8 | 693.20 | 0.75 | ||||||

9 | WDKP9 | 650660 | FirEGA | 647477 | 644820 | 630086 | 2056.06 | 0.90 |

SecEGA | 598343 | 586770 | 583854 | 2315.5 | 9.82 | |||

BPSO8 | 646910 | 645133.0 | 642980 | 923.83 | 0.85 | |||

10 | WDKP10 | 678947 | FirEGA | 675452 | 673008 | 668239 | 1441.96 | 0.88 |

SecEGA | 620230 | 606215 | 609964 | 3090.86 | 10.72 | |||

BPSO8 | 1171.04 | 0.86 |

Comparison of BPSO8, SecEGA, and FirEGA on UDKP1–UDKP10.

Index | Instance | OPT | Algorithm | Best | Average | Worst | Std. dev | Gap |
---|---|---|---|---|---|---|---|---|

1 | UDKP1 | 85740 | FirEGA | 80593 | 79103 | 77935 | 690.01 | 7.74 |

SecEGA | 78287 | 76807 | 75156 | 798.95 | 10.42 | |||

BPSO8 | 102.30 | 0.17 | ||||||

2 | UDKP2 | 163744 | FirEGA | 155039 | 151662 | 149875 | 1044.95 | 7.38 |

SecEGA | 148043 | 145548 | 143833 | 883.43 | 11.11 | |||

BPSO8 | 314.45 | 0.42 | ||||||

3 | UDKP3 | 269393 | FirEGA | 246698 | 240886 | 237980 | 1491.97 | 10.58 |

SecEGA | 228823 | 225492 | 222486 | 1353.58 | 16.30 | |||

BPSO8 | 681.78 | 0.89 | ||||||

4 | UDKP4 | 347599 | FirEGA | 321605 | 317319 | 314486 | 1426.85 | 8.71 |

SecEGA | 305796 | 299978 | 297606 | 1435.46 | 13.70 | |||

BPSO8 | 924.93 | 1.10 | ||||||

5 | UDKP5 | 442644 | FirEGA | 405409 | 399620 | 395367 | 1692.23 | 9.72 |

SecEGA | 376147 | 370808 | 367574 | 1611.71 | 16.23 | |||

BPSO8 | 1572.94 | 1.71 | ||||||

6 | UDKP6 | 536578 | FirEGA | 486556 | 478726 | 474015 | 2233.61 | 10.78 |

SecEGA | 447438 | 442499 | 438809 | 1765.28 | 17.53 | |||

BPSO8 | 1877.81 | 1.78 | ||||||

7 | UDKP7 | 635860 | FirEGA | 568119 | 560948 | 556938 | 2441.8 | 11.78 |

SecEGA | 529753 | 521401 | 518407 | 1813.04 | 18.00 | |||

BPSO8 | 2120.14 | 2.20 | ||||||

8 | UDKP8 | 650206 | FirEGA | 590137 | 585286 | 580684 | 2078.87 | 9.99 |

SecEGA | 550645 | 546678 | 543836 | 1449.36 | 15.92 | |||

BPSO8 | 2121.45 | 2.43 | ||||||

9 | UDKP9 | 718532 | FirEGA | 655172 | 649636 | 645012 | 2023.64 | 9.59 |

SecEGA | 613581 | 602215 | 605835 | 2003.75 | 16.19 | |||

BPSO8 | 3132.54 | 2.70 | ||||||

10 | UDKP10 | 779460 | FirEGA | 712270 | 706575 | 701545 | 2013.43 | 9.35 |

SecEGA | 665459 | 658908 | 655645 | 1723.8 | 15.47 | |||

BPSO8 | 3865.48 | 2.91 |

Average ranks of BPSO8, SecEGA, and FirEGA on 40 instances.

Index | Algorithm | Average best rank | Average mean rank | Average worst rank |
---|---|---|---|---|

1 | FirEGA | 1.8 | 1.3 | 1.4 |

2 | SecGA | 2.9 | 2.1 | 2.1 |

3 | BPSO8 |

For the stability, the Std. dev and Gap value from Tables

Box plot of 8 instances: (a) IDKP3, (b) IDKP9, (c) UDKP3, (d) UDKP9, (e) WDKP3, (f) WDKP9, (g) SDKP3, and (h) SDKP9.

Convergence curve of (a) IDKP1, (b) IDKP10, (c) UDKP1, (d) UDKP10, (e) WDKP1, (f) WDKP10, (g) SDKP1, and (h) SDKP10.

Therefore, the performance of BPSO8 is excellent compared to that of BPSOs for the DKP01 problem. From the above comparison, it is not difficult to see that, for the DKP01 problem, the BPSOS has the best performance, followed by BPSO8, and they are far better than FirEGA and SecEGA. This shows that the designed method of binary swarm optimization with a new binary encoding scheme is not only feasible but also effective.

In this paper, eight new algorithms have been proposed based on the binary particle swarm optimization with a new repair operator to solve discounted 0-1 knapsack problem efficiently. An effective binary encoding scheme is proposed to present the solution to the problem. The new encoding scheme has two advantages, that is, helping reduce the computing effort when using shorter binary vector and also automatically satisfy the constraint that chose the most one item in each group. The simulation results on forty DKP01 instances showed that the proposed algorithms are better than the two algorithms based on genetic algorithm.

In the future, I will study the effect of transfer function combined with PSO algorithm for other optimization problems. Many other optimization algorithms are also considered to solve DKP01.

The data used to support the findings of this study are included within the article or are made publicly available to the research community at

(i) Particle swarm optimization algorithms with difference binary transfer functions and new solution presentation are proposed to solve the discounted 0-1 knapsack problem. (ii) A new encoding scheme has shorter binary vector and also automatically satisfy the constraint that chose the most one item in each group. (iii) A new repair operator is developed to handle isolation solution while improving its quality. (iv) Experiment results in 40 instances of discounted 0-1 knapsack problem showed that the proposed approaches are efficient.

The author declares that there are no conflicts of interest regarding the publication of this paper.

The author acknowledges Van Lang University for supporting this work.