Implementation of Genetic Algorithm to Solve Travelling Salesman Problem with Time Window (TSP-TW) for Scheduling Tourist Destinations in Malang City

In doing travel to some destinantions, tourist certainly want to be able to visit many destinations with the optimal scheduling so that necessary in finding the best route and not wasting lots of time travel. Several studies have addressed the problem but does not consider other factor which is very important that is the operating hours of each destination or hereinafter referred as the time window. Genetic algorithm proved able to resolve this travelling salesman problem with time window constraints. Based on test results obtained solutions with the fitness value of 0,9856 at the time of generation of 800 and the other test result obtained solution with the fitness value of 0,9621 at the time of the combination CR=0,7 MR=0,3.


Introduction
Tourism is one of a growing field today. Along with the development of that, the majority of governments around the world have devoted time and energy to promoting tourism through nonprofit services [1]. One of the rapidly growing tourism is in Indonesia. Can be taken as an example one of the cities that Malang has become one of the best tourist destination in East Java that is favored by many people. Neither of the tourists who come from East Java, outside of East Java, to outside Java. Many travel treats in Malang, among others: family travel, educational travel, outbound travel, nature tours, historical tours to culinary tourism. It is used by the majority party provider of travel services to offer travel packages in the city of Malang. But unfortunately many tour packages offered ineffective because in a short time can not visit some tourist destinations with optimal so many tourists who choose to venture on their own tourist destinations. Ineffective means tourist doing travel based on travel route from travel services which is visit some destination not in the its operating hours.
In the other hand, some tourists think that by traveling independently can maximize travel destinations with optimal, but in fact as ineffective because tourists do not take into account the important things such as the distance between destinations as well as 2 JITeCS Volume 2, Number 1, 2017, pp 1-10 p-ISSN: 2540-9433; e-ISSN: 2540-9824 the operating hours of destinations. The operating hours can be a limitation in determining the optimal route of travel and hereinafter referred to as the time window. In doing trips to various tourist destinations, each destination must be visited exactly once and then back to the starting point [2] [3]. Problems like these can be modeled into a Travelling Salesman Problem (TSP). TSP is one combinatorial problem in the search for a solution can only be gained by trying some of the possibilities at random so that the computing time required is quite high [2].
This problem is very important and deserves to be resolved as the subject is not the only form of conventional TSP is always aiming to find the shortest distance, but also pay attention to the time window [3] [4]. There are several methods that can be applied in solving the TSP such as Method Campbell Dudeck Smith (CDS) [5], Ant Colony Optimization [6] [7] [8], and Genetic Algorithm (Genetic Algorithm) [

Related Research
Previous research has ever done and is closely related to the problems discussed namely concerning the scheduling of these travel destinations carried out by [5] and [9]. In the study [5] conducted by Saptaningtyas is the optimization in the management of attractions in the hope that does not happen traveler piling on the attraction by applying the method of Campbell Dudeck Smith (CDS). While the study [9] conducted a visit Attraction optimization by applying genetic algorithms. But optimizations like these two studies are less effective because there is no limit problems related to the operating hours of the tourist attraction. Several previous studies conducted to the discussion of the same but apply a different algorithm as in [8] and [6]. In their study, Dong et al. [8] solve problems by using the TSP Cooperative Genetic Ant System. They use two methods namely hybridization Ant Colony optimization algorithm and genetic algorithms. While Escario [6] conducted experiments Ant Colony Extended application of algorithms to solve the problems TSP. They claimed that there novelty comparison algorithm Ant Colony algorithm optimization in general. But the application of Ant Colony algorithm in both of these studies is still less than optimal. Due to the fact that these ants is "likely to" choose a short path in search of food but the path is not necessarily the best path.
Widodo and Mahmudy [2] conducted the research with similar problems, but there are some considerations as a limitation. The study discusses the culinary tourism recommendation system. The recommendations are not only aims to minimize the distance but also match the travel choice, taste suitability dining and travel time.
In a study with the same case study, Setiawan [9] try to provide solutions to optimization problems Attraction visit by applying genetic algorithms. Solutions offered by applying the genetic algorithm is considered quite high because of a genetic algorithm to try all the possibilities that exist to obtain the best solution. But there is a lack of such research that is only focused on finding the best route, do not consider the time limit operating hours of these destinations.
There are other studies conducted by Arnesen, et al [11] regarding the scheduling of several tankers in international trade lines anchored at several terminals at the same 3 p-ISSN: 2540-9433; e-ISSN: 2540-9824 port so that no clashes between the ship and the buildup of ships at the terminal, besides that there are times and conditions which is different for each boat to visit the terminal.
Suprayogi and Mahmudy [4] also conducted similar research on the pick-up laundry which has a goal to minimize the distance and also consider the time availability of its customers.
Based on several studies that have been done before, it can be said that the genetic algorithm is an optimization technique that is the most popular and proven to solve problems as complex as that applied to the Travelling Salesman Problem with Time Window for pick-bar [4], the system recommendations culinary tour [2] and the optimization of attraction visit [9]. With these considerations, the authors propose research on optimization TSP with limits on hours of operation as a time window for scheduling case study of tourist destinations in Malang using a genetic algorithm.

Travelling Salesman Problem (TSP)
TSP problems are the problems that exist in the various fields that aim to find the shortest route to expedite travel or minimize costs [6] [11] [12]. The concept of TSP itself is through the points that have been planned at the beginning of the right one, and finally back to the starting point [3]. One form an extension of the TSP problem is more complex in the presence of other variables. Another variable that can be referred to the total travel time, operating hours, time of delivery, time availability [4], service time and arrival time [11]. Such problems can then be referred to as TSP-TW [12].
In this study the concept of TSP-TW is meant is the existence of different operating hours for each destination. So that limits the operating hours to consider the best approach to get optimal solutions rather than just looking for the shortest path alone.
Here are 27 tourist destinations to be set up these travel route for 3 days, where in a day will be scheduled to 9 tourist destinations with the start point from Brawijaya University Malang.

Time Window
In this research there are additional variables to be parameters as limit in the TSP problem that is time window. Time window is meant their operating hours at each destination. For convenience, the author made a 9 time zone starting from 05.00 until 23.00 where each section has a time interval of 2 hours. Below is a table part of the time and also the penalty calculation based on time window.  The purpose of the penalty on the time window is a time traveler arrives destinations outside of operating hours. For example if a destination 6 namely Batu Night Spectacular scheduled on solutions to chromosome 3 2 5 4 1 7 6 9 8 ... 20, means the time that traveler arrives at the third time zone which is 09:00 to 11:00 while the operating hours of these destinations on sixth time zone. It is penalized by 6 because travelers have to wait from time of arrival to the destination operating hours.

Genetic Algorithm
Genetic algorithm is an algorithm to looking for that has a concept as a mechanism of natural selection and biological evolution [2] [3] [4] [13]. Form of the approach taken by the genetic algorithm is to accommodate a wide choice of solutions in a population to obtain selection of the best solution in certain generation with the best fitness values [12]. Fitness value is a value that represents the quality of a chromosome in the population [3] [13]. The main problems in the application of genetic algorithm is to represent a solution to the problem in the form of chromosomes [2]. For TSP problem in this study, the  Each gene in a chromosome above represents a tourist destination then if combined in one string chromosome sequence travel route. In one chromosome there are 27 genes that are divided into three segments. Each of the 9 genes into one segment shows the journey for a day.

5.1
Initialization Initialize the initial population. P (generation) randomly to determine the size of the population (popSize) first. In this study, the authors define popSize = 100. The size of popSize is obtained based on the results of previous studies that has been done by Priandani and Mahmudy [12].

5.2
Reproduction Phase reproduction carried out to produce offspring. In this study, the stage of reproduction using crossover and mutation. Crossover process used is a one-cut-point with 2 randomly selected parent. While the mutation process used is the insertion of genes shift in position as much as 1 to the left. In this mutation process only takes one parent at random. Here's an example of crossover and mutation process on a small scale.

Evaluation
Evaluation phase conducted to evaluate how well a chromosome. How the chromosomes assessment is to calculate the value of fitness. Value of fitness of this research is produced with the following formula :

Information ∑D = Total Distance Traveled ∑T = Total Travel Time ∑P = Total Penalty
The travel time is the time it takes to get to that destination. The travel time of course is directly proportional to the distance. The smaller the travel time, the closer the distance. In this study, a congestion while traveling is not calculated. Total distance traveled is the sum of the overall distance destinations visited are then added to the distance from the start point to the first destination and the distance from the start point to the final destination. While Penalty is a violation of any difference interval time traveler arrives at the destination and destination operating. So that the penalty should be multiplied by 60 to get the number of minutes that is proportional to the travel time.
In this section, P1 become a sample data that chosen by authors. Here is an example of manual calculations in P1 (travel route in a day) with chromosome →11 14 7 22 5 8 3 26 9.  The results of manual calculations previously incorporated into the formula to get the fitness value.

Selection
This selection phase is the phase to select the best chromosome number popSize. The selection method used in this research is the replacement. The workings of the selection method of replacement is every child chromosome of result of reproductive and its fitness value is better than the fitness value of the parent, then the child will replace the parent in the next generation [3].

Testing Scenario
Based on the backgrounds, authors wants to optimize scheduling travel route some destinations in Malang City. To get the best travel route, we have to take the best components in genetic algorithm. So the optimal solution is generated with the best fitness value. The components in genetic algortihm includes the number of generation and the combination of reproduction operator. We can also do testing to get the best number of population, but in this study did not do the test because it has taken the best measure based on previous research. So, the authors conducted two testing scenario which is as follows: a. Generation testing with a multiple of 100 from 100 to 1000, popSize = 100, Crossover Rate (CR) = 0.5 and Mutation Rate (MR) = 0.5. In each test will be 10 times testing. Fitness value of each generation is an average of 10 times testing. The goal is to get a generation with the best fitness value. b. Test the combination of CR and MR between 0 to 1 by iterating the number of generations as much as 100. In each test will be 10 times testing. The goal is to get a combination of CR and MR with the best fitness value. In testing, the authors made 11 combinations of CR and MR as follows:

Conclusion
Based on test results, it was concluded as follows: a. The number of generation with the best fitness value is 800. b. The combination of CR and MR that produces the best fitness value is 8th combination with CR = 0.7 and MR = 0.3.