|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Hungarian (Kuhn-Munkres) algorithm for the optimal assignment problem. More...
#include <cmath>#include <limits>#include <type_traits>#include <utility>#include <initializer_list>#include <tpl_dynMat.H>#include <tpl_array.H>#include <htlist.H>#include <ah-errors.H>#include <ahFunction.H>Go to the source code of this file.
Classes | |
| struct | Aleph::Hungarian_Result< Cost_Type > |
| Result of the Hungarian assignment algorithm. More... | |
| class | Aleph::Hungarian_Assignment< Cost_Type > |
| Implementation of the Hungarian (Munkres) algorithm. More... | |
Namespaces | |
| namespace | Aleph |
| Main namespace for Aleph-w library functions. | |
Functions | |
| template<typename Cost_Type > | |
| Hungarian_Result< Cost_Type > | Aleph::hungarian_assignment (const DynMatrix< Cost_Type > &cost) |
| Compute minimum-cost assignment (free function). | |
| template<typename Cost_Type > | |
| Hungarian_Result< Cost_Type > | Aleph::hungarian_max_assignment (const DynMatrix< Cost_Type > &cost) |
| Compute maximum-profit assignment (free function). | |
Hungarian (Kuhn-Munkres) algorithm for the optimal assignment problem.
This file implements the Hungarian algorithm, also known as the Kuhn-Munkres algorithm, for solving the linear assignment problem: given an \(m \times n\)cost matrix, find a minimum-cost matching of rows to columns.
| Algorithm | Time | Space |
|---|---|---|
| Hungarian | O(max(m,n)^3) | O(m*n) |
Definition in file Hungarian.H.