Can I take all ICE trains in order?
Find a file
Giles Antonio Radford 8d9fc2592d ignored .env
2025-11-24 15:26:00 +01:00
ice_challenge Change the range of dates to 4 days 2025-11-24 14:52:34 +01:00
.gitignore ignored .env 2025-11-24 15:26:00 +01:00
.python-version Initial checkin - inital download of GTFS Data, still need to fix progress bars. 2025-11-13 16:44:12 +01:00
bahn-expert-data-format.md The prepare_data_sqlalchemy script now works correctly using. Need to clean up before merging into main, where I'll be removing the GTFS stuff. 2025-11-18 18:53:23 +01:00
pyproject.toml Added information to the readme, and commands to pyproject.toml 2025-11-23 21:02:22 +01:00
README.md Added information to the readme, and commands to pyproject.toml 2025-11-23 21:02:22 +01:00
run.sh Added a shell script to run the full script 2025-11-24 15:25:51 +01:00
uv.lock doesn't work, still got my trips messed up.. but actually uses database. 2025-11-23 11:05:46 +01:00

ICE Age Challenge

This is a bunch of scripts to try to compute the optimal path for the ICE Age Challenge

The Challenge

The started from a comment by @quixoticgeek who said:

Clearly the challenge is to see if you can ride the complete set in one day. Ice 1, 2, 3, t, 3m, 3neo, 4, and L

The rules are thus:

  • take all active ICE models in order, preferably only once
  • finish in Köln to catch the ICE-L on the first day of service
  • one trip between any two stations on each model will suffice
  • I am allowed overnight stops somewhere
  • I can take the same model of ICE multiple times, but only in sequence (so 2, 2, T is valid, but not 2, T, 2)
  • non-ICE trains are valid at any point, in order to maintain the ICE sequence (particularly useful if bahned)
  • all 2s and 4s and Ts are equivalent. Im not chasing down a 402 and an 801, similarly, not having to do a 4 short and a 4 long.
  • if there are 3Ms and TDs in museums, a break to visit them should happen, preferably in sequence or as close to it as possible (genuinely need flexibility here as very few ICEs go to Koblenz) (there aren't)
  • as a bonus, take the other Talgo 230, the EuroCity from Copenhagen to Hamburg

The models I can take are (in order):

  • ICE 1 - 401
  • ICE 2 - 402/801
  • ICE T - 411
  • ICE 3 - 403
  • ICE 3MS (ICE V) - 407
  • ICE 4 - 412
  • ICE 3neo - 408
  • ICE L - 105

Preparing Data

$ uv run prepare-data

This will download the data into a sqlite file: data/transit.db

Running the calculations

uv run calculate-itinerary > log.log 2>&1

This will calculate possible itineraries, using a breadth-first search. It will say at the end how many itineraries it has returned, but some of them appear to be duplicates. The itineraries are saved to the database.

Viewing the itineraries

uv run print-definite-itineraries

This will run through all the Definite Itineraries in the database, and then output them in a directory called output, which is then further sorted by starting station. This will remove some of the duplicates in the database, as the file names get clobbered.