You are on page 1of 17

OPERATIONS RESEARCH 0

OPTIMIZATION OF SIGHTSEEING TOURS

Introduction 3

Setting 3

The list of sights 3

The audience’s choice 4

Where should we go ? 5

Choice of sights in real life applications 5

Results 6

Discussion 7

Routing with Travelling Salesman Problem (TSP) 8

Integer linear programming formulation 8

Results of the tour planning 9

Operations Research Class - Elderly Ladies from Denmark 10

German Football Team 10

Conclusion 11

New model: sub problems 11

APPENDIX 13

OR class ‘15/’16 13

German football team case 14

Elderly ladies from Denmark 15

Routing results 16

1
Introduction

In this seminar work we are going to present a method on how to plan tours through
Prague. The chosen setting is a so called Free Tour. In our approach we first try to
consider how interesting several sights are for different visitors and choose the
interesting ones along with constraints in time. Secondly a time-optimal tour for all sights
is being chosen.

Setting

Martin is a tour guide at one of the popular ​Free Tours in Prague. As the tours are for
free, Martin’s income is depending on the tips his audience is willing to offer after the
tour. His idea is, that the better his audience likes what he’s telling them, the higher the
tips will be. He assumes that it’s not only depending on his abilities as a story-teller (he’s
really good), but also on his audience's preferences. Therefore he collects the
preferences and let’s a tool he programmed, calculate the best sites for this day. It also
calculates the route and therefore the time it takes to guide the people through Prague.
The Free Tour starts at the Astronomical Clock and ends there again. The Astronomical
clock is therefore a mandatory sight. Through the right choice of a starting time the
visitors can then also see the twelve apostles.

The list of sights

Martin creates a list of the most popular sites in Prague and categorizes them into seven
categories: art, food & beer, history, literature, music, sports and technical aspects. In
each category he evaluates the sight in this category with up to three stars. In order to
protect his voice - and therefore generate future income - he doesn’t want to talk for
more than two hours per tour. For that reason he also collects the duration of speech it
needs at every sight. Because it is a free tour, none of the sights require entrance fees.

2
time of
technical food &
No. Name history art music literature sport explantati
aspects beer
on [min]

d1 Dancing house 1 2 2 1 5
d2 Strahov stadium 1 2 2 3 15
d3 Vyšehrad Park 1 1 1 1 1 20
d4 Saint Peter and Paul Basilica 2 2 10
d5 Zizkov & Tower 3 1 2 2 2 25
d6 Prague Metronome & Letna 1 3 2 2 20
d7 Staropramen Brewery 1 2 3 15
d8 Charles Bridge 1 3 2 1 2 20
d9 Astronomical clock 3 2 1 10
d10 Jewish quarter 3 1 1 30
d11 Powder Gate 2 2 10
d12 Strahov Monastery 2 3 2 2 1 2 20
d13 Lennon Wall 1 1 3 1 1 10
d14 Troja Chateau 2 3 2 30
d15 Kafka museum 1 2 2 1 3 20
d16 Prague Castle 1 3 3 1 2 2 60
d17 Prague Botanical Garden 2 1 1 30
d18 National theatre 3 3 3 2 1 10
Monument to Victims of
d19 1 2 2 2 10
Communism
d20 National Monument in Vitkov 2 3 1 1 20

Table 1: Martin’s assumptions of every sight’s value

The audience’s choice

To plan the tour through Prague, Martin now has to ask his visitors, what they prefer to
see. Of course they don’t know anything about the sights in Prague, but most certainly
they know something about their personal preferences. He hands out surveys to each
visitor (later he develops a smartphone app, which does all the explained tasks
automatically) and let’s them specify their preferences. With his visitors’ preferences he
can calculate the average interest in every category. This way he can choose the most
valuable​ sights for his tour.

3
How much are you interested in …? food & technical
art history literature music sports
0 - not beer aspects
1 - a little
2 - responsive
3 - very much

Table 2: Exemplary table to demonstrate the survey for visitors

Where should we go ?

Martin’s target is to maximize the “joy”, which is represented by the value of every sight.
The binary integer problem can be described as follows:

n 7
f unction max → ∑ ∑ dx ji vi,x
x = 1i = 1

n
∑ dx * tx ≤ 120 time constraint
x=1

n
∑ dx ≤ p constraint in number of sights (optional)
x=1

dx Ѯ {0, 1} decision variable - location of choice?

ji Ѯ {0, 1, 2, 3} joy of visitors in category

vi,x Ѯ {0, 1, 2, 3} value of sight x in category i

tx > 0 duration of speech at location x

The task is solved by software LINDO (​http://www.lindo.com​). Parameters of decisive


7
variable d1-d20 is pre-calculated by formula ∑ ji.vi,x (compare appendix ) from the
i=1

customer’s survey (table 3-5) and of the sight’s value (table 1). The starting point will be
the Astronomical clock, therefore the variable d9 = 1 will be set as an additional
constraint.

4
Choice of sights in real life applications

To show the functionality of our tool we’ve made a survey in our colleges from OR class
to see where Martin would lead our rather heterogenous class (survey results in
appendix). Further we will compare the result to an exemplary German football team
(high preferences in sport, food and beer) and an imaginary group of elderly ladies from
Denmark (preferences in literature and art).

Operations Research technical food & literature


art history music sports
class Winter 15/16 aspects beer

1 2.22 1.78 2.22 2.56 2.22 2

German football team technical food & literature


art history music sports
aspects beer

2 0 3 2 0 0 3

Elderly ladies from Denmark technical food & literature


art history music sports
aspects beer

0 3 0 2 3 1 0

Table 3-5: Preferences in every group

Results

LINDO solves the tasks by Simplex algorithm to produce the optimal solution. The detail
optimal objective-function values could be found at the appendix. The table below
presents locations which are best fit to each particular group.

5
Table 6: choice of sights for every group

Discussion

The results reflect the difference between the optimal solution of our real group (OR
class) and the hypothetical groups (Germany and Denmark). It can be seen that the OR
class achieves much higher values (150.9) compared to Germany (108) and Denmark
(118). It cannot be stated whether the joy of one group is really higher than in the other
group, as the calculated value is only the result of their given preferences. A group that is
interested in many aspects automatically has higher values.

A look to the chosen sights shows that there are some preferred ones for any group,
especially when the relation between ​value of the sight and ​time to explain is relatively
high. On the other hand, the results are also different between the groups; at least the
football team would visit other sights. However, it is doubtful whether the results really
represent the preferences of the group. For instance, it is to be expected that every
group will visit Charles Bridge, which is not the case here. Further, the football team
could most certainly like to see the Brewery (and hear all the stories about it), but they
don’t. Therefore the table of ​values has to be adjusted by the time to deliver optimal
results. Further, maybe more sights have to become mandatory.

6
Routing with Travelling Salesman Problem (TSP)

After the sights are chosen, Martin is looking for the perfect route. He wants to minimize
the walking time to comfort the visitors. He chooses the Travelling Salesman Problem as
a suitable programming, because every sight should only be visited once and he wants to
bring his visitors back to the starting point. The imaginary graph to that problem is
undirected. [​https://users-cs.au.dk/bromille/dOpt/Lec11.ppt​ - TSP explanation]

As mentioned in the beginning, the tour starts and ends at the obligatory Astronomical
Clock in Prague 1.

Integer linear programming formulation


n n
function min Ѝ ∑ ∑ cij * xij
i=0 j=i,
/ j=0

n
∑ xij = 1 arrive at every sight from only one sight
i=0, i=j
/

n
∑ xij = 1 leave every sight only to one another
j=0, j=i
/

xij Ѯ {0, 1} decision variable - path goes from i to j

cij ≥ 0 time to go from i to j (compare table below)

ui − uj + n * xij ≤ n − 1 1 ≤ i =/ j ≤ n subtour elimination constraint

i, j = 0, ... , n n equals number of sights

7
Table 7: time to travel from sight ​i​ to sight ​j ​in minutes

The cij -table, where i are the rows and j the columns. Each value represents the time
that Google maps suggested for pedestrians to walk from sight i to j (in minutes).

To solve our problem we use the tool “TSP Solver and Generator” (​http://tspsg.info/​). It
computes the routing via Branch-and-Bound method. Side note: to see all 20 sights at
one day it takes 402 minutes - almost seven hours (optimal solution).

Results of the tour planning

Following, we display the tour planning with the estimated time of walking, which we
compare to a recalculation of the final tour in Google maps again. There are differences

8
between our assumption and Google’s results to roughly 20 minutes, which could either
be explained by wrong setups in the cij -table or different routing-time assumptions by
Google, when a full route is calculated. Extracts of the branch-and-bound method can be
found in the appendix.

Operations Research Class - Elderly Ladies from Denmark

160 minutes (142 minutes in Google maps)

astronomical clock - charles bridge - kafka museum - lennon wall - dancing House -
national theatre - monument of victims - strahov stadium - strahov monastery -
astronomical clock

German Football Team

242 minutes (223 minutes in Google maps)

astronomical clock - saint peter and paul basilica - dancing house - national theatre -
monument of victims - strahov stadium - strahov monastery - lennon wall - zizkov &
tower - astronomical clock

9
Conclusion

As a conclusion we can state that our methodology is functional and that we obtained
explainable results. The results are debatable. The rating of the guide and the group
happens from a subjective perspective, therefore the result from the maximization
function is not comparable to any other group. So far it is unclear whether a linear rating
from 0 to 3 stars is sufficient. Secondly, after sights are chosen, the walking time is
calculated independently from the choice of sights and vice versa. Therefore sights, which
are totally out of reach, are chosen and result in long walking distances which also
require a lot of time. It can be assumed that the joy, we wanted to increase in the first
step, will get trapped while walking from one sight to another. Further the routing only
considers the shortest path from one sight to another, but does not consider whether
some routes are overcrowded. As our approach used Google maps, it is difficult to
implement such constraints. Lastly, sights that are absolutely important for Prague are
not being reached, because a mathematical program won’t decide for it. Another
conclusion therefore is, that some sights in tour guiding must be mandatory.

New model: sub problems

In the end Martin develops a new model that he uses to find his route. Still, the visitors
choose their preferences but time is now limited by explanation time & walking

10
preferences. To solve the problem we define a problem where a sub-problem is being
solved within. Via a branch-and-bound-method every possibility can be checked and
therefore the optimum can be found. Thus, the calculation becomes quite complex and
probably time-intensive.

Following a radically simplified description:

n 7
f unction max → ∑ ∑ dx ji vi,x
x = 1i = 1

dx Ѯ {0, 1} decision variable

n
∑ dx ≤ p constraint in number of sights
x=1

m m
TSP-problem min Ѝ ∑ ∑ cgh * xgh
g=0 h=g,
/ h=0

n
m = ∑ dx
x=1

T = resulted time

n
∑ dx * tx + T ≤ 240 time constraint, e.g. 4 hours
x=1

11
APPENDIX

OR class ‘15/’16

INPUT

MAX 11.22 D1 + 15.88 D2 + 10.44 D3 + 8 D4 + 17.22 D5 + 15.66 D6 + 12.1 D7 + 18.56 D8 + 9.22 D9 + 11 D10 + 6.44 D11 + 23.66 D12

+ 13.34 D13 + 14.9 D14 + 18.9 D15 + 24.78 D16 + 7.78 D17 + 26 D18 + 14.12 D19 + 14.34 D20

SUBJECT TO

2) 5 D1 + 15 D2 + 20 D3 + 10 D4 + 25 D5 + 20 D6 + 15 D7 + 20 D8 + 10 D9 + 30 D10 + 10 D11 + 20 D12 + 10 D13 + 30 D14 + 20 D15 + 60 D16

+ 30 D17 + 10 D18 + 10 D19 + 20 D20 <= 120

3) D1 + D2 + D3 + D4 + D5 + D6 + D7 + D8 + D9 + D10 + D11 + D12 + D13 + D14 + D15 + D16 + D17 + D18 + D19 + D20 <= 10

4) D9 = 1

END

INTE 20

SOLUTION

OBJECTIVE FUNCTION VALUE

1) 150.9000

VARIABLE VALUE REDUCED COST

D1 1.000000 -11.220000

D2 1.000000 -15.880000

D8 1.000000 -18.559999

12
D9 1.000000 -9.220000

D12 1.000000 -23.660000

D13 1.000000 -13.340000

D15 1.000000 -18.900000

D18 1.000000 -26.000000

D19 1.000000 -14.120000

NO. ITERATIONS= 9

German football team case

INPUT

MAX 10 D1 + 15 D2 + 8 D3 + 6 D4 + 18 D5 + 12 D6 + 2 D7 + 10 D8 + 9 D9 + 3 D10 + 4 D11 + 14 D12 + 13 D13 + 9 D14 + 10 D15 + 13 D16 +

9 D17 + 15 D18 + 8 D19 + 12 D20

SUBJECT TO

2) 5 D1 + 15 D2 + 20 D3 + 10 D4 + 25 D5 + 20 D6 + 15 D7 + 20 D8 + 10 D9 + 30 D10 + 10 D11 + 20 D12 + 10 D13 + 30 D14 + 20 D15 + 60 D16

+ 30 D17 + 10 D18 + 10 D19 + 20 D20 <= 120 (TIME CONSTRAINT)

3) D1 + D2 + D3 + D4 + D5 + D6 + D7 + D8 + D9 + D10 + D11 + D12 + D13 + D14 + D15 + D16 + D17 + D18 + D19 + D20 <= 10 (LOCATION)

4) D9 = 1 (STARTING SIGHT)

END

INTE 20 (ALL VARIABLE ARE BINARY)

SOLUTION

OBJECTIVE FUNCTION VALUE

1) 108.0000

VARIABLE VALUE REDUCED COST

D1 1.000000 -10.000000

D2 1.000000 -15.000000

D4 1.000000 -6.000000

D5 1.000000 -18.000000

D9 1.000000 -9.000000

D12 1.000000 -14.000000

D13 1.000000 -13.000000

13
D18 1.000000 -15.000000

D19 1.000000 -8.000000

NO. ITERATIONS= 8

Elderly ladies from Denmark


INPUT

MAX 8 D1 + 10 D2 + 6 D3 + 6 D4 + 5 D5 + 13 D6 + 9 D7 + 17 D8 + 6 D9 + 12 D10 + 6 D11 + 18 D12 + 8 D13 + 12 D14 + 17 D15 + 19 D16 + D17

+ 22 D18 + 12 D19 + 9 D20

SUBJECT TO

2) 5 D1 + 15 D2 + 20 D3 + 10 D4 + 25 D5 + 20 D6 + 15 D7 + 20 D8 + 10 D9 + 30 D10 + 10 D11 + 20 D12 + 10 D13 + 30 D14 + 20 D15 + 60 D16

+ 30 D17 + 10 D18 + 10 D19 + 20 D20 <= 120 (TIME CONSTRAINT)

3) D1 + D2 + D3 + D4 + D5 + D6 + D7 + D8 + D9 + D10 + D11 + D12 + D13 + D14 + D15 + D16 + D17 + D18 + D19 + D20 <= 10 (LOCATION)

4) D9 = 1 (STARTING SIGHT)

END

INTE 20 (ALL VARIABLE ARE BINARY)

SOLUTION

OBJECTIVE FUNCTION VALUE

1) 118.0000

VARIABLE VALUE REDUCED COST

D1 1.000000 -8.000000

D2 1.000000 -10.000000

D8 1.000000 -17.000000

D9 1.000000 -6.000000

D12 1.000000 -18.000000

D13 1.000000 -8.000000

D15 1.000000 -17.000000

D18 1.000000 -22.000000

D19 1.000000 -12.000000

NO. ITERATIONS= 10

14
Routing results
Preamble: The output warns that our solutions may not be optimal. As the program is
still in beta state, but with open source code, we’ve checked the source code. The
problem is that the function ​solver.isOptimal ​has not been programmed yet and always
claims to not be optimal. Although all branches have been checked, their optimality will
not be confirmed “by design”. The results are reasonable and most certainly optimal.

OR Class - Eldery Ladies from Denmark

Task:
--- 42 18 21 41 22 24 7 17
42 --- 41 51 41 36 40 40 31
18 41 --- 9 22 5 4 10 12
21 51 9 --- 32 15 14 12 21
41 41 22 32 --- 25 28 37 29
22 36 5 15 25 --- 5 14 11
24 40 4 14 28 5 --- 16 13
7 40 10 12 37 14 16 --- 9
17 31 12 21 29 11 13 9 ---

Variant #1 Solution
Step #1
Selected route with (1;8) part.

Step #2
Selected route with (2;5) part.

Step #3
Selected route with (4;3) part.
1 alternate candidate for branching: (9;1).

Step #4
Selected route with (9;2) part.

Step #5
Selected route with (7;6) part.

Step #6
Selected route with (3;7) part.

Step #7
Selected route with (6;1) part.

15
Step #8
Selected route with (5;4) part.
1 alternate candidate for branching: (8;9).

Resulting path:
City 1 -> City 8 -> City 9 -> City 2 -> City 5 -> City 4 -> City 3 -> City 7 -> City 6 -> City 1
The price is 160 units.

WARNING!!!
This result is a record, but it may not be optimal.
Iterations need to be continued to check whether this result is optimal or get an optimal one.

German football team


Variant #1 Task
Task:
--- 42 19 43 21 41 22 7 17
42 --- 50 78 51 41 36 40 31
19 50 --- 55 37 59 40 26 35
43 78 55 --- 40 71 50 44 53
21 51 37 40 --- 32 15 12 21
41 41 59 71 32 --- 25 37 29
22 36 40 50 15 25 --- 14 11
7 40 26 44 12 37 14 --- 9
17 31 35 53 21 29 11 9 ---

Variant #1 Solution
Step #1
Selected route with (5;4) part.

Step #2
Selected route with (3;1) part.

Step #3
Selected route with (1;8) part.

Step #4
Selected route with (4;3) part.

Step #5
Selected route with (2;6) part.
2 alternate candidates for branching: (6;2), (9;7).

Step #6
Selected route with (6;7) part.

16
1 alternate candidate for branching: (9;7).

Step #7
Selected route with (9;2) part.

Step #8
Selected route with (7;5) part.
1 alternate candidate for branching: (8;9).

Resulting path:
City 1 -> City 8 -> City 9 -> City 2 -> City 6 -> City 7 -> City 5 -> City 4 -> City 3 -> City 1
The price is 242 units.

WARNING!!!
This result is a record, but it may not be optimal.
Iterations need to be continued to check whether this result is optimal or get an optimal one.

17

You might also like