## 4 Proposed Hybrid PSO (PHPSO) for NWFSSP
### Proposed Hybrid PSO (PHPSO) Algorithm  
PHPSO algorithm is based on the solution representation by the ROV rule, population initialization with NEH-based local search and neighborhood searching through SA-based local search. The complete computational procedure of the PHPSO framework for the NWFSS PHPSO algorithm for NWFSSP (Algorithm 1) can be summarized as follows:  
```
Step 1: Input the total no. of jobs (n), total no. of machines (m) and processing time matrix (p). Calculate delay matrix (\(\delta\)) as per Equation (7). Step 2: for i = 0 to n - 1 do 2.1 Initialize particle with random value (mpval) and velocity (mvelocity). Set the acceleration constants c\({}_{1}\) and to 1.65 and 1.75 respectively; r\({}_{1}\) and r\({}_{2}\) both are set to the value 0.5 and inertia weight w to 0.65. 2.2 Apply ROV rule to represent random value of particle to position of particle (mpbest). 2.3 Calculate the processing sequence of job (\(\sigma\)) as per ROV rule. 2.4 Evaluate objective function value TFT as per Equation (6).
```  
**Algorithm 1**PHPSO for NWFSSPend for  
Step 3:  
Sort the particles with increasing order of TFT score.  
Step 4: Generate initial seed sequence with NEH algorithm by following:  
4.1 Consider the first sequence(\(\sigma_{1}\)) of job and find TFT. Swap first position with next and compute TFT for new sequence(\(\sigma_{1}\)).  
4.2 for i = 1 to n do  
4.2.1 Swap \(\sigma_{i}\) with \(\sigma_{i+1}\) and find TFT  
4.2.2 if TFT(\(\sigma_{i}\)) < TFT(\(\sigma_{i+1}\)) set \(\text{f}_{\text{seq}}=\sigma_{i}\)  
else \(\text{f}_{\text{seq}}=\sigma_{i+1}\)  
Step 5: minArr = \(\text{f}_{\text{seq}}\)  
Step 6: Calculate pbest (mpbest) of particle and gbest (pgbest) of swarm for generating the initial seed sequence.  
Step 7: Select particle from the current population for local refinement;  
repeat  
7.1 for i = 0 to n \(-\) 1 do  
7.1.1 Update velocity and position of particle according to Equations (9) and (10), respectively.  
7.1.2 Update value of particle (mpval) and apply ROV rule to find next job permutation.  
7.1.3 Calculate TFT value for the updated particle.  
7.1.4 If updated_TFT_value > current_TFT_value and gbest (pgbest) then  
7.1.5 update pbest of particle (mpbest) and gbest (pgbest)  
end for  
until maximum iteration count is reached.  
Step 8: Select best_particle from the population for global refinement;  
Step 9: Initialize initial_temperature, T as 3.0 and final_temperature, F as 0.9, and cooling rate \(\alpha\) as 0.99.  
Step 10: Initialize Best_So_Far to current state.  
Step 11: while T < final_temperature do  
11.1 for i = 0 to n \(-\) 1  
11.1.1 Randomly perturb from the current state to a new state and calculate corresponding objective function value.  
11.1.2 Update gbest depending on best particle.  
11.1.3 Calculate the difference in objective function value between current and new state i.e., \(\Delta E\)  
11.1.4 If \(\Delta E\) < 0 i.e., new state has minimum TFT, accept new state as current state. Set Best_So_Far to this new state  
11.1.5 If \(\Delta E\geq 0\), consider new state as current state with probability by invoking random number between range (0, 1).  
11.1.6 Prob (accepted) = exp (\(-\Delta E/\alpha\cdot T\)).  
11.1.7 Revise \(T\) as necessary according to annealing schedule  
end for  
end while  
Step 12: set gbest to Best_So_Far.  
**End Procedure**  
Thus, it can be observed that the PHPSO effectively provides a promising solution within the entire region, along with exploitation for solution improvement in sub-regions. Because of the NP-hard nature of NWFSSP, PHPSO applies local search methods which include NEH-based local search and SA-based local search. Since both exploration and exploitation are used in this algorithm, it is expected to achieve good results for NWFSSP. The results obtained through various numerical simulations and their comparisons are demonstrated in the next section.