s2mflow: A meta-generator for multicommodity flow instances
Benchmark instances for multicommodity flow problems often fail to capture the structural characteristics of real-world networks or preserve a rigorous relationship with their single-commodity counterparts. To address these limitations, this paper presents s2mflow : an open-source, cross-platform Python library for lifting single-commodity minimum-cost flow instances into the multicommodity space. Unlike existing generators, s2mflow makes this structural relationship an explicit design principle of the instance construction process, enabling the generation of structurally grounded benchmarks. The package combines a Python interface with a high-performance Rust backend built with PyO3 and maturin, and is distributed via PyPI for Linux and macOS on x86_64 and ARM64, and Windows on x64. It provides integer partitioning methods to control commodity-demand heterogeneity, a key factor for the Single-Multi-Commodity Gap and solver performance. Additionally, s2mflow introduces the specialized .mcfmin file format for compact, reproducible storage. The resulting instances are suitable for benchmarking methods in linear programming, network optimization, and transportation science.