2.89k likes | 3.09k Views
Finding Minimum-Cost Circulation By Successive Approximation. Goldberg and Tarjan 1990. Advanced Algorithms Seminar Instructor: Prof. Haim Kaplan Presented by: Michal Segalov & Lior Litwak. Motivation. What is the minimum cost circulation problem?
E N D
Finding Minimum-Cost Circulation By Successive Approximation Goldberg and Tarjan 1990 Advanced Algorithms Seminar Instructor: Prof. Haim Kaplan Presented by: Michal Segalov & Lior Litwak
Motivation • What is the minimum cost circulation problem? • What is this problem equivalent to in the real world?
The Min-Cost Circulation Problem • In the flow problems we have the “source” and “sink” special vertices, such that flow passes between them.
The Min-Cost Circulation Problem • In the flow problems we have the “source” and “sink” special vertices, such that flow passes between them. • The circulation problems take these vertices out of the game.
The Min-Cost Circulation Problem • In the flow problems we have the “source” and “sink” special vertices, such that flow passes between them. • The circulation problems take these vertices out of the game. • We push flow through edges in cycles along the graph, seeking minimal cost.
The Min-Cost Circulation Problem • In the flow problems we have the “source” and “sink” special vertices, such that flow passes between them. • The circulation problems take these vertices out of the game. • We push flow through edges in cycles along the graph, seeking minimal cost. • Notice – we are not interested in pushing maximal flow anymore.
Max-Flow, Min-Cost & What’s Between • Consider the familiar Max-Flow problem. In that problem we want to achieve maximal flow on the edges.
Max-Flow, Min-Cost & What’s Between • Consider the familiar Max-Flow problem. In that problem we want to achieve maximal flow on the edges. • Now think of giving a cost to flow units going through each edge (positive or negative).
Max-Flow, Min-Cost & What’s Between • Consider the familiar Max-Flow problem. In that problem we want to achieve maximal flow on the edges. • Now think of giving a cost to flow units going through each edge (positive or negative). • We now wish to find, amongst all possible maximal flows, the one with minimal cost.
Min-Cost Max-Flow Equivalenceto Min-Cost Circulation • Given a graph G, construct G’ by adding two vertices s and t, not connected to any of the other vertices. Any min cost flow in G’ is a min-cost circulation in G. G’ G s t
Min-Cost Max-Flow Equivalenceto Min-Cost Circulation • Given a graph G, construct G’ by connecting t and s with a new edge s.t. G G’ s s t t
Previous Work • Some other Algorithms out there: • This paper introduced an efficient general scheme, rather than a specific one, for solving the problem
The BIG Picture • In this lecture we will see a general approach for solving this problem.
The BIG Picture • In this lecture we will see a general approach for solving this problem. • It works by finding an initial approximate solution and then iteratively refining it until reaching an optimal one.
The BIG Picture • In this lecture we will see a general approach for solving this problem. • It works by finding an initial approximate solution and then iteratively refining it until reaching an optimal one. • The error parameter, ε, is halved in each iteration until the integrality of the arc costs guarantees an optimal solution.
The BIG Picture • We will see two methods for refinement: • The Generic method – Uses a sequence of transformation on the current circulation to produce a finer one. Achieves a runtime of • Blocking Flow method – a generalization of Dinic used for refinement. Complexity is the same for a simple implementation. • Complexity even better with dynamic trees…
Definitions – The Basics • A circulationnetwork is a symmetric graph G=(V,E) with a real value capacityu(v,w) functionand a cost c(v,w) function for each arc s.t. c(v,w) = -c(w,v) (cost antisymmetry constraint)
Definitions – The Basics • A pseudoflow is a function s.t. for each : 1. f(w,v) ≤ u(w,v) (capacity constraint) 2. f(w,v) = –f(v,w) (flow antisymmetry constraint) • The cost of a pseudoflow is
Definitions – The Basics • For a pseudoflow f and a vertex v, the excess flow into v , is defined by • A vertex v is called active if • Observe that (because G is symmetric)
Definitions – The Basics • Pseudoflow example: Total cost = -2 u=5,f=2,c=-1 ef = -1 ef = -4 0,-1,-3 0,-2,1 4,1,3 0,-3,2 4,3,1 ef = -1 6,3,-2 2,-3,-1 ef = 6
Definitions – The Basics • A circulation is a pseudoflow s.t. for each vertex v,
Definitions – The Basics • A circulation is a pseudoflow s.t. for each vertex v, • This means that there is no excess flow in v, and that flow is not “created” in v(i.e. no “sources” and “sinks” in G)
Definitions – The Basics • A circulation is a pseudoflow s.t. for each vertex v, • This means that there is no excess flow in v, and that flow is not “created” in v(i.e. no “sources” and “sinks” in G) • A pseudoflow is a circulation iff there are no active vertices (by definition)
Definitions – The Residual System • The residual capacity of and edge (v,w) is • An arc is saturated if • The residual graph is defined as • Note that all the residual arcs are non-saturated…
Definitions – Prices & Costs • A price function is a function • We use the price function to define the reduced cost of an arc:
Definitions – Prices & Costs • A price function is a function • We use the price function to define the reduced cost of an arc: • Note that the cost of a circulation is the same whether the original costs or the reduced costs with respect to some price function are used!
Optimality of Circulations • We say the a circulation is optimal if its cost is minimal
Optimality of Circulations • We say the a circulation is optimal if its cost is minimal Theorem 2.1 • A circulation f is minimum cost iff the residual graph contains no cycles of negative cost
Optimality of Circulations • Proof ( ): • If there are negative cycles in Gf we can obtain a “cheaper” circulation by increasing flow on them. G Gf u=5,f=3,c=-1 uf=2,c=-1 4,3 We have a negative cycle cost = -6 4,0,3 1,1 6,3,-2 3,-2 4,3,1
Optimality of Circulations • Proof ( ): • If the circulation f is not optimal, we show there exists a negative cycle in Gf • Let f* be an optimal circulation.We will look at the decomposition of the circulation f*-f into cycles. • Since it is of negative cost and feasible in Gf, it contains a negative cycle!
Optimality of Circulations Theorem 2.2 • A circulation f is minimum cost iff there is a price function p s.t. for each arc (v,w)
Optimality of Circulations • Proof ( ): • Given such p, there are no negative reduced cost cycles in Gf. • Hence, no negative cost cycles in Gf. • Use the previous theorem.
Optimality of Circulations • Proof ( ): • Given an optimal circulation, such a function can be calculated using the shortest paths from an external vertex s in Gf. • can you think how?
Optimality of Circulations uf=1,c=-1 Gf 4,1 4,2 4,3 4,-1 2,-2
Optimality of Circulations c=-1 Gaux 1 2 3 -1 0 -2 0 0 0 S
Optimality of Circulations c=-1 Gaux 1 2 3 -1 0 -2 0 0 0 S
Optimality of Circulations c=-1 Gaux 1 2 3 -1 0 -2 0 0 S
Optimality of Circulations c=-1 Gaux 1 2 3 -1 0 -2 0 S
Optimality of Circulations c=-1 Gaux 1 2 -1 0 -2 0 S
Optimality of Circulations c=-1 Gaux 2 -1 0 -2 0 S
Optimality of Circulations c=-1 Gaux 2 0 -2 0 S
Optimality of Circulations c=-1 T 0 -2 0 S
Optimality of Circulations c=-1 T d = -1 d = 0 0 -2 0 d = 0 S d = -3
Optimality of Circulations Define p = d: uf=1,c=-1 Gf p = -1 4,1 p = 0 4,2 4,3 4,-1 2,-2 p = 0 p = -3
Optimality of Circulations c=-1, cp=0 Gf p = -1 p = 0 c=1, cp=0 c=3, cp=3 c=2, cp=0 c=-2, cp=0 c=-1, cp=2 p = 0 p = -3
Definitions – The Basics • A circulationnetwork is a symmetric graph G=(V,E) with a real value capacityu(v,w) functionand a cost c(v,w) function for each arc s.t. c(v,w) = -c(w,v) (cost antisymmetry constraint)
Definitions – The Basics • A pseudoflow is a function s.t. for each : 1. f(w,v) ≤ u(w,v) (capacity constraint) 2. f(w,v) = –f(v,w) (flow antisymmetry constraint) • The cost of a pseudoflow is
Definitions – The Basics • For a pseudoflow f and a vertex v, the excess flow into v , is defined by • A vertex v is called active if • Observe that (because G is symmetric)
Definitions – The Basics • A circulation is a pseudoflow s.t. for each vertex v,