CMSC 341 Lecture 24 Max Flow Prof. Neary

Slides:



Advertisements
Similar presentations
Lecture 5: Network Flow Algorithms Max-Flow Min-Cut Single-Source Shortest-Path (SSSP) Job Sequencing.
Advertisements

Network Optimization Models: Maximum Flow Problems
1 Augmenting Path Algorithm s t G: Flow value = 0 0 flow capacity.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
1 Augmenting Path Algorithm s t G: Flow value = 0 0 flow capacity.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Lecture 5: Network Flow Algorithms Single-Source Shortest-Path (SSSP) (Dijkstra's Algorithm) Max Flow - Min Cut (Ford-Fulkerson) Job Sequencing.
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.
CS 4407, Algorithms University College Cork, Gregory M. Provan Network Optimization Models: Maximum Flow Problems In this handout: The problem statement.
CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010.
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.
CSEP 521 Applied Algorithms Richard Anderson Lecture 8 Network Flow.
1 Network Flow CSC401 – Analysis of Algorithms Chapter 8 Network Flow Objectives: Flow networks –Flow –Cut Maximum flow –Augmenting path –Maximum flow.
Fall 2003Maximum Flow1 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 
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 14, 2014.
CS 312: Algorithm Design & Analysis Lecture #29: Network Flow and Cuts This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported.
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)
Network Flow What is a network? Flow network and flows
Network Flow.
Max-flow, Min-cut Network flow.
Richard Anderson Lecture 23 Network Flow
CSCI 3160 Design and Analysis of Algorithms Tutorial 8
December 1st – Graph Madness
Network Flow.
Special Graphs: Modeling and Algorithms
Maximum Flow Solutions
Max-flow, Min-cut Network flow.
Lecture 16 Maximum Matching
Network Flow 2016/04/12.
Instructor: Shengyu Zhang
Edmonds-Karp Algorithm
Maximum Flow c v 3/3 4/6 1/1 4/7 t s 3/3 w 1/9 3/5 1/1 3/5 u z 2/2
Network Flow and Connectivity in Wireless Sensor Networks
Lecture 10 Network flow Max-flow and Min-cut Ford-Fulkerson method
7. Ford-Fulkerson Demo.
7. Ford-Fulkerson Demo.
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 21 Network Flow
Flow Networks and Bipartite Matching
Fundamental Data Structures and Algorithms
Complexity of Ford-Fulkerson
Algorithms (2IL15) – Lecture 7
Network Flow CSE 373 Data Structures.
EE5900 Advanced Embedded System For Smart Infrastructure
Max Flow / Min Cut.
離散數學 DISCRETE and COMBINATORIAL MATHEMATICS
Network Flow.
Lecture 21 Network Flow, Part 1
7. Ford-Fulkerson Demo.
7. Ford-Fulkerson Algorithm with multiple optimal solutions
MAXIMUM flow by Eric Wengert.
Introduction to Maximum Flows
Richard Anderson Lecture 22 Network Flow
Lecture 21 Network Flow, Part 1
Maximum Flow Neil Tang 4/8/2008
7. Ford-Fulkerson Demo.
7. Ford-Fulkerson Demo.
7. Ford-Fulkerson Demo.
7. Ford-Fulkerson Demo.
Richard Anderson Lecture 20 Shortest Paths and Network Flow
Introduction to Maximum Flows
Network Flow.
7. Ford-Fulkerson Demo.
Richard Anderson Lecture 22 Network Flow
7. Ford-Fulkerson Demo.
Maximum Flow Problems in 2005.
Presentation transcript:

CMSC 341 Lecture 24 Max Flow Prof. Neary Based on slides by Prof. Jeremy Dixon

Flow Network In graph theory, a flow network (also known as a transportation network) is a directed graph where each edge has a capacity and each edge receives a flow Flow: Amount moving through an edge or path Capacity: Maximum flow possible through an edge The amount of flow on an edge cannot exceed the capacity of the edge From: https://en.wikipedia.org/wiki/Flow_network

Flow Network Flow cannot exceed capacity 1 3 s t 1 Sink Source 2 5 Flow cannot exceed capacity At every vertex (excluding your source s and your sink t), the flow coming in must equal the flow going out

Why Use Flow Networks? Road Networks Public Transportation Utilities Water Sewer Gas Computer Networks

Why Use Flow Networks? Hotel Airport 7 10 4 12 25 4 30 32 From: https://www.youtube.com/watch?v=LfbKwot9sZA

What are we doing? Want to find: The overall capacity from source to sink A configuration of paths that achieve this flow Ford-Fulkerson Algorithm can help find these max flows

Ford-Fulkerson Algorithm Create a flow network representing the problem Update labels to show current flow and capacity

Ford-Fulkerson Algorithm Create a flow network representing the problem Update labels to show current flow and capacity s t Airport Hotel 0|30 0|10 0|4 0|32 0|25 0|7 0|12

Ford-Fulkerson Algorithm Flow starts equal to 0 While there exists an “augmenting path” (just a path from s to t) Find an augmenting path Compute the bottleneck capacity Increase flow on that path by bottleneck capacity Runtime is O(E * F) E is the number of edges on the graph F is the maximum flow Flow/Capacity for each edge Remember, Flow CANNOT EXCEED Capacity

Ford-Fulkerson Algorithm Evaluate the “augmented” path Update Flows Repeat 1 and 2 until no more paths are available 0|7 7|7 7|10 0|10 0|4 0|4 t 0|12 s 0|4 0|25 0|4 0|30 0|32

Ford-Fulkerson Algorithm Evaluate the “augmented” path Update Flows Repeat 1 and 2 until no more paths are available 7|7 10|10 7|10 0|4 3|4 0|4 t 0|12 3|12 s 0|4 0|25 0|4 0|30 0|32

Ford-Fulkerson Algorithm Evaluate the “augmented” path Update Flows Repeat 1 and 2 until no more paths are available 7|7 10|10 3|4 0|4 t 3|12 s 0|4 25|25 0|25 0|4 25|30 0|30 25|32 0|32

Ford-Fulkerson Algorithm Evaluate the “augmented” path Update Flows Repeat 1 and 2 until no more paths are available 7|7 10|10 3|4 0|4 t 7|12 3|12 s 0|4 25|25 4|4 0|4 29|30 25|30 29|32 25|32

Ford-Fulkerson Algorithm Out of s: 10+29 = 39 In to t: 7+7+25 = 39 The solution found may be one of many 7|7 10|10 3|4 0|4 t 7|12 s 0|4 25|25 4|4 29|30 29|32

Ford-Fulkerson Algorithm Basic algorithm to determine maximum flow in a flow network Find (list) all paths from “s” to “t” (called augmented paths) Max allowed = 0

Ford-Fulkerson Algorithm For each path found Find max allowed capacity in entire path Look for the smallest capacity in the entire path Total sums of max allowed Update flow on graph with max capacity for all edges in this specific path Watch for capacity limit, cannot go over limit

Ford-Fulkerson Practice #1 |5 |3 |13 t s |50 |20 |10 |35

Ford-Fulkerson Practice #1 Solution

Ford-Fulkerson Practice #2 |13 |25 |15 t |5 s |7 |30 |23 |9

Ford-Fulkerson Practice #2 Solution

Announcements Homework 6 is out Final Due Tuesday, December 8th at 8:59:59 PM Final Will occur on December 14th from 8-10am ITE 102 and ITE 104