Algorithm for Generating Train Calendar Texts

  • Karel Greiner
Keywords: railway calendar, railway timetable, generating text


The article describes a possibility of generating train calendar text for the needs of compiling the annual timetable in the conditions of the Czech Republic. Based on the analysis of the types of texts of calendars that appear in various print outputs, a heuristic algorithm was designed to generate a text from a set of calendar days. The algorithm is a part of an application that also provides a tool to define the text of the calendar by using a mask of sub-periods and calendars to be displayed in them. The algorithm was tested on real data of the timetable. In most cases, the algorithm shows the same or better results than the previously used tools. In several cases, however, a better result can be obtained by the user. The described algorithm to generate the text of the calendar is a part of a program that is used for compiling the timetable for trains in the Czech Republic.


Bachratý, H., Šotek, K.: Koncepce směřující k inovaci tvorby jízdního řádu v železniční dopravě. In INFOTRANS 2009. Pardubice: University of Pardubice, 2009. p. 117–126. ISBN 978-80-7395-171-9.

Greiner, K.: Information System of Railway Undertakings Train Track Requirements. PROMET – Traffic & Transportation. Zagreb: Sveučilište u Zagrebu, 2011, vol. 23, no. 2, p. 141 – 146. ISSN 0353-5320.

Knižní jízdní řády [online]. 2013 [cit. 2013-01-09]. Available from: <>.

Bachratý, H., Kršák, E., Sadloň, L., Tavač, M.: Príspevok ku generovaniu textových popisov bitových kalendárov. Perner’s Contacts [online]. Pardubice: University of Pardubice, 2008, Vol. 3., No. 5. p. 6–15 [cit. 2013-01-09]. Available from: <>. ISSN 1801-674X.

Greiner, K.: Centrální editor vlaků Českých drah. In INFOTRANS 2002. Pardubice: University of Pardubice, 2002. ISBN 80-7194-419-X.

How to Cite
Greiner K. Algorithm for Generating Train Calendar Texts. Promet [Internet]. 1 [cited 2024Feb.24];25(2):99-107. Available from: