There's an algorithm that I don't exactly understand what it does and it is part of my homework.

123 Views Asked by At

Also there are 3 questions that I can't seem to find an answer for. Could you at least point me in the right direction if not help me solve these exercises?

for $(e ∈ E)$ do

{

$a(e) ← 1$;

}

$E+ ← \{e ∈ E : a(e) > 0\}$;

while $(G+ = (V, E+)$ contains a cycle $C)$ do

{

let $C = M1 ∪ M2$, where $M1$ and $M2$ are matchings with $a(M1) >= a(M2)$;

for $(e ∈ E(C))$ do

if $(e ∈ M1)$ then $a(e) + +;$

else $a(e) − −$;

$E+ ← \{e ∈ E : a(e) > 0\}$;

}

return $E+;$

//end of algorithm

(i)after each while iteration, for every $u ∈ V$ , $X$ $uv∈E+$ $a(uv) = p$;

(ii) the algorithm doesn’t end as long as there are edges $e$ with $0 < a(e) < p$; at the end of the algorithm $a(e) = p$, $∀e ∈ E+$, and $E+$ is the set edge of a perfect matching in $G$;

(iii) the number of the while iterations is finite, at the end of the algorithm $f(E+) = np2/2 = pm$, and the total length of all cycles is at most $pm$;