Network Flow & Linear Programming Jeff Edmonds York University Adapted from www.cse.yorku.ca/~jeff/notes/3101/03.5- NetworkFlow.ppt.

Slides:



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

Max Flow Problem Given network N=(V,A), two nodes s,t of V, and capacities on the arcs: uij is the capacity on arc (i,j). Find non-negative flow fij for.
Introduction to Algorithms
Introduction to Markov Random Fields and Graph Cuts Simon Prince
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:
Introduction To Algorithms CS 445 Discussion Session 8 Instructor: Dr Alon Efrat TA : Pooja Vaswani 04/04/2005.
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 
1 COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf.
HW2 Solutions. Problem 1 Construct a bipartite graph where, every family represents a vertex in one partition, and table represents a vertex in another.
3 t s the black numbers next to an arc is its capacity.
ECE LP Duality 1 ECE 665 Spring 2005 ECE 665 Spring 2005 Computer Algorithms with Applications to VLSI CAD Linear Programming Duality.
1 Network Flow & Linear Programming Jeff Edmonds York University COSC 3101 Lecture 5 Optimization Problems Network Flow Def nNetwork Flow Def n Simple.
A B C D The diagram below shows water flowing through a pipework system. The values on the edges are the capacities of water that they.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
MAX FLOW CS302, Spring 2013 David Kauchak. Admin.
Module 5 – Networks and Decision Mathematics Chapter 24 – Directed Graphs.
CS774. Markov Random Field : Theory and Application Lecture 13 Kyomin Jung KAIST Oct
Lecture 5: Network Flow Algorithms Single-Source Shortest-Path (SSSP) (Dijkstra's Algorithm) Max Flow - Min Cut (Ford-Fulkerson) Job Sequencing.
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 Algorithmic Paradigms Jeff Edmonds York University COSC 2011 Lecture 9 Brute Force: Optimazation Problem Greedy Algorithm: Minimal Spanning Tree Dual.
1 COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf.
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.
Max Flow – Min Cut Problem. Directed Graph Applications Shortest Path Problem (Shortest path from one point to another) Max Flow problems (Maximum material.
Network Flow Analysis of Algorithms.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 25.
Algorithm Design and Analysis (ADA)
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Data Structures & Algorithms Network Flow Richard Newman based on book by R. Sedgewick.
CSCI 256 Data Structures and Algorithm Analysis Lecture 20 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
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.
Markov Random Fields in Vision
A directed graph G consists of a set V of vertices and a set E of arcs where each arc in E is associated with an ordered pair of vertices from V. V={0,
11/21/02CSE Max Flow CSE Algorithms Max Flow Problems.
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)
1 Network Flow & Linear Programming Jeff Edmonds York University COSC 3101 Lecture 5 Optimization Problems Network Flow Def n Network Flow Def n Simple.
Network Flow & Linear Programming Jeff Edmonds York University COSC 6111 Lecture 3 Network Flow Linear Programming.
Contest Algorithms January 2016 Describe the maxflow problem, explain the Ford-Fulkerson, Edmonds-Karp algorithms. Look at the mincut problem, bipartite.
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
Network Flow.
Finding a Path With Largest Smallest Edge
CS4234 Optimiz(s)ation Algorithms
Network Flow & Linear Programming
Richard Anderson Lecture 23 Network Flow
Lecture 22 Network Flow, Part 2
CSCI 3160 Design and Analysis of Algorithms Tutorial 8
Network Flow.
Maximum Flow Solutions
Network Flows – Labelling procedure
Lecture 16 Maximum Matching
CSE Algorithms Max Flow Problems 11/21/02 CSE Max Flow.
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 21 Network Flow
Max Flow Problem Given network N=(V,A), two nodes s,t of V, and capacities on the arcs: uij is the capacity on arc (i,j). Find non-negative flow fij for.
Algorithms (2IL15) – Lecture 7
Max Flow / Min Cut.
Network Flow.
Lecture 21 Network Flow, Part 1
Richard Anderson Lecture 22 Network Flow
Lecture 21 Network Flow, Part 1
Lecture 22 Network Flow, Part 2
Network Flow.
Richard Anderson Lecture 22 Network Flow
Maximum Flow Problems in 2005.
EMIS The Maximum Flow Problem: Flows and Cuts Updated 6 March 2008
Presentation transcript:

Network Flow & Linear Programming Jeff Edmonds York University Adapted from NetworkFlow.ppt

Instance: A Network is a directed graph G Edges represent pipes that carry flow Each edge has a maximum capacity c A source node s in which flow arrives A sink node t out which flow leaves Goal: Max Flow Network Flow Adapted from NetworkFlow.ppt

Instance: A Network is a directed graph G Edges represent pipes that carry flow Each edge has a maximum capacity c A source node s in which flow arrives A sink node t out which flow leaves Network Flow Adapted from NetworkFlow.ppt

Solution: The amount of flow F through each edge. Flow can’t exceed capacity i.e. F  c. Unidirectional flow F  0 and F = 0 or F = 0 and F  0 Some texts: F = -F Network Flow Adapted from NetworkFlow.ppt

Solution: The amount of flow F through each edge. Flow F can’t exceed capacity c. Unidirectional flow No leaks, no extra flow. Network Flow Adapted from NetworkFlow.ppt

Solution: The amount of flow F through each edge. Flow F cant exceed capacity c. Unidirectional flow No leaks, no extra flow. For each node v: flow in = flow out  u F =  w F Except for s and t. Network Flow Adapted from NetworkFlow.ppt

Value of Solution: Flow from s into the network minus flow from the network back into s. rate(F) =  u F = flow from network into t minus flow back in. =  u F -  v F -  v F What about flow back into s? Goal: Max Flow Network Flow Adapted from NetworkFlow.ppt

Network flow problem is a linear program Taken from

Adapted from NetworkFlow.ppt

A network with its edge capacities Network Flow What is the maximum that can flow from s to t? Adapted from NetworkFlow.ppt

A network with its edge capacities Network Flow The max total rate of the flow is = 3. flow/capacity = 2/5 Can prove that total cannot be higher. Adapted from NetworkFlow.ppt

No more flow can be pushed along the top path because the edge is at capacity. Similarly, the edge. No flow is pushed along the bottom path because this would decrease the total from s to t. Network Flow Adapted from NetworkFlow.ppt

is a minimum cut Its capacity is the sum of the capacities crossing the cut = 1+2 = 3. is not included in because it is going in the wrong direction. Network Flow Adapted from NetworkFlow.ppt

The edges crossing forward across the cut are at capacity those crossing backwards have zero flow. This is always true. Network Flow Adapted from NetworkFlow.ppt

The maximum flow is 1+2=3 The minimum cut is 1+2=3. These are always equal. Maxflow = Mincut Adapted from NetworkFlow.ppt

An Application: Matching SamMary BobBeth JohnSue FredAnn Who loves whom. Who should be matched with whom so as many as possible matched and nobody matched twice? 3 matches Can we do better? 4 matches Adapted from NetworkFlow.ppt

An Application: Matching st c = 1 Total flow out of u  flow into u  1 Boy u matched to at most one girl. 1 c = 1 Total flow into v = flow out of v  1 Girl v matched to at most one boy. 1 u v Adapted from NetworkFlow.ppt

Instance: A Network is a directed graph G Special nodes s and t. Edges represent pipes that carry flow Each edge has a maximum capacity c Partition into two regions so that the cut between the two is minimized Min Cut s t Adapted from NetworkFlow.ppt