The Munkres version of the Hungarian Method for weighted minimal bipartite matching. The implementation is based on Robert A. Pilgrim's notes, http://18.104.22.168/bob.pilgrim/445/munkres.html (mirror: http://www.public.iastate.edu/~ddoty/HungarianAlgorithm.html).
Needs a rectangular array of nonnegative weights, which
encode the weights on the edges of a (complete) bipartitate graph.
The indexing should start from
Returns a minimal matching, and the cost of it.
Unfortunately, GHC is opposing hard the polymorphicity of this function. I think
the main reasons for that is that the there is no
Unboxed type class, and
thus the contexts
IArray UArray e and
MArray (STUArray s) e (ST s) do not
know about each other. (And I have problems with the
forall s part, too).
The same as 'hungarianMethod<Type>', but uses boxed values (thus works with
any data type which an instance of
The usage of one the unboxed versions is recommended where possible,
for performance reasons.