简体   繁体   English

完整的二部图中最大化产品完美匹配

[英]Maximum product perfect matching in complete bipartite graphs

I am trying to solve this problem : Jobs . 我正在尝试解决这个问题: 乔布斯 So far i have thought that the problem is same as the Assignment Problem with the distributors and districts represented as a bipartite graph and the edges representing the probability. 到目前为止,我认为该问题与分配问题相同, 分配者和地区用二部图表示,边表示概率。 But here we would need to maximize the product rather than the sum of weights of matched edges. 但是这里我们需要最大化乘积而不是匹配边缘的权重之和。

One idea that came to my mind was to change each edge weight to log ( weight ). 我想到的一个想法是将每个边的权重更改为log(权重)。 Then the problem essentially changes to finding the maximum sum, which is can then be solved using the algorithms for Assignment Problem . 然后,问题从本质上改变为找到最大和,然后可以使用“ 分配问题 ”算法解决 But this poses a problem, since applying log will make the edge weights non-integer, something which i think the Hungarian Algorithm does not work for. 但这带来了一个问题,因为应用对数将使边缘权重变为非整数,我认为匈牙利算法不起作用。

Please suggest some other alternative approach. 请提出其他替代方法。

In theory, the Hungarian algorithm works fine with real weights. 从理论上讲,匈牙利算法在使用实际权重时效果很好。

In practice, it's possible that, since most integer logarithms cannot be represented exactly as floating-point numbers, it could come to pass that rounding would change the optimal solution. 实际上,由于大多数整数对数不能精确地表示为浮点数,因此有可能通过舍入将改变最佳解。 There are ways to deal with that even so, but it's unlikely that you'll need them for this programming contest problem. 即使有这样的方法,也有解决的方法,但是对于此编程竞赛问题,您不太可能需要它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM