sol6 - Introduction to Algorithms CS 482 Spring 2008...

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

View Full Document Right Arrow Icon
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. (b) The numbers in the table are wrong. The demand for blood of type B should be 10, not 8.
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern