Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reinforcement Learning Guided Neural Deconstruction Search for Flexible Job Scheduling

High-level diagram of NDS-S

Official repository of the paper "Reinforcement Learning Guided Neural Deconstruction Search for Flexible Job Scheduling", published in Machine Learning (Springer).

This repository contains the implementation of Neural Deconstruction Search for scheduling (NDS-S). The code supports both the Job Shop Scheduling Problem (JSSP) and the Flexible Job Shop Scheduling Problem (FJSSP), including learned deconstruction operators, destroy-repair baselines, and synthetic dataset generation.

The main entry points are:

  • ndss/train.py: train an NDS-S deconstruction model.
  • ndss/eval.py: evaluate a trained model or a baseline.
  • data/generate_dataset.py: generate synthetic JSSP/FJSSP datasets.

Scheduling primitives and repair operators are implemented in C++ under ndss/src/cpp/jssp/ and loaded from Python with cppimport and pybind11.

Repository Layout

.
|-- baselines/             # PyJobShop CP-SAT baselines
|-- data/                  # benchmark instances, validation sets, generator
|-- models/                # pretrained NDS-S checkpoints
|-- ndss/
|   |-- configs/           # train/eval configuration files
|   |-- src/               # model, environments, search, baselines
|   |-- train.py           # training entry point
|   `-- eval.py            # evaluation entry point
`-- scripts/               # convenience scripts for experiments

Setup

Use a Python environment with a PyTorch build matching your CPU/CUDA setup. The first run compiles the C++ extension, so a C++14 compiler is required.

# Install torch and torch-geometric following their platform instructions.
pip install hydra-core omegaconf numpy matplotlib pytz cppimport pybind11 wandb

The PyJobShop CP-SAT baseline scripts additionally require:

pip install pyjobshop

For runs without Weights & Biases, pass logger_params.wandb.enable=False to training commands.

Data

The repository includes benchmark instances and serialized validation/ablation sets:

  • data/jssp/*.csv: JSSP benchmark instances.
  • data/fjssp/*.fjs: FJSSP benchmark instances.
  • data/*.pt: serialized datasets used by the configs and scripts.

Example synthetic dataset generation:

python data/generate_dataset.py \
  --problem jssp \
  --name validation \
  --dataset_size 200 \
  --seed 0 \
  --num_jobs 20 \
  --num_machines 20

For FJSSP generation, use --problem fjssp and provide operation, alternative, and duration ranges; see python data/generate_dataset.py --help.

Training

Training is configured by files in ndss/configs/train/. A typical JSSP run is:

python ndss/train.py jssp.yaml \
  logger_params.desc=jssp_run \
  logger_params.wandb.enable=False

For FJSSP, use one of the FJSSP configs, for example:

python ndss/train.py fjssp.yaml \
  logger_params.desc=fjssp_run \
  logger_params.wandb.enable=False

Training outputs are written under results/<logger_params.desc>/ by default, including logs and checkpoint files.

Evaluation

Evaluation is configured by files in ndss/configs/eval/. Replace CHECKPOINT_DIR with a directory containing checkpoint-<epoch>.pt.

python ndss/eval.py jssp.yaml \
  tester_params.test_data_load.filename=data/jssp_ablation_dataset.pt \
  tester_params.model_load.0.path=CHECKPOINT_DIR \
  tester_params.model_load.0.epoch=1000 \
  tester_params.max_runtime=60 \
  logger_params.filepath=eval_outputs/jssp \
  logger_params.desc=""

For FJSSP, use fjssp.yaml and an FJSSP dataset such as data/fjssp_ablation_dataset.pt.

To run a destroy-repair baseline instead of a neural model, use the provided ablation scripts or set the baseline flags in the evaluation config.

Evaluation writes log.txt, results.csv, and solutions.csv to the selected output directory.

Experiment Scripts

The scripts in scripts/ reproduce the experiments reported in the paper.

bash scripts/run_eval_jssp.sh <model_path> <epoch> <max_runtime>
bash scripts/run_eval_fjssp.sh <model_path> <epoch> <max_runtime>

Runtime and ablation scripts are also provided for both JSSP and FJSSP.

bash scripts/run_eval_jssp_runtime.sh
bash scripts/run_eval_fjssp_runtime.sh
bash scripts/run_jssp_ablation_0_nds.sh
bash scriptsrun_jssp_ablation_1_order.sh
...
bash scripts/run_fjssp_ablation_0_nds.sh
bash scripts/run_fjssp_ablation_1_order.sh
...

Citation

If you use this code in your research, find our method useful, or compare against NDS-S in your benchmarks, please cite our paper:

@article{zago2026ndss,
  author    = {Zago, Davide and Hottung, Andr{\'e} and Gilbert, Fynn Martin and Cancelliere, Rossella and Tierney, Kevin},
  title     = {Reinforcement Learning Guided Neural Deconstruction Search for Flexible Job Scheduling},
  journal   = {Machine Learning},
  volume    = {115},
  number    = {180},
  year      = {2026},
  month     = {jul},
  publisher = {Springer},
  doi       = {10.1007/s10994-026-07116-9},
  url       = {https://doi.org}
}

About

Official repository of the paper "Reinforcement Learning Guided Neural Deconstruction Search for Flexible Job Scheduling" published in Machine Learning (Springer)

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages