Need pairing algorithm - based on Hungarian?

前端 未结 2 2112
攒了一身酷
攒了一身酷 2021-02-09 13:36

Hungarian or Kuhn-Munkres algorithm (good description here) pairs objects from two sets (of n and m objects respectively, n>=m) so that the overall \"

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-09 14:04

    Maybe your approach is wrong but the hungarian algorithm is only for bipartite graph. For a general (non-bipartite) graph (i.e. weigthed matching) look here http://en.wikipedia.org/wiki/Edmonds%27s_matching_algorithm. Or you want to cheat and you give only the top ten of the maximum-cost pair matching?

提交回复
热议问题