150 likes | 288 Views
EMI 2 – Matching problem. Javier Belenguer Faguás Catalin Costin Stanciu Maria Cabezuelo Sepúlveda Jaime Barrachina Verdia. The problem:. Let G = {{a,b,c,d,e},{e,f,g,h,i,j}} be complete (this means that for every x from X and y from Y there exists a (x,y) that pertains to E)
E N D
EMI 2 – Matching problem Javier Belenguer Faguás Catalin Costin Stanciu Maria Cabezuelo Sepúlveda Jaime Barrachina Verdia
The problem: Let G = {{a,b,c,d,e},{e,f,g,h,i,j}} be complete (this means that for every x from X and y from Y there exists a (x,y) that pertains to E) H is a weighted graph whose weights are given by:
Step 1 → u = {a}; V(T) = {a}; E(T) = 0; V(T,E) = 0; Step 2 → Ad(a) = {g,h}; g → M-insaturated → go to Step 3 Step 3 → (a – g); V(T) = E(T) = 0; go to Step 1;
Step 1 → u = {b}; V(T) = {b}; E(T) = 0; V(T,E) = 0; Step 2 → Ad(b) = {f,g,i,j}; f → M-insaturated → go to Step 3 Step 3 → (b-f); V(T) = E(T) = 0; go to Step 1;
Step 1 → u = {c}; V(T) = {c}; E(T) = 0; V(T,E) = 0; Step 2 → Ad(c) = {g,h}; g → M-saturated ^ g pertains to V(T)→ go to Step 4; Step 4 → (g,a) edge; V(T)={a,c,g}; E(T)={cg,ga}; V(T,E)={g}; Go to Step 2; h → M-insaturated → Step 3 → (h,c) → go to Step 1
Step 1 → u = {d}; V(T) = {d}; E(T) = {}; V(T,E) = {d}; Step 2 → Ad(d) = {g,h}; g → M-saturated ^g does not pertain to V(T); → go to 4 Step 4 → (g,a) edge → V(T) = {d,g,a}; E(T) = {dg,ga}; V(T,E) = {d,a}; h → M-saturated ^h does not pertain to V(T): → go to 4 Step 4 → (h,c) edge → V(T) = {a,c,d,g,h}; V(T,E) = {d,a,c}; E(T) = {dh,hc,dg,ga}; go to Step 2
We choose a; Ad(a) = {g,h}; g → M-saturated ^h does not pertain to V(T) → go to Step 5; Step 5 → No perfect matching.
Now we recalculate the labels: Odd → L(v) + alpha Even → L(v) - alpha alpha = min(L(x) + L(y) – p(x,y)) = 1
Step 1 → u = {e}; V(T) = {d,g,h,a,c,e}; V(T,E) = {d,c,a,e}; Step 2 → Ad(e) = {i,j}; j → M-insaturated → go to Step 3 Step 3 → (e-j) →there's an M-augmenting path → Go to 1
Step 1 → u = {d}; V(T) = {d}; V(T,E) = {}; Step 2 → Ad(d) = {g,h}; g → M-saturated ^ doesn't belong to V(T) → go to Step 4 Step 4 → (g,a) pertains to M → V(T)={g,a,d} V(T,E)={a,d} ; E(T)={dg,ga}; return to step 2 h→ M-saturated ^ doesn't belong to V(T) → go to Step 4 Step 4 → (h,c) pertains to M → V(T)={g,a,d,c,h} V(T,E)={a,d,c} ; E(T)={dg,ga,dh,hc}; return to step 2
Step 2 →v= a; Ad(a) = {g,h,i}; i → M-insaturated → go to Step 3 Step 3 →There's a path d-g-a-i ^ (ga) belongs to M Delete the edge (ga) from M ; Add (ai) to M; Delete V(T) , E(T), V(T,E); go to Step 1;
Step 1 → u=d; V(T)={d}; V(T,E)={d}; E(T)=0; Step 2 → v=d; Ad(d)={g,h}; g → M-insaturated → go to Step 3; Step 3 → (dg) is an M-augmenting path; Add (dg) to M; Delete V(T), V(T,E), E(T); Go to step 1;
Step 2 →v= a; Ad(a) = {g,h,i}; i → M-insaturated → go to Step 3 Step 3 →There's a path d-g-a-i ^ (ga) belongs to M Delete the edge (ga) from M ; Add (ai) to M; Delete V(T) , E(T), V(T,E); go to Step 1;