Docsity

5 Problems Homework 2 - Design and Computer Algorithms | CMSC 451, Assignments of Computer Science

Toggle sidebar
bg1
CMSC 451
Summer 2006 Homework 2 Juli´an Mestre
Due on Wednesday 2
Problem 1: In an undirected graph G, the disconnecting power of a vertex uis defined
as the number of connected components of G−u. Design an algorithm that computes the
disconnecting power of every vertex in O(n+m) time.
Problem 2: In class we discussed an algorithm for Interval Coloring in which intervals were
added to the solution in increasing starting time. What would happen if intervals are added
in increasing finishing time? Prove or disprove the correcteness of this strategy.
Problem 3: Show that the following algorithm finds a minimum spanning tree.
IMPROVING-MST(G,w)
Let Tbe some spanning tree of G
For e∈E[in any order]
T←T+e
Let Cbe the unique cycle in T
Let fbe a heaviest edge in C
T←T−f
Problem 4: A computer network can be modelled as an undirected graph G= (V, E ) where
vertices correspond to computers and edges correspond to physical links between computers.
In practice the maximum transmission rate or bandwidth varies from link to link; let b(e)
be the bandwidth of edge e∈E. The bandwidth of a path pis defined as the minimum
bandwidth of edges in the path, i.e., b(p) = mine∈pb(e). Design an algorithm that computes
a maximum bandwidth path between two vertices. If you are up to the challenge you can
solve Exercise 4.19 from the book instead.
Problem 5: You are to schedule a set of jobs Jusing two machines. Each job i∈ J has
processing time pi. There is no preemption, once a job starts running it cannot be stopped. A
machine can work on only one job at a time. A schedule assigns to each job i∈ J a starting
time siand a machine to run on. Design a greedy algorithm that finds a schedule minimizing
the average completion time 1
nPisi+pi.
Problem (extra credit): A matroid is a subset system (E , L) with the property
∀x∈E, C ⊂D∈ L such that C+x∈ L and D+x /∈ L
there exists y∈D\Csuch that D−y+x∈ L (1)
A more common way of defining a matroid is to ask for the property
∀A, B ∈ L such that |A|<|B|there is z∈B\Asuch that A+z∈ L (2)
Prove that the two exchange properties are equivalent.

Partial preview of the text

Download 5 Problems Homework 2 - Design and Computer Algorithms | CMSC 451 and more Assignments Computer Science in PDF only on Docsity!

CMSC 451

Summer 2006 Homework 2^

Juli´an Mestre

Due on Wednesday 2

Problem 1: In an undirected graph G, the disconnecting power of a vertex u is defined as the number of connected components of G − u. Design an algorithm that computes the disconnecting power of every vertex in O(n + m) time.

Problem 2: In class we discussed an algorithm for Interval Coloring in which intervals were added to the solution in increasing starting time. What would happen if intervals are added in increasing finishing time? Prove or disprove the correcteness of this strategy.

Problem 3: Show that the following algorithm finds a minimum spanning tree.

IMPROVING-MST(G,w)

Let T be some spanning tree of G For e ∈ E [in any order] T ← T + e Let C be the unique cycle in T Let f be a heaviest edge in C T ← T − f

Problem 4: A computer network can be modelled as an undirected graph G = (V, E) where vertices correspond to computers and edges correspond to physical links between computers. In practice the maximum transmission rate or bandwidth varies from link to link; let b(e) be the bandwidth of edge e ∈ E. The bandwidth of a path p is defined as the minimum bandwidth of edges in the path, i.e., b(p) = mine∈p b(e). Design an algorithm that computes a maximum bandwidth path between two vertices. If you are up to the challenge you can solve Exercise 4.19 from the book instead.

Problem 5: You are to schedule a set of jobs J using two machines. Each job i ∈ J has processing time pi. There is no preemption, once a job starts running it cannot be stopped. A machine can work on only one job at a time. A schedule assigns to each job i ∈ J a starting time si and a machine to run on. Design a greedy algorithm that finds a schedule minimizing the average completion time (^1) n

i si^ +^ pi.

Problem (extra credit): A matroid is a subset system (E, L) with the property

∀ x ∈ E, C ⊂ D ∈ L such that C + x ∈ L and D + x /∈ L there exists y ∈ D \ C such that D − y + x ∈ L

A more common way of defining a matroid is to ask for the property

∀A, B ∈ L such that |A| < |B| there is z ∈ B \ A such that A + z ∈ L (2)

Prove that the two exchange properties are equivalent.