Network Flow How to solve maximal flow and minimal cut problems.

Slides:



Advertisements
Similar presentations
Maximum flow Main goals of the lecture:
Advertisements

IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
EMIS 8374 Vertex Connectivity Updated 20 March 2008.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 8 Network models.
Introduction To Algorithms CS 445 Discussion Session 8 Instructor: Dr Alon Efrat TA : Pooja Vaswani 04/04/2005.
Network Optimization Models: Maximum Flow Problems
The Maximum Network Flow Problem. CSE Network Flows.
Chapter 10: Iterative Improvement The Maximum Flow Problem The Design and Analysis of Algorithms.
1 Maximum Flow w s v u t z 3/33/3 1/91/9 1/11/1 3/33/3 4/74/7 4/64/6 3/53/5 1/11/1 3/53/5 2/22/2 
Advanced Algorithm Design and Analysis (Lecture 8) SW5 fall 2004 Simonas Šaltenis E1-215b
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.
Nick McKeown Spring 2012 Maximum Matching Algorithms EE384x Packet Switch Architectures.
Lecture 1: Introduction to the Course of Optimization 主講人 : 虞台文.
Applications of Maximum Flow and Minimum Cut Problems In this handout Transshipment problem Assignment Problem.
CSC 2300 Data Structures & Algorithms April 17, 2007 Chapter 9. Graph Algorithms.
Network Optimization Models: Maximum Flow Problems In this handout: The problem statement Solving by linear programming Augmenting path algorithm.
A network is shown, with a flow f. v u 6,2 2,2 4,1 5,3 2,1 3,2 5,1 4,1 3,3 Is f a maximum flow? (a) Yes (b) No (c) I have absolutely no idea a b c d.
1 1 Slide © 2000 South-Western College Publishing/ITP Slides Prepared by JOHN LOUCKS.
NetworkModel-1 Network Optimization Models. NetworkModel-2 Network Terminology A network consists of a set of nodes and arcs. The arcs may have some flow.
MAX FLOW CS302, Spring 2013 David Kauchak. Admin.
Shortest Route, Minimal Spanning Tree and Maximal Flow Models
Operations Research Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD4207 University of Palestine.
Maximum Flow Chapter 26.
Module 5 – Networks and Decision Mathematics Chapter 24 – Directed Graphs.
CS774. Markov Random Field : Theory and Application Lecture 13 Kyomin Jung KAIST Oct
COSC 2007 Data Structures II Chapter 14 Graphs III.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 11, 2014.
Announcements Network Flow today, depending on how far we get, we will do String Matching on Wednesday Then Review for Final next Monday This week’s lab.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
CS 4407, Algorithms University College Cork, Gregory M. Provan Network Optimization Models: Maximum Flow Problems In this handout: The problem statement.
Flows in Planar Graphs Hadi Mahzarnia. Outline O Introduction O Planar single commodity flow O Multicommodity flows for C 1 O Feasibility O Algorithm.
Max Flow – Min Cut Problem. Directed Graph Applications Shortest Path Problem (Shortest path from one point to another) Max Flow problems (Maximum material.
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
1 WEEK 11 Graphs III Network Flow Problems A Simple Maximum-Flow Algorithm Izmir University of Economics.
Maximum Flow Chapter 26. Flow Concepts Source vertex s – where material is produced Sink vertex t – where material is consumed For all other vertices.
CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010.
Graphs. Introduction Graphs are a collection of vertices and edges Graphs are a collection of vertices and edges The solid circles are the vertices A,
Announcements Finish up Network Flow today Then Review for Final on Monday ◦ HW#5 is due on Monday, let me or the TA’s know if you have trouble starting.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Data Structures & Algorithms Network Flow Richard Newman based on book by R. Sedgewick.
Network Analysis Maxflow. What is a Network? Directed connected graph Source node Sink (destination node) Arcs are weighted (costs) Represent a system.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 14, 2014.
ENGM 631 Maximum Flow Solutions. Maximum Flow Models (Flow, Capacity) (0,3) (2,2) (5,7) (0,8) (3,6) (6,8) (3,3) (4,4) (4,10)
The Maximum Network Flow Problem
::Network Optimization:: Minimum Spanning Trees and Clustering Taufik Djatna, Dr.Eng. 1.
Maximum Flow Chapter 26.
Network Flow.
St. Edward’s University
The Maximum Network Flow Problem
Max-flow, Min-cut Network flow.
Maximum Flow Chapter 26.
CSCI 3160 Design and Analysis of Algorithms Tutorial 8
Network Flow.
Special Graphs: Modeling and Algorithms
Chapter 12 Network Models 12-1
Bipartite Matching and Other Graph Algorithms
Maximum Flow Solutions
Max-flow, Min-cut Network flow.
MATS Quantitative Methods Dr Huw Owens
Introduction Basic formulations Applications
Network Flows – Multiple sources and sinks
R. Johnsonbaugh Discrete Mathematics 5th edition, 2001
Flow Networks and Bipartite Matching
Algorithms (2IL15) – Lecture 7
Network Flow.
Network Flow.
Maximum Bipartite Matching
Network Flow Problems – Maximal Flow Problems
Maximum Flow Problems in 2005.
Presentation transcript:

Network Flow How to solve maximal flow and minimal cut problems

What is Network Flow? Network Flow is a subsection of graph theory related specifically to situations where something moves from one location to another. An easily visualized example of network flow is piping system through which a quantity of water must pass.

Concepts in Network Flow “Sources” are nodes which supply a commodity “Sinks” are nodes which use up a commodity An edge’s capacity is the maximum amount of flow which can pass through it Graphs are usually directed

An example What is the maximum flow from A to B? A B

The Ford-Fulkerson method This is a relatively simple way to find maximum flow through a network:  Find an unsaturated path from the source to the sink  Add an amount of flow to each edge in that path equal to the smallest capacity in it  Repeat this process till no more paths can be found  The total amount of flow added is then maximal

Storing the graph It is easiest to store, for each edge in the graph, its capacity in both directions, as well as the current flow in each direction. Thus for a directed graph, the capacity in the reverse direction will start as zero. When flow is put through the edge, decrease its capacity in the direction and increase the capacity in the opposite direction.

Finding a path The eventual answer given by this method is not affected by the path chosen, although the algorithm’s speed will be affected If possible, the shortest path or the path with maximum flow is a good choice, else simply using a DFS works reasonably well

Minimum Cuts It is sometimes necessary to know the minimum total weight of a cut that splits the graph in two, separating the source and the sink This will be equal to the maximum flow through the network

To find the minimum cut First create the maximum flow graph Select all the nodes that can be reached from the source by unsaturated edges Cut all the edges that connect these nodes to the rest of the nodes in the graph This cut will be minimal

An example Maximal flow in the graph shown earlier A B

An example Choose a path and put flow through it A B

An example Current flow = 1 A B

An example Current flow = 3 A B

An example Current flow = 3 A B

An example Current flow = 5 A B

An example Total flow = 5 A B

An example To find a minimal cut A B [3] [4] [6] [1] [3] [2] [5]

An example Minimal cut = = 5 A B

Variations on Network Flow Undirected graphs – give the edge the capacity in both directions, then increase or decrease this capacity as flow changes, as before.

Variations on Network Flow Multiple sources / sinks – create a “supersource” or “supersink” which connects directly to each of these nodes, and has infinite capacity S

Variations on Network Flow Node capacity – split the node into an “in” node, an “out” node and an edge

Conclusion Network flow problems can come in a number of forms, usually relating to some commodity being moved from suppliers to where it is needed. Also look for minimal cut problems, which can be solved easily with graph theory.