Bipartite Matching
2020-1νκΈ°, λνμμ βμκ³ λ¦¬μ¦β μμ μ λ£κ³ 곡λΆν λ°λ₯Ό μ 리ν κΈμ λλ€. μ§μ μ μΈμ λ νμμ λλ€ :)
μ΄λ² ν¬μ€νΈλ Network Flow ν¬μ€νΈμ νμ ν¬μ€νΈμ λλ€. Network Flow λ¬Έμ μ ν΅μ¬μ΄ λλ μ λ¦¬μΈ <Max-Flow Min-Cut Theorem>μ λν΄ κΆκΈνλ€λ©΄ μ΄μ ν¬μ€νΈλ₯Ό μ°Έκ³ ν΄μ£ΌμΈμ! π
μ΄λ² ν¬μ€νΈμ μ½λλ λ°±μ€ 1298λ²: μ΄νκ°νΈ λ¬Έμ λ₯Ό κΈ°μ€μΌλ‘ μμ±λμμ΅λλ€ π¨βπ»
Introduction to Bipartite Matching
<Bipartite Matching; μ΄λΆ 맀μΉ>μ μ§μμ μ§ν© $P$μ μμ μ μ§ν© $J$, κ·Έλ¦¬κ³ κ° μ§μλ€μ μμ μ λν μ νΈκ° μ£Όμ΄μ‘μ λ (μ§μ, μμ )μ 맀μΉμ μλ₯Ό μ΅λνμΌλ‘ λ§λλ μ‘°ν©μ λμΆνλ λ¬Έμ μ΄λ€.
μ΄λ, 맀μΉμ μμ±ν λλ κ° μ¬λμ μ΅λ νλμ μμ
μ ν λΉλ μ μκ³ , νλμ μμ
μ μ΅λ ν μ¬λμκ²λ§ ν λΉ λ°μ μ μλ€. λμΆ© ν μ¬λμ΄ 2κ°μ§ μΌμ λͺ»νκ³ , ν μμ
μ 2λͺ
μ΄ λͺ» λ€μ΄κ°λ€λ λ§
(μ§μ, μμ )μ 맀μΉμ μ§ννλ€κ° λ μ΄μ 맀μΉμ μ§νν μ μλ μνλ₯Ό maximal matchingμ΄λΌκ³ νλ©°, λΉμ°νκ²λ λͺ¨λ maximal matchingμ΄ maximum matchingμ 보μ₯νλ κ²μ μλλ€!
Reduction to NF Problem
μ°λ¦¬λ <Bipartitie Matching> λ¬Έμ λ₯Ό μλμ κ°μ΄ <reduction; νμ>μμΌ ν΄κ²°ν μ μλ€.
Reduction to NF
- Replace each edge to a directed edge from a person to a job of capacity 1.
- Add a special node $s$ and connect $s$ to every node in People by directed edge of capacity 1.
- Add a special node $t$ and connect every node in Jobs to $t$ by directed edge of capacity 1.
μμ κ°μ΄ <Bipartite Matching>μ <Network Flow> λ¬Έμ λ‘ νμνλ©΄, μ°λ¦¬λ reduction μμμμ maximum flowκ° μλμ κ²°κ³Όλ₯Ό λ±μ κ²μ΄λΌκ³ κΈ°λν μ μλ€.
κ·Έλ¦¬κ³ reductionλ NF λ¬Έμ μμ μ»λ maximum total flowκ° maximum matchingμ μ λνλ€λ κ²μ κ°λ¨νκ² μ¦λͺ ν΄λ³΄μ!
Let $M$ be the set of edges used in the maximum flow of value $k$. Then $M$ is a matching because there is at most on edge in $M$ leaving a one person and entering a one job. (λ°λ‘ μμμ μΈκΈν μ±μ§ λλ¬Έ!) Moreover, $M$ consists of $k$ matching edges!
(κ·λ₯λ²) If there is a matching consisting of more than $k$ matching edges, then there must be a flow of value larger than $k$. That is a contraction!
ꡬν
μ¬μ€ ꡬνμ μμ ν¬μ€νΈμμ μ΄ν΄λ³Έ <Ford-Fulkerson Algorithm>μΌλ‘ reductionμ μ ꡬννλ©΄ λλ€. λ³λ‘ μ΄λ ΅μ§ μλ€ γ γ
π Ford-Fulkerson & Edmons-Karp Algorithm