An application of tabu-enhanced genetic search to the railway optimization problem introduced in the informatiCup2022 by the German Informatics Society (GI).
🥈 The project was awarded 2nd place. The project presentation can be seen on youtube.
This readme contains a usage guide for the program. The theoretical elaboration can be found in the paper.
Create a build using the following command:
cargo build --release
Then pass the input model via stdin to the binary:
cat test-cases/long/input.txt | ./target/release/rstrain
You may use the docker container to run the programm.
Create a build first:
docker build . -t rstrain
...and run it via:
cat test-cases/long/input.txt | docker run --interactive rstrain
The advanced usage of the program can be printed via the --help
flag.
USAGE:
rstrain [FLAGS] [OPTIONS]
FLAGS:
-d, --debug Prints detailed information about the result
-p, --plot Plots the fitness progress, plots are located in ./plots
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-s, --tabu-size <TABU> Size of tabu list, increase for large models (default 8000000)
-t, --time <TIME> Max search duration in milliseconds (default 600000)
-m, --t-max <TMAX> The latest time, increase when a solution with a total delay of 0 cannot be found, default
value is the latest arrival time of all passengers
The --debug
and --plot
flags come in handy, when it comes to understanding a the progess and performance of a search process for a model.
For example:
cat test-cases/long/input.txt | ./target/release/rstrain --debug --plot
plots the fitness progress into a graph and prints detailed information similar to the following example:
...
+---------------------+---------+
| duration | 0.440s |
+---------------------+---------+
| compared moves | 1365533 |
+---------------------+---------+
| compared moves / ms | 3103 |
+---------------------+---------+
| delays | 0 |
+---------------------+---------+
| arrived passengers | 721/721 |
+---------------------+---------+
| t-max | 6291 |
+---------------------+---------+
Tests can be executed via:
cargo test
A web version of the program's documentation can be created and opened using the following command:
cargo doc --open
Note: Benchmarks use unstable features of the rust programming languages, which are currently only available on the nightly channel.
Benchmarks can be run via:
cargo bench
Rusts standard code formatter rustfmt is used for ensure coding style consistency. It can be run via:
cargo fmt