CSCI 3104 - Algorithms - Fall 2006

Problem Set #5

Due: 3pm, Oct 11th, 2006



1. Text problem 3.2.

2. Text problem 3.4.

3. Text problem 3.8.

4. Text problem 3.11. Justify the correctness and running time of your algorithm.

5. Text problem 3.24. Justify the correctness and running time of your algorithm. (Note that it says dag and not digraph. If we ask the same problem about a digraph, there is no known polynomial-time algorithm!)

6. A chain of words is a list of words where the i-th word is the (i-1)st word with one extra character and some mixing of letters. For example, AN, TAN, RANT, TRAIN, RETINA, NASTIER is a chain of length 6. Find the longest chain you can in our wordlist.

In order to do this, first build a dag. The dag will consist of a node for each word (you might want to collapse words into a single node when it makes sense to), and an edge from word x to word y if y can follow x in a chain. Then run DFS from each source node in the dag and keep track of the maximum depth you reach. Print out the list of words you find.

7. (Extra Credit) Don't do this one until you've worked on all others first! This is worth only a few points and is harder than the other problems.     Text problem 3.28.