Skip to content

AnasNeumann/gns2

Repository files navigation

Engineer-To-Order (ETO) Graph Neural Scheduling (GNS) Project [version 2]

A Graph Attention Network (GAT) to schedule jobs in an ETO manufacturing environment, trained with a Multi-Agent version of the Deep Q-Learning algorithm.

Refer to this repository in scientific documents

Neumann, Anas (2025). A hyper-graph neural network trained with multi-agents deep Q-learning to schedule engineer-to-order projects *GitHub repository: https://github.com/AnasNeumann/gns2*.

    @misc{HGNS,
    author = {Anas Neumann},
    title = {A hyper-graph neural network trained with multi-agents deep Q-learning to schedule engineer-to-order projects},
    year = {2025},
    publisher = {GitHub},
    journal = {GitHub repository},
    howpublished = {\url{https://github.com/AnasNeumann/gns2}},
    commit = {main}
    }

Locally try the project

  1. python -m venv ./gns2_env
  2. source ./gns2_env/bin/activate
  3. pip install --upgrade -r requirements/gns_wheels.txt
  4. CHOOSE EITHER GNS_SOLVER, EXACT_SOLVER, INSTANCE_GENERATOR, or RESULTS_ANALYS (see bellow for the rest)
  5. desactivate

Generate a dataset of training and test instances

python generators/instance_generator.py --debug=false --train=150 --test=50

Use CP solver to get optimal values

python solvers/exact_solver.py --size=s --id=151 --mode=test --path=./ --time=1 --memory=8

Build and run SLURM jobs to execute the exact solver on DRAC super-computers

python jobs/exact_builder.py --account=x --parent=y --mail=x@mail.com
bash jobs/scripts/0_run_purge.sh
bash jobs/scripts/1_run_all.sh exact_s

Use the GNS2 solver (inference mode) to get good heuristic values

python main.py --train=false --target=true --path=./ --mode=test --version=1 --itrs=0 --size=s --id=151  --interactive=false # one instance only
python main.py --train=false --target=false --path=./ --mode=prod --version=1 --itrs=0 --interactive=false # all test instances

Train the GNS2 solver using e-greedy DQN

python main.py --train=true --path=./ --mode=prod --version=1 --itrs=0 --interactive=true

Build and run SLURM jobs to train the GNS2 solver on DRAC super-computers

jobs/gns_builder.py --account=x --parent=y --mail=x@mail.com --time=20 --memory=187 --cpu=16 --version=1 --itrs=0
sbatch jobs/scripts/train_gns.sh

Analyze the final results

python results_analysis.py --path=./ --last=9

About

DQN-trained GNN solver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published