bmc/munkres — pull request #11 by brunokim (2014-12-14 16:09:40+00:00)
Title: Creating a default for make_cost_matrix

I believe the make_cost_matrix function is more complex than it should. The most obvious solution would be to simply negate the profit matrix, but I'm not sure if the method expects a strictly positive matrix. We can then translate the negated matrix values enough to ensure positivity, by translating as much as the maximum. That is,

cost_matrix = max(profit_matrix) - profit_matrix

This solution works for all numeric types, thus not requiring one to specify a lambda function.