#### Abstract

An evolutionary discrete firefly algorithm (EDFA) is presented herein to solve a real-world manufacturing system problem of scheduling a set of jobs on a single machine subject to nonzero release date, sequence-dependent setup time, and periodic maintenance with the objective of minimizing the maximum completion time “makespan.” To evaluate the performance of the proposed EDFA, a new mixed-integer linear programming model is also proposed for small-sized instances. Furthermore, the parameters of the EDFA are regulated using full factorial analysis. Finally, numerical experiments are performed to demonstrate the efficiency and capability of the EDFA in solving the abovementioned problem.

#### 1. Introduction

Production scheduling is a form of decision-making that significantly impacts any manufacturing or service [1]. Efficient production schedules are critical in improving organization productivity by exploiting the production system efficiently and conducting the best utilization. According to the production environment, the single-machine scheduling problem (SMSP) is one of the most common scheduling problems that have been studied in the past few decades. However, in some real-world manufacturing systems, studying the SMSP under the setup consideration between jobs is also required such as the manufacturing systems in painting and metalworking industries [2]. Comprehensive reviews regarding the setup consideration are provided [3–5] for all scheduling problem environments such as the single-machine scheduling, parallel machine scheduling, and flow shop scheduling problems. The authors clarified the sequence-dependent setup time when the setup time for any job depends on the immediately preceding job; i.e., the setup time for the job* i* after job* j* should not equal the setup time for the same job* i* after any other job. Different algorithms were proposed in [6–15] to optimize the SMSP with considering of the sequence-dependent setup times constraints. An ant colony optimization was presented in [16] to minimize job tardiness for an SMSP with sequence-dependent setups. A single-machine scheduling problem with sequence-dependent setup times and release dates had been less studied [2, 17, 18]; one of these studies is [2] where a beam search and mixed-integer linear model were used to study the SMSP subject to the release date and nonanticipatory dependent setup time to minimize the makespan.

Additionally, in several studies on scheduling in a single-machine environment as well as the previously mentioned papers, the problems have been simplified by ignoring the maintenance intervention dates assuming the production systems are continuously available over the planning horizon, which would increase the probability of machine breakdowns. Many researchers have adopted some basic assumptions in their studies [19–21] by considering that maintenance activities are important to improve the manufacturing system efficiency and product quality. However, to maintain the production system in a good condition and to decrease the probability of system failures, various maintenance policies (periodic, preventive, among others) have been applied in many real-world manufacturing systems where the periodic maintenance policy has been widely used [22]. Maintenance activities were performed during known intervention dates and occupied part of the running time of the planning horizon of the machine. Hence, the scheduling of jobs on the available machine’s running time is an important issue that attracted many researchers. Reference [23] addressed the problem when the maintenance duration is dependent on the workload time, and the start time for each maintenance is restricted to a given time window. A mixed-integer linear programming model was used by [24] to minimize the makespan of a set of jobs on the SMSP with flexible periodic preventive maintenances, where the jobs have their own release dates. Moreover, the authors provided two complementary algorithms, i.e., a heuristic consisting of earliest release date rule and longest processing time (ERD-LPT) and Branch and Bound algorithm. Reference [25] offered six types of heuristic algorithms to minimize the makespan in the SMSP by considering flexible periodic maintenance. An uncertain single-machine scheduling problem with periodic maintenance studies the SMSP subject to periodic maintenance with considering the uncertainty environment for the processing and maintenance time. The uncertain data caused where the data cannot be accurately obtained and could be estimated via work experience. Three uncertain programming models were reported in [26] to solve the SMPS with periodic maintenance when the time of processing and repair are nondeterministic. Reference [27] provided a mathematical formulation and a knowledge-based variable neighborhood search algorithm to minimize the sum of maximum earliness and tardiness on a single machine with multiple unavailability constraints.

The works that address the SMSP with sequence-dependent setup times and periodic maintenance constraints are few. References [28, 29] considered the scheduling problem by minimizing the total earliness and tardiness penalties on the single machine with sequence-dependent setup times and planned maintenance constraints. Paper [30] addressed the scheduling problem on a single machine with availability constraints and sequence-dependent setup to minimize the makespan; they also presented a mixed-integer linear model. In another work [31], the same authors offered a metaheuristic that combined the greedy randomized adaptive search procedure and a local search for the SMSP subject to preventive maintenance and sequence-dependent setup times. Finally, [32] addressed the same above-mentioned problem and presented another metaheuristic that depended on the tabu search embedded in a multistart procedure.

The primary interest in this work is to provide a mixed-integer linear programming model and an effective algorithm called evolutionary discrete firefly algorithm for the production schedules for the single-machine problem subject to resale date, dependent setup time, and periodic maintenance, to minimize the makespan. To our knowledge, the addressed problem herein has been not studied hitherto. The remainder of this paper is organized as follows: The next section will be dedicated to describe the problem in detail and formulate it with a mixed integer linear programming model. Section 3 presents a brief introduction to firefly algorithm, and Section 4 will be to demonstrate the proposed algorithm (EDFA) in details. Section 5, discusses the parameter tuning for the proposed algorithm. Computational experiments are given in Section 6. Finally, Section 7 makes a conclusion and recommendation discuss for the possible future work.

#### 2. Problem Description and Mathematical Modeling

##### 2.1. Problem Definition and Assumptions

The considered problem is defined as a set of jobs on a single machine where each job has a certain processing time and release date . The machine can only process one job at a time. Job preemptions are not allowed and no precedence relations exist between them. Each job has a setup time that depends on the immediate successor job . The machine is not continuously available over the planning horizon of the machine and a periodic maintenances activity should be performed, as shown in Figure 1. The time between two maintenances is presumptively fixed, and the time required to perform maintenances is . The aim is to obtain the best sequence of the n jobs on the machine that minimizes the maximum completion time .

##### 2.2. Proposed Model

The notations in Table 1 are used to formulate the problem.

The mixed-integer linear programming (MILP) model formulated based on the assumptions above and the mathematical notations are as follows:Equation (1) minimizes the makespan. Constraints (2) until (4) were used to obtain the expected sequence that determines the required setup time, whereas constraint (2) guarantees that every job has exactly one predecessor. The first job in the schedule has a predecessor which is the dummy job 0, for that (*j = 0*) as shown in Constraint (2). Constraint (3) ensures the feasibility of the sequence in which the maximum number of successors for any job is no greater than one. Because the last job in the scheduled has no successor, the equality condition for Constraint (3) cannot be considered. Constraint (4) imposes that the dummy job 0 be placed as the first in the sequence. Constraint (5) ensures that each real job occupies only one position of the scheduling sequence. Constraint (6) ensures that each position can only be occupied by one job. Constraints (7) and (8) guarantee the sequencing similarity of the jobs in setup decision variable ‘’ and job scheduling decision variable ‘’; i.e., if the job* i* processed in position* k* () and the job* i* also processed immediately after job* j* (), Constraints (7) and (8) guarantee that job j occupies position* k-1* (). Constraint (9) calculates the setup time for each job by considering its position and the immediately preceding job. Constraint (10) guarantees that the job cannot start when performing maintenance activities. Constraint (11) ensures each job cannot start until the predecessor job is completed. Constraints (12) and (13) determine the starting time and completion time for all jobs. Constraint (14) calculates the machine’s age after running the first job, and constraint (15) calculates the machine’s age after running each job, where the machine’s age is the total running time for the machine after the last maintenance activity with adding the idle time that caused the release date constraint. Constraint (16) guarantees that the machine’s age is no larger than the time required between two maintenances. Constraint (17) indicates that the job cannot start until the job is released. Constraint (18) calculates the makespan. Constraints (19) and (20) are used to indicate the type of decision variables.

By using the CPLEX solver, an instance with six jobs (n = 6) was used to test the proposed MILP model. The input data for the given example are presented in Table 2. The Gantt chart for the optimal schedule is shown in Figure 2.

##### 2.3. Preliminary Analysis

To evaluate the performance of the EDFF for large-scale problems, some properties of the problem are introduced in the following.

*Property 1. *For any feasible schedule s,

*Proof. *As it is known, the maximum completion time for any set of jobs must be larger than the latest release date , by adding the processing time and the smallest setup time for the job with the latest release date.

Therefore, we can obtain .

*Property 2. *For any scheduling problem, .

*Proof. *Suppose that the total machine idle time is only when the machine is waiting for the first job in any feasible schedule s. First, the machine cannot start before the smallest release date for the set of job ; subsequently, the actual running time for the machine equals to the smallest possible amount of time by using the smallest setup time for each job regardless of the sequence consideration except for the processing time . Because the maintenance constraint is also not considered, the is larger.

*Note*. The lower bound of the problem is estimated by the maximum value between these two properties.

#### 3. Firefly Algorithm (FA)

The firefly algorithm (FA) is one of the swarm intelligence methods first developed by [33]. The algorithm is inspired by the social behaviour of fireflies in which they produce flashlights to attract their mates. Three idealized characteristics of the fireflies’ flashing light are used to develop the FA to obtain an optimal solution [34]. First, all fireflies are assumed to be unisex, and any firefly can be attracted to another regardless of its gender. Next, the attractiveness of the fireflies is directly proportional to their brightness, and it decreases when the distance between the two fireflies increases. Thus, for any two flashing fireflies, the less luminous one will be attracted and moves to the other. Finally, the brightness of the flashing light of a firefly is considered as an objective function that requires optimization. The FA procedure can be described as in Algorithm 1 [35].

Parameter Initialization for the algorithm & define the objective function ) | |

Generation of the initial population . | |

while i ≤ number of fireflies do | |

Evaluation of the light intensity | |

i++; | |

End | |

while x ≤ Maximum number of iterations do | |

i← 1; | |

while i ≤ number of fireflies do | |

j← 1; | |

while j ≤ number of fireflies do | |

if | |

Calculate the distance between two fireflies | |

Firefly with less luminous moves to the brighter once | |

Attractiveness varies with distance r via ; | |

Evaluation of the light intensities of new solutions and update the light | |

intensity; | |

j++; | |

End | |

Rank the fireflies and obtain the current best; | |

i++; | |

End | |

x ++; | |

end |

#### 4. Evolutionary Discrete Firefly Algorithm

The FA was primarily developed for continuous optimization [36], which attracted many researchers to adopt the classic FA to a discrete version to solve different discrete problems such as the scheduling problem [37, 38] and vehicle routing [35, 39]. The primary steps of our EDFA are presented as follows.

##### 4.1. Generation of the Initial Population

The first step of the EDFA is to generate an initial population that represents a set of possible and feasible solutions for the addressed problem. This initial population of fireflies contains* m* random permutations of (1, 2… n), with the consideration that each firefly has a different permutation from the others. The population size determines the number of solutions or the size of the search space whose purpose is to direct the search to the best location.

##### 4.2. Evaluation of the Light Intensity

The light intensity for each firefly is determined by its objective function value in the EDFA, which is the maximum completion time in our study (Algorithm 2). Because the problem is a minimization problem, the firefly with a lower objective function value is more attractive than the others. Generally, this evaluation is used to obtain the best individual or bad individual.

a ← First job on the schedule | |

whiledo | |

If ( | |

If ( | |

Else | |

If ( | |

end |

##### 4.3. Distance Function

In the continuous optimization problem, the Euclidian distance is widely used to determine the distance between two fireflies. For our discrete problem, the distance between any two fireflies is measured by the number of different arcs between them [40]. For example, given we have two fireflies, each consists of eight nodes:

First firefly, .

Second firefly, .

The distance between the two fireflies is 5 = -1,5-, -3, 1-, -6, 3-, -8,6-, -7,1-.

##### 4.4. Attractiveness

In the classic FA, the attractiveness function is defined using the light intensity, the distance between fireflies, and an absorption coefficient.This scheme is completely adopted in the EDFA.

##### 4.5. Firefly Movement

The movement of a firefly* i* that is attracted to another brighter firefly j is expressed aswhere is the distance between the two fireflies i and j, and g is the iteration number. In this case, the length of the firefly movement will be a random number between 2 and . This value is used to generate n successors from the solution corresponding to the firefly to be moved.

##### 4.6. New Population Creation

When the fireflies are moving toward to the brighter ones, the translocation mutation strategy for each firefly couple is applied to create the “n” number of new fireflies. The length of the translocation mutation is determined byFigure 3 illustrates an example of the proposed mutation strategy. In this method, at first two fireflies are selected through their attractiveness evaluation (Figure 3(a)). And then, the first mutation point is selected randomly from a discrete uniform distribution in (1, n - L) and the second mutation point equals to (the first mutation point +L), (Figure 3(b)). Then all digits between the two mutation points will be exchanged between the two fireflies (Figure 3(c)). After that, the remaining empty positions in the new fireflies 1 and 2 are consecutively filled by the unassigned jobs in the same order that appears in the original fireflies (Figure 3(d)). This process will be repeated for n times according to the values of fireflies’ movement. After all successor new fireflies are created, their light intensities will be evaluated. During the pair comparison loop, the best solution currently is updating iteratively.

The new fireflies are generating from the best solution on each iteration (Figure 4(a)). In continuance, creating an empty template has the same number of digits of the solution filling it with a random binary number to each digit (Figure 4(b)). The digits with ‘1’s in the binary templet will keep the same job in its positions from the best solution in the new solution (Figure 4(c)). Then, fill the remaining empty digits with the remaining unselected jobs randomly (Figure 4(d)). For all new iterative stages, the brightness and attraction of each firefly are calculated.

**(a)**

**(b)**

**(c)**

**(d)**

##### 4.7. Local Search

The procedure consists of swapping two jobs selected randomly (IT), or the random insertion of a job in another random position (IS) for the possibility of improvement (Figure 5). Both variants IT/IS and IS/IT could be used in a random way depending on which is implemented first.

##### 4.8. EDFA Decoding Scheme

The structure of the proposed EDFA is shown in Figure 6.

The EDFA has two useful elements that render it competitive with other algorithms:(1)creating a new generation of fireflies by the translocation mutation method and(2)creating a local search combining IT and IS.

#### 5. EDFA Parameters Setting

Different types of parameter settings were used to test the EDFA. The list of parameters and their expected levels are presented in Table 3. About 540 investigational runs have been done on ten instances with a number of jobs =15. The average relative percentage deviation (ARPD) from the lower bund is the response variable of the factorial analysis. To conduct the best model, the nonsignificant terms were eliminated according to the P value and the final result showed Table 4.

Figure 7 shows the interaction between the parameters, in which we found that the number of fireflies has a significant effect on the algorithm performance.

The best values were obtained by a full factorial design analysis, where the number of fireflies = 15, the fireflies’ attractiveness coefficient (*β*) = 0.5, the light absorption coefficient (*γ*) = 0.75, and the number of iterations = 120.

#### 6. Computational Analysis

In this section, the EDFA performance evaluation is discussed. To examine the EDFA behaviour, the algorithm was coded in C and tested on 480 randomly generated instances using a PC with an Intel Core i7 2.80-GHz CPU and 8-GB RAM.

##### 6.1. Data Generation

As a wide set of benchmark instances is not available for the addressed problem, two sets of instances are randomly generated based on a uniform distribution for processing time, release dates, and setup time as shown in Table 5. The maintenance time and the fixed time between two maintenances are generated dependent on the total expected time and a control variable for each parameter, where ‘t’ and ‘m’ are control variables for the fixed time between two maintenances and the maintenance time respectively. As Table 5 clearly indicates, the parameters are randomly generated from different parameters and include different kinds of circumstances for a more convincing validation.

##### 6.2. Experimental Results

###### 6.2.1. Comparisons of EDFA with CPLEX

The efficiency and effectiveness of the proposed algorithm will be evaluated in this section by comparing the computation result of the EDFA with the optimal result obtained by solving the same small-scaled instances by the proposed MILP in CPLEX with a 1-h run time limitation. Table 6 shows the summary results of 240 instances by five replications for each parameter combination, which indicates that the proposed EDFA can obtain the exact solutions for all instances. Because the computation times of the EDFA are less than 2.5 s in all instances, which outperformed the CPLEX solver CPU times, we did not include EDFA time in the table. The relative percentage deviation for small-scaled instances is calculated by the following formula: Figure 8 shows that the EDFA is superior to well-known dispatching rules, which are first in first out (FIFO), shortest processing time (SPT), and longest processing time (LPT) for all small-scaled instances with respect to the RPD.

###### 6.2.2. Comparisons of EDFA with Other Algorithms

To evaluate the proposed EDFA performance, different methods that have been proposed in the literature for solving a similar problem were investigated in this section. The first method is called ERD-LPT to minimize the makespan for a set of jobs on the SMSP with flexible periodic maintenances [24]. The second method is EDFA for solving the transport salesman problem (TSP) [40], which is related to the addressed problem in this work if the constraints of the maintenance and the release dates are ignored; the problem collapses to TSP where nodes correspond to jobs and edges correspond to setup times. For the comparison clarity, the second method was renamed to (O-EDFA). The third method is particle swarm optimization (PSO), which is similar to the proposed EDFA with corresponding the Light absorption coefficient (*γ*) =0 [36].

Tables 7 and 8 show the comparisons between the proposed EDFA (P-EDFA), PSO, ERD-LPT, and O-EDFA for large-scaled instances, where “max”, “min”, and “ave” are the maximum, minimum, and the average of the relative percentage deviation RPD, respectively, from the lower bound calculated from Properties 1 and 2 (Section 2.3). Tables 7 and 8 show that P-EDFA have a better performance than other methods.

The relative percentage deviation is calculated using the following formula:Once the experimental results were presented, a statistical test has been done to check if there was a significant difference between the performance of the four methods (ERD-LPT, PSO, O-EDFA, P-EDFA) or not. Table 9 demonstrates the result of the statistical test which is the one-way ANOVA analysis test. From Table 9, the P value is smaller than *α* value, which is 0.05 (significance level), refering that there is a significant difference between the performance of the four methods.

Figure 9 demonstrates the Tukey simultaneous 95% confidence interval test. The aim of applying this test is to compare the means of the performance of the four methods and check if there are significant differences from each other. If an interval does not contain zero, the corresponding means will significantly differ from each other. In Figure 9 all intervals do not contain zero, which is strong evidence that the performances of the four methods are significantly different.

Finally, some sensitive analyses are performed for assessing the behaviour of algorithms versus different conditions. The interaction between the RPD values versus the number of jobs, setup time factor, maintenance interval factors, release date factor, and maintenance time factor is shown in Figures 10(a), 10(b), 10(c), 10(d), and 10(e), respectively.

**(a) Setup time (s)**

**(b) Number of Jobs (n)**

**(c) Maintenance interval (T)**

**(d) Maintenance time (M)**

**(e) Release Dates (r)**

#### 7. Conclusion and Results Discussion

Herein, an EDFA was developed to minimize the makespan for a single machine with periodic maintenance, sequence-dependent setup times, and release date constraint. The proposed algorithm has two distinctive features, including the inversion mutation method for creating the new generation of fireflies and a local search. In total, 420 random instances were generated to test the efficiency and effectiveness of the EDFA. The EDFA performances were compared with the CPLEX and PSO. The results revealed that the proposed EDFA showed the optimal solution as generated in the CPLEX solver for most of the small-scaled instances. Regarding the CPU time, the results indicate that the EDFA outperforms the CLPEX in execution time for all problem instances. For large-scaled instances, the EDFA shows excellent performance and it outperformed the PSO algorithm.

#### Data Availability

The data used to support the findings of this study are available from the coauthor Ammar Qamhan (435108378@student.ksu.edu.sa) upon request.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.

#### Acknowledgments

The authors extend their appreciation to the Deanship of Scientific Research at King Saud University for funding this work through research group No. RG-1439- 033.