我可以使用匈牙利算法来找到最高费用吗? [英] Can I use the Hungarian algorithm to find max cost?

查看:104
本文介绍了我可以使用匈牙利算法来找到最高费用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

匈牙利算法解决了多项式时间内的分配问题。给定工作人员和任务,以及一个n×n矩阵,其中包含为每个工作人员分配任务的成本,它可以找到使分配成本最小化的成本。

The Hungarian algorithm solves the assignment problem in polynomial time. Given workers and tasks, and an n×n matrix containing the cost of assigning each worker to a task, it can find the cost minimizing assignment.

我想找到最大成本的选择?我可以使用匈牙利语或任何其他类似方法吗?还是只能以指数方式完成?

I want to find the choice for which cost is max? Can I do it using Hungarian or any similar method? Or this can only be done exponentially?

推荐答案

正如David在评论中所说:

As David said in the comment:

Multiply the cost matrix by -1 for maximization.

这篇关于我可以使用匈牙利算法来找到最高费用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆