## 4 Late Acceptance Hill-Climbing Matheuristic Template
### Illustrative Example of the Functioning of the LAHCM for the GLSP-RP  
With the goal of facilitating the comprehension of LAHCM, this subsection presents an example case of its functioning using the problem instance provided in Section 4.1 and considering a list length (\(l\)) of two. **Initial Solution:** As detailed in Section 4.1, for creating a starting solution, the production sequence of the GLSP is given to the GLSP-RP, i.e., the complete sequence of \(x_{j,m}\) of the GLSP is given to the GLSP-RP with no rescheduling enabled. Table 5 shows that the resulting sequence of the initial GLSP-RP solution matches the sequence of the GLSP. The objective function value of the initial solution (i.e., 4478.75) is stored in the list \(l=[4478.75]\) and the iterative procedure with relaxation of the sequence is started. **Iteration 1:** The strategy selected at random is \(\alpha_{2}\) and the selected products within the strategy are \(j=1\) and \(2\). Therefore, the binary setup variables for \(j=1\) and \(2\) are reset to zero for all micro-periods \(m\), which is once exemplified in Table 6. This allows a rescheduling of the sequence of products 1 and 2. The above sequence is given to the GLSP-RP, producing thus a reduced problem, which is solved by means of an exact algorithm. The optimal solution of this problem results in the following new production sequence for iteration 1:  
Having the sequence of products \(j=1\) and \(j=2\) free while the remaining products are fixed leads to four rescheduling decisions (shown in bold in Table 7) and results in an objective function  
\begin{table}
\begin{tabular}{l  
value of 998.25. This new solution does not include disposal costs. Moreover, this objective value is added to the list \(l=[4478.75;998.25]\) and the updated production sequence will be the new input sequence for iteration 2. As the list is filled (with the predefined list length \(l=2\)), the next solutions of the next iterations will be compared to the first entry of the list until the stopping criterion is met. **Iteration 2:** The strategy selected at random is \(\alpha_{1}\) and the selected product within the strategy is \(j=1\). All values of the production sequence of iteration 1 are fixed except for product \(j=1\). This is given as an input to the GLSP-RP. This reduced problem does not lead to any rescheduling and, therefore, results in the same objective function value of 998.25, which is lower than the first entry of the list (i.e., 998.25 \(<\) 4478.75). Consequently, the first entry of the list is dropped and the objective function value of iteration 2 is added: \(l=[998.25;998.25]\). **Iteration 3:** The strategy selected at random is \(\alpha_{1}\) and the selected product within the strategy is \(j=3\). In this iteration of the algorithm, the products' sequence is fixed except for product \(j=3\). The optimal solution of the resulting reduced problem leads to a solution for the GLSP-RP with two rescheduling decisions, which are shown in Table 8.  
The new objective function value is 994.25, which is lower than the corresponding entry of the list (i.e., 994.25 \(<\) 998.25). Therefore, that entry of the list is dropped and the objective function value of iteration 2 is added to the end of the list: \(l=[998.25;994.25]\). **Iteration 4:** The strategy selected at random is \(\alpha_{1}\) and the selected product within the strategy is \(j=2\). All values of the production sequence of iteration 3 are fixed except for product \(j=2\). Having the decision concerning this product free does not lead to any improvement and thus the objective function value of 994.25 is maintained. Nevertheless, this objective function value is lower than the corresponding one of the list (i.e., 994.25 \(<\) 998.25). Therefore, the entry of the list is dropped and the objective function value of iteration 4 is added to the end of the list: \(l=[994.25;994.25]\). **Iteration 5:** The strategy selected at random is \(\alpha_{2}\) and the selected products within the strategy are \(j=1\) and 3.