Docsity

Advanced Analysis of Algorithms - Quiz II, Quizzes of Algorithms and Programming

Toggle sidebar
bg1
Advanced Analysis of Algorithms - Quiz II
K. Subramani
LCSEE,
West Virginia University,
Morgantown, WV
1 Instructions
1. Attempt as many problems as you can. You will be given partial credit.
2. The duration of this quiz is 1 hour, 20 minutes, i.e., 8 : 00-9 : 20 am.
2 Problems
1. Let G=< V, E , c > denote an undirected graph with vertex set V, edge set Eand a cost function cthat
assigns a positive integer c(e) to each edge eโˆˆE. If all the edge costs are unique, argue that Ghas a unique
Minimum Spanning Tree. (7 points)
2. The Hamilton Cycle problem is defined as follows:
HC: Given an undirected graph G=< V, E >, with vertex set Vand edge set E, is there a simple cycle in
G, that visits all the vertices in V?
The Traveling Salesman problem is defined as follows:
TSP: Given a complete undirected graph G=< V, E, c >, with vertex set V, edge set Eand a cost function
c, that assigns a positive cost c(e)to each edge eโˆˆE, and a number K, does there exist a tour (simple
cycle) of Gthat visits all the vertices in V, and whose cost at is at most K? The cost of a tour is defined
as the sum of the costs of the edges in the tour.
Describe a polynomial time transformation of HC to TSP. (7 points)
3. Develop a counterexample to show that the greedy algorithm developed for the fractional Knapsack problem
does not work for the 0/1 Knapsack problem. (6 points)
1

Partial preview of the text

Download Advanced Analysis of Algorithms - Quiz II and more Quizzes Algorithms and Programming in PDF only on Docsity!

Advanced Analysis of Algorithms - Quiz II

K. Subramani

LCSEE,

West Virginia University,

Morgantown, WV

{[email protected]}

1 Instructions

  1. Attempt as many problems as you can. You will be given partial credit.
  2. The duration of this quiz is 1 hour, 20 minutes, i.e., 8 : 00-9 : 20 am.

2 Problems

  1. Let G =< V, E, c > denote an undirected graph with vertex set V , edge set E and a cost function c that assigns a positive integer c(e) to each edge e โˆˆ E. If all the edge costs are unique, argue that G has a unique Minimum Spanning Tree. (7 points)
  2. The Hamilton Cycle problem is defined as follows: HC: Given an undirected graph G =< V, E >, with vertex set V and edge set E, is there a simple cycle in G, that visits all the vertices in V?

The Traveling Salesman problem is defined as follows: TSP: Given a complete undirected graph G =< V, E, c >, with vertex set V , edge set E and a cost function c, that assigns a positive cost c(e) to each edge e โˆˆ E, and a number K, does there exist a tour (simple cycle) of G that visits all the vertices in V , and whose cost at is at most K? The cost of a tour is defined as the sum of the costs of the edges in the tour. Describe a polynomial time transformation of HC to TSP. (7 points)

  1. Develop a counterexample to show that the greedy algorithm developed for the fractional Knapsack problem does not work for the 0/1 Knapsack problem. (6 points)