Presentation is loading. Please wait.

Presentation is loading. Please wait.

割当問題とマッチング Assignment Problem B=(b ij ) : n×n matrix C ⊆ {b ij |1 ≦ i ≦ n, 1 ≦ j ≦ n} C is diagonal ⇔ (1) ∀ b ij, b kh ∈ C, ⇒ i≠k and j≠h (2) |C | =

Similar presentations


Presentation on theme: "割当問題とマッチング Assignment Problem B=(b ij ) : n×n matrix C ⊆ {b ij |1 ≦ i ≦ n, 1 ≦ j ≦ n} C is diagonal ⇔ (1) ∀ b ij, b kh ∈ C, ⇒ i≠k and j≠h (2) |C | ="— Presentation transcript:

1

2 割当問題とマッチング

3 Assignment Problem B=(b ij ) : n×n matrix C ⊆ {b ij |1 ≦ i ≦ n, 1 ≦ j ≦ n} C is diagonal ⇔ (1) ∀ b ij, b kh ∈ C, ⇒ i≠k and j≠h (2) |C | = n def max (min) {Σb ij | C is diagonal} C

4 max-weight bipartite matching problem Given G=(S ∪ T, A) complete bipartite graph, |S|=|T|=ncomplete bipartite graph, w:A→R arc weight find min{Σ w(a) | K : perfect matching}perfect matching a∈Ka∈K max-weight bipartite matching problem assignment problem EQUIVALENT

5 Bipartite graph G=(V, A) is bipartite ⇔ ∃ partition of V, V=S ∪ T s.t. ∃ arc which has both their vertices in S, ∃ arc which has both their vertices in T def ・ G=(S ∪ T, A) is complete bipartite ⇔ A=S×T def

6 Matching G=(V, A) M ⊆ A M is a matching ⇔ ∀ a, b ∈ M a and b do not have any vertex in common. M is a perfect matching ⇔ any vertex in V is covered by an arc in M def

7 diagonal ⇔ perfect matching 1234 1 2 34 1 4 -5 2 Assume that any arc weigh ( matrix element) is given by nonnegative real number. S T

8 Node weighting (potential) G=(S ∪ T, A) u(i) i ∈ S v(j) j ∈ T u, v is feasible node weighting ⇔ u(i)+v(j) ≧ w(i, j) ∀ {i, j} ∈ A def ex. u(i) = 0, ∀ i ∈ S v(j)=max{w(i, j) |i ∈ S}, ∀ j ∈ T is a feasible node weighting u\v

9 Lemma 6.1 u, v: feasible node weighting K : perfect matching = ≦ Corollary 6.2 u, v: feasible node weighting A = ={{i, j} ∈ A | u(i)+v(j)=w(i, j)} K ⊆ A = K : perfect matching ⇒ K : max-weight perfect matching

10 Reduced weighting w(i, j) = u(i)+v(j)-w(i, j) ∀ {i, j} ∈ A u, v is feasible node weighting ⇔ w(i, j) ≧ 0 ∀ {i, j} ∈ A

11 Graph orientation u, v: feasible node weighting K : (any) matching 1234 1 2 34 S T orientation i ∈ S, j ∈ T {i, j} ∈ K ⇒ j→i {i, j} ∈ A\K ⇒ i→j 1234 1 2 34 add new vertices s, t, and new arcs {(s, i) | i ∈ S\K} ∪ {(j, t) |j ∈ T\K} s t Each vertex i ∈ S has one incoming arcs

12 Re-weighting u, v: feasible node weighting K : (any) matching 1234 1 2 34 S T re-weighting {i, j} ∈ K ⇒ l(j, i) = -w(i, j) {i, j} ∈ A\K ⇒ l(i. j) = w(i, j) l(s, i) = 0 ∀ i ∈ S\K l(j, t)=0 ∀ j ∈ T\K 1234 1 2 34 s t d(v) : distance from s to v with respect to l Property u’(i) = u(i)+d(i), i ∈ S v’(j) = v(j) - d(j), j ∈ T : feasible node potential

13 feasible node weighting? re-weighting {i, j} ∈ K ⇒ l(j, i) = -w(i, j) {i, j} ∈ A\K ⇒ l(i. j) = w(i, j) l(s, i) = 0 ∀ i ∈ S\K l(j, t)=0 ∀ j ∈ T\K u’(i) = u(i)+d(i), i ∈ S v’(j) = v(j) - d(j), j ∈ T feasible? ( u’(i)+v’(j) ≧ w(i, j) ) {i, j} ∈ A\K i j w(i, j) d(j) ≦ d(i)+l(i, j) = d(i)+w(i, j) ∴ u’(i)+v’(j) = u(i)+d(i)+v(j)-d(j) ≧ u(i)+v(j)-w(i, j) = u(i)+v(j)-(u(i)+v(j)-w(i, j)) = w(i, j) {i, j} ∈ K i j -w(i, j) d(i)=d(j)+l(i, j) =d(j)-w(i, j) ∵ i has exactly one incoming arc ∴ u’(i)+v’(j) = u(i)+v(j)-w(i, j) = w(i, j)

14 Corollary P : shortest path from s to t with respect to l {i, j} ∈ A(P) ⇒ u’(i)+v’(j)=w(i, j) K △ A(P) = (K\A(P)) ∪ (A(P)\K) : matching 1234 1 2 34 1234 1 2 34 s t 1234 1 2 34 1234 1 2 34 s t | K △ A(P) |>|K|

15 Algorithm (successive shortest path) Maintain a feasible node weighting u, v and a matching K ⊆ A = ={{i, j} ∈ A | u(i)+v(j)+w(i, j)} 1.Orient each arc and add new vertices and arcs. 2.Find a shortest path P and shortest path distance d (since l ≧ 0, we can use Dijkstra algorithm) 2.Update u and v by d 3.Update K to K △ A(P) Repeat the following steps: Each step increases the cardinality of K. Thus the algorithm terminates at most n iterations.

16 Example (1) Initialization w u(i) = 0, ∀ i ∈ S,v(j)=max{w(i, j) |i ∈ S}, ∀ j ∈ T arcs in A = K

17 Example (2) Iteration 1 w s t Find d 0 0 0 6 4 84 3 5 2 6 3 2 2 2 3 5 shortest path P update

18 Example (3) Iteration 2 w s t Find d shortest path P update 0 0 0 12 6 1 0 4 1 1 2 4 optimal

19 LP variable x :A→{0, 1} 1 ( when an optimal matching contains an arc a) x(a) = 0 ( otherwise)

20 LP -dual

21 Hichcock’s Transportation Problem 輸送問題

22 Problem Definition Given G=(S ∪ T, A) bipartite graph supply b(i) i ∈ S, demand b(j), j ∈ T (Σb(i) = Σb(j) ) arc cost c(i, j), {i, j} ∈ A i j warehouse customer Determine a way of distribution of goods from each warehouse to each customoer with minimizing the total transpotation cost.

23 f(i, j) : a value distributed a goods from warehouse i to customer j total transportation cost = Σ c(i, j)f(i, j) {i, j} ∈ A Node cost G=(S ∪ T, A) u(i) i ∈ S v(j) j ∈ T u, v is feasible node cost ⇔ u(i)+v(j) ≦ c(i, j) ∀ {i, j} ∈ A def

24 Lemma 6.3 u, v: feasible node cost f : feasible distribution Corollary 6.4 u, v: feasible node cost A = ={{i, j} ∈ A | u(i)+v(j)=c(i, j)} If G(S ∪ T, A = ) has a feasible solution f, f is optimal.

25 Think Think Think Develop an algorithm for Hichcock’s transportation problem Describe an LP formulation of Hichcock’s transportation problem Develop an algorithm for Hichcock’s transportation problem with arc capacity

26 Matching problem on nonbipartite graphs 5 4 5 6 7 4 8 6 7 optimal solution fractional optimal solution value = 18 1/2 0 0 0 value = 19


Download ppt "割当問題とマッチング Assignment Problem B=(b ij ) : n×n matrix C ⊆ {b ij |1 ≦ i ≦ n, 1 ≦ j ≦ n} C is diagonal ⇔ (1) ∀ b ij, b kh ∈ C, ⇒ i≠k and j≠h (2) |C | ="

Similar presentations


Ads by Google