| Homework 8General Comments
- For full credit, provide context for each problem, show all calculations,
and justify all answers by providing enough comments to explain your reasoning.
- Homework assignments must be very neatly written or typeset
(e.g. using Word or OpenOffice).
- You can get up to 50% credit on a problem if you get significant outside assistance. Thus, if you are totally stuck on a problem it might be worth getting help. However, you must indicate any assistance/collaboration (See the Homework Assistance section on the Policies page). Failure to do so could result in a failing grade for the course! Note that getting help from the Help Center or me does not count as significant outside assistance, but talking with your classmates or searching on the Internet does!
- If a problem asks for an algorithm,
you should give the most efficient algorithm you can find to ensure full credit.
You should also specify the complexity of the algorithm with justification,
whether or not the problem asks for it.
Details
-
(8) Complete the
Kevin Bacon Assignment.
You may work in pairs on this problem,
but not on the rest of the assignment.
-
(6) Run DFS on the following DAG.
Process the vertices in alphabetical order, both in the overall
algorithm and the adjacency lists!
Print/copy/redraw the graph and write the timestamps on the nodes.
- Show the discovery and finishing timestamps for every vertex.
- Classify every edge (tree, back, forward, cross).
- List the vertices in decreasing order of their finishing times (largest finish time first).
In fact, redraw the graph with the vertices lined up in that order.
- Observation: What special property does the ordering from part (c) have for a DAG? State it in one sentence and explain why it holds using the DFS timestamps.
- (6) Problem 10 from BFS (Even-Length Cycle Detection via BFS).
|
|
|