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

Transportation Research Part B 91 (2016) 332–343

Contents lists available at ScienceDirect

Transportation Research Part B


journal homepage: www.elsevier.com/locate/trb

Travel itinerary problem


Xiang Li a,∗, Jiandong Zhou a, Xiande Zhao b
a
School of Economics and Management, Beijing University of Chemical Technology, Beijing 100029, China
b
China Europe International Business School (CEIBS), Pudong, Shanghai 201206, China

a r t i c l e i n f o a b s t r a c t

Keywords: In this study, we propose a travel itinerary problem (TIP) which aims to find itineraries
Travel itinerary problem with the lowest cost for travelers visiting multiple cities, under the constraints of time
Implicit enumeration algorithm
horizon, stop times at cities and transport alternatives with fixed departure times, arrival
Smart travel
times, and ticket prices. First, we formulate the TIP into a 0–1 integer programming model.
Then, we decompose the itinerary optimization into a macroscopic tour (i.e., visiting se-
quence between cities) selection process and a microscopic number (i.e., flight number,
train number for each piece of movement) selection process, and use an implicit enumer-
ation algorithm to solve the optimal combination of tour and numbers. By integrating the
itinerary optimization approach and Web crawler technology, we develop a smart travel
system that is able to capture online transport data and recommend the optimal itinerary
that satisfies travelers’ preferences in departure time, arrival time, cabin class, and trans-
port mode. Finally, we present case studies based on real-life transport data to illustrate
the usefulness of itinerary optimization for minimizing travel cost, the computational effi-
ciency of the implicit enumeration algorithm, and the feasibility of the smart travel system.
© 2016 Elsevier Ltd. All rights reserved.

1. Introduction

Travel is defined here as the movement of people between relatively distant places; it generally includes short stays
between successive movements. Traditional travel decision-making problems use route choice behavior analysis (Iida
et al., 1992), travel forecasting (Bar-Gera and Boyce, 2003), air-travel itinerary share (Koppelman et al., 2008), intersec-
tion movement-based dynamic route choice (Long et al., 2013), walk-ride itinerary optimization (Jonge and Teunter, 2013),
among others. In the era of big data, however, there exists an emerging demand for smart travel: a traveler plans to depart
from an origin city, visit n intermediate cities, and arrive at a destination city within a predetermined time horizon. First,
the traveler determines the tour, i.e., the visiting sequence among intermediate cities. Second, he/she makes sound deci-
sions about the transport modes and numbers for each section of the itinerary. During this process, the departure times and
arrival times associated with transport alternatives and stop times at intermediate cities must be considered to ensure the
feasibility and continuity of travel. The travel itinerary problem (TIP), which finds itineraries with the lowest travel cost, is
extremely attractive to such travelers but difficult to solve. First, there is the need for a comprehensive optimization model
to cover all of the constraints and objectives. Second, there is the need for designing a powerful algorithm to compare the
numerous potential itineraries. To the best of our knowledge, no study has provided these tools.


Corresponding author.
E-mail address: lixiang@mail.buct.edu.cn (X. Li).

http://dx.doi.org/10.1016/j.trb.2016.05.013
0191-2615/© 2016 Elsevier Ltd. All rights reserved.
X. Li et al. / Transportation Research Part B 91 (2016) 332–343 333

The TIP has its roots in the traveling salesman problem (TSP), which can be simply stated as follows: given a collection
of cities, find the lowest cost tour that visits each city exactly once and returns to the starting point. Compared with the
TSP, the TIP has some special constraints. First, for each pair of cities, there are regular transport modes and numbers, and
each transport alternative has a fixed departure time, arrival time, and ticket price. Second, there is a minimum stop time
at each intermediate city. Third, the traveler must plan his/her journey within a time horizon. Although TSP variants and
generalizations have been studied quite extensively (a vast collection of resources and information can be found at http:
//www.math.uwaterloo.ca/tsp/), including TSP with time windows (Dumas et al., 1995), TSP with deadlines (Campbell and
Thomas, 2008), TSP with interval values on travel time (Montemanni et al., 2007), TSP with stochastic travel time (Toriello
et al., 2014), TSP with time-dependent travel cost (Cordeau et al., 2014), and so on, restrictions on transport alternatives, stop
time at cities, and time horizon have never been investigated. In this study, we consider all of these issues, and formulate
the TIP into a 0–1 integer programming problem, which is proved to be a new extension of the TSP.
The NP-hard TSP (Garey and Johnson, 1979) has been more widely studied than other combinatorial optimization prob-
lems, as it is so intuitive and suitable (Hill, 1982) for formulating various practical issues, such as the order-picking problem
(Ratliff and Rosenthal, 1983), school bus scheduling problem (Graham and Nuttle, 1986), mailbox collection route choice
(Laporte et al., 1989), split-demand capacitated vehicle routing problem (Salazar-Gonzlez and Santos-Hernndez, 2015), and
so on. (Khanra et al., 2015) considered a profit maximization problem with crisp expenditure and return, and handled the
stop time at each city as the decision variable. In the TIP we proposed in this study, the stop times at each city are given
as constant values according to the users’ demands. The TIP aims to report the optimal route and tour selection strat-
egy which forms the best travel itinerary for users. Smith and Thompson (1977) introduced a LIFO implicit enumeration
search algorithm for the symmetric traveling salesman problem. Balas and Christofides (1981) solved the TSP by proposing a
restricted Lagrangean approach. Crowder and Padberg (1980) presented cutting-plane methods for solving large-scale sym-
metric traveling salesman problems to optimality. Johnson and McGeoch (1997) surveyed a wide range of algorithms that
run the gamut from implicit enumeration, through local search, simulated annealing, tabu search, and genetic algorithms to
neural networks. For small-scale problems, the implicit enumeration algorithm has good performances for both optimality
and computation time. For large-scale problems, heuristic algorithms are used to select optimal solutions among all of the
possible ones, but they do not guarantee that the best solution will be found. As the scale of the TIP is generally small
(almost no traveler plans to visit dozens of cities at one time), in our work we use the implicit enumeration algorithm is
used to find the global optimal itinerary in this study.
Big data is one of the key factors driving the evolution of traditional travel into smart travel, which fuels an unprece-
dented demand for the study of the TIP. With the advent of big data, travelers have the opportunity to improve their travel
by effectively using smart phones and other mobile terminals. If we can capture the online transport data and solve the TIP
quickly, we can help travelers reduce travel expense and save planning time. In this study, we explore a smart travel system
that integrates the data collecting, data processing, and itinerary optimization procedures.
This study of the TIP makes three contributions. First, it boosts the development of the tourism industry by bridging the
gap between travel demand and supply in the era of big data, by extending the proposed smart travel system to different
kinds of travel decision support systems on both websites and mobile applications. Second, the TIP meets users’ personalized
travel requirements, and is able to significantly reduce costs in a convenient way. Website and mobile applications inspired
by the TIP can enrich travel options and ensure efficient travel itineraries by developing user-friendly interactive interfaces
based on effective optimization methodologies. Third, the big data constantly generated by various TIP-related applications
will definitely improve smart travel planning, tourism promotion operations, tourism management, among other aspects of
the tourism industry.
The rest of this paper is organized as follows. Section 2 formulates the TIP into a 0–1 integer programming model, and
decomposes the itinerary optimization into a tour selection process and a number selection process. Section 3 designs an
implicit enumeration algorithm to find the optimal combination of tour and numbers. Section 4 proposes a smart travel
system by integrating the data collecting, data processing, and itinerary optimization procedures. Case studies based on
real-life data are presented in Section 5. At the end of this paper, a brief summary is given.

2. TIP model

Suppose that a traveler plans to depart from an origin city 0, visit a set of intermediate cities 1, 2, , n, and finally
arrive at a destination city n + 1. The objective is to minimize the travel costs under the following constraints:

• there are regular transport modes and numbers linking each pair of cities, and each transport alternative has a fixed
departure time, arrival time and ticket price (although the ticket prices may vary as the discount policies change, we
assume that they are unchanged during the optimization process);
• each intermediate city is visited exactly once;
• there is a minimum length of stop at each intermediate city, denoted by si ; and
• there is a fixed time horizon for the travel, with the start time denoted by T and the end time denoted by T .

Remark 2.1. It is possible that the origin city coincides with the destination city; for example, the traveler may start and
end in his/her home city. In this case, we consider them two different cities: the origin city and the destination city.
334 X. Li et al. / Transportation Research Part B 91 (2016) 332–343

For any i, j = 0, 1, . . . , n + 1, we use {(ci jk , di jk , ai jk ) | k = 1, 2, . . . , Ii j } to denote the collection of transport alternatives


from city i to city j, where cijk stands for the ticket price, dijk denotes the departure time from city i, aijk denotes the arrival
time to city j, and Iij is the total number of transport alternatives linking city i and city j. Obviously, we have aijk > dijk .
Here we assume that Iii = 0 for all i = 0, 1, . . . , n + 1. Let xijk be a binary decision variable that takes the value 1 if and only
if the kth transport alternative from city i to city j is used. Denote the decision vector as x = {xi jk | i, j = 0, 1, . . . , n + 1, k =
1, 2, . . . , Ii j }.
For each decision vector x, the travel cost from city i to city j using transport alternative k is cijk xijk , and the total travel
cost for all of the sections of the itinerary between the origin city, intermediate cities, and destination city is

n+1  Ii j
n+1 

ci jk xi jk . (2.1)
i=0 j=0 k=1

Now we consider the constraints for ensuring the feasibility and continuity of x. First, the departure time from the origin
city 0 must be greater than or equal to the start time T, i.e.,

I0 j
n+1 

d0 jk x0 jk ≥ T . (2.2)
j=1 k=1

Second, the stop time at each intermediate city i must be greater than or equal to the minimum amount si , that is,

Ii j
n+1  I ji
 
n 
di jk xi jk − a jik x jik ≥ si , i = 1, 2, . . . , n. (2.3)
j=1 k=1 j=0 k=1

In the left side, the first term denotes the departure time from city i and the second term denotes the arrival time at city i.
Third, the arrival time at the destination city n + 1 must be less than or equal to the end time T , i.e.,

n Ii
 (n+1 )

ai(n+1)k xi(n+1)k ≤ T . (2.4)


i=0 k=1

In what follows (2.2), (2.3), and (2.4) are called the time constraints. Next, to ensure that each intermediate city is visited
exactly once, we have the following degree constraints

Ii j
n+1  Ii j
 
n 
xi jk = 1, i = 1, 2, . . . , n, xi jk = 1, j = 1, 2, . . . , n. (2.5)
j=1 k=1 i=0 k=1

As there is no trip arriving at the origin city 0 or departing from the destination city n + 1, we separately list the degree
constraints for the origin city as

I0 j
n+1  n+1 
  Ii0
x0 jk = 1, xi0k = 0, (2.6)
j=1 k=1 i=1 k=1

and the degree constraints for the destination city as

n Ii
 (n+1 ) n I(
 n+1 ) j

xi(n+1)k = 1, x(n+1) jk = 0. (2.7)


i=0 k=1 j=0 k=1

Finally, the integrality constraints restrict that all of the decision variables are binary, that is, xijk ∈ {0, 1} for all k = 1, 2, . . . , Ii j
and i, j = 0, 1, . . . , n + 1.

Remark 2.2. In the case where the origin city and the destination city coincide, the degree constraints (2.6) and (2.7) are
still consistent if we consider them as two different cities.
X. Li et al. / Transportation Research Part B 91 (2016) 332–343 335

Based on the description above, by minimizing the travel cost under the time constraints, degree constraints, and inte-
grality constraints, we formulate the following TIP model



n+1 
 Ii j
n+1 

⎪min ci jk xi jk



⎪ i=0 j=0 k=1




I0 j
n+1 


⎪ d0 jk x0 jk ≥ T
⎪ s.t.


⎪ j=1 k=1



⎪ Ii j
n+1 
  I ji
n 

⎪ di jk xi jk − a jik x jik ≥ si , i = 1, 2, . . . , n






j=1 k=1 j=0 k=1

⎪ n Ii



(n+1 )


⎪ ai(n+1)k xi(n+1)k ≤ T

⎨ i=0 k=1
Ii j
n+1 
 (2.8)

⎪ xi jk = 1, i = 0, 1, . . . , n






j=1 k=1

⎪  Ii j
n 



⎪ xi jk = 1, j = 1, 2, . . . , n + 1




i=0 k=1

⎪ n+1 
 Ii0



⎪ xi0k = 0



⎪ i=1 k=1




n I(
 n+1 ) j


⎪ x(n+1) jk = 0



⎩ j=0 k=1
xi jk ∈ {0, 1}, i, j = 0, 1, . . . , n + 1, k = 1, 2, . . . , Ii j .

Note that we combine the degree constraints (2.5), (2.6), and (2.7) in this TIP model. If some travelers are more concerned
about time than cost, we can change cijk to represent the travel duration instead of ticket price. In that case the objective
function becomes the total travel time.
For simplicity, we call a feasible solution satisfying all of the time constraints, degree constraints, and integrality con-
straints an itinerary. The TIP searches for itineraries with the lowest travel costs. For each itinerary x, define a route
 Ii j


x̄ = x̄i j = xi jk | i, j = 0, 1, . . . , n + 1 . (2.9)
k=1

Route is a simplified itinerary that hides the information about transport alternatives. Generally speaking, there are multiple
itineraries for each route. Each one is called an inverse itinerary of the route.

Theorem 2.1. For each route x̄ = {x̄i j | i, j = 0, 1, . . . , n + 1}, we have


⎧
⎪ x̄i j ≤ |S| − 1, 2 ≤ |S| ≤ n − 1



⎪i, j∈S

⎪ n+1

⎪

⎪ x̄i j = 1, i = 0, 1, . . . , n



⎪ j=1
⎪
⎪ n
⎨ x̄ = 1, j = 1, 2, . . . , n + 1
ij
(2.10)


i=0

⎪n+1

⎪ x̄i0 = 0



⎪i=1

⎪ n

⎪ x̄(n+1) j = 0



⎩ j=0
x̄i j ∈ {0, 1}, i, j = 0, 1, . . . , n + 1.

Proof. Let x = {xi jk | k = 1, 2, . . . , Ii j , i, j = 0, 1, . . . , n + 1} be an inverse itinerary of x̄. The last five conditions follow imme-
diately from the degree constraints and integrality constraints. Now we prove the first condition. Let |S| be the cardinality
336 X. Li et al. / Transportation Research Part B 91 (2016) 332–343

of set S. For each set S ⊆ {0, 1, . . . , n + 1} with 2 ≤ |S| ≤ n − 1, we have


  n+1
  n+1
 
n
x̄i j = x̄i j ≤ x̄i j + x̄i0 + x̄(n+1) j = |S |.
i, j∈S i∈S j∈S i∈S j=1 i=1 j=0

If the equality holds, there is at least one subset {i1 , i2 , , ip }⊆S such that x̄i1 i2 = · · · = x̄i p−1 i p = x̄i p i1 = 1. According to the
fourth and the fifth conditions of (2.10), we have 1 ≤ i1 , i2 , , ip ≤ n. Let k1 , k2 , , kp be the alternative indexes with
xi1 i2 k1 = · · · = xi p−1 i p k p−1 = xi p i1 k p = 1. It follows from the time constraints that

di1 i2 k1 < ai1 i2 k1 < di2 i3 k2 < · · · < ai p i1 k p < di1 i2 k1 .


This contradiction implies that the equality does not hold. The proof is complete. 

Remark 2.3. Theorem 2.1 tells us that (2.10) is the necessary condition for routes. However, it is not sufficient. In other
words, a vector x̄ satisfying (2.10) may not be a route if it contradicts the time constraints.

Remark 2.4. If there is no restriction on the time horizon (e.g., T = 0 and T = +∞) and there are transport alternatives
linking each pair of cities (i, j) with any departure time but the same expense c̄i j (e.g., traveling by car), then the time
constraints degenerate to the first condition of (2.10). Furthermore, if the destination city concides with the origin city, we
have
n+1  Ii j
n+1 
 
n 
n
ci jk xi jk = c̄i j x̄i j .
i=0 j=0 k=1 i=0 j=0

In this case, the TIP model degenerates to the following TSP model

⎪ 
n 
n

⎪min c̄i j x̄i j



⎪ i=0 j=0




⎪ s.t. x̄i j ≤ |S| − 1, 2 ≤ |S| ≤ n − 1


⎨ i, j∈S
 n
(2.11)

⎪ x̄i j = 1, i = 0, 1, . . . , n




j=0

⎪ 
n

⎪ x̄i j = 1, j = 0, 1, . . . , n



⎩ i=0
x̄i j ∈ {0, 1}, i, j = 0, 1, . . . , n.
For each route x̄, define a tour r = (r0 , r1 , . . . , rn+1 ) with r0 = 0 and rn+1 = n + 1 to express the visiting sequence between
cities via the recurrence relation
rt = arg max x̄rt−1 i , t = 1, 2, . . . , n. (2.12)
0≤i≤n+1

Note that tour r is a permutation of {1, 2, , n} with two additional ending points 0 and n + 1, which is uniquely deter-
mined by route x̄. Conversely, route x̄ can also be uniquely determined by tour r as

1, if (i, j ) ∈ {(rt , rt+1 ) | t = 0, 1, . . . , n}
x̄i j = (2.13)
0, otherwise.
Based on the analysis above, the itinerary optimization can be decomposed into a macroscopic tour selection process and
a microscopic number selection (i.e., flight numbers, train numbers for each section of the itinerary) process. As a result, we
divide the itinerary optimization problem into a tour optimization subproblem and a number optimization subproblem. The
tour optimization model is formulated as follows

min g(r0 , r1 , . . . , rn+1 )
(2.14)
s.t. (r0 , r1 , . . . , rn+1 ) is a tour,
where g(r0 , r1 , . . . , rn+1 ) is the optimal value of the following number optimization model

⎪ 
n

⎪min crt rt+1 τt

⎨ t=0
s.t. dr0 r1 τ0 ≥ T , arn rn+1 τn ≤ T (2.15)



⎪ drt rt+1 τt − art−1 rt τt−1 ≥ st , t = 1, 2, . . . , n

τt ∈ {1, 2, . . . , Irt rt+1 }, t = 0, 1, . . . , n,
which determines the numbers for all of the sections of the itinerary {τt , t = 0, 1, . . . , n} along tour (r0 , r1 , . . . , rn+1 ).
X. Li et al. / Transportation Research Part B 91 (2016) 332–343 337

Fig. 1. Relationships between itinerary, route, and tour.

Fig. 2. An illustration of a permutation index.

The relationships between itinerary, routes and tour are illustrated in Fig. 1. As we have already mentioned, each tour is
uniquely determined by its route, and vice versa. For each tour or route, there are multiple inverse itineraries, and (2.15) se-
lects the itinerary that has the minimum travel cost.

3. Solution method

A tour is a permutation of {1, 2, , n} with two additional ending points 0 and n + 1. Conversely, not every permutation
of {1, 2, , n} with ending points 0 and n + 1 is a tour. Theoretically, we can enumerate all of the permutations, check the
feasibility of each one, and finally report the one that is a tour and has the minimum travel cost. In practice, however, to
speed up the solution process, we design an implicit enumeration algorithm to search for the optimal tour (r0 , r1 , . . . , rn+1 )
and numbers {τt , t = 0, 1, . . . , n} for each section of the tour, which can be easily augmented to an optimal itinerary

1, if (i, j, k ) ∈ {(rt , rt+1 , τt ) | t = 0, 1, . . . , n}
xi jk = (3.1)
0, otherwise.
As the number of intermediate cities is generally small (in most cases no traveler plans to visit dozens of cities at one time),
the implicit enumeration algorithm has good computational efficiency, as shown in the case studies.
Denote by T the set of all permutations of {1, 2, , n}. Whenever no confusion would result, we use a bold letter r to
express both tour and permutation. For each permutation r = (r1 , r2 , . . . , rn ), define

n
Index(r ) = 1 + ( pi − 1 )(n − i )!
i=1

where pi is the position of ri in the set {1, 2, . . . , n}/{r1 , r2 , . . . , ri−1 }. The index function defines one-to-one mapping from T
to {1, 2, , n!}. Without loss of generality, assume that all of the permutations in T are ordered according to their indexes
from low to high, i.e., Index(rl ) = l with l = 1, 2, . . . , n!.
For every r1 , r2 , , rt ∈ {1, 2, , n}, there are (n − t )! permutations with the first t elements r1 , r2 , , rt . The index
ranges from L(r1 , r2 , . . . , rt ) = 1 + ( p1 − 1 )(n − 1 )! + · · · + ( pt − 1 )(n − t )! to H (r1 , r2 , . . . , rt ) = L(r1 , r2 , . . . , rt ) + (n − t )! − 1.
For example, in Fig. 2, there are four intermediate cities and 24 permutations of the set {1, 2, 3, 4}. If r1 = 1 and r2 = 3, we
have p1 = 1, p2 = 2, L(r1 , r2 ) = 3, and H (r1 , r2 ) = 4.
338 X. Li et al. / Transportation Research Part B 91 (2016) 332–343

Fig. 3. Illustrations of the tour and number selection processes.

We use M to record the upper bound of travel cost and use opt to record the index of the best permutation. Initially, we
set M as the maximum cost that the traveler can afford for his/her travel and set opt = 0. During the implicit enumeration
process, we gradually update these values by the lowest travel cost and the corresponding permutation index. Let l be the
permutation index and let t be the city index. Define

clt = crlt rl (t+1) k | T ≤ drlt rl (t+1) k < arlt rl (t+1) k ≤ T , k = 1, 2, . . . , Irlt rl (t+1)

and mlt = |clt | for all t = 0, 1, . . . , n.


The implicit enumeration algorithm uses two-level nested loops. The outer loop takes control of the permutation index
l, and the inner loop takes control of the city index t. First, we set l = 1 and t = 1. For each 1 ≤ i ≤ mlt , if drlt rl (t+1) i −
arl (t−1) rlt k < srlt for all k = 1, 2, . . . , ml (t−1 ) , (i.e., there is no transport alternative from city rl (t−1 ) to city rlt matching it, reset
 
clt (i ) = +∞. Otherwise), reset clt (i ) = crlt rl (t+1) i + cl (t−1 ) (kti ), where kti = arg mink cl (t−1 ) (k ) | drlt rl (t+1) i − arl (t−1) rlt k ≥ srlt . If
min clt > M, permutations passing through (rl1 , rl2 , . . . , rl (t+1 ) ) are all nonoptimal as their costs exceed the upper bound M.
Cut them off by resetting permutation index l = H (rl1 , rl2 , . . . , rl (t+1 ) ) + 1, and exit the inner loop. Otherwise, reset t = t + 1.
Repeat the inner loop process until t = n + 1. The local minimum travel cost is g(rl ) = min cln . Take τln = arg mini cln (i ). Set
τl (t−1) = kt τlt with t = n, n − 1, . . . , 1. The optimal transport alternative from city rlt to city rl (t+1) is τ lt . Update the upper
bound of travel cost M = min cln and the best permutation index opt = l. Reset l = l + 1. Repeat the outer loop process until
l = n!. Return the optimal tour ropt , numbers {τopt,t , t = 0, 1, . . . , n} and the global minimum travel cost g(ropt ). Generate
the optimal itinerary via (3.1).
Illustrations of the tour and number selection processes are shown in Fig. 3. On the left, the symbol “ > ” means that
the current travel cost is greater than the upper bound M, symbol “ ≤ ” means that the current travel cost is less than or
equal to M, and the dotted lines indicate that these permutations are deleted. On the right, the dotted lines indicate that
these numbers are invalid, and the red lines indicate an optimal selection of numbers.

4. Smart travel system

Based on the itinerary optimization approach, we develop a smart travel system that recommends the itinerary with the
lowest travel cost. The inputs include the names of the origin city, intermediate cities, and destination city, the stop times at
intermediate cities, time horizon, and preferences for departure times, arrival times, cabin class, and transport modes. The
system consists of four parts.
First, it gathers from the website the data on transport alternatives for each pair of cities. By searching for the names
of the departure city and arrival city, it collects all of the HTML text containing departure times, arrival times, ticket prices,
and numbers (e.g., flight numbers, train numbers, and so on) during the time horizon, via a Web crawler written with the
Java programming technique in the development environment of MyEclipse 2015CI.
Second, to reduce the computation time of the itinerary optimization process, it initially eliminates the invalid transport
data that conflict with the time constraints by defining the following general rules:

• The departure time from the origin city to any city j must be greater than or equal to the start time T, i.e.,

d0 jk ≥ T , j = 1, 2, . . . , n + 1, k = 1, 2, . . . , I0 j .

• The departure time from the origin city to any city j must be less than or equal to the end time T minus the total stop
time, that is,

d0 jk ≤ T − (s1 + s2 + · · · + sn ), j = 1, 2, . . . , n + 1, k = 1, 2, . . . , I0 j .
X. Li et al. / Transportation Research Part B 91 (2016) 332–343 339

Fig. 4. The architecture diagram of smart travel system.

• The departure time from any city i to the destination city must be greater than or equal to the total stop time at all of
the intermediate cities plus T, that is,

di(n+1)k ≥ T + s1 + s2 + · · · + sn , i = 1, 2, . . . , n, k = 1, 2, . . . , Ii(n+1) .

• The arrival time from any city i to the destination city must be less than or equal to T , that is,

ai(n+1)k ≤ T , i = 1, 2, . . . , n, k = 1, 2, . . . , Ii(n+1) .

• The departure time from each intermediate city i to another city j must be greater than or equal to the stop time at this
city plus T, that is,

di jk ≥ T + si , i = 1, 2, . . . , n, j = 1, 2, . . . , n + 1, k = 1, 2, . . . , Ii j .

• The arrival time from any city i to an intermediate city j must be less than or equal to T minus the stop time at city j,
that is,

ai jk ≤ T − s j , i = 0, 1, . . . , n, j = 1, 2, . . . , n, k = 1, 2, . . . , Ii j .

Third, it eliminates the invalid transport data that conflict with the preferred departure times, arrival times, cabin class,
and transport modes.
Finally, it performs the itinerary optimization process based on these collected and processed data to search for and
return the optimal itinerary. The diagram illustrating the architecture of the smart travel system is given in Fig. 4. The
system is practically explained in the following case studies.
340 X. Li et al. / Transportation Research Part B 91 (2016) 332–343

Table 1
The optimal itinerary in Example 5.1 .

Tour Beijing → Changchun → Shanghai → Chongqing → Xi’an → Beijing 1946

Movement Date Flight number Departure time Arrival time Cost

Beijing → Changchun 2015-11-10 HU7765 8:25 10:15 381


Changchun → Shanghai 2015-11-11 MU545 11:40 14:25 380
Transport alternative Shanghai → Chongqing 2015-11-14 FM9423 16:05 19:10 424
Chongqing → Xi’an 2015-11-17 PN6221 21:15 22:45 201
Xi’an → Beijing 2015-11-19 HU7738 23:30 1:25(+1) 560

Table 2
Five feasible permutations and travel costs .

No. Permutation Number of strategies on FNS Cost (RMB)

1 Beijing → Changchun → Shanghai → Chongqing → Xi’an → Beijing 8.07 × 1012


1946
2 Beijing → Changchun → Shanghai → Xi’an → Chongqing → Beijing 7.86 × 1012 2004
3 Beijing → Xi’an → Chongqing → Shanghai → Changchun → Beijing 9.58 × 1012 2128
4 Beijing → Shanghai → Changchun → Chongqing → Xi’an → Beijing 1.67 × 1012 2313
5 Beijing → Xi’an → Chongqing → Changchun → Shanghai → Beijing 1.38 × 1012 2504

5. Case studies

In this section, we present two practical examples based on real-life flight data and high-speed train data to illustrate the
effectiveness of itinerary optimization for minimizing travel cost, the computational efficiency of the implicit enumeration
algorithm, and the feasibility of the smart travel system.

Example 5.1. Suppose that a traveler living in Beijing (origin city and destination city) plans to visit Shanghai (3 days),
Xi’an (2 days), Chongqing (3 days), and Changchun (1 day) in the time horizon from 2015/11/10 08:00 to 2015/11/20 08:00.
The traveler prefers to take flights in the Economy cabin class and has no preferences for departure time or arrival time.
Instead of booking each flight separately, he/she wants to plan the whole itinerary for achieving the minimum travel cost.
All of the flight information for Beijing, Shanghai, Xi’an, Chongqing, and Changchun are captured from the Ctrip website
(http://flights.ctrip.com), including flight numbers, origin cities, destination cities, departure times, arrival times and ticket
prices.

By performing Algorithm 1, the optimal itinerary is obtained and shown in Table 1. The optimal tour is Beijing →
Changchun → Shanghai → Chongqing → Xi’an → Beijing, and the lowest travel cost is 1946 RMB. To further illustrate
how itinerary optimization minimizes travel cost, we list the five optimal feasible permutations of these four intermedi-
ate cities (Shanghai, Xi’an, Chongqing, Changchun) and calculate the travel costs corresponding to the optimal selection
of flight numbers. The computational results are shown in Table 2. As the total length of flight duration is very limited
(10 − 3 − 2 − 3 − 1 = 1 day ), only five permutations are tours. The best tour has a travel cost of 1946 RMB, whereas the
worst one has a travel cost of 2504 RMB. The relative error is (2504 − 1946 )/2504 = 22.284%.
Take the first permutation as an example. In the time horizon, there are 288 flights from Beijing to Changchun, 591
flights from Changchun to Shanghai, 582 flights from Shanghai to Chongqing, 327 flights from Chongqing to Xi’an, and 249
flights from Xi’an to Beijing. In total, there are 8.07 × 1012 potential strategies (some of them may be infeasible). If the
traveler tries to plan his/her itinerary manually, it would take him/her an unmanageable amount of time. In comparison,
the optimal itineraries according to the user’s requirements for time horizon, origin city, destination city, and preferences
for departure time and arrival time are performed by the implicit enumeration algorithm in 9.625 s. Thus, the implicit
enumeration embedded in the smart travel system can save travelers significant planning time.
X. Li et al. / Transportation Research Part B 91 (2016) 332–343 341

Table 3
The optimal itinerary in Example 5.2 .

Tour Beijing → Chongqing → Wuhan → Shenzhen → Shanghai → Changchun 6369.0

Movement Date Train number Departure time Arrival time Cost

Beijing → Chongqing 2015-11-10 G307 8:30 20:46 2383.0


Chongqing → Wuhan 2015-11-12 G310 8:14 14:53 743.0
Transport Alternative Wuhan → Shenzhen 2015-11-14 G73 14:27 19:11 998.0
Shenzhen → Shanghai 2015-11-16 D2282 7:00 19:01 593.5
Shanghai → Changchun 2015-11-19 G1258 9:13 20:15 1651.5

Fig. 5. Travel costs for all tours.

Example 5.2. Suppose that a traveler plans to visit Shanghai (2 days), Wuhan (1 day), Chongqing (1 day), and Shenzhen
(1 day) with the origin city “Beijing” and the destination city “Changchun” in the time horizon from 2015/11/10 08:00 to
2015/11/20 08:00. The traveler prefers to take the high-speed train, Business cabin class. For each trip, the desired de-
parture time is later than 7:00 and the desired arrival time is earlier than 23:00. All of the high-speed train data for
routes between Beijing, Shanghai, Wuhan, Shenzhen, Chongqing, and Changchun are captured from the 12,306 website
(http://www.12306.cn/mormhweb), including train numbers, origin stations, destination stations, departure times, arrival
times, and ticket prices.
By performing Algorithm 1, the optimal itinerary is obtained and shown in Table 3. The optimal tour is Beijing →
Chongqing → Wuhan → Shenzhen → Shanghai → Changchun, and the travel cost is 6369.0 RMB. In this example, as the
total duration is relatively short (10 − 2 − 1 − 1 − 1 = 5 days ), there are 12 feasible permutations (See Fig. 5). In fact, the
other 12 permutations are infeasible because there is no high-speed train from Chongqing, Shenzhen to Changchun. The
best tour can reduce cost by (9536.5 − 6369.0 )/9536.5 = 33.21%, which is cheaper than the worst one.
Here, we further analyze the algorithmic complexity of the implicit enumeration, which consists of two-level nested
loops for solving the TIP. In the worst case, the implicit enumeration should loop through all of the possible choices. The

tour selection process has a complexity O(n!) and the number selection process has a complexity O( ni=0 ki ), where n is the
number of cities to be visited, and ki is the number of available number choices between each two cities. Therefore, the
 ! n p p
implicit enumeration has a total complexity of O( np=1 i=0 ki ), where ki is the number of available choices when tour p
∈ {1, 2, , n!} is selected.
342 X. Li et al. / Transportation Research Part B 91 (2016) 332–343

Table 4
Computational efficiency of implicit enumeration algorithm on itinerary selection .

Number of intermediate cities Total stay time (Unit: Day)

T=1 T=2 T=3 T=4 T=5 T=6 T=7 T=8

12 9 9 7 8 6 5 2
Xi’an
20 20 20 20 20 20 20 20
11856 10638 9233 7309 7975 6537 3159
Xi’an, Changchun -
15552 15552 15552 15552 15552 15552 15552
19183 16928 15477 13837 12819 8325
Xi’an, Changchun, Qingdao - -
38016 38016 38016 38016 38016 38016
1083727 957109 692244 502833 301545
Xi’an, Changchun, Qingdao, Shenyang - - -
190 080 0 190 080 0 190 080 0 190 080 0 190 080 0

Table 5
Illustration of the computational efficieny of implicit enumeration algorithm .

List of intermediate cities Computation time (Unit: Second)

- 0.07
Wuhan 0.30
Wuhan, Shanghai 0.81
Wuhan, Shanghai, Shenzhen 3.78
Wuhan, Shanghai, Shenzhen, Qingdao 9.14
Wuhan, Shanghai, Shenzhen, Qingdao, Chongqing 34.93

As the eliminating features of the implicit enumeration algorithm used for solving the TIP simultaneously take into
account the user’s personalized demands and the constraints of the collected data, such as the number of cities to be visited,
the number of available tours between each pair of cities, varied travel times, stop times at each city, and time horizons,
estimating the average complexity of the implicit enumeration becomes very more difficult. Keeping the same time horizon,
origin city, destination city, and preferred departure times and arrival times, we change the number of intermediate cities
from 1 to 4; we conduct testing experiments by changing the total stop time in the cities to illustrate the effectiveness
of the algorithm. The results are shown in Table 4, where the number of choices traversed by the implicit enumeration
algorithm before the optimal itinerary is found and the total number of possible choices are both recorded for different
scenarios. For example, when there is only one intermediate city Xi’an and the total stop time is 1 day, the optimal itinerary
is obtained after traversing 12 choices out of 20 possible choices, which means that eight possible choices are eliminated
by the implicit enumeration method. It is obvious that the implicit enumeration method for solving the TIP is effective. The
experiments shown in Table 4 also illustrate the average complexity of the implicit enumeration method.
We also present the computational efficiency of the implicit enumeration algorithm. Keeping the same time horizon,
origin city, destination city, and preferred departure times and arrival times, we change the number of intermediate cities
from 0 to 5, set the stop time at each intermediate city to be 1 day, and record the computation time, shown in Table 5.
The computation time varies from 0.07 s to 34.93 s, which implies that the implicit enumeration is a fast algorithm when
the number of intermediate cities is small.

These two case studies of the TIP have the following managerial and scientific implications. First, the proposed TIP sat-
isfies the unprecedented demand for smart travel fueled by advances in big data. Our work can be the basis for some
extensive models and decision support systems will emerge as practical websites or mobile applications; these tools will
make smart travel planning much more convenient for users and will bridge the gap between urgent travel demand and
supply in the era of big data. Second, as illustrated in the two case studies, the implicit enumeration algorithm for solving
the TIP shows effectiveness when reporting the optimal travel itineraries, which facilitates the practical use of the proposed
smart travel system. Third, the cost of an itinerary can be reduced by: (a) selecting midnight flights and/or high-speed rails
due to the lower prices; (b) increasing the time taken when arranging an itinerary. Finally, our work highlights the impor-
tance of big data in practical decision-making problems like the TIP. These problems can be effectively formulated using the
existing large-scale open source data on the Internet, and then solved with exact operations algorithms.

6. Conclusions

In this study, we propose a travel itinerary problem as a new variant of the traveling salesman problem. The TIP can
make a global optimal itinerary for travel between multiple cities, at the lowest travel cost. We decompose the itinerary
optimization into a tour selection process and a number selection process, and then use the implicit enumeration algorithm
to find the optimal combination of tour and numbers. Furthermore, we integrate the data collecting, data processing, and
itinerary optimization to create a smart travel system. Here we use Web crawler technology to capture online transport
data, and design general rules to initially eliminate the invalid data. In the era of big data, the study of the TIP can boost
the development of tourism industries, as it effectively bridges the gap between travel demand and supply. Variants of
X. Li et al. / Transportation Research Part B 91 (2016) 332–343 343

the proposed smart travel systems, installed in websites and mobile platforms with user-friendly interfaces, will help users
make personalized travel itineraries in a convenient way. The accompanying continuous generation of travel big data (e.g.,
the deluge of text) will enhance the TIP-driven smart travel planning systems, and also benefit both tourism marketing and
management.
As the number of intermediate cities increases, both the number of tours and the strategies for number selection in-
crease exponentially so that the computation time for itinerary optimization increases rapidly. In future research, we plan
to design more detailed rules to eliminate more invalid data before the itinerary optimization procedure starts. The implicit
enumeration algorithm will also be improved. Given the complexity caused by an increase in the number of intermediate
cities and route alternatives between two cities, we may design solution algorithms with a MapReduce computing frame-
work and perform them on some distributed Cloud computing platforms such as Hadoop and Apache Spark, which could
definitely report the optimal travel itineraries with significantly reduced computational time.
In this study, we don’t take the hotel expenses into consideration, which are an important portion of the total cost.
Generally speaking, hotel expenses vary with the itinerary, as most hotels have weekday specials and different hotels have
different policies. In our future research, we will take hotel reservations into account, such that an even more complete
itinerary for travelers can be generated. In addition, we will investigate areas such as user-friendly TIP interactive interfaces,
formulating the smart travel planning problems with tourist preferences taken into account, among others.

Acknowledgments

This research was supported by the National Natural Science Foundation of China (No. 71371027), the Fundamental Re-
search Funds for the Central Universities (No. Buctrc201503), the Beijing Nova Program (No. Z141110 0 0180 0 0 0), and Beijing
Social Science Fund (No. 13JGC087).

Supplementary material

Supplementary material associated with this article can be found, in the online version, at 10.1016/j.trb.2016.05.013

References

Balas, E., Christofides, N., 1981. A restricted lagrangean approach to the traveling salesman problem. Math. Program. 21 (1), 19–46.
Bar-Gera, H., Boyce, D., 2003. Origin-based algorithms for combined travel forecasting models. Transport. Res. Part B 37 (5), 405–422.
Campbell, A.M., Thomas, B.W., 2008. Probabilistic traveling salesman problem with deadlines. Transport. Sci. 42 (1), 1–21.
Cordeau, J.F., Ghiani, G., Guerriero, E., 2014. Analysis and branch-and-cut algorithm for the time-dependent traveling salesman problem. Transport. Sci. 48
(1), 46–58.
Crowder, H., Padberg, M.W., 1980. Solving large-scale symmetric travelling salesman problems to optimality. Manage. Sci. 26 (5), 495–509.
Dumas, Y., Desrosiers, J., Gelinas, E., Solomon, M., 1995. An optimal alogorithm for the traveling salesman problem with time windows. Operat. Res. 43 (2),
367–371.
Garey, M.D., Johnson, D.S., 1979. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman and Company, San Francisco, CA.
Graham, D., Nuttle, H.L., 1986. A comparison of heuristics for a school bus scheduling problem. Transport. Res. Part B 20 (2), 175–182.
Hill, A.V., 1982. An experimental comparison of human schedulers and heuristic algorithms for the traveling salesman problem. J. Operat. Manage. 2 (4),
215–223.
Iida, Y., Akiyama, T., Uchida, T., 1992. Experimental analysis of dynamic route choice behavior. Transport. Res. Part B 26 (1), 17–32.
Johnson, D.S., McGeoch, L.A., 1997. The traveling salesman problem: a case study in local optimization. Local Search Combinatorial Optim. 1, 215–310.
Jonge, B.D., Teunter, R.H., 2013. Optimizing itineraries in public transportation with walks between rides. Transport. Res. Part B 55, 212–226.
Khanra, A., Maiti, M.K., Maiti, M., 2015. Profit maximization of TSP through a hybrid algorithm. Comput. Ind. Eng. 88, 229–236.
Koppelman, F.S., Coldren, G.M., Parker, R.A., 2008. Schedule delay impacts on air-travel itinerary demand. Transport. Res. Part B. 42 (3), 263–273.
Laporte, G., Chapleau, S., Landry, P.E., Mercure, H., 1989. An algorithm for the design of mailbox collection routes in urban areas. Transport. Res. Part B 23
(4), 271–280.
Long, J., Huang, H.J., Gao, Z., Szeto, W.Y., 2013. An intersection-movement-based dynamic user optimal route choice problem. Operat. Res. 61 (5), 1134–1147.
Montemanni, R., Barta, J., Mastrolilli, M., Gambardella, L.M., 2007. The robust traveling salesman problem with interval data. Transport. Sci. 41 (3), 366–381.
Ratliff, H.D., Rosenthal, A.S., 1983. Order-picking in a rectangular warehouse: a solvable case of the traveling salesman problem. Operat. Res. 31 (3), 507–521.
Salazar-Gonzlez, J.J., Santos-Hernndez, B., 2015. The split-demand one-commodity pickup-and-delivery travelling salesman problem. Transport. Res. Part B
75, 58–73.
Smith, T.H., Thompson, G.L., 1977. A LIFO implicit enumeration search algorithm for the symmetric traveling salesman problem using held and karp’s 1-tree
relaxation. Ann. Discrete Math. 1, 479–493.
Toriello, A., Haskell, W., Poremba, M., 2014. A dynamic traveling salesman problem with stochastic arc costs. Operat. Res. 62 (5), 1107–1125.

Further reading
Erika, B., Roberto, R., Paolo, T., 2014. A reduced-cost iterated local search heuristic for the fixed-charge transportation problem. Operat. Res. 62 (5),
1095–1106.
Nagata, Y., Kobayashi., S., 2013. A powerful genetic algorithm using edge assembly crossover for the traveling salesman problem. INFORMS J. Comput. 25
(2), 346–363.
Thibaut, V., Teodor, G.C., Michel, G., Nadia, L., Walter, R., 2012. A hybrid genetic algorithm for multidepot and periodic vehicle routing problems. Operat.
Res. 60 (3), 611–624.

You might also like