next up previous
Next: About this document ...

`|= `@=


Applied Algorithms Anna Karlin, 426C Sieg
CSE 589, Autumn 2000

Homework # 2
Due by 4pm, FRIDAY, October 13




Reading: Skiena, chapters 1-4. You also may want to look at chapters 16, and 23- 26 in Cormen, Leiserson, Rivest.



Problems:

1.
Dynamic Programming:

2.
Graph representation: Consider an unweighted graph with n vertices and m edges. The two common data structures used to represent such a graph are adjacency matrices and adjacency lists. An adjacency matrix is an n x  n matrix M, where M[i,j]=1 if there is an edge from vertex i to vertex j and M[i,j]=0 otherwise. An adjacency list consists of an n-element array of pointers, where the i-th element points to a linked list of the edges incident on vertex i.

3.
Depth-first search on a directed graph: Write pseudo-code for depth first sirch on a directed graph, so that it prints out, for each edge examined, whether the edge is a tree edge, a back edge, a forward edge or a cross edge.

4.
We discussed (sometimes briefly) the following in the first lecture.

For each of the following problems, describe how it could be modeled as a graph problem and solved with the aid of one or more of the above known algorithms, or ideas involved therein. I have purposely left these problems somewhat vague....

(a)
Given a set of processes that need to be scheduled, and dependencies that tell you which processes need to be completed in order for a given process to execute, how would you schedule the processes so as not to violate any of the dependencies?
(b)
How would you find your way out of a maze using a very large collection of pennies?
(c)
DNA sequences - you are given experimental data consisting of small DNA fragments. For each fragment f, it has been determined experimentally that certain fragments lie to the left of f on the chromosome, certain fragments lie to the right of f, and the rest can be on either side. How would you go about finding a consistent ordering of the fragments from left to right that satisfies all the constraints?
(d)
Broadcast - suppose a given processor on a network wishes to broadcast a message to all other processors. How would you go about routing the message to all the other processors as efficiently as possible? You can assume that you have information about the bandwidth and congestion on the various links in the network.
(e)
Circuit simulation - Given a circuit layout and input/output information for each gate in the circuit (where its outputs go and where its inputs come from) how would you schedule the simulation of the gates in the circuit?
(f)
Graphics- A triangle strip is a sequence of triangles, $t_1,\ldots, t_n$ such that ti shares exactly one edge with ti+1 and exactly one (other edge) with ti-1, for each 1<i <n. Rendering engines are often able to very efficiently render a ``triangle strip'', much more efficiently than they can render each of the n individual triangles. Given a large set of triangles (given by the 3D coordinates of the three vertices of each triangle), how would you go about constructing a set of maximal triangle strips to feed to the renderer.




next up previous
Next: About this document ...
Ashish Sabharwal
2000-10-04