Solver selection
Use iterated local search for heuristic k-assignment. Use linear assignment for a two-part problem.
By task
| Need | Function | When |
|---|---|---|
| Default heuristic search | ils / Algo::Ils | Use time_limit and several chains; compare the measured gaps to the optimum. |
| Original multiple Hungarian methods | multiple_hungarian / Am–Fm | Reproduce the paper’s methods; Am, Dm, and Shift limit construction work, while Bm-based methods grow rapidly with k. |
| Refine a complete solution | local_search / DV | Apply deterministic 1DV or sDV sweeps, with a constructed start or a supplied complete solution. |
| Population search | memetic / Algo::Memetic | Compare with ILS on your instances; optional matching changes their relative results. |
| Choose a method by name | k_assignment | Retain a common Python dispatcher or select an explicit Rust Algo. |
| Allow vertices to stay unmatched | threshold= / Options::threshold | Use optional matching with the native heuristics; forbidden infinities exclude individual pairs. |
| Prove an optimum | exact (Python only) | Use small equal-size inputs, with about 10⁵ tuple variables as a practical limit. |
| Bound the remaining improvement | lower_bound | Measured k=3 and metric-cost gaps were small; random costs at k≥4 gave looser bounds. |
| Solve a two-part LAP | linear_sum_assignment | Compute an optimal rectangular linear assignment. |
See the benchmarks for instance definitions, hardware, timings, and gaps.
Usage
- Define your parts and pairwise cost matrices.
- Run ILS with an iteration limit or time budget.
- Refine an existing complete assignment with a warm start.
- For equal-size parts, compare against a lower bound, or use the Python exact solver on a small instance.
For the mathematical objective and unequal-size parts, see problem definition.