Docsity

Homework 2 for CS CS 473g: Algorithms, Fall 2007, Assignments of Algorithms and Programming

Toggle sidebar
bg1
CS CS 473g: Algorithms, Fall 2007
Homework 2 (due Tuesday, October 9, 2007 at 11:59.99 p.m.)
Version 1.02
Name:
Net ID: Alias:
Name:
Net ID: Alias:
# Score Grader
1.
2.
3.
4.
5.
Total
Neatly print your name(s), NetID(s), and the alias(es) you used for Homework 0 in the boxes above.
Staple this sheet to the top of your homework. If you are on campus, submit the homework by
submitting it in SC 3306 (or sliding it under the door).
Note: You will be held accountable for the appropriate responses for answers (e.g. give models,
proofs, analysis, etc). For NP-Complete problems you should prove everything rigorously, i.e. for
showing that it is in NP, give a description of a certificate and a polynomial time algorithm to verify
it, and for showing problems are NP-Hard, you must show that your reduction is polynomial time
(by similarly proving something about the algorithm that does the transformation) and proving
both directions of the ‘if and only if’ (a solution of one is a solution of the other) of the many-one
reduction.
pf3

Partial preview of the text

Download Homework 2 for CS CS 473g: Algorithms, Fall 2007 and more Assignments Algorithms and Programming in PDF only on Docsity!

CS CS 473g: Algorithms, Fall 2007

Homework 2 (due Tuesday, October 9, 2007 at 11:59.99 p.m.)

Version 1.

Name:

Net ID: Alias:

Name:

Net ID: Alias:

# Score Grader

Total

Neatly print your name(s), NetID(s), and the alias(es) you used for Homework 0 in the boxes above. Staple this sheet to the top of your homework. If you are on campus, submit the homework by submitting it in SC 3306 (or sliding it under the door).

Note: You will be held accountable for the appropriate responses for answers (e.g. give models, proofs, analysis, etc). For NP-Complete problems you should prove everything rigorously, i.e. for showing that it is in NP, give a description of a certificate and a polynomial time algorithm to verify it, and for showing problems are NP-Hard, you must show that your reduction is polynomial time (by similarly proving something about the algorithm that does the transformation) and proving both directions of the ‘if and only if’ (a solution of one is a solution of the other) of the many-one reduction.

In the back of her mind, Sherri thought about death ceaselessly. Everything else, all people, objects and processes had become reduced to the status of shadows. Worse yet, when she contemplated other people she contemplated the injustice of the universe. They did not have cancer. This meant that, psychologically speak- ing, they were immortal. This was unfair. Everyone had conspired to rob her of her youth, her happiness and eventually her life; in place of those, everyone else had piled infinite pain on her, and probably they secretly enjoyed it. "Enjoying themselves" and "enjoying it" amounted to the same evil thing. Sherri, therefore, had motivation for wishing that the whole world would go to hell in a handbasket. — Valis, Philip K. Dick

Required Problems

  1. Greedy algorithm does not work for TSP with the triangle inequality. [20 Points] In the greedy Traveling Salesman algorithm, the algorithm starts from a starting vertex v 1 = s, and in i-th stage, it goes to the closest vertex to vi that was not visited yet.

(a) [10 Points] Show an example that prove that the greedy traveling salesman does not provide any constant factor approximation to the TSP. Formally, for any constant c > 0 , provide a complete graph G and positive weights on its edges, such that the length of the greedy TSP is by a factor of (at least) c longer than the length of the shortest TSP of G. (b) [10 Points] Show an example, that prove that the greedy traveling salesman does not provide any constant factor approximation to the TSP with triangle inequality. Formally, for any constant c > 0 , provide a complete graph G, and positive weights on its edges, such that the weights obey the triangle inequality, and the length of the greedy TSP is by a factor of (at least) c longer than the length of the shortest TSP of G. (In particular, prove that the triangle inequality holds for the weights you assign to the edges of G.)

  1. Maximum Clique [10 Points] Let G = (V, E) be an undirected graph. For any k ≥ 1 , define G(k)^ to be the undirected graph (V (k), E(k)), where V (k)^ is the set of all ordered k-tuples of vertices from V and E(k)^ is defined so that (v 1 , v 2 , ..., vk) is adjacent to (w 1 , w 2 , ..., wk) if and only if for each i ( 1 ≤ i ≤ k) either vertex vi is adjacent to wi in G, or else vi = wi.

(a) [5 Points] Prove that the size of the maximum clique in G(k)^ is equal to the k-th power of the size of the maximum clique in G. (b) [5 Points] Argue that if there is an approximation algorithm that has a constant ap- proximation ratio for finding a maximum-size clique, then there is a fully polynomial time approximation scheme for the problem.

  1. Greedy algorithm does not work for independent set. [20 Points] A natural algorithm, GreedyIndependent, for computing maximum independent set in a graph, is to repeatedly remove the vertex of lowest degree in the graph, and add it to the independent set, and remove all its neighbors.