Function pathfinding::kuhn_munkres [] [src]

pub fn kuhn_munkres<C>(weights: &SquareMatrix<C>) -> (C, Vec<usize>) where
    C: Bounded + Sum<C> + Zero + Signed + Ord + Copy

Compute the maximum 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.