Keywords

1 Introduction

The scheduling problems can be modelled into virtually innumerable problem types [2]. Thus identifying the correct problem definition is as important as having an impeccable solution for the problem under consideration. The annals in operations research have suggested various solutions for scheduling and routing problems based on their area of execution and demand of the application. Modern production scenario has moved on to agile manufacturing and just-in-time manufacturing practices where every minute change in the process reflect on the final outcome of the production house. Thus, the objective of scheduling and routing is not to finish the activity in a minimum possible time but at the right time, where neither the activities lag nor it leads to the planned schedule. There are various practices adopted by the industry for this task which involves stern planning, careful execution and sustainable outcome. Over the years the computation has developed a human-like execution capability, which involves decision-making and trend prediction, and such computation based on large statistical data primarily known as artificial intelligence has promised the potential to augment the digitization of human culture [14]. The fourth industrial revolution expects vertical as well as horizontal communication to occur on such a level that virtually every unit of the system communicates and feedbacks everything. In such a scenario, traditional techniques tend to stall the outreach of modern principles which primordially are caused due to the mainstay of these techniques. The fourth industrial revolution is characterized by ‘data collection’ and ‘data analysis’, which is completely different from the second or third industrial revolution. In both of these scenarios, ‘data’ is not priorly concerned over other production aspects. These modern demands of the industrial revolution can be coped up with by amalgamating them with computational techniques which are characterized to operate effectively with these requirements [3]. At the human level, it is not possible to process this large data and that too simultaneously. Thus, considering these points a schema was brainstormed that would consolidate all the needs of the industry without compromising the current system. The proposed solution was the development of a computational program by the development team that would aid the supply chain and production management team in their daily and overall scheduling and routing problems. These computational techniques can study large data in a very short time and provide optimum solutions with a fair acceptance rate, thus reducing the workload of managers so that they can focus on uncertainty management. The data from the company was first identified and then modelled into a mathematical model which was subjected to constraints so as to gain the desired outcome.

2 Scheduling and Routing Techniques

Initially in the company, no specific scheduling or routing technique was used. The sole work was done by the experienced supply chain and production managers who used to macro and micro plan the production. Thus, the initial task performed was analysis and identification of a suitable technique that can be effectively applied. After studying various traditional techniques [2, 10] it was proposed that these techniques with certain modifications can be implemented in the company as an algorithm that would automatically compute the schedule and aid the activity in the company. Total tardiness was the principal method used to model the problem which was further enhanced by other optimization techniques. The apparent tardiness cost (ATC) minimization model was also considered to avoid earliness in production. The heuristic method as elaborated [6] was first used to find the coefficients; later mixed integer programming model was designed which describes the objective function subject to the greedy randomized adaptive search procedure (GRASP) which selects feasible solution from the set of best-restricted candidate list (RCL), out of which a random set is selected again to perform a local search with small changes in the solution to find the better value of objective function [8]. This aided the macro-level scheduling while the micro-level scheduling which included consideration of single machines, operating parallelly with some being identical and some not, was modelled with best-suited methodologies [1] with release date consideration [4]. For the sake of computation, algorithms were developed [5, 15], which were first written as pseudocode and then programmed. Following are the analytical treatments applied to develop the objective function, constraints and map them to the company’s variables:

m = Machine number (0,1,2…i)

m = 0,1,2,3,4,5; where 0,1,2,3 are CNC and 4,5 are VMC

j = Jobs or batches (0,1,2…n)

j = 0,1,2,3,4,5,6,7,8,9

B = Big positive number

l = Position in sequence (0,1,2…n)

dj = Due date of batch j

pij = Processing time of batch j on machine i

wj = Weight of batch j

Xil = 1 if job is in sequence L, otherwise 0

Sij = Starting time of job j on machine i

Cij = Completion time of job j on machine i

Tj = Tardiness of job j

Thus, the objective function would be Eq. (1)

$$\min \sum {\rm{w}}_{\rm{j}} {\rm{T}}_{\rm{j}}$$
(1)

subjected to

$$\begin{aligned} & {\rm{C}}_{{\rm{ij}}} \ge {\rm{S}}_{{\rm{ij}}} + {\rm{d}}_{\rm{j}} \\ & {\rm{S}}_{\left( {{\rm{i}} + {1}} \right){\rm{ j}}} \ge {\rm{C}}_{{\rm{ij}}} \\ & {\rm{S}}_{{\rm{ij}}} + \left( {{1} + {\rm{X}}_{{\rm{j}}({\rm{l}} + {1})} } \right)*{\rm{B}} \ge {\rm{C}}_{{\rm{im}}} -\left( {{1}-{\rm{X}}_{{\rm{ml}}} } \right)*{\rm{B}} \\ & {\rm{T}}_{{\rm{ij}}} \ge {\rm{C}}_{{\rm{ij}}} --{\rm{d}}_{\rm{j}} {\rm{T}}_{\rm{j}} \ge 0 \\ & {\rm{S}}_{{\rm{ij}}} \ge 0 \\ \end{aligned}$$

3 Software Development Through Python and XML

Based on mathematical models, the most feasible programming language that would satiate the requirements was python because of its cross-platform support, number of open-source libraries and future scope to comply with the Industry 4.0 ready machine learning and deep learning systems. Python (3.9.5) was used in the development of this algorithm. The machine used for this program development is an Intel® Core™ i3-7100 @ 3.6 GHz, 4 GB RAM @ 2400 MHz, Intel® HD Graphics 630 operating on Ubuntu (20.0.4 LTS). The programming is compiled by its default command line-based compiler and typed in gedit. The programming went through standard stages of develop-deploy-test-redefine based on the outcomes observed [11]. Several versions with different features were tested and released out of which the best suited and applied is elaborated in this research piece.

3.1 Libraries Deployed

The primary need was the provision to define and solve the linear programming which was enabled by deploying the library ‘mip’. The eminent features of the mip are the ability to solve highly complex linear models, model the system in higher language, dynamic header loading, multiple solvers and such to note [12]. The scheduling model based on Eq. (1) along with its variables and constraints was constructed in mip and CP-SAT solver was used to provide the first possible optimization solutions.

As the data on the shop floor is neither static nor constant, thus it gave channelization in the direction of dynamic modelling and data analysis. This requirement was fit as a solution provided by the ‘Google OR-Tools’. OR-Tools is an open-source python library that provides combinatorial optimization with the help of a Glop solver. ‘Glop’ has its own set of assumptions which compulsory are subjected to the algorithms for which it is subjected to. The dominant feature of this library and solver is its dynamic data handling range and the ability to provide the best solution out of a very large set of possible solutions [9]. This library is not limited to classic linear programming problems but can also be coded as per the user’s need for further flexible computation by enhancing the source code provided by the developers.

After the successful trial of the mathematical model, the challenge was to develop a user-friendly U.I. and a platform so that the algorithm can be accessed with minimum effort. For this, the ‘tkinter’ library was used, which is a standard GUI development library accompanied by python [7]. Using tkinter, a simple GUI was designed considering ergonomic factors which are as demonstrated in Fig. 2. Further, the ergonomic enhancement included eliminating the need to run the algorithm by compiling and executing it. Thus, an executable was compiled which would suit both Linux and Windows operating systems using a very simple yet elegant library called ‘auto-py-to-exe’, which with minimal efforts produces the executable from desired python script with a bundle of interesting accessories like icon selection, standalone execution and so on [13].

3.2 Data Collection and Handling

It is a general practice that the data required in an industry is mostly stored and handled in Microsoft Office Excel. Task-specific spreadsheets are prepared accordingly which have the production capacity, deadlines and such related data specified. The schedule under analysis is for the 14th and 15th week of the year 2021. This is the time period under consideration because this program is developed in the 11th and 12th week of the year 2021. This time span also has a fixed deadline as the 21st week of the year 2021. Thus, in order to check the program’s effectiveness and compare it with the current system, the stated schedule plan was selected as it is and almost immediately executed. The major constraint here was the format in which the data was stored. The company has an integrated ERP software which maintains data pertaining to related processes such as cycle time, batch quantity, sequence of operations and so on, as represented in Table 1.

Table 1 Raw data extracted from ERP

Using the data extracted from the ERP and considering the batch dispatch required, the time analysis was performed which yielded Table 2. In this table the actual inputs which are to be given to the program are determined based on general computation and are expressed as below. The selection of a particular machine for a specific job is decided based on the capacity, possible setting and operator availability for the scheduling time under consideration.

Table 2 Machine number and operation time (minutes) for respective batches

This data was then extracted to Excel spreadsheets in raw form. This data in raw form did not have a peculiar format or structure. Thus, a generalized format was proposed as shown in Fig. 1, which was maintained across the departments pertaining to this research. The data required for analysis is maintained in the Excel files, which was first condensed down to required variables. The data corresponding to variables under consideration was then exported into a comma-separated values (.csv) file for the sake of ease of data handling for the program. The .csv files can be opened in any text editor or an office Excel handler, thus the need for another data handler was eliminated without compromising the effectiveness of the code. The extracted scheduling .csv file is given as an input to the program through its navigation panel. The data from the scheduling file is imported into the algorithm in the form of a multi-dimensional array, and on those arrays the computational constraints are applied to get the best possible outcome (Fig. 3).

Fig. 1
figure 1

Standardized format for data collection and handling

Fig. 2
figure 2

Application user interface

3.3 Sample of Code Deployed

The process of development is continuous which implies that there is not a confirmed or final version but the most acceptable outcome is considered to be standard and thus is elaborated further in this paper.

3.3.1 Pseudocode

figure a
figure b

3.3.2 Final User Interface and Deployment

Following is the simplified app UI. It has two options, the one on top to import the schedule .csv file while the below one starts the scheduling when clicked.

After selecting the CSV file containing the scheduling data in the required manner, ‘Start Scheduling’ is clicked on the U.I. after which the algorithm computes the shortest possible cycle time for given inputs. This output is displayed in the command line interface (C.L.I.) as shown in Fig. 3. Also, the schedule is produced as a text file output which is created by the program and saved in the program’s directory.

Fig. 3
figure 3

Schedule output in the terminal

Further, this schedule obtained is used to edit a .xml file present in the same directory which produces the Gantt chart, a very vital tool for floor level reference and analysis. Here the variables are appended as ‘Component ID [batch number, operation number]’. This .xml file can be opened using Project Libre or Microsoft Project and shows the output as represented in Fig. 4.

Fig. 4
figure 4

Optimized scheduled as displayed in project Libre

4 Results and Discussion

The company currently uses a critical ratio and shortest delivery time first scheduling assisted by manual insights of the managers. This technique is used by assigning an algorithm to the Excel sheet. Following is the algorithm and its result applied to the schedule under consideration:

figure c

Based on the above old algorithm, the following results were obtained by the production department, as shown in Table 3.

Table 3 Critical ratio-based scheduling result

This technique lacks the consideration of parallel machining; thus, it was a manual task for the production department to assign duty to every machine for the next couple of days, every day after the second shift ends (16:00 h) by filling individual plan sheet on every machine. This task consumed their productive time to do similarly repeated tasks every day that too with less effectiveness. The scheduling activity is proposed by Mr. Surve (Production Manager, Marvelous Engineers Pvt. Ltd.), who proposed a schedule of 17,280 min considering parallel machining and routing as per his experience and manual problem-solving. For our schedule under consideration, he instructed us to consider a 25% lag in the schedule given by the new algorithm due to the uncertainties like power cuts, accident like such. These results have been condensed in the conclusion part which elaborates the effectiveness of this new algorithm.

5 Insights and Conclusion

The algorithm suggested that all of the input work can be finished in 12,033 min. When this is compared to the manual schedule designed by Mr. Surve which is 17280 min, there is a 30% time-saving in scheduling. If we consider a 25% lag in the programmed schedule due to uncertainties as per instructions, we still get 13.11% time-saving in the total schedule which is 2266 min. This time-saving is vital in production as it directly indicates the monetary benefits obtained. When the schedule was actually deployed on the floor, it was observed that 2357 min (13.64%) were saved as compared to the old scheduling technique. Also, this program takes parallel machining and deadline computation into consideration.

The algorithm has a major constraint of overlooking real-time scenario on the machine floor which can be eliminated by using machine learning which would identify and modify the inputs and algorithm accordingly. Further, IoT would enable real-time GUI-based scheduling as it would upload data, and at the same time, the data would be processed. Also, IoT would completely eliminate the need for manual data handling and would thus further rectify the SCM department’s activities.