Lazy gas, hot gas, and a thousand robots
Anonymous multiagent pathfinding (MAPF) for warehouse robots can be solved to optimality in polynomial time by formulating it as multimarginal optimal transport (MMOT) whose constraint matrices stay totally unimodular. A linear program then returns integer, collision-free paths, about O(n^1.68) in practice. On a 150×150 grid with 1,125 robots (3.4M variables, T=30), this takes 478 seconds, while the NP-hard non-TU formulation often fails to find a feasible solution in 12 hours. An entropic relaxation equivalent to a Schrödinger bridge (the 'hot gas' model) is solved with Sinkhorn iterations to find likely corridors, then pruned back to integral paths. This cuts runtime to 67 seconds, scaling roughly O(n^1.15), at a cost of staying within 6.5% of optimal.
Related posts
- Linear programming for fun and profit
Modal mediumAdept
Modal provisions GPU and CPU capacity across multiple clouds with a "resource solver" that formulates demand, prices, availability and per-instance limits as a linear program. It solves that program with Google's GLOP simplex solver from OR-Tools and outputs a delta of instances to spin up or down. Cheap preprocessing heuristics, such as pruning instance types, keep solves to fractions of a second rather than minutes, trading a little optimality for predictable scaling latency. Background workers make the actual cloud requests and feed observed capacity-limit failures back into later solves. The approach lets Modal exploit price arbitrage, such as H200s priced below H100s, and saves millions per year.
- MilleMiglia: A realistic instance generator for middle-mile logistics
Google Research easyNoviceMilleMiglia is an open-source C++ instance generator that produces realistic, privacy-preserving benchmarks for middle-mile logistics, where shipments are relayed across multiple vehicles between distribution centers over multi-day horizons. Middle-mile delivery is modeled as a multi-commodity flow problem on a space-time graph with hard constraints (fixed vehicle schedules, distribution-center throughput limits, and cross-vehicle synchronization), which standard VRP solvers cannot handle. The generator places distribution centers via gravity models or spatial clustering, samples origin-destination demand, builds structured vehicle rotations, and serializes each instance to a single Protocol Buffers file. Instance sizes range from toy problems for exact algorithms to continent-scale ones needing metaheuristics, with the aim of creating a CVRPLIB-style benchmark suite.
- Open-Sourcing Rebalancer: A Generic, High-Performance Library for Solving Assignment Problems
Meta Engineering mediumAdeptMeta has open-sourced Rebalancer, an assignment-problem solver used for nine years to place hardware, services, tasks and traffic across its infrastructure. Problems are specified with objects, bins, dimensions, partitions, scopes and reusable specs (e.g. CapacitySpec, BalanceSpec), then compiled into an expression graph. That graph either drives a parallelized local search with an O(objects+bins) neighborhood or is translated into a MIP for Xpress, Gurobi or HiGHS, which shrinks models with variable aggregation and symmetry breaking but can still grow O(objects×bins). Rebalancer solves about 40 million problems a day, with a P99 of 12 seconds at 265k objects and 3.2k bins, and ships alongside Explorer, a Dockerized debugging UI.
- Building a dynamic inventory optimisation system: A deep dive
Zalando Engineering mediumAdeptZalando's ZEOS builds replenishment recommendations by minimising a cost function that combines storage, lost sales, overstock, operations and inbound costs. Probabilistic demand forecasts feed a Monte Carlo simulation engine with gradient-free black-box optimisers. The weekly forecasting pipeline runs LightGBM through Nixtla's MLForecast with conformal inference, does pre-processing in PySpark on Databricks and feature transforms on SageMaker, and covers 5 million SKUs over about 3 years of history in under 2 hours. The optimisation service shares features via SageMaker Feature Store (online lookups at 10–20ms per SKU, S3-backed offline store). It serves daily batch transform jobs plus an interactive SQS/Lambda path for partner setting changes, keeping both paths consistent.
- How to Build a Model Router in the Harness
LangChain mediumAdeptRouting each coding-agent thread to one of three model tiers (fast, balanced, performance) cut median cost per thread by 64% versus always using a top frontier model, with no measurable change in merged-PR rate (29.2% vs 27.3%, p=0.49) across 973 threads in Open SWE. The router runs as harness middleware, classifying the first user message against per-tier criteria. Those criteria come from trace-based task analysis and provider guidance, which is why it belongs in the harness rather than a generic gateway. Most threads went to the balanced (56%) or fast (34%) tiers. A fast-only control degraded quality so quickly it was stopped within a day. Future work includes subagent routing and mid-thread re-routing, which carries a prompt-cache cost.