Electric Vehicle Routing Problem with Fuzzy Time Windows using Genetic Algorithm and Tabu Search

id


Introduction
Mobility is an important aspect, for example as in 28 European Union countries that contribute almost 561 billion euros to the transport sector (Pereirinha et al., 2018).One of the uses of transportation is for the distribution of goods.Distribution is the process of delivering goods from producers to consumers, when, and where the goods or services are needed (Karundeng et al., 2018).In overcoming transportation and wide distribution problems, the Vehicle Routing Problem (VRP) has many applications in real life (Mohammed et al., 2017).VRP is a combinatorial problem used to determine the distribution route of goods from warehouse (distribution centers) to customers spread across various points or places (Pitaloka et al., 2014).In addition VRP can be described as a problem of designing the shortest path route from one location to a group of geographically distributed locations (Mohammed et al., 2017).Developments in transportation technology produce electricpowered vehicles or so-called Electric Vehicles (EV) without combustion, creating a clean and pollution-free environment.E-VRP (Electric Vehicle Routing Problem), another variation of the Green Vehicle Routing Problem (G-VRP) coupled with customer uptime restrictions (time windows) becomes a solution for vehicles that have a limited cruising range and demand refueling or refueling propulsion to continue their journey (Schneider et al., 2014).In practice, distribution involves vehicle routes based on time windows which are highly relevant to the level of customer satisfaction (Tang & Huang, 2018).This makes the route determination more specific because it considers the time windows penalty.Where if there is a time penalty in the form of delay or delivery arrives early, it will affect the results of VRP because it must prioritize several customers to avoid time windows penalties (Ghobadi et al., 2021).In the real case, the time windows on VRP do not always have to be strictly adhered to.The schedule sometimes makes the vehicle arrive early or even late from the specified time windows.This deviation in delivery time can affect the level of customer satisfaction which will affect the distributor's income (Febrita & Mahmudy, 2018).Therefore, the application of Fuzzy Logic to time windows can mask time deviations, because fuzzy is vague or uncertainty.It was found that Fuzzy Theory is useful for describing subjective opinions that should be applied in Vehicle Routing Problem with Time Windows (VRPTW) problems (Adelzadeh et al., 2014).In solving VRP problems, there are algorithms that are often used, such as Genetic Algorithms (GA) and Tabu Searches (TS) (Akbar & Aurachman, 2020).GA which is one of the metaheuristic searches, can be a solution in determining the optimum route because it has a good representation in parallel searches and makes in-depth research on schemes that achieve high quality and low cost (Zhenfeng et al., 2017).Recent research shows that TS, a metaheuristic procedure for solving optimization problems, which can help GA to get out of the trap of local optimization (Utamima et al., 2015).At the TS stage several exchanges of nodes called neighbors, are carried out to find the best structure among the results produced through each iteration for further use (Akbar & Aurachman, 2020).Based on these, this study focuses on improving the results of E-VRPTW with the addition of Fuzzy Logic using GA and TS.

Electric Vehicle Routing Problem (E-VRP)
VRP is introduced as a delivery truck which is then defined as a combination of optimization problems to determine the optimum route used by the delivery fleet from the depot to the customer (Toth & Vigo, 2002).Another form of VRP is E-VRP which is a variation from G-VRP to Battery Electric Vehicle (BEV), where both have a limited cruising range and demand recharging of drive energy to continue the journey (Zhenfeng et al., 2017).

Time Windows
Time windows in the case of VRP is a time interval in which the delivery must have already arrived at a certain time (Schneider et al., 2014).For service level issues related to time windows violations or penalties in VRP are described using the fuzzy membership function (Ghannadpour et al., 2014).In traditional VRPTW, a viable solution must meet all time windows, called hard time windows.The level of customer satisfaction is determined by the actual arrival time.The satisfaction level function of the hard time window can be seen in Figure 1.
Figure 1.Satisfaction level function of the hard time window (Tang & Huang, 2018) If the distribution service is completed in the time window, L=1 (service satisfaction).Customers have an acceptable time span between [EET, ELT].EET for Endurable Earliness Time and ELT for Endurable Lateness Time.

Fuzzy Logic
Fuzzy logic or vague logic is a branch of mathematical science functions in applications involving vagueness, doubt, linguistic uncertainty, inaccuracy of measurement and subjectivity (Nikolić et al., 2020).Fuzzy logic allows the use of linguistic values of variables and relationships imprecise for the behavior of modeling systems.The level of customer satisfaction in VRPTW can be described by the fuzzy membership function which can be seen in Figure 2.  (Teimoori et al., 2014) In fuzzy logic, there is a membership function which is the value of a curve that shows the mapping of input points into their membership values that have intervals between [0, 1] (Irfan et al., 2018).This interval value can be a tolerance value in the penalty time window, if a delay in delivery occurs.More specifically, the level of customer satisfaction is directly related to the degree of fuzzy membership of each, when the customer is visited by one of the vehicles from the warehouse (Qamsari et al., 2022).In this diagram the parameters e and l are the limits of the crisp time windows (0 or 1) that provide the highest utility for the customer.Thus, the penalty on delivery time is too early or late depending on the service time gets a value between zero and one expressed in the fuzzy time function of windows.The fuzzy time function of windows can be seen in Equation 1.  (Zheng, 2020).

Genetic Algorithm (GA)
GA is one of the most effective metaheuristic methods used for optimization cases because the search is carried out by exploring a wider solution space (Pitaloka et al., 2014).Fitness value expresses the value of the goal function.The purpose of the GA is to maximize the value of fitness (Adnyana, 2018).Here are the stages in the Genetic Algorithm (Yuliastuti et al., 2017).
• Chromosome Representation (Encoding), the term chromosome in GA represents the solution to the problem at hand.In the case of VRP, the chromosomes in question are the sequence of routes of the vehicle to be taken.• Process Of Initialization is the stages of random parent generation are as many as the specified size (popsize).• Reproduction Process (Breeding) is aims to produce offspring or alternative solutions that refer to parents.There are 2 ways to produce offspring, namely crossover and mutation.Crossovers require 2 chromosomes as parents to be crossed, while mutations only need 1 chromosome as a parent.These two processes are the stage of changing the genes (nodes) on the chromosome to produce new chromosomes.• Evaluation Process is the process of assessing the good and bad of a chromosome by calculating the fitness value.• Process Selective is selection of the best chromosomes as much as popsize.

Tabu Search (TS)
TS is a search that explores the solution space for a number of iterations from a random solution to another that was better in the previous environment by including it in the Tabu list to prevent getting stuck in the same set of solutions (Zakouni et al., 2017).The best value obtained can be considered as the real solution when there is no longer a solution that is not a member of the Tabu list (Tiandini & Anggraeni, 2017).The TS algorithm is characterized by a Tabu list containing Tabu solutions and is used to avoid cycles when searching away from the optimum local through a non-improving process (Zidi et al., 2019).Two other important steps in TS are intensification and diversification.Diversification is carried out when no improvement is achieved on the best solution after several iterations, whereas intensification aims to conduct a more thorough search of the environment for an optimal solution (Zakouni et al., 2017).

Proposed Methods
This study focuses on improving E-VRPTW fitness results or values by adding Fuzzy Logic using GA and TS.The process of improving the results of E-VRPTW consists of several main stages, including the data collection stage, data processing (E-VRPTW and E-VRPFTW), and drawing conclusions.Each of these stages can be seen in Figure 3 and Figure 4.There are two treatments in the dataset to be processed, namely E-VRPTW (non-Fuzzy Logic) and E-VRPFTW (with Fuzzy Logic).E-VRPTW will carry out two processes after dataset input, it called the GA process which is then continued with the taboo search process and then generates the route with the best fitness value that can be found.The second treatment in data processing is that E-VRPFTW is almost the same as the E-VRPTW process.However, in this treatment there is an addition of Fuzzy Logic in the time windows (Fuzzyfication) section, so that it will affect the calculation of GA-TS.This research begins by entering a pre-prepared dataset.In the E-VRPTW Instances dataset, the StringID and Type variables are not Integer so they will not be used in the GA-TS method.The x coordinate and y coordinates of each instance will be used to find the distance between points (nodes) and the distance will be used to calculate the cost of mileage and travel time.In addition, customer coordinates will also be used to represent fleet travel routes in the form of graphs.Variable demand is used to reduce load when arriving at the customer's location.However, when the number of customer demands have not been visited cannot be met, then the load must be replenished at the warehouse.However, this will increase the amount of distance and time traveled so that it affects the final fitness value.
Then there are the readytime, duedate, and servicetime variables which are time variables.Each customer has an interval between readytime and duedate (time windows), where the delivery must have arrived at the customer's location when the time is between the two variables.Delays or early arrival will affect the level of customer satisfaction, as it is considered a time penalty.Fuzzy will be used in time windows which plays a role in calculating the fitness value in the customer's time windows section.All variables that have been described above will be processed in the Genetic Algorithm and Taboo Search methods.
The incorporation of the GA-TS method is carried out by applying the GA method first to determine the individuals who have potential based on the highest fitness value.After the solution with the highest fitness value is found, then the output or solution from GA will be the input for use in TS.Therefore, the output from GA-TS will be optimal.The GA flowchart can be seen in Figure 5.
Figure 5. Genetic Algorithm Process This process is carried out to determine the value of fitness that comes from the current population.The population evaluation process is carried out by calculating three main indicators, it is travel_cost, fuel_cost, time_cost, and vehicle_cost to determine the fitness value of the population.The fitness value can be calculated using a formula such as Equation 2. (2) Fuzzy time windows will minimize the calculation of the delivery time penalty (TimeCost) value by fuzzifying the windows time limit according to the fuzzy membership function.The calculation of the TimeCost value is calculated when the vehicle will go to the customer, where there are five fuzzy sets of vehicle arrivals, called early, early_fuzzy, on_time, late_fuzzy, late.The fuzzy arrival set representation uses a trapezoidal function that produces a curve as seen in Figure 6.

Figure 6. Fuzzy Trapezoidal Function
The arrival utility level can be described at various times of service using the L(t) function which is then accumulated ∑ .The representation of the equation from the fuzzy set can be seen in Equation 3.
The early category is a condition where the arrival time (t) is less than Edge of Early Tolerance (EET), thus getting an EPU score where it is added with the EPU ∑  and gets a membership degree of 0 (early/late).The early_fuzzy category is used when t is between EET and e (customer ready_time).A function is a function up from t to obtain a degree of membership with a value between [0, 1].Those membership degrees are then multiplied by the EPU value and summed by ∑ .Category on_time is a condition in which t is greater than e and smaller than l.Category on_time has a membership degree of 1 (on time).This category does not get a penalty score, so ∑  it does not gain or lose its value.
The late_fuzzy category is used when t is between ELT and l (due_time customer).A function is a derivative function of t to obtain a degree of membership with a value between [0, 1].After getting the degree of membership from late_fuzzy, then the value of the membership degree will be multiplied by the LPU value and summed by ∑ .The late category is a condition where t is more than the final tolerance time limit ELT (Edge of Late Tolerance), thus obtaining a LPU score where ∑  it is summed up with the LPU and gets a membership degree of 0 (early/late).This breeding process will continue to repeat until individuals with better fitness values are produced (stagnation) or the number of iterations is sufficient.It is this final individual that is then used as an input on the quest for taboos.The TS Flowchart can be seen in Figure 7.

Figure 7. Tabu Search Flowchart
The TS is started by entering a solution that comes from the output of the GA, then continued by forming 1 set of solutions based on the nearest possibility (neighbor).After evaluating existing solutions, the next step is the stage of choosing the best solution.If the solution does not meet the criteria, it will be included in the taboo list and the process will return to the beginning by creating a new set of solutions based on the last solution.The process repeats until results that meet the criteria are obtained.The stopping criterion in this TS method is that the specified iteration has been met., in the case of VRP the number of TS iterations is equal to the number of existing customers.Drawing conclusions are drawn based on preliminary studies, data collection stages, and system development as well as analysis results from research.The conclusions obtained are about how to apply Fuzzy Logic, apply GA and TS and find out the best route results with the highest fitness values optimization results using GA and TS on E-VRP with reference to Fuzzy time windows constraint variables.

Dataset
The dataset used is the "E-VRPTW Instances" dataset based on the research of Schneider et al (2014).The study retrieves datasets available in Mendeley Data public repositories.This dataset has 8 attributes and has a total of data in the range of 5 to 120 instances.A sample of dataset used can be seen in Table 1.The data processing stage is a stage of computer calculation using the Python Programming Language.Before performing the GA-TS calculation, it is necessary to first determine the parameters that will be used on the GA-TS.

Main Standard Parameters
At this stage, parameter testing is carried out to determine the main parameters that produce the best fitness value.Before conducting the main parameter test, the researcher has created standard parameters for reference, and for testing it is carried out on the "c101_21" dataset.The main standard parameters can be seen in table 2. In testing the tested parameters, parameters other than those tested use predefined standard parameters.The test results of the main parameters produce the values that can be seen in Table 3.

Conditional Parameters
Unlike the main parameters, conditional parameters are not too referenced because as the name implies, namely adjusting circumstances or needs.For this study the value of conditional parameters is determined rationally.As for the values of the conditional parameters, they can be seen in Table 4.

Application of Genetic Algorithms
The incorporation of the GA-TS method is carried out by applying the GA method first to determine the individual/solution that has potential based on the highest fitness value.

Initial Initialization
This initialization is done by specifying the parameters to be used in the GA process.

Population Initialization
Population initialization is done by randomly generating as many numbers as the amount of data.A sample of the results of population initialization can be seen in Table 5.Table 5. Sampel Population Initialization

Population Evaluation
This process is carried out to determine the fitness value derived from the current population.The population evaluation process is carried out by calculating three main indicators, it is travel_cost, fuel_cost, and time_cost to determine the fitness value of the population.

Selection
The population selection process is a process to get a good parent of offspring.There are several methods that can be used in conducting population selection.In this study, the method used was the Tournament Selection Method.Tournament Selection is a selection process by bringing together chromosomes until the final result of the selection process is obtained which is then continued with the determination of the parent.In determining the parent for the crossover, the parent range can be determined using a parent selection ratio that can be determined using a formula such as Equation 4.

Elitism
In this process, several chromosomes will be included in the elite category.The elite category here is that the chromosomes are good chromosomes and do not need to go through the process of crossover and mutation, so that they enter the next generation.

Crossover
The process of crossing is aimed at forming offspring (child) based on the specified parent.In this crossover stage, the parent selection ratio value is 0.8.As for after getting the parent range, a cross between parents is carried out as can be seen in Table 6.A crossover is a cross between two parent chromosomes.The method used to carry out crossing in this study is to use the one-point crossover method or one point crossing.The crossing process can be seen in Table 7.After the exchange of genes on predetermined chromosomes.The crossover produces a new population which can be seen in Table 8.

Mutation
The mutation process is execute by replacing the genes on the chromosomes with new genes, and aims to get the best fitness value.Using the parameter that was previously tested, named the mutation probability used is 0.75, then look for the total genes that when formulated can be seen as in Equation 5.
= ℎ ℎ *   (5) After getting the mutation range, the next step is to calculate the total genes and the maximum mutation.In calculating the total genes and the maximum mutations can be seen in Equation 6and Equation 7.
After getting the max mutation, then the generation of random numbers is carried out as many as the Total Gen.This random number will be used as an index number that will experience as many mutations as max mutations.The mutation process can be seen in Table 9.After selecting a gene to be mutated randomly, the gene value will be replaced with another gene value at random as well.If the gene value has been altered, the gene that has the same gene value as the mutated gene.The gene value will change to the gene value before mutating in other words, there will be an exchange of gene values between the mutated gene and the gene that has the same gene value as the mutation result.A sample of the results of gene values that have undergone mutation can be seen in Table 10.At the beginning of the initialization, researchers have determined that the maximum generation or the maximum number of generations is as many as 1000.Then the GA process will undergo a reiteration starting from the population evaluation stage and will stop when it reaches the 1000th generation.Chromosomes with the highest fitness value are considered the best solution in that generation and we can use them for the next process.GA best population results can be seen in Table 12.74,72,33,24,19,97,42,14,40,91,102,11,106,26,104,8,94,2,88,27,105,82,32,4,110,93,100,18,59,62,50,90,20,71,36,31,9,57,28,51,46,45,78,67,15,111,25,6,119,115,35,66,77,3,92,80,16,10,64,54,29,60,73,22,99,101,122,37,43,121,5].

Starting Iteration
The next stage is to determine the next iteration and look for alternative solutions that do not violate the Tabu criteria.An alternative solution is obtained by exchanging the position of two points (nodes) or customers based on indices.

Choosing the Best Solution
The next step is to choose the best solution among the alternative solutions that have been obtained in step 4.1.5.2.

Evaluation
If the solution obtained is on the Tabu list, the solution will be ignored.Then if the fitness value of the best solution in step 4.1.5.2 is greater than the value of the initial optimum solution, then the best optimum solution obtained is chosen as the optimum solution.

Tabu List
Update the Tabu list by adding the optimum solution route obtained in step evaluation.

Stop Criteria
If the dismissal criteria are met, the process stops.If not, then the process is restarted starting step 4.1.5.2 with the last optimum solution as initialization and will stop when the dismissal criteria are met.The stop criteria in this study is that the maximum index has been met or TS managed to find one iteration with a fitness value better than the fitness value of the GA result.

Discussion
In this study, a comparison of the results will be carried out between E-VRP which uses fuzzy in increasing time windows and E-VRP which only uses time windows.The greater the fitness value obtained, the better the quality of the solution.There are two types of trials carried out, specifically trials with the same dataset and trials with randomly selected datasets.This study applies GA and TS in optimizing the route determination of the E-VRP with the limitation of time windows parameters combined with Fuzzy Logic.The dataset used is E-VRPTW Instances which contains VRP data with cluster, random, and random cluster types.This dataset presents cartesian coordinates (x-coordinates and y-coordinates), the number of requests, the start time and end time, as well as the total time in serving customers.Each of the available datasets has instances ranging from 5 instances, up to 120 instances.

Testing One Dataset
The parameter determination stage is perform with the aim of determining the appropriate parameters for the GA-TS method in order to increase the effectiveness and work efficiency of the GA method.
After testing with several values, the optimum parameters shown in Table 3 were obtained.These optimum parameters are then used for the process of finding the optimum route with GA-TS.After going through the parameterization stage, the next stage is data processing on E-VRPTW with and without using Fuzzy Logic.The results of data processing execution on the "c101_21" dataset can be reviewed in Table 13.After ten E-VRPFTW trials, the fitness value with and without fuzzy was taken from the average value.The average fitness results from the E-VRPTW data processing process with and without fuzzy can be seen in Table 14.Based on the fitness value results from Table 14, the average result of ten E-VRPTW executions with fuzzy in the "c101_21" dataset got a value of 0.000226 with fuzzy and 0.000197 without fuzzy.The difference between fuzzy and non-fuzzy usage is 0.000028.

Testing Random Datasets
In addition to using one dataset ten times for trials, researchers also conducted trials on several different datasets.The datasets used are: c101C10, c102_21, c106C15, c101_21, r101_21, r202_21, rc205_21, r211_21, rc201_21, rc208_21.The results of the data processing execution on the dataset used can be seen in Table 15.After ten trials of a randomly selected dataset, fitness scores with and without Fuzzy were obtained.
Based on the results in Table 15, all fitness value results using Fuzzy are superior to non-Fuzzy.Furthermore, the fitness value is calculated as the average value.The average results of ten random dataset trials can be seen in Table 16.Based on the second type of experiment, called a random dataset, the fitness values can be seen in Table 16.The average result of ten E-VRPFTW executions on ten different datasets, resulted in greater results than without the use of E-VRPTW.The second type of trial gets a score of 0.000448 with fuzzy and 0.000413 without fuzzy.The difference between fuzzy and non-fuzzy usage is 0.0000351.To find out that the GA-TS method and the use of Fuzzy used in this study are the right methods, the researchers compared the methods with the research conducted by (Schneider et al., 2014).In a study conducted by (Schneider et al., 2014) which focused on mileage and the number of vehicles used with the Variable Neighborhood Search and Tabu Search (VNS-TS) methods, it had differences with researchers' research, especially on the GA-TS method and the use of Fuzzy.A comparison of the accuracy results obtained with previously conducted research can be seen in Table 17.In Table 17 comparisons between studies related to research conducted by researchers can be seen that the distance (mileage) in the proposed method has a distance that is mostly shorter than the distance from the previous study, and the number of vehicles used is relatively less.The dataset used in this study and the previous study is the same, named "E-VRPFTW Instances".An average comparison of the results of related studies can be seen in Table 18.Based on the average results with related studies, the values produced using the proposed method produce better results.This is seen from the smaller number of vehicles and shorter mileage.The first result in the form of a vehicle count experienced an increase in quality of 30.43%, while the second result experienced an increase in quality of 11.35%.

Conclusion
This paper examines the improvement of E-VRPTW by adding Fuzzy Logic using GA and TS.Fuzzy Logic is used in time windows to provide a tolerance value for arrival time beyond the time windows limit.The results obtained showed that E-VRPFTW has a higher fitness value than E-VRPTW when using GA-TS.The results of the fitness value obtained were that the first type of trial increased by 14.39%, and the second type of trial increased by 8.49%.Also based on a comparison of the results of the number of vehicles and the distance in related research it can be concluded that the use of the GA-TS method and the use of fuzzy can be said to be better due to the factor of shorter mileage and the small number of vehicles.

Figure 2 .
Figure 2. Fuzzy time windows satisfaction level function(Teimoori et al., 2014) In fuzzy logic, there is a membership function which is the value of a curve that shows the mapping of input points into their membership values that have intervals between [0, 1] (Irfan et al., 2018).This interval value can be a tolerance value in the penalty time window, if a delay in delivery occurs.More specifically, the level of customer satisfaction is directly related to the degree of fuzzy membership of each, when the customer is visited by one of the vehicles from the warehouse(Qamsari et al., 2022).In this diagram the parameters e and l are the limits of the crisp time windows (0 or 1) that provide the highest utility for the customer.Thus, the penalty on delivery time is too early or late depending on the service time gets a value between zero and one expressed in the fuzzy time function of windows.The fuzzy time function of windows can be seen in Equation1.

Table 2 .
Main Standard Parameters

Table 3 .
Optimum Results of Key Parameters

Table 10 .
Mutation Evaluation of New PopulationsThis evaluation process is the last process in 1 iteration which produces a new population called the 1st Generation.A sample of population evaluation results based on fitness values can be seen in Table11.

Table 17 .
Comparison of Results with Related Research

Table 18 .
Comparison of Related Research Averages Result Schneider et al (2014) Proposed Method