Attention-based Reinforcement Learning for Combinatorial Optimization: Application to Job Shop Scheduling Problem

Jaejin Lee, Seho Kee, Mani Janakiram, George RungerarXiv 2024 · DOI

Introduction

The Job Shop Scheduling Problem (JSSP) represents a fundamental challenge in operations research and industrial engineering. Classified as NP-hard, the problem involves scheduling a set of jobs on a set of machines, where each job consists of a sequence of operations that must be performed in a specific order on designated machines. The primary objective is typically to minimize the makespan—the total time required to complete all operations.

Historically, JSSP has been approached through two main avenues: exact solvers and priority rule-based heuristics. While exact solvers guarantee optimal solutions, their computational requirements grow exponentially with problem size, making them impractical for large-scale industrial applications. Conversely, heuristics like First-In-First-Out (FIFO) or Shortest Processing Time (SPT) are computationally efficient but often yield sub-optimal schedules. Recent advancements in Reinforcement Learning (RL) have attempted to bridge this gap, yet many existing models suffer from poor scalability and "brittleness," failing to generalize when the number of jobs or machines deviates from the training environment. This paper introduces the Attention-based Reinforcement Learning Scheduler (ARLS), a framework designed to learn the underlying logic of scheduling in a size-agnostic manner.

The ARLS Framework

The core innovation of ARLS is the adaptation of the Transformer architecture—originally designed for sequence modeling in natural language processing—to the domain of combinatorial optimization. The model is structured to handle the two primary constraints of JSSP: conjunctive constraints (the order of operations within a job) and disjunctive constraints (the competition for machine resources).

Dual-Encoder Strategy

To effectively capture these constraints, ARLS employs a dual-encoder architecture:

  1. Job-based Encoder: This component focuses on the sequential dependencies within individual jobs, ensuring the model respects the required processing order.
  2. Machine-based Encoder: This component analyzes the shared resource constraints, identifying potential bottlenecks where multiple jobs compete for the same machine.

These two perspectives are integrated using a convex combination governed by a weighting factor ($\lambda$). This allows the model to dynamically balance job-flow requirements against machine availability during the decision-making process.

Attention and Masking

Unlike previous approaches that utilized Graph Neural Networks (GNNs) to represent the disjunctive graph of a JSSP, ARLS leverages the self-attention mechanism. By applying specific masking, the model ensures that each operation only "attends" to relevant counterparts—specifically those within the same job or those assigned to the same machine. This targeted attention allows the model to build a sparse but highly relevant representation of the problem state.

Training Methodology

ARLS is trained using a modified Monte-Carlo policy gradient method. Because JSSP is a constructive task—where a schedule is built step-by-step—the model learns a policy that selects the next operation to be scheduled from a set of available candidates.

To stabilize the learning process, the authors implement a multi-trajectory baseline. During training, the model generates multiple potential schedules (trajectories) for a single problem instance. The average makespan of these trajectories serves as a baseline; the model is then rewarded for producing schedules that outperform this average. This approach reduces variance and helps the model distinguish between high-quality policy decisions and random successes.

Experimental Results

The performance of ARLS was evaluated using both synthetic data and classic academic benchmarks (including ABZ, FT, YN, SWV, ORB, TA, and DMU).

Generalization and Scalability

A defining feature of ARLS is its ability to generalize from small to large problem instances. The model was trained exclusively on synthetic $6 \times 6$ problems (6 jobs, 6 machines). Despite this limited training scope, it demonstrated remarkable performance on much larger instances, including $100 \times 20$ problems. This "zero-shot" scaling capability suggests that the attention mechanism successfully captures the fundamental "physics" of scheduling rather than merely memorizing patterns specific to a certain problem size.

Comparative Performance

In direct comparison with previous state-of-the-art (SOTA) RL models, such as the work by Zhang et al. (2020), ARLS achieved a 12.5% improvement in makespan reduction on synthetic test sets. Furthermore, across 26 different problem classes in classic benchmarks, ARLS achieved the best performance in 22 instances. It consistently outperformed standard industry heuristics like Most Work Remaining (MWKR) and remained highly competitive with best-known solutions even on the massive Taillard (TA) benchmarks.

Conclusion

The Attention-based Reinforcement Learning Scheduler (ARLS) represents a significant step forward in applying deep learning to combinatorial optimization. By utilizing a dual-encoder Transformer architecture and a robust policy gradient training strategy, the authors have developed a model that is both high-performing and highly scalable.

Future work may explore increasing the model's depth or expanding the action space to include local search refinements. Additionally, testing the framework in dynamic environments—where machine breakdowns or variable processing times occur—will be essential for transitioning ARLS from academic benchmarks to real-world factory floors.

Summary updated

BibTeX
@misc{lee2024attention,
  author = {Jaejin Lee and Seho Kee and Mani Janakiram and George Runger},
  title = {{Attention-based Reinforcement Learning for Combinatorial Optimization: Application to Job Shop Scheduling Problem}},
  year = {2024},
  eprint = {2401.16580},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.16580},
}
Figure