Ma/CS 6a Class 15: Flows and Bipartite Graphs

Similar documents
Final Exam : Solutions

Flow Networks. Ma/CS 6a. Class 14: Flow Exercises

Reminder: Flow Networks

4/12/12. Applications of the Maxflow Problem 7.5 Bipartite Matching. Bipartite Matching. Bipartite Matching. Bipartite matching: the flow network

Admin MAX FLOW APPLICATIONS. Flow graph/networks. Flow constraints 4/30/13. CS lunch today Grading. in-flow = out-flow for every vertex (except s, t)

Graphs III - Network Flow

Algorithm Design and Analysis

CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 259] B-Trees

Transfer function and the Laplace transformation

Matching. Slides designed by Kevin Wayne.

Flow networks. Flow Networks. A flow on a network. Flow networks. The maximum-flow problem. Introduction to Algorithms, Lecture 22 December 5, 2001

Network Flow. Data Structures and Algorithms Andrei Bulatov

Shortest Path With Negative Weights

CSE 245: Computer Aided Circuit Simulation and Verification

CSE 521: Design & Analysis of Algorithms I

Main Reference: Sections in CLRS.

Boyce/DiPrima 9 th ed, Ch 2.1: Linear Equations; Method of Integrating Factors

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING SIGNALS AND SYSTEMS. Assoc. Prof. Dr. Burak Kelleci. Spring 2018

Algorithmic Discrete Mathematics 6. Exercise Sheet

Today s topics. CSE 421 Algorithms. Problem Reduction Examples. Problem Reduction. Undirected Network Flow. Bipartite Matching. Problem Reductions

Randomized Perfect Bipartite Matching

14.02 Principles of Macroeconomics Fall 2005 Quiz 3 Solutions

Soviet Rail Network, 1955

Maximum Flow and Minimum Cut

CS4445/9544 Analysis of Algorithms II Solution for Assignment 1

Week 3: Connected Subgraphs

CSC 364S Notes University of Toronto, Spring, The networks we will consider are directed graphs, where each edge has associated with it

! Abstraction for material flowing through the edges. ! G = (V, E) = directed graph, no parallel edges.

Problem Set If all directed edges in a network have distinct capacities, then there is a unique maximum flow.

Poisson process Markov process

Today: Max Flow Proofs

Max Flow, Min Cut COS 521. Kevin Wayne Fall Soviet Rail Network, Cuts. Minimum Cut Problem. Flow network.

Greedy. I Divide and Conquer. I Dynamic Programming. I Network Flows. Network Flow. I Previous topics: design techniques

1 Motivation and Basic Definitions

Math 266, Practice Midterm Exam 2

6/3/2009. CS 244 Algorithm Design Instructor: t Artur Czumaj. Lecture 8 Network flows. Maximum Flow and Minimum Cut. Minimum Cut Problem.

Chap.3 Laplace Transform

Economics 302 (Sec. 001) Intermediate Macroeconomic Theory and Policy (Spring 2011) 3/28/2012. UW Madison

2.1. Differential Equations and Solutions #3, 4, 17, 20, 24, 35

UNIT #5 EXPONENTIAL AND LOGARITHMIC FUNCTIONS

Maximum Flow in Planar Graphs

Soviet Rail Network, 1955

Algorithm Design and Analysis

Algorithms and Data Structures 2011/12 Week 9 Solutions (Tues 15th - Fri 18th Nov)

Lecture 2: Current in RC circuit D.K.Pandey

LaPlace Transform in Circuit Analysis

REPETITION before the exam PART 2, Transform Methods. Laplace transforms: τ dτ. L1. Derive the formulas : L2. Find the Laplace transform F(s) if.

Instructors Solution for Assignment 3 Chapter 3: Time Domain Analysis of LTIC Systems

5. An object moving along an x-coordinate axis with its scale measured in meters has a velocity of 6t

Midterm exam 2, April 7, 2009 (solutions)

Network Flows: Introduction & Maximum Flow

CS 473G Lecture 15: Max-Flow Algorithms and Applications Fall 2005

Lecture 1: Numerical Integration The Trapezoidal and Simpson s Rule

Part I: Short Answer [50 points] For each of the following, give a short answer (2-3 sentences, or a formula). [5 points each]

20/20 20/20 0/5 0/5 20/20 20/20 5/5 0/5 0/5 5/5 0/20 25/30 20/20 30/30 20/20 0/5 5/5 20/20 0/5 0/5 15/20 15/25 20/20 10/10

1 Finite Automata and Regular Expressions

Homework #2: CMPT-379 Distributed on Oct 2; due on Oct 16 Anoop Sarkar

Jonathan Turner Exam 2-10/28/03

Elementary Differential Equations and Boundary Value Problems

First Lecture of Machine Learning. Hung-yi Lee

Physics 160 Lecture 3. R. Johnson April 6, 2015

Network Flow Applications

2. The Laplace Transform

Chapter 5 The Laplace Transform. x(t) input y(t) output Dynamic System

H is equal to the surface current J S

Relaxing planarity for topological graphs

Let s look again at the first order linear differential equation we are attempting to solve, in its standard form:

SOLUTIONS. 1. Consider two continuous random variables X and Y with joint p.d.f. f ( x, y ) = = = 15. Stepanov Dalpiaz

Lecture 26: Leapers and Creepers

18 Extensions of Maximum Flow

16 Max-Flow Algorithms and Applications

Laplace Transform. National Chiao Tung University Chun-Jen Tsai 10/19/2011

Discussion 06 Solutions

MAXIMUM FLOW. introduction Ford-Fulkerson algorithm maxflow-mincut theorem

Source code. where each α ij is a terminal or nonterminal symbol. We say that. α 1 α m 1 Bα m+1 α n α 1 α m 1 β 1 β p α m+1 α n

Lecture 4: Parsing. Administrivia

Network Flows UPCOPENCOURSEWARE number 34414

7.5 Bipartite Matching. Chapter 7. Network Flow. Matching. Bipartite Matching

(1) Then we could wave our hands over this and it would become:

3/3/2015. Chapter 7. Network Flow. Maximum Flow and Minimum Cut. Minimum Cut Problem

INTRODUCTION TO AUTOMATIC CONTROLS INDEX LAPLACE TRANSFORMS

CMPS 6610/4610 Fall Flow Networks. Carola Wenk Slides adapted from slides by Charles Leiserson

Network Design with Weighted Players

Flow networks, flow, maximum flow. Some definitions. Edmonton. Saskatoon Winnipeg. Vancouver Regina. Calgary. 12/12 a.

Phys463.nb Conductivity. Another equivalent definition of the Fermi velocity is

Engineering Circuit Analysis 8th Edition Chapter Nine Exercise Solutions

Copyright 2012 Pearson Education, Inc. Publishing as Prentice Hall.

Institute of Actuaries of India

EXERCISE - 01 CHECK YOUR GRASP

Network Design with Weighted Players (SPAA 2006 Full Paper Submission)

Voltage v(z) ~ E(z)D. We can actually get to this wave behavior by using circuit theory, w/o going into details of the EM fields!

u r du = ur+1 r + 1 du = ln u + C u sin u du = cos u + C cos u du = sin u + C sec u tan u du = sec u + C e u du = e u + C

Maximum Flow 5/6/17 21:08. Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015

Lecture 1: Growth and decay of current in RL circuit. Growth of current in LR Circuit. D.K.Pandey

4.3 Design of Sections for Flexure (Part II)

The Residual Graph. 12 Augmenting Path Algorithms. Augmenting Path Algorithm. Augmenting Path Algorithm

Charging of capacitor through inductor and resistor

7.5 Bipartite Matching. Chapter 7. Network Flow. Matching. Bipartite Matching

AR(1) Process. The first-order autoregressive process, AR(1) is. where e t is WN(0, σ 2 )

EE243 Advanced Electromagnetic Theory Lec # 10: Poynting s Theorem, Time- Harmonic EM Fields

Transcription:

//206 Ma/CS 6a Cla : Flow and Bipari Graph By Adam Shffr Rmindr: Flow Nwork A flow nwork i a digraph G = V, E, oghr wih a ourc vrx V, a ink vrx V, and a capaciy funcion c: E N. Capaciy Sourc 7 a b c d Sink

//206 Flow in a Nwork Givn a flow nwork G = (V, E,,, c), a flow in G i a funcion f: E N ha aifi Evry E aifi f c. Evry v V, aifi u,v E Toal flow nring v. f u, v = v,w E f v, w Toal flow xiing v. Exampl: Flow Th capacii ar in rd. Th flow i in blu. 2/7 2/ 0/ a 2/ c 0/ b 2/ d / / / / 2

//206 Rmindr: Cu A cu i a pariioning of h vric of h flow nwork ino wo S, T uch ha S and T. Th iz of a cu i h um of h capacii of h dg from S o T. 7 a b c d Rmindr: Max Flow Min Cu Max flow min cu horm. In vry flow nwork, h iz of h minimum cu i qual o h iz of h maximum flow. 7 a b c d

//206 Edg in Min Cu Problm. Givn a flow nwork V, E,,, c and an dg E, dcrib an algorihm for chcking whhr i in a la on min cu of h nwork. Soluion. Find a max flow. Dcra h capaciy of by on and find a max flow in h nw nwork. By h max-flow min-cu horm, i in a min cu iff h iz of h maximum flow dcrad. Edg in Min Cu Problm. Givn a flow nwork V, E,,, c and an dg E, dcrib an algorihm for chcking whhr i in vry min cu of h nwork. Soluion. Find a max flow. Incra h capaciy of by on and find a max flow in h nw nwork. By h max-flow min-cu horm, i in vry min cu iff h iz of h maximum flow incrad. 4

//206 Rmindr: Maching A maching of an undircd graph G i a of vrx-dijoin dg of G. Th iz of a maching i h numbr of dg in i. A maximum maching of G i a maching of maximum iz. Flow and Bipari Maching Problm. givn a bipari graph G = V V 2, E, u a max flow algorihm o find a maximum maching of G. V V 2

//206 Flow and Bipari Maching (2) Dirc h dg from V o V 2. Add a ourc and dg from i o vry vrx of V. Similarly, add a ink. Dirc dg o h righ and capacii o. V V 2 Flow and Bipari Maching () Thr i a bijcion bwn h maching of G and h flow of h nwork. A max maching corrpond o a max flow. V V 2 6

//206 Machin and Tak Problm. W ar givn n machin and m ak ha h machin nd o do. Th i h machin prform a mo n i ak. Evry machin ha a ub of h ak ha i i abl o do. Dcrib an algorihm for aigning all of h ak (or aing ha no aignmn xi). Soluion n n 2 n n 4 Tak Machin W wih o find a flow of iz m. 7

//206 Indgr and Oudgr Conidr a digraph G = V, E. Th indgr of a vrx v V i h numbr of dg of E ha ar dircd ino i. Th oudgr of a vrx v V i h numbr of dg of E ha ar dircd ou of i. Indgr: 2 Oudgr: Subgraph wih Boundd Dgr Problm. Givn a dircd graph G = V, E, dcrib an algorihm for finding a ub of h dg E E o ha vry vrx of V ha an indgr and an oudgr of xacly in V, E (or announc ha uch a do no xi). 8

//206 Soluion Build a bipari graph G = U W, E o ha V = U = W. Wri V = v,, v n, U = u,, u n, and W = w,, w n. For vry dg v i, v j E, w add u i, w j E. Exampl: Building G u w v2 v u 2 w 2 v v v 4 u u 4 w w 4 u w 9

//206 Soluion Build a bipari graph G = U W, E o ha V = U = W. Wri V = v,, v n, U = u,, u n, and W = w,, w n. For vry dg v i, v j u i, w j E. E, w add Chck whhr hr xi a prfc maching in G. If o, rurn h dg of h maching. Ohrwi, no valid ub xi. Corrcn An dg v i, v j E conribu o h oudgr of v i and o h indgr of v j. In h bipari graph, i corrpond o u i, w j, conribuing o h dgr of u i, w j. Conidr E E and h dgr ha h dg of E induc. A vrx v i ha indgr and oudgr iff boh u i and w i hav a dgr of. Evry dgr in h bipari ubgraph i iff vry indgr and oudgr i in h inducd ubgraph. 0

//206 Dircing a Graph wih Dgr Conrain Problm. Givn an undircd graph G = V, E, which migh no b impl, dcrib an algorihm ha dirc ach of h dg of G, o ha no oudgr i largr han. 2 d ou Soluion W build a flow nwork: v v 2 2 v v 4 4 v A vrx for vry lmn of V. An dg for vry vrx-dg pair ha ar adjacn in G. A vrx for vry lmn of E.

//206 Soluion (con.) v v 2 2 v v 4 4 v Thr i a valid orinaion of h dg if and only if h iz of h max flow i E. Corrcn (Skch) Thr i a flow of iz E in h nwork. If and only if Thr i a flow whr vry vrx on h righ id of h nwork rciv a flow of from on of i wo nighbor. If and only if Thr i an orinaion of h dg of G uch ha vry oudgr i a mo. 2

//206 Back o MST Problm. Conidr a conncd undircd graph G = V, E, a wigh funcion w: E N, an dg E, and an ingr k > 0. Dcrib an fficin algorihm for chcking whhr w can rmov a mo k dg from G o ha i in vry MST of h ruling graph. Rricion. G ha o rmain conncd afr h rmoval. Sinc k i larg, w ar no allowd o ry all ~ E k of a mo k dg. Warm-up S = u, v. Whn i in vry MST of G? If in vry ohr pah bwn u and v hr i an dg wih a wigh largr han w(). Non of h pah can b h pah bwn u and v in an MST. u 4 4 0 6 v

//206 Warm-up #2 S = u, v. Whn i in vry MST of G afr rmoving a mo on dg of E? If afr rmoving a mo on dg vry rmaining pah bwn u and v conain an dg wih a wigh largr han w(). u 4 4 0 4 v Soluion S = u, v. W wih o rmov up o k dg, o ha vry ohr pah bwn u and v conain an dg havir han w(). How can w do ha? Rmov vry E wih w > w() (Th ar ignord; no par of h chon ub). W g a problm ha wa olvd in h prviou lcur: Finding h minimum ub of dg uch ha i rmoval diconnc from (ignoring h wigh). 4

//206 A Small Iu Acually, w only olvd h problm of finding a minimum numbr of diconncing dg in dircd graph. In h ca of an undircd graph: Rplac vry dg wih a pair of ani-paralll dg. Alo from prviou cla: Thr xi a max flow ha do no u any pair of ani-paralll dg. Th End