OPEN SOURCE / ROUTING OPTIMIZATION

Hard routing.
Open possibilities.

Solve vehicle routing problems with capacity constraints and time windows. Use Python for root relaxations, the CLI for feasible routes and integer search, or Rust to build your own solver.

Rust performancePython interfaceMIT licensed

A ROUTING SANDBOX

One depot. Many possibilities.

Ten customers served from a central depot Three illustrative routes for a vehicle capacity of four. Each customer has unit demand. Change capacity below to regroup the routes.
3 routes · 10 customers · unit demandIllustration only; routes are grouped, not optimized by BALDES.

01 / YOUR FIRST SOLVE

Less setup.
More possibilities.

Choose your interface. The same Rust engine powers the CLI and Python root solver.

01

Get the source.

Clone once, with the bundled Clp sources.

git clone --recurse-submodules https://github.com/lseman/baldes.git
cd baldes
Rs

Install with Cargo

The solver, in your terminal.

02
cargo install --path . --features clp --locked
baldes --help

From the checkout above. Requires Rust/Cargo and a C++14 compiler. Cargo installs baldes into its binary directory; add it to your PATH if needed.

Build options & native backends
Py

Install for Python

Your data. A Rust-backed solve.

02
python -m venv .venv
source .venv/bin/activate
python -m pip install .

From the same checkout, with Python 3.9+, Rust/Cargo and a C++14 compiler. The source build includes Clp. Activation shown for Linux/macOS shells.

Python installation & API

03 / PUT IT TO WORK

A small model.
A real starting point.

Define a depot, add customers, and solve a capacitated routing root relaxation. No instance file required.

  • Model directly with Python objects
  • Inspect bounds, duals, and route columns
  • Export results as a dictionary or JSON

Python returns an LP relaxation; routes may have fractional values. Use the CLI or Rust for integer tree search.

Explore the Python API
first_route.pyPYTHON
from pybaldes import Customer, Instance

# Depot first, then customers with unit demand.
instance = Instance("first-route", capacity=2, customers=[
    Customer(0, 0),
    Customer(1, 0, demand=1),
    Customer(0, 1, demand=1),
])

result = instance.solve_root(
    problem_type="cvrp",
    capacity_cuts=True,
)
print(result.status, result.lp)
for route in result.routes:
    print(route.value, route.nodes)
Working with files or building a Rust application?

Solve a Solomon instance

Run from the checkout after installing the CLI.

baldes vrptw instances/Solomon/R101.txt \
  --customers 10 --rank1 --tree --time 60

Add the Rust library

From your own Cargo project, use a path to the cloned source.

cargo add baldes --path ../baldes --features clp
Rust module guide

02 / INSIDE THE ENGINE

From promising paths
to a stronger bound.

Work with one component, or connect the full routing pipeline. The Rust core uses the standard library; native backends power the master solves.

01

Price the paths.

Bucket graphs organize resource-constrained labels. Forward and backward searches meet, while dominance removes paths that cannot help.

Explore pricing
02

Tighten the model.

Rank-one, capacity, strong k-path, and load-knapsack cuts strengthen the relaxation, with their dual effects carried into pricing.

Meet the cut families
03

Branch with context.

Children inherit the solved master, cuts, and pricing state. Ryan–Foster and vehicle-count branches work with the single-network tree.

Follow a node
Few routes left? Send a complete enumerated node master to HiGHS, preserving its branches and cuts.

03 / OPEN THE NOTEBOOK

Understand what
the solver is doing.

All documentation