CPSC 629: Analysis of Algorithms
Exam 2 Information
General Information
The second exam will be Wedneday May 12 from 1-3pm in
our classroom (during the final exam slot).
It will be a closed book exam (no notes, books, or neighbors).
However, I will allow you to use one 8.5x11 page of notes (one side),
which you must turn in with your exam.
Material
All of the following are considered to be fair game:
- Chapters 21-23, 25-27, and 36-37 in the text.
(Reading Assignments 5-8.)
- Lectures thru April 29.
You are responsible for things that we went over that
were either not covered in the text, or that were done differently
than in the text.
-
Homeworks 4-6.
Know how to do all the problems on homeworks #4, #5 and #6.
the solutions to homework #6 will be available
on Thursday April 29 (remember, this assignment will not be graded).
Some Review Questions
- Union/Find Data Structures:
Review the various versions of the union/find (disjoint sets) data
structure. What types of operations does this data structure support?
What are the complexities of the various versions?
- Stongly Connected Components:
Review the algorithm for computing the strongly connected components
of a digraph. What basic graph algorithm is it based on?
- Shortest Paths:
What are the asymptotic complexities of the algorithms for computing
single source shortest paths (SSSP) in a weighted directed graph.
How can you use an SSSP algorithm to solve the all pairs shortest
path problem (APSP)? What are the asymptotic complexities of the
APSP algorithms that would result if you used each of the SSSP
algorithms? What is the asymptotic complexity of Johnson's APSP
algorithm, and when should you use it?
Consider the SSSP algorithms of Dijkstra, Bellman-Ford, and Floyd-Warshall
and the APSP algorithm of Johnson.
Which algorithms cannot handle negative weight edges?
Why can't they handle them?
Which algorithms cannot handle negative weight cycles?
Why can't they handle them?
- Max Flow Problems:
Review the Ford-Fulkerson maximum flow algorithm. What is its
complexity? How does it work? What properties are maintained by
the algorithm?
- NP-Completeness:Constructing Cliques.
how that if the decision problem CLIQUE in P, then the problem
of listing the vertices of a largest clique in a graph is solvable in
polynomial-time.
In other words, suppose you are given a ``black box'' containing
a polynomial-time algorithm that, on any input (G, k), tells
you whether or not there is a clique in G of size k.
Use this black box to construct a polynomial-time
algorithm to actually construct the largest clique in a graph.
- NP-Completeness: Longest Path Problem (LP).
Given an undirected graph G=(V,E,W) with non-negative integer weights,
and two vertices x, y in V,
the Longest Path Problem
is to find the longest path between x and y in G,
i.e., the path with the largest weight.
(An edge can appear at most once in the path.)
- Formulate the Longest Path problem as a decision problem LP.
- Show that LP is in NP.
- Show that LP is NP-Hard by giving a polynomial-time
transformation from a known NP-Complete Problem to LP.
Prove that your transformation is correct.
(Hint: Use the Hamiltonian Path problem as your known NP-Complete problem.)
- Approximation Algorithms:
Understand the approximation algorithms for computing a traveling
salesman tour when the inter-city distances satisfy the triangle
inequality given in the text.