Improved Search for Night Train Connections

Thorsten Gunkel∗ Matthias M¨uller-Hannemann† Mathias Schnee∗

∗Algorithms Group - TU Darmstadt †Martin-Luther-University Halle-Wittenberg

November 16, 2007

in cooperation with AG

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 1 / 20 Motivation & Introduction e"b"b Night Trains r "b"ber r r r r

Sleep in train save night in hotel win a day

Kopenhagen Kaliningrad (Königsberg)

Gdansk St. Petersburg Sassnitz (Danzig) Moskau Flensburg Kazan Stralsund Binz Gdynia (Gdingen) Chelyabinsk Usedom Novosibirsk Rostock Tczew (Dirschau) Adler Norddeich Mole Ufa Hamburg Astana

Bremen

Amsterdam Berlin Poznan (Posen) Warszawa (Warschau) Utrecht Kiev/Harkov Gelsenkir Osnabrück Donezk Hannover Simferopol Odessa chen London Halle

Duisburg Hamm Brüssel Essen Dortmund Wroclaw (Breslau) Düsseldorf L'vov (Lemberg) Hagen Köln Weimar Lüttich Krakow (Krakau) Praha (Prag) ankfurt/M Fr

Nürnberg Paris

Karlsruhe rg bu Wien Stuttgart Augsburg Salz München

Innsbruck gl Bischofshofen Zürich Wör Be Graz Narbonne r n Bludenz Villach Lausanne Chur Maribor Übersicht Nachtreise / Zugarten Bozen Timisoara Genf Brig lle tvi Lugano CityNightLine er lb A Bourg- D-Nacht Saint-Maurice Mailand Verona Venedig Modane Rijeka Belgrad EuroNight Turin Bologna

UrlaubsExpress* Rimini

DB NachtZug Florenz Ancona * Winter-/Sommersaison saisonabhängige Verkehrstage Rom Diese Übersichtskarte zeigt nur eine Pescara Auswahl an Halten. Näheres ent- nehmen Sie bitte den Fahrplänen. Neapel Stand: 10/2005 · Änderungen vorbehalten

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 2 / 20 Motivation & Introduction e"b"b Attractive Night Train Connections r "b"ber r r r r

Sufficient sleeping time No train change in the middle of the night Do not arrive too early

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 3 / 20 Motivation & Introduction e"b"b Concerning Night Trains r "b"ber r r r r

Books, Films, Music, . . .

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 4 / 20 Motivation & Introduction e"b"b Searching for Night Trains r "b"ber r r r r Finding direct connections: easy Our goal: (feeder +) night train (+ feeder)

Hamburg Hbf Hamburg Hbf

Hannover Hbf

Mannheim Hbf Karlsruhe Hbf Stuttgart Hbf Stuttgart Hbf

8h23, 2 changes, 5h19 sleep 9h54, 1 change, 8h02 sleep

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 5 / 20 Timetable information system MOTIS e"b"b MOTIS r "b"ber r r r r Multi-Objective Traffic Information System

Dijkstra-based multi-criteria search Using time expanded graph for the timetable data Provable exact minimization of travel time and interchanges Absolutely no simplifying assumptions (valid connections) Sophisticated pruning techniques (e.g. domination by terminal)

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 6 / 20 Timetable information system MOTIS e"b"b Relaxed Pareto Dominance r "b"ber r r r r

Travel Inter- Price Pareto relaxed time changes optimal P-opt √ √ c 180 1 45,00 1 √ √ c 190 0 42,50 2 √ √ c 185 1 41,00 3 √ c4 240 1 38,00 ∗ √ c5 182 1 45,00

∗ 1 hour later

Relaxed Pareto-Dominance: Takes other critiera into account, e.g.: hourly wages, differences in departure times, train classes . . .

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 7 / 20 Timetable information system MOTIS e"b"b More MOTIS r "b"ber r r r r

Attractive alternatives using relaxed Pareto-optimality (ATMOS 04)

Enhancement for efficient search for special tariffs (ATMOS 05) Extendable to other criteria (e.g. interchange security)

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 8 / 20 Approach I: Pre-Selection of Night Trains e"b"b Pre-Selection of Night Trains r "b"ber r r r r

Only few night trains Amongst ca. 57,000 trains only 229 night trains (in July 07) → enumerative approach:

All night trains in/through

1 Iterate over all night trains on query day 2 Determine possible entry and exit points for each night train 3 For each entry/exit pair determine feeder sections 4 Apply relaxed Pareto dominance on result set

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 9 / 20 Approach I: Pre-Selection of Night Trains e"b"b Selection of Entry and Exit points r "b"ber r r r r

Night Train Alternative entrance Alternative exit Entrance Exit

a b

c Start station Terminal station

Entry and exit close to source or terminal station Enough sleeping time No unreasonable detours

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 10 / 20 Approach I: Pre-Selection of Night Trains e"b"b Speedup r "b"ber r r r r

Priority queue to determine order of feeder computations Parameter tuning e.g. minimum sleeping time gain for “staying longer in train” Caching of feeder search results only 25% feeder searches necessary Variant: Single-Criterion MOTIS for feeder

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 11 / 20 Approach II: Additional Search Criterion e"b"b Sleeping Time as an Additional Criterion r "b"ber r r r r

MOTIS designed to handle multiple criteria Still a challenge, because: we do not have a minimization problem (opposed to travel time, interchanges, price, . . . ) we do not want to maximize at all cost we have the trade off: sleeping time gain vs. travel time increase → involved modification to domination rules required

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 12 / 20 Approach II: Additional Search Criterion e"b"b Domination Rules r "b"ber r r r r

Relevant characteristics to consider Values for the criteria Complete or partial connection

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 13 / 20 Approach II: Additional Search Criterion e"b"b Domination Rules r "b"ber r r r r

Relevant characteristics to consider now Values for the other criteria (estimate of) sleeping time Complete or partial connection Usage of night train: used and left a night train currently in night train used no night train at all (estimate of) sleeping time high enough or not

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 14 / 20 Computational Study e"b"b Setup for Study r "b"ber r r r r

Processed around 2,000 real queries 20% direct night train 52% needed one feeder 28% needed two feeders Removed results without enough sleeping time Applied standard Pareto-dominance Tested on off the shelf hardware (Athlon 64X2 with 2.4 GHz)

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 15 / 20 Computational Study e"b"b Test Results r "b"ber r r r r

Algorithm A B C D connections 2334 4223 3939 3196 no night train 20% 0% 0% 2.4% run time 1.87s 14.20s 3.72s 2.34s

win % loss % match % A Standard MOTIS (6:00pm to 2:00am) B vs. C 2.7 0.7 96.6 B Enumerative Approach C Enumerative Approach B vs. D 18.0 13.0 69.0 with fast feeder computation D MOTIS with sleeping time as C vs. D 17.5 14.0 68.5 additional criterion

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 16 / 20 →

Wrapping it up e"b"b Recommendation r "b"ber r r r r

Two scenarios for application:

User explicitly asks for night train connection → use pre-selection algorithm with fast feeder computation because of its excellent quality

User asks for connections departing in the evening or arriving early in the morning → use MOTIS with additional criterion spending only little extra time

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 17 / 20 Wrapping it up e"b"b Current (and Future) Work r "b"ber r r r r Recommendations under delays Multi-criteria search on time dependent graphs Mass transit Additional speed up techniques New features in prototype Simulated real-time delay feed Interchange security

Open Ph.D. or post-doc positions in Halle and Darmstadt

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 18 / 20 Wrapping it up e"b"b Demo r "b"ber r r r r

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 19 / 20 Wrapping it up e"b"b Time for Questions r "b"ber r r r r

Any Questions?

Gunkel, M¨uller-Hannemann, Schnee Night Train Search November 16, 2007 20 / 20