Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Let G = (V, E) be an undirected graph and let w(e) > 0 for edge weights for e G

ID: 3664824 • Letter: L

Question

Let G = (V, E) be an undirected graph and let w(e) > 0 for edge weights for e G E. Recall that a subset M E is called a matching if the edges in M do not share a node. The Maximum Weight Matching problem consists of finding the matching M so that the weight w(M) := summation _e m w (e) is maximized. This is indeed a polynomial time solvable problem, but the algorithm is highly non-trivial and way beyond the scope of our lecture. But it is easy to design a greedy algorithm that finds 2-approximation. To be precise we suggest the following algorithm: Sort the edges so that w (e_1) > w (e_2) > ... > w (e_m) Set M : = theta FOR I = 1 TO m DO If M U {e_i} is still a matching THEN update M : = M U {e_i} Let us donte OPT: = max {m (M) : M E is matching} as the value of the optimum solution and GREDY as the value of the solution produced by the greedy algorithm above. Solve the following: Show that for ant epsilon > 0 there is an instance where GREEDY w (a_2) > ... > w (a_p) and w (b_1) > w (b_2) > ... > w (b_q) For the sake of simplicity, assume that q is even. Show that w (a_i) > w (b_2i-1) for all I {1, ..., q/2}. Prove that GREEDY . 1/2 DPT.

Explanation / Answer

Input:

Weighted bipartite graph G = (U, V, E) and each edge (ui , vj ) E has a weight wij .

E 0 =

for ui U do create vertex ui' 0 i U'

for (ui , vj ) E do

add back edge (u 0 i , vj ) to E 0 with weight 0

end for

add back edge (ui , u0 i ) to E 0 with weight wmax

for uk U do

add edge (u 0 i , uk) to E 0 with weight 0

end for

end for

return graph G' = {U, V, E, U' , E'}

In a weighted bipartite graph G = (U, V, E), we can choose the vertex set U or V arbitrarily to do matching. We choose the vertex set U for illustrations.

We apply the Metropolis algorithm on the maximum weighted bipartite matching (maximum-weighted BM) problem. Let x be the current search state. x {0, 1} |E| describes the set of matchings (ui , vj ), where xij = 1 denotes a matching edge, xij = 0 denotes not. In each iteration, choose (ui , vj ) E at random and flip xij . Thus, in the current state x, choose a new search state x 0 = {x 0 00, ..., x0 |U||V | } where x 0 ij = 1 xij , and x 0 gh = xgh, if the edges (ug, vh) 6= (ui , vj ). After choosing a new state x 0 , using a fitness function f to decide if we choose the new search state x 0 as the next state. If f(x 0 ) f(x), select x 0 . If f(x 0 ) < f(x), select x 0 with the probability e f(x 0 )f(x) K , where K is a constant,otherwise, select x.Here we choose 0m as the starting state x for the maximization problems and choose a fitness function f, where f(x) = 0 for the state x which there exist two edges in the matching sharing a common vertex, and f(x) = P uiU,vjV xijwij for the state x, not which has two edges that share the same vertex. This fitness function f will guarantee the matching is reasonable in each iteration.

The Complexity of Metropolis Algorithm In the Metropolis algorithm, generating a new search state costs a little. To generate a new search state we choose a edge (ui , vj ) E at random and flip xij . It will cost O(1) to generate a new search state. Then, it costs O(1) to calculate the weight of the new search state and costs O(1) to verify if the 15 new state is reasonable. If the new search state is better than the best state, record the new search state as the best state and it will cost O(U). Thus, if there are c iterations, the complexity of the Metropolis algorithm is O(cU).

Input: Weighted bipartite graph G = (U, V, E) and each edge (ui , vj ) E has a weight wij . MatchingListBest = [] Weightmin = for t = 1 to tmax do {Generate Solution} for k = 1 to NumberOfAnts do Availk (U)(t) = U; MatchingListk (t) = [] Weightk (t) = 0 while |Availk (U)(t)| > 0 do choose available ui Availk (U)(t) based on ij (t) remove ui in Availk (U)(t) if ui has available adjacent vertices Nk i (t) V then choose vj Nk i (t) based on ij (t) and ij add (ui , vj ) into MatchingListk (t) Weightk (t) = Weightk (t) + wij else add (ui , ) into MatchingListk (t) Weightk (t) = Weightk (t) + wmax end if end while if Weightk (t) Weightmin(t) then MatchingListBest = MatchingListk (t) end if end for {Update pheromone} for k = 1 to NumberOfAnts do for l = 1 to |MatchingListk (t)| and (xl , yl) MatchingListk (t) do k xl1,xl (t) = 1/Weightk (t) if yl 6= then k xl ,yl (t) = 1/Weightk (t) else k xl ,xl (t) = 1/Weightk (t) end if end for end for for (ui , vj ) E do ij (t + 1) = (1 )ij (t) + Pm k=1 k ij (t) end for for ui , uj U, ui 6= uj do ij (t + 1) = (1 )ij (t) + Pm k=1 k ij (t) end for t = t + 1; end for 1

Input: Weighted bipartite graph G = (U, V, E) and each edge (ui , vj ) E has a weight wij . loop choose (ui , vj ) E at random and flip xij sample from U(0, 1) if f(x 0 ) f(x) then select x 0 else if e f(x 0 )f(x) K then select x 0 end if end if end loop

The Complexity of Metropolis Algorithm In the Metropolis algorithm, generating a new search state costs a little. To generate a new search state we choose a edge (ui , vj ) E at random and flip xij . It will cost O(1) to generate a new search state. Then, it costs O(1) to calculate the weight of the new search state and costs O(1) to verify if the 15 new state is reasonable. If the new search state is better than the best state, record the new search state as the best state and it will cost O(U). Thus, if there are c iterations, the complexity of the Metropolis algorithm is O(cU).

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote