# Urban Transportation Network Design for Fresh Fruit and Vegetables Using GIS-The Case of Bangkok
## 3 Research Background
### Vehicle Routing with a Time Window  
The VRP is one of the most significant problems in distribution management [17]. The VRP aims to provide a high level of customer service while complying with time windows [31]. The constraints are to complete the routes with available resources and within the time limits imposed by driver work shifts, driving speeds, and customer commitments [31].  
In this research, we used the VRPTW, which is a generalization of the VRP where the service at any customer starts within a given time interval, called a time window [32]. The formulation of the model is as follows:  
Sets:  
\(I\) = set of demand nodes (indexed by \(i\));  
\(J\) = set of eligible facility sites (indexed by \(j\));  
\(V\) = set of vehicles (indexed by \(k\));  
\(C\) = set of customers;  
Parameters  
\(c_{ij}\) = travel cost from node \(i\) to node \(j\);  
\(t_{ij}\) = travel time from node \(i\) to node \(j\);  
\(d_{i}\) = demand of customer at node \(i\);  
\(q\) = capacity of vehicle;\(a_{i}=\) earliest service time at node \(i\);  
\(b_{i}=\) latest service time at node \(i\);  
Decision Variables:  
\(x_{ijk}=\) binary variable equals 1 if a fleet vehicle \(k\) travels from node \(i\) to node \(j\), 0 otherwise;  
\(s_{ik}=\) arrival time of vehicle \(k\) at node \(i\);  
\(s_{jk}=\) arrival time of vehicle \(k\) at node \(j\);  
\[Min\,\sum_{k\in V}\sum_{i\in N}\sum_{j\in N}C_{ij}X_{ijk} \tag{8}\]  
subject to  
\[\sum_{k\in V}\sum_{j\in N}X_{ijk}=1 \forall i\,\varepsilon\,C, \tag{9}\] \[\sum_{i\in C}d_{i}\sum_{j\in N}X_{ijk}\leq q \forall k\,\varepsilon\,V,\] (10) \[\sum_{j\in N}X_{0 jk}=1 \forall k\,\varepsilon\,V,\] (11) \[\sum_{i\in N}X_{ilk}\,-\,\sum_{j\in N}X_{hjk}=\,0 \forall h\,\varepsilon\,C,\,\,\forall k\,\varepsilon\,V,\] (12) \[\sum_{j\in N}X_{i,n+1,k}=1 \forall k\,\varepsilon\,V,\] (13) \[X_{ijk}\big{(}S_{ik}+t_{ij}-S_{jk}\big{)}\,\leq 0 \forall i,j\,\varepsilon\,N,\,\forall k\,\varepsilon\,V,\] (14) \[a_{i}\leq S_{ik}\leq b_{i} \forall i\,\varepsilon\,N,\,\forall k\,\varepsilon\,V,\] (15) \[X_{ijk}\,\varepsilon\,\{0,1\} \forall i,j\,\varepsilon\,N,\,\forall k\varepsilon\,V. \tag{16}\]  
The objective function in Equation (8) minimizes not only the number of vehicles required, but also the total travel time, and total travel distance incurred by the fleet of vehicles. The constraints in Equation (9) certify that each customer is visited once, and Equation (10) indicates that a vehicle can be loaded up to its capacity. Equations (11)-(13) state that each vehicle is initially located at a distribution center, which we denote by 0; after arriving at a delivery point, it has to leave to another destination; finally, all vehicles must arrive at depot n + 1. The inequalities in Equation (14) establish the relationship between the vehicle departure time from a customer and its immediate successor. Finally, constraints in Equation (15) insist that time windows should be observed, and Equation (16) shows integrality constraints. Note that an unused vehicle is modeled by driving the empty route (0, n + 1) [32].