Optimizing production scheduling with the spotted hyena algorithm: A novel approach to the flow shop problem

ABSTRACT


Introduction
The flow shop-scheduling problem (Ferraro et al., 2023) is a common challenge in manufacturing and production environments (Ab Wahab et al., 2015), where multiple jobs must be processed through a series of machines or stages in a specific order. Finding the optimal order and timing of these jobs can help to increase efficiency, reduce costs, and improve customer satisfaction. However, finding the optimal solution can be a complex task as it requires considering multiple varia-bles and constraints.
In recent years, researchers have turned to various optimization algorithms (Ab Wahab et al., 2015) in an effort to find efficient and effective solutions to the flow shop-scheduling problem.  (Mzili et al.) 91 There are various algorithms and approaches that can be used to solve the flow shop-scheduling problem, including heuristics (Lenat, 1982), mathematical programming (Ball, 2011), and simulation. These approaches can be used to optimize the scheduling of jobs in realtime (Cai et al., 2023) or to plan and schedule jobs in advance (Musselman et al., 2022). However, these methods have some limitations and gaps that make it difficult to solve this problem effectively. For example, some heuristic algorithms may not be able to find the optimal solution, and mathematical programming methods can be computationally expensive.
In this article, we will focus on optimization algorithms for solving the flow shop scheduling problem, including those based on swarm intelligence (Sharma et al., 2021), such as particle swarm optimization (PSO) (Liao et al., 2012), ant colony optimization (ACO) (Yagmahan & Yenisey, 2008), and bee colony optimization (BCO) (Anuar et al., 2016). These algorithms have been used to solve the flow shop problem, but they have their limitations as well. For example, PSO, ACO and BCO are sensitive to the initial solution, and they may not be able to find the global optimum.
One such algorithm that addresses these limitations is the spotted hyena optimization algorithm (SHOA) (Dhiman & Kumar, 2018), which is based on the behavior and hunting strategies of spotted hyenas. This algorithm simulates the social dynamics and problem-solving behaviors of spotted hyena packs, which is unique compared to other optimization algorithms such as WOA, GWO, and BA. The objective of this research is to demonstrate the effectiveness of SHOA in comparison with other optimization approaches and to investigate the potential of this algorithm in solving the flow shop scheduling problem.
The SHO (Ghafori & Gharehchopogh, 2022) algorithm utilizes a population of hyenas that represent potential solutions to the flow shop scheduling problem. Each hyena is assigned a set of parameters that correspond to different aspects of the scheduling process, such as the order of the jobs and the processing times at each stage. The hyenas are then iteratively updated based on their performance and the performance of other hyenas in the population. This article will explore the development and application of the SHO algorithm for solving the flow shop scheduling problem. We will examine the performance of the algorithm in various test cases and compare it to other optimization algorithms. Through this analysis, we hope to demonstrate the potential of the SHO algorithm as a tool for optimizing production processes in a variety of industries.
We will provide an in-depth examination of the SHO algorithm and its application to the flow shopscheduling problem. We will discuss the underlying principles of the algorithm, its performance compared to other optimization techniques, and its potential benefits and limitations. Additionally, we will provide examples of how the SHO algorithm has been applied in real-world settings and its potential future directions. Overall, our goal is to provide a comprehensive overview of the SHO algorithm and its potential as a powerful tool for solving the flow shop scheduling problem.
The use of the spotted hyena optimization algorithm (SHOA) for solving the flow shop scheduling problem in manufacturing and production settings needs justification as there are many other metaheuristic algorithms available for this problem. The motivation for using SHOA is that it simulates the social dynamics and problemsolving behaviors of spotted hyena packs, which is unique compared to other optimization algorithms such as WOA, GWO, and BA. The attributes that make SHOA unique include its ability to adapt to changing environments, its use of a cooperative approach for problem solving, and its ability to learn from previous solutions and experiences.
One of the main advantages of SHOA is its ability to adapt to changing environments. This is important in manufacturing and production settings as the conditions and requirements of the problem can change over time. SHOA uses a cooperative approach for problem-solving which allows for the sharing of information and resources among the members of the pack. This approach leads to better and more efficient solutions than traditional algorithms.
Another advantage of SHOA is its ability to learn from previous solutions and experiences. This allows the algorithm to improve its performance over time and to find better solutions for the problem at hand. Overall, the unique attributes of SHOA make it a promising tool for solving the flow shop scheduling problem in manufacturing and production settings. The objective of this research is to demonstrate the effectiveness of SHOA in comparison with other optimization approaches, and to investigate the potential of this algorithm in solving the flow shop scheduling problem.
The main objectives of this work are:

•
To present the spotted hyena optimization algorithm (SHOA) as a novel approach for addressing the flow shop scheduling problem in manufacturing and production settings. To evaluate the performance of SHOA in comparison to other well-known optimization algorithms such as PSO, ACO, and BCO.

•
To examine the capacity of SHOA to adapt to changing environments and to learn from previous solutions and experiences.

•
To establish the effectiveness of SHOA in identifying optimal schedules for jobs in a flow shop environment.

•
To investigate the potential of SHOA as a tool for enhancing production processes and increasing efficiency in manufacturing and production settings.
The organization of this article is as follows: Section 2 presents related work, Section 3 introduces the flow shop problem, Section 4 presents the spotted hyena swarm optimization algorithm, Section 4 presents the proposed discrete SHOA algorithm to solve the flow shop problem, Section 6 presents the experimental results, Section 7 provides a comparison and analysis using the Wilcoxon test, and finally the conclusion.

Related works
Swarm intelligence algorithms have become increasingly popular in the realm of scheduling and optimization, specifically when dealing with the flow shop scheduling problem. This problem involves a sequence of jobs that need to be processed through a series of machines or stages in a particular order, with the objective of optimizing the schedule to meet certain goals, such as maximizing resource utilization or minimizing completion time.
One example of a swarm intelligence algorithm applied to this problem is the ant colony optimization (ACO) (Yagmahan & Yenisey, 2008b) introduced by Yagmahan and Yenisey in 2008. The ACO algorithm mimics the behavior of real-life ants that use pheromone trails to find the shortest path between their nest and a food source. In the context of flow shop scheduling, the ACO algorithm employs a similar approach, with each "ant" representing a potential schedule and the pheromone trails indicating the quality of each schedule. The algorithm continually improves the quality of schedules by adjusting the pheromone trails based on the schedules' performance.
Another widely used swarm intelligence algorithm in this domain is the particle swarm optimization (PSO) algorithm, which was introduced by Kennedy and Eberhart in 1995 (Kennedy & Eberhart, 1995). PSO algorithms are inspired by the flocking behavior of birds, with each "particle" representing a potential schedule. The algorithm improves the quality of schedules by adjusting the particles' positions based on their performance.
Both ACO and PSO algorithms have been applied to various variations of the flow shop scheduling problem, such as the flow shop scheduling problem with parallel machines (Akhshabi et al., 2014) and the flow shop scheduling problem with sequence-dependent setup times (Shen et al., 2018). These algorithms have been compared to other optimization techniques such as genetic algorithms (Jorapur et al., 2014) and simulated annealing, and have demonstrated efficacy in finding high-quality solutions in a relatively short amount of time (Jorapur et al., 2014). The use of swarm intelligence algorithms in the flow shop scheduling problem holds great promise and has the potential to enhance efficiency and productivity in manufacturing and production settings.

Flow shop problem
The flow shop problem is a type of scheduling problem (Fu et al., 2021;Komaki et al., 2019) in which a set of tasks must be performed in a specific order on a set of machines or resources. The objective is to minimize the total completion time or makespan (Dhiman & Kumar, 2018), i.e. the time it takes to complete all tasks while satisfying certain constraints such as machine availability and task dependencies.
The problem can be formulated mathematically using the following notation:

93
The objective function of the flow shop problem can be written as: where the first constraint ensures that the completion time of each job on each machine is the maximum of the completion times of the same job on the previous machine and the previous job on the same machine. The second constraint ensures that the completion time of each job is the completion time on the last machine.
The flow shop problem is a combinatorial optimization problem that can be solved using various techniques, such as heuristic algorithms, integer programming, and branch-and-bound algorithms.

The spotted hyena optimization (SHO) algorithm
The spotted hyena optimization (SHO) algorithm (Dhiman & Kumar, 2018) is inspired by the behavior and social dynamics of spotted hyenas, which are a type of carnivorous mammal found in Africa. Specifically, the SHO algorithm is inspired by the way that spotted hyenas work together to solve problems and make decisions as a group.
Spotted hyenas are known for their complex social structure and their ability to work together as a group to hunt and defend territory. They use vocalizations, body language, and other forms of communication to coordinate their actions and make decisions.
The SHO algorithm uses these principles of group decision-making and social coordination to solve optimization problems. It works by dividing the optimization problem into smaller subproblems, which are then solved concurrently by a group of "virtual hyenas" using a combination of exploration and exploitation. The solutions from the virtual hyenas are then combined to generate a final solution to the optimization problem.
The SHO algorithm has been applied to a variety of optimization problems, including those in the fields of machine learning, engineering, and economics. It has been shown to have good performance in terms of solution quality and computational efficiency. Spotted hyena optimization (SHO) is an optimization algorithm inspired by the social behavior and decision-making of spotted hyenas. Spotted hyenas are social animals that live and hunt in groups, relying on a network of trusted friends that can include over 100 members. They communicate with each other using specialized calls, postures, and signals and can recognize and rank their kin and other individuals.

Mathematical Formulation and Optimization Technique
In this subsection, we will introduce the mathematical models that outline the encircling behavior of predators and briefly mention the other behaviors of searching, hunting, and attacking prey. We will also present the SHO (Search, Hunt, and attacking) algorithm, which is used to model these behaviors.

encircling
Spotted hyenas are known for their hunting tactics, including encircling their prey to trap and isolate it. They use vocalizations, body language, and other forms of communication to coordinate their movements and surround their prey, cutting off any escape routes and preparing for the attack. This strategy allows them to take down even large and powerful animals, such as wildebeest and zebra, by overwhelming them with numbers and coordinating their attacks.
To model this behavior mathematically, we use the following equations: where Dh represents the distance between the prey and the spotted hyena, x indicates the current iteration, B and E are coefficient vectors, _ ( ) indicates the position vector of the prey, and P is the position vector of the spotted hyena. The symbols | | and · represent the absolute value and vector multiplication, respectively.
The vectors B and E are calculated as follows: where Iteration = 1, 2, 3, . . . , MaxIteration To find a balance between exploration and exploitation, the value of h is gradually decreased from 5 to 0 over the maximum number of iterations (MaxIteration). This encourages more exploitation as the number of iterations increases. B and E are random vectors within the range of [0, 1], which also helps to promote exploitation as the iteration value increases. In addition, rd1 and rd2 are random vectors within the range of [0, 1].

Searching
In addition to encircling prey, spotted hyenas also use their keen senses of sight, hearing, and smell to search for potential prey. They are known to track prey over long distances and through challenging terrain, using their powerful legs and stamina to pursue their targets. Once they have located their prey, they will use their encircling tactics to close in for the attack.

Hunting
When hunting, spotted hyenas use a combination of stealth and coordination to take down their prey. They often work together to surround and isolate their target, using vocalizations and body language to communicate and coordinate their movements. Once the prey is trapped, the spotted hyenas will attack by using their sharp teeth and powerful jaws to bring down their prey.

Attacking
Once the prey has been encircled and hunted, the spotted hyenas will attack in a coordinated manner by using their sharp teeth and powerful jaws to bring down their prey. They will work together to bite and tear at 95 the prey, using their superior strength and numbers to overpower their target. The spotted hyenas will continue to attack until the prey is killed or driven off, at which point they will divide the spoils of the hunt among themselves.

The proposed discrete DSHO to solve the flow shop problem
In this study, we will focus on using the encircling behavior to solve the flow shop scheduling problem. However, it is worth noting that there are other behaviors that can also be utilized in this context. To utilize the encircling behavior for this problem, the following steps can be followed: 1.
Define the problem: Clearly define the problem you are trying to solve, including the number of tasks, the number of workshops, and any constraints or requirements to consider.

2.
Initialize the population: Create a population of spotted hyenas that will represent potential solutions to the problem. Each hyena will be assigned a set of tasks to be performed in a random order.

3.
Define the prey: Set the prey to represent the best possible position, i.e. the optimal sequence as we do not know the best solution at the beginning. We assume that the prey will be the hyena closest to the optimal solution during the search.

4.
Evaluate the distance between the hyena and the prey: Calculate the distance between each hyena and the prey using the objective function of the flow shop problem, such as minimizing the makespan or total completion time.

5.
Select the hyena closest to the prey: Select the hyena with the shortest distance to the prey as the fittest hyena. This hyena will be used to generate the next generation of hyenas.

6.
Generate new hyenas: Generate new hyenas from the fittest hyena using discrete operations, such as permutation and swapping, instead of vector multiplication and absolute value by eq(3).

7.
Apply the 2-opt algorithm: This involves selecting two edges in the schedule and swapping the order of the jobs between them. Calculate the new makespan after the swap and if it is better than the current solution, keep the new solution.

8.
Repeat the process until the optimal solution is found: Continue the process of evaluating the distance between the hyena and the prey, selecting the fittest hyena, and generating new hyenas until the optimal solution is found. To apply this mechanism to solve the flow shop problem, several adjustments must be made to the mathematical representation of the equations and the mathematical operators used. Specificavly: • Each hyena P(x) can represent a sequence of tasks to be performed, but in a random order, i.e. a possible random solution to the flow shop problem.

•
The position P_prey(x) of the prey represents the best possible position, i.e. the optimal sequence as we do not know the best solution at the beginning. We assume that P_prey(x) will be the hyena closest to the prey during the search.

•
The mathematical operators must be modified as they are designed only for linear problems, while the flow shop problem is a discrete problem. The necessary changes include: • Using discrete operations, such as permutation and swapping, instead of vector multiplication and absolute value.
• Adjusting the coefficients B and E to be suitable for the flow shop problem, such as using task processing times or machine speeds as coefficients.
• Using the objective function of the flow shop problem, such as minimizing the makespan or total completion time, as the criterion for determining the distance between the hyena and the prey.

Mathematical operator's changes.
The mathematical operators for the flow shop problem will be redefined as follows: • ℎ = | · ( ) − ( )|: The operator of subtraction between two hyena positions will be changed in our case to a list of swaps to be performed on a sequence of jobs P(t) to obtain the first sequence list Pbest(t).
• · ℎ: This operation between areal number in the range [0,1] and a list of swaps will be defined to manipulate and reduce the number of swaps generated by the previous equation.
• ( ) − · ℎ : This operation allows for the final number of possible swaps to be applied to a sequence of jobs.
These changes will be clarified in the following example: The 2-opt algorithm can be applied to the given schedule by selecting any two edges and swapping the order of the jobs between them. The new makespan is then calculated based on the swapped order. If the new makespan is better than the current solution, then the new solution is kept.
For example, if we have a schedule as follows: • Machine 1: Job 1-2-3 • Machine 2: Job 4-5-6 We can select the edges (1,2) and (5,6) and swap the jobs between them to get: • Machine 1: Job 1-5-6 • Machine 2: Job 4-2-3 The new makespan is calculated based on this swapped order and if it is better than the current makespan, the new solution is kept. This process can be repeated by selecting different edges until no further improvement is possible.
The final algorithm can be described as follow:

Experimental results
The performance of the SHO algorithm was evaluated on a set of 45 benchmark instances from the OR library. The results of this evaluation are shown in Table [ [3][4][5], which includes the instance name ('Instance'), the number of jobs (n) and machines (m) for each instance ('n×m'), the best result achieved by other algorithms ('BKS'), the best and worst results obtained through the SHO method ('Best' and 'Worst'), the average results ('Average'), and the average execution time in seconds for 20 runs ('Time'). The 'PDav(%)' column shows the percentage deviation of the average solution length from the optimal solution length, calculated using equation 8.
The "PDav(%)" column highlights values of 0.00 in bold when all solutions found in the 20 runs are equal to the length of the best-known solution. If the average of the solutions found in all tests is less than the length of the best-known solution, these values are highlighted in bold and blue. This indicates that the SHO algorithm was able to find solutions that either equal or exceed the best-known solutions for these instances.
To gauge the effectiveness of the SHO algorithm, it is important to compare it with other problem-solving methods. For a more comprehensive understanding of SHO's capabilities, it is recommended to compare it to a variety of different metaheuristics (Table 2). This will provide a clearer picture of SHO's strengths and weaknesses compared to other algorithms and help determine in which situations it performs best. By comparing SHO to a range of metaheuristics, we can gain a better understanding of how it performs against different types of problems and techniques. The initial parameters of SHO are described in Table 1.  (Kurdi, 2021) The Social Spider Optimization (SSO) algorithm is based on the collaborative behavior of social spider colonies, which involve interactions between males and females performing various tasks such as web-building, prey capture, and mating. The algorithm incorporates both direct and indirect interactions among the "spiders" in the optimization process. (Zhao, et al., 2015(Zhao, et al., , 2021 The Shuffled Complex Evolution (SCE) algorithm with opposition-based learning is an optimization method that combines the SCE algorithm, a global optimization technique with opposition-based learning, a method for generating new solutions by manipulating existing ones. (Zhao, et al., 2016) The Chaotic Local Search Based Bacterial Foraging Algorithm (CLSBBFA) is an optimization method that combines chaotic local search with the principles of bacterial foraging to search for optimal solutions to problems.

CLS-BFE
ACGA (Chang, et al.,, 2008) The Artificial Chromosomes Genetic Algorithm (ACGA) is an optimization method that combines the principles of genetic algorithms with the use of artificial chromosomes to encode and manipulate solutions.

CSO (Li & Yin, 2013)
The HCS algorithm combines the Cuckoo Search, a metaheuristic optimization method inspired by the behavior of cuckoo birds, with Lévy flights, a technique for random search that is based on the probability distribution of Lévy flights observed in nature.

BAT (Bellabai et al., 2022)
The BAT algorithm is a method that uses the echolocation system of bats as inspiration to solve problems. It involves individual search and movement towards "nutritious" locations with certain idealized rules being followed to optimize the process.

Comparison and analysis
Based on Table 3, which compares SHOA, SSO, SCE-OBL, CLS-BFO, and ACGA, we can see that SHOA was able to find the optimum for all test instances, while the other metaheuristics were not. This is also supported by Figure 2, which shows that the values of SHOA are lower than those of the other methods.
However, the comparison between SHOA and CSO in Table 4 and Figure 3 shows that the results of SHOA are better than those of CSO, and the deviation curve of SHOA shows that, for each instance, the 20 executions gave results that were very close to the optimum, while CSO did not.
Finally, Table 5, which compares SHOA with BAT and TLBO, shows that SHOA found the optimum in all the tested instances, while BAT found the optimum for only 3 instances, and TLBO did as well. Figure 4 shows that the curve for SHOA is very small compared to those of BAT and TLBO, indicating that SHOA was able to find the optimum or a nearly optimal value for the 20 tested executions.

Wilcoxon Test and Statistical Analysis
These results can also be supported by the Wilcoxon test described below: The Wilcoxon test is a non-parametric statistical test used to compare the medians of two groups. In the table above, the Wilcoxon test is used to compare the performance of the SHOA (Spotted Hyena Optimization Algorithm) with four other optimization algorithms: SSO (Scatter Search Optimization), SCE-OBL (Self-Adaptive Cuckoo Search with Orthogonal Bat Algorithm), CLS-BFO (Chaotic Levy Walk with Biogeography-Based Optimization), and ACGA (Adaptive Cooperative Genetic Algorithm).
The "N" column indicates the number of samples or instances used in the test. The "W+" and "W-" columns represent the sum of the ranks of the SHOA results that are better or worse than the results of the comparison algorithm, respectively. The "p-value" column shows whether the probability that the results obtained are due to chance or not. If the p-value is less than 0.05, the results are considered statistically significant and the null hypothesis (that there is no difference between the two groups) is rejected.
According to the results in Table 6, the SHOA algorithm significantly outperforms all four comparison algorithms on all of the test instances. This is indicated by the p-values being less than 0.05 and the "Significant" column showing "Yes" for all comparisons.

Conclusion
In conclusion, the results of this study demonstrate that the SHOA algorithm is an effective solution for the flow shop problem. It consistently found the optimal or nearly optimal solution across all test instances, while the other algorithms tested were unable to do so. These results were supported by both visual comparisons of the results and statistical analysis using the Wilcoxon test. There are several possible avenues for future work in this area. One possibility is to further improve the SHOA algorithm by incorporating additional optimization techniques or adapting it to different variations of the flow shop problem. Another possibility is to test the algorithm on a wider range of test instances to ensure its robustness and generalizability. Additionally, it would be interesting to compare the performance of SHOA with other state-of-the-art optimization algorithms to see how it stands up against them. Finally, applying the SHOA algorithm to real-world flow shop problems and evaluating its performance in those settings could provide valuable insights and potential practical applications.