CS70 Midterm Exam 2 Spring 2009-Solution

# CS70 Midterm Exam 2 Spring 2009-Solution - CS570 Analysis...

This preview shows pages 1–5. Sign up to view the full content.

CS570 Analysis of Algorithms Spring 2009 Exam II Name: _____________________ Student ID: _________________ ____2:00-5:00 Friday Section ____5:00-8:00 Friday Section Maximum Received Problem 1 20 Problem 2 20 Problem 3 20 Problem 4 20 Problem 5 20 Total 100 2 hr exam Close book and notes 1) 20 pts Mark the following statements as TRUE or FALSE . No need to provide any justification.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
[ TRUE/FALSE ] TRUE The problem of deciding whether a given flow f of a given flow network G is maximum flow can be solved in linear time. [ TRUE/FALSE ] TRUE If you are given a maximum s - t flow in a graph then you can find a minimum s - t cut in time O(m). [ TRUE/FALSE ] TRUE An edge that goes straight from s to t is always saturated when maximum s - t flow is reached. [ TRUE/FALSE ] FALSE In any maximum flow there are no cycles that carry positive flow. (A cycle <e 1 , …, e k > carries positive flow iff f(e 1 ) > 0, …, f(e k ) > 0.) [ TRUE/FALSE ] TRUE There always exists a maximum flow without cycles carrying positive flow. [ TRUE/FALSE ] FALSE In a directed graph with at most one edge between each pair of vertices, if we replace each directed edge by an undirected edge, the maximum flow value remains unchanged. [ TRUE/FALSE ] FALSE The Ford-Fulkerson algorithm finds a maximum flow of a unit-capacity flow network (all edges have unit capacity) with n vertices and m edges in O(mn) time. [ TRUE/FALSE ] FALSE Any Dynamic Programming algorithm with n unique subproblems will run in O(n) time. [ TRUE/FALSE ] FALSE The running time of a pseudo polynomial time algorithm depends polynomially on the size of of the input [ TRUE/FALSE ] FALSE In dynamic programming you must calculate the optimal value of a subproblem twice, once during the bottom up pass and once during the top down pass.
2) 20 pts a) Give a maximum s-t flow for the following graph, by writing the flow f e above each edge e. The printed numbers are the capacities. You may write on this exam sheet. Solution: (b) Prove that your given flow is indeed a max-flow. Solution:

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
The cut ({s: 1, 2, 3, 4}, {5, 6, 7}) has capacity 6. The flow given above has value 6. No flow can have value exceeding the capacity of any cut, so this proves that the flow is a max-flow (and also that the cut is a min-cut). 3)
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 10/08/2010 for the course CS 570 taught by Professor Shahriarshamsian during the Fall '08 term at USC.

### Page1 / 9

CS70 Midterm Exam 2 Spring 2009-Solution - CS570 Analysis...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online