Genetic Algorithm for Optimizing Routing Design and Fleet Allocation of Freeway Service Overlapping Patrol

The freeway service patrol problem involves patrol routing design and fleet allocation on freeways that would help transportation agency decision-makers when developing a freeway service patrols program and/or altering existing route coverage and fleet allocation. Based on the actual patrol process, our model presents an overlapping patrol model and addresses patrol routing design and fleet allocation in a single integrated model. The objective is to minimize the overall average incident response time. Two strategies—overlapping patrol and non-overlapping patrol—are compared in our paper. Matrix encoding is applied in the genetic algorithm (GA), and to maintain population diversity and avoid premature convergence, a niche strategy is incorporated into the traditional genetic algorithm. Meanwhile, an elitist strategy is employed to speed up the convergence. Using numerical experiments conducted based on data from the Sioux Falls network, we clearly show that: overlapping patrol strategy is superior to non-overlapping patrol strategy; the GA outperforms the simulated annealing (SA) algorithm; and the computational efficiency can be improved when LINGO software is used to solve the problem of fleet allocation.


Introduction
The freeway service patrol problem considered in this paper consists of the number of patrol route optimization, patrol route design, and patrol vehicle allocation.Traffic incidents are the main cause of travel delays (accounting for more than 50% of delays), as well as secondary incidents on freeway performance [1][2][3].Many studies have proven that freeway service patrol (FSP) is an effective method for freeway incident management [4,5].As one key component to improve safety and traffic conditions, FSP can save substantial losses through faster response to quickly remove traffic incidents.The University of South Florida [6] says benefit-cost ratios of FSP is up to 27.6:1.Due to FSP being able to patrol the freeway regularly and provide help to stranded drivers, the FSP is more spontaneous compared with the traditional incident response dispatching system, where tow trucks are placed at depots waiting for dispatching commands [7].
FSP has been a hot topic and proven to be an effective method for incident management.Feno and Ogden (1998) documented the state of the practice of freeway service patrol programs in the United States, and the result showed that available benefit to cost analyses for 15 of the service patrols studied ranged from 2:1 to 36.2:1 [8].Ma et al. (2009) developed a microscopic simulation model to evaluate the benefits of FSPs in reducing the duration of roadway blockages following a crash and the resulting vehicle delay, and the results showed that FSP programs can obtain a maximum benefit-cost ratio of 22:1 [9].Khattak et al. (2004) developed a new approach to help determine the most beneficial locations for patrol deployment by using expanded placement criteria [10].Wu et al. (2014) analyzed FSP by a discrete event-based simulation model [11].Yang et al. (2007) used a simulation approach to quantify the cost-effectiveness of freeway service patrol programs [12].
Previous work mostly used simulation or prediction methods to evaluate or estimate the effectiveness of a FSP system.This paper is concerned with resolving the number of patrol beats/routes, designing patrol beats/routes, and assigning patrol vehicles to optimize the performance of a FSP system.The most directly-relevant research studies are very few-many studies for the FSP optimization model focus only on patrol routing or fleet allocation.Zhao et al. (2017) proposed a method based on travel time prediction to solve the dynamic vehicle routing problem [13].Erdogan (2017) solved many variants of the vehicle routing problem (VRP) using VRP Spreadsheet Solver [14].Keskin et al. (2012) developed a specific mixed integer linear programming model to determine the patrol routes of state troopers [15].Chen (2012) presented a new approach for real-time patrol route planning in dynamic environments for fast patrol route planning [16].Chircop et al. (2013) proposed a column generation approach for the scheduling of patrol boats to provide complete patrol coverage [17].Çapar et al. (2015) presented an improved formulation for the maximum coverage patrol routing problem [18].Dewil et al. (2015) showed a minimum cost network flow model for the maximum covering and patrol routing problem [19].It is undeniable that the above research has made a variety of breakthroughs, however, they only address patrol routing with a fixed number of troopers (and cars) on any one shift.Similarly, many previous studies (see, for example, References [20][21][22]) only address how to allocate patrol vehicles to optimize the performance of the FSP system.Ahuja et al. (1993) had proved that the traveling salesman problem is a non-deterministic polynomial hard problem [23].Our paper builds a model based on the traveling salesman problem.Thus, it is very difficult to solve this problem.The genetic algorithm is commonly used to generate high-quality solutions to optimization and search problems [24].To our knowledge, inspired by the natural genetic mechanism and biological evolutionary theory, Holland first proposes the genetic algorithm (GA) in 1975 [24,25].It has been widely used to solve transportation network problems, such as transportation network routing design problems, traffic signal coordination problems, and so on (see, for example, References [26][27][28][29][30]).
Our paper presents an overlapping patrol model and addresses patrol routing design and fleet allocation in a single integrated model.Based on the actual patrol process, our model takes multiple routes to patrol on the same segment into account, as well as allows the way between back and forth patrolling to be different.Section 2 presents a mixed-integer nonlinear full covering model to strategically resolve the number of patrol routes, design patrol routes, and assign patrol vehicles to optimize the performance of a FSP system.As formulated, the model is large, highly nonlinear, and 0-1 mixed integer programming, which is an NP-hard problem.The genetic algorithm is presented in Section 3, which we test in Section 4 by solving the FSP problem for the Sioux Falls network, and compare overlapping patrol strategy with non-overlapping patrol strategy.Sections 5 and 6 discuss and summarize our conclusions.

Model Formulation
FSP system operation can be simply described as follows.The freeway network is divided into several routes which consist of connected segments, and each route can be seen as a closed loop.Thus, patrol vehicles can travel cyclically along the route, stopping to clear incidents in a first-reach-first-serve manner.Generally, FSP contains two components: patrol routing design and fleet allocation.Take two overlapping patrol routes for an example.We assume that each route patrol time for all day is the same-Route 1 and Route 2 overlap on segment l.Two overlapping patrol routes are shown in Figure 1.t s means the starting time for patrol vehicle; t d means the ending time for patrol vehicle; t bi means travel time of route bi; v bi means the number of patrol vehicles in route bi; t bi v bi means the time headway.Assume that each incident can be independently served by the first arriving patrol vehicle, the expected waiting time before the incident is served can be approximated as follows [21].bi; means the time headway.Assume that each incident can be independently served by the first arriving patrol vehicle, the expected waiting time before the incident is served can be approximated as follows [21].We consider a FSP routing design and fleet allocation problem for a general traffic network, G(N, A), where N and A are the sets of nodes and segments in the network.For each segment i A ∈ , i t and i f denote, respectively, the average travel time it takes a FSP patrol vehicle to patrol segment i , and the total number of incidents on the segment during the planning horizon.It is worth noting that the planning horizon used in our paper is one year.Let ij t and ij f denote, respectively, the average travel time it takes a patrol vehicle to patrol the segment j from the segment i , and patrol vehicle needed to deal with the total number of incidents on the segment j from the segment i during the planning horizon.We consider a FSP routing design and fleet allocation problem for a general traffic network, G(N, A), where N and A are the sets of nodes and segments in the network.For each segment i ∈ A, t i and f i denote, respectively, the average travel time it takes a FSP patrol vehicle to patrol segment i, and the total number of incidents on the segment during the planning horizon.It is worth noting that the planning horizon used in our paper is one year.Let t ij and f ij denote, respectively, the average travel time it takes a patrol vehicle to patrol the segment j from the segment i, and patrol vehicle needed to deal with the total number of incidents on the segment j from the segment i during the planning horizon.
. Give a virtual starting point O, assume the average travel time it takes a patrol vehicle to patrol the segment i from O is equal to t i , then t oi = t i .At the same time, t io = 0. Similarly, f oi = f i , f io = 0. Let n b express the number of covered segments on beat b, t b , and f b denote, respectively, the total average travel time and the total number of incidents on beat b.The movements of patrol vehicles are determined by the binary variable x b ij as follows: x b ij = 1 I f patrol vehicles travel directly f rom segment i to segment j on beat b, i = j.
These data are clearly deterministic and we can get them through statistical methods.We let V and B represent, respectively, the total number of FSP patrol vehicles and patrol routes, V is given, but B is an optimization variable in the model.Since there is at least one FSP patrol vehicle on each route, then V ≥ B. v b , an integer variable, is the number of patrol vehicles assigned to route b.Below is our deterministic optimization model which addresses route design and fleet allocation in a single nonlinear mixed-integer model with the objective of minimizing the overall average incident response time.
Equation ( 3) ensures that the numbers of patrol vehicles assigned to route b cannot exceed the total number available.Equation ( 4) guarantees that each beat is assigned at least one vehicle.Equation (5) shows that each beat has one starting segment.Equation ( 6) requires that each segment is covered by at least one route.That is, each segment in the network can be patrolled by no less than one route, and we call this situation an overlapping patrol problem.At the same time, if we let ∑ b ∑ j x b ij = 1 for each segment in the network, then, it changes to be a non-overlapping patrol problem.Equations ( 7) and ( 8) implement segments on the route b are connected and sub-tours are eliminated.x b ij indicates whether patrol vehicles travel directly from segment i to segment j on beat b.We assume that 1 = yes; 0 = no in our paper.M is a sufficiently large number (e.g., M can be seen as the number of segments in the traffic network).v b , an integer variable, is the number of patrol vehicles assigned to route b.

Genetic Algorithm
The process of GA includes the initial population, selection, crossover, and mutation.At the same time, to maintain population diversity and avoid premature convergence and speeding up of the convergence, a niche strategy and an elitist strategy are incorporated into the traditional genetic algorithm.The specific process is as follows:

Encoding Scheme
The route problem involves two important parts: route and segments covered on each route.We encode routes into a permutation of integers from 1 to B, where B is the number of routes, and ith integer represents segment i.Take 2|2|1|1|1|2|2| for an example; the code is a permutation of integers from 1 to 2, which means there are two routes.Route 1 covers segments 3, 4, and 5; Route 2 covers segments 1, 2, 6, and 7. Then the route can also be encoded as B × N matrix, where N means the number of segments.The first column means routes, and the other columns mean segments covered.Both the integer permutations encoding scheme and matrix encoding scheme act as a chromosome in the GA.

Fitness Function
The objective function (12) is defined as the fitness function of a solution, which is solved by a branch and bound algorithm in LINGO software.If the best fitness function value is not improved over a certain number of consecutive generations, then the algorithm is halted and the best chromosome over all generations is the solution to our FSP problem.

Initial Population
This procedure aims to randomly generate P feasible individuals, where P is the population size.The construction of a feasible individual has three steps.The first step constructs a random route without considering connectivity; the second step splits the disjoint route into connected sub-routes; and the third step merges connected routes when the number of routes exceeds B-an example is shown in Figure 2.

Fitness Function
The objective function (12) is defined as the fitness function of a solution, which is solved by a branch and bound algorithm in LINGO software.If the best fitness function value is not improved over a certain number of consecutive generations, then the algorithm is halted and the best chromosome over all generations is the solution to our FSP problem.

Initial Population
This procedure aims to randomly generate P feasible individuals, where P is the population size.The construction of a feasible individual has three steps.The first step constructs a random route without considering connectivity; the second step splits the disjoint route into connected sub-routes; and the third step merges connected routes when the number of routes exceeds B-an example is shown in Figure 2. First-step.We use the integer permutations encoding scheme and let each segment be randomly selected from integers 1 to B, given the maximum number of routes is B. Theoretically, the initial population can be generated in B N , where N is the number of segments.
Second-step.Split the disjoint route into connected sub-routes when connectivity is considered.The procedure needs to judge whether there is a common node between segments by the adjacency matrix.Since most of the randomly generated routes cannot guarantee connectivity, it is recommended that a segment be randomly selected from integers 1 to 2B/3 in the First-step.
Third-step.To guarantee V B ≥ , we need to merge connected routes when the number of routes exceeds B. The procedure also needs to judge whether there is a common node between connected routes by the adjacency matrix.The whole process is repeated until generating P feasible individuals.

Selection
The selection of the parents is made based on the fitness function.This paper employs the stochastic universal sampling (SUS) method (which was introduced by Baker, 1987) [31] in the genetic algorithm toolbox [25].

Crossover
Taking into account patrol route connectivity, crossover is no longer one or more points of the exchange process between chromosomes.We adopt two-point crossover and implement the last two First-step.We use the integer permutations encoding scheme and let each segment be randomly selected from integers 1 to B, given the maximum number of routes is B. Theoretically, the initial population can be generated in B N , where N is the number of segments.
Second-step.Split the disjoint route into connected sub-routes when connectivity is considered.The procedure needs to judge whether there is a common node between segments by the adjacency matrix.Since most of the randomly generated routes cannot guarantee connectivity, it is recommended that a segment be randomly selected from integers 1 to 2B/3 in the First-step.
Third-step.To guarantee V ≥ B, we need to merge connected routes when the number of routes exceeds B. The procedure also needs to judge whether there is a common node between connected routes by the adjacency matrix.
The whole process is repeated until generating P feasible individuals.

Selection
The selection of the parents is made based on the fitness function.This paper employs the stochastic universal sampling (SUS) method (which was introduced by Baker, 1987) [31] in the genetic algorithm toolbox [25].

Crossover
Taking into account patrol route connectivity, crossover is no longer one or more points of the exchange process between chromosomes.We adopt two-point crossover and implement the last two steps in Section 3.3 to make sure the routes are connected.Note that the non-overlapping patrol problem needs to ensure that the constraint ∑ be deleted in the non-overlapping patrol problem. Figure 3 illustrates how to generate legal offspring for the overlapping patrol problem using two-point crossover.
Sustainability 2018, 10, x FOR PEER REVIEW 6 of 16 steps in Section 3.3 to make sure the routes are connected.Note that the non-overlapping patrol problem needs to ensure that the constraint is established, then duplicate segments need to be deleted in the non-overlapping patrol problem. Figure 3 illustrates how to generate legal offspring for the overlapping patrol problem using two-point crossover.

Mutation
A mutation operator could let GA search a broader space.In each chromosome, (1) randomly select a segment i from 1 to N as a mutation segment, where N is the segments size in the network; (2) identify which route the segment i belongs to; (3) verify the route connectivity when deleting the segment i, and construct the route into a connected route; (4) judge which routes the segment i can mutate to; and (5) rank the mutation chromosomes by fitness value and select the elitist chromosome.Figure 4 shows the mutation process.
1.Select the parents and two crossover points

Mutation
A mutation operator could let GA search a broader space.In each chromosome, (1) randomly select a segment i from 1 to N as a mutation segment, where N is the segments size in the network; (2) identify which route the segment i belongs to; (3) verify the route connectivity when deleting the segment i, and construct the route into a connected route; (4) judge which routes the segment i can mutate to; and (5) rank the mutation chromosomes by fitness value and select the elitist chromosome.Figure 4 shows the mutation process.

Elitist Strategy and Niche Strategy
To maintain population diversity and avoid premature convergence, a niche strategy is incorporated into the traditional genetic algorithm by replacing chromosomes in population that are too close together.The distance between chromosomes is measured by the fitness values.Meanwhile, an elitist strategy is employed to speed up the convergence, in which the elite chromosome will be copied directly to the next generation.

Elitist Strategy and Niche Strategy
To maintain population diversity and avoid premature convergence, a niche strategy is incorporated into the traditional genetic algorithm by replacing chromosomes in population that are too close together.The distance between chromosomes is measured by the fitness values.Meanwhile, an elitist strategy is employed to speed up the convergence, in which the elite chromosome will be copied directly to the next generation.
All in all, we use the objective function (12) as the fitness function to evaluate and rank each chromosome.Second, generate chromosomes for the initial population, rebuild these chromosomes based on the adjacency matrix to make them satisfy constraint (7), and calculate the fitness function  All in all, we use the objective function (12) as the fitness function to evaluate and rank each chromosome.Second, generate chromosomes for the initial population, rebuild these chromosomes based on the adjacency matrix to make them satisfy constraint (7), and calculate the fitness function value based on LINGO software, where we can assign patrol vehicles to each patrol route for each initial population by encoding in LINGO 17.0.Third, to maintain population diversity and avoid premature convergence, a niche strategy is incorporated into the genetic algorithm; to speed up the convergence, an elitist strategy is applied.If the optimization does not end, then generate chromosomes in a new population through a series of operations including selection, crossover, mutation, and niche strategy.Again, any chromosome in the newly generated population should satisfy constraint (7).Then, calculate the fitness function value and rank each chromosome.If the optimization does not end, then generate new populations, step by step.Finally, the algorithm terminates either when it reaches the predetermined maximum number of generations, or if it does not improve the best fitness function value over a certain number of consecutive generations.Then, record the best chromosome over all generations as the solution to our FSP problem.A high level pseudo-code is provided below, named as Algorithm 1.

input:
G(N, A): instance graph; V: number of vehicles; t ij and f ij : the average travel time and the number of incidents on each segment initialize parameters of GA: P (population size parameter); maxGEN; pc_ini; pc_min; pm_ini; pm_min begin gen = 1 generate initial population; // Section 3.3 while gen < maxGEN or tolerance condition is not reached do evaluate the fitness for initial population using LINGO Genetic operation; // Sections 3.4-3.7 gen = gen + 1 repeat Genetic operation; // Sections 3.4-3.7 end return best known solution end

Numerical Example
We conducted numerical experiments to demonstrate the application of our model on realistic networks using the classic Sioux Falls network.The Sioux Falls network contains 24 nodes and 76 road segments, as shown in Figure 5.The average travel time it takes a patrol vehicle and the total number of incidents for each segment during the planning horizon are listed in Table 1.It is worth noting that those data are artificial.We assumed there are 20 patrol vehicles in the Sioux Falls network.
Tables 2 and 3 report the resulting FSP deployment plans from the genetic algorithm with two cases: with overlapping patrol and non-overlapping patrol.The non-overlapping patrol model is solved by the GA and the simulated annealing (SA) algorithm; the reader is referred to Appendix A for the pseudo-code of SA.The initial solutions are all randomly generated.The optimized overall average incident response times from the genetic algorithm, respectively, are 4621.11min for the overlapping patrol case and 4301.17min for the non-overlapping patrol case from the GA.The evolution curve from the genetic algorithm is shown in Figure 6a,b, respectively.
The computational efficiency of the algorithm was also tested.Using a personal computer with CORE I7-2600 CPU 3.40 GHz, the LINGO algorithm is able to allocate patrol vehicles to each route within 0.4 s, the GA algorithm is able to find the shortest route within 1 s.
Analyzing the results of Table 2, we can find that the segments are covered on average 3.34 times.Because of the possibility of the combination of routes being too enormous when the network is too large, there needs to be a purpose to overlap 'important' segments.Then, we re-program the GA; the improved GA is required to overlap only 'important' segments, where we take the ratio of incidents and travel time for each segment as an important segment.According to the definition, we choose the important segments are as followed: segment #13, 17, 20, 23, 49, 52, 53, 58, 65, 69.The new optimized overall average incident response times from the improved genetic algorithm are 4269.00min for the overlapping patrol case.The result of the overlapping patrol strategy from the improved GA and the evolution curve from the genetic algorithm is shown in Table 4 and Figure 7, respectively.Additionally, the route resulting in the overlapping patrol strategy from the improved genetic algorithm is shown in Figure 8.

Summary and Conclusions
This paper has presented an overlapping patrol model to strategically resolve the number of patrol routes, design patrol routes, and assign patrol vehicles to optimize the performance of the FSP system.The improved GA is encoded in two ways: matrix encoding and integer encoding.To maintain population diversity and avoid premature convergence, a niche strategy is incorporated

Discussion
Comparing Table 2 with Table 4, we can find that the blind overlapping patrol is clearly not desirable, the genetic algorithm needs to be improved.At the same time, comparing Table 3 with Table 4, we can find that the overlapping patrol strategy is superior to the non-overlapping patrol strategy.The genetic algorithm of the non-overlapping patrol strategy has been discussed in Sun (2018) [32].Besides, the same numerical experiment has been conducted with Lou (2011) [4].Comparing the result of Lou (2011) with the result of this paper, we can verify the validity of this paper's improved genetic algorithm.The results of Lou (2011) are shown in Table 5.

Summary and Conclusions
This paper has presented an overlapping patrol model to strategically resolve the number of patrol routes, design patrol routes, and assign patrol vehicles to optimize the performance of the FSP system.The improved GA is encoded in two ways: matrix encoding and integer encoding.To maintain population diversity and avoid premature convergence, a niche strategy is incorporated into the traditional genetic algorithm.Meanwhile, an elitist strategy is employed to speed up the convergence.A series of comparative tests show that the overlapping patrol strategy is superior to the non-overlapping patrol strategy with the objective of minimizing the overall average incident response time.
Comparing the results of Tables 3 and 4, we can find that the overlapping patrol strategy is superior to the non-overlapping patrol strategy when we expect to minimize the overall average incident response time; for the overlapping patrol strategy, the improved GA often produces better results.The results of Tables 2 and 4 show that the response time is improved by 7.62% using the improved GA; the improved GA can get a better solution.
In addition, the inputs in our model have only three parts of data: the number of incidents on each segment during the planning horizon, the average travel time it takes a patrol vehicle, and the total number of FSP patrol vehicles-so our model can be widely used for a practical application.Our future research will investigate the problem of stochastic FSP planning and the impact of incidence duration for a FSP program.

Figure 2 .
Figure 2.An instance and a corresponding chromosome.

3 Figure 2 .
Figure 2.An instance and a corresponding chromosome.

Figure 3 .
Figure 3.The procedure for generating legal offspring using two-point Crossover.

Figure 3 .
Figure 3.The procedure for generating legal offspring using two-point Crossover.

Figure 4 .
Figure 4.The procedure for mutation.

Figure 4 .
Figure 4.The procedure for mutation.

Figure 6 .
Figure 6.Evolution curve from the genetic algorithm.(a) Evolution curve from the genetic algorithm for the overlapping patrol strategy; (b) evolution curve from the genetic algorithm for the nonoverlapping patrol strategy.

Figure 7 .
Figure 7. Evolution curve from the improved genetic algorithm.

Figure 6 .
Figure 6.Evolution curve from the genetic algorithm.(a) Evolution curve from the genetic algorithm for the overlapping patrol strategy; (b) evolution curve from the genetic algorithm for the non-overlapping patrol strategy.

Figure 6 .
Figure 6.Evolution curve from the genetic algorithm.(a) Evolution curve from the genetic algorithm for the overlapping patrol strategy; (b) evolution curve from the genetic algorithm for the nonoverlapping patrol strategy.

Figure 7 .
Figure 7. Evolution curve from the improved genetic algorithm.

Figure 8 .
Figure 8. Route resulting in the overlapping patrol strategy from the improved genetic algorithm.

Table 2 .
Resulting freeway service patrol (FSP) deployment plans from the genetic algorithm for the overlapping patrol strategy.

Table 2 .
Resulting freeway service patrol (FSP) deployment plans from the genetic algorithm for the overlapping patrol strategy.

Table 3 .
Resulting FSP deployment plans from the genetic algorithm (GA) and the simulated annealing (SA) algorithm for the non-overlapping patrol strategy.

Table 4 .
Resulting overlapping patrol strategy from the improved genetic algorithm.

Table 2 .
Resulting freeway service patrol (FSP) deployment plans from the genetic algorithm for the overlapping patrol strategy.