# A Location Routing Problem with Time Windows Consideration: A Metaheuristics Approach
## 2 Materials and Methods  
### Problem Description  
We describe the location routing problem with time windows in this subsection. There are \(m\) depot, \(k\) vehicles, and \(n\) customers. Each prospective depot has different capacity and opening cost. Each vehicle has the same capacity, and it leaves the open depot to deliver goods to customers and go back to its original depot. Every customer must be served exactly once by one vehicle within its available service time window, which is bounded by an earliest time and a latest time. If a vehicle reaches a customer before the customer's service time window starts, then it must wait until the earliest service time. On the other hand, if a vehicle reaches a customer later than the customer's latest available service time, then the vehicle can no longer serve the customer. The customer has to be served by another vehicle. After arriving at a customer's location, the vehicle has to stay for a period of time, i.e., service time. The problem determines the location of the depots and vehicle routes to minimize total cost associated with establishing the depots and distributing the goods. Given a graph \(G=(V,L)\) in which \(V\) and \(L\) comprise the graph's vertices and links, respectively, \(V\) entails a subset \(I\) of \(m\) prospective depot sites and a subset \(J=V\backslash I\) of \(n\), the node of customers. Each set of nodes in \(V\) is connected by link \(E\). For each link \((i,j)\in L\), traveling cost \(c_{ij}\) is incurred to express the cost between node \(i\) and \(j\). Every depot \(i\in I\) has a fixed capacity \(W_{i}\) with its associated cost of opening \(O_{i}\). Each node \(j\in J\) holds a demand \(d_{j}\) that needs to be satisfied by vehicle \(k\). The maximum number of \(K\) vehicles is available with its respected capacity \(Q\). Each vehicle used from depot \(i\) will have a fixed cost \(F_{i}\). All nodes, customers, and depots are associated with time windows. The time window of a node, \(i\), is specified by an interval \([e_{i},l_{i}]\) where \(e_{i}\) and \(l_{i}\) represent the earliest and the latest arrival time, respectively. All vehicles must come to customer node \(i\) before the latest time windows \(l_{i}\). Each depot will have time windows \([e_{0},l_{0}]\), which indicate the working hour for the driver, from leaving the depot until the vehicle returns to the depot. The service/routing can only be performed within this range. The travel time between links \((i,j)\in L\) is denoted by \(t_{ij}\). \(a_{ik}\) is the arrival time of vehicle \(k\) at customer \(i\) and \(p_{ik}\) is the departure time at customer \(i\). Each vehicle \(k\) has an identical duration \(B_{k}\) equal to the length of a driver's working hours. The service time in each node \(i\), \(\delta_{i}\), is a fixed number indicating the time needed to serve customer \(i\). A vehicle can only serve customer \(i\) if the vehicle arrives within its time window, otherwise the waiting time \(w_{i}\) will be incurred. If the vehicle arrives at customer \(i\) within its time windows, \(w_{i}=0\). Variables:  
\[y_{i}= \begin{cases}1,&\text{if the depot $i$ is opened;}\\ 0,&\text{otherwise.}\end{cases} \]  
\[f_{ij}= \begin{cases}1,&\text{if customer $j$ is assigned to an open depot $i$;}\\ 0,&\text{otherwise.}\end{cases} \]  
\[x_{ijk}= \begin{cases}1,&\text{if customer $j$ is visited immediately after customer $i$ by vehicle $k$;}\\ 0,&\text{otherwise.}\end{cases}