Travel and Assignment Planning Software in Python

Software Architecture

Software Architecture

From 8/2015 to 5/2018 I worked for a Swiss company named ETC Transport Consultants as senior data analyst and developer on a part-time basis (60%). Within this time period, in less than three years, I developed a complete solution for Travel and Assignment Planning in Python -with the help of ETC team of course- that accomplished following tasks in an integrated process:

  1. Top-down distribution of measurement requirements (see introduction)
  2. Travel Planning (based on 60+ logical search conditions & constraints)
  3. Assignment Planning (based on 20+ assignment conditions + nonlinear/discrete optimization)
  4. Export of results into excel files (reporting)

You may download my official work certificate from ETC (pdf file) which provides a good overview about this development project.

Travel Planning

Planning Process

Planning Process

Searching, evaluating and sorting optimal tours (with public transport vehicles like train, tram or bus) that are found according to given set of search conditions in planning software…

The planning software is based on central timetable data (HAFAS data) for Switzerland, that include information like departure and arrival times for every transport line. In the simple central architecture of this planning software there are Python modules and PostgreSQL database containing the timetable data, and nothing else.

The tour planning algorithm I developed is based on time-dependent (dynamic) graphs, or time-dependent decision trees with multiple choices (i.e. edges) at each node. The really interesting part of the project was, step-by-step improving (a) historical evaluation of the paths, and (b) foresight into the future, in order to design better constraints, and to make better (more intelligent) decisions that reduce futile search and runtime. This logical & mathematical background can be applied in many fields related with dynamic graphs and decision trees.

Assignment Planning

Assignment of selected tours to test customers (recruited travelers who measure various quality criteria of the public transport vehicles) according to given set of assignment conditions, including the preferences of test customers like availability, minimum or maximum number of tours in a week, and so on.

In that sense, assignment planning is a kind of resource planning, or resource optimization module of the whole planning software (discrete optimization with nonlinear logical constraints). Because the existing optimization modules of Python I had tested (like Pyomo) were not flexible enough (esp. for non-linear logical constraints) I had to develop a totally new discrete resource optimization algorithm from scratch.

The same optimization algorithm can be applied in many different cases where two kinds of resources should be mapped (or assigned) to each other, like tours and travelers, teachers and classes, students and teachers, drivers and cars, and so on.

For more technical information about this planning software you may download ETC Project Summary (pdf file).

Travel (tour) planning example with simple constraints

Find all possible tours from Zürich to Bern that pass from given stations in given order.
Earliest departure from Zurich: 8:30 (latest departure at 9:00)
Earliest arrival to Bern: 8:30 + 90 minutes = 10:00
Latest arrival to Bern: 8:30 + 180 minutes = 11:30
Path: Zürich->Baden->Aarau->Olten-> … ->Solothurn->Bern

Map from Zürich to Bern

Map from Zürich to Bern

Assigning values to search parameters:
Assigning values to search parameters

Search conditions and constraints:
Search conditions and constraints

Search algorithm of tour planning finds 6 tours that satisfy all the conditions and constraints. A tour is displayed with all its departure and arrival station pairs:
Result of tour search

You don’t need a monopolistic and expensive corporate software for complex travel or resource planning.
You may contact me for knowhow transfer, training or development.

This entry was posted in Uncategorized and tagged , , , , , . Bookmark the permalink.

Leave a Reply