Fe Practice

download Fe Practice

of 3

Transcript of Fe Practice

  • 8/11/2019 Fe Practice

    1/3

  • 8/11/2019 Fe Practice

    2/3

    3. (5 points) What is the dual of the following linear program?

    Objective function to be maximized:m

    i = 1 biyi

    Inequalities:m

    i = 1

    tijyi 1 j = 1, , n

    Nonnegativity constraints:

    yi 0 i = 1, ,m.

    Solution:

    Objective function to be minimized:n

    j = 1 xj

    Inequalities:n

    j = 1

    tijxj bi i = 1, ,m

    Nonnegativity constraints:

    xj 0 j = 1, , n.

    4. LetG = (V,E,s,t ,c) be a network such that all edges have capacity 1. Also, for every vertex u V {s, t},indegree(u) = 1 or outdegree(u) = 1 .

    Show that iffis an integral flow in G, then there exist |f| vertex-disjoint paths from s to t each carrying aflow of value 1.

    (Assume that the flow is integral.)

    Solution:

    Let fbe an integral flow constructed using Ford-Fulkerson algorithm. Since the capacity of each edge is 1,there must be |f| edges out ofs that carry a flow of value 1. Let (s, u1), (s, u2), , (s, u|f|) be these edges.There is a unit flow out of each of these vertices. The flow out of these|f| vertices must go to |f| distinctvertices. Suppose there are two vertices, say ui and uj such that the flow out of these two vertices goes tothe same vertex, say v. That is, the inflow into v is 2. Then, Indegree(v) must be 2. By degreeconstraints,outdegree(v) = 1. That is, flow out ofv is at most 1. This violates the conservation conditionat the vertex v. Continuing this argument, we conclude that there are fvertex-disjoint paths each carryinga flow of value 1.

    5. Let G = (V, E) be an undirected graph. A matchingin Gis a collection of edges Msuch that no two edgesin M share a vertex. A maximum cardinality matching is a matching with the maximum possible size. A

    perfect matchingis a matching in which every vertex has an incident matched edge.A perfect matching in a graph with edge weights is said to be a weighted perfect matching.

    Show how to reduce the maximum cardinality matching problem to the problem of finding a maximumweight perfect matching. Your reduction should work in linear time.

    Solution: Let G = (V, E) be a graph. Let G = (V, E) be the complete graph on V. Create weights onE as follows: if (u, v) E then weight(u, v) = 1 and if (u, v) E then weight(u, v) = 0 .

    A maximum cardinality matching G gives a maximum weight perfect matching in G and vice-versa.

    2

  • 8/11/2019 Fe Practice

    3/3

    6. Let G = (V, E) be a bipartite graph. Describe an efficient algorithm to decide ifG has more than onemaximum matching.

    Solution: Use the O(m

    (n)) algorithm discussed in class to find a maximum matching in G. Then, foreach edge in M do: remove the edge from the graph and find a maximum matching. If there is an edgeremoving which the remaining graph has a maximum matching of size the same as the original matchingthen G has more than one maximum matching.

    Time: O(m2(n)).

    7. Design an O(m

    (n)) algorithm to find a maximum independent set in a bipartite graph. Why is youralgorithm correct? Why does it run in the claimed time bound?

    Solution: The minimum vertex cover C in a graph G(V, E) is the complement of the set of vertices in itsmaximum independent set I.

    Why?

    Let I = V\C. Let u, v be two vertices in I. Then, u, v C. Suppose there is an edge betweenu andv then it is not covered by C. This is not possible since C is a vertex cover. That is, Iis an independentset.

    Let C = V\I. Let (u, v) be an edge in G. Then, both u and v cannot be in I. That is, either u or v isin C. Therefore, Cis a vertex cover ofG.

    We saw in class a O(m

    (n)) algorithm for finding a maximum matching in a bipartite graph. From this,we saw an algorithm to compute a minimum vertex cover in the claimed time bound. Using that we find amaximum independent set in G.

    8. LetWbe an n nmatrix whose (i, j)-th entry is (n)ij , where 0 i, j (n 1), and n is a principaln-th root of unity. LetX = (X0, . . . , X n1) be an n vector. The FFT algorithm shows that the matrixvector productW Xcan be computed in O(n log n) time.

    Let FFT(X) denote the vector that results by applying the FFT evaluation algorithm to the vector X.

    Describe an O(n) algorithm to compute FFT(FFT(X)).

    Solution: FFT(FFT(X)) is W2 X.

    (W2)jk = 0 if j+ k is not a multiple ofn and it is n otherwise.

    3