sol6 - Introduction to Algorithms Solution Set 6 CS 482,...

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: Introduction to Algorithms Solution Set 6 CS 482, Spring 2008 (1) (a) To compute whether the blood on hand meets the projected demand, one can construct a flow network with 10 vertices. A super-source s . For each blood type x , a pair of vertices u x ,v x . A super-sink t . The edges and their capacities are as follows. For all x , an edge ( s,u x ) with capacity s x . For all x,y such that x can donate blood to y , an edge ( u x ,v y ) with infinity capacity. For all x , and edge ( v x ,t ) with capacity d x . The blood on hand meets the projected demand if and only if the value of the maximum flow in the network is equal to the sum of demands (i.e., the quantity x d x ). Indeed, if f is a flow and v ( f ) = x d x then f must saturate every edge into t . In this case, the amount of flow on edge ( u x ,v y ) designates the amount of blood that should be donated from people of type x to people of type y . The capacity constraints on the edges ( s,u x ), along with flow conservation, guarantee that the supply of blood on hand is sufficient to provide the required amount of type x blood, for all x . Conversely, if there is a way to satify the projected need with the blood on hand, then one can construct a network flow which saturates each edge ( v x ,t ) by letting the flow on each edge ( u x ,v y ) be the amount of type x blood used to satisfy the demand for type y , and filling in the flow values on the remaining edges in the unique way that satisfies flow conservation....
View Full Document

Page1 / 3

sol6 - Introduction to Algorithms Solution Set 6 CS 482,...

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