OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Rl4Co

Rl4Co, referred to as RL4CO in its project documentation, is a Python and PyTorch library and benchmark framework for reinforcement learning applied to combinatorial optimization. It provides reusable policy and environment components for research experiments, with a stated focus on reproducibility.

Independent OpenViST project profile, based on linked sources.

Rl4Co — OpenViST project profile in AI Developer Tools & SDKs.
OpenViST project illustration. See the linked sources for product details.
Understand the project

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.
Before you choose

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.

Source-based practical guide

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

  1. Clone the ai4co/rl4co repository and change into its directory.

  2. Run the command below to create a virtual environment and install dependencies.

    Documented command
    uv sync --all-extras
  3. Activate 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.
Source-based practical guide

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.py entry point

Steps

  1. From the repository, run the command below.

    Documented command
    python run.py
  2. For a configured routing experiment, use the documented example the command below.

    Documented command
    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.
Evidence and transparency

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