Practical overview
When it fits
Use RL4CO when implementing or comparing reinforcement-learning research workflows for combinatorial optimization, especially when a shared benchmark framework and configurable PyTorch experiments are useful.
Who it is for
- Researchers comparing reinforcement-learning methods for combinatorial optimization.
- Developers prototyping neural approaches to routing, scheduling, and related optimization problems.
Documented uses
- Benchmark reinforcement-learning algorithms on combinatorial optimization tasks.
- Train constructive policies that build solutions or improvement policies that refine existing solutions.
- Configure and compare experiments for routing environments such as TSP and CVRP.
- Adapt reusable environment components when exploring a new optimization problem.
Requirements & limits
The public repository is MIT-licensed and documents installation through pip or from source.
- The framework builds on TorchRL and TensorDict, and uses PyTorch Lightning and Hydra in its documented stack.
- Policies cover both solution construction and improvement, with autoregressive and non-autoregressive constructive approaches described.
- The README includes a GPU-based training example, but does not identify GPU use as necessary for all workflows.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install RL4CO for local development
Create a local development environment and install RL4CO with its dependencies.
Before you start
- Python development environment
- uv package manager
Steps
Clone the ai4co/rl4co repository and change into its directory.
Run the command below to create a virtual environment and install dependencies.
uv sync --all-extrasActivate the environment with
source .venv/bin/activate.
Expected outcome
A local `.venv` environment with the project dependencies installed.
Guide limitations
- This procedure prepares a development environment; it does not document running a training job.
Train the documented default TSP experiment
Start model training with RL4CO's default Attention Model configuration on the TSP environment.
Before you start
- RL4CO installed in a Python environment
- The RL4CO repository's
run.pyentry point
Steps
From the repository, run the command below.
python run.pyFor a configured routing experiment, use the documented example the command below.
python run.py experiment=routing/am env=tsp env.num_loc=50 model.optimizer_kwargs.lr=2e-4
Expected outcome
The documented training command starts the default TSP configuration; the alternate command specifies a routing experiment and settings.
Guide limitations
- The README does not make a particular hardware setup a prerequisite for these commands.
- The example records documented commands, not a verified execution result.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- ai4co/rl4co · Official homepage title · retained in its source language

