Function pathfinding::kuhn_munkres_min
[−]
[src]
pub fn kuhn_munkres_min<C>(weights: &Array2<C>) -> (C, Vec<usize>) where
C: Sum<C> + Zero + Signed + Ord + Copy,
Compute the minimum matching between two disjoints sets of vertices using the Kuhn-Munkres algorithm (also known as Hungarian algorithm).
The weights between the first and second sets are given into the
weights
square matrix. The first axis is indexed by the X set,
and the second axis by the Y set. The return value is a pair with
the total assignments weight, and a vector containing indices in
the Y set for every vertex in the X set.
This algorithm executes in O(n³) where n is the cardinality of the sets.
Panics
This function will panic if the weights
matrix is not a square matrix.