Skip to content
Advertisement

The Assignment Problem, a NumPy function?

Since an assignment problem can be posed in the form of a single matrix, I am wondering 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://software.clapper.org/munkres/. Still I suppose a NumPy/SciPy implementation could be much faster, right?

Advertisement

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.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement