Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

A question about maxflow algorithm

Правка en1, от ngk_manh, 2021-04-27 15:42:41

Hi, guy!

There is a problem which has statement :

Given n people and m job, c[i][j] represent the cost if people i match with job j. Find a max matching with minimum cost.

This problem can be solve with Hungary algorithm for max matching and minimum cost in bipartite graph. But some time, I see some problem which similar the statement below :

Given n people, c[i][j] represent the cost if people i match with people j. Find a matching and with maximum cost.

The bipartite property is not hold in this problem, but I think there's some way to modify it to bipartite graph and solve it by Hungary algorithm, but this problem also has tag "maxflow". So, I wonder how to solve this with maxflow-mincost algorithm because it must be hold that if the people i match with people j, then people i and j mustn't match with any another people.

(Sorry because my English)
Теги hungarian algorithm, maxflow, #mincostflow

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский ngk_manh 2021-04-27 15:42:41 1019 Initial revision (published)