1. Introduction
With technological advancements and the environmental challenges society faces today, the demand for increasingly ambitious and sustainable projects has become inevitable, particularly within the industrial sector. While these innovations may give us new tools to execute operations in less time and bring exciting opportunities, they also introduce new challenges, where wrong decisions can be damaging to companies, negatively impacting productivity and profitability [
1].
One of the most relevant industrial problems we face is optimizing the production scheduling, in which multiple jobs must be assigned and processed on specialized machines while following the company constraints [
2]. When the number of machines is substantively increased and with more complex workplace requirements, like managing employees responsible for supervising large-scale operations, the use of rigorous mathematical techniques and the most efficient software programs in order to achieve the desirable goal is necessary. For this reason, the Operational Research methodology and its mathematical optimization algorithms become highly relevant to solve these real industrial problems [
3].
One modern version of the scheduling problem is its application of industrial jobs and operations on CNC machines: “automated control machines that have a command function, a drive/motion mechanism, and a feedback system”. CNC machines are typically used to “manufacture parts by shaping solid materials into desired forms” [
4]. The combination of software development with the construction of mathematical programming models that correctly describe the real problem is what experts usually use.
Nowadays, many industrial companies and factories make use of CNC machinery to improve their production environments and increase efficiency. But, usually, those companies and factories do not take advantage of the recent technological and scientific advancements to improve their operations assignments on CNC machines. On the one hand, some of these companies have not yet implemented software applications that could help them optimize their production lines. On the other side, most of their employees do not have the necessary knowledge skills to define and to code the mathematical programming problems, which will require an expert in the area of mathematical optimization to set up and solve the models. This is the case of a factory in Portugal that has a set of available CNC machines and workers with different skills.
Thus, in this work, we propose to create a general MILP model capable of describing various CNC scheduling scenarios, and to study the development of a no-code and user-friendly software program capable of reading autonomously Excel files, with a functionality that enables switching on–off specific information and/or constraints and is able to generate schedule charts that minimize CNC machine downtime and lower operator workload; all of these without requiring the user to write a single line of code.
This paper is organized as follows.
Section 2 provides a review of the relevant literature.
Section 3 presents the methodology and the mathematical formulation of the Scheduling Problem.
Section 4 describes the application and software development.
Section 5 presents the results and discussion.
Section 6 concludes the paper and outlines directions for future work. Furthermore,
Appendix A.1 and
Appendix A.2 contain the notation and the screenshots from the developed system, respectively.
2. Literature Review
A scheduling problem involves the assignment of tasks to the available resources (machines and workers) over time while satisfying specific constraints and optimizing certain objectives [
5]. Scheduling problems are called
deterministic when all the input data is known with certainty and does not change over time. When production environments are subject to sources of uncertainty or randomness, the scheduling problem is classified as a
stochastic one [
5].
According to [
5], a deterministic scheduling problem can be described by a triplet
, where the
field indicates the machine environment, the
field shows details of processing characteristics and its specific constraints, and lastly, the
field describes the objective function to be minimized. The combination of those three fields creates different types of scheduling problems, like the Flexible Job Shop variant. Some of the most relevant machine environments that can be specified in the
field are:
Single machine: This is the simplest form of machine environment in which there is only a single machine available, each job involves just one operation, and the processing time for each job is deterministic [
6];
Parallel machine: This follows the rules of the single machine version, but here there are m machines, where each job has to be processed mandatorily on each one of the m machines;
Job Shop Scheduling Problem (JSSP): This is like the parallel machine version, but with the addition that each job has its own predetermined processing order to follow. There are different versions of job shops in which each job may visit each machine at most once or in cases where it may visit each machine more than once.
Flow shop: This is similar to the JSSP, but all jobs have to follow the same predefined processing order.
Open shop: This is an extension of the JSSP, where some of the processing times may be zero, and there are no restrictions with regard to the processing order of each job through the machine environment (it is the responsibility of the factory to decide the previous factors).
Flexible: This is an extension to the previous machine environments, where there are machine alternatives for the same job, instead of a fixed machine.
The constraints specified in the field may include multiple entries, such as release dates and precedences between jobs.
When different types of machine environments are combined with different kinds of constraints and new ones are added to the scheduling, for example, workers to supervise during machine execution, the problem generally becomes
NP-hard. This means no polynomial-time algorithm is known that solves the problem optimally, and metaheuristics or relaxation methods are often used to find feasible solutions [
7].
Scheduling problems can be described through MILP formulations, where their optimal solutions can be found efficiently through optimization solvers [
3,
5,
8]. Relevant examples are modern MILP solvers, such as Gurobi or CPLEX, and
open-source code such as COIN-OR CBC, Python-MIP, and HiGHS, which are equipped with high-performance algorithms to solve large-scale MILP problems [
9,
10,
11,
12,
13].
The
Branch-and-Cut algorithm is currently the most popular used architecture for a MILP solver [
8], along with efficient techniques, like the
Lagrangian relaxation,
Benders, and
Dantzig–Wolfe decompositions;
Genetic Algorithms; metaheuristics, such as the
Large Neighborhood Search (LNS) and
Simulated Annealing; and cut generators [
8]. Moreover, with the advancements from machine learning [
8] and quantum computing [
14], solvers can take advantage of their unique characteristics to improve optimization algorithms.
3. Methodology and Scheduling Problem
This work adopted a quantitative and computational approach, focusing on formulating rigorously the scheduling problem as a mathematical model and developing a software web application that could optimize the desired schedules autonomously, without requiring programming skills from the user. Therefore, the applied methodology consists of the following stages:
Formulation of the mathematical model;
Software design and implementation;
Computational testing and results analysis.
To simplify the exposition of the deterministic scheduling problem, we first introduce all relevant data and decision variables. Next, we present the objective function along with all associated constraints.
3.1. Minimal Information
Although a wide range of information can be used to define a CNC scheduling problem, there is a
minimal set of input data that must be known in advance to describe the jobs and machines of the problem [
5,
6,
7,
11]:
Set of jobs: ;
Set of machines: ;
The non-negative amount of processing time () required by job j in machine i.
3.2. Optional Scheduling Information
After the minimal data is defined, it is possible to add extra information related to its jobs and schedules, add workers, priorities, among others. Consequently, its complexity and the necessary time to find an optimal solution increase. The list below shows a set of extra attributes/data that can be added to the formulation, as follows:
(Optional) The initial time, , for the scheduling problem;
(Optional) The time horizon ();
Set of workers: ;
If worker k has the necessary skills to operate machine i (binary value): ;
The release date () at which job j is available for processing;
The time at which the processing of job j is due to be completed: due date (), also known as deadline;
Job precedences: if all operations of job j must be completed before any operation of job can start (binary value): ;
The processing order of job j (without repetition), , which indicates the machine that will receive the r-operation of job j;
Working interval schedules for worker k: , organized in chronological order;
Maintenance schedules for machine i: , organized in chronological order;
Priority : weight/importance of completion for job j.
Usually, time is considered continuous; however, for this software implementation, time is discrete, modeled as a sequence of equally separated time steps, where , which must be transformed into . All remaining attributes also need to be transformed so that all data is correct for the same time range as the new T set.
When is not given to the program, it will be defined by default as 8 AM (usual start time for a work day); while when is not given by the user to the application, then the program will calculate it as the usual 8 daily work hours.
3.3. Decision Variables
When time is divided into discrete values, we have 3 types of decision variables or parameters:
(binary variable): Shows if machine i starts to process job j at instant t;
(binary variable): Shows if worker k starts to operate task j on machine i at time t (Optional when the program does not have any information about its workers);
: The total makespan for all operations from job j.
The maximum number of decision variables in this case can be variable, depending on the initial time, , and its time horizon, . A bad discretization of time can result in an absurd number of unnecessary binary variables to solve the problem.
3.4. Objective Function
The objective function must be able to minimize the time when the last task finishes [
2,
11,
15]. Therefore, if the priorities
of each job
are given to the user/program (warning that the priorities are
optional data), the objective function must be able to minimize the sum of the product between the makespans of each job
j (
) and their respective priorities:
However, if priorities
are not given (in other words,
), then the objective function becomes the simple sum of
makespans from all jobs
j:
3.5. Mandatory Constraints
The mandatory constraints are those defined using only the minimal data required from the scheduling problem to ensure it remains solvable [
2,
11,
15]:
Each task/operation of job
j must be executed
only once and start each time on a machine at an
exact time (if job
j has a processing time):
From now on, whenever any constraint uses information related to schedules, their time values must be corrected according to the initial time, , in order to make the search for the optimal solution start at time . Moreover, the following constraints can only work with processes with a defined processing time ().
A machine can only receive one job at a time and run it until its processing time is completed (which also means that two jobs
j and
cannot be executed at the same time in the same machine
i). So, a machine can only receive a new job after the first one has been concluded. This can be verified for each discrete time
t through the auxiliary variable
which can tell if operation
j is active on machine
i at the specific time
t:
The variable will inform if operation j on machine i is active at time t by verifying the values of for the previous discrete times of t, inclusive. As it will make use of values from the variable , will just verify if job j has ever started on machine i during the previous interval of time. One important aspect of this variable is that when a task from job j on machine i finishes at a specific discrete time t, the value of must be equal to 0, since the task becomes inactive, leaving that time to a (valid) job that has not started its processing on machine i.
In order to avoid two jobs overlapping each other in the same machine (which also means that two jobs on the same machine cannot be active at the same time), the following constraint ensures that no more than one job can be active in the same machine at instant
t:
Thus, this constraint can be expressed through the simple substitution of expression that defines
as follow:
The
makespan of job
j (
) must be greater or equal to the execution times of all operations of job
j:
3.6. Constraints from Optional Data
Unlike the mandatory constraints, the following constraints cannot be added to the problem formulation if some of the extra attributes are not provided in our database or the user wishes to
switch on–off some of the available information [
2,
11,
15].
First, the extra constraints related to jobs from Constraints (7) to (10) are introduced.
No job can start until its previous one is completed. If defined in
as equal to 1, then job j’ can only start after job
j has finished all of its defined operations:
A job
j can only start after its release time
:
The completion time of a job
j must not surpass its due date (
), which means its operations cannot start at a discrete time
t that will end at a time after its due date:
All operations/tasks from job
j must be executed in the order of the sequence given by
:
Additional information about the defined maintenance schedules of its machines can impose the following constraint:
While in maintenance time of machine
i (
), it cannot receive any jobs (until its maintenance has finished):
It is assumed that no machine has a setup time when switching jobs (as we are working with hours only)! In other words, when a machine finishes one job, it can immediately start another without any delay. This assumption is reasonable in this context since the scheduling is performed in units of whole hours, making short setup or transition times negligible or irrelevant for our scheduling model.
The last type of constraints from optional data is the one related to its workers. When a user gives data about its workers, it adds new decision variables, , and the constraints (12) and (13). If a worker is added, but their skills and schedules are unknown, we admit that the worker has the ability to operate any machine at any time and the respective workers work full-time:
Each machine operating a job must have at least one worker allocated. From the following formulation, it is the same as stating that the number of allocated workers to operation
j on machine
i must be equal to the number of times this exact operation has started:
When a worker k is allocated to a process from job j on machine i, it must be there until the task finishes, being unable to work at two or more machines (or processes from the same machine) at the same time. From the other side, a worker can only start a task on a specific machine after the worker who was already supervising a task on the same machine finishes it.
Therefore, to help with the definition of this constraint, it was necessary to create auxiliary variables,
, that could tell if worker
k is still working on machine
i at discrete time
t:
The previous variable verifies if the specific worker k has started any operations on machine i that could be active at instant t by analyzing if at the previous discrete time and at t, inclusive, any task has ever started for each job that must be executed on machine i.
Through this variable, we can build a constraint that guarantees the same worker cannot work two operations at the same time (either from the same machine, or from two different machines!) by counting how many tasks worker
k is actively supervising:
The final and simpler version of this constraint with just the decision variable
can be built by using the expression that defines the variable
:
Constraints (14) and (15) are required for the mathematical formulation if the program has access to the worker schedules and skills, respectively:
Each worker
k, when out of their working schedules
, cannot be assigned to any available machine. To guarantee that no worker starts a task that might finish at a time out of their working hours, the following formulation had to consider the processing times from each available pair (job, machine):
where
A worker
k can only operate a machine
i if the worker has the necessary skills to manipulate it. If worker
k does not have the skill to supervise machine
i (i.e.,
), that worker cannot be assigned to any operation on that machine:
It is assumed that the company manager is able to ensure that all tasks have the necessary raw materials to start their executions and that another person or company is responsible for the management of workers skilled to maintain the CNC machines. Consequently, the workers of the company are exclusively tasked with operating the machines and are not involved in maintenance or repair duties.
3.7. General MILP Model
For completeness, the full general mathematical formulation of the MILP model is defined as follows:
subject to:
where
4. Application and Software Development
(WARNING: Due to data privacy, some private information and small parts of the code cannot be shared here!)
Since this work targets industrial enterprises whose employees and managers typically do not have experience with MILP formulation interfaces or advanced database methodologies, it was essential to develop a user-friendly system. Specifically, the system was designed to make it straightforward for users to upload data, select the relevant scheduling information, and generate the desired schedules without requiring specialized technical knowledge.
Appendix A.2 shows the screenshots of the developed system.
The solution involved the development of a web application that could run in the Microsoft Windows operating system with an intuitive and user-friendly Graphical User Interface (GUI). To achieve this goal, the following software and languages were used:
Microsoft Excel: Software for manual data sheet insertion, which does not require any knowledge or experience with relational data storage;
Python (version: 3.10.15): Utilized for the adapted Excel compiler and the back-end programming, where the MILP formulation is created for the given data from the Excel file;
Flask (version: 3.1.0): Enables the connection between back-end and front-end parts made in HTML and Python;
Python-MIP (version: 1.15.0): The chosen MILP formulation constructor interface;
CBC (version: October 28 2021) and
HiGHS (version: 1.8.0): The available MILP solvers to solve the MILP problem [
12]. Both solver versions are the ones available on the Python-MIP interface by default. Besides that, both solvers use the
Branch-and-Cut algorithm (which can also be called
branch-and-cut-and-bound [
9]) to find the values that minimize the given MILP problem [
8,
16].
We have to clarify that both solvers use exact optimization methods, instead of heuristic or rule-based scheduling techniques to find a solution.
After the information related to the CNC machines and their available workers is filled out on the Excel file through specific instructions, the user can start the application. Its pages are responsive depending on the action that the user or the program itself takes. This complexity of actions between pages is systematized on the activity diagram presented in
Figure 1.
Once the user initializes the application, the first page that appears on the screen is the Startup/Upload page. There, the user can upload an Excel file (.xlsx) and then proceed to the next step. If the program verifies the file does not have the extension .xlsx, it will not proceed to the “Option Selection” page, but it will refresh the actual one and warn the user to upload a valid format file.
When the uploaded file is validated by the application, the Option Selection page appears on the screen with an innovative functionality to turn on–off options related to the information provided by the uploaded file. This functionality enables the user to select:
The machines, jobs, and workers (if available) that must be included in the machine (and worker) scheduling;
The optional/extra information that can be added or deleted from the scheduling problem (release and due dates, priorities, defined schedules for workers, skills …)
Which MILP solver must be used: CBC or HiGHS.
This page will only show the options that are related to the input data from the uploaded Excel file. For example, if the previous file does not contain any information related to employees, then the program will not allow the possibility to select workers for assignments, and if the user wishes to turn on or off the constraint related to them, like their skills and working hours.
When the selected information by the user is not enough for generating a schedule (like selecting no machines or no jobs), the application refreshes the page and warns the user to select an adequate minimum number of machines and jobs.
After selecting the necessary data, if the selected solver finds out the problem has an optimal feasible solution, the proposed system generates a page where the optimal scheduling for the CNC machine is shown through Gantt charts. When workers are introduced by the user and they are enough to produce a schedule for the enterprise employees, the solver will also return the results for the worker assignments, which are also shown on Gantt charts. In addition, this page provides functionality for users to conveniently export and download the generated charts in a PDF format. This feature enables easy sharing, printing, or further review of the scheduling results outside the web application of the proposed system.
5. Results and Discussion
In this section, a realistic example will be explored, inspired by a real-life case from a Portuguese industrial company. The main goal of this case is to improve the production scheduling for the primary parts of aeronautical structures, with a set of nine available MAKINO machines (with similar characteristics to the studied CNC machines, but adapted for the aeronautical materials and structures). The available MAKINO machines are introduced on
Table 1, along with their scheduled maintenance hours, except for machines A4 and A20.H.
The expected jobs to be completed are denoted in the model as J1, J2, …, as shown in
Table 2 and
Table 3.
It was essential to ensure that all MAKINO machines were supervised by workers during their operation, primarily due to safety concerns, quality assurance, and operational reliability. Continuous supervision reduces the risk of accidents, allows for immediate intervention in case of machine malfunction or unexpected errors, and ensures that the machining tasks meet the desired quality standards. The factory employee bank is full of workers available and capable of managing different types of MAKINO machines. Those employees can work at one of two available shifts. Initially, four workers were assigned to the industrial jobs related to the MAKINO machines. Details about each assigned employee are described in
Table 4.
Not all the previous workers have the same skills, as they have different training levels with the MAKINO machines, which are listed in
Table 5.
When testing, it was verified that it is impossible to create a schedule with all the given data. Unfortunately, this can happen in real industrial contexts, as, in production environments, the reachability of those goals is very complex, which surpasses simple analysis.
This means that the original given data and constraints provided by the company are unreachable. The need for changes in the production goals is urgent, which is only possible by making some alterations to the source Excel file. But, before making considerable changes, it was necessary to discover which data makes this problem infeasible, by taking advantage of the selection options menu.
While selecting which set of conditions allows the program to turn the infeasible problem into a feasible one (by trial and error), it was found that only when the defined due hours and workers were turned off, the program generated a schedule for the MAKINO machines. This means that the necessary changes on the source data had to be made on the job due hours and/or assigned workers.
Alternative Solutions
Three alternative solutions were identified from making direct changes to the due hours and workers from the data source file, which now allows the generation of schedules for workers.
The first alternative solution resulted in the change of some job due hours, as shown in
Table 6, and the addition of an extra worker (Sara F.) from the factory with the specifications from
Table 7.
These modifications enabled the generation of the schedules illustrated in
Figure 2 and
Figure 3.
However, this is not the only possible solution to surpass the blocks in the original data. In real industrial settings, it is common practice to reassign existing workers to different shifts than those originally scheduled, rather than hiring additional personnel to cover remaining hours. This approach offers greater flexibility, reduces labor costs, and makes more efficient use of the current workforce, especially when only a small number of additional work hours need to be covered. By adjusting shift assignments instead of increasing headcount, companies can respond more dynamically to production demands while maintaining operational efficiency.
All the operations assigned to Sara F. on the first alternative solution were executed on machine MA8. One worker besides Sara F. who can manipulate this type of machine is Tiago R.
Though Tiago R. was assigned to work during the day shift (8:00–17:00), it can be observed on the first obtained alternative solution (
Figure 3) that he starts to supervise machines at only 13:00, 5 h after his starting hour (8:00). Thus, asking him if he is willing to change his shift to the night one can be beneficial for the company, as it brings the opportunity to create schedules that do not need to include more workers beyond the ones originally planned.
The new working hours for Tiago R. are described in
Table 8, and the respective changes on due hours are represenetd in
Table 9.
With the previous new information, two new schedules were generated by the program for the MAKINO machines and their assigned workers (
Figure 4 and
Figure 5).
The last option would be to provide extensive professional training to specific employees, so they become capable of handling more types of machines and, consequently, make the management of machine and worker schedules more flexible, without compromising the initial constraints imposed by the company. In the actual case study, originally, Ana S. could only supervise operations from MAKINO machines MA12 and MA20. Now, with some training, she can also manipulate MA8 machines (her new skills after her training are summarized in
Table 10 and the new job due hours in
Table 11).
This small change was enough to generate the optimized schedules from
Figure 6 and
Figure 7.
Even if the data is well defined, there is a risk that the requirements stated by the company may be impossible to achieve. The use of the switch on/off functionality in the developed software system proved to be highly useful for identifying, through a trial-and-error approach, which specific data inputs or constraints were preventing the solver from finding optimal solutions. By selectively enabling or disabling certain data inputs and/or constraints, users could isolate the problematic components, better understand the influence of each constraint, and iteratively refine the configuration to obtain a feasible solution and to improve the solution quality. From small changes on the original data source, it was possible to generate three different alternative optimal solutions that are summarized in
Table 12.
Both solvers (CBC and HiGHS) produced the same results for the three alternative cases in similar computational CPU execution times. The three shown alternative solutions are all capable of minimizing efficiently the total makespan; but only the first alternative solution obtained the lowest total makespan (117.0). However, this does not mean that this is the most desirable solution for the factory. Choosing the best solution for production organization and scheduling depends on the company’s preferences and current conditions. The primary purpose of this system is to assist users in identifying the best possible solution based on the provided data and requirements. Rather than replacing human judgment, the system serves as a decision-support tool, helping users explore alternative scheduling scenarios, evaluate trade-offs between conflicting constraints, and make informed, data-driven decisions. By offering visual feedback and optimized solutions, the system empowers users, especially those without technical expertise in optimization, to effectively manage resources, improve operational efficiency, and adapt to changing production requirements.
6. Conclusions and Future Work
The main objective of evaluating the creation of an analytical autonomous decision-making software for the Portuguese factory was achieved successfully. Through the real-life case from a Portuguese industrial company, it was possible to show how well the developed software optimizes industrial CNC scheduling problems and offers a useful tool for actual industrial operations, like the previously referred factory. This type of no-code tools becomes more important as many of the employees that are responsible for assigning tasks to the available machines and workers in large-scale environments do not have the programming skills to write lines of code with MILP formulation constructor interfaces and optimization solvers, showing once again the importance of the combination of software with mathematical techniques in the industrial world. This aligns well with the core principles of Industry 4.0 and smart scheduling, where flexibility, automation, and decision-support are critical, particularly in environments where cyber-physical systems are fundamental and real-time dynamic scheduling is essential.
Although the developed software is capable of solving the scheduling problems currently specified by the factory in Portugal, it has the potential to be further enhanced to address a wider range of industrial needs. Future upgrades could incorporate improvements to the objective function to account not only for makespan but also for machine idle time and job delays, reflecting whether deadlines are met; besides additional data types and constraints, such as weekly or rotating shift schedules, flexible machine assignments, variable processing times, worker availability or absences, machine setup times, and raw material availability. Integrating these elements would significantly increase the versatility of this system, enabling it to handle more complex and dynamic scheduling environments. Such enhancements would make the software a more powerful and general-purpose decision-support tool, adaptable to diverse manufacturing contexts and capable of helping industrial managers optimize operations under more realistic and demanding conditions.
The usability of the GUI has not yet been formally evaluated, leaving user experience and accessibility aspects uncertain. To address this, future usability testing will involve employees from the Portuguese factory. Additionally, further tests incorporating a larger number of machines and jobs will be carried out to assess the system’s scalability in more complex manufacturing environments.
One potential future improvement to the developed software is by adding a functionality that identifies which constraint(s) cause the problem to become infeasible, activated only when infeasibility occurs. This way, it becomes much easier for the user to identify the data and/or constraints that could be turned on or off or even changed, in order to transform the problem into a feasible one. Another interesting extension that could be implemented in the near future is the possibility to change the original input data inside the program, without having to make modifications to the original Excel file (this could be useful in situations like the real-life case, where changes in the original data are mandatory to generate any schedule charts). Future work will apply more advanced algorithms, like genetic algorithms and dynamic programming, instead of the used MILP solvers, to study their effectiveness on solving CNC scheduling problems.