## 3 Solution Methodology
### Phase 1: Minimizing Makespan  
The main purpose of the first phase is to minimize the makespan for the products that have received orders. The limited number of changeovers per day is also considered. For the development of the Phase 1 model, the required notation is defined as follows:  
Indices:  
Index of products;  
Index of machines;  
Index of sequences;  
Index of working days.  
Input variables:  
Number of products;  
Number of machines;  
Number of sequences;  
Scheduling period (working days);  
Production time of product \(i\) (hours).  
Decision variable:  
\[X_{ijk} =\left\{\begin{array}{ll}1,\text{ If product $i$ is produced by Machine $j$ with Sequence $k$}\\ 0,\text{ Otherwise}\end{array}\right.\] \[Y_{jk} =\left\{\begin{array}{ll}1,\text{ If any product is produced by Machine $j$ with Sequence $k$}\\ 0,\text{ Otherwise}\end{array}\right.\] \[C_{jkl} =\left\{\begin{array}{ll}1,\text{ If mold exchanged for Machine $j$ with Sequence $k$ is in day $d$}\\ 0,\text{ Otherwise}\end{array}\right.\] \[WD_{jk}\text{ Working days required by Machine $j$ with Sequence $k$ (integer)}\] \[S_{jk} \text{ The day that Machine $j$ with Sequence $k$ exchanges mode;}\] \[F_{jk} \text{ The day that Machine $j$ with Sequence $k$ completed;}\] \[M \text{ Makespan.}\]  
The mathematical model in the first phase aims to minimize the makespan as given in Equation (1). Equation (2) ensures that batch splitting is not allowed for any product, and all products have to be scheduled. Equation (3) is used to judge if any product is produced by Machine \(j\) with Sequence \(k\). Equation (4) ensures, at most, one product is produced by Machine \(j\) with Sequence \(k\). In the case company, the work time is 24 h per day. Because molds can only be exchanged on the day shift, it is assumed that 8 h are required. Equation (5) is used to calculate the number of working days required for each product including the changeover. Equation (6) ensures that the mold in a machine cannot be exchanged before day 1. Equation (7) defines the relationship between the starting and completion days of Sequence k in Machine j. Equation (8) defines the relationship between the completion day of Sequence k and the starting day of Sequence \(k+1\) in Machine \(j\). Equation (9) is used to judge the date for the mold exchange for Machine \(j\) with Sequence \(k\). Equation (10) ensures  
Figure 3: The proposed methodology.  
that, at most, one mold is exchanged per day. The completion time for all of the sequences on all machines cannot exceed the makespan stated in Equation (11).  
\[\text{Minimize }M \tag{1}\] \[\sum_{j=1}^{J}\sum_{k=1}^{K}X_{ijk}=1 \forall i\] (2) \[\sum_{i=1}^{I}X_{ijk}=Y_{jk} \forall j,k\] (3) \[Y_{jk}\leq 1 \forall j,k\] (4) \[\sum_{i=1}^{I}(PT_{i}+8)X_{ijk}/24\leq WD_{jk} \forall j,k\] (5) \[S_{jk}\geq 1 \forall j,k\] (6) \[S_{jk}+WD_{jk}-1=F_{jk} \forall j,k\] (7) \[F_{jk}+1\leq S_{jk+1} \forall j,k=1,\ldots,K-1\] (8) \[\sum_{d=1}^{D}d*C_{jkd}=S_{jk}Y_{jk} \forall j,k\] (9) \[\sum_{j=1}^{J}\sum_{K=1}^{K}C_{jkd}\leq 1 \forall d\] (10) \[F_{jk}\leq M \forall j,k \tag{11}\]  
Figure 4 shows an example result from the integer program in Phase 1. In this example, for Machine 1, Product 1 is assigned to Sequence 2 and Product 2 is assigned to Sequence 4. No product is assigned to Sequences 1, 3, and 5. Therefore, Machine 1 is arranged to exchange the mold on Day 1 and produce Product 1 until Day 3. Then, Machine 1 exchanges its mold on Day 4, and produces Product 2 until Day 5. For the two machines, at most one changeover per day is allowed, and the makespan is 5 days.