# A Location Routing Problem with Time Windows Consideration: A Metaheuristics Approach
## 2 Materials and Methods
### Proposed Method
#### 2.2.3 Variable Neighborhood Search with Path Relinking Procedure  
There are six parameters used for the VNSPR, including \(k_{max}\), \(N_{non-improving}\), \(m\), \(EX\), \(P\) and \(I_{iter}\). The first parameters \(k_{max}\) is the total neighborhoods incorporated in the shaking procedure. The neigborhood can be varied and pre-selected. The neighborhood variation can be carried out arbitrarily or according to a predetermine sequence. In order to achieve better performance, this algorithm also uses parameter \(m\) which is the selected modulus number. This modulus number ensures that the shaking phase will give a better solution each time. Two parameters to stop the algorithm, namely \(N_{non-improving}\) and \(I_{iter}\) indicate the maximum number of iterations that can be executed without improving the best objective function value and maximum number of iterations. The algorithm will be terminated if either one of those parameters is fulfilled. A set of elite solutions that consist of candidate target solutions in the pool is equivalent to \(EX\). This solution pool is used in determining the target solution for the path relinking procedure. It is updated during the iteration when a better solution compared to the best-known solution is found. Lastly, \(P\), is the unit penalty cost associated with violation of the time windows constraint. Figure 2: Illustration of example solution representation. Initially, a solution \(X\) is created with \(X\) set as the solution and \(obj(X\),\(P)\) set as the objective value. Current solution \(X\) is associated with a subset \(N(X\),\(P)\), called neighborhood of \(X\). Let \(N_{k}(k=1,2,...,k_{max})\) represent a predefined set of pre-designated neighborhood structures, and \(N_{k}(X\),\(P)\) represents the list of solution in the \(k\)th neighborhood. At the beginning, \(k\) is equal to 1. For each iteration, an active solution \(Y\) is calculated with reference to the \(k\)th neighborhood, \(N_{k}(X\),\(P)\). A more intense search is then performed on the solution \(Y\) to produce the \(Y^{\prime}\). The value of \(obj(Y^{\prime}\),\(P)\) is then analyzed as a decision to move or not move. If \(obj(Y^{\prime}\),\(P)\) is better than \(obj(X\),\(P)\), the result \(X\) is rationalized, and the procedure is repeated with the same neighborhood \(N_{1}\). Otherwise, set \(k=k+1\) and repeat the procedures in conjunction with the subsequent neighborhood, \(N_{k+1}\). This process is carried out until \(k=k_{max}\). \(X_{best}\) will save the best solution observed during the procedure. When \(k\) modulus \(m\) equals zero, the best solution (\(X_{best}\)) is used to renew the current solution, in order to avoid getting stuck at a local optimal solution. Following that, the PR investigates the route that must be taken to achieve an elite solution \(X^{\prime}\) from a local optimum, \(X\), which was obtained using VNS by choosing random \(X^{\prime}\) from \(EX\). The PR employs a forward strategy to convert the solution \(X\) into the guiding solution \(X^{\prime}\) by fixing the broken pairs in \(X\) from left to right, based on a non-distance path from \(X\) to \(X^{\prime}\). The procedure searches for a node called \(I\) that is present in more than one position in both \(X\) and \(X^{\prime}\). In order to rectify the imbalance, the node \(I\) will switch places with the node that was originally occupying the same position in \(X^{\prime}\). The time window constraint is treated as hard time windows, where it cannot be violated. However, during the computational procedure, it is allowed to violate the constraints. Every time the solution exceeds or violates the time constraint, it is penalized as \(P\). Finally, the best solution chosen must be feasible, of which the sum of the penalty (\(P\)) is equal to zero. The process will be ended once the iteration reaches the \(I_{iter}\) or the current best solution, \(X_{best}\), is not improved in \(N_{non\_improving}\).