C.3. Comparison of results on 400-customer instances of Felipe et al (2014)
5.3. Simulation to calculate expected recourse cost and construct second stage
1: Set iter Ω 1, CkΩ 0 and N to be a sufficiently large number
2: Determine the index of the station visited on route k, i.e., s 3: Determine the arrival time at the depot, i.e., ·n+1
4: while iter 6 N do
5: Generate a waiting time, Ês from sample space according to the probability distribution of
station s.
6: Using Ês update the arrival times of the vertices visited after the station.
7: for all customer i, visited after the station do
8: if ·i> li then
9: Remove customer i from the route
10: Update the arrival times of the vertices after customer i 11: Determine the energy saved after removal of i, i.e., yi
12: Ck= Ck+ ci≠ ce yi 13: end if 14: end for 15: iter= iter + 1 16: if ·depot > l0 then 17: Ck = Ck+ cd(l0≠ ·n+1) + co(·depot≠ l0) 18: else 19: Ck = Ck+ cd(·depot≠ ·n+1) 20: end if 21: end while 22: E[Ck] = Ck/N
5.4.5. Solving the Second Stage Problem
Given a first stage solution, ALNS is utilized to solve also the second stage problem. The second stage problem relies on the realized values of the random waiting times and the first stage problem uses the expected objective function value of the second stage problem. Procedure 5.3 provides the steps for calculating the expected recourse cost and constructing the second stage solution.
If the first stage solution is infeasible, i.e., one of the customers cannot be visited within its time window, then the customers visited after the recharging are checked in an iterative way starting from the first customer visited following the station. If the EV arrives at customer 𝑖 after its late service time, then this customer is skipped with penalty 𝑐B. After removing this customer from the route, the arrival times of the subsequent vertices are updated, and the same procedure is applied until all customers become feasible. This simulation is performed 𝑁 times with different waiting times belonging to different scenarios. Finally, the expected cost is calculated as the average of all the simulated costs.
5.4.6. Waiting Time Adjustment
The algorithm finds the first stage solutions assuming fixed waiting times at the recharging stations. If the fixed value is much less than the average waiting time, then the first stage cost will be low, but the recourse cost will be high since many customers will be skipped due to long realized waiting times. This is a risk seeking strategy and it may yield low quality solutions if the realized waiting times are long. On the other hand, a risk averse strategy may be followed by assuming much longer waiting times than the averages. This will increase the cost of the first stage decisions because the fleet size may grow to cover all customers in the presence of long queue times. However, the recourse cost will be low. So, if the fixed waiting time at a station is increased, the first stage cost will be higher, and the recourse cost will be lower. On the contrary, if it is decreased, the first stage cost will be lower, and the recourse cost will be higher. So, based on this tradeoff we propose an adaptive mechanism to adjust these fixed waiting times after every 𝑁" iterations. Let 𝔼[𝑄] and 𝔼[𝑄ÿ] denote the total expected costs of the best-found solutions in the last 𝑁" iterations and previous 𝑁" iterations, respectively. If 𝔼[𝑄] > 𝔼[𝑄ÿ] then the quality of the deterministic solution deteriorates in terms of estimating the stochastic solution because the total cost has increased. In other words, the fixed waiting times underestimate the real values and may be increased in a more risk averse setting. In contrast, if 𝔼[𝑄] < 𝔼[𝑄ÿ], then we conclude that the fixed times overestimate the real values and may be decreased. In this way, we tune the waiting times in an attempt to reduce the total
cost. The tuning is performed by multiplying the average waiting times with a constant 𝛼 calculated as follows:
𝛼 =𝔼[𝑄]
𝔼"𝑄ÿ# (5.28)
If 𝛼 is less than 1, it means that the waiting times will be decreased for the next 𝑁" iterations. Conversely, if it is greater than 1, they will be increased for the next 𝑁" iterations. In the latter case, the current solution may become infeasible when the routes are updated using new waiting times. Since the waiting times are increased, some customers which are visited after the station may not be covered within their time windows. In this case, the Solution Correction procedure is applied to make the current solution feasible.
Solution Correction: Similar to the procedure when obtaining the final solution after random
waiting times are revealed, this mechanism detects the customers whose time windows are violated. These customers are then removed from their routes and put in a list. Sometimes, the EV may be late for the depot, as well. In these cases, the customer visited before the depot is also removed even if the EV arrives at that customer on time. If the EV is still late, then the removal continues with the next customers until the route becomes feasible. Then the Deterministic Greedy Insertion is applied for the removed customers to include them in the solution.
The general structure of the proposed metaheuristic is outlined in Procedure 5.4. 𝑓(𝑥) represents the objective function of the first stage solution 𝑥.
5.5. Computational Study
We test the performance of the proposed ALNS using 100-customer EVRPTW-SP instances of Desaulniers et al. (2016). This study also assumed that each vehicle may visit at most one recharging station during its journey and its data set is compatible with our case. As highlighted in Desaulniers et al. (2016) and Chapter 4, wide time windows do not have much effect on recharging decisions since they can be easily satisfied. So, we focus on type-1 instances where the customers have narrow time windows in order to better observe the influence of the waiting times at recharging stations. The data set includes three different configurations, namely, C, R and RC. In type C problems, customers are geographically distributed within clusters whereas in type R problems, they are located randomly. In type RC problems, they are both clustered and randomly distributed. The metaheuristic is coded in Java and all experiments are conducted on an Intel Core i7-8700 CPU 3.2 GHz processor with 16 GB of RAM.
We also perform an analysis on the maximum number of iterations by recording the iteration number where the best solution is obtained. In many cases, the best solution is found close to 25,000iterations. Hence, the algorithm is terminated after 25,000 iterations.
5.5.1. Problem Settings
We assume that the recharging (service) times follow exponential distribution with parameter 𝜇. The arrivals of EVs at stations follow a Poisson distribution with mean 𝜆. Hence, the queueing systems at the recharging stations become 𝑀/𝑀/1 systems. We assume that the batteries are operated between 10% − 90% of their capacities to improve the battery life