Vous êtes sur la page 1sur 2

03 Nov 2009

Jaypee Institute of Information Technology University, NOIDA

07B71CI404/09M31CI424 - Graph Algorithms & Apps./Algorithmic Graph Theory

ASSIGNMENT-I - 03 Nov 2009

Instructor: Harkesh Singh Dagar (dagarhs@yahoo.co.uk)

Due: 20 Nov 2009

1. (5 points) Suppose we are given an array A[1..m][1..n] of non-negative real numbers. We want to round
A to an integer matrix, by replacing each entry x in A with either ⌊x⌋ or ⌈x⌉, without changing the sum
of entries in any row or column of A. For example:
   
1.2 3.4 2.4 1 4 2
3.9 4.0 2.1 → 4 4 2
7.9 1.6 0.5 8 1 1

Describe an efficient algorithm that either rounds A in this fashion, or reports correctly that no such
rounding is possible.
2. (5 points) In an institute there are seven instructors and twelve classes. The teaching requirements for
a five-day week are given by the matrix

Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Y9 Y10 Y11 Y12


X1 3 2 3 3 3 3 3 3 3 3 3 3
X2 1 3 6 0 4 2 5 1 3 3 0 4
X3 5 0 5 5 0 0 5 0 5 0 5 5
P =
X4 2 4 2 4 2 4 2 4 2 4 2 3
X5 3 5 2 2 0 3 1 4 4 3 2 5
X6 5 5 0 0 5 5 0 5 0 5 5 0
X7 0 3 4 3 4 3 4 3 4 3 3 0

where pij is the number of periods that instructor Xi must teach class Yj .
(a) Into how many periods must a day be divided so that the requirements can be satisfied?
(b) If an eight-period/day timetable is drawn up, how many classrooms will be needed?
(c) Present a schedule for part (b) above.
3. (5 points) Suppose we model a computer network as a weighted undirected graph, where each vertex
represents a computer and each edge represents a direct network connection between two computers.
The weight of each edge represents the bandwidth of that connection—the number of bytes that can
flow from one computer to another in one second. (Note that the bandwidth is symmetric; there are
no cable modems or wireless phones. Also, don’t worry about systems level stuff like network load and
latency.) We want to implement a point-to-point network protocol that uses a single dedicated path to
communicate between any pairs of computers. Naturally, when two computers need to communicate, we
should use the paths with the highest bandwidth. The bandwidth of a path is the minimum bandwidth
of its edges.

Page 1 of 2
ASSIGNMENT-I - 03 Nov 2009
Describe and analyze an order O(|V |2 ) (yes, no misprint, that is O(|V |2 ) and not O(|V |3 )) algorithm to
compute the maximum bandwidth path between every pair of computers in the network. Assume that
the graph is represented as an adjacency list.
4. (5 points) In order to facilitate recompiling programs from multiple source files when only a small
number of files have been updated, there is a utility called ‘make’ that only recompiles those files that
were changed after the most recent compilation, and any intermediate files in the compilation that depend
on those changed. A makefile is typically composed of a list of source files that must be compiled. Each
of these source files is dependent on some of the other files which are listed. Thus, a source file must be
recompiled if a file on which it depends is changed.
Assuming you have a list of which files have been recently changed, as well as a list for each source file
of the files on which it depends, design an algorithm to recompile only those necessary. Do not worry
about the details of parsing a makefile.
5. (5 points) The incidence matrix of an undirected graph G = (V, E) is a |V | × |E| matrix B = (bij ) such
that (
1 vertex vi and edge ej are incident,
bij =
0 otherwise.

(a) Describe what all the entries of the matrix product BB T represent (B T is the matrix transpose).
Justify.
(b) Describe what all the entries of the matrix product B T B represent. Justify.
(c) Let C = BB T − 2A. Let C ′ be C with the first row and column removed. What does det C ′
represent? (A is the adjacency matrix of G, with zeroes on the diagonal.)

Trivia: Telescoping Sums

We have discussed telescoping sums earlier in class. Can you compute the following sum by employing this
method? n
X
Compute k! · k.
k=1

Solution
We can write

k! · k = k! · (k + 1 − 1)
= (k + 1)! − k!.

Thus, the sum transforms to


n
X
[(k + 1)! − k!].
k=1

After cancellations, this is equal to (n + 1)! − 1.

Afterthought

I have yet to see any problem, however complicated, which, when you looked at it in the right
way, did not become more complicated.

— Paul Anderson

Powered by TEX (and friends: PGF, TikZ, etc.), Vim, and Mathematica

Page 2 of 2

Vous aimerez peut-être aussi