Theory of Computing Systems

, Volume 62, Issue 3, pp 600–621 | Cite as

Computing and Listing st-Paths in Public Transportation Networks

  • Kateřina Böhmová
  • Luca Häfliger
  • Matúš Mihalák
  • Tobias Pröger
  • Gustavo Sacomoto
  • Marie-France Sagot


Given a set of directed paths (called lines) L, a public transportation network is a directed graph G L = (V L , A L ) which contains exactly the vertices and arcs of every line lL. An st-route is a pair (π, γ) where γ = 〈l 1,…, l h 〉 is a line sequence and π is an st-path in G L which is the concatenation of subpaths of the lines l 1,…, l h , in this order. Given a threshold β, we present an algorithm for listing all st-paths π for which a route (π, γ) with |γ| ≤ β exists, and we show that the running time of this algorithm is polynomial with respect to the input and the output size. We also present an algorithm for listing all line sequences γ with |γ| ≤ β for which a route (π, γ) exists, and show how to speed it up using preprocessing. Moreover, we show that for the problem of finding an st-route (π, γ) that minimizes the number of different lines in γ, even computing an \(o(\log |V|)\)-approximation is NP-hard.


Listing algorithm Public transportation NP-hardness 



We thank the anonymous reviewers for pointing out how the running times of our listing algorithms can be improved by a factor of Θ(logM) and for providing additional valuable feedback. Furthermore we thank Peter Widmayer for many helpful discussions.


  1. 1.
    Bast, H., Delling, D., Goldberg, A.V., Müller-Hannemann, M., Pajor, T., Sanders, P., Wagner, D., Werneck, R.F.: Route planning in transportation networks (2015). CoRR arXiv:1504.05140
  2. 2.
    Bezem, G., Leeuwen, J.V.: Enumeration in graphs. Tech. Rep. RUU-CS-87-07. Utrecht University (1987)Google Scholar
  3. 3.
    Birmelé, E., Ferreira, R.A., Grossi, R., Marino, A., Pisanti, N., Rizzi, R., Sacomoto, G.: Optimal listing of cycles and st-paths in undirected graphs. In: SODA 2013, pp. 1884–1896 (2013)Google Scholar
  4. 4.
    Böhmová, K., Mihalák, M., Neubert, P., Pröger, T., Widmayer, P.: Robust routing in urban public transportation: Evaluating strategies that learn from the past. In: ATMOS 2015, pp. 68–81 (2015)Google Scholar
  5. 5.
    Böhmová, K., Mihalák, M., Pröger, T., Sacomoto, G., Sagot, M.: Computing and listing st-paths in public transportation networks. In: CSR 2016, pp. 102–116 (2016)Google Scholar
  6. 6.
    Böhmová, K., Mihalák, M., Pröger, T., Šrámek, R., Widmayer, P.: Robust routing in urban public transportation: How to find reliable journeys based on past observations. In: ATMOS 2013, pp. 27–41 (2013)Google Scholar
  7. 7.
    Böhmová, K., Mihalák, M., Pröger, T., Widmayer, P.: Modelling urban public transportation networks to support robust routing. In: CASPT 2015 (2015)Google Scholar
  8. 8.
    Brodal, G.S., Jacob, R.: Time-dependent networks as models to achieve fast exact time-table queries. Electr. Notes Theor. Comput. Sci 92, 3–15 (2004)CrossRefMATHGoogle Scholar
  9. 9.
    Dial, R.B.: Algorithm 360: shortest-path forest with topological ordering. Commun. ACM 12(11), 632–633 (1969)CrossRefGoogle Scholar
  10. 10.
    Dijkstra, E.W.: A note on two problems in connexion with graphs. Numer. Math. 1(1), 269–271 (1959)MathSciNetCrossRefMATHGoogle Scholar
  11. 11.
    Dinur, I., Steurer, D.: Analytical approach to parallel repetition. In: STOC 2014, pp. 624–633 (2014)Google Scholar
  12. 12.
    Disser, Y., Müller-Hannemann, M., Schnee, M.: Multi-criteria shortest paths in time-dependent train networks. In: WEA 2008, pp. 347–361 (2008)Google Scholar
  13. 13.
    Eppstein, D.: Finding the k shortest paths. SIAM J. Comput. 28(2), 652–673 (1998)MathSciNetCrossRefMATHGoogle Scholar
  14. 14.
    Firmani, D., Italiano, G.F., Laura, L., Santaroni, F.: Is timetabling routing always reliable for public transport? In: ATMOS 2013, pp. 15–26 2013. doi: 10.4230/OASIcs.ATMOS.2013.15
  15. 15.
    Fredman, M.L., Tarjan, R.E.: Fibonacci heaps and their uses in improved network optimization algorithms. J. ACM 34(3), 596–615 (1987)MathSciNetCrossRefGoogle Scholar
  16. 16.
    Johnson, D.B.: Finding all the elementary circuits of a directed graph. SIAM J. Comput. 4(1), 77–84 (1975)MathSciNetCrossRefMATHGoogle Scholar
  17. 17.
    Johnson, D.S., Papadimitriou, C.H., Yannakakis, M.: On generating all maximal independent sets. Inf. Process. Lett. 27(3), 119–123 (1988)MathSciNetCrossRefMATHGoogle Scholar
  18. 18.
    Katoh, N., Ibaraki, T., Mine, H.: An efficient algorithm for k shortest simple paths. Networks 12(4), 411–427 (1982)MathSciNetCrossRefMATHGoogle Scholar
  19. 19.
    Lawler, E.L.: A procedure for computing the k best solutions to discrete optimization problems and its application to the shortest path problem. Mgmt. Sci 18, 401–405 (1972)MathSciNetCrossRefMATHGoogle Scholar
  20. 20.
    Müller-Hannemann, M., Schulz, F., Wagner, D., Zaroliagis, C.D.: Timetable information: Models and algorithms. In: ATMOS 2004, pp. 67–90 (2004)Google Scholar
  21. 21.
    Nguyen, S., Pallottino, S., Gendreau, M.: Implicit enumeration of hyperpaths in a logit model for transit networks. Transp. Sci. 32(1), 54–64 (1998)CrossRefMATHGoogle Scholar
  22. 22.
    Rizzi, R., Sacomoto, G., Sagot, M.: Efficiently listing bounded length st-paths. In: IWOCA 2014, pp. 318–329 (2014)Google Scholar
  23. 23.
    Schulz, F., Wagner, D., Zaroliagis, C.D.: Using multi-level graphs for timetable information in railway systems. In: ALENEX 2002, pp. 43–59 (2002)Google Scholar
  24. 24.
    Tulp, E., Siklȯssy, L.: Trains, an active time-table searcher. In: ECAI 1988, pp. 170–175 (1988)Google Scholar
  25. 25.
    Vo, K.D., Pham, T.V., Nguyen, H.T., Nguyen, N., Hoai, T.V.: Finding alternative paths in city bus networks. In: IC3INA 2015, pp. 34–39 (2015)Google Scholar
  26. 26.
    Xu, W., He, S., Song, R., Chaudhry, S.S.: Finding the K shortest paths in a schedule-based transit network. Comput. OR 39(8), 1812–1826 (2012)MathSciNetCrossRefMATHGoogle Scholar
  27. 27.
    Yen, J.Y.: Finding the k shortest loopless paths in a network. Mgmt. Sci. 17, 712–716 (1971)MathSciNetCrossRefMATHGoogle Scholar
  28. 28.
    Yuan, S., Varma, S., Jue, J.P.: Minimum-color path problems for reliability in mesh networks. In: INFOCOM 2005, pp. 2658–2669 (2005)Google Scholar

Copyright information

© Springer Science+Business Media New York 2017

Authors and Affiliations

  • Kateřina Böhmová
    • 1
  • Luca Häfliger
    • 1
  • Matúš Mihalák
    • 2
  • Tobias Pröger
    • 1
  • Gustavo Sacomoto
    • 3
    • 4
  • Marie-France Sagot
    • 3
    • 4
  1. 1.Department of Computer ScienceETH ZürichZürichSwitzerland
  2. 2.Department of Knowledge EngineeringMaastricht UniversityMaastrichtThe Netherlands
  3. 3.INRIA Grenoble Rhône-AlpesMontbonnot-Saint-MartinFrance
  4. 4.UMR CNRS 5558 – LBBE, Université Lyon 1LyonFrance

Personalised recommendations