hw_9_soln - CS 473: Algorithms, Fall 2010 HW 9 (due...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 473: Algorithms, Fall 2010 HW 9 (due Tuesday, November 16th) This homework contains four problems. Read the instructions for submitting homework on the course webpage . In particular, make sure that you write the solutions for the problems on separate sheets of paper; the sheets for each problem should be stapled together. Write your name and netid on each sheet. Collaboration Policy: For this home work, Problems 1-3 can be worked in groups of up to 3 students each. Problem 0 should be answered in Compass as part of the assessment HW7-Online and should be done individually. 1. (25 pts) Given an undirected graph G = ( V,E ) and two distinct nodes s,t describe an algorithm that decides if there are k internally node-disjoint paths between s and t . Two s- t paths P and Q are internally node-disjoint if they do not share any nodes other than s and t . Solution : We first turn the undirected graph into a directed graph by turning each undirected edge { u,v } , into two directed edges, ( u,v ) and ( v,u ). We now use the same reduction as we did when we were studying shortest paths, in order to shift the capacity from the nodes to the edges. Specifically, we split each node v V ( G ) \ { s,t } into two nodes v and v 00 and create the edge ( v ,v 00 ). We connect each incoming edge of v to the node v , and we connect each outgoing edge of v to the node v 00 . As was done in class for the k edge disjoint problem, we now give every edge in the graph unit capacity. Finally, we run a max flow algorithm, and output true if and only if the value of the flow is greater than or equal to k . Since k = O ( n ), this takes O ( mn ) time with Ford-Fulkerson, and it takes O ( m 2 log n ) time with capacity scaling. We now sketch a proof of correctness for this algorithm. In the following let G be the original graph, and let G be the network that was created from G by the algorithm above. First we show that if there are k internally node disjoint s- t paths in G , then there is a flow of size k in G . Let p = s,v 1 ,v 2 ,...,v l ,t be one of the k internally node disjoint paths in G . Then clearly p = s,v 1 ,v 00 1 ,v 2 ,v 00 2 ,...,v l ,v 00 l ,t is a valid s- t path in G . We can send one unit of flow along this path since all capacities were integral. Also, since all k of the s- t paths in G were internally node disjoint, the corresponding paths in G with be node disjoint, and hence we can push one unit of flow on all such paths without violating the capacity constraint. Therefore we will get a flow of size k , since there were k paths. Now we show that if there is a flow of size k in G , then there are k internally disjoint paths in G . Since the capacities are integers, we know that if there is a flow of value k , then there is an integer flow of value k . We also know we can decompose the flow into k s- t paths each with flow 1. Since all the edges have unit capacity, this implies that the paths are edge disjoint....
View Full Document

Page1 / 6

hw_9_soln - CS 473: Algorithms, Fall 2010 HW 9 (due...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online