18ILP is an optimal route finder and calculator for 18XX board games. It currently supports Shikoku 1889 and uses a Integer Linear Programming (ILP) solver to determine the most profitable train routes for a given game state.
Please note that this app is heavily WIP so there is no proper documentation yet and things may break.
- Full support for Shikoku 1889
- Qt6 User Interface
- Tile placement on the game board
- Purchasing trains by railways, along with train rusting
- Optimal route display on the map
- Board state save and loading to .json file
After converting the board state to a graph, 18xx Router creates decision variables for whether a given node or edge belongs to each trains route. This is then fed along with constraints based on the Shikoku 1889 ruleset to the CBC solver which returns the optimal solution to the linear problem. See solver/pathfinder.py for the various constraints.
After cloning, set up a venv and install all required dependencies using the following command in the cloned folder:
pip install -r ./requirements.txtThen run the app:
python -m mainThe app also provides a naive brute-force implementation of the pathfinding algorithm for testing purposes with you can enable by running the app with the -b flag:
python -m main -b