The combination of a NEH heuristic and an LP metric to solve a flow-shop scheduling problem taking into account energy consumption and production costs: a case study

In this work, we study a multi-objective problem in a pharmaceutical production unit composed of several production stations that produce several kinds of products. The goal of this work, in a first step, is to propose a scheduling at the production unit in order to establish a synchronization of the different tasks on the m-machines. The problem can be formulated by the scheduling of a multi-product flow-shop.Then, we take into account the energy constraints of each task to be done. The problem can be formulated by a linear multi-objective MILP program, where the first objective is to determine the best sequence that minimizes the production and launch costs. In addition, the second objective is to find the best sequence that minimizes energy consumption. The problem is formulated and solved by combining the NEH heuristic and the LP-metric method to determine an intermediate solution between minimizing production costs and minimizing energy consumption.


Introduction
The evolution of technology and the increasing competition from more exigent customers impact the industry at all different levels. In this context, companies tend to improve their performance and productivity by adopting new mechanisms and approaches to ensure their competitiveness in the market.
In this environment, the component that significantly affects each organization is the production system. The optimization and control of this element generates an improvement and a gain for the company. The main activity of this component is the planning and scheduling of production. This is why scheduling is becoming an essential aspect of production management. It consists of establishing a precise plan for the use of available resources (time, energy, raw materials, etc.). This determines when to process a particular task, under which resource and in what quantity. It is a question of managing and optimizing conflicts according to the criteria and characteristics of the production system. More commonly, the production scheduling problems dealt with most often consider points such as resources, quality and running times as target objectives in their optimization approaches. However, there are a multitude of other issues that need to be addressed to optimize a production system. In addition, a field that has emerged in recent years and is increasingly solicited is the energy context, in relation to the exhaustibility of certain energy sources (nonrenewable energy) and in relation to its negative * Corresponding author: triquilamia@yahoo.fr environmental impact. Environmental issues are now at the heart of world affairs. They are now a primary criterion of recent economic models. Industrialists must now face new challenges of an environmental nature, which is most often translated into elements such as gas and toxic product emissions, consumption of nonrenewable resources (gas, oil, etc.). In this work, we are more particularly interested in the question of the energy consumption of a production unit. Indeed, it was established following bibliographical research that it is a problem which is current and whose stakes are important for the industrialists.
To position our work in this area, namely that our work addresses two phases, the first phase related to the scheduling of a multi-product flow-shop and a second phase related to energy consumption in a multiobjective framework, an overview of existing work will be given subsequently, where several researchers are interested in the multi-objective aspect of the criteria for optimizing production units as given by Mouzon and al. (2007) [1] who have proposed several algorithms that can solve a single machine problem aiming to reduce energy consumption and total operating time. Shrouf and al. (2014) [2] addressed in their scheduling problem the minimization of the total cost of the energy consumed. Their model considers the cost and amount of energy varying from one period to another. Al Quaseer and al. (2015)[3] applied a method for minimizing delay times and energy consumption during idle time through a multi-objective mathematical model based on genetic algorithms. Yan and al. (2016) [4] A multi-level optimization approach for a flexible flowshop type scheduling problem focused on energy consumption and whose resolution is based on genetic algorithms. Lu, Wang and al. (2017) [5] establish a hybrid multi-objective backtracking algorithm for solving a flow-shop type scheduling problem with energy-efficient permutation. Schultz and al, (2019) [6] applied an iterative multiobjective local search algorithm adapted to an energyefficient hybrid flow-shop type scheduling problem. Hasani and al. (2020) [7] have developed a bi-objective resolution model based on genetic algorithms for a flexible flow-shop type scheduling problem with machine interdependence. In order to find a compromise between the optimization of the production cost and the energy consumption. Min dai and al.  [16] we established a multi-objective optimization method by adaptive selection of algorithms for solving a hybrid flow-shop type scheduling problem under constraints of finite variable parameters, including the makespan and the consumption of 'energy. According to the state of the art, we have noticed that the energy constraint has indeed been treated under various facets and using several tools, such as genetic algorithms, simulated annealing.. Namely that for this type of resolution, the choice of the initial solution is random. With a risk rate of converging on local solutions. In our context, we applied the NEH heuristic which gives the best solution for this type of problem (Siyoucef K, Fellahi H. 2021) combined in a multi-objective context with energy consumption applied to the production company SOPHAL SPA pharmaceutical products. Therefore, this prompted us to try a more interactive and simplistic resolution for the case of the flow shop m machines problem.

Problem description
The problem of this work concerns a flow shop scheduling problem where we have m machines assembled in series. Each job (product ei) must pass through each machine during the execution of the process. All jobs must follow the same route ei, first passing through machine 1, then machine 2, and so on .... The FSSP (flow-shop scheduling problem) can be described as follows: • Each job of the set J = {1,2, ..., n} passes respectively through m machines (i = 1,2, ..., m). • At any time, each machine can only operate on one job and each • A job can only be executed in one machine at a time.
• There is only one machine per type and they are available at all times. • The launch and idle time are the change and cleanup times that are considered constant.
• The operating times are independent of the sequences and known. • Jobs can wait between two spots in unlimited intermediate stock.
• Jobs are not necessarily always available to go to the end of a previous step • No preemption or division of jobs: once the Oij operation has started, the job does not exit until the end. In our problem, we consider several criteria to establish an optimal solution. Namely the production costs and the energy consumption costs required for production.

Data and parameters
The following table groups together all the parameters and data established to formulate the objective functions and mathematical constraints reflecting the problem previously described and which will be the subject of an interpretation in a computer program thereafter

Mathematical model
Under the constraints: S1,1 = 0 (5) S1,K + σ ܲͳ݇Ǥ ‫݆ܺ‬ ୀ ୀଵ = S1,(k+1) 1Kn-1 (6) SK,1 + σ ܲ݇ͳǤ ‫݆ܺ‬ ୀ ୀଵ = S(k+1),1 1Km-1 (7) Si,k + σ ܲ݅݇Ǥ ‫݆ܺ‬ Sk,(j+1) 2 i m, 1 k n − 1 (9) PEk CEk x σ ݆ܲ݇Ǥ ‫݆ܺ‬ ୀଵ 1 k m (10) SEk CSEk x σ ݆ܶ݇‫‬Ǥ ܼ݆݅݇ ୀଵ 1 k m (11) PCk σ ܲ݅݇Ǥ ‫݅ܲܥ‬ ୀଵ 1 k n (12) Xi,j et Zi,j,k ‫א‬ {0, 1}, 1 p m, 1 j m (13) PEk,SEk,PCnm, Si,j 0, 1 i m, 1 j n. (14) The following formulas are correlated to govern the logic of the problem previously described. Each having an explanation as follows:Formula (1) expresses the sum of the total production costs of all the jobs and represents the first function to be minimized. Formula (2) expresses the sum of the total energy consumption costs and forms the second function to be minimized. Constraints (3) and (4) indicate the positioning of job j in k, and ensure that each job must be assigned exactly once on each machine and that each job must occupy exactly one position at a time. Constraint (5) sets the process start time to zero. Constraints (6) and (7) ensure that there is no idle time on the first machine and that the first job in the sequence is processed on all m machines without delay (time waiting time). Then, the constraint (8) indicates that the start time of each job j on machine i +1 does not occur before the end of its Completion time on machine i. The constraint (9) indicates that the job j + 1 does not pass to the machine i as long as the processing job j in position p = i (on the machine i) is not completed. Then, the constraints (10) and (11) define the estimate of the energy consumption costs specific to the machines i at start-up and during processing. The constraint (12) indicates the limit of the total production cost of the job j = k in the m machines. Finally, the constraints (13) and (14) indicate that the decision variables are respectively binary and positive.

Description of the real case
SOPHAL SPA, is a Pharmaceutical Company specialized in the development, production and marketing of generic drugs located in Oran and having several production unit. it specializes in the manufacture of a multitude of medicaments. where the production is carried out by a production by batch. Each batch corresponding to a single product goes through a global production process of 4 consecutive steps started by the stage of mixing and weighing, followed by the stage of compression, then the coating and finally packaging.
This process concerns several types of products of different ranges. The operating times of the machines vary according to the type of product, so they are considered to be at relative speed. This description of the production process of generic products at SOPHAL SPA can be compared to a flow=shop model without permutation.

Resolution and results interpretation
To solve this problem we have applied the NEH heuristic algorithm, known for the precise resolution of NP-Difficult flow-shop type scheduling problems but most often exclusive to the makespan computation. We have adapted the computational logic of the NEH heuristic to a bi-objective model, in terms of computational criteria and constraints as expressed in the developed mathematical model. More precisely, the modification relates to the calculation preceding the scheduling sequence. In addition to operating times, the algorithm translates production costs and energy consumption costs as criteria to establish the optimal sequence. It aims to calculate an optimal cost weighting production costs and energy consumption costs. In doing so, an optimal total cost is obtained which represents a balanced cost, which acts as a compromise between minimizing energy consumption and production costs. The algorithm first requires the entry of information such as unit production and energy costs as well as the unit energy consumption of machines and operating times and quantities to be produced (number of jobs), then correlate, and calculate a matrix balancing the costs, which will be scheduled thereafter.
In order to test the validity of the proposed algorithm, we implemented and programmed it in python language. Using several scenarios, where in each scenario, we have taken into consideration m machines and n jobs applied to the two objectives studied. Which are the best scheduling sequence that minimizes the different costs and the minimization of energy consumption represented by three different configurations, a configuration for small instances, a configuration for medium instances, and a configuration for large instances presented as follows: • Scenario I : illustration of small instances. 4 Machines / 4 Jobs • Scenario II : illustration of average instances, 4 Machines / 9 Jobs • Scenario III : illustration of large instances, 12 Machines / 50 Jobs For the execution of the different scenarios, we started by collecting data from the company SOPHAL SPA in order to determine the unit production costs and the unit costs of energy consumed and energy consumption for each type of machine used represented. by table (1) and the operating times per hour represented by table (2) relating to scenario I.

• SCENARIO I: 4 machines / 4 jobs
The following tables give the information and data relating to the first scenario, which were identified at the level of the SOPHAL SPA company in order to have an approach of the real case. This data is used for programming and running the established algorithm. Table (2) lists the data relating to the unit costs of energy for the production and consumption of machines.  -The optimal weighted cost is: 225,455 -The optimal sequence: [1,4,2,3] the order of passage is therefore the following; the first batch is produced, followed by the 4, then the second and the third.
After execution of the scenario in the classic NEH program, we obtained the following results to compare with: -The optimal weighted cost is: 225.455 -The optimal sequence: [1,4,2,3], which is the same sequence with our program.
• SCENARIO II : 4 machines / 9 jobs The following two tables show the data developed to illustrate the average instances, as an extension of the first scenario in order to simulate the behavior of the algorithm and to demonstrate its flexibility.
Table (4) lists the data relating to the unit costs of energy for the production and consumption of machines.  -The optimal weighted cost is: 351.355 -The optimal sequence: [5,4,2,1,9,8,3,7,6] • SCENARIO III : 12 machines / 50 jobs Finally, we established a third scenario, which is an extension to large instances of up to 50 jobs running on 12 machines. This simulation tests the behaviour of the program in this case and confirms the logical evolution of the results.
The table (6) lists the data relating to the unit costs of energy for the production and consumption of machines. Table 6. Data for scenario III The table (7) lists the operating times required for the jobs.    The following table summarizes the results obtained after the three runs. For each scenario, we have the optimal calculated cost, and the order in which the jobs are run representing the optimal sequence to be executed. This is therefore the sequence that allows for lower energy consumption, knowing that consumption and execution is different from machine to machine. It can be seen immediately that by increasing the number of instances the optimal cost price also increases by positive correlation. Which is the norm and confirms the logic of the developed program.

Conclusion
In this work, we have developed a multi-objective mathematical model made for the resolution of an NPdifficult flow-shop type-scheduling problem which takes into account the production costs and the energy consumption costs for the calculation of the optimal result.
In this type of problem, the energy resources, weighted by costs, can be subject to optimization based on a multi-objective resolution model. Energy, especially electricity, is a resource that can affect scheduling efficiency, which is why it is the subject of the heart of the matter. In order to explain the theoretical choices which form the basis of our problematic, we have developed, following our research and documentation, an explanatory state of the art. Then, we propose a multi-objective mathematical model as a resolution translated into a computer program. The model was solved by programming under the python language of a customized algorithm based on a customized NEH logic adapted to a two-objective scheduling problem. The results obtained demonstrate the adaptability of the computation under small, medium and large instances and their growing size demonstrates the positive correlation between the objectives of energy consumption and production cost. Just as it confirms the logic of the established algorithm.