MS&E 211, Lecture 11 The dual of Min-Cost Flow Ashish Goel.

Slides:



Advertisements
Similar presentations
1 LP, extended maxflow, TRW OR: How to understand Vladimirs most recent work Ramin Zabih Cornell University.
Advertisements

Lecture 5: Network Flow Algorithms Max-Flow Min-Cut Single-Source Shortest-Path (SSSP) Job Sequencing.
Geometry and Theory of LP Standard (Inequality) Primal Problem: Dual Problem:
ECE Longest Path dual 1 ECE 665 Spring 2005 ECE 665 Spring 2005 Computer Algorithms with Applications to VLSI CAD Linear Programming Duality – Longest.
C&O 355 Mathematical Programming Fall 2010 Lecture 22 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A.
Introduction to Algorithms
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2002 Lecture 8 Tuesday, 11/19/02 Linear Programming.
1 Introduction to Linear Programming. 2 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. X1X2X3X4X1X2X3X4.
The Simplex Method and Linear Programming Duality Ashish Goel Department of Management Science and Engineering Stanford University Stanford, CA 94305,
Chapter 6 Maximum Flow Problems Flows and Cuts Augmenting Path Algorithm.
MS&E 211 Minimum Cost Flow LP Ashish Goel. Minimum Cost Flow (MCF) Need to ship some good from “supply” nodes to “demand” nodes over a network – Example:
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
Chapter 10: Iterative Improvement The Maximum Flow Problem The Design and Analysis of Algorithms.
The Out of Kilter Algorithm in Introduction The out of kilter algorithm is an example of a primal-dual algorithm. It works on both the primal.
Chapter 7 Maximum Flows: Polynomial Algorithms
Approximation Algoirthms: Semidefinite Programming Lecture 19: Mar 22.
Totally Unimodular Matrices Lecture 11: Feb 23 Simplex Algorithm Elliposid Algorithm.
Primal Dual Method Lecture 20: March 28 primaldual restricted primal restricted dual y z found x, succeed! Construct a better dual.
CSE 589 Part III The computer is useless It can only answer questions. -- Pablo Picasso.
Network Optimization Models: Maximum Flow Problems In this handout: The problem statement Solving by linear programming Augmenting path algorithm.
Finite Mathematics & Its Applications, 10/e by Goldstein/Schneider/SiegelCopyright © 2010 Pearson Education, Inc. 1 of 99 Chapter 4 The Simplex Method.
Routing algorithms, all distinct routes, ksp, max-flow, and network flow LPs W. D. Grover TRLabs & University of Alberta © Wayne D. Grover 2002, 2003 E.
ECE LP Duality 1 ECE 665 Spring 2005 ECE 665 Spring 2005 Computer Algorithms with Applications to VLSI CAD Linear Programming Duality.
Linear Programming – Max Flow – Min Cut Orgad Keller.
Chapter 4 The Simplex Method
Max-flow/min-cut theorem Theorem: For each network with one source and one sink, the maximum flow from the source to the destination is equal to the minimal.
MS&E 211 Lecture 5: Basic Feasible Solutions; Shortest Paths Ashish Goel.
1 Lecture 4 Maximal Flow Problems Set Covering Problems.
15.082J and 6.855J and ESD.78J November 2, 2010 Network Flow Duality and Applications of Network Flows.
Lecture 4 – Network Flow Programming
1 Linear Programming:Duality theory. Duality Theory The theory of duality is a very elegant and important concept within the field of operations research.
Modeling and Evaluation with Graph Mohammad Khalily Dermany Islamic Azad University, Khomein branch.
Lecture 5: Network Flow Algorithms Single-Source Shortest-Path (SSSP) (Dijkstra's Algorithm) Max Flow - Min Cut (Ford-Fulkerson) Job Sequencing.
Linear Programming Data Structures and Algorithms A.G. Malamos References: Algorithms, 2006, S. Dasgupta, C. H. Papadimitriou, and U. V. Vazirani Introduction.
Theory of Computing Lecture 13 MAS 714 Hartmut Klauck.
Network Flow. Network flow formulation A network G = (V, E). Capacity c(u, v)  0 for edge (u, v). Assume c(u, v) = 0 if (u, v)  E. Source s and sink.
Hon Wai Leong, NUS (CS6234, Spring 2009) Page 1 Copyright © 2009 by Leong Hon Wai CS6234: Lecture 4  Linear Programming  LP and Simplex Algorithm [PS82]-Ch2.
Advanced Operations Research Models Instructor: Dr. A. Seifi Teaching Assistant: Golbarg Kazemi 1.
 Minimization Problem  First Approach  Introduce the basis variable  To solve minimization problem we simple reverse the rule that is we select the.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
Maximum Flow Problem (Thanks to Jim Orlin & MIT OCW)
15.082J and 6.855J March 4, 2003 Introduction to Maximum Flows.
Hon Wai Leong, NUS (CS6234, Spring 2009) Page 1 Copyright © 2009 by Leong Hon Wai CS6234: Lecture 4  Linear Programming  LP and Simplex Algorithm [PS82]-Ch2.
OR Chapter 7. The Revised Simplex Method  Recall Theorem 3.1, same basis  same dictionary Entire dictionary can be constructed as long as we.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 25.
Chapter 8 Network Models to accompany Operations Research: Applications and Algorithms 4th edition by Wayne L. Winston Copyright (c) 2004 Brooks/Cole,
1 Introduction to Linear Programming. 2 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. X1X2X3X4X1X2X3X4.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved © 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or.
Approximation Algorithms Duality My T. UF.
Approximation Algorithms based on linear programming.
Tuesday, March 19 The Network Simplex Method for Solving the Minimum Cost Flow Problem Handouts: Lecture Notes Warning: there is a lot to the network.
Lap Chi Lau we will only use slides 4 to 19
St. Edward’s University
Topics in Algorithms Lap Chi Lau.
The minimum cost flow problem
Network Simplex Animations
CS4234 Optimiz(s)ation Algorithms
Algorithms and Networks
Chap 9. General LP problems: Duality and Infeasibility
1.206J/16.77J/ESD.215J Airline Schedule Planning
Primal-Dual Algorithm
Algorithms (2IL15) – Lecture 7
Flow Feasibility Problems
Algorithms and Networks
Maximum flow: The preflow/push method of Goldberg and Tarjan (87)
Maximum Flow Problems in 2005.
EMIS The Maximum Flow Problem: Flows and Cuts Updated 6 March 2008
Presentation transcript:

MS&E 211, Lecture 11 The dual of Min-Cost Flow Ashish Goel

Taking stock Today: Max-flow Min-Cut Next eight lectures (with possible order changes): – Zero sum games – Interior Point Method – Introduction to convex and quadratic optimization – Two examples from finance – Support vector machines – Gittins index and dynamic programming – Lagrange multipliers – Semi-definite and conic programming

Recap: The MCF

The MCF: A Useful Trick Assume that the sum of all the demands = 0 (Necessary for the problem to be feasible)

The MCF: A Useful Trick

≤ ≤

≤ ≤ - Maximize -

The MCF: A Useful Trick NOW, THE LP IS IN A STANDARD PRODUCTION FORM

Adding Labels to the MCF

The Dual of MCF PRIMAL DUAL

Coefficient of variable z(p) in constraint x(v,w) in Dual? PRIMAL The Transpose rule of thumb: Same as the coefficient of variable x(v,w) in constraint z(p) in primal p=v : x(v,w) appears as part of OUT x (p), i.e. with coefficient 1 p=w : x(v,w) appears as part of IN x (p), i.e. with coefficient -1 p≠v, p≠w : x(v,w) does not appear in z(p), i.e. occurs with coefficient 0

Coefficient of variable z(p) in constraint x(v,w) in Dual? PRIMAL The Transpose rule of thumb: Same as the coefficient of variable x(v,w) in constraint z(p) in primal p=v : x(v,w) appears as part of OUT x (p), i.e. with coefficient 1 p=w : x(v,w) appears as part of IN x (p), i.e. with coefficient -1 p≠v, p≠w : x(v,w) does not appear in z(p), i.e. occurs with coefficient 0

Coefficient of variable z(p) in constraint x(v,w) in Dual? PRIMAL The Transpose rule of thumb: Same as the coefficient of variable x(v,w) in constraint z(p) in primal p=v : x(v,w) appears as part of OUT x (p), i.e. with coefficient 1 p=w : x(v,w) appears as part of IN x (p), i.e. with coefficient -1 p≠v, p≠w : x(v,w) does not appear in z(p), i.e. occurs with coefficient 0

Coefficient of variable z(p) in constraint x(v,w) in Dual? PRIMAL The Transpose rule of thumb: Same as the coefficient of variable x(v,w) in constraint z(p) in primal p=v : x(v,w) appears as part of OUT x (p), i.e. with coefficient 1 p=w : x(v,w) appears as part of IN x (p), i.e. with coefficient -1 p≠v, p≠w : x(v,w) does not appear in z(p), i.e. occurs with coefficient 0

The Dual of MCF PRIMAL DUAL

Coefficient of variable y(q,r) in constraint x(v,w) in Dual? PRIMAL The Transpose rule of thumb: Same as the coefficient of variable x(v,w) in constraint y(q,r) in primal (q,r)=(v,w) : x(v,w) appears in y(q,r) with coefficient 1 (q,r)≠ (v,w): x(v,w) does not appear in y(q,r), i.e. occurs with coefficient 0

The Dual of MCF PRIMAL DUAL

The Dual of MCF PRIMAL DUAL FLIP SIGNS

The Dual of MCF PRIMAL DUAL

A Lot of Work!! Why?

A Lot of Work!! Why? We can now apply this to many problems Next module: Dual of Shortest Path Problem

The Dual of MCF PRIMAL DUAL

Applying to Shortest Path Problem The constraints x(v,w) ≤ u(v,w) don’t exist in the primal ! => No variables y(v,w) in the Dual !! d(s) = -1; d(t) = 1; all other d(v)’s are 0 !!! DUAL

Dual for the Shortest Path Problem Really Simple. Informal Interpretation: z(v) – z(s) = Shortest path distance from s to v

An Algorithmic Interpretation Ford’s Algorithm – Initialize: Set z(s) = 0; z(v) = 1 for all v  s – Repeat: While there exists an edge (v,w) which violates the constraint, set z(w) = z(v) + c(v,w) [Known as relaxation] Intuition: z(v) is the shortest path distance from s to v Most (perhaps all) popular shortest path algorithms are special cases of Ford’s algorithm (if multiple edges violate the constraint, which one to choose)

Dual Complementary Slackness for Shortest Path Example Let x,z be optimum solutions to primal, dual respectively Either z(w) = z(v) + c(v,w) or x(v,w) = 0 Informal Interpretation: Either there exists shortest path to w that goes via v or the flow on edge (v,w) is zero

Example s t p q r What is the value of z(t) – z(s) in any optimum solution of the dual for the shortest path problem?

Example s t p q r One optimum solution to the dual is z(s) = 0 z(p) = 4 z(q) = 3 z(r) = 5 z(t) = 6 Using dual complementary slackness, for which of the following edges can we conclude that the flow in an optimum solution to the primal shortest path is 0? (a) (s,p) (b) (p,s) (c) (s, q) (d) (r,t)

Example s t p q r One optimum solution to the dual is z(s) = 0 z(p) = 4 z(q) = 3 z(r) = 5 z(t) = 6 In fact, we can conclude that edges (p,s), (p,t), and (q,s) can not have positive flow in the primal

Example s t p q r One optimum solution to the dual is z(s) = 0 z(p) = 4 z(q) = 3 z(r) = 5 z(t) = 6 In fact, we can conclude that edges (p,s), (p,t), and (q,s) can not have positive flow in the primal INTRIGUING FACT: The remaining edges form a shortest path tree! Not totally a coincidence, since this corresponds to our informal interpretation, but we will not develop this further in this class. INTRIGUING FACT: The remaining edges form a shortest path tree! Not totally a coincidence, since this corresponds to our informal interpretation, but we will not develop this further in this class.

Applying to Max-Flow Problem The values d(v) and c(v,w) are 0 for max-flow (except for the fake edge, which does not have a capacity constraint) DUAL

Applying to Max-Flow Problem The values d(v) and c(v,w) are 0 for max-flow (except for the fake edge, which does not have a capacity constraint and does not need x t,s ¸ 0) DUAL

The Dual of Max-Flow The values y(v,w) must be 0 or 1 (increasing the capacity of an edge by a small amount ± increases the max-flow by 0 or ±

The Dual of Max-Flow The values y(v,w) must be 0 or 1 (increasing the capacity of an edge by a small amount ± increases the max-flow by 0 or ±  Similarly, z must be either 0 or 1 [Proof omitted]  We have the “min-cut” problem: Find the set of edges of smallest capacity which “cuts” the source from the sink, i.e., removes all paths from source to sink

Theorem: Max-flow = Min-Cut The maximum flow you can send from s to t in a network = The minimum s-t in the same network [Minimum s-t cut is the smallest total capacity of any s-t cut] [An s-t cut is a set of edges such that removing these edges from the network will result in no path remaining from s to t]

2 1 Sin k Sourc e Yinyu Ye, Stanford, MS&E211 Lecture Notes #8 36 Look at Another Max-Flow Problem 3

Let x ij be the flow rate from node i to node j. Then the problem can be formulated as max x 41 x 21 + x 31 + x 41 − x 12 − x 13 x 12 + x 32 + x 42 − x 21 − x 23 − x 24 x 13 + x 23 + x 43 − x 31 − x 32 − x 34 x 24 + x 34 − x 41 − x 42 − x 43 x ij z 1 z 2 z 3 z 4 y ij s.t. = 0, ≤ u ij, ∀ (i, j) ∈ E, ≥ 0, ∀ (i, j) ∈ E. 37 The Primal Formulation Corresponding Dual variables

38 The Dual of Max-Flow: the Min-Cut Problem min ∑ (i,j) ∈ A u ij y ij s.t. z 4 − z 1 = 1, −z 2 + z 1 + y 12 ≥ 0, −z 3 + z 1 + y 13 ≥ 0,... −z 4 + z 2 + y 24 ≥ 0, −z 4 + z 3 + y 34 ≥ 0, y,z ≥ 0. x 41 x 12 x 13 … x 24 x 34 1 if i is on the sink side 1, if z i =0 and z j =1 z i = and y ij = 0 if i is on the source side 0 otherwise Corresponding Primal variables

Yinyu Ye, Stanford, MS&E211 Lecture Notes #8 39 The Min-Cut Solution: Min-Cut Value=8 y 24 = 1 1 Sin k Sourc e Z 4 =1 Z 3 =1 Z 2 =0 z 1 =0 y 23 = 1 y 13 = 1 2 All other y ij =0

THANK YOU!!!