This repository contains the implementation of DiffILO, an unsupervised learning approach for predicting solutions to Integer Linear Programs (ILPs).
Paper: https://openreview.net/pdf?id=FPfCUJTsCn
Note: This is the latest version, and we're still in the process of organizing and refining the code. Updates will follow. Feel free to reach out with any questions.
-
Python environment
- python 3.8
- pytorch 2.3.0
- torch-geometric 2.6
- ecole 0.8.1
- pyscipopt 4.4.0
- gurobipy 10.0
- tensorboardX
-
MILP Solver
- Gurobi 11.0.3. Academic License.
-
Hydra
- Hydra for managing hyperparameters and experiments.
To set up the environment, run the installation script:
bash scripts/environment.sh
Alternatively, create the environment from a file:
conda env create -f scripts/environment.yml
The workspace is organized as follows:
DiffILO
├── conf/ # Hydra config files
├── data/ # Dataset directory (see below)
│ ├── CA/
│ │ ├── train/
│ │ └── test/
│ ├── IS/
│ │ ├── train/
│ │ └── test/
│ └── SC/
│ ├── train/
│ └── test/
├── scripts/ # Training/testing scripts
├── src/ # Core implementation
├── preprocess.py # Data preprocessing
├── train.py # Training entry point
├── test.py # Evaluation entry point
└── README.md
The dataset is located in the data/
directory. Data instances can be in any format, as long as they are compatible with scip
and ecole
. An example dataset is available at this link.
To preprocess a dataset (e.g., SC
), run:
python preprocess.py dataset=SC num_workers=50
To train the model with default settings:
python train.py dataset=SC cuda=0
To evaluate the trained model,
python test.py dataset=SC cuda=0
If you find DiffILO useful or relevant to your research, please consider citing our paper.
@inproceedings{
geng2025differentiable,
title={Differentiable Integer Linear Programming},
author={Zijie Geng and Jie Wang and Xijun Li and Fangzhou Zhu and Jianye HAO and Bin Li and Feng Wu},
booktitle={The Thirteenth International Conference on Learning Representations},
year={2025},
url={https://openreview.net/forum?id=FPfCUJTsCn}
}