0
votes

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 ). 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.

1

1 Answers

1
votes

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.