mcfcg¶
Column generation solver for the minimum-cost multicommodity flow (MCF) problem with path-based and tree-based Dantzig-Wolfe decompositions.
The implementation accompanying: S. Spoorendonk and B. Petersen, Tree-based formulation for the multi-commodity flow problem, arXiv:2509.24656, 2026 (v3, 25 Aug 2026).
The CommaLab instance planar150 (150 nodes, 850 arcs, 2239 commodities) with
an optimal multicommodity flow. An edge’s width is the flow in its busier
direction; the edges saturated in a direction are in full colour, and those
without flow in grey. The instance has no coordinates: the positions are
recovered from its arc costs, which are the arcs’ squared lengths.¶
The CommaLab instance planar150 (150 nodes, 850 arcs, 2239 commodities) with
an optimal multicommodity flow. An edge’s width is the flow in its busier
direction; the edges saturated in a direction are in full colour, and those
without flow in grey. The instance has no coordinates: the positions are
recovered from its arc costs, which are the arcs’ squared lengths.¶
Problem and formulations¶
Given a directed graph \(G=(V,A)\) with arc costs \(c_a\) and capacities \(u_a\), and a set of commodities \(K\) where commodity \(k\) routes \(d_k\) units from source \(o_k\) to sink \(t_k\), find the min-cost feasible multicommodity flow.
Arc-flow (compact) formulation¶
Path formulation (Dantzig-Wolfe)¶
Let \(P_k\) be the set of \(o_k \!\to\! t_k\) simple paths, with \(\lambda^k_p \ge 0\) the flow on path \(p \in P_k\) and \(c_p = \sum_{a\in p} c_a\). (This is the flow convention the solver uses: the demand row bound is \(d_k\) and the capacity row coefficient is \(1\) per arc used; the pricer’s reduced cost does not carry a \(d_k\) factor.)
Reduced cost of a path \(p\) for commodity \(k\): \(\bar c^k_p = \sum_{a\in p} (c_a - \mu_a) - \pi_k\). Pricing reduces to a shortest path in \(G\) with arc weights \(c_a - \mu_a\) (one Dijkstra per source, targeting that source’s sinks).
Tree formulation (Dantzig-Wolfe)¶
Group commodities by source: \(S_s = \{k \in K : o_k = s\}\). For each source \(s\) let \(T_s\) be the set of trees (subgraphs) serving every sink of \(S_s\) from \(s\), with \(\xi^s_t\) the fraction used, aggregated arc flow \(f^{s,t}_a = \sum_{k\in S_s} d_k [a \in \text{path from } s \text{ to } t_k \text{ in } t]\), and tree cost \(c_t = \sum_{a\in A} c_a\, f^{s,t}_a\).
Reduced cost of a tree \(t\) for source \(s\): \(\bar c^s_t = \sum_{a\in A} f^{s,t}_a (c_a - \mu_a) - \pi_s\). Pricing is a single Dijkstra from \(s\) with arc weights \(c_a - \mu_a\) that simultaneously finds all shortest paths to the sinks of \(S_s\); the tree column aggregates demand-weighted arc flow over those paths.
Algorithm¶
Dantzig-Wolfe column generation. The restricted master starts with
demand/convexity rows; capacity rows are added lazily on violation. Slacks go
on whichever side is smaller, the structural rows or the capacitated arcs: in
the first case every demand/convexity row gets one at the start, in the second
(EdgeRows) each capacity row brings its own when it is added. Each iteration solves the
LP once, separates violated capacity cuts, prices columns against the
captured duals, and commits what survived.
The LB is the Lagrangian relaxation of the capacity (coupling) constraints: \(\mathit{sp}_k(c-\mu)\) is the reduced-cost shortest path the pricer already computed for entity \(k\), accumulated without subtracting the structural dual \(\pi_k\), and \(\varepsilon\) is a rounding-error budget for the scale-integer Dijkstra. By weak duality \(L(\mu) \le \mathrm{OPT}\) for any \(\mu \le 0\), so the bound holds whatever the master’s feasibility state — it is gated only on the pricer having visited every source, not on \(s = 0\) or \(A^{\text{new}} = \emptyset\), and so it advances from the first iteration rather than waiting for the last slack to leave the basis. The \(\pi\)-free form matters numerically as well as logically: a basic slack pins \(\pi_k\) at the bumped slack cost, and reconstructing the bound from \(\pi^\top b\) would then lose it to catastrophic cancellation. Demands weight the path sum for the path formulation; under tree the convexity RHS is \(1\) and the \(d_k\) weighting collapses.
Both optimal exits return \(UB\) — the incumbent — never the terminating iteration’s LP objective. The pricing-exhaustion exit fires under exactly the guard that updates \(UB\), so \(UB \le \mathit{obj}\) holds there by construction; returning \(\mathit{obj}\) instead used to hand back a value worse than one CG already had whenever a barrier landed above an earlier solve on a strictly larger column set.
The non-optimal exit reports \(UB\) when one was ever recorded and
falls back to the Lagrangian \(LB\) otherwise: with slacks basic the LP
objective is a feasibility penalty rather than a routing cost, so it
would be worse than useless as a reported value. That fallback is not a
corner case in practice — of the 20 uncertified cells in
results/cg_benchmark.csv, 19 produced a number at all, and 17 of those
report a lower bound in their objective column for exactly this reason.
pricer.price is the source-level dispatcher; each per-source call
(PriceOneSource) is the A* inner body. Postponement is a
one-iter-ahead filter: a source that emits no negative-RC column is
skipped on the next non-final call. Flags are cleared whenever the
main iteration commits columns (clearPostponed, keeps the cursor so
partial pricing resumes), when pricing finally exhausts
(resetPostponed, rewinds to source 0), and after the warm-start
pass. filter_for_new_caps rewrites the flag vector wholesale after
a cut round: sources whose best-path arcs were touched by a new cap
are flipped in (postponed=0), all others are postponed until a
later sweep re-examines them.
Iteration log¶
Verbosity::Iteration prints one row per CG iteration:
column |
meaning |
|---|---|
|
iteration number |
|
running min LP obj over MCF-feasible iters |
|
best \(\pi\)-free capacity-relaxation Lagrangian bound so far |
|
current LP objective (carries slack penalty while |
|
columns / rows in the LP right now |
|
basic slack columns; non-zero means |
|
columns added / purged this iteration ( |
|
capacity rows added / purged this iteration |
|
per-iter seconds (LP, pricing, separation, total) |
|
seconds accumulated over the iterations so far |
A CG optimal or CG stopped line ends the log with the iteration count, the
final UB, LB and gap, and the time totals; stopped means not certified
(iteration cap, time limit, or an LP the backend could not solve). The CLI then
prints [bounded-pricing] enabled=… fired=… priced=… rate=…: how many of the
source pricings --bounded-pricing cut short (fired is 0 when it is off).
Build¶
Requires a C++23 compiler (it is built with GCC 15, with Apple clang 21, and
weekly with the default compiler of Ubuntu 24.04), CMake 3.21+, zlib and a BLAS, which HiGHS’ interior-point solver needs: zlib1g-dev and
libopenblas-dev on Debian/Ubuntu. Configuring downloads HiGHS and GoogleTest
from GitHub (FetchContent); nothing else needs installing. It also sets this
checkout’s core.hooksPath to .githooks (Git hooks) unless
-DMCFCG_INSTALL_GIT_HOOKS=OFF is given.
To push, also run uv sync once per checkout: it installs clang-format and
clang-tidy 22.1.8 (pinned in pyproject.toml) and the documentation
site’s Sphinx build into .venv. The pre-push gate configures with
-DMCFCG_REQUIRE_LINT=ON and fails on any other clang version, including a
system clang-tidy on PATH, and on a .venv without the docs build.
cmake -B build
cmake --build build -j$(nproc)
There is no install step: run the binaries from build/. mcfcg is a C++
library and two command-line tools. There is no Python package: uv sync
installs development tools only, and scripts/ are plain Python scripts.
Use it from C++¶
The library is consumed as source, by add_subdirectory or FetchContent, as
the CMake target mcfcg; there is no install() and no exported package. The
target carries C++23 and HiGHS with it:
cmake_minimum_required(VERSION 3.21)
project(app LANGUAGES C CXX) # C is needed by HiGHS
include(FetchContent)
set(MCFCG_INSTALL_GIT_HOOKS OFF)
FetchContent_Declare(mcfcg
GIT_REPOSITORY https://github.com/spoorendonk/mcfcg.git
GIT_TAG main) # or, to pin one tree, a release tag after v0.1.0
FetchContent_MakeAvailable(mcfcg)
add_executable(app main.cpp)
target_link_libraries(app PRIVATE mcfcg)
#include <cstdio>
#include <exception>
#include "mcfcg/cg/path_cg.h" // solve_path_cg
#include "mcfcg/cg/tree_cg.h" // solve_tree_cg
#include "mcfcg/instance.h" // read_commalab, read_tntp
int main(int argc, char** argv) {
if (argc != 2) {
return 2;
}
try {
const mcfcg::Instance inst = mcfcg::read_commalab(argv[1]);
const mcfcg::CGResult result = mcfcg::solve_tree_cg(inst, {.time_limit_seconds = 60.0});
std::printf("%s objective %.6f, lower bound %.6f\n",
result.optimal ? "optimal," : "not certified,", result.objective,
result.lower_bound);
} catch (const std::exception& e) { // unreadable or infeasible instance
std::fprintf(stderr, "error: %s\n", e.what());
return 1;
}
}
solve_path_cg takes the same arguments. As a subproject mcfcg also builds its
own command-line tools and tests, so build your target by name
(cmake --build build --target app) to skip them.
macOS¶
The Mac build works with HiGHS alone. From a fresh clone, the ## Build & Test
blocks in CLAUDE.md pass on it, Python and CLI tests included (Apple clang 21,
arm64). You need:
xcode-select --install # Apple clang, the SDK (zlib), python3
brew install cmake ninja uv coreutils # coreutils provides `nproc`
uv sync # pinned clang-format/clang-tidy wheels
Stock macOS has no nproc, and the build and test commands call it. Any
nproc on PATH works. The Mac mini gate ran with a two-line shim that prints
sysctl -n hw.ncpu, not with coreutils.
zlib comes from the SDK. HiGHS’ interior-point solver uses Apple’s Accelerate
framework as its BLAS, so you do not install OpenBLAS. To check that the solver
really is HiPO, run mcfcg_cli … --verbose-solver: every solve should log
Running HiPO. ccache (brew install ccache) is optional. pre-push builds in
a fresh worktree, so ccache only speeds that build up when a user-level ccache
base_dir is set. Behaviour that differs from Linux:
No GPU. cuOpt needs CUDA, so leave
MCFCG_USE_CUOPToff; it is off by default.--solver cuoptthen exits withcuOpt not available.Python.Scriptsskips two more test classes. Two intimeout_memory_test(the harness-timeout RSS test andPgidMembersTest) need Linux/proc, which the benchmark harness scans for process groups. On any platform thecli_testclasses skip there too (they run asCLI.EndToEnd), and in a fresh clone the two committed-round checks inanalyze_bounded_pricing_ablation_test, because the raw ablation logs are gitignored.The benchmark scripts are Linux-only. They run every solve under
/usr/bin/time -f %M. That needs GNU time, but on macOS the file is BSDtime, which rejects-f, so every benchmark cell fails.hooks.localCiCpushas no effect. It pins CPUs withtaskset, which macOS lacks. pre-push says so and runs the local CI on every CPU.
Optional¶
Flag |
Default |
Effect |
|---|---|---|
|
OFF |
Enable the NVIDIA cuOpt GPU LP backend. Defaults to cuOpt’s incremental delta C API ( |
|
ON |
Opt out of the delta C API for stock (non-fork) cuOpt: falls back to the rebuild-from-scratch path, which recreates the whole LP every CG iteration — a serious performance degradation. Default ON requires the fork’s |
|
OFF |
Enable the COPT LP backend (requires COPT installed, |
|
OFF |
Enable the MOSEK CPU barrier LP backend (requires MOSEK, |
|
ON |
Disable |
|
ON |
Stop configure from pointing this checkout’s |
Git hooks¶
Development hooks are tracked in .githooks/: commit-msg
(Conventional Commits), pre-commit (checks, without reformatting, that every
tracked C++ file is clang-formatted) and pre-push (no merge commits on main,
a review receipt for the pushed commit, then a clean build and the tests,
including the clang_format and clang_tidy:<path> lint tests for what the
push changed, in a fresh worktree of that commit). They come from
wcp; see CLAUDE.md for the details.
Git only runs hooks from core.hooksPath, which is per-checkout config and
therefore cannot itself be tracked, so cmake -B build sets it for you. It
leaves an existing .githooks value alone and warns rather than overwriting a
hooksPath you set deliberately. To do it by hand, or after configuring with
-DMCFCG_INSTALL_GIT_HOOKS=OFF:
git config core.hooksPath .githooks
cuOpt and the delta-API fork¶
The cuOpt backend mutates the restricted master incrementally (add/delete
columns and rows, re-solve), so by default it uses cuOpt’s incremental delta C
API (MCFCG_CUOPT_DELTA_API=ON). Stock cuOpt has no such API; the default path
needs a cuOpt build that ships cuopt_c_delta.h — the
spoorendonk/cuopt fork (delta-api-26.10
branch, the delta API on the v26.10.00 release). Build that fork first
(configure errors out if the header is missing), or reconfigure with
-DMCFCG_CUOPT_DELTA_API=OFF to fall back to the rebuild-from-scratch path on
a stock cuOpt with its headers under cuopt/mathematical_optimization/ (the
v26.08.00 release on; a cuOpt that keeps them under cuopt/linear_programming/,
such as the fork’s old delta-api branch, fails the configure) — a serious performance degradation
(the whole LP is recreated every CG iteration), supported only as a
compatibility fallback. To use the fork, point the configure at it (an install
prefix or a source checkout both work):
# one combined build with both COPT and the cuOpt delta fork
cmake -B build -DCMAKE_INSTALL_MESSAGE=LAZY \
-DMCFCG_USE_COPT=ON \
-DMCFCG_USE_CUOPT=ON \
-DCUOPT_INCLUDE_DIR=/path/to/cuopt/cpp/include \
-DCUOPT_LIBRARY=/path/to/cuopt/cpp/build/libcuopt.so
cmake --build build -j$(nproc)
From v26.10 libcuopt.so is a GNU ld script naming the component libraries
libcuopt_client.so and libcuopt_mathopt.so in the same directory, so the
link line above still works and the binaries end up depending on those two.
They (and their librmm / rapids_logger deps) must be reachable by
the dynamic loader at run time. The build embeds the cuOpt library directory
as an RPATH — derived from CUOPT_LIBRARY — so build/mcfcg_cli, the tests,
and the tools run without exporting LD_LIBRARY_PATH. If you later move the
fork’s build directory, either reconfigure (so the RPATH updates) or put the
new location on LD_LIBRARY_PATH:
export LD_LIBRARY_PATH=/path/to/cuopt/cpp/build:$LD_LIBRARY_PATH
LP backends¶
Four LP backends implement a common interface: HiGHS (default, FetchContent,
no license/GPU), cuOpt (GPU barrier), COPT (CPU/GPU barrier), and
MOSEK (CPU barrier). Select at run time with --solver.
Pinned barrier configuration. For fair cross-solver comparison every backend
runs the same regime: presolve off, crossover off, convergence tolerance 1e-4
(the MCF feasibility design target; see include/mcfcg/util/tolerances.h
BARRIER_TOL). Each solver prints a one-line provenance banner to stderr at
construction (captured in the CG / benchmark logs), e.g.:
[lp-config] backend=mosek version=11.0.30 method=barrier exec=CPU presolve=off crossover=off tol=0.0001 threads=auto(32)
version= is queried from the library actually loaded at run time, never from
the vendor header’s compile-time macros, so a stale LD_LIBRARY_PATH pointing at
a second install shows up here instead of being silently misreported.
PROVENANCE.txt records what it cannot see: whether cuOpt is the delta-API fork,
and, for the v0.1.0 results built on HiGHS 1.15.1, the local HiPO patch (gone
since v1.16.0, which carries the upstream fix).
The tolerance is each vendor’s primal and dual feasibility tolerance. MOSEK and
cuOpt get it as their relative gap tolerance too; HiGHS and COPT keep their own
default there. exec=GPU for COPT is
what --copt-gpu-mode asked for, also on a machine without a GPU, and a backend
on the GPU prints threads=n/a(GPU). The environment variable
MCFCG_HIGHS_SOLVER (simplex, ipm, hipo or pdlp; default hipo)
selects another HiGHS method.
threads=auto(N) reports the backend’s effective thread count (N = hardware
concurrency when the backend auto-selects); exec is CPU or GPU. The banner
reports the steady-state pins — a stall-recovery certify solve transiently runs
crossover on the crossover-capable backends (HiGHS/COPT/MOSEK; see below).
HiPO errors are redone with simplex. On a few LPs HiGHS’s HiPO ends in an
error: a NaN met close to the optimum of a feasible LP (which the same LP
repeats every time), or a verdict it cannot settle. The HiGHS backend then
solves that one LP again with simplex, outside the regime above, and says so on
stderr: one [lp-fallback] backend=highs solve=K: … line per such solve and a
[lp-fallback] backend=highs total=N of M solves line at the end, with nothing
printed when N is 0. The banner still reads method=hipo.
scripts/benchmark_solvers.py marks such a run LP-FALLBACK in the CSV’s
detail column: its time is not HiPO’s alone. One case is not marked: on a
certify solve (below) HiGHS itself finishes with simplex when HiPO stalls short
of its tolerances.
HiGHS crossover-on-certify (stall recovery). HiGHS uses the HiPO
interior-point method with crossover off per iteration, so the bulk of CG is
fast. But a pure interior-point solution is not a vertex: on the path
formulation of large instances its central duals can fail to price an improving
column, and demand-row slacks settle at O(tol) > 0 rather than exactly 0, so the
CG loop cannot certify a slack-free upper bound. When the loop detects this stall
(pricing exhausted but not optimal, or an interior solve spuriously reporting
infeasible after cuts), it re-requests that one solve as a certify solve via
LPSolver::solve(certify=true) — HiGHS then runs crossover to round the interior
point to a vertex (discriminating duals, slacks exactly 0). COPT and MOSEK
likewise run crossover (basis identification) only on a certify solve; the cuOpt
GPU barrier has no crossover and treats certify as a no-op (the loop skips its
stall recovery there, via certify_runs_crossover()). This keeps “crossover off”
honest for the common case (every backend runs crossover-off steady-state, and
in practice only HiGHS ever stalls) while letting any crossover-capable backend
certify the cases that need a vertex — crossover fires only on the stalled
solves, not every iteration.
Test¶
GTEST_BRIEF=1 ctest --test-dir build --output-on-failure --progress -j$(nproc)
A single test:
./build/mcfcg_tests --gtest_filter='PathCGSingleSource.OptimalObjective'
./build/mcfcg_integration_tests --gtest_filter='GridCorrectness.Grid1'
The documentation site is this README and the other READMEs in the
repository, built by Sphinx from docs/.
The test docs_build (ctest --test-dir build -L docs) builds it
warning-free; to build it by hand:
uv run --only-group docs sphinx-build -W -b html docs build/docs/html
CLI usage¶
./build/mcfcg_cli <instance_path> [options]
Option |
Default |
Meaning |
|---|---|---|
|
|
Decomposition to use |
|
10000 |
CG iteration cap |
|
auto |
TNTP trips file; by default the net path with |
|
auto |
TNTP demand coefficient: every demand is divided by it. By default the one of the city the file is named after, known for nine cities only ( |
|
0 |
Pricing threads ( |
|
0 |
Sources priced per batch. |
|
highs |
LP backend: |
|
2 |
COPT barrier execution: |
|
— |
Write the compact source-based LP as MPS (gzipped if |
|
off |
Enable the LP backend’s own log output, on stderr |
|
off |
Print the instance’s cost scale and slack-cost ceiling for the chosen |
|
5 |
Purge columns after N idle iters ( |
|
5 |
Purge cap rows after N idle iters ( |
|
-1e-3 |
Reduced-cost acceptance threshold |
|
0 |
Wall-clock budget in seconds ( |
|
pricer-light |
|
|
off |
Stop each source’s A* once the duals prove no improving column remains |
|
Print the options and exit |
A solve prints one CSV header and one row on stdout; everything else (iteration log, banners, the LP backend’s log) goes to stderr. The columns:
Column |
Meaning |
|---|---|
|
as given on the command line |
|
CG iterations run, columns in the master at the end |
|
with |
|
best Lagrangian lower bound; empty when no iteration priced every source |
|
|
|
seconds, total and per part |
There is no upper-bound column: with optimal = 0 an objective equal to
lower_bound is a bound, not a solution.
Exit codes. 0 after any completed run, optimal = 0 included, so a script
must test the optimal column. 1 for a usage error, an unreadable or invalid
instance (also a commodity with no path, below), an unknown solver or TNTP city,
a backend that was not compiled in, or an error the backend raised; stdout then
has no result row.
--stats-only prints the instance sizes and cost scale, the slack-cost ceiling
with the bound it is clamped from (slack_cost_upper_bound), where the slacks
go (slack_mode), and the dimensions of the LP that --write-mps writes
(source_lp_cols, source_lp_rows, source_lp_nnz).
# CommaLab format
./build/mcfcg_cli data/commalab/grid/grid1
# TNTP transportation format (auto-detects trips file and demand coefficient)
./build/mcfcg_cli data/transportation/Winnipeg_net.tntp.gz
# Tree formulation
./build/mcfcg_cli data/commalab/grid/grid1 --formulation tree
Input files¶
CommaLab, the default format: whitespace-separated numbers, vertices numbered from 1. Three counts, then one line per arc, then one per commodity:
<vertices>
<arcs>
<commodities>
<from> <to> <cost> <capacity> one per arc; capacity < 0: uncapacitated
<source> <sink> <demand> one per commodity
TNTP, recognised by a file name ending in _net.tntp or _net.tntp.gz; the
matching _trips file holds the demands. The arc cost is the free_flow_time
column. Demands are divided by a coefficient that is built in for the nine
cities in scripts/README.md, looked up by the file name up to its first _;
any other name exits with use --coef.
A file of either format is decompressed when its name ends in .gz.
A demand is finite and at least 0. Any other is refused with exit code 1, in
every mode, and so is a --coef that is not. A line of a TNTP net file or a
pair of a trips file that cannot be read is skipped, with a warning on stderr
that counts them; a trips pair of demand 0 is dropped without one.
Every sink must be reachable from its source. A commodity with demand and no
path makes the instance infeasible, and a solve refuses it with exit code 1
(--stats-only and --write-mps do not look for paths).
mcfcg_clean writes a copy of a CommaLab instance (it does not read TNTP)
without the unreachable commodities:
./build/mcfcg_clean instance.txt # writes instance_cleaned.txt
./build/mcfcg_clean instance.txt --output out.txt
It writes plain text. Name the output yourself for a .gz input: only the last
extension is replaced, so x.txt.gz becomes x.txt_cleaned.txt.
Instance data¶
Four instance families from public sources:
Family |
Format |
Source |
|---|---|---|
Grid |
CommaLab |
|
Planar |
CommaLab |
|
Transportation |
TNTP (gz) |
|
Intermodal |
CommaLab (gz) |
Every instance of all four families is committed to this repository, so
reproducing any published row needs no download step. Three of the four can
also be re-derived from their original sources rather than taken on trust:
scripts/download_commalab.sh fetches grid and planar, and
scripts/prepare_intermodal.sh generates the intermodal instances (it needs
git lfs). Both skip what is already there, so in a clone, where the data is
committed, move the committed copies out of the way first
(how). The transportation instances have no fetch script — the committed
.tntp.gz files came from the linked TransportationNetworks repository
unmodified, and the CLI applies the per-city demand coefficient at read time
(the coefficients are tabulated in scripts/README.md).
Reproducing the published results¶
The committed result tables are in results/; PROVENANCE.txt pins the exact
solver versions, host and patches behind them, and scripts/README.md documents
how each table is produced and consolidated.
The standard build is HiGHS-only. That is deliberate — it needs no licence,
no GPU and no external install — but it means the default cmake -B build
produces a binary that can reproduce one of the five benchmark configurations.
The other four are opt-in at configure time, and a --solver label whose backend
was not compiled in reports as an error row rather than silently disappearing.
To build the full matrix:
export MOSEK_HOME=/opt/mosek/<ver>/tools/platform/linux64x86 \
COPT_HOME=/opt/copt80
cmake -B build -DCMAKE_INSTALL_MESSAGE=LAZY \
-DMCFCG_USE_MOSEK=ON -DMCFCG_USE_COPT=ON -DMCFCG_USE_CUOPT=ON \
-DCUOPT_INCLUDE_DIR=/path/to/cuopt/cpp/include \
-DCUOPT_LIBRARY=/path/to/cuopt/cpp/build/libcuopt.so
cmake --build build -j$(nproc)
What each configuration costs you¶
Config |
Licence |
Hardware |
Reproducible with open-source components? |
|---|---|---|---|
|
none (MIT) |
CPU |
Yes. Fetched and built by CMake; nothing to install. |
|
none (Apache-2.0) |
NVIDIA GPU |
Yes, given a GPU. Build the |
|
commercial (academic licences available) |
CPU |
No. |
|
commercial (academic licences available) |
CPU |
No. |
|
commercial (academic licences available) |
NVIDIA GPU |
No. |
Cite the cuOpt fork by commit, not by branch: delta-api-26.10 is a moving ref.
The results tagged v0.1.0 were run on the older delta-api branch (commit
8ea7a033a, as PROVENANCE.txt at that tag records). That fork keeps its
headers under cuopt/linear_programming/, so build it with mcfcg’s v0.1.0 tag,
not main; delta-api-26.10 is the delta-API commits rebased onto upstream
v26.10.00, not a descendant of 8ea7a033a, so it is a different cuOpt from the
one the results record (its objectives agree, see gh #47).
Verifying a reproduction¶
Objective values are the reproducible quantity — specifically, the objectives of
runs that proved optimality. Wall-clock time and peak RSS are properties of the
host, the GPU and the solver build and will not match on different hardware, and
a run stopped by the time limit reports a bound that likewise depends on how fast
the machine is. scripts/check_reproduction.py compares objectives only, gates
on the certified ones, and reports cells your sweep did not run as not run
rather than folding them into a pass:
python3 scripts/benchmark_solvers.py --families grid --solvers highs \
--formulations path,tree --out /tmp/grid_highs.csv
python3 scripts/check_reproduction.py /tmp/grid_highs.csv
That is the smoke test: 30 cells, roughly 15 minutes, no licence and no GPU. It exits non-zero on any mismatch.
Citing¶
Cite the paper for the result and the archived release for the code.
CITATION.cff carries both in machine-readable form — GitHub’s
“Cite this repository” button reads it.
The paper is arXiv:2509.24656, https://arxiv.org/abs/2509.24656. Its
current version is v3 (25 Aug 2026), a substantial revision of the 2025
v1/v2: every number it reports was produced by release v0.1.0 of this
repository, and the 44 instances × 2 formulations × 5 backends it studies are
the 440 cells of results/cg_benchmark.csv. Cite the year of that version:
@misc{spoorendonk2026treemcf,
title = {Tree-based formulation for the multi-commodity flow problem},
author = {Spoorendonk, Simon and Petersen, Bj{\o}rn},
year = {2026},
eprint = {2509.24656},
archivePrefix= {arXiv},
primaryClass = {math.OC},
url = {https://arxiv.org/abs/2509.24656}
}
The archived code is on Zenodo. v0.1.0 is 10.5281/zenodo.22058614; the
concept DOI 10.5281/zenodo.22058613 always resolves to the latest version.
Cite the version DOI when reproducibility matters — it pins one tree, one
PROVENANCE.txt, one set of result tables:
@software{spoorendonk2026mcfcg,
title = {mcfcg: column generation for minimum-cost multicommodity flow},
author = {Spoorendonk, Simon and Petersen, Bj{\o}rn},
year = {2026},
version = {0.1.0},
doi = {10.5281/zenodo.22058614},
url = {https://doi.org/10.5281/zenodo.22058614}
}
Cite a tag or a DOI, never main: the result tables under results/ move with
the code, and PROVENANCE.txt pins the solver stack only as of the tag that
carries it.
License¶
MIT, except for parts of the graph layer (include/mcfcg/graph/, plus one
reverse-Dijkstra loop in include/mcfcg/cg/pricer_base.h) derived from
melon, which stay under the Boost Software
License 1.0. THIRD_PARTY_NOTICES.md lists them, and
LICENSES/BSL-1.0.txt holds the licence text.