(1)  iter 0, 𝑐 𝑝 𝑡 0 , Initialize 𝑠 𝑤 𝑎 𝑟 𝑚 _ 𝑠 𝑖 𝑧 𝑒 particles  
(2)  stop_criterion maximum number of function evaluations or 𝑂 𝑝 𝑡 𝑖 𝑚 𝑎 𝑙 _ 𝑠 𝑜 𝑙 𝑢 𝑡 𝑖 𝑜 𝑛 is not attained
(3)  while   Not stop_criterion  do
(4)       for  each particle 𝑖 1   to   𝑠 𝑤 𝑎 𝑟 𝑚 _ 𝑠 𝑖 𝑧 𝑒   do
(5)      Evaluate ( 𝑝 𝑎 𝑟 𝑡 𝑖 𝑐 𝑙 𝑒 ( 𝑖 ) )   if  the fitness value is better than the best fitness value (cbest) in history  then
(6)          Update current value as the new 𝑐 𝑏 𝑒 𝑠 𝑡 .
(7)      end
(8)       end
(9)       Choose the particle with the best fitness value in the neighborhood ( 𝑔 𝑏 𝑒 𝑠 𝑡 )
(10)       for  each particle 𝑖 1   to   𝑠 𝑤 𝑎 𝑟 𝑚 _ 𝑠 𝑖 𝑧 𝑒   do
(11)       Update particle velocity according to Equation  (3)
(12)        Enforce velocity bounds
(13)        Update particle position according to Equation  (4)
(14)        Enforce particle bounds
(15)       end
(16)       if  there is no improvement of global best solution  then
(17)      𝑐 𝑝 𝑡 𝑐 𝑝 𝑡 + 1
(18)       end
(19)       Update global best solution
(20)        𝑐 𝑝 𝑡 0
(21)       if   𝑐 𝑝 𝑡 = 𝐾   then
(22)      𝑐 𝑝 𝑡 0
(23)       / / Apply SA to global best solution
(24)      iterSA 0, Initialize 𝑇 according to Equation  (5)
(25)       𝑐 𝑢 𝑟 𝑟 𝑒 𝑛 𝑡 _ 𝑠 𝑜 𝑙 𝑢 𝑡 𝑖 𝑜 𝑛 global_best_solution
(26)       𝑐 𝑢 𝑟 𝑟 𝑒 𝑛 𝑡 _ 𝑐 𝑜 𝑠 𝑡 Evaluate( 𝑐 𝑢 𝑟 𝑟 𝑒 𝑛 𝑡 _ 𝑠 𝑜 𝑙 𝑢 𝑡 𝑖 𝑜 𝑛 )
(27)      while  Not SA_stop_criterion  do
(28)        while  inner-loop stop criterion  do
(29)           𝑁 𝑒 𝑖 𝑔 𝑏 𝑜 𝑟 Generate( 𝑐 𝑢 𝑟 𝑟 𝑒 𝑛 𝑡 _ 𝑠 𝑜 𝑙 𝑢 𝑡 𝑖 𝑜 𝑛 )
(30)           𝑁 𝑒 𝑖 𝑔 𝑏 𝑜 𝑟 _ 𝑐 𝑜 𝑠 𝑡 Evaluate( 𝑁 𝑒 𝑖 𝑔 𝑏 𝑜 𝑟 )
(31)          if  Accept(current_cost, Neighbor_cost, 𝑇 )  then
(32)             𝑐 𝑢 𝑟 𝑟 𝑒 𝑛 𝑡 _ 𝑠 𝑜 𝑙 𝑢 𝑡 𝑖 𝑜 𝑛 𝑁 𝑒 𝑖 𝑔 𝑏 𝑜 𝑟
(33)             𝑐 𝑢 𝑟 𝑟 𝑒 𝑛 𝑡 _ 𝑐 𝑜 𝑠 𝑡 𝑁 𝑒 𝑖 𝑔 𝑏 𝑜 𝑟 _ 𝑐 𝑜 𝑠 𝑡
(34)          end
(35)          iterSA iterSA + 1
(36)          Update (global_best_solution)
(37)        end
(38)        Update( 𝑇 ) according to Equation(2)
(39)        Update (SA_stop_criterion)
(40)      end
(41)       end
(42)       iter iter + 1, Update (stop_criterion)
(43) end
Algorithm 1: HPSO-SA hybrid algorithm.