Applying Particle Swarm Optimization for Solving Team Orienteering Problem with Time Windows

: The Team Orienteering Problem with Time Windows (TOPTW) is a transportation problem case that have a set of vertices with a score, service time, and the time windows, start and final at a depot location. A number of paths are constructed to maximize the total collected score by the vertices which is visited. Each vertice can be visited only once and the visit can only start during the time window of vertices. This paper proposes a Particle Swarm Optimization algorithm for solving the TOPTW, by defining a specific particle for representing the solution of TOPTW within the PSO algorithm and two alternatives, called PSO_TOPTW1 and PSO_TOPTW2, for translating the particle position to form the routes of the path. The performance of the proposed PSO algorithm is evaluated through some benchmark data problem available in the literature. The computational results show that the proposed PSO is able to produce sufficiently good TOPTW solutions that are comparable with corresponding solutions from other existing methods for solving the TOPTW.


Introduction
For many organizations, including industry, transportation of vehicles to visit several locations for some specific purpose, i.e. delivery goods or service, can be considered as an important activity.During planning of this transportation activity, the organization needs to consider the visit time to each location, since each location to be visited usually has the earliest and the latest time of visits, or usually called the time windows.The vehicle can immediately stop in the location to accomplish its purpose, if and only if it arrives in the location during its time window.Otherwise, it has to wait in the location if it has arrived before the earliest time of visit of the location.In other case, the transportation vehicle cannot stop in the location if it arrives after the latest time of visit, that makes this transportation activity useless.Another practical aspect that needs consideration during the transportation planning is the condition in which case the organization should select locations to be visited among candidate locations due to time limitation.This decision problem can be solved using a simple computational procedure, i.e. enumeration method.However, this procedure consumes a lot of time when there are hundreds or thousands of locations to be evaluated.
This paper focuses on one case of transportation problem called the Team Orienteering Problem with Time Windows (TOPTW) by considering the conditions described above. 1 Faculty of Industrial Technology, Industrial Engineering Department, Atma Jaya Yogyakarta University, Jl.Babarsari 44, Yogyakarta 55281.Indonesia, Email: jinai@mail.uajy.ac.id

*Corresponding author
This problem has root in another transportation problem so called the Orienteering Problem (OP).In the OP, there are a number of locations that usually called vertices, in which each of vertices has a definite score.The travel time is given between a pair of vertices.The decision of the OP is to determine a path starting from the vertex 1, visits to some vertices, and ending in the vertex N, in which the travel time of the path does not exceed its maximum travel time ( ).The objective function of the OP is to maximize the total collected score of the visited vertices (Golden et al. [1]; Vansteenwegen et al. [2]).A variant of OP is called the Orienteering Problem with Time Windows (OPTW), in which each vertice in this problem has a time window.So, a visit to each vertice can only be done within the available time windows (Kantor and Rosenwein [3]; Righini and Salani [4]).One application of OPTW is a travelling to some tourist destinations in one region.Each destination (vertex) has its advantages (score) and specific open and close time to visit (time windows).Since the tour has limited time (maximum travel time), the tour is not able to visit all destinations, therefore the tour guide needs to select which destinations to be visited and the route of the tour so that the tourist will obtain maximum advantages within the limited tour duration.
The TOPTW problem setting is similar to OPTW except that the TOPTW determines a set of paths instead of single path (Vansteenwegen et al. [5]).An example of TOPTW application is the scheduling of some medical representative staffs for visiting medical doctors in certain areas to offer new products, i.e. new medical devices.Usually they are assigned in a limited time ( ) and each doctor has specific time to be visited (the doctor's time windows), so that their visiting schedule is very important to determine.Due to these limitations, they put a priority to the qualified and experienced doctors, i.e. doctor with a good 'score', so that the visiting sequence schedules of all staffs can cover the majority of good doctors in the area.
Although the mathematical model of the TOPTW can be formulated, i.e. in the paper of Montemanni and Gambardella [6], the problem is hard in nature in which the optimal solution can be found in reasonable computational time for small size problem only.Therefore, some researchers in the past already proposed some heuristics or applied some metaheuristics for solving the TOPTW, such as iterated local search (Vansteenwegen et al. [5]), ant colony optimization (Montemanni and Gambardella [6]), hybridized evolutionary local search (Labadie et al. [7]), LP-based granular variable neighborhood search (Labadie et al. [8]), and simulated annealing (Lin and Yu [9]).
In the literature, it is found that particle swarm optimization (PSO), an emerging population based searching metaheuristics, has been successfully applied for solving some transportation problems such as vehicle routing problems and team orienteering problem.Several variants of vehicle routing problems that had been tackled with PSO are vehicle routing problem with time windows (Ai and Kachitvichyanukul [10]; Xu et al. [11]; Govindan et al. [12]), vehicle routing problem with simultaneous pickup and delivery (Ai and Kachitvichyanukul [13]; Goksal et al. [14]), and capacitated vehicle routing problem (Ai and Kachitvichyanukul, [15]; Kuo et al. [16]; Tlili et al. [17]).Two groups of author recently published their works on the application of PSO for solving the team orienteering problem (Dang et al. [18]; Ai et al. [19]).Since the TOPTW is very close with these problems, especially the vehicle routing problem with time windows (VRPTW) and the team orienteering problem (TOP), therefore, there is a high possibility to use PSO to solve the TOPTW.This paper proposes on how the PSO can be applied to solve the TOPTW and tests the proposed algorithm over some benchmark problems of TOPTW.To the authors knowledge, no other literature in the past applied PSO for solving the TOPTW.
The outline of this paper is as follows: In the first section the formal definition of TOPTW is presented.After that the PSO algorithm for TOPTW is proposed.The following section describes the computational experiments for evaluating the performance of the proposed algorithm.Finally, the conclusion of this study is presented with some suggestions for further research in this research area.

TOPTW Problem Formulation
As defined in some previous researches, i.e. .It is assumed that the service time at vertex is already included in the .The problem looks for set of paths with the following conditions: (1) each path starts and ends at the depot, (2) each vertex is visited at the most once by any path, (3) the total duration of any path does not exceed , (4) the visited vertices time windows are satisfied, and (5) the total profit of visited vertices is maximized.

Proposed Particle Swarm Optimization for TOPTW
Particle Swarm Optimization (PSO) is a populationbased stochastic optimization technique developed by Kennedy and Eberhart [20], inspired by the behavior of swarm organism such as bird flock, fish school, and bee swarm.PSO mimics the physical movement of individuals in the swarm to conduct the search mechanism of problem solution by two important parameters: position and velocity.A particle position, which is usually placed in multidimensional space, represents an alternative of problem solution.Velocity of particle is the driver of particle movement from one position to another.By moving to other position, another alternative of problem solution is evaluated.Therefore, the particle velocity expresses the searching capability of the problem solution.There are two important behaviors of the swarm organism that are formulated in the PSO, namely the cognitive behavior and the social behavior.The cognitive behavior is defined as the tendency of particle moving towards the best position ever visited by the particle, which is usually called personal best or pbest.While the social behavior is defined as the tendency of particle moving towards the best position ever visited by all particles in the swarm, which is usually called personal best or pbest.The simplest version of particle movement can be stated as following equations: where is iteration index, is particle index, is dimension index, is uniform random number in interval , -, ( ) is inertia weight in the iteration, ( ) is velocity of particle at the dimension in the iteration, ( ) is position of particle at the dimension in the iteration, is personal best position (pbest) of particle at the dimension, is global best position (gbest) at the dimension, is personal best acceleration constant, and is global best acceleration constant.Equations 1 and 2 imply that the movement of particle in certain period of time is driven by three different directions that are: 1) follow its own way, 2) go towards its personal best position, and 3) go towards its global best position.
In general, the algorithm of PSO can be formally defined as follow: 1. initialization of particles, their position and initial velocity, 2. decode particles into problem solutions, 3. evaluate the quality of particles, based on their corresponding objective functions, 4. update pbest value, 5. update gbest value, 6. update velocity and position for each particle, i.e.
based equations 1 and 2, 7. if the stopping criterion, i.e. maximum number of iteration, is reached, stop.Otherwise return to step 2.
Following this algorithm, the best problem solution is represented by the global best at the end of iteration.The details of PSO can be found in several textbooks, among others are Kennedy and Eberhart [20] and Clerc [21].It is noted that this algorithm can be applied on various types of problems by defining how the particle represents the problem, which is usually called the solution representation, and how the particle can be translated into problem solution, which is usually called the decoding method.Therefore for applying PSO for TOPTW, we need to define the solution representation and the decoding method in the following subsections.

Solution Representation
Based on Ai et al. [19], the solution representation of TOPTW with vertices is particle with dimen-sions, in which each particle's dimension corresponds to each vertex, i.e. dimension 1 represents vertex 1, dimension 2 represents vertex 2, and so on.Particle position is assigned to be a real number and represents a priority of vertex on the decoding method.
The smaller the position of particle, the higher the priority of the corresponding vertex.Later on the decoding steps, each vertex is evaluated to be inserted into the solution paths based on its priority.

Decoding Methods
The decoding method starts with the conversion of particle position into priority of vertex.Then, the vertex is evaluated for possibility to be inserted into the paths, one by one according to the priority.The solution of TOPTW is created when all the vertices already evaluated.We are proposing two alternatives of evaluation procedure.The first alternative is a simpler procedure, in which a vertex is evaluated to be inserted in the last sequence of each path, starting from the first path.If the insertion complies with the vertex's time window and path duration constraint, then the vertex is placed on the sequence.Otherwise, the vertex is evaluated to be inserted to the subsequent path.If the vertex cannot be inserted to any available paths, it implies that the vertex is decided not to be visited.
In the second alternative, a vertex is evaluated to be inserted into all possible sequences in all existing paths.Finally, the vertex is being inserted into a sequence in certain path that satisfies all time windows and total duration constraints and provides the smallest additional time.Figures 2 and 3 illustrate the first and second evaluation procedure, respectively.Later on PSO algorithm for TOPTW with the first and second alternative of evaluation procedures are called PSO_TOPTW1 and PSO_ TOPTW2, respectively.
It is illustrated in Figure 2 for the first evaluation procedure that at this step vertex number 3 is evaluated to be inserted into the existing paths, in which currently the first path is 0 -4 -1 -0 and the second path is 0 -9 -0.The evaluation starts from the first path, in which the vertex number 3 is to be inserted in the last sequence of this path, i.e. the path become 0 -4 -1 -3 -0.The travel time between vertex 1 and 3 is then considered to obtain the actual starting service time at vertex 3 and total travel time.Since the actual starting service time of the first path is presented at Table 1, the emerging path is not feasible as it violates the time windows constraint of vertex 3. Therefore, the first path remains the same and the evaluation of second path, i.e. 0 -9 -3 -0 is needed.If this evaluation satisfies the time window and path duration constraint, then the path 2 is updated.Otherwise, vertex number 3 is decided not to be visited.
Figure 3 illustrates the second evaluation procedure for the same step as the first one.At first, three evaluations have to be evaluated, that are 0 -4 -3 -1 -0, 0 -4 -1 -3 -0, and 0 -9 -3 -0, to identify all possible feasible paths.Then, among feasible paths the additional time due to adding vertex number 3 is evaluated that illustrated in Table 2.In this case, finally the first path is updated into 0 -4 -3 -1 -0, since this alternative is feasible and has the smallest additional time.

Initialization
In the initialization step of PSO algorithm, only one particle is initialized by using special method described below, while the others are initialized with random position.The initial position of special particle, i.e. the first particle, is obtained from the vertex score using following equation: where are the prescribed value of minimum and maximum of particle's position, and is the score of vertex .By using this equation, vertex with higher score has the lower value of corresponding particle position value.As the consequence, the higher score vertex has a higher priority.The remaining particles are initialized with random positions by generating the position between the value of and .

Benchmark Data Instances
To conduct computational experiments, the existing TOPTW test instances data from previous researches, i.e.Righini and Salani [4], Montemanni and Gambardella [6], and Vansteenwegen et al. [2], are taken.A test instance describes a certain characteristic of TOPTW such as the number of vertices, the number of desired paths, maximum travel time ( ), and attributes of each vertex (coordinates, score, service time, time windows).These TOPTW instances are based on the Solomon [22] data instances of Vehicle Routing Problem with Time Windows, consisting of 100 vertices to be visited, and the Cordeau et al. [23] data instances of Multi Depot Vehicle Routing Problem, that ranges from 48 to 288 vertices to be visited.Righini and Salani [4] converted 48 Solomon's data instances into TOPTW instances called c10*, r10*, rc10* and 10 Cordeau's data instances into TOPTW instances called pr01-pr10.Montemanni and Gambardella [6] creates 37 TOPTW instances, 27 instances are converted from Solomon's data instances, which are called c20*, r20*, and rc20*, and the other instances are converted from Cordeau's instances, which are called pr11-pr20.Vansteenwegen et al. [2] also uses Solomon's and Cordeau's data instances and changes the number of paths in the problem.They also consider the optimal number of paths, in which the total collected score is the best among the other number of paths.
For comparison purpose, since the optimal solution for any TOPTW instances is not available, the result of the proposed method will be compared with the best known solution of each instances.In this paper, the best known solution is updated based on the result of Labadie [7] and Lin and Yu [9].

Experiment Setting
The proposed PSO algorithm for TOPTW, including the decoding methods and initialization procedure, are implemented using C# language and supported by PSO computational library called ET-Lib (Nguyen et al. [24]).It is noted that the ET-Lib uses a PSO variant called GLNPSO that has three different social behavior terms called global best, local best, and nearest neighbor best with its corresponding acceleration constant ( , , and ).
The main parameters of GLNPSO are taken from its user manual (Nguyen et al. [24]), that are , , , and .All the test instances are run on a computer with an Intel Pentium dual core 2.70 GHz CPU and 2 GB RAM.For each instance, 10 replications of the PSO algorithm runs are conducted.

Parameters Optimization
It is well known in the PSO literature that its parameters have an influence in the solution quality, so that these parameters need to be optimized.In this experiment, an optimization process is conducted to select the number of particles and the number of iterations in such a way that the algorithm is able to provide minimum average deviation from the best known solution at minimum computational time.Test instances c101 with 4 paths is used for the optimization process to evaluate the combination of 30, 50, 100, and 200 particles with 500, 1000, and 2000 iterations.The average deviation is calculated based on the deviation of each iterations, in which the deviation is defined as the difference between the total score of best known solution and the total score of PSO solution.
Empirically, the larger number of particles and number of iterations the better solution can be obtained by the algorithm.However, it is followed by the longer computational times.This experiment also confirms this statement, in which the best result is obtained from the combination of 200 particles and 2000 iterations with the longest computational time.For computational efficiency, we will determine combination of parameters that can provide result that is statistically similar with the result of combining 200 particles and 2000 iterations but with smallest computational time.It is found that combination of 100 particles and 1000 iterations is the preferred one.In addition, the result from combination of 30 particles and 1000 iterations only differs by 0.6% from the best result but significantly uses smaller computational time.Therefore, considering the efficiency of the computational time, both combinations (30 particles and 1000 iterations, 100 particles and 1000 iterations) are used for all test instances and both evaluation procedures inside the decoding method.

Computational Results
The PSO_TOPTW1 and PSO_TOPTW2 results are compared to the results from existing algorithms for TOPTW, which are Simulated Annealing (SSA and FSA) of Lin and Yu [9], Iterated Local Search (ILS)of Vansteenwegen et al. [2], LP-based GVNS (VNS) of Labadie et al. [8], Ant Colony System (ACO) of Montemanni and Gambardella [6], and GRASP-ELS of Labadie et al. [7].In particular the results of our proposed algorithm are categorized into 3 parts, namely PSO_TOPTW1_30_1000, PSO_TOPTW2 _30_1000, and PSO_TOPT W2_100_ 1000.The two numbers after the algorithm name indicate number of particles and number of iterations, respectively.Table 3, 4, and 5 shows the results of the TOPTW1_ 30_1000, TOPTW2_30_1000, and TOPTW2_100_ 1000.Results are grouped into the each instance data set c10*, r10*, c20*, r20*, rc20*, pr01-10, pr11-20.Columns I and II shows the number of paths and data sets used.Column III-V summarize the solution of respective group, in terms of the average (Avg.),standard deviation (S.D.), and minimum (Min.)percentage deviation of 10 PSO replications.The percentage deviation (dev) is calculated using formula 4, where fPSO is the total profit of PSO solution and fBKS is the total profit of the best known solution from existing algorithms for TOPTW.Column VI-VII show the average (Avg.)and standard deviation (S.D.) of computational time.(4) It is shown from Table 3 and 4 that the average percentage deviation of PSO_TOPTW1_30_1000 is bigger than PSO_TOPTW2_30_1000, while the computational time of PSO_TOPTW1_30_1000 is smaller than PSO_TOPTW2_30_1000.These results imply that the decoding process in PSO_TOPTW2, which is more complex than PSO_TOPTW1, can produce better solutions.Table 5 shows that increasing number of particles is able to yield smaller deviation but requires more computational effort, since the results from PSO_TOPTW2_100_1000 is better than the results from PSO_TOPTW2_ 30_1000 and the computational time of PSO_TOPT W2_100_1000 is bigger than the computational time of PSO_TOPTW2_30_1000.
In addition to the result presented in Tables 3-5, the TOPTW1_30_1000 is able to produce 11 solution of instances, among 304 instances used in the computational tests, reaching its corresponding best known solution.The TOPTW2_30_1000 is able to produce 74 solution of instances reaching its corresponding best known solution.The TOPTW2_100_1000 is able to produce 85 solution of instances reaching its corresponding best known solution.Combined all approaches together, the PSO algorithms in this research are able to produce 88 solution of instances that are similar with its corresponding best known solutions.Furthermore, the TOPTW2_100_1000 is able to provide 1 solution of instance that is outperform its corresponding best known solution.

Conclusion
This paper tries to solve the Team Orienteering Problem With Time Windows (TOPTW) by using Particle Swarm Optimization (PSO) algorithm.A specific particle is defined for representing the solution of TOPTW within the PSO algorithm, in which the particle can be translated into priority of vertices and later on the priority of vertices can be utilized to form the routes of the path.In this paper, there are two alternatives of method to form routes, which are called PSO_TOPTW1 and PSO_TOPTW2.PSO_TOPTW1 test the priority of each vertices in the last sequence of the route.Vertices will be placed on route if satisfy the time window and duration less than T_max, conversely, vertices tested on the next path.PSO_TOPTW2 is more complex.The priority of vertices is tested in every sequences of the route, starting from the last sequence.Vertices will be placed on the route if they satisfy time window and have the best time duration, conversely, vertices tested on the next path.
The result of program is divided into three parts, TOPTW1_30_1000, TOPTW2_30_1000, TOPTW2_ 100_1000, which distinguishes the alternative decoding method, the number of particles, and the number of iterations that used.TOPTW1_30_1000 has a biggest average percentage deviation smallest computational time, otherwise, TOPTW2_100_1000 has a smallest average percentage deviation and the biggest computational time.Overall, this research can produce 88 existing best known solutions and improve 1 best known solution.Comparison with other optimization method shows that the proposed method is good enough.
The authors believe that it is still possible to improve the performance of the proposed method.However, some further research is required, such as in the area of parameter optimization, decoding alternatives, hybridization of method, and computer programming implementation.Selection of PSO parameter may improve the performance of the algorithm.There are also room for improving the decoding methods.A modification in algorithm, like multi-swarm methods, or a combination with other optimization algorithm, like local search, can be conducted to get better result.The improvement should address also the issue of shortening the computational times of the proposed method via good computer programming implementation.Future research direction also open for applying the PSO for other orienteering problem variants, such as capacitated team orienteering problem.

Figure 1 .Figure 2 .
Figure 1.Solution representation of TOPTW of 10 vertices and its conversion to priority of vertex

Table 1 .
Starting service time of the illustrated path 1

Table 2 .
Feasibility checking and additional time evaluation

Table 3 .
Summarize of PSO_TOPTW1_30_1000 results

Table 4 .
Summarize of PSO_TOPTW2_30_1000 results

Table 5 .
Summarize of PSO_TOPTW2_100_1000 results