Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Solver selection

Use iterated local search for heuristic k-assignment. Use linear assignment for a two-part problem.

By task

NeedFunctionWhen
Default heuristic searchils / Algo::IlsUse time_limit and several chains; compare the measured gaps to the optimum.
Original multiple Hungarian methodsmultiple_hungarian / Am–FmReproduce the paper’s methods; Am, Dm, and Shift limit construction work, while Bm-based methods grow rapidly with k.
Refine a complete solutionlocal_search / DVApply deterministic 1DV or sDV sweeps, with a constructed start or a supplied complete solution.
Population searchmemetic / Algo::MemeticCompare with ILS on your instances; optional matching changes their relative results.
Choose a method by namek_assignmentRetain a common Python dispatcher or select an explicit Rust Algo.
Allow vertices to stay unmatchedthreshold= / Options::thresholdUse optional matching with the native heuristics; forbidden infinities exclude individual pairs.
Prove an optimumexact (Python only)Use small equal-size inputs, with about 10⁵ tuple variables as a practical limit.
Bound the remaining improvementlower_boundMeasured k=3 and metric-cost gaps were small; random costs at k≥4 gave looser bounds.
Solve a two-part LAPlinear_sum_assignmentCompute an optimal rectangular linear assignment.

See the benchmarks for instance definitions, hardware, timings, and gaps.

Usage

  1. Define your parts and pairwise cost matrices.
  2. Run ILS with an iteration limit or time budget.
  3. Refine an existing complete assignment with a warm start.
  4. 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.