cvanelteren / cython-munkres-wrapper

Python wrapper of a C++ implementation of the Munkres assignment algorithm.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Munkres Readme

Munkres calculates the minimum cost assignment of the assignment using the Hungarian/Munkres algorithm.

Can handle non-square cost matricies, using algorithm provded by Bougeois and Lassalle in An extension of the Munkres Algorithm for the Assignment Problem to Rectangular Matrices.

Usage

from munkres import munkres
import numpy as np
a = np.array(map(float,'7 4 3 6 8 5 9 4 4'.split()), dtype=np.double).reshape((3,3))
print munkres(a)

which should print out

[[False False  True]
 [ True False False]
 [False  True False]]
https://travis-ci.org/jfrelinger/cython-munkres-wrapper.png?branch=master

About

Python wrapper of a C++ implementation of the Munkres assignment algorithm.

License:BSD 2-Clause "Simplified" License


Languages

Language:Python 54.0%Language:C++ 46.0%