Mathematical Problems in Engineering

Mathematical Problems in Engineering / 2021 / Article

Research Article | Open Access

Volume 2021 |Article ID 2864607 | https://doi.org/10.1155/2021/2864607

Tung Khac Truong, "Different Transfer Functions for Binary Particle Swarm Optimization with a New Encoding Scheme for Discounted {0-1} Knapsack Problem", Mathematical Problems in Engineering, vol. 2021, Article ID 2864607, 17 pages, 2021. https://doi.org/10.1155/2021/2864607

Different Transfer Functions for Binary Particle Swarm Optimization with a New Encoding Scheme for Discounted {0-1} Knapsack Problem

Academic Editor: Luigi Rodino
Received27 Jun 2020
Revised08 Apr 2021
Accepted09 Apr 2021
Published24 Apr 2021

Abstract

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.

1. Introduction

The discounted 0-1 knapsack problem (DKP01) is a new kind of knapsack problem proposed by Guldan [1]. This problem has an important role in the real-world business process. It is a part of many key problems such as investment decision-making, mission selection, and budget control. An exact algorithm based on dynamic programming for the DKP01 is first proposed in [1]. An approach combining dynamic programming with the core of the DKP01 to solve it is studied in [2]. Two algorithms based on genetic algorithm for DKP01 are named FirEGA and SecEGA in [3].

Assume that there are n groups. Each group contains three items. Consider a given set of items; each of them has an integer weight and an integer profit . The problem is to select a subset from the set of items in n groups such that the overall profit is maximized without exceeding a given weight capacity C. We cannot choose more than 1 item in each group. It is an NP-Hard problem and hence it does not have a polynomial time algorithm unless . The problem may be mathematically modelled as follows:where , , and represent whether the items , and are put into the knapsack: indicates that the item is not in knapsack, while indicates that the item j is in knapsack. It is worth noting that a binary vector is a potential solution of DKP01. Only if X meets both equations (2) and (3), it is a feasible solution of DKP01.

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 [4]. An algorithm based on PSO is named GBPSO using discrete particle swarm optimization [5]. An evolution algorithm combines with ring theory to solve DKP01 [6]. Multistrategy monarch butterfly optimization algorithm, Binary Moth Search algorithm [7], and hybrid teaching-learning-based optimization algorithm [8] are proposed for DKP01. Binary PSO is also developed to solve many optimization problems such as scheduling of appliances in smart homes [9], fault diagnosis of bearing [10], operation cost reduction in unit commitment problem [11], channel selection in the EEG signals and its application to speller systems [12], wireless sensor networks [13], transmission expansion planning considering n − 1 security criterion [14], a bare-bones multiobjective particle swarm optimization algorithm for environmental/economic dispatch [15], multiobjective particle swarm optimization for feature selection with fuzzy cost [16], multiobjective particle swarm optimization approach for cost-based feature selection in classification [17], and variable-size cooperative coevolutionary particle swarm optimization for feature selection on high-dimensional data [18].

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 -dimensional length is used to represent an individual the proposed binary PSO strategies. Eight types of transfer functions are used to design binary PSO algorithms for DKP01. Finally, we conducted extensive experiments on four groups of 40 instances using our proposed approaches. The experience results demonstrate that the proposed algorithms outperform the genetic algorithm and original binary PSO in solving 40 DKP01 instances. The main contributions of this work can be listed as follows:(i)Binary 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 (the length is 2n compared to 3n) and also automatically satisfies 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.

The rest of this paper is organized as follows: Section 2 presents previous algorithms for KP01. Section 3 presents the binary particle swarm optimization for DKP01. The simulated results of the proposed algorithms are presented in Section 4. We conclude this paper and suggest potential future work in Section 5.

2.1. Particle Swarm Optimization

The PSO implements a population of particles. A population of particles is randomly created initially [19, 20]. The standard molecule swarm optimizer keeps up a swarm of molecule that speaks to the potential arrangements to issue on hand. Suppose that the search space is D-dimensional, and the position of the ith particle of the swarm can be described using a D-dimensional vector, . The velocity of the particle is described by a D-dimensional vector . The last best position of the ith particle is named as . In substance, the direction of each molecule is upgraded concurring to its claim flying experience as well as to that of the finest molecule within the swarm. The fundamental PSO calculation can be depicted aswhere is the dth dimension velocity of particle i in cycle k; is the dth dimension position of particle i in cycle k; is the dth dimension position of personal best (pbest) of particle i in cycle k; is the dth dimension position of global best particle (gbest) in cycle k; is the inertia weight; is the cognitive weight and is a social weight; and are two random values uniformly distributed in the range of [0, 1] [21].

The pseudocode of the PSO is given in Algorithm 1.

Input: Initial parameters
Output: optimal solution
(1)for each particle do
(2) Initialize particle
(3)while stop condition is not met do
(4)for each particle do
(5)  Evaluate objective function
(6)  if the objective function valuepBest then
(7)   current value is replace by pBest
(8) Calculate the gBest (the global best value)
(9)for each particle do
(10)  Calculate particle velocity by equation (5)
(11)  Update particle position by equation (6)
2.2. Binary Particle Swarm Optimization

The binary particle swarm optimization algorithm was introduced by Bansal and Deep to allow the PSO algorithm to operate in binary problem spaces [2123]. It uses the concept of velocity as a probability that a bit (position) takes on one or zero. In the BPSO, equation (5) for updating the velocity remains unchanged, but equation (6) for updating the position is redefined by the rule using the two following equations:where S (.) is the sigmoid function for transforming the velocity to the probability as the following expression:

In this section, we propose 8 binary algorithms based on BSO named BPSO1 to BPSO8. The algorithm BPSOx uses transfer function Sx (where x is integer in [1, 8]), and BPSO1–BPSO4 use formula (7), while BPSO5–BPSO8 use formula (8) to calculate binary vector X.

3. Proposed Binary Particle Swarm Optimization for DKP01

3.1. Solution Presentation

At present, there are two methods to encode a solution which are using a binary vector with length equal to the -dimensional problem [3, 7, 24, 25], and the other method is an integer vector with length equal to number of groups n to present a solution [8]. Each encoding scheme has its advantages and disadvantages. The binary scheme has an advantage when many metaheuristics have a good design to be directly applied to solution.

In this paper, a new binary encode scheme with length is used to present the solution. The advantage of this encode scheme is shorter length and it automatically satisfies constraint 2. The new binary encoding scheme is presented in Table 1.


No.Binary encoding schemeMeaning

100No item of group is chosen
201First item of group is chosen
310Third item of group is chosen
411Fourth item of group is chosen

3.2. Repair Function

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 [3] is proposed. The advantage of this repair procedure is the balance between CPU time cost and not getting stuck in local optima. The items are sorted according to the profit-to-weight ratio so that they are not increasing. It means that

This repair operator consists of two phases. The first phase (called repair phase) examines each variable in increasing order of and drops item from knapsack if feasibility is violated. The first phase (called optimization phase) examines each variable in increasing order of and adds item to knapsack as long as feasibility is not violated. The aim of the repair phase is to obtain a feasible solution from an infeasible solution, while the optimization phase seeks to improve the fitness of a feasible solution. The pseudocode for the repair operator is given in Algorithm 2. The time complexity of repair operator is O (n).

Input: Solution , value vector , weight vector , index vector , and knapsack capacity .
Output: Solution
(1)% Repair phase
(2)n length (x)/2 for i= 1 : do
(3)k floor ((id (i) − 1)/3);
(4)r mod (id (i) − 1, 3);
(5)ifthen
(6)  
(7)  
(8)else ifthen
(9)  x (2k + 1)  0
(10)  x (2k + 2)  0
(11)ifthen
(12)  
(13)  
(14)else ifthen
(15)  x (2k + 1)  0
(16)  x (2k + 2)  0
(17)ifthen
(18)  
(19)  
(20)else ifthen
(21)  x (2k + 1)  0
(22)  x (2k + 2)  0
(23)% Optimization phase
(24)fordo
(25)k floor ((id (i) − 1)/3);
(26)r mod (id (i) − 1, 3);
(27)ifthen
(28)  
(29)  
(30)  ifthen
(31)   x (2k + 1)  0; x (2k + 2)  1
(32)  ifthen
(33)   x (2k + 1)  1; x (2k + 2)  0
(34)  ifthen
(35)   x (2k + 1)  1; x (2k + 2)  1
(36)return

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

Input: Initial parameters
Output: Optimal solution
(1)for each particle do
(2) Initialize particle
(3)while stop condition is not met do
(4)for each particle do
(5)  Evalute objective function
(6)  if the objective function valuepBest then
(7)   current value is replace by pBest
(8)  Caculate the gBest (the global best value)
(9)  for each particle do
(10)   Calculate particle velocity by equation (5)
(11)   Caculate S (.) using a transfer function
(12)   Update particle position by equations (7) or (8)
(13)   Apply repair operator for current particle position.

4. Simulation Results

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 [6] named FirEGA and SecEGA. 40 DKP01 test instances are 10 uncorrelated instances (denoted as UDKP1–UDKP10), 10 weakly correlated instances (denoted as WDKP1–WDKP10), 10 inverse strongly correlated instances (denoted as IDKP1–IDKP10), and 10 strongly correlated instances (denoted as SDKP1–SDKP10) [3].

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 [6]. The population sizes of FirEGA and SecEGA are set to 50, and the iteration is set to be equal to the dimension of the DKP01. For a fair comparison, the parameters for BPSO algorithms are set as follows: the number of particles is equal to 50, and are set to 2, is linearly decreased from 0.9 to 0.4, the maximum number of iterations is set to be equal to the dimension of the DKP01, and the stopping criterion is satisfied when the maximum number of iterations is reached. For all algorithms, the numbers of objective function evaluations are similar.

Tables 25 summarize the comparison among 8 BPSO algorithms based on the five different performance factors, that is, the best results (BEST), the average results (AVE), the worst results (Worst), the standard deviation (Std. dev), and the gap between the AVE and OPT, where OPT is the optimal value of the instance. The results are averaged over 30 independent runs, and the best results are highlighted in bold font. The formula of computing the gap is as follows:


BPSO1BPSO2BPSO3BPSO4BPSO5BPSO6BPSO7BPSO8

IDKP1Best6798265735661306521569940699446990569950
AVE66360.465219.164523.164206.469650.569689.369652.869761.0
Worst6572464686639116358369345690696934869521
Std. dev450.89285.19468.09367.69127.49184.26151.25109.15
Gap5.346.977.968.420.650.590.650.49

IDKP2Best111220109980107920106690117840117700117960118000
AVE109885.7108308.3106567.0105800.3117157.7117265.3117237.7117418.0
Worst108670107420105580104920116530116690116880117040
Std. dev526.83583.77527.62375.53317.69220.23250.72228.83
Gap7.098.429.8910.540.940.850.870.72

IDKP3Best223100220370217660217270234550234600234510234540
AVE221673.7219018.7216489.0215686.7234234.0234193.3234192.3234253.7
Worst220330218260215340214360233870233740233820233800
Std. dev655.53522.10621.85588.95170.00194.82196.90192.52
Gap5.596.727.808.140.240.260.260.23

IDKP4Best262250261600256030254560281630281460281860281560
AVE260578.7257426.7254213.0253443.3280915.7280937.0280926.7280953.3
Worst259350255980253070251990280230280210280310280220
Std. dev680.611036.33669.28545.32370.76298.83381.13328.28
Gap7.798.9010.0410.310.590.590.590.58

IDKP5Best306710304080300290299740334080334460334370334330
AVE305651.3302176.0298676.3297292.7333196.0333540.0333450.7333380.7
Worst304530300500297810296300331670332140331700332480
Std. dev627.16837.40572.50822.63558.47545.39595.10479.64
Gap8.929.9611.0011.410.710.610.640.66

IDKP6Best424860420840414340414270451530451120451180451390
AVE422738.0418002.7412954.3410614.0450461.3450450.0450227.7450455.0
Worst420920416490411800409440449550449230449230448980
Std. dev1094.931134.30671.58922.85476.18491.61468.12563.12
Gap6.577.628.739.250.440.440.490.44

IDKP7Best445470440660437100434590485500485610485970485920
AVE443578.0438952.7434153.7432156.0484351.7484123.3484322.3484205.7
Worst441760437450432760430820482930482580482450482400
Std. dev973.401031.281060.95965.40741.76739.59938.96879.02
Gap9.3210.2611.2411.650.981.030.991.01

IDKP8Best476350469590465180462400528810528720528910528450
AVE473369.7467065.0462243.3460488.7526964.3526535.3526150.3526356.7
Worst470860465310459400459070524250524640523860524150
Std. dev1361.111059.541294.50853.731377.911070.181437.351268.72
Gap11.3312.5113.4113.741.291.371.441.40

IDKP9Best467480460890456610452870521210521390520960522140
AVE463983.7458418.0453862.3451666.0516689.3517894.3518507.0518834.7
Worst460970456540451430450200513400514390514080515480
Std. dev1575.601013.391205.04700.421976.731723.291353.101726.89
Gap12.1513.2014.0614.482.171.941.821.76

IDKP10Best512140505660503250500520571780572400572250572260
AVE509844.0503661.7498110.3495816.3568518.7569094.3568045.0569364.7
Worst506800501750495910493320564150564620563900566140
Std. dev1072.29996.781548.611635.381711.131681.261724.571446.41
Gap12.2813.3514.3014.702.192.092.272.04


BPSO1BPSO2BPSO3BPSO4BPSO5BPSO6BPSO7BPSO8

SDKP1Best9104690103900678955894300944219441494363
AVE90484.489446.688655.588449.994089.394112.794174.494181.6
Worst8996488772878358784793687938079392093897
Std. dev240.44312.35513.73422.86152.07128.84103.15113.74
Gap4.215.316.146.360.390.370.300.29

SDKP2Best152080149910148440148320160470160490160430160570
AVE150627.7148857.0147307.0146598.3160058.0160033.3160127.0160136.0
Worst149590148000146410145830159730159380159480159780
Std. dev591.17505.77535.13595.93190.92237.35214.82182.33
Gap6.337.438.398.830.460.480.420.42

SDKP3Best225340222940220310218570237580237350237430237370
AVE223456.7221130.0218620.0217727.3236629.7236821.0236829.3236778.3
Worst222120219740217530217020235770236390236110235960
Std. dev617.52777.22567.24435.05359.95265.44352.00314.48
Gap6.217.188.248.610.680.600.600.62

SDKP4Best317610313630310850310020338360338480338520338240
AVE315521.0311837.3308411.3306979.7337381.0337525.0337545.0337433.0
Worst314020310180306940305490336270336540336440336210
Std. dev938.08789.991010.631074.09501.50524.94540.16495.98
Gap7.218.299.309.720.780.740.730.76

SDKP5Best438720431560427340425190459900459890460190459970
AVE435066.7429523.7424714.0422803.3458421.7458479.3458505.0458292.0
Worst432570427170422560421120456570456980457430457130
Std. dev1412.531057.971127.73833.64724.35669.22548.81802.76
Gap6.047.248.288.691.000.980.981.02

SDKP6Best428070424110417840415960463040462310463070462650
AVE424916.3420600.0415690.3413662.3461229.3461288.0461370.0461310.7
Worst423230418080414020412230459870459390459610459880
Std. dev1121.731370.311020.89994.05759.15708.60789.20680.64
Gap8.849.7610.8111.251.041.031.011.03

SDKP7Best580940574630567460562990615640615810615100614830
AVE578574.3571778.7564752.3561783.7613474.3613542.7613242.0613182.7
Worst576180569410563080560270611790611970611180610700
Std. dev1210.371118.881034.42708.71955.251000.74953.90984.83
Gap6.757.848.989.451.121.111.161.17

SDKP8Best619660613680605780602220665540665340665070665230
AVE616572.0609950.0603096.3600201.3663894.7663703.3663633.7663681.7
Worst614660607940601290598950662710661970661310661500
Std. dev1288.631507.531244.25876.08772.79865.64806.70925.22
Gap8.079.0610.0810.511.011.041.051.05

SDKP9Best679360672620664590661320733260732790732800732910
AVE676278.0668958.7661978.0659159.0731433.3731057.0731107.0730950.3
Worst671400667010659530657170730050729290728590728990
Std. dev1620.021566.351313.951201.62645.22869.96892.301024.07
Gap8.509.4910.4410.821.041.091.081.11

SDKP10Best691200681980677280672420758000757900758090758110
AVE687130.3679407.7672908.3669316.7756100.0756291.0756452.3756337.3
Worst684090676750669860667010754400754250754150753730
Std. dev1737.151527.541694.791452.26837.73993.511023.711038.86
Gap10.2211.2312.0712.541.201.181.161.17


BPSO1BPSO2BPSO3BPSO4BPSO5BPSO6BPSO7BPSO8

WDKP1Best8061979846794867855683086830838308383090
AVE80013.779208.478425.378067.982977.383001.482995.083014.1
Worst7914378770779527750582783828768286682649
Std. dev344.73308.46352.70246.3581.1659.4761.9382.14
Gap3.714.685.626.050.150.120.120.10

WDKP2Best129590127850126590126010138020138040138060138110
AVE128602.7126549.3124836.0124143.0137769.7137740.0137814.3137830.0
Worst127680125580123800123260137390137420137430137270
Std. dev534.56561.11643.57620.55154.53128.04171.26161.59
Gap6.958.449.6810.180.320.340.290.28

WDKP3Best243760240740239080237110256120256320256330256360
AVE242457.7239491.0236892.0235980.0255743.0255603.0255831.3255778.7
Worst241370238570235560235110254750254910254930254850
Std. dev661.12581.07749.34481.79330.32377.36351.57325.67
Gap5.526.677.698.040.340.390.310.33

WDKP4Best296760293210289800288090315040315120315020315040
AVE294886.7291169.0287984.7286589.7314392.0314444.7314413.3314340.7
Worst293860289950286820285510313470313900313160313360
Std. dev660.30638.33728.30541.86360.52318.05423.15471.89
Gap6.587.768.779.210.400.380.390.42

WDKP5Best402060397880393220392120427390427280427420427390
AVE400608.7395759.3391217.7389422.0426337.3426314.7426490.7426349.7
Worst398530394270389620387990425140424980425170424950
Std. dev909.19915.60995.13928.49570.29569.34507.68640.64
Gap6.517.648.709.120.500.510.470.50

WDKP6Best432220427900421630419290464810464440464430464040
AVE429596.3424036.7419191.3417385.0463214.7463253.3463201.7463228.3
Worst428160421740417910416010461760461920462000461980
Std. dev1087.141200.48892.42762.16666.55627.89555.16487.82
Gap7.829.0110.0510.440.610.600.610.61

WDKP7Best506860503130495310494200545820545570545570545270
AVE505569.3499531.0493412.7491195.3544327.0544235.3544057.0544006.7
Worst503840496860491740489660543130542560542170542140
Std. dev786.271319.85847.951281.14620.46884.96783.31779.24
Gap7.698.799.9110.310.610.630.660.67

WDKP8Best521960515930509890508840574630574580573780574290
AVE519367.7513180.0507473.7505650.3572645.7572659.0572513.7572652.7
Worst515830510670505790503570571260570240570270571520
Std. dev1441.061205.031069.101391.39797.36771.39705.13693.20
Gap9.9811.0512.0412.360.750.750.770.75

WDKP9Best584160577510571210568630646730647010646690646910
AVE580843.3574534.3568415.0566222.3645331.7645445.0645101.0645133.0
Worst576840572340566130564130643900643790642660642980
Std. dev1659.971273.191136.321116.77811.74901.38900.69923.83
Gap10.7311.7012.6412.980.820.800.850.85

WDKP10Best592210585730580200578010675100675790675310675460
AVE589632.0582542.0576737.3574541.0672859.7673530.0673296.3673135.3
Worst586780580160574670572440669350671700671090670990
Std. dev1281.471245.801511.331320.041249.331078.37959.271171.04
Gap13.1514.2015.0515.380.900.800.830.86


AlgorithmBPSO1BPSO2BPSO3BPSO4BPSO5BPSO6BPSO7BPSO8

UDKP1Best7907077244751137448285728857408572885740
AVE77771.075977.274212.673635.385526.185555.085532.285590.0
Worst7645474811729287282485193852828502685347
Std. dev618.95667.48534.68487.81135.12130.18184.05102.30
Gap9.2911.3913.4414.120.250.220.240.17

UDKP2Best145300143840138350136930163560163500163630163560
AVE143420.3139566.3136063.0134346.3162678.3162878.7163002.0163061.7
Worst141530137850134630132520161520161760162360162260
Std. dev1032.821243.82741.111018.84466.99399.78304.90314.45
Gap12.4114.7716.9117.950.650.530.450.42

UDKP3Best236780231160227280224910268270267810268450268430
AVE233404.0228742.0224682.7222441.0266421.0266729.3266814.3267008.7
Worst231530226860222570220600264740265150264980265560
Std. dev1247.531053.301101.781077.08864.86715.80805.32681.78
Gap13.3615.0916.6017.431.100.990.960.89

UDKP4Best301870295140290750288990345340345110345980346120
AVE299048.3292933.7287865.0285816.7343429.7343510.3343958.3343789.0
Worst296850290590285580284460341160341330341970341800
Std. dev1338.881104.721178.901126.14999.47848.451036.98924.93
Gap13.9715.7317.1817.771.201.181.051.10

UDKP5Best377980370780363930362700436440437610437610437870
AVE374958.3367368.0361415.3358738.3434067.0434640.7435638.0435053.0
Worst372200363700358340354560430540431110432930431500
Std. dev1687.231465.291430.941788.701415.511410.721362.971572.94
Gap15.2917.0118.3518.961.941.811.581.71

UDKP6Best460830452640441270439260528730529110528940530600
AVE455015.3446125.3438852.3435647.0525352.3525774.0525666.0527004.7
Worst451680443210435620432550521500522460519710523880
Std. dev2176.801998.821368.331766.471682.211691.982340.591877.81
Gap15.2016.8618.2118.812.092.012.031.78

UDKP7Best545040537910525410521590624860624300626480627350
AVE542066.3531413.7522129.3518659.0620906.0620467.7622543.3621875.3
Worst539210527820518860515290616570615210618950617290
Std. dev1425.632665.991579.611717.161898.052135.622122.032120.14
Gap14.7516.4317.8918.432.352.422.092.20

UDKP8Best551650540430532270533240638060638320641500637900
AVE546316.3536630.3528103.7524527.7633762.3635553.7635667.3634388.3
Worst543810532280524740521420630280630450630150629600
Std. dev1938.411996.291807.582466.312124.681784.872357.172121.45
Gap15.9817.4718.7819.332.532.252.242.43

UDKP9Best594880582140570220565930702810705110704700704350
AVE588958.7577306.7566914.3561907.7699517.7699452.3700655.0699156.3
Worst584970574490561620558820692160693090694810693320
Std. dev2264.911811.951962.561931.902335.852628.182570.033132.54
Gap18.0319.6521.1021.802.652.662.492.70

UDKP10Best633620619750604900598780763810760920762640767550
AVE627361.3612962.3598703.3593618.7756328.3757261.7757706.3756768.3
Worst620570608500594060589560751310752420749190749330
Std. dev3489.472565.512702.422415.983078.532348.743148.563865.48
Gap19.5121.3623.1923.842.972.852.792.91

The results show that BPSO7 and BPSO8 have better performance compared to the other six algorithms. Table 6 summarizes the average ranks of eight BPSO algorithms on 40 instances. The results showed that BPSO8 achieved the average best rank in all three factors, that is, average best rank (rank based on Best), average mean rank (rank based on AVE), and average worst rank (rank based on Worst). Tables 710 summarize the comparison among the FirEGA, SecEGA, and BPSO8 based on the five different performance criteria on 30 independent runs: BEST, AVE, Worst, Std. dev, and Gap. BPSO8 is better than FirEGA and SecEGA in Best, AVE, and Worst for the instances of SDKP, UDKP, and WDKP except for instances of IDKP. The results show that BPSO8 has better performance than FirEGA and SecEGA algorithms. Table 11 summarizes the average ranks of eight BPSO8, FirEGA, and SecEGA algorithms on 40 instances. The results showed that BPSO8 achieved the average best rank in all three factors, that is, average best rank (rank based on Best), the average mean rank (rank based on AVE), and average worst rank (rank based on Worst).


IndexAlgorithmAverage best rankAverage mean rankAverage worst rank

1BPSO15.05.14.8
2BPSO26.15.95.3
3BPSO36.96.75.8
4BPSO48.07.26.3
5BPSO52.73.13.4
6BPSO62.52.63.6
7BPSO72.53.43.4
8BPSO82.22.03.5


IndexInstanceOPTAlgorithmBestAverageWorstStd. devGap

1IDKP170106FirEGA70106700997009070.01
SecEGA6866368000673693283.00
BPSO86995069761695211090.49

2IDKP2118268FirEGA118169117869117625102.590.34
SecEGA1144341133851123077446.674.13
BPSO8118000117418.0117040228.830.72

3IDKP3234804FirEGA234497233997233666175.420.34
SecEGA220096217982216313835.837.16
BPSO8234540234253.7233800192.520.23

4IDKP4282591FirEGA282148280695278881827.630.67
SecEGA263238260425258922933.47.84
BPSO8281560280953.3280220328.280.58

5IDKP5335584FirEGA3350043334843296211173.90.63
SecEGA309573306878304881907.198.55
BPSO8334330333380.7332480479.640.66

6IDKP6452463FirEGA4516804498634467041161.520.58
SecEGA4140904113674087881099.319.08
BPSO8451390450455.0448980563.120.44

7IDKP7489149FirEGA4880094855924763852294.280.73
SecEGA4515284443164421331280.319.17
BPSO8485920484205.7482400879.021.01

8IDKP8533841FirEGA5330355299845141962308.110.72
SecEGA4904944818314780352215.669.74
BPSO8528450526356.75241501268.721.40
9IDKP9528144FirEGA5264105239825116512216.130.79
SecEGA4896614770014718483656.229.68
BPSO8522140518834.75154801726.891.76

10IDKP10581244FirEGA5789035767725689031905.180.77
SecEGA5355415216045164454265.0710.26
BPSO8572260569364.75661401446.412.04


IndexInstanceOPTAlgorithmBestAverageWorstStd. devGap

1SDKP194459FirEGA93235931719307042.151.36
SecEGA897698883287463594.915.96
BPSO89436394181.693897113.740.29

2SDKP2160805FirEGA15915915900415885961.541.12
SecEGA153821152059150753489.395.44
BPSO8160570160136.0159780182.330.42

3SDKP3238248FirEGA23545423524123504379.861.26
SecEGA224997223580221918543.386.16
BPSO8237370236778.3235960314.480.62

4SDKP4340027FirEGA336353335963335709122.411.20
SecEGA318510315513313747851.147.21
BPSO8338240337433.0336210495.980.76

5SDKP5463033FirEGA4529004475874442551974.993.34
SecEGA4202384169644139331291.659.95
BPSO8459970458292.0457130802.761.02

6SDKP6466097FirEGA459254458893458584162.941.55
SecEGA4307384273044255041031.128.32
BPSO8462650461310.7459880680.641.03

7SDKP7620446FirEGA5993615922795796733949.034.54
SecEGA5612245560835520071926.2610.37
BPSO8614830613182.7610700984.831.17

8SDKP8670697FirEGA661276660104659367426.061.58
SecEGA6116446062636037741446.949.61
BPSO8665230663681.7661500925.221.05

9SDKP9739121FirEGA729135727544727064343.671.57
SecEGA6748856679006645801614.049.64
BPSO8732910730950.37289901024.071.11

10SDKP10765317FirEGA756205753394750757985.461.56
SecEGA7089356955576919942956.089.12
BPSO8758110756337.37537301038.861.17


IndexInstanceOPTAlgorithmBestAverageWorstStd. devGap

1WDKP183098FirEGA82803826938259252.040.49
SecEGA800147902278096473.674.91
BPSO88309083014.18264982.140.10

2WDKP2138215FirEGA13770413758413735663.230.46
SecEGA133315132276131337415.624.30
BPSO8138110137830.0137270161.590.28

3WDKP3256616FirEGA254120253657253307173.011.15
SecEGA238331235721234025873.588.14
BPSO8256360255778.7254850325.670.33
4WDKP4315657FirEGA313966312849311998484.760.89
SecEGA293640290851288764950.067.86
BPSO8315040314340.7313360471.890.42

5WDKP5428490FirEGA426311424548423058798.530.92
SecEGA3936173900143879921059.838.98
BPSO8427390426349.7424950640.640.50

6WDKP6466050FirEGA4631854616724577181107.570.94
SecEGA4292084251124232691058.378.78
BPSO8464040463228.3461980487.820.61

7WDKP7547683FirEGA5440195419495381261224.681.05
SecEGA5015574961344938451230.949.41
BPSO8545270544006.7542140779.240.67

8WDKP8576959FirEGA5734275715595632531495.360.94
SecEGA5309715232035203502157.099.32
BPSO8574290572652.7571520693.200.75

9WDKP9650660FirEGA6474776448206300862056.060.90
SecEGA5983435867705838542315.59.82
BPSO8646910645133.0642980923.830.85

10WDKP10678947FirEGA6754526730086682391441.960.88
SecEGA6202306062156099643090.8610.72
BPSO8675460673135.36709901171.040.86


IndexInstanceOPTAlgorithmBestAverageWorstStd. devGap

1UDKP185740FirEGA805937910377935690.017.74
SecEGA782877680775156798.9510.42
BPSO88574085590.085347102.300.17

2UDKP2163744FirEGA1550391516621498751044.957.38
SecEGA148043145548143833883.4311.11
BPSO8163560163061.7162260314.450.42

3UDKP3269393FirEGA2466982408862379801491.9710.58
SecEGA2288232254922224861353.5816.30
BPSO8268430267008.7265560681.780.89

4UDKP4347599FirEGA3216053173193144861426.858.71
SecEGA3057962999782976061435.4613.70
BPSO8346120343789.0341800924.931.10

5UDKP5442644FirEGA4054093996203953671692.239.72
SecEGA3761473708083675741611.7116.23
BPSO8437870435053.04315001572.941.71

6UDKP6536578FirEGA4865564787264740152233.6110.78
SecEGA4474384424994388091765.2817.53
BPSO8530600527004.75238801877.811.78

7UDKP7635860FirEGA5681195609485569382441.811.78
SecEGA5297535214015184071813.0418.00
BPSO8627350621875.36172902120.142.20

8UDKP8650206FirEGA5901375852865806842078.879.99
SecEGA5506455466785438361449.3615.92
BPSO8637900634388.36296002121.452.43

9UDKP9718532FirEGA6551726496366450122023.649.59
SecEGA6135816022156058352003.7516.19
BPSO8704350699156.36933203132.542.70

10UDKP10779460FirEGA7122707065757015452013.439.35
SecEGA6654596589086556451723.815.47
BPSO8767550756768.37493303865.482.91


IndexAlgorithmAverage best rankAverage mean rankAverage worst rank

1FirEGA1.81.31.4
2SecGA2.92.12.1
3BPSO81.30.90.9

For the stability, the Std. dev and Gap value from Tables 210 demonstrate the stability of the proposed algorithms. Figure 1 demonstrates the box plot of eight instances. The results showed that the group of algorithms BPSO5–BPSO8 is better than group of algorithms BPSO1–BPSO4. Figure 2 demonstrates the convergence curves of eight instances. The results showed that the group of algorithms BPSO5–BPSO8 has faster convergence than the group of algorithms BPSO1–BPSO4.

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.

5. Conclusion

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.

Data Availability

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 https://www.researchgate.net/publication/336126537_Four_kinds_of_D0-1KP_instances.

Additional Points

(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.

Conflicts of Interest

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

Acknowledgments

The author acknowledges Van Lang University for supporting this work.

References

  1. B. Guldan, Heuristic and Exact Algorithms for Discounted Knapsack Problems, University of Erlangen-Nürnberg, Erlangen, Germany, 2007.
  2. A. Rong, J. R. Figueira, and K. Klamroth, “Dynamic programming based algorithms for the discounted {0-1} knapsack problem,” Applied Mathematics and Computation, vol. 218, no. 12, pp. 6921–6933, 2012. View at: Publisher Site | Google Scholar
  3. Y. He, X. Wang, W. Li, X. Zhang, and Y. Chen, “Research on genetic algorithms for discounted 0-1 knapsack problem,” Chinese Journal of Computers, vol. 39, no. 12, pp. 2614–2630, 2016. View at: Google Scholar
  4. Y.-C. He, X.-Z. Wang, Y.-L. He, S.-L. Zhao, and W.-B. Li, “Exact and approximate algorithms for discounted {0-1} knapsack problem,” Information Sciences, vol. 369, pp. 634–647, 2016. View at: Publisher Site | Google Scholar
  5. J. Kenedy and R. Eberhart, “A discrete binary version of the particle swarm optimization,” Computational Cybernatics and Simulation, vol. 5, no. 1, pp. 4104–4108, 1997. View at: Google Scholar
  6. Y. He, X. Wang, and S. Gao, “Ring theory-based evolutionary algorithm and its application to D {0-1} KP,” Applied Soft Computing, vol. 77, pp. 714–722, 2019. View at: Publisher Site | Google Scholar
  7. Y. H. Feng and G. G. Wang, “Binary Moth search algorithm for discounted 0-1 knapsack problem,” IEEE Access, vol. 6, pp. 10708–10719, 2018. View at: Publisher Site | Google Scholar
  8. C. Wu, J. Zhao, Y. Feng, and M. Lee, “Solving discounted {0-1} knapsack problems by a discrete hybrid teaching-learning-based optimization algorithm,” Applied Intelligence, vol. 50, pp. 1872–1888, 2020. View at: Google Scholar
  9. A. R. Jordehi, “Binary particle swarm optimisation with quadratic transfer function: a new binary optimisation algorithm for optimal scheduling of appliances in smart homes,” Applied Soft Computing, vol. 78, pp. 465–480, 2019. View at: Publisher Site | Google Scholar
  10. S.-w. Fei, “The hybrid method of VMD-PSR-SVD and improved binary PSO-KNN for fault diagnosis of bearing,” Shock and Vibration, vol. 2019, Article ID 4954920, 2019. View at: Publisher Site | Google Scholar
  11. A. N. Hussain and A. A. Ismail, “Operation cost reduction in unit commitment problem using improved quantum binary PSO algorithm,” International Journal of Electrical & Computer Engineering, vol. 10, pp. 1149–1155, 2020. View at: Google Scholar
  12. Z. Beheshti, “A time-varying mirrored S-shaped transfer function for binary particle swarm optimization,” Information Sciences, vol. 512, pp. 1503–1542, 2020. View at: Publisher Site | Google Scholar
  13. A. Kaushik, M. Goswami, M. Manuja, S. Indu, and D. Gupta, “A binary PSO approach for improving the performance of wireless sensor networks,” Wireless Personal Communications, vol. 113, pp. 263–297, 2020. View at: Google Scholar
  14. L. F. F. Ledezma and G. G. Alcaraz, “Hybrid binary PSO for transmission expansion planning considering n−1 security criterion,” IEEE Latin America Transactions, vol. 18, no. 3, pp. 545–553, 2020. View at: Google Scholar
  15. Y. Zhang, D.-W. Gong, and Z. Ding, “A bare-bones multi-objective particle swarm optimization algorithm for environmental/economic dispatch,” Information Sciences, vol. 192, pp. 213–227, 2012. View at: Publisher Site | Google Scholar
  16. Y. Hu, Y. Zhang, and D. Gong, “Multiobjective particle swarm optimization for feature selection with fuzzy cost,” IEEE Transactions on Cybernetics, vol. 51, no. 2, pp. 874–888, 2020. View at: Publisher Site | Google Scholar
  17. Y. Zhang, D.-w. Gong, and J. Cheng, “Multi-objective particle swarm optimization approach for cost-based feature selection in classification,” IEEE/ACM Transactions on Computational Biology and Bioinformatics, vol. 14, no. 1, pp. 64–75, 2015. View at: Google Scholar
  18. X.-F. Song, Y. Zhang, Y.-N. Guo, X.-Y. Sun, and Y.-L. Wang, “Variable-size cooperative coevolutionary particle swarm optimization for feature selection on high-dimensional data,” IEEE Transactions on Evolutionary Computation, vol. 24, no. 5, pp. 882–895, 2020. View at: Publisher Site | Google Scholar
  19. R. Eberhart and J. Kennedy, “A new optimizer using particle swarm theory,” in Proceedings of the Sixth International Symposium on Micro Machine and Human Science (MHS’95), pp. 39–43, Nagoya, Japan, October 1995. View at: Google Scholar
  20. J. Kennedy and R. Eberhart, “Particle swarm optimization,” Proceedings of ICNN’95-International Conference on Neural Networks, Perth, Australia, , vol. 4, pp. 1942–1948, 1995. View at: Google Scholar
  21. Z. Li and N. Li, “A novel multi-mutation binary particle swarm optimization for 0/1 knapsack problem,” in Proceedings of the 21st Annual international Conference on Chinese Control and Decision Conference, Ser. CCDC’09, pp. 3090–3095, Piscataway, NJ, USA, 2009. View at: Google Scholar
  22. J. C. Bansal and K. Deep, “A modified binary particle swarm optimization for Knapsack problems,” Applied Mathematics and Computation, vol. 218, no. 22, pp. 11042–11061, 2012. View at: Publisher Site | Google Scholar
  23. S. Mirjalili and A. Lewis, “S-shaped versus V-shaped transfer functions for binary particle swarm optimization,” Swarm and Evolutionary Computation, vol. 9, pp. 1–14, 2013. View at: Publisher Site | Google Scholar
  24. Y. Feng, G. G. Wang, W. Li, and N. Li, “Multi-strategy Monarch butterfly optimization algorithm for discounted {0-1} knapsack problem,” Neural Computing and Applications, vol. 30, pp. 3019–3036, 2018. View at: Google Scholar
  25. H. Zhu, Y. He, X. Wang, and E. C. C. Tsang, “Discrete differential evolutions for the discounted {0-1} Knapsack problem,” International Journal of Bio-Inspired Computation, vol. 10, no. 4, p. 219, 2017. View at: Publisher Site | Google Scholar

Copyright © 2021 Tung Khac Truong. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Related articles

No related content is available yet for this article.
 PDF Download Citation Citation
 Download other formatsMore
 Order printed copiesOrder
Views721
Downloads355
Citations

Related articles

No related content is available yet for this article.

Article of the Year Award: Outstanding research contributions of 2021, as selected by our Chief Editors. Read the winning articles.