Блог пользователя Excogitatoris

Автор Excogitatoris, история, 7 лет назад, По-английски

I have an undirected bipartite graph with N nodes in set A and M nodes in set B, where N <= 50000 and M <= 1000. There can be N * M edges. Each node from set A can mark either zero or two nodes from set B if there is an edge between the node from set A and each of the two nodes from set B. Each node from set B can be marked only once by only one node from set A. I need to find the maximum number of nodes that can be marked from set B.

I'm stuck with this problem. Any kind of help is very much appreciated.

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

»
7 лет назад, скрыть # |
← Rev. 3  
Проголосовать: нравится -7 Проголосовать: не нравится

This is a wrong solution to the problem This is basically maximum matching with the condition that each node in a can connect to two nodes in b. Since the number edges is huge. we can reduce it by connecting all nodes in a to a node and all nodes in b to that node. Then run dinics algorithm complexity O((n + m)sqrr(n + m)).