# Multiprocessor Fair Scheduling Based on an Improved Slime Mold Algorithm
## 4 Improved Slime Mold Algorithm (IMSMA)
### IMSMA Flowchart and Pseudocode  
The flowchart of the improved slime mold algorithm (IMSMA) is shown in Figure 2.  
First, the initialization of the slime mold population is performed using the direction learning strategy based on the Bernoulli map. Subsequently, the weights (W) of the slime molds and the value of parameter \(a\) are calculated. Random number \(r\) is compared to parameter \(z\). If \(r\) is less than \(z\), the slime mold positions are updated using the first equation in Equation (6). If \(r\) is greater than or equal to \(z\), the values of parameters \(p\), \(vb\), and \(vc\) are updated, and then \(r\) is compared to \(p\). If \(r\) is less than \(p\), the slime mold positions are updated using the second equation in Equation (6). If \(r\) is greater than or equal to \(p\), the slime mold positions are updated using the third equation in Equation (6). Next, nonlinear boundary conditions are applied to modify the positions of the slime molds. The fitness values of the slime molds are calculated, and the global optimal value is updated. It is then checked whether the global optimal value has not been updated for more than five times.  
If it has, it is considered that the algorithm has converged to a global optimal value. In this case, the Cauchy mutation strategy is applied to update the positions, and the global optimal value is recalculated and updated. If the global optimal value has changed at least once within a continuous span of 5 times, it is checked whether the termination condition is met. If the condition is not met, the iteration continues. If the condition is met, the algorithm terminates, and the optimal solution and the optimal fitness value are outputted.  
The pseudocode for the improved slime mold algorithm (IMSMA) is as follows:  
Step 1. Initialization: \(T\), \(Dim\), slime mold population \(N\), \(z\), \(lb\), \(ub\).  
Step 2. Based on the Bernoulli mapping reverse learning strategy, initialize the positions of the slime mold population. Do the fitness calculations and rank them in order to find the best fitness value \(bF\) and the poorest fitness value \(wF\).  
Step 3. Calculate the values of the weight \(W\) and the parameter \(a\).  
Step 4. If \(rand<z\): on the basis of the first equation in Equation (6), adjust the locations of the slime molds; go to step 6.  
Else: update \(p\), \(vb\), \(vc\); go to step 5.  
Step 5. If \(r<p\): on the basis of the second equation in Equation (6), adjust the locations of the slime molds; go to step 6.  
Else: on the basis of the third equation in Equation (6), adjust the locations of the slime molds; go to step 6.  
Figure 2: IMSMA Flowchart.  
Step 6. Revise the locations of the slime molds based on the nonlinear dynamic boundary conditions. Update the global optimal solution after calculating the fitness values. Step 7. If the global best solution has not changed more than five times, perform a Cauchy mutation on the positions of the slime molds; go to step 6. Step 8. If the termination condition is not satisfied, go to step 3. Else: generate the best answer and its fitness value, and terminate the program.