Paul - 4 months ago 39

Python Question

Since an assignment problem can be posed in the form of a single matrix, I am wandering if numpy has a function to solve such a matrix. So far I have found none. Maybe one of you guys know if numpy/scipy has an assignment-problem-solve function?

**Edit:** In the meanwhile I have found a python (not numpy/scipy) implementation at http://www.clapper.org/software/python/munkres/. Still I suppose a numpy/scipy implementation could be much faster, right?

Answer

No, NumPy contains no such function. Combinatorial optimization is outside of NumPy's scope. It may be possible to do it with one of the optimizers in `scipy.optimize`

but I have a feeling that the constraints may not be of the right form.

NetworkX probably also includes algorithms for assignment problems.