Journal of Applied Mathematics

Volume 2018, Article ID 2453185, 14 pages

https://doi.org/10.1155/2018/2453185

## A Comparison of Algorithms for Finding an Efficient Theme Park Tour

^{1}Furman University, Department of Mathematics, Greenville, SC 29613, USA^{2}Dickinson College, Department of Mathematics and Computer Science, Carlisle, PA 17013, USA^{3}TouringPlans.com, Celebration, FL 34747, USA

Correspondence should be addressed to Richard J. Forrester; ude.nosnikcid@rtserrof

Received 23 August 2018; Accepted 17 September 2018; Published 16 October 2018

Academic Editor: Quanke Pan

Copyright © 2018 Elizabeth L. Bouzarth et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

The problem of efficiently touring a theme park so as to minimize the amount of time spent in queues is an instance of the Traveling Salesman Problem with Time-Dependent Service Times (TSP-TS). In this paper, we present a mixed-integer linear programming formulation of the TSP-TS and describe a branch-and-cut algorithm based on this model. In addition, we develop a lower bound for the TSP-TS and describe two metaheuristic approaches for obtaining good quality solutions: a genetic algorithm and a tabu search algorithm. Using test instances motivated by actual theme park data, we conduct a computational study to compare the effectiveness of our algorithms.

#### 1. Introduction

Theme parks like Walt Disney World in Orlando, Florida, attract millions of tourists each year. While these parks provide great entertainment, a common complaint is the amount of time spent waiting in line for the various attractions. Whole industries have arisen to help tourists maximize their entertainment value by offering advice on how to optimally tour parks to minimize such waiting (e.g., [1, 2]). Here, we look at the problem of finding a shortest route through an amusement park that takes into account the wait time of the attractions. This is an instance of the Traveling Salesman Problem with Time-Dependent Service Times (TSP-TS) [3].

The TSP-TS is a variation of the Traveling Salesman Problem (TSP) and was introduced by Tas et al. [3]. Given a set of locations and distances between every pair of locations, the classical TSP seeks to find the shortest possible route that visits each location and returns to the starting location. For the TSP-TS, the duration of time spent at each location is defined as a function of the arrival time to that location. The objective is to minimize the total route duration, which consists of the sum of the total travel time and the total service time. In our setting, the service times represent attraction wait times and ride times.

Time-dependency in the TSP literature is typically addressed in terms of travel times. In particular, the Time-Dependent Traveling Salesman Problem (TDTSP) seeks to find the shortest tour through the locations when the time to travel depends not only on the distance but also on the time of day the route is traversed. Because the TDTSP incorporates a more realistic touring cost structure, it has been used to model several other applications including scheduling single-machine jobs with time-dependent setup costs [4, 5], creating timetables for university exams to minimize back-to-back exams [6], production planning for car assembly lines [7], satisfying product demands at minimum travel and purchasing costs [8], and vehicle routing with varying travel times such as within regions of congestion [9–15]. Vander Wiel and Sahinidis [16, 17] note that the TDTSP is NP-hard, but little has been published in terms of heuristics, especially heuristics that incorporate a time-dependency. Multiple authors [4, 5, 12, 16–18] have proposed mixed-integer linear programs (MILP) for producing solutions to the TDTSP, but these exact solutions have generally been for networks with tens of nodes rather than hundreds. Relaxations to these MILP formulations though have provided upper and lower bounds for TDTSP instances. Malandraki and Daskin [12] combine a MILP formulation with TSP nearest neighbor heuristics to solve random instances of up to 25 locations. Vander Wiel and Sahinidis [16] solve problems of size up to 100 locations by developing a time-dependent version of the well-known Lin-Kernighan heuristic with their MILP formulation. Cordeau et al. [19] consider a version of the TDTSP where the time range is subdivided into equal-length subintervals and the average travel speed is known. They use an algorithm by Ichoua et al. [20] to compute the travel time on each arc. Further, they develop a branch-and-cut algorithm to produce solutions for instances up to 40 vertices. Other approaches taken include dynamic programming [21], simulated annealing [22, 23], Monte Carlo methods [24], and genetic algorithms [25, 26]. With the exception of [16], most of the heuristic approaches employed are ones that were developed for the time-independent TSP and do not try to make use of the time-dependent nature of the problem.

The majority of the papers on the TDTSP focus on allowing congestion to build up on routes during certain parts of the day and consider the time spent at locations negligible [27]. However, in a theme park scenario, it is the variability in the wait time for rides that greatly increases tour time rather than variations in travel time. Tas et al. [3] introduce the Traveling Salesman Problem with Time-Dependent Service Times (TSP-TS) to model scenarios such as this. They show that in cases where service times are modeled by a linear or quadratic function with certain specifications, the service times cannot be incorporated into arc durations like those used in [19]. They propose formulations for the TSP-TS and measure the effectiveness of different subtour elimination constraints. We will show that our version of the TSP-TS also cannot be modeled as a TDTSP.

The main contributions made in this paper are as follows.(1)We extend the TSP-TS introduced by Tas et al. [3] to include more general service time functions.(2)By incorporating wait times into the distances between nodes, we construct an asymmetric TSP that can be used to compute a lower bound on the TSP-TS.(3)We propose a mixed-integer linear programming model of the TSP-TS and describe a branch-and-cut algorithm based on this formulation.(4)We create a new metric, , to guide tour construction and augmentation and we develop both a genetic algorithm and tabu search algorithm that can be used to find good quality solutions to the TSP-TS in an efficient manner.(5)Motivated by actual theme park data, we introduce a collection of test problems that utilize different types of wait time distributions.(6)Finally, we perform a detailed computational study to compare the effectiveness of our algorithms.

The remainder of this paper is organized as follows. In Section 2, we formally describe our version of the TSP-TS, propose a mixed-integer linear programming (MILP) formulation, and describe a branch-and-cut algorithm. In Section 3, we show that our version of the TSP-TS cannot be modeled as a TDTSP and describe a method for computing a lower bound on the optimal solution. Section 4 describes two different metaheuristic approaches for solving the TSP-TS using a genetic algorithm and a tabu search algorithm. We present our test data and computational results in Sections 5 and 6, respectively. Section 7 highlights our conclusion.

#### 2. Problem Description and Formulation

In this section, we begin by introducing the notation that will be used throughout the paper. We then present a MILP model for our version of the TSP-TS and describe a branch-and-cut algorithm based on this formulation.

##### 2.1. Notation

Let be a connected digraph with node set and arc set . Associated with each arc is a travel time from node to node , , while associated with each node is a service time function , where corresponds to the arrival time to node . For our application, the nodes represent theme park attractions, represents the time to walk from attraction to attraction , and represents the sum of the wait time and ride time when arriving at attraction at time . The TSP-TS aims to minimize the total tour duration, beginning and ending at node 1 (possibly representing the entrance to the park), including the total walking time and the total service time.

Tas et al. [3] considered both linear and quadratic service time functions . However, such functions are not realistic in a theme park scenario. In practice, service (wait) time data at each attraction is collected at discrete times . In this paper, we consider two types of functions based on data collected at these times. The first is to define as a step function where is set to be the wait time recorded at attraction at time for all . The second is to compute using linear interpolation of the wait times recorded at and for all . While wait times computed using linear interpolation are more realistic, they are difficult to model using mixed-integer programming. However, such functions can easily be handled using metaheuristics.

##### 2.2. Mathematical Model

To formulate the TSP-TS as an MILP, we will assume that is a step function over the intervals . We refer to as time interval . Our model is formulated on an expanded graph where each arc from node to node is replaced by parallel arcs from to , one for each time interval. In this new network we define to represent the service time (sum of the wait time and ride time) when arriving at node during time period .

For notational convenience, we introduce the set to represent the set of possible successor nodes and define to be the set of all time intervals. The decision variables for our formulation are as follows.Using the models presented in [12, 28] as a starting point, we formulate our version of the TSP-TS as follows.Recall that we assume that our tour begins and ends at node 1. The objective function (2) minimizes the arrival time back to node 1 as only one variable can be positive. Constraints (3) and (4) ensure that each node is visited exactly once. Constraint (5) computes the arrival time to node after leaving node 1, while constraints (6) compute the arrival time to node visited after node . Note that constraints (5) and (6) act as the subtour elimination constraints. The temporal constraints (7) and (8) ensure that the correct time interval is chosen when visiting node after node (note that since we assume is an integer for all ). Finally, constraints (9) ensure that only if one of for any .

To strengthen the continuous relaxation of the formulation, we can include additional restrictions designed to tighten the model as suggested in [12]. Toward this end, we define the following sets: We can then add in the following new restrictions, where is a lower bound on the optimal solution.Constraints (12) and (13) tighten the formulation as follows. Suppose so that we travel from node to node and arrive during time period . Then constraints (12) ensure that if you then visit node immediately after node , then you must use a time interval that occurs after your arrival to . Suppose so that you travel from node to node and arrive during time period . Then constraints (13) ensure that when you traveled from node to node you must use a time period that finishes service at before you leave node to travel to node . Finally, constraint (14) allows us to utilize a lower bound on the optimal solution, such as that computed in Section 3.

##### 2.3. Branch-and-Cut Algorithm

In this section we describe a branch-and-cut algorithm that we developed based on the MILP described in the previous section. Our algorithm begins with a preprocessing phase that first computes a lower bound to use in constraint (14) using the method described in Section 3. We then utilize the metaheuristics of Section 4 to obtain an incumbent solution to seed the branch-and-bound procedure. The solution obtained from the metaheuristics is also used to determine an upper bound on the number of time intervals that are needed within the MILP formulation. Recall that between each pair of nodes there are parallel temporal arcs, each of which is represented by a variable . It is therefore advantageous to keep the number of temporal arcs to a minimum so as to reduce the size of the MILP formulation, which we can accomplish using the best tour found by the metaheuristics.

After the preprocessing phase, we submit the MILP (2), (3), (4), (5), (6), (7), (8), (9), (10), (12), (13), and (14) and the incumbent solution to the mixed-integer programming solver CPLEX, which was used to implement the branch-and-cut algorithm. We utilize CPLEX’s callback functionality to add cuts during the enumeration. Specifically, we incorporate additional subtour elimination constraints. Recall that constraints (5) and (6) act as the subtour elimination constraints for our formulation, which are similar to the Miller-Tucker-Zemlin constraints for the TSP [30]. Note that these constraints are weaker than the typical, yet exponential in number, subtour elimination constraints for the TSP that were introduced by Dantiz, Fulkerson, and Johnson [31]. We can extend these tighter subtour elimination constraints to our formulation as follows, where is the node set of a subtour and is the cardinality of :At each node of the branch-and-bound tree we identify violated subtour elimination constraints (15) of the LP relaxation using a separation technique based on a min-cut algorithm of [32] and subsequently add these constraints to the formulation. Even though these additional cuts are not necessary for the elimination of the subtours, the inequalities strengthen the linear programming relaxation of the problem. Note that the inequalities (15) added at any node of the enumeration tree are valid for all the other nodes because these inequalities are valid for the entire formulation (3), (4), (5), (6), (7), (8), (9), (10), (12), (13), and (14). Thus, at a given node, all the inequalities generated so far were incorporated into the formulation.

#### 3. Computing a Lower Bound

We begin this section by showing that our version of the TSP-TS cannot be modeled as a TDTSP, and therefore we are unable to use the techniques that have been developed for computing lower bounds for the TDTSP. We then describe a method for computing a lower bound for the TSP-TS.

First, we need to introduce some additional notation. We define each tour of the nodes as a permutation , where , , and associated with tour is a tour cost, , representing the time it takes to traverse the tour as described by permutation and to return to , the entrance. To break down this tour cost, recall we defined to be the time that the tour arrives at the th attraction, and let us define to be the time that the tour departs the th attraction. Note we define . We can then recursively define the arrival and departure times for each of the attractions as follows. The arrival time at the th attraction for isThe departure time of the th attraction for isThus,

Following the approach in [19] it seems reasonable to try to incorporate service time variability into travel times and use many of the results in the TDTSP literature to establish bounds for the TSP-TS. Much of this literature proposes to model the TDTSP by establishing a nonnegative traversal rate for arc during times in time period . This rate is fixed during each time period but is allowed to change to when the time period changes from to , where , even if the arc traversal is not complete. This modeling technique offers the benefits of establishing lower bounds for the TDTSP. However, as we show here, the TSP-TS cannot be modeled by using this technique.

Consider an instance of the TSP-TS with the following conditions during time periods and :(1)It is possible to arrive at node at some time , where and arrive at node at some time with .(2)The slope of the service time function for some node is -1 during time period so that, for instance, .

In this instance of the TSP-TS, if some tour traverses arc starting at time , then it will arrive at node at some time . However, if some tour traverses arc beginning at , then it must arrive at node at time Note in departing node at time or at time we arrive at node at time in both cases.

Let us attempt to model this TSP-TS using a nonnegative traversal rate common in modeling the TDTSP. Since we arrive at node at the same time, , regardless of whether we begin traversing arc at time or time , we cover the same distance, and we haveThis implies that , and thus . Hence, a tour in our TSP-TS cannot cover any ground along arc during the interval . This means that if some tour in the TSP-TS finishes traversing arc at time , then or . This contradicts the first condition of our TSP-TS instance, which implies that a tour can complete edge at time between and . Thus, this instance of a TSP-TS cannot be modeled by converting service times to edge traversal rates as is common in modeling the TDTSP. Further, this scenario is common to amusement parks, especially among attractions that have batch servicing.

Cordeau et al. [19] use variable arc traversal speeds to find a lower bound for the TDTSP. They create this lower bound by assigning, in each time interval, each arc its maximum speed found over all time intervals. This creates an asymmetric Traveling Salesman Problem (ATSP) as all arcs now have a fixed traversal time. Solutions to this ATSP provide a lower bound to the TDTSP. However, as shown in [3], solutions to the TSP in the case of variable service times are not necessarily a lower bound for the TSP-TS.

For a preliminary lower bound on the TSP-TS, one may assign to each node a wait time equal to the minimum wait time achieved at that node throughout the day, . If we incorporate this time into every arc leaving node , the problem becomes an instance of the asymmetric TSP where arc has a weight of . Let denote the time for a tour to finish in this ATSP. Notice that, for any tour , , since every arc in the TSP-TS costs at least as much as the corresponding arc in the ATSP. Thus, for a tour that is optimal to the ATSP problem, , and as a result , for all tours . Thus is a lower bound for the TSP-TS.

However, in amusement parks, wait times for different rides often increase together, and it is unlikely to create a tour with every ride achieving a minimum wait time. We can find an improved lower bound by incorporating the extra wait cost incurred by not visiting each attraction at its minimum wait time. Define to be the wait time above for each node in a tour . Then has some total extra cost accumulated over all nodes, .

Consider a tour that is optimal to an instance of a TSP-TS. We would like to find a tighter lower bound of than . To that end, let be the set of nodes corresponding the first attractions visited by the optimal tour . Let be the set of all permutations of the nodes in , and let be the permutation of that achieves . Each permutation has a time that it requires to visit each of its nodes. We call this time . Let be the permutation of that achieves . That is, among all tours that begin with some permutation of the nodes in , finishes the tour of the nodes in fastest, while minimizes the extra wait incurred in any tour of nodes in . For each node we can redefine , call it , to be the minimum value of over all times , where is any solution to the TSP-TS. Thus node incurs an extra wait of at least because it must be visited after time , as shown in Figure 1.