1 Introduction and problem description

The textile industry plays a crucial role in the global economy, providing essential goods for daily life, such as clothing, blankets, and household items (Research 2020). Textile production is a complex process that involves six primary stages as shown in Fig. 1, including yarn spinning and dyeing, warp making, starching, weaving, finishing and dyeing, and cutting and sewing (Karacapilidis and Pappis 1996).

The textile dye industry produces about 3600 different types of products (Kant 2012), which can make scheduling and planning easily intractable. Advanced algorithms are needed to tackle this complexity.

Fig. 1
figure 1

The textile manufacturing process (Karacapilidis and Pappis 1996)

In this paper, the first stage of the textile manufacturing process, yarn dyeing will be considered. Yarn dyeing occurs after the fibres have been spun into yarn, where the dye penetrates the strands to the centre of the yarn. This process aims to produce coloured yarns, which can be used to make striped knit or woven textiles, solid-dyed yarn fabrics, and sweaters. The study focuses on planning the spinning and dyeing process, the first step of textile production. Yarn is coloured as packages, which are small reels fixed on hollow spindles. Package dyeing, which involves dyeing yarn coiled on perforated cores, is one of the most widely used yarn dyeing procedures. The dye passes through to the yarn package with the aid of the tube package’s designed perforations. Once the carrier of coloured yarn has been fully depleted, it is removed from the vessel. Readers are referred to textiletutorials.com (2023) for more technical details of the process with visual material.

Figure 2 provides a schematic representation of the Yarn Dyeing Planning (YDP) described by the industry experts during the development of this manuscript and validated with literature (Karacapilidis and Pappis 1996). Assume that there are 13 customer orders (jobs) to be assigned to one of the three shifts (\(P=3\)) of K eligible Dying Machines (DM) on each day of the planning period of G days. Each machine can work at only one of the predefined levels which is chosen based on the attributes of jobs (total weight, volume, etc.) assigned to it. Furthermore, to reduce DM cleaning times water and chemical usage between consecutive batches on a machine, the color code in consecutive batches must be in ascending order while respecting the weight and volume capacity of DMs in each batch. This way, not only the cost but the environmental impact of the dyeing process is minimized. YDP has two objectives lexicographically ordered based on their priority: maximizing the number of jobs processed and minimizing the number of DMs used. These priorities are defined by the industry experts during the consultancy. The industry employs over 8000 types of chemicals in various textile manufacturing processes, including dyeing and printing. Many of these chemicals harm human health, either directly or indirectly. Textile processing, dyeing, and printing are water-intensive operations, with an average-sized textile mill, consuming approximately 1.6 million liters of water, of which 16% is used in dyeing processes. Specifically, yarn dyeing requires about 60 lt. of water per kilogram of yarn, and the dyeing section contributes to 15–20% of the total wastewater flow (Kant 2012). As a result, the optimization goal was set to reduce the amount of dye machines used. The idea behind this method is that by lowering the total number of dye machines in use, chemical and water usage will also drop.

Figure 2 shows the assignment of those 13 jobs into three shifts of machines \(machine_1\) and \(machine_3\) in days 1 and g respectively. Selected levels of \(machine_1\) are 1, 3, and 2 while 1, 2 and 3 for \(machine_3\). As an example, the solution depicts that jobs 2, 4, and 8 are assigned to the second batch of \(machine_1\) which works in \(level_3\) based on the total weight, volume, and flotte of the jobs assigned to this machine.

Fig. 2
figure 2

An illustration of Yarn Dying Planning problem

The problem demonstrated above has several similarities with multidimensional knapsack (Kellerer et al. 2004), bin packing (Delorme et al. 2016), and unrelated parallel machine scheduling problems (Fleszar and Hindi 2018) in the literature:

  • As in the multidimensional knapsack problem, YDP has several capacities (weight, volume, number) and flotte conditions that provide an upper bound for the number of jobs assigned to each DM in each batch.

  • The number of available machines is known as in knapsack problems; however, the second objective of YDP is minimizing the number of DMs which converges the problem to bin packing problems.

  • The color code of the consecutive batches (shifts) of each DM each day must be in non-decreasing order, bringing a sequencing dimension as in an unrelated parallel machine scheduling problem.

Therefore, YDP can be reduced to these three well-known combinatorial optimization problems; hence, it is an NP-hard problem.

However, the following conditions of YDP make it different from classical multidimensional knapsack, bin packing, and unrelated parallel machine scheduling problems:

  • Capacities of a DM (volume, weight, number, and flotte) are also decision variables and selected from technologically predefined levels according to the assigned jobs into that DM.

  • There are nonlinear eligibility conditions between jobs assigned to the same batch of the same DM.

  • Sequencing colour code of consecutive batches requires time-bucket (Swamidass 2000) based formulation as in lot sizing problems (Oztürk and Ornek 2010) in which each bucket corresponds to a batch in a DM on a given day. This property makes YDP different from unrelated parallel machine scheduling where disjunctive scheduling-based formulations are needed to sequence individual jobs.

Therefore, this paper will describe YDP using a mixed integer programming (MIP) model. However, the industrial size of the YDP is intractable to solve by using exact solution methods such as mathematical programming in terms of time and space complexity. Hence, we propose an adaptive large neighbourhood search algorithm (ALNS) (Pisinger and Ropke 2019). ALNS exploits both systematic search capability and scalability of local search. This gives the power to deal with optimization problems with extremely large instances with close to optimal solution quality. The basic principle of ALNS is finding an initial solution, generating sub-problems, and solving them iteratively until a stopping condition is met. In the proposed ALNS we will demonstrate two types of initial solution finding mechanisms; one relies on solving the proposed MIP model until the first feasible solution is found and the other is a matheuristic (Fischetti and Fischetti 2016) algorithm. The selection of the subproblems in ALNS has a significant impact on the performance of the overall algorithm. Hence, we propose three subproblem selection (destroy) methodologies; job group-based, DM based, and ad-hoc (random). Dynamically changing subproblem sizes in each iteration provides adaptability to the proposed large neighbourhood search algorithm.

In contrast to previous publications in this domain, this paper brings the following contributions: (1) a novel mixed integer programming model formulation for a novel problem from the textile industry (2) a very fast adaptive large neighborhood search algorithm providing high-quality solutions in a very short computation time. (3) In practice, the textile company, that we worked for during the development of this study, often relies on manual scheduling and planning processes, which can be time-consuming and inefficient, requiring half a day and several people to develop a feasible plan. In contrast, the ALNS algorithm provides a highly efficient solution, reducing this task to a matter of minutes requiring just a single planning staff. (4) extensive experiments with publicly available realistic instances for further research.

The paper is structured into five sections, with Sect. 2 providing a literature review. Section 3 explains the YDP formally with a mixed integer programming model and a lexicographic solution scheme for the model. An adaptive large neighbourhood algorithm to solve large instances of YPD is proposed in Sect. 4. The computational results are presented in Sect. 5, and the paper concludes by elaborating on the results and discussing future studies in Sect. 6.

2 Literature review

This study focuses on the initial step of textile production, which is the spinning and dyeing process of yarn. Yarn is dyed as small packages fixed on hollow spindles, using the widely used package dyeing method where the dye penetrates through the perforations of the yarn package. Scheduling textile production is complex, involving planning multiple products and manufacturing phases using Dyeing Machines with different capacities and levels. The varied nature of the textile production system makes production management challenging, with different planning horizons and output characteristics for each process. Scheduling problems have gained attention due to their wide application in industry and computational complexity, and researchers have focused on multi-stage and complex scheduling to find the most appropriate quantity and timing of production orders based on customer demands and resource capacities (Sáenz-Alanís et al. 2016; Öztürk and Ornek 2014).

Researchers have extensively studied scheduling problems involving multi-stage and complex manufacturing processes. Various mathematical formulations, heuristic algorithms, and decomposition methods have been proposed to solve these problems.

The problem of scheduling the yarn dyeing process involves parallel machines and batch processing. Various studies have been conducted to address similar issues, such as single-machine batch scheduling with job families and setup requirements (Ghosh and Gupta 1997), parallel machine batch scheduling with sequence-dependent setup times in a brewing company (Sáenz-Alanís et al. 2016), scheduling of parallel batching machines with non-identical machine capacities and inclusive processing set constraints (Li 2017), and single batch-processing machine problem with non-identical task sizes and release dates (Zhou et al. 2018). These studies have proposed different mathematical formulations, heuristic algorithms, and optimisation techniques to minimize maximum lateness or makespan, which are critical objectives in manufacturing companies. Overall, scheduling problems are complex and require different approaches depending on the production system’s characteristics and requirements.

Li et al. (2009) developed an Ant Colony Optimization (ACO) algorithm to solve the parallel batch processing machines problem with incompatible job families, dynamic job arrivals, and sequence-dependent setup time constraints.

Crauwels et al. (2006) addressed a batch scheduling problem with parallel machines, job families, and family-dependent setup times. They partitioned jobs into families and required a family-specific setup time at the beginning of each period and batch. They developed an integer program to minimize the number of overloaded periods and total overtime, and the program provided benchmark results for the heuristic method.

Although there has been extensive research on scheduling problems in various industries, there has been limited research on scheduling problems specific to the textile production process. This is partly due to the complex nature of the textile industry and the difficulty in developing software systems that can handle all aspects of textile production (Öztürk and Ornek 2014). However, some studies have been conducted on the programming of textile production.

According to Periyasamy and Militky (2020) and Kant (2012), the textile industry is a major contributor to environmental sustainability issues, with the dyeing process having a significant impact on pollution, water usage, and energy consumption. Hynes et al. (2020) note that Industry 4.0 technologies can be used to implement multi-objective optimization techniques for dyeing processes, enabling the minimization of water consumption, treatment costs, and environmental pollution by optimizing manufacturing resources.

Zhang et al. (2017) investigate a multi-objective ABC algorithm that focuses on solving the production scheduling problem in fabric dyeing processes. They view the problem as a model for parallel batch machine scheduling. In a separate study, Hsu et al. (2009) examine the scheduling strategy for producing yarn-dyed textiles, which includes multi-stage production, hierarchical product structure, sequence-dependent setup times, and group delivery requirements. The aim is to minimize the total tardiness of customer orders. Li et al. (2021) tackle a parallel machine scheduling problem with several color families, sequence-dependent setup times, and machine eligibility constraints. They create an integer programming model to minimize the overall delay. Huynh and Chien (2018) researched related to Industry 4.0 migration and developed a multi-subpopulation genetic algorithm with embedded heuristics (MSGA-H) to optimize the textile batch dyeing scheduling process. The goal of the study was to minimize the makespan, which is the time required to complete a batch, and improve the efficiency of the dyeing process, which is a bottleneck in textile production. For a more detailed study on setups in the dyeing process, see (Gomes et al. 2021). Demir and Kemal (2022) have created an integer linear model and iterative greedy-based heuristics for bobbin boiler planning in the textile industry. EROĞLU et al. (2014) have developed a genetic algorithm to address loom scheduling with sequence-dependent setup times. A data-driven, simulation-based method to optimize the scheduling of operations to increase the manufacturing process’ sustainability is provided by Pirola et al. (2021). In another research, Zhou et al. (2020), authors presented an optimization model for scheduling dyeing processes in knitting companies. It utilizes a hybrid genetic algorithm with variable neighborhood search to improve production schedules, and minimize delay and switching costs. Finally, Karacizmeli and Ogulata (2017) have formulated a mixed-integer programming model for scheduling textile finishing plants.

3 Problem formulation and lexicographic solution scheme

This section presents a mixed integer programming (MIP) formulation to model and solve the multi-period multi-objective yarn dying planning problem (YDP) described in the previous section. The formulation structure is shown conceptually in Fig. 3, in which input parameters and variables related to DMs and jobs, constraints, and objectives are included.

Fig. 3
figure 3

Structure of the MIP model

3.1 Multi-objective mixed integer programming model for YDP

This section formally defines the multiobjective YDP using a MIP formulation.

Sets and Indices

I: set of job orders, \(i \in I=\{1,2..,|I|\}\)

P: set of batches, \(p \in P=\{1,2..,|P|\}\)

G: set of days, \(g \in G=\{1,2..,|G|\}\)

K: set of dye machines, \(k \in K=\{1,2..,|K|+1\}\), dye machine \(|K|+1\) is dummy DM in which any job that can not be assigned to any real DM is assigned

\(S_k\): set of levels in dye machine \(k, m \in S_k=\) {1,2..,|\(level_{S_k}\)|}

F: set of flotte intervals, \(f \in F=\{1,2..,|F|\}\)

R: set of chemical recipe code, \(r \in R=\{1,2..,|R|\}\)

C: set of colour percentage, \(c \in C=\{1,2..,|C|\}\)

\(machine_i\): eligible dye machines for job order i

\(machine_i\)= K \(-\) { k \(\in\) K \(\vert\) ((\(reactive_i\)=1) \(\vee\)(\(lyc_i\)=1)) \(\wedge\)(\(special_k\)=1)}

Parameters

Job-related parameters

\(orderno_i\): number of the job order

\(kg_i\): weight of the job order

\(orderrecipe_i\): chemical recipe of the customer order

\(ordercolour_i\): colour percentage of the job order

\(duedate_i\): due date of the job order

\(latest_i\): latest possible time for finishing the job order

\(orderflotte_{i,f}\) =\({\left\{ \begin{array}{ll} 1 &{} \textit{if flotte interval of job }{} \textit{i} \textit{is }{} \textit{f} \\ 0 &{} otherwise \end{array}\right. }\)

\(reactive_i\)= \({\left\{ \begin{array}{ll} 1 &{} \hbox {if job} \textit{i} \hbox {is reactive} \\ 0 &{} \hbox {otherwise} \end{array}\right. }\)

\(lyc_i\)= \({\left\{ \begin{array}{ll} 1 &{} \hbox {if job} \textit{i} \hbox {is spandex} \\ 0 &{} \hbox {otherwise} \end{array}\right. }\)

spool: weight of a spool

Dye machine-related parameters

\(machineno_k\): index of dye machine

\(special_k\)= \({\left\{ \begin{array}{ll} 1 &{} {if machine {k} is eligible for reactive or spandex job orders} \\ 0 &{} otherwise \end{array}\right. }\)

\(Level_{s_k}\): total number of possible levels of dye machine k

\(volumecapacity_m\): volume capacity of machine k at level m where \(m \in S_k\)

\(maxquantity_m\): number of spools capacity of machine k at level m where \(m \in S_k\)

\(minkg_m\): minimum processing weight of machine k at level m where \(m \in S_k\)

\(maxkg_m\): maximum processing weight of machine k at level m where \(m \in S_k\)

\(initialcolour_k\): initial colour percentage of dye machine k at the beginning of the planning period

\(maxflotte_f\): maximum allowed flotte value for flotte interval f

\(minflotte_f\): minimum allowed flotte value for flotte interval f

Note that flotte intervals are defined for both jobs and batches and the flotte value of a dye machine is defined as the ratio of volume to the weight of dyestuff

In the following, we define big-M values used to linearise several constraints. We define different values to ensure the tightest possible right-hand side values for each constraint where a big M is needed.

M: a big number

\(M_2\): a big number for colour constraints (\({}^{max}_{\forall i}\{ordercolour_{i}\}\))

\(M_3\): a big number for receipt constraints (\({}^{max}_{\forall i}\{orderrecipe_{i}\}\))

\(M_4\): a big number for machine kg constraints (\({}^{max}_{\forall m}\{maxkg_{m}\}\))

\(M_5\): a big number for a number of spool constraints (\({}^{max}_{\forall m}\{maxquantity_{m}\}\))

Variables

Variables related to dye machines

\(weight_{g,p,k}\): total weight of batch p at dye machine k on day g, \(weight_{g,p,k} \in {\mathbb {R}}^{+}\)

\(volume_{g,p,k}\): total volume of batch p at dye machine k on day g, \(volume_{g,p,k} \in {\mathbb {R}}^{+}\)

\(quantity_{g,p,k}\): total number of spools of batch p at dye machine k on day g, \(quantity_{g,p,k} \in \mathbb Z^{+}\)

\(colour_{g,p,k}\): colour percentage of batch p at dye machine k on day g, \(colour_{g,p,k} \in {\mathbb {R}}^{+}\)

\(recipe_{g,p,k}\): colour code of batch p at dye machine k on day g \(recipe_{g,p,k} \in {\mathbb {R}}^{+}\)

\(flotte_{g,p,k,f}\)= \({\left\{ \begin{array}{ll} 1 &{} \textit{if batch p at dye machine k on day g is in flotte interval f} \\ 0 &{} otherwise \end{array}\right. }\)

\(level_{g,p,m}\)= \({\left\{ \begin{array}{ll} 1 &{} \textit{if level of batch p at dye machine k on day g is level m} \\ 0 &{} otherwise \end{array}\right. }\)

\(usage_{g,p,k}\)= \({\left\{ \begin{array}{ll} 1 &{} \textit{if a job order is assigned to batch p at dye machine k on day g} \\ 0 &{} otherwise \end{array}\right. }\)

\(machineusage_{k}\)= \({\left\{ \begin{array}{ll} 1 &{} \textit{if dye machine k is used } \\ 0 &{} otherwise \end{array}\right. }\)

Variables related to job orders

\(assignment_{g,p,k,i}\)= \({\left\{ \begin{array}{ll} 1 &{} \textit{if job i is assigned to batch p of dye machine k at day g} \\ 0 &{} otherwise \end{array}\right. }\)

\(\alpha\): the number of jobs that are not assigned to any DMs

\(\beta\): the number of DMs used

Now, we propose the complete mixed integer programming model:

$$\begin{aligned} \begin{aligned}&Minimize \; \alpha =\sum _{g\in G}\sum _{p \in P}\sum _{i \in I} assignment_{g,p,\vert K \vert +1,i} \\&Minimize \; \beta =\sum _{k \in K \vert k\le \vert K \vert } machineusage_{k} \end{aligned} \end{aligned}$$
(1)

where \(\alpha \preccurlyeq \beta\)

The lexicographic objective function 1 first maximizes the number of jobs processed by minimizing the number of jobs assigned to the dummy machine \(\vert K \vert +1\). Then it minimizes the number of DMs used.

Subject to

Constraints for assigning jobs to different batches of dye machines

$$\begin{aligned} \sum _{\forall g \in G,p \in P, k \in |K|+1 } assignment_{g,p,k,i}=1, \; \forall i \in I \end{aligned}$$
(2)

Constraint (2) ensures that each job order (\(\forall i \in I\)) has to be assigned to exactly one of the batches (\(\forall p \in P\)) of a DM (\(\forall k \in machine_i\) ) in a day (\(\forall g \in G\)).

Constraints for selecting a level for each batch

$$\begin{aligned}{} & {} \sum _{\forall m \in S_k} level_{g,p,m} \le 1 \; \forall g \in G, \; \forall p \in P, \; \forall k \in K \vert k \le \vert K \vert \end{aligned}$$
(3)
$$\begin{aligned}{} & {} \sum _{\forall i \in I \vert k \in machine_i} assignment_{g,p,k,i} \le M*usage_{g,p,k} \nonumber \\{} & {} \quad \; \forall g \in G, \; \forall p \in P, \; \forall k \in K \vert k \le \vert K \vert \end{aligned}$$
(4)
$$\begin{aligned}{} & {} usage_{g,p+1,k} \le usage_{g,p,k} \; \forall g \in G, \; \forall p \in P, \; \forall k \in K (p<\vert P \vert ) \wedge (k<\vert K \vert ) \end{aligned}$$
(5)
$$\begin{aligned}{} & {} usage_{g,p,k} =\sum _{m \in S_k} level_{g,p,m} \; \forall g \in G, \; \forall p \in P, \; \forall k \in K \vert k< \vert K \vert ) \end{aligned}$$
(6)

Constraint (3) guarantees that each DM (\(\forall k \in K\)) can be used at one of its levels (\(\forall m \in s_k\)) in each batch (\(\forall p \in P\)) on any day (\(\forall g \in G\)).

Constraint (4) is the linear formulation of logical proposition \(\sum _{\forall i \in I\vert k \in machine_i} assignment_{g,p,k,i} \ge 1 \implies usage_{g,p,k}=1\) and mean that If at least one job order is assigned to a batch (\(\forall p \in P\)) of a DM (\(\forall k \in K\)) on any day (\(\forall g \in G\)), that dye machine is marked as used. Constraint (5) guarantees that batches (\(\forall p \in P\)) assigned to a machine (\(\forall k \in K\)) are used consecutively. In other words, a job can be assigned to a successor batch p+1 if and only if the batch p is used. Since the cost of producing in any batch of a given day is indistinguishable, constraint (5) is formulated as valid inequalities and used to break symmetries. Constraint (6) is the linear formulation of logical proposition \(usage_{g,p,k} \Leftrightarrow \sum _{m \in S_k} level_{g,p,m}\) and ensure that if a dye machine (\(\forall k \in K\)) is used in a batch (\(\forall p \in P\)) of any day (\(\forall g \in G\)), it can be used in one of its predefined levels (\(m \in S_k\)). In addition to constraints (3) and (4), if any job is not assigned to a batch of a dye machine on a particular day, there is no need to make a level decision for the same machine in that batch of the day. However, if at least one job is assigned to a level has to be selected by the model. We diversify \(usage_{g,p,k}\) and \(level_{g,p,j}\) variables to allow for the easier formulation of logical propositions (a) minimum weight condition is not compulsory if none of the job orders is assigned to that batch and (b) flotte selection for each batch which is explained in detail in constraints below.

Weight and volume constraints for each batch

$$\begin{aligned} weight_{g,p,k} =\sum _{i \in I \vert k \in machine_i}&(kg_i*assignment_{g,p,k,i}) \nonumber \\&\forall g \in G, \; \forall p \in P, \; \forall k \in K \end{aligned}$$
(7)
$$\begin{aligned}&weight_{g,p,k} \le maxkg_m +M_4*(1-level_{g,p,m}) \nonumber \\&\quad \forall g \in G, \; \forall p \in P, \; \forall k \in K, \; \forall m \in S_k \vert k\le \vert K \vert \end{aligned}$$
(8)
$$\begin{aligned}&weight_{g,p,k} \le minkg_m - M_4*(1-level_{g,p,m}) \nonumber \\&\quad \forall g \in G, \; \forall p \in P, \; \forall k \in K, \; \forall m \in S_k \vert k \le \vert K \vert \end{aligned}$$
(9)
$$\begin{aligned} volume_{g,p,k}=&\sum _{m \in S_k} (volumecapacity_m*level_{g,p,m}) \nonumber \\&\quad \forall g \in G, \; \forall p \in P, \; \forall m \in S_k \vert k\le \vert K \vert \end{aligned}$$
(10)

Constraint (7) returns the total weight of each batch (\(\forall p \in P\)) of every dye machine (\(\forall k \in K\)) for each day (\(\forall g \in G\)) as the sum of the weights of assigned job orders which must be in between the minimum and maximum weight interval of the selected level of that batch with the help of constraints (8) and (9). Similarly, constraint (10) ensures that the volume of a batch equals the volume of the selected level of that batch. Note that if the total volume of assigned jobs is not enough to fill the volume of the chosen level, scrap yarns are used.

Number of spools-related constraints for each batch

$$\begin{aligned} quantity_{g,p,k}\ge & {} \frac{weight_{g,p,k}}{spool}, \; \forall g \in G, \; \forall p \in P, \; \forall k \in K \vert k\le \vert K \vert \end{aligned}$$
(11)
$$\begin{aligned} quantity_{g,p,k}\le & {} \frac{weight_{g,p,k}}{spool}+1, \; \forall g \in G, \; \forall p \in P, \; \forall k \in K\vert k \le \vert K \vert \end{aligned}$$
(12)
$$\begin{aligned} quantity_{g,p,m}\le & {} maxquantity_m*level_{g,p,m} + M_5*(1-level_{g,p,m}) \nonumber \\{} & {} \quad \forall g \in G, \; \forall p \in P, \; \forall m \in S_k \; \forall k \in K \vert k\le \vert K \vert \end{aligned}$$
(13)
$$\begin{aligned} quantity_{g,p,m}\ge & {} maxquantity_m*level_{g,p,m} + M_5*(1-level_{g,p,m}) \nonumber \\{} & {} \quad \forall g \in G, \; \forall p \in P, \; \forall m \in S_k \; \forall k \in K \vert k\le \vert K \vert \end{aligned}$$
(14)

The total number of spools in a batch of a dye machine in a day is equal to \(quantitiy_{g,p,k}=\lceil \frac{weight_{g,p,k}}{bobin} \rceil\) which is linearized (making it integer) by constraints (11) and (12). The integer \(quantity_{g,p,k}\) variable is greater than or equal to the float \(\frac{weight_{g,p,k}}{bobin}\) (11) and less than or equal to float \(\frac{weight_{g,p,k}}{bobin}+1\) (12). For example, if \(\frac{weight_{g,p,k}}{bobin}=2.3\), the number of spools in that batch will be three because it is the only integer value between \(2.3 \le\) \(amount_{g,p,k}\) \(\le 3.3\). Constraints (13) and (14) ensure that the number of spools in a batch is within the predefined minimum and the maximum number of spools of the assigned level. In this formulation, we assume that different levels of a dye machine are sorted in ascending order of the maximum number of spools allowed. For example, if there are two levels with spool capacity \(maxamount_{m}\)=20 and \(maxamount_{m-1}\)=15, the number of spools assigned to a batch with level j must be greater than 15 (constraint 13) and less than 20 (constraint 14).

Colour carryover constraints for each batch

$$\begin{aligned} colour_{1,1,k}\ge & {} initialcolour_k, \; \forall k \in K \vert k\le \vert K \vert \end{aligned}$$
(15)
$$\begin{aligned} colour_{g,1,k}\ge & {} colour_{g-1,\vert P \vert ,k}, \; \forall g \in G, \; \forall k \in K \vert (g>1)\wedge (k\le \vert K \vert ) \end{aligned}$$
(16)
$$\begin{aligned} colour_{g,p+1,k}\ge & {} colour_{g,p,k}, \; \forall g \in G, \; \forall k \in K \vert (p> \vert P \vert ) \wedge (k\le \vert K \vert ) \end{aligned}$$
(17)
$$\begin{aligned} colour_{g,p,k}\le & {} M_2*(initialcolour_k+\sum _{l \in P \vert l \le p} usage_{g,l,k} \; ) \nonumber \\{} & {} \quad \forall g \in G, \; \forall k \in K \vert (p> \vert P \vert ) \wedge (k\le \vert K \vert ) \end{aligned}$$
(18)

Because of the high cost and time for changeovers, a setup carryover restriction enforces that from shift to shift, the colours must be processed in the increasing degree of darkness, i.e., in technical terms, the colour percentage of the batch increases. Hence, while constraint (15) guarantees that the colour percentage of a dye machine at the beginning of the planning period is greater than or equal to the initial colour percentage of that machine, constraint (16) ensures that the colour percentage of the first batch of a successor day is greater than or equal to the colour percentage of the same dye machine in the last batch of the previous day. Similarly, constraint (17) sorts colour percentages of successive batches in a dye machine in ascending order for each dye machine. Constraint (18) is used as a valid inequality such that the color percentage variable is set to 0 if a machine batch is not used.

Flotte selection for each batch

$$\begin{aligned} usage_{g,p,k}= & {} \sum _{f \in F} flotte_{g,p,k,f}, \; \forall g \in G, \; \forall p \in P,\; \forall k \in K \vert (k\le \vert K \vert ) \end{aligned}$$
(19)
$$\begin{aligned} volume_{g,p,k}\ge & {} weight_{g,p,k}*minflotte_f-M*(1-flotte_{g,p,k,f}), \nonumber \\{} & {} \; \forall g \in G,\forall p \in P, \forall f \in F,\; \forall k \in K \vert k\le \vert K \vert \end{aligned}$$
(20)
$$\begin{aligned} volume_{g,p,k}\le & {} weight_{g,p,k}*maxflotte_f+M*(1-flotte_{g,p,k,f}), \nonumber \\{} & {} \; \forall g \in G,\forall p \in P, \forall f \in F,\; \forall k \in K \vert k\le \vert K \vert \end{aligned}$$
(21)

The flotte value of a batch is calculated by the nonlinear equation \(\frac{{volume_{g,p,k}}}{{weight_{g,p,k}}}\) and must be in between predefined technologically possible intervals. Hence, first, we assign a flotte interval to each batch if it is used as in constraint (19) which is a linear formulation of a logical proposition \({usage_{g,p,k}}=1 \Leftrightarrow \sum _{f \in F} flotte_{g,p,k,f}\).Since \({minflotte_f} \le \frac{{volume_{g,p,k}}}{{weight_{g,p,k}}} \le {maxflotte_f}\) is a non-linear constraint, it is converted into linear constraints in (20) and (21).

Constraints for ensuring consistency between technological requirements of jobs and batches of dye machines

$$\begin{aligned} orderflotte_{i,f}\le & {} flotte_{g,p,k,f}+M*(1-assignment_{g,p,k,i}), \nonumber \\{} & {} \; \forall g \in G,\forall p \in P, \forall f \in F,\; \forall k \in K \vert (orderflotte_{i,f}=1)\wedge (k\le \vert K \vert ) \end{aligned}$$
(22)
$$\begin{aligned} orderflotte_{i,f}\ge & {} flotte_{g,p,k,f}-M*(1-assignment_{g,p,k,i}), \nonumber \\{} & {} \; \forall g \in G,\forall p \in P, \forall f \in F,\; \forall k \in K \vert (orderflotte_{i,f}=1)\wedge (k\le \vert K \vert ) \end{aligned}$$
(23)
$$\begin{aligned} ordercolour_i\le & {} colour_{g,p,k}+M_2*(1-assignment_{g,p,k,i}), \nonumber \\{} & {} \; \forall g \in G,\forall p \in P, \forall i \in I,\; \forall k \in K \vert k\le \vert K \vert \end{aligned}$$
(24)
$$\begin{aligned} ordercolour_i\ge & {} colour_{g,p,k}-M_2*(1-assignment_{g,p,k,i}), \nonumber \\{} & {} \; \forall g \in G,\forall p \in P, \forall i \in I,\; \forall k \in K \vert k\le \vert K \vert \end{aligned}$$
(25)
$$\begin{aligned} orderrecipe_i\le & {} recipe_{g,p,k}+M_3*(1-assignment_{g,p,k,i}), \nonumber \\{} & {} \; \forall g \in G,\forall p \in P, \forall i \in I,\; \forall k \in K \vert k\le \vert K \vert \end{aligned}$$
(26)
$$\begin{aligned} orderrecipe_i\ge & {} recipe_{g,p,k}-M_3*(1-assignment_{g,p,k,i}), \nonumber \\{} & {} \; \forall g \in G,\forall p \in P, \forall i \in I,\; \forall k \in K \vert k\le \vert K \vert \end{aligned}$$
(27)
$$\begin{aligned} recipe_{g,p,k}\le & {} M_3*usage_{g,p,k} \; \forall g \in G,\forall p \in P,\; \forall k \in K \vert k\le \vert K \vert \end{aligned}$$
(28)

Constraint (22) and (23) ensure that the flotte interval of a job order is the same with the selected flotte interval of the assigned batch and consequently with other jobs assigned to the same batch of the same dye machine on the same day. Similarly, constraints between (24)–(27) guarantee the consistency of colour percentage and recipe of individual job orders with assigned batches and other job orders assigned to the same batch of the same dye machine. Constraint (28) is used as a valid inequality such that if a batch of a machine is not used on a particular day, the recipe variable is set to 0.

Domains of variables

$$\begin{aligned}{} & {} usage_{g,p,\vert K \vert +1} =0, \; \forall g \in G,\forall p \in P \end{aligned}$$
(29)
$$\begin{aligned}{} & {} recipe_{g,p,\vert K \vert +1}\le 0, \; \forall g \in G,\forall p \in P \end{aligned}$$
(30)
$$\begin{aligned}{} & {} colour_{g,p,\vert K \vert +1}\le 0, \; \forall g \in G,\forall p \in P \end{aligned}$$
(31)
$$\begin{aligned}{} & {} level_{g,p,m}= 0, \; \forall g \in G,\;\forall p \in P \; \forall m \in S_k \vert k=\vert K \vert +1 \end{aligned}$$
(32)
$$\begin{aligned}{} & {} weight_{g,p,m} \le 0, \; \forall g \in G,\;\forall p \in P \; \forall m \in S_k \vert k=\vert K \vert +1 \end{aligned}$$
(33)
$$\begin{aligned}{} & {} volume_{g,p,m}\le 0, \; \forall g \in G,\;\forall p \in P \; \forall m \in S_k \vert k=\vert K \vert +1 \end{aligned}$$
(34)
$$\begin{aligned}{} & {} amount_{g,p,\vert K \vert +1}= 0, \; \forall g \in G,\;\forall p \in P \end{aligned}$$
(35)
$$\begin{aligned}{} & {} flotte_{g,p,\vert K \vert +1,f}= 0, \; \forall g \in G,\;\forall p \in P, \;\forall f \in F \end{aligned}$$
(36)
$$\begin{aligned}{} & {} weight_{g,p,k},volume_{g,p,k},colour_{g,p,k},recipe_{g,p,k} \ge 0 \nonumber \\{} & {} usage_{g,p,k} \in \{0,1\}, quantitiy_{g,p,k} \le and \; integer \nonumber \\{} & {} \quad \; \forall g \in G,\;\forall p \in P, \;\forall f \in F \end{aligned}$$
(37)
$$\begin{aligned}{} & {} flotte_{g,p,k,f} \in \{0,1\}, \; \forall g \in G,\;\forall p \in P, \;\forall k \in K \;\forall f \in F \end{aligned}$$
(38)
$$\begin{aligned}{} & {} level_{g,p,m} \in \{0,1\}, \; \forall g \in G,\;\forall p \in P, \;\forall m \in S_k \end{aligned}$$
(39)
$$\begin{aligned}{} & {} assignment_{g,p,k,i} \in \{0,1\}, \; \forall g \in G,\;\forall p \in P, \;\forall k \in K, \;\forall i \in I \end{aligned}$$
(40)
$$\begin{aligned}{} & {} \sum _{g\in G}\sum _{p \in P}\sum _{i \in I} assignment_{g,p,k,i} \le M*machineusage_k, \; \forall k \in K \vert k\le \vert K \vert \end{aligned}$$
(41)
$$\begin{aligned}{} & {} machineusage_k \in \{0,1\} \; \forall k \in K \vert k\le \vert K \vert \end{aligned}$$
(42)

All variables on the dummy dye machine are set to 0 with constraints (30)–(37) where the domains are given in (38)–(40). Constraint (41) indicates if there is any assignment to any of the DMs in any shift (batch) of any day, that machine is marked as being used, \(machineusage_{k}=1\). And finally constraint (42) gives the domain of machine usage variables.

3.2 Lexicographic solution scheme for the multi-objective YDP MIP model

MIP formulation in Sect. 3.1 has two objectives lexicographically ordered; minimizing the number of jobs assigned to dummy DM (\(\alpha\)) with a minimum number of DMs, \(\beta\). Based on the industry experts’ feedback, there is a clear distinction between the priority of these two objectives, and hence a lexicographic solution method fits best for the resolution which also does not require normalizing goals as in the weighted sum method. The methodology relies on decomposing the multi-objective problem into many single objective problems and solving sequentially in which the solution (i.e., objective function value) of the upstream problem(s) is added as an upper bound (for minimization problems) or lower bound (for maximization problems) into the downstream problem(s). The optimal solution for all objectives is found when the last instance is solved, which also guarantees a Pareto optimal solution. Readers are referred to Zykina (2004) and Arora (2012) for details of the lexicographic method.

The same methodology is used for YDP problem formulation in Sect. 3.1: presented model is first solved by minimizing only the number of jobs assigned to the dummy machine, we call this model as \(MIP\; \alpha\) and then the objective function value \(\alpha ^{*}\) is fed into the second MIP model, which we call as \(MIP\; \beta\), as an upper bound for unassigned jobs while minimizing the number of DMs used, \(\beta\). When optimal solutions are found for both models, the minimum number of unprocessed jobs, \(\alpha ^{*}\) and the minimum number of machines used \(\beta ^{*}\) are ensured.

Figure 4 shows the lexicographic solution scheme. The formulation of \(MIP\; \alpha\) and \(MIP\; \beta\) are detailed in the following subsections.

Fig. 4
figure 4

Lexicographical solution scheme

3.2.1 MIP \(\alpha\)

$$\begin{aligned} Minimize \; \alpha =\sum _{g\in G}\sum _{p \in P}\sum _{i \in I} assignment_{g,p,\vert K \vert +1,i} \end{aligned}$$
(43)

\(subject \; to\)

Constraints (242)

The solution of \(MIP\; \alpha\), is stored as \(\alpha ^{*}\) to be used as an upper bound for the number of unassigned jobs in the downstream model \(MIP\; \beta\).

3.2.2 MIP \(\beta\)

Additional input parameters

\(\alpha ^{*}\): the number of jobs that are not assigned to any DMs based on the solution of \(MIP\; \alpha\)

$$\begin{aligned} Minimize \; \beta =\sum _{k \in K} machineusage_{k} \end{aligned}$$
(44)

\(subject \; to\)

(242) and

$$\begin{aligned} \sum _{a \in A \vert a.machine=\vert K \vert +1} assignment_{g,p,k,i} \le \alpha ^{*} \end{aligned}$$
(45)

Constraint (44) ensures that any solution to \(MIP\; \beta\) can not yield a worse solution for \(MIP\; \alpha\) than \(\alpha ^{*}\).

Optimal solutions of first the \(MIP\; \alpha\) and then \(MIP\; \beta\) models result from the minimum number of jobs that are not processed, \(\alpha ^{*}\) and \(\beta ^{*}\) [\(\alpha ^{*}\),\(\beta ^{*}\)]

In addition to the NP-hard computational complexity of the proposed MIP models, the size complexity of the model is bounded with \(\mathcal {O}(|G|\times |P| \times |K| \times |I| )\) both for the number of variables and constraints due to \(assignment_{g,p,k,i}\) variables and equation (27).

Nonlinear relations between variables make developing good-quality lower bounds for objective functions difficult. However, a practical lower bound can be formulated for \(\beta\) as in the following.

Recall that the colour percentage of a batch is one and only one and equal to the colour percentage of all jobs assigned to (1518 and 24, 25). Assume five different colour percentages (groups of jobs) exist in the set of jobs to be processed, and only three batches are available. They need to be assigned to minimum (\(\lceil \frac{5}{3}\rceil =2\)) machines. Therefore, \(\sum _{k}machineusage_k \ge \lceil \frac{n}{b}\rceil\) where n and b represent the number of groups and the total number of batches in a day, respectively is a valid lower bound for \(\beta\).

As presented in Sect. 5 in detail, the lexicographic solution scheme proposed above is intractable due to its size and computational complexity. Hence, in the next section, an Adaptive Large Neighborhood Search (ALNS) heuristic will be proposed to get good-quality solutions in a reasonable time for large instances. The ALNS heuristic differs from the conventional large neighbourhood search (LNS) heuristic by employing multiple destroy and repair methods in dynamically changing size during the search.

4 Adaptive large neighbourhood search algorithm for YDP

Divide-and-Conquer is the most practical method to attack sizeable combinatorial optimization problems, dividing the problem into computationally tractable but independent sub-problems and iteratively solving till a stopping criterion is met. Large neighbourhood search (LNS) proposed in Shaw (1998) is the primarily used divide-and-conquer method for combinatorial optimization problems from many domains. The basic working principle of a typical LNS is finding an initial solution, selecting a subproblem, and iteratively destroying and repairing the current solution. As an example, for a mixed integer programming model-based initial solution, these phases would be selecting a set of variables to be destroyed (subproblem selection) at random or with a heuristic selection method, relaxing values of these variables (destruction) while fixing values of other variables, then solving (repair) the mixed integer programming model only for those whose values are relaxed. Since a combinatorial problem is solved in every repair phase, the method is called “large” compared to “local” search methods, where polynomial repair methods are used. If the size of the subproblems changes dynamically during the search, the overall process is called an adaptive large neighbourhood search (ALNS), Ropke and Pisinger (2006). Readers are referred to Taillard (2023) for a detailed explanation of generic LNS and ALNS procedures.

In this paper, we implemented the ALNS method into the Yarn Dyeing Planning (YDP) problem, demonstrating the hierarchy of steps in Fig. 5. Having a structural formulation of the problem through a mixed integer programming model provides a background for employing ALNS as it can be used for having a good quality initial solution and as a repair operator and promises quickly converging solutions compared to other metaheuistic methods. Developed ALNS uses two approaches to find an initial solution; a matheuristic method based on the YDP MIP model presented in Sect. 3.1 and the other based on executing the lexicographic scheme presented in Sect. 3.2 only until the first feasible solution is found. Once an initial solution is found, three alternative subproblem generation heuristics are executed; job and machine-based or random. A subproblem is selected based on descending or ascending ordering heuristics. The following subsection will explain the design of these steps demonstrated in Fig. 5.

Fig. 5
figure 5

Hierarchy and ALNS steps for Yarn Dyeing Problem

4.1 Design of the ALNS algorithm

The ALNS metaheuristic uses a neighborhood defined implicitly by a destroy method and a repair method. The destroy method breaks down a part of the current solution, while the repair method rebuilds the destroyed part with the hope of a better objective. For avoiding to stuck in a local optima, the destroy method usually incorporates a degree of randomness so that a different part of the current solution is destroyed in each iteration. The function d(\(\cdot\)) represents the destroy method, while r(\(\cdot\)) represents the repair method. In more detail, when the function d(x) is applied to a solution x, it returns a partially destroyed copy of x. On the other hand, using the function r(\(\cdot\)) to a partially destroyed solution results in a repaired, feasible solution constructed from the destroyed one (Pisinger and Ropke 2019). Algorithm 1 shows the framework of ALNS.

Algorithm 1
figure a

ALNS (machines,jobs,Reverse)

Algorithm 1 provides the adaptive large neighbourhood search algorithm’s pseudo-code. ALNS starts with finding an initial solution (Line 2) with \(\alpha\) which refers to the number of unassigned jobs, lexicographically the first objective function. Suppose there exists at least one unassigned job (line 5). In that case, ALNS applies r(\(d^1\)(S,RT)) (lines 6–9) that first destroys the current solution based on the job-based destroy operator and then repairs the solution, which updates the current best solution if the new solution is lexicographically better. If not, ALNS invokes r(\(d^2\)(S,RT)) (lines 10–13) and destroys the current solution based on the machine based destroy operator and repair with the hope of finding a better solution with fewer machines (\(\beta\)) used. If all jobs are assigned (line 14), the algorithm invokes r(\(d^2\)(S,RT)) (Lines 15–19) to minimize \(\beta\). Once all job and machine-based destroy operators are tried, if there is still time remaining, ALNS calls a random destroy operator and repairs the destroyed solution r(\(d^3\)(S,RT)) (lines 20–23). Once the time limit is reached, ALNS stops (line 23) returning the current best solution (line 25). Details of Algorithm 1 are explained in the following subsections.

4.1.1 Finding an initial solution

Two methods have been employed to find an initial solution as shown in Algorithm 2. The first method uses the lexicographic solution scheme presented in Sect. 3.2 with limited time. And the second one is using the matheuristic method to search for larger solution space in a given limited time. These initial solution algorithms are selected with binary “Heuristic” parameters in line 2 of Algorithm 1.

Algorithm 2
figure b

InitialSol(machines,jobs,Heuristic)

Algorithm 3 is used to find the first feasible solution using the lexicographic scheme in Sec 3.1 which is denoted as solve method. Since the problem is NP-Hard, time restriction is used to find the first feasible solution in a reasonable time.

Algorithm 3
figure c

Lex(machines,jobs,RT)

In Algorithm 4, a matheuristic is applied to find an initial solution. First, jobs are divided into Job\(\_\)groups using StaticJobGroup algorithm, Algorithm 5. For each group in Job\(\_\)groups, g is a subproblem for matheuristic and solved by the lexicographic method presented in Sect. 3.1 with resulting objective function values \(\alpha _{g}\) and \(\beta _{g}\). Overall objective function values \(\alpha\) and \(\beta\) are updated with values from those groups. And finally, the assignments in matheuristic are returned to Algorithm 1.

Algorithm 4
figure d

Matheuristic(machines,jobs)

Algorithm 5, groups jobs according to their features such as flotte, recipe, and colour percentage. Each group is appended to job\(\_\)groups as a set for use in Algorithm 4. Note that Algorithm 5 is called static because jobs are grouped based on physical attributes and also to distinguish it from a dynamic grouping scheme during the search to be explained in the following subsection.

Algorithm 5
figure e

StaticJobGroups(machines,jobs)

4.1.2 Destroy and repair operators

In this subsection, we explain the details of the job (Algorithm 6 and machine-based (Algorithm 8) and random (Algorithm 10) destroy and repair methods mentioned in Fig. 5.

Job-based destroy and repair operator presented in Algorithm 6 starts with initializing parameters in lines 1–3. DynamicJobGroup algorithm is called (Algorithm 7) in line 4 to create two lists of job groups: assigned and unassigned. While assigned groups indicate a group of jobs assigned to a machine, unassigned jobs groups refer to job groups where at least one job is not assigned to any machine. Then algorithm 6 goes through each assigned group in descending order of weight and chooses the one, lines 5–6, and creates two sets of assignment variables, \(V^r\) and \(V^f\), ones to be relaxed and fixed respectively, line 7. To escape from local optima, all assignment variables in group a and the first unassignedgroups are relaxed, line 8, while the rest of the variables are kept as they are, line 9. Then, the lexicographic method presented in Sect. 3.1 is executed with the current solution S, and a set of relaxed and fixed variables to find a new temporary solution \(S^t\), line 10. As discussed in the numerical experiments section, the subproblem optimized in this stage is small enough to find optimal solutions in all instances. Suppose the temporary solution is better than the current best solution (line 11), the best solution is updated (line 12), a set of assigned and unassigned groups of jobs are re-created based on the new best solution (line 13), and the algorithm starts from scratch (line 14). If not, the algorithm continues by switching to the next group of jobs in the unassigned group (line 18). When all unassigned groups are traversed without further improvement, the algorithm returns the current best solution and remaining time parameter to Algorithm 1. The worst-case number of calls for Algorithm 6 will be O(|I|) if each individual job indicates an unassigned group itself.

Algorithm 6
figure f

r(\(d^1\)(machines,jobs,S,RT)

Since DynamicJobGroups referred to in lines 4 and 13 of Algorithm 6 are also being initialized in other destroy and repair operators, we provide its details below. Algorithm 7 starts with initializing two lists of groups of jobs, for unassigned and assigned groups in lines 1 and 2, and then invokes Algorithm 5 to group jobs according to their physical attributes in line 3. Then, each job group is checked (lines 4 and 5) and added to the list of unassigned (line 6) groups if there exists at least one job not assigned to any machine or assigned list of groups otherwise (line 8).

Algorithm 7
figure g

DynamicJobGroups(machines,jobs,job\(\_\)groups,S)

The second destroy and repair operator is machine based and explained in Algorithm 8, prioritizing the second objective, minimizing the number of machines used. The Algorithm starts with initializing input parameters in lines 1 and 2. In line 3, Algorithm 9 is invoked to create the list of used machines in the current based solution which is ordered in ascending (Reverse=1) or descending (Reverse=0) order based on the weight of jobs assigned to each. Starting from line 4, the algorithm traverses each machine in the used machine list. It initializes the list of variables to be relaxed and fixed, line 6, and the group of jobs assigned to the selected machine, line 7. Then, the algorithm checks all job groups, line 8, and add all of them to the list of Machine group if at least one job is assigned to the selected machine, lines 9 and 10. Job groups in assigned_groups are in descending order based on their weight and Job groups in unassigned_groups are sorted in descending order in terms of the number of unassigned jobs. All assignment variables related to the machine group are added to the list of variables to be relaxed and the rest are kept as fixed, lines 13 and 14. Then, the algorithm invokes the lexicographic solution scheme in Sect. 3.2 by considering the relaxed and fixed variables in line 15. If the current solution is better than the best solution in line 16, the best solution is updated in line 17, the list of used machines is initialized in line 18, and the algorithm starts from the beginning, line 19. Otherwise, the algorithm continues with the following machine in the list of used machines, line 21. Algorithm 8 terminates by returning the best solution and the remaining runtime, line 26.

Algorithm 8
figure h

r(\(d^2\)(S,RT,Reverse))

In the following, Algorithm 9, we demonstrate how machine groups are created, which are used in Algorithm 8. Algorithm 9 traverses each machine, line 2, and if at least one job is assigned, the total weight of jobs is computed, and the machine is added to the list of used machines, lines 3–5. The list of used machines is sorted in descending (Reverse =0) or ascending (Reverse = 1) order based on the total weight of assigned jobs before it is returned to Algorithm 8, lines 8 and 9.

Algorithm 9
figure i

CreateMachineGroup(S,Reverse)

Finally, after job based and machine-based destroy and repair operators explained above, if there is still available time, Algorithm 1 uses a completely random destroy and repair operator, Algorithm 10 as explained below. After initializing the set of relaxed and fixed variables, in line 1, randomly selected b \(\%\) of assignment variables (chosen as 30%) are fixed, and (1-b) \(\%\) are relaxed, lines 2 and 3. The lexicographic solution scheme is invoked with the given fixed and relaxed variables, line 4 and if the new solution is better than the current best, the incumbent solution is updated, lines 5–7.

Algorithm 10
figure j

r(\(d^3\)((S,b,RT))

In the following subsection, we provide a numerical example to demonstrate the execution of Algorithm 1.

4.2 A numerical example

This paper proposes an ALNS with three different destroy and repair operators to tackle multi-objective YDP. Three variants of ALNS are proposed. This subsection presents a minimal example of how these operators are executed. We generate an instance with three dyeing machines (DM) and 17 jobs, as shown in Tables 1 and 2.

Table 1 DM data for the minimal example
Table 2 Job data for the minimal example

Overall ALNS algorithm, Algorithm 1 starts with an initial solution, in which, one of the variants of finding an initial solution, Algorithm 4 requires the classification of jobs first. Algorithm 5, jobs are classified into four groups: group 1\(=\){1,2,3}, group 2\(=\){4,5,6,7,8,9},group 3\(=\){10,11,12,13}, group 4\(=\){14,15,16,17}. An initial solution is shown in Fig. 6

Fig. 6
figure 6

Initial solution for the minimal data

In the initial solution, there are four unassigned jobs: jobs 4,5,6, and 14. Then ALNS invokes Algorithm 6 which first creates two groups of jobs based on the current solution. Suppose all jobs in a group previously created in Algorithm 5 are assigned to a machine. In that case, that group is put into the assigned_group set, otherwise into the unassigned_group set(see. Algorithm 7). For this demonstrated example, assigned_group:{[10, 11, 12, 13], [1, 2, 3]} which is ranked in descending order based on their total weight; and unassigned_group: {[4, 5, 6, 7, 8, 9], [14, 15, 16, 17]} which is sorted in descending order based on the number of unassigned jobs in each group. Next, Algorithm 6 relaxes all variables in the first elements of both sets and invokes the lexicographic solver by fixing the assignment variables for the rest as fixed. The new solution found is illustrated in Fig. 7.

Fig. 7
figure 7

Demonstration of the improved solution by Algorithm 6 after the first iteration

Then, in the next iteration of Algorithm 6, two more jobs are assigned; jobs 5 and 6. However, since job 4 from group 2 and 14 from group 4 are still not assigned to any machine, the assigned and unassigned set of groups of jobs stays the same::unassigned_group: {[4, 5, 6, 7, 8, 9], [14, 15, 16, 17]}; assigned_group:{[10, 11, 12, 13], [1, 2, 3]}. However, since the total number of unassigned jobs is reduced by two with the new solution, the best solution is updated and Algorithm 6 starts from the beginning. The next step will be the same as the previous one: all variables of the first element of both sets are relaxed: {[4, 5, 6, 7, 8, 9], [10, 11, 12, 13]} which results in no improvement. Then the next component of the assigned_group and the first element in the unassigned_group. ({[4, 5, 6, 7, 8, 9], [1, 2, 3]} are chosen without no improvement as well. At this point, because all possible pairs of unassigned/assigned groups of jobs are tried with the first element in the unassigned_group has been tried, Algorithm 6 proceeds with pairing the next element in the unassigned_group which is [14, 15, 16, 17] and the first element in the assigned_group [10, 11, 12, 13] to create a set of variables to relax (create a subproblem). The solution of this new subproblem results in an improvement by assigning one more job, job 14, as demonstrated in Fig. 8.

Fig. 8
figure 8

Final result of Algorithm 6

As the algorithm achieves a better solution, a set of assigned and unassigned jobs are updated, unassigned_job: {[4, 5, 6, 7, 8, 9]}, assigned_job: {[14, 15, 16, 17], [10, 11, 12, 13], [1, 2, 3]} Algorithm 1 continues with Algorithm 6 till trying all pair of assigned/unassigned groups of jobs as long as the time limit is not exceeded. In this small example, we do not see further improvement with the Algorithm 6 operator and as there is still time to search, ALNS continues with Algorithm 8. Algorithm 8 first creates used machine sets. In this illustrative example, three machines are used which are DMS01, KRN03, and THS01. As an input parameter, the algorithm sorts them based on their weight in descending or ascending order(see. Alg. 1). In this example, descending order is used which orders machines as THS01, KRN03, and DMS01, respectively. If at least one job exists in any job group assigned to THS01, then all variables of jobs in that group are relaxed. In that case, the assignment of jobs in group 4, job 14–17, is relaxed. However, there will be no improvement since all jobs in this group are already assigned. Next, machine KRNO3 is selected to which Group 2 and Group 3 are assigned. Hence, all variables of all jobs in groups 2 and 3 are to be relaxed the resulting subproblem is solved again. If there will be no more improvement after Algorithm 8 and there is still solution time available, ALNS will continue with Algorithm 10 which randomly chooses the set of jobs to be fixed and relaxed. In this study, 30% of the randomly selected job assignments are kept fixed in every iteration. Algorithm 10 continues until the stopping criteria are met. In the next section, computational experiments to test the proposed ALNS algorithm over a vast number of realistically generated instances are presented.

5 Computational result

In this section, we test the performance of developed ALNS and compare it with the best results obtained from the solution of the lexicographic MIP scheme over extensive instances generated based on a real industrial case.

The industrial dyeing system consists of 33 dyes (DM) (\(|K|=\)33) where 26 of them are eligible for reactive and lycra job orders \(Special_k=1\) and none of them is ready for any of the colour percentages (\(initialcolour_k=0\)). Each DM has at least one, at most, four different dyeing levels based on its features. Volume capacity, minimum and maximum weights, and the number of spools allowed for a DM in a defined level vary between the lower and upper bounds as shown in Table 3. Similarly, there are four different and predefined flotte intervals as given in Table 4. The Spool weight, spool is assumed as 0.850 kg.

For numerical experiments, 45 instances are generated by varying the number of jobs from 15 to 100 and the number of machines is fixed to 33 in each as in the real industrial case. For each number of jobs (5 different numbers of jobs: 15, 40, 60, 80, and 100), nine instances are generated by changing flotte values and colors which in total results \(5 \times 9 = 45\) instances. Instances can be accessed from corresponding author’s GitHub repository (Duran ). The instances utilized in this study were derived from actual data obtained from a textile company. Due to privacy concerns and confidentiality agreements, the specific real data and company identity cannot be disclosed. Table 5 shows the number of different flotte values and colors for each five groups.

Table 3 Lower and upper bounds of dye machine parameters
Table 4 Predefined flotte intervals of batches and jobs
Table 5 Number of different flotte and colour percentage for each group

The ALNS algorithm and the lexicographic MIP scheme in Sect. 3.2 are implemented in Python 3.7 (Foundation 2023) and executed on an ASUS ZenBook 13 computer with Intel core i7 8th gen processor, 16 GB RAM running on Windows 10 operating system. IBM ILOG CPLEX (IBM 2023) is used as a solver for MIP models in Sect. 3.2 and to repair the destroyed subproblems in the ALNS algorithm.

First, we present the performance of the lexicographic solution scheme in Sect. 3.2 on the generated instances that are limited to 10 h of runtime. Figure 9 shows what percentage of the overall solution time is used for solving MIP \(\alpha\) and MIP \(\beta\) respectively. Results show that MIP \(\alpha\) consumes less time in larger instances. This behaviour is because, in larger instances, the set of feasible assignments is limited and hence. In contrast, the assignment problem (MIP \(\alpha\)) is solved in less time and the remaining time is used to find a solution with less machine usage (MIP \(\beta\)).). The individual runtime of each instance will be provided in the following results table. Among the factors that affect the runtime, the number of jobs is prominent. However, increasing the number of colors and flotte has not been found to establish a strong correlation with the runtime.

Fig. 9
figure 9

Runtime of instances with lexicographic scheme in Sect. 3.2

45 instances mentioned earlier are divided into small (15 jobs), medium (40 and 60 jobs,) and large (80 to 100 jobs) to analyze the behaviour of ALNS and lexicographic solution method better which are presented in In Tables 6, 7, and 8.

The first column in each table J*F*C refers to (Job size)*(number of different Flotte)*(number of different Colour) of each instance respectively. The next column, “Instance” refers to the instance number which is followed by the “Reverse” column “0” indicates machines are sorted in Descending (Reverse =0) order or not, “1” in Algorithm 8 based on the total weight of jobs assigned to them. The following column demonstrates the result of the ALNS algorithm, Algorithm 1, based on two initial solution methods described in Sect. 4.1.1 with respective objective function values \(\alpha\), the number of unassigned jobs, \(\beta\), the number of machines used with the time those solutions found within the 1800 s of runtime. Finally, the “Best lower bound” column represents the solution obtained from executing the lexicographic scheme in Sect. 3.2. For each instance, the lexicographic scheme is run for 11 h of a time limit, and the best solution obtained is reported. Please note that the results discussed in Fig. 9 use the runtime performance of the lexicographic scheme presented in this column. If the solution obtained from the lexicographic scheme is reported as optimal, they are shown as bold and italic. If not, the best resulting solution (ALNS or lexicographic scheme) is shown as bold for each instance. The criteria for ranking a solution as the best is first, lexicographically \(\alpha\) and \(\beta\) values, and if they are the same then the time that solution is reached. Note that, if lexicographically scheme is reported optimal, it is shown as italic.

At first sight, Table 6 shows that the ALNS algorithm with an initial lexicographic solution is the most efficient method to solve small instances regardless of the ordering heuristic used in the “Reverse” column. However, starting from the medium size instances, Table 7 and Table 8 indicate better performance for the ALNS algorithm with a Matheuristic based initial solution regardless of the ordering heuristic. However, when all instances are analyzed, the ALNS algorithm with a matheuristic based initial solution found the best lower bound in 27 instances out of 45. It is also concluded that ALNS, after matheuristic, found the best lower bound in 42 instances for objective function 1, indicating the success of Algorithm 6. Overall, experiments show the ALNS algorithm’s superiority in finding near-optimal solutions quickly.

Finally in Fig. 10, we demonstrate the ALNS search process for instance 45 with 100 jobs, three different flottes, and ten different colors. Figure 10 shows that during the search for the first objective function, the number of unassigned jobs, \(\alpha\), went down from 61 to 21 with the expense of increasing the second objective function, \(\beta\), from 3 to 6 within 8 iterations.

Table 6 Results for small instances
Table 7 Results for medium instances
Table 8 Results for large instances
Fig. 10
figure 10

ALNS search process for Instance 45 with 100 jobs, 3 different flotte, and 10 colours

6 Conclusions

This study is motivated by an industrial problem; multi-objective yarn dying planning. The dyeing process is vital for the overall effectiveness of an integrated textile manufacturing system because of the high setup and changeover costs/times as well the environmental impact of the process. The amount of chemicals needed to wash the DMs is reduced by using fewer of them and ordering the colors from light to dark, reducing environmental pollution. Additionally, several technological limitations and competing goals require the attention and time of production planners. To the best of the authors’ knowledge, no similar research exists in the literature on formulating and solving this very practical yet computationally challenging problem.

First, this paper formulates the problem as a multi-objective mixed integer programming model. And second, an adaptive large neighbourhood search method with various initial solution methods along with alternative destroy and repair algorithms developed for large instances of the problem.

Developed mathematical formulation and ALNS method are tested with an extensive number of instances adapted from industrial data. Experimental results show that the runtime of the mathematical model grows exponentially as the instance size grows. However, numerical computations reveal that the developed ALNS method finds optimal and near-optimal solutions for all sizes of instances in a very short computational time of fewer than 3 min at most. This is particularly important for manufacturing engineers who spend several hours finding a reasonably efficient production plan.

This work can be extended further in terms of problem definition and solution methods. The developed ALNS algorithm uses mathematical modeling-based initial solution methods that require employing a commercial or open-source solver. Developing a solver-free method for an initial solution is undoubtedly a significant extension of the ALNS method proposed in this paper. As part of another future work, the proposed model can be compared to other promising metaheuristics and matheuristics methods such as Adaptive Polyploid Memetic Algorithm (APMA) (Dulebenets 2021) and customized multi-objective hybrid metaheuristic solution algorithm (Pasha et al. 2022). Ant Colony Optimization (ACO) based methods can be considered as well (Singh and Pillay 2022) which utilizing hyper-heuristic ant colony optimisation (HACO) could be promising. Apart from applying different metaheuristics, in this article, the lexicographic method has been employed as the solution approach; however, other multi-objective methods such as the Pareto frontier (Elahi et al. 2022; Yıldırım et al. 2019) or weighted sum (Ozturk et al. 2016) can also be utilized depending on the problem definition. Exploiting machine learning methods in textile process planning showed good initial results (He et al. 2020) and can be a promising future research direction for the problem studied in this paper, especially the stochastic extension. The learning automaton (LA) (Zhao and Zhang 2020) customizes the search strategy and can be used to improve the performance of ALNS in this paper. Furthermore, stochastic batch processing times and preventive maintenance activities can be added as a problem extension as in Gholizadeh et al. (2021). Machine breakdowns, order cancellation are some other industrial extensions of the problem studied as in He et al. (2022) and Zhang et al. (2021). Adding due date constraints, limiting the earliness and tardiness to avoid inventory holding and lateness costs as a third objective function, and considering sequence-dependent setup times from one color to another in machines might give more practical use of the methods developed in this paper.