HW4 - UF CISE

advertisement
HW4. Problems are for practice only (submission not needed). Solutions will be
posted next Monday (April 14, 2003)
1. Problem 9 (page 337 of the textbook): Let G(V,E) be any connected undirected
graph. A bridge of G is defined to be an edge of G which when removed from G,
will make it disconnected. Present an O(|E|) time algorithm to find all the bridges
of G.
2. Problem 10 (page 337 of the textbook): Let S(V,T) be any DFS tree for a given
connected undirected graph G(V,E). Prove that a leaf of S cannot be an
articulation point of G.
3. It is easy to see that for any graph G, both DFS and BFS will take almost the same
amount of time. However, the space requirement may be considerably different.
(a) Give an example of an n-vertex graph for which the depth of recursion of DFS
starting from a particular vertex v is n-1 whereas the queue of BFS has at most
one vertex at any given time if BFS is started from the same vertex v.
(b) Give an example of an n-vertex graph for which the queue of BFS has n-1
vertices at one time whereas the depth of recursion of DFS is at most one. Both
searches are started from the same vertex.
4. Suppose you are given n men and n women and two n x n arrays P and Q such
that P(i,j) is the preference of man i for woman j and Q(i,j) is the preference of
woman i for man j. Give an algorithm that finds a pairing of men and women such
that the sum of the product of the preferences is maximized. (∑P(i,j)Q(i,j)). Give
idea of the algorithm, worst time complexity and proof of correctness.
5. Let F={Sj} be a finite family of sets. TF is an exact cover of F iff T is a cover of
F and the sets in T are pairwise disjoint. Show that the chromatic number decision
problem reduces to the problem of determining whether F has an exact cover.
6. Prove or disprove that the following decision problem NP-complete. Instance:
Positive integers a1…an, b. Question: Are there non-negative integers x1…xn such
n
that  ai  xi  b ?
i 1
7. Given an integer m x n matrix A and an integer m x 1 vector b, the 0-1 integer
programming problem asks whether there is an integer n X 1 vector x with
elements in the set {0,1} such that Ax <= B. Prove that the integer programming is
NP-Complete.
8. UF students have a range of talents like singing, playing, dramatics etc. Many
students are multi-talented, and each student has at least one talent. Devise an
algorithm to make a list of t talents such that if all the students who have any one
of those t talents are asked to show up, all the UF students will be eligible to
come. Is your algorithm NP-complete?
9. In the pro-wrestling world, there is either friendliness or hatred between any two
wrestlers. Vince McMahon, the fight promoter, plans to have the biggest multiwrestler fight show by putting x such wrestlers together in the ring so that no two
wrestlers in the ring like each other. Design an algorithm to help Vince to choose
x such wrestlers. Is your algorithm NP-complete?
10. In Gotham city, Batman’s arch-enemy Joker plans to destroy Batman’s dream
project – the flyover system. The flyover system is a road network above the
ground, where each intersection is supported using a pillar from ground
(intersections are defined as points where two or more roads meet, or any dead
end).
Joker plans to target the pillars since once an intersection is destroyed, all road
segments connected to that intersection are destroyed. Since joker has limited
explosives, he will like to select a set of pillars to minimize the number of
explosives are used. Design an efficient algorithm to help Joker minimize the
number of pillars to be targeted. Is your algorithm NP-complete? Is your
algorithm NP-hard?
Download