Research Article

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

Algorithm 3

Overall pseudocode of BPSO algorithms for DKP01.
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.