Itinerary Recommendation Generation Using Enhanced Simulated Annealing Algorithm PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Available online at www.sciencedirect.

com

ScienceDirect
Available online at www.sciencedirect.com
Procedia Computer Science 00 (2019) 000–000
www.elsevier.com/locate/procedia
ScienceDirect
Procedia Computer Science 157 (2019) 605–612

4th International Conference on Computer Science and Computational Intelligence 2019


(ICCSCI), 12–13 September 2019

Itinerary Recommendation Generation using Enhanced Simulated


Annealing Algorithm
Novita Hanafiaha,*, Indra Wijayaa, Steffan Xaviera, Choandrio Grolyus Younga, Dennise
Adriantoa, Muhsin Shodiqa
a
Computer Science Department, School of Computer Science, Bina Nusantara University, Jakarta, Indonesia 11480

Abstract

The trend of traveling has increased in recent years along with the easy access to information. Travelers create the itinerary before
they are travelling to an area. However, creating itinerary is not easy, many factors need to be considered before deciding where to
go, such as the “must visited” places in that area, distance between tourist attractions to be visited within a day, preferred tourist
attractions, and other information about the places. Generating the optimized distance itinerary is similar as a Traveling Salesman
Problem (TSP). The purpose of this research is to study the combination of simulated annealing and Greedy algorithms to create
an itinerary. The initialization process of the simulated annealing algorithm uses Greedy algorithm searching technique and then
proceeded with existing optimization step in simulated annealing method. This paper proposed a method of enhanced simulated
annealing algorithm and the experiment results show the enhanced simulated annealing increase the effectiveness of simulated
annealing algorithm which produce the shortest distance needed to travel places around an area.
© 2019
© 2019 The
The Authors.
Authors. Published
Published by
by Elsevier
Elsevier B.V.
B.V.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Peer-review under responsibility of the scientific committee of the 4th International Conference on Computer Science and
Peer-review
Computationalunder responsibility
Intelligence 2019. of the scientific committee of the 4th International Conference on Computer Science and
Computational Intelligence 2019
Keywords: Travel plan; Greedy algorithm; Simulated annealing; Itinerary generator;

* Corresponding author.
E-mail address: nhanafiah@binus.edu

1877-0509 © 2019 The Authors. Published by Elsevier B.V.


This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Peer-review under responsibility of the scientific committee of the 4th International Conference on Computer Science and Computational
Intelligence 2019

1877-0509 © 2019 The Authors. Published by Elsevier B.V.


This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Peer-review under responsibility of the scientific committee of the 4th International Conference on Computer Science and Computational
Intelligence 2019.
10.1016/j.procs.2019.09.020
606 Novita Hanafiah et al. / Procedia Computer Science 157 (2019) 605–612
2 Novita Hanafiah et al. / Procedia Computer Science 00 (2019) 000–000

1. Introduction

The trend of travelling has been increasing in the recent years. The availability of transportation and current lifestyle
support traveling both international and domestic. Even though people have never been to a place they want to visit,
they don't need to worry because technological advancements has allowed them to find information easily. Typically,
people plan trips before they go to certain place, this plan is called itinerary. However, making itinerary is not easy,
due many factors needed to be considered before deciding where to go, such as the “must visited” places in that area,
distance between tourist attractions to be visited within a day, preferred tourist attractions, and other information about
the places. More time and effort to gather information about the places will be needed to create an itinerary from a
place that has never been visited and reviewed by other travelers.
In the travel itinerary planer field, there are several research that have been conducted on itinerary generation
problem. Generating itinerary is a challenge, Li et al. 1 studied the itinerary problem to aim the lowest cost for travelers
visiting multiple cities with the consideration of the transport alternative, transport’s time schedule, and ticket prices.
They formulated the problem into 0-1 integer programming model and create the application integrated with the web
crawler to collect the public transport data and time schedule.
Meanwhile, De Choudhury et al. 2 generate the itinerary using geo-temporal breadcrumbs. The information is
leveraged from photos and locations shared by people in the social media. They concluded that the solution for the
itinerary problem is to generate per-user timed paths using geo-temporal attributes of each photo, aggregates those
paths into a graph, and computes an approximate solution to a variant of the Orienteering problem to construct
itineraries. Extensive user studies that evaluated the quality of the resulting itineraries yielded promising results. To
the best of their knowledge, this is the first end-to-end work that leverages geo-temporal breadcrumbs to build travel
itineraries.
Other itinerary generator is created by Yoon et al. 3 based on the user generated GPS trajectories. Generating the
optimized distance itinerary can be mapped as a Traveling Salesman Problem (TSP), which will return to the same
location after visiting several places. “Branch and bound” algorithm 4 was used to solve TSP by breaking the set of
feasibility solution into small subsets. A distributed algorithm called Ant Colony System was used by Dorigo et al. 5
to find a good solution for TSP, and the results showed that the algorithm outperformed other algorithms like simulated
annealing and evolutionary computation.
Geng et al. 6 proposed an effective local search algorithm based on simulated annealing and greedy search
techniques to solve the TSP. In the research, they used algorithm based on standard simulated annealing algorithm and
adopted the combination of three kinds of mutations with different probabilities during its search. After that, the greedy
search technique was used to speed up the convergence rate of the proposed algorithm. Their result showed that the
proposed algorithm provides better compromise between CPU time and accuracy among some recent algorithms for
the TSP.
Simulated annealing algorithm is often used to solve the location-routing problem. Ferreira and Queiroz 7 presented
effective simulated annealing algorithm for location-routing problem which combined with Greedy algorithm for
initial phase and improved the result by using Lin-Kernighan heuristic. In their research, they developed the
combination of the two heuristics based on the simulated annealing method with a diversification procedure to solve
the Location-Routing Problem in its capacitated version or CLRP (Capacitated Location Routing Problem).
In other research, Yu and Lin 8 also used simulated annealing to minimize operation cost, vehicle cost and traveling
cost. In their paper, Yu and Lin introduced the open location-routing problem (OLRP) as a variant of the capacitated
location-routing problem (CLRP). OLRP emerged due to the rise of contracting with third-party logistic (TPL)
companies and is different from CLRP in that vehicles do not return to the distribution center after servicing all
customers. The computational results indicated that they solved OLRP using a simulated annealing (SA)-based
heuristic and tested it on OLRP instances that have been adopted from three sets of well-known CLRP benchmark
instances with up to 318 customers and 4 potential depots.
Another modification for simulated annealing algorithm 9 was also used for small unmanned aerial vehicle planning
which considered as multiple TSP and tested using flight simulator.
The simulated annealing algorithm starts with an initialization process which is usually done randomly from all
existing destinations. The purpose of this research is to study the combination of simulated annealing and Greedy
algorithms to create an itinerary. The initialization process of the simulated annealing algorithm uses Greedy algorithm
Novita Hanafiah et al. / Procedia Computer Science 157 (2019) 605–612 607
Novita Hanafiah et al. / Procedia Computer Science 00 (2019) 000–000 3

searching technique and then proceeded with existing optimization step in simulated annealing method. Greedy
algorithm has a low complexity, hence it does not have a significant impact on computing time. This paper proposed
a method of enhanced simulated annealing algorithm to produce effective trip plans.

2. Candidate places generation

There are many kinds of activities arranged in an itinerary, but we conclude that it always has one main activity,
which is eating. The itinerary designed for a day is shown in table 1. We divide the activities into 4 categories, which
are Food, Market, Scenery and Attraction. Food category has collection of food places, Market category has collection
of shopping places, Scenery category for places promised with good landscape and Attraction category is usually for
tourist places. All places’ information are gathered from Google Maps API. Some data are provided from Google
Maps API Find Place, which are: formatted address, geometry, icon, id, name, photos, place id, plus code, scope,
types, user rating total, opening hours, price level, and rating. Place id is then leveraged in the next step to find the
place detail.

Table 1. Order of the Ideal Travel Plan Category.


Index Category
1 Start Point
2 Food
3 Food/Market/Scenery/Attraction
4 Food/Market/Scenery/Attraction
5 Food
6 Food/Market/Scenery/Attraction
7 Food/Market/Scenery/Attraction
8 Food
9 Food/Market/Scenery/Attraction

The collected lists of places can be used to generate our itinerary, but sometimes, there are some places that do not
meet the criteria because the places were filled into Google Maps based on users input. For example, there is a point
in a map which is a gathering place for a group or activist to carry out group activities, so that it is not relevant to be
a destination for traveler. To avoid the case, two methods were used to minimize the possibility of selecting irrelevant
places into the itinerary. First, the data are filtered by the plus code attribute. The plus code attribute is a coded location
reference, derived from longitude and latitude coordinates to represent the area. Based on experiments, irrelevant
places have almost no plus code when a Nearby Search API is called. Therefore, for every place that does not have a
plus code, it will not be entered to the itinerary. Second, the data are sorted, and the order is based on the highest to
lowest rating attribute. The rating is based on Google Maps user reviews who have visited the place, hence, this
location sorting can be obtained with the location that has the best rating attribute among others. Before the places are
included into the travel schedule, the places have been checked with our premium list which has been collected
manually. Places categorized as premium is a landmark or “must see” places of the area.

3. Travel routes generation

From several list of locations obtained through the Nearby Search API Google Maps and filtered with premium
list, nine destination locations were taken including the starting point of the trip (as shown in table 1). The nine
locations were taken with the aim of fulfilling the sequence and criteria of the trip that begins with the starting point
of the trip, then continued with a place for breakfast. The third and fourth order can be filled by any location and
continued with a place for lunch. After lunch, the sixth and seventh sequences can be filled by any location and
followed by a place for dinner, and one more location that can be filled with any activities. Next step is measuring the
distance between the selected locations to find the effective route which has the minimum distance value. Greedy
608 Novita Hanafiah et al. / Procedia Computer Science 157 (2019) 605–612
4 Novita Hanafiah et al. / Procedia Computer Science 00 (2019) 000–000

algorithm and Simulated annealing algorithm were used in this experiment, and we also adopted the simulated
annealing algorithm using Greedy search for the initial process. Table 2 shows example of location list in Singkawang
area and the distance matrix gathered from Google Map API is presented in table 3.

Table 2. List Location Sample.

No Place Category
0 Swiss-Belinn Singkawang Start Point
1 Bakso Mi-mi Food
2 Waroeng Kita Food
3 Rujak Angok Food
4 Rumah Makan Awam Food
5 Pasar Hongkong Market
6 Singkawang Cultural Center Scenery
7 Batu Belimbing Attraction
8 Waterboom Gunung Poteng Attraction

Table 3. Distance Matrix Between the Locations.

Matrix Distance (meter)

0 1 2 3 4 5 6 7 8

0 -1 2979 3548 3221 3566 4084 3140 13110 9848

1 2979 -1 4899 5148 5410 5706 5442 14732 11470

2 3548 4899 -1 1223 761 1073 1497 10098 6836

3 3221 5148 1223 -1 760 1042 688 10067 6806

4 3566 5410 761 760 -1 630 1055 9656 6394

5 4084 5706 1073 1042 630 -1 836 9437 6175

6 3140 5442 1497 688 1055 836 -1 9970 6708

7 13110 14732 10098 10067 9656 9437 9970 -1 3262

8 9848 11470 6836 6806 6394 6175 6708 3262 -1

3.1. Greedy Algorithm

There is a difference between Greedy algorithms with mark for the case of Traveling Salesman Problems and
creating travel plans. In TSP case, the algorithm does not check the type of location to be visited based on the order
and calculate the distance to return to the starting point. Meanwhile in itinerary generation case, the algorithm is
modified to adjust the order of destination, especially in the category of eating and not considering the distance to
return to the starting point. The Greedy algorithm is used as the following:
1. Looping up to the number of cities in the itinerary has been equal to the number of cities that are on the list to
be visited.
2. If the number of cities visited is still empty, it will be filled with the starting point entered by the user.
3. Ensure that if the place has been visited, it will not be visited again.
4. If the current order is in positions 1, 4 or 7 (indicating breakfast, lunch and dinner) then make sure that it can
only be filled by places to eat.
5. In filling other destinations, ensure that there are still places to eat left to be able to fill positions 4 or 7.
Novita Hanafiah et al. / Procedia Computer Science 157 (2019) 605–612 609
Novita Hanafiah et al. / Procedia Computer Science 00 (2019) 000–000 5

Table 4. Itinerary Result Based on Greedy Algorithm.

Index Name Category Distance (meter)


0 Swiss-Belinn Singkawang Start Point
1 Bakso Mi-mi Food 2979
2 Waroeng Kita Food 4899
3 Pasar Hongkong Market 1079
4 Rumah Makan Awam Food 630
5 Singkawang Cultural Center Scenery 1055
6 Waterboom Gunung Poteng Attraction 6708
7 Rujak Angok Food 6806
8 Batu Belimbing Attraction 10067
Total Distance 34223

3.2. Simulated Annealing

There is an additional step in the implementation of the Simulated Annealing algorithm for creating travel plans.
In the exchange process between one location and another location, it must be ensured that the initial location cannot
be exchanged and the location which is a place to eat must be exchanged for locations that are also places to eat. The
following is a simple idea that underlies the modification of Simulated Annealing algorithm:
1. Perform the initialization step by entering the destination on the list into the itinerary one by one.
2. Fill in the values of the temperature and cooling rate parameters.
3. Repeat if the temperature value is still greater than 1.
4. In loop number 3, 2 destinations are randomly exchanged in the itinerary. If the distance traveled is shorter,
the exchange will be accepted. But if exchanges generate much greater distances then it will search probability
of acceptance.
5. At the time of the exchange, check should the place being exchanged is the starting point, then the exchange
will be canceled.
6. If the place exchanged is a place with an index of 1, 4 or 7 then a check is made to ensure that the place is
exchanged for a place to eat.

Table 5. Itinerary Results Based on Simulated Annealing Algoritm.


Index Name Category Distance (meter)
0 Swiss-Belinn Singkawang Start Point
1 Bakso Mi-mi Food 2979
2 Waterboom Gunung Poteng Attraction 11470
3 Batu Belimbing Attraction 3262
4 Rujak Angok Food 10067
5 Singkawang Cultural Center Scenery 688
6 Pasar Hongkong Market 836
7 Waroeng Kita Food 1073
8 Rumah Makan Awam Food 761
Total distance 31136

After the initialization stage, the algorithm will enter the loop which is limited by the value of temperature.
Temperature will decrease further with a cooling rate multiplier until the value is not greater than 1. Every initial
iteration, the itinerary list will be copied exactly to the new itinerary list to be exchanged between 2 random
610 Novita Hanafiah et al. / Procedia Computer Science 157 (2019) 605–612
6 Novita Hanafiah et al. / Procedia Computer Science 00 (2019) 000–000

destinations which are candidates for the new itinerary. If between 2 destinations exchanged is index 0 (starting point
of travel), it will be marked to be ignored because the starting point cannot be exchanged for another position. Besides
checking index 0, checking is also done if the index exchanged is index 1, 4 or 7. It must also be exchanged for
destinations that have the type as Food, because the index is intended as a place to eat (breakfast, lunch, and dinner).
If the destination exchanged is not a place to eat, it will be marked to be ignored and continue to the next iteration.
Every time you go to the next iteration, the temperature value will decrease because it is multiplied by (1 - cooling
rate).
If the exchange process between destinations meets the criteria, then the exchange of 2 destinations in the new
itinerary list will then be compared between the overall distance from the new itinerary list (stored in New Energy)
with the itinerary list (stored in Current Energy). Initially the acceptance probability value is filled with 1, indicating
that the new itinerary list will be accepted as the current itinerary replacing the previous one, with the certainty that
New Energy is smaller than Current Energy (the total overall distance of the new itinerary is smaller than the total
distance of the entire itinerary). But if the value of New Energy is greater than Current Energy (the total overall
distance of the new itinerary is greater than the total distance of the entire itinerary) then the acceptance probability
value is calculated using the following formula:
������������� � ���������
��������������������� = � ����������� (1)

The acceptance probability value is compared with random values from 0 to 1. If the acceptance probability value
is greater than the random value, the algorithm will receive the new itinerary list as the current itinerary. Then a
comparison is made between the distance of the whole itinerary and the distance of the whole best itinerary to store
the itinerary which has the shortest overall distance into the best itinerary list. After leaving the loop (temperature is
not above 1), the itinerary will be filled by best itinerary which is the sequence of trips with the shortest distance based
on the process that has been passed.

3.3. Enhanced Simulated Annealing

In section 3.2, the Simulated Annealing algorithm begins with the initialization stage by entering the destinations
listed in the itinerary one by one. This process can be replaced by using the Greedy algorithm in section 3.1. The
following is the idea of enhanced simulated annealing algorithm:
1. Perform the itinerary initialization stage with the Greedy algorithm.
2. Calling the Simulated Annealing algorithm procedure to process the itinerary results from the Greedy algorithm.

Table 6. Itinerary Results Based on Enhanced Simulated Annealing Algorithm.

Index Name Category Distance (meter)


0 Swiss-Belinn Singkawang Start Point
1 Bakso Mi-mi Food 2979
2 Batu Belimbing Attraction 14732
3 Waterboom Gunung Poteng Attraction 3262
4 Rumah Makan Awam Food 6394
5 Pasar Hongkong Market 630
6 Singkawang Cultural Center Scenery 836
7 Rujak Angok Food 688
8 Waroeng Kita Food 1223
Total distance 30744

There are differences that we do compared to the technique in paper 8. In their research, it changes the reception
process of the simulated annealing algorithm when the new solution is no better than the previous solution, and at the
Novita Hanafiah et al. / Procedia Computer Science 157 (2019) 605–612 611
Novita Hanafiah et al. / Procedia Computer Science 00 (2019) 000–000 7

initialization stage it is still done randomly. As for the paper we are working on, we replace this initialization process
using the results of the greedy algorithm at that time. This is also similar to paper 6, where the generation of initial
solution using a greedy procedure. However, that research focuses on solving the case of Location-Routing Problems
(where the factors considered besides the route are vehicle capacity, facility, customer allocation, etc.). Whereas in
the paper we are working on, the focus is on the formation of the shortest route by considering the order of categories
of tourist places at a particular index (especially places to eat) with the aim that prospective travelers can make ideal
travel trips including hours of meal.

4. Experiment Results

Table 7 shows the comparison of total distance generated by algorithms applied. Comparison of the total distance
is done for Singkawang, Jakarta and Bangka area.

Table 7. Comparison of Travel Plan Total Distance Produced.

Total Distance (meter)


Case
Greedy Simulated Annealing Enhanced Simulated Annealing
1 34223 31136 30744
2 63111 54183 50941
3 65916 58390 57557

The experiment in these three areas shows that Enhanced Simulated Annealing algorithm generates effective
itinerary with the shortest distance, compared with Greedy algorithm and Simulated Annealing algorithm. The
efficiency percentage of the enhanced simulated annealing algorithm compared to other algorithms is calculated by
using formula (2) and the results are presented in table 8. It is shown that the use of Greedy search techniques has
improved the algorithm results to provide the shortest distance to travel over places.

Efficiency (%) = (a – Enhanced simulated annealing distance) / a * 100% (2)

Where a is a distance of Greedy algorithm result to calculate the efficiency compared to Greedy algorithm, or a is
a distance of Simulated annealing algorithm result to calculate efficiency compared to Simulated annealing algorithm.

Table 8. Enhanced Simulated Annealing Efficiency Percentage.

Enhanced Simulated Annealing Efficiency Percentage


Case
Greedy Simulated Annealing
1 10.17 % 1.26 %
2 19.28 % 5.98%
3 12.68% 1.43%

5. Conclusion

This paper proposed an algorithm called enhanced simulated annealing which is a combination of the greedy
algorithm and simulated annealing to determine the order of itinerary destinations with the shortest path. Based on the
experiment of several cases, enhanced simulated annealing algorithms produced a sequence of itinerary destinations
with the shortest total distance compared to the cases that use only the Greedy algorithm or the cases that use only the
simulated annealing algorithm. For further development, next research can be conducted varied with different
temperature and cooling rate parameters to obtain minimal complexity but still maintain the probability of getting the
most optimal solution.
612 Novita Hanafiah et al. / Procedia Computer Science 157 (2019) 605–612
8 Novita Hanafiah et al. / Procedia Computer Science 00 (2019) 000–000

References

1. Li X, Zhou J, Zhao X. Travel itinerary problem. Transportation Research Part B: Methodological 2016; 91:332-343.
2. De Choudhury M, Feldman M, Amer-Yahia S, Golbandi N, Lempel R, Yu C. Automatic construction of travel itineraries using social
breadcrumbs. Proceedings of the 21st ACM conference on Hypertext and hypermedia 2010; 34-44.
3. Yoon H, Zheng Y, Xie X, Woo W. Smart itinerary recommendation based on user-generated GPS trajectories. In International Conference on
Ubiquitous Intelligence and Computing 2010; 19-34.
4. Little JDC, Murty KG, Sweeney DW, Karel C. An algorithm for the traveling salesman problem. Operations research 1963;11(6):972-989.
5. Dorigo M, Gambardella LM. Ant colonies for the travelling salesman problem. Biosystems 1997;43 (2): 73-81.
6. Geng X, Chen Z, Yang W, Shi D, Zhao K. Solving the traveling salesman problem based on an adaptive simulated annealing algorithm with
greedy search. Applied Soft Computing 2011;11 (4): 3680-3689.
7. Ferreira KM, Queiroz TA. Two effective simulated annealing algorithms for the location-routing problem. Applied Soft Computing 2018;70:
389-422.
8. Yu VF, Lin SY. A simulated annealing heuristic for the open location-routing problem. Computers & Operations Research 2015;62: 184-196.
9. Behnck LP, Doering D, Pereira CE, Rettberg A. A Modified Simulated Annealing Algorithm for SUAVs Path Planning. IFAC-PapersOnLine
2015;48 (10): 63-68.

You might also like