分配问题,一个NumPy函数? [英] The Assignment Problem, a NumPy function?
问题描述
由于分配问题可以以单个矩阵的形式提出,想知道NumPy是否具有求解此类矩阵的功能.到目前为止,我什么都没找到.也许你们当中有人知道NumPy/SciPy是否具有分配问题解决功能?
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?
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?
推荐答案
否,NumPy不包含此类功能.组合优化不在NumPy的范围内.可能可以使用scipy.optimize
中的其中一个优化程序来完成此操作,但是我感觉约束可能格式不正确.
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 可能还包括用于分配问题的算法.
NetworkX probably also includes algorithms for assignment problems.
这篇关于分配问题,一个NumPy函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!