[Paper Review] OR-Gym: A Reinforcement Learning Library for Operations Research Problems
OR-Gym is an open-source reinforcement learning (RL) library that reformulates classic operations research problems—such as knapsack, bin packing, supply chain management, and portfolio optimization—into Markov Decision Processes for RL training. It benchmarks RL agents against MILP and heuristic models, showing RL can outperform robust optimization in expected portfolio returns, though with higher variance and significantly longer training times.
Reinforcement learning (RL) has been widely applied to game-playing and surpassed the best human-level performance in many domains, yet there are few use-cases in industrial or commercial settings. We introduce OR-Gym, an open-source library for developing reinforcement learning algorithms to address operations research problems. In this paper, we apply reinforcement learning to the knapsack, multi-dimensional bin packing, multi-echelon supply chain, and multi-period asset allocation model problems, as well as benchmark the RL solutions against MILP and heuristic models. These problems are used in logistics, finance, engineering, and are common in many business operation settings. We develop environments based on prototypical models in the literature and implement various optimization and heuristic models in order to benchmark the RL results. By re-framing a series of classic optimization problems as RL tasks, we seek to provide a new tool for the operations research community, while also opening those in the RL community to many of the problems and challenges in the OR field.
Motivation & Objective
- To bridge the gap between reinforcement learning (RL) and operations research (OR) by creating a standardized, accessible library for OR problems.
- To enable researchers to apply RL to real-world industrial optimization problems such as multi-echelon supply chains and multi-period asset allocation.
- To provide benchmark environments with optimal (MILP), heuristic, and RL solutions for fair comparison across methods.
- To explore the feasibility and performance of RL in solving constrained, sequential decision-making problems traditionally handled by mathematical programming.
- To encourage hybrid approaches combining RL with optimization models to improve sample efficiency and solution quality.
Proposed method
- Reformulates classic OR problems (e.g., knapsack, bin packing, supply chain, portfolio optimization) as Markov Decision Processes (MDPs) with state, action, and reward definitions.
- Implements environments using the OpenAI Gym interface for compatibility with existing RL frameworks and tools like Ray for distributed training.
- Applies action masking to enforce hard constraints, preventing invalid actions and reducing the search space during training.
- Uses Proximal Policy Optimization (PPO) as the primary RL algorithm for policy learning across all problem classes.
- Solves MILP benchmarks using Gurobi 8.2 and Pyomo 5.6.2 to obtain optimal solutions for comparison.
- Employs hyperparameter tuning (learning rate, entropy coefficient) across a standard RL library setup with three fully connected layers of 128 units each.
Experimental results
Research questions
- RQ1Can reinforcement learning effectively solve classical operations research problems such as multi-period asset allocation and multi-echelon supply chain management?
- RQ2How does RL performance compare to traditional MILP and heuristic models in terms of solution quality and computational cost?
- RQ3To what extent does action masking improve training stability and policy quality in constrained OR problems?
- RQ4Does RL outperform robust optimization in expected portfolio returns despite higher variance and longer training times?
- RQ5Can RL policies be used to extract actionable heuristics or inform hybrid optimization-RL frameworks?
Key findings
- In multi-period asset allocation, the RL policy achieved an average portfolio value of approximately $865 after 1,000 simulated instances, outperforming the robust optimization (RO) policy in expected return.
- The robust optimization policy provided significantly better worst-case performance, guaranteeing a minimum return of $610.17 across 99.7% of the parameter space.
- Despite sparse rewards, the RL agent successfully learned a high-performing policy, indicating that RL can handle complex, sequential decision-making under uncertainty.
- The variance of the RL portfolio returns was substantially higher than that of the RO policy, indicating less downside protection.
- Training the RL agent required hours of computation, while the RO solution was computed in just a few minutes, highlighting a trade-off between performance and efficiency.
- In off-line knapsack problems, RL did not outperform established heuristics, underscoring that RL may not be cost-effective for well-solved, deterministic problems.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.