HW3_April2018_answers.pdf

Is the previous shop from which it is cheapest to go

Info icon This preview shows page 2. Sign up to view the full content.

View Full Document Right Arrow Icon
] is the previous shop from which it is cheapest to go shop i . Q5 : a) Yes, it will. The algorithm works by finding a path from s to t , and send- ing as much flow along it as possible. If all edges have even capacity, then in the first iteration, clearly the flow will be even. We then modify the edges by subtracting this flow, and reversing edges, and so in the new graph, again all edges have even capacity. Thus in each step, the amount of flow on each edge is even. b) Suppose a node n in the original graph has a capacity c . Replace it with two nodes, called n 1 , n 2 . Add an edge from n 1 to n 2 , with capacity c . For all edges incoming to node n in the original graph, replace them with an edge incoming to n 1 in the new graph. For all edges outgoing from node n in the original graph, replace them with an edge outgoing from n 2 in the new graph. In other words, make a new graph G 0 to replace the original graph G . G 0 has twice as many nodes as G . For every node n in G , make nodes n 1 and n 2 in G 0 . Add an edge ( n 1 , n 2 ) in G 0 , with capacity corresponding to the capacity of node n in G . For an edge ( n, m ) in G , add an edge ( n 2 , m 1 ) in G 0 . If there is f units of flow going through node n in G , there are f units of flow along the edge ( n 1 , n 2 ) in G 0 . 2
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