Downloads · 30 days
0
Almanach-HF/flowshop_transformer
flowshop_transformer is a machine learning model from Almanach-HF. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
The goal of this project is to explore the applicability of the Transformer architecture to solve an NP-Hard combinatorial optimization problem (COP). For this study, we choose to focus on a single COP known as the pe…
Downloads · 30 days
0
Access
Public
Updated Mar 17, 2026
Repo size
22.3 GB
Likes
0
Public
Click a slice to open those files.
.pth12.3 GB · 58%
From the Hugging Face model README
The goal of this project is to explore the applicability of the Transformer architecture to solve an NP-Hard combinatorial optimization problem (COP). For this study, we choose to focus on a single COP known as the permuation flowshop problem (PFSP), where we seek to schedule the launch of several jobs to go through a chain of machines with the goal of reducing total completion time also known as the MakeSpan. To apply the Transformer architecture to the PFSP, we consider the jobs as tokens to which learned embeddings can be associated, and we investigate an approach involving two learning phases: (1) in the first phase, we train our Transformer network to act as a surogate to the MakeSpan objective function (2) in the second phase, we recover the schedule using learnable schedule embeddings combined with the trained Transformer surrogate to minimize the MakeSpan over a continuous space while also leveraging a regularization strategy matching the schedule embeddings to trained job embeddings.
Challenges:
The Permutation Flow-Shop Problem (PFSP) considers a ( Jobs x Machines ) matrix, where each job requires some processing time in each machine, the notable constraints being:

Different launch sequences result in different completion times of all the jobs. The goal is to find the sequence that minimizes the completion time (MakeSpan).This NP-Hard problem is of great importance in modern industry and to reduce production time, energy consumption, and generated pollution.
<img src="presentation/schemas/Screenshot from 2026-02-09 14-21-56.png" width="500"> <img src="presentation/schemas/gantt_1_2_0.png" width="600"> <img src="presentation/schemas/gantt_0_2_1.png" width="600">Given an PFSP instance, i.e. a Jobs x Machines matrix, the idea we would like to investigate is to recover an optimal/pseudo-optimal schedule using a two learning phases process:
<img src="presentation/schemas/global_architecture.png" width="1200">Phase 1: In this phase, the goal is to train a neural model (which we will call the objective surrogate or simply surrogate) to learn latent job embeddings and to predict/estimate the MakeSpan associated with job schedules that are represented as sequences of those job embeddings, specifically:
Phase 2: In the second phase, we recover the optimal/pseudo-optimal job schedule in the following way:
Other approaches could be to use the Sinkhorn-Gumbel regularization porposed by 'Gonzalo Mena, David Belanger, Scott Linderman, & Jasper Snoek. (2018). Learning Latent Permutations with Gumbel-Sinkhorn Networks'.
This project will envolve several aspects related to the course, at least:
Finding an appropriate neural net architecture that can model the right inductive biases for solving our task $\rightarrow$ course 3: Architectures.
The exploratory nature of this project will involve some visualizations to investigate the behavior of the proposed model, such as the similarity matrix obtained at the end of the optimization in phase 2 $\rightarrow$ course 2: Interpretability: visualization and analysis.
Controlling the bias in the generated dataset, such as the ratio of good and bad PFSP schedules $\rightarrow$ course 4: Issues with datasets.
We begin with small PFSP instances (with a few jobs like 5 to 9 jobs, 2 to 5 machines) to see how capable the neural model is to recover optimal solutions. We will probably consider these two experiment variants:
We increase afterwards the size of our PFSP instances and/or move to literature benchmarks like Taillard's.
We compare ourselves essentially with classical approaches for solving PFSP, as to the best of our knowledge, this is the first time a fully neural based approach is proposed to solve this problem, though a close paper exists that also targets PFSP with a neural model but employs a much different strategy and focuses on a different objective function other than MakeSpan, known as Total Flow Time (see I. Garmendia, A., Ceberio, J., & Mendiburu, A. (2024). Applicability of Neural Combinatorial Optimization: A Critical View. ACM Trans. Evol. Learn. Optim., 4(3).)
I. Garmendia, A., Ceberio, J., & Mendiburu, A. (2024). Applicability of Neural Combinatorial Optimization: A Critical View. ACM Trans. Evol. Learn. Optim., 4(3).
Gonzalo Mena, David Belanger, Scott Linderman, & Jasper Snoek. (2018). Learning Latent Permutations with Gumbel-Sinkhorn Networks'
E. Taillard (1993). Benchmarks for basic scheduling problems. European Journal of Operational Research, 64(2), 278-285.