Вы находитесь на странице: 1из 30

Maximum Flow Network

Submitted By:-

Contents:
Maximum Flow Network
Cuts and Flows

Residual Network
Augmenting Path

Ford-Fulkerson Method
Matching

Network Flows

Types of Networks
Internet
Telephone
Cell
Highways

Rail
Electrical Power

Water
Sewer

Gas

Network Flow
Instance:
A Network is a directed graph G
Edges represent pipes that carry flow
Each edge (u,v) has a maximum capacity c(u,v)

I.
II.

If (u,v)E, we assume that c(u,v)=0.


Two distinct vertices :a source s and a sink t.

Typical example:
Here IEI>=IVI-1; E represents edges and V represents vertices.

3/3

3/3

0/2

s
2/3

Notation:
Flow/Capacity

2/2
1/4

2/2

t
2/3

Flow:
G=(V,E): a flow network with capacity function c.

s-- the source and t-- the sink.


A flow in G: a real-valued function f:V*V R

satisfying the following two properties:


Capacity constraint: For all u,v V,
we require f(u,v) c( u,v).
Flow conservation: For all u V-{s,t}, we require

f (e) f (e)
e.in.v

e.out .v

When (u,v) E, there can be no flow from u to v and f(e)=0

Max Flow of a Network


Max flow is the flow from s-t that maximizes net flow out of the
source.

2/2

3/3

3/3
0/2

s
2/3

1/4

2/2

t
2/3

Here |f|=f(s,g) + f(s,f) =3+2=5

Cuts of Flow Networks


Cuts: A cut (S,T)of flow network G=(V,E) is a partition of V
into S and T=V-S such that sS and tT

12/12
15/20

11/16
1/4
8/13

4/9

11/14

7/7
4/4

Residual Networks
The network given by the undirected arcs and
residual capacities is called residual network.
The residual capacity of an edge (u, v) in a network with a flow f is
given by:

c f (u, v) c(u, v) f (u, v)


The residual network of a graph G induced by a flow f is the graph
including only the edges with positive residual capacity, i.e.,
Gf (V , Ef ), where Ef {(u,v ) V V : cf (u,v ) 0}

Example of Residual Network

Flow Network:

Residual Network:

Augmenting Paths
Augmenting path=path in the residual network
Given a flow network G=(V,E) and a flow f, an augmenting path P
is a simple path from s to t in residual network Gf .
An augmenting path is a directed path from the source to the sink in
the residual network such that every arc on this path has positive residual
capacity.

The minimum of these residual capacities is called the residual


capacity of the augmenting path.

Example: G =(V,E) be the given graph as shown below find, residual


graph and augmenting path.

Flow Network:

Solution:
Original graph G=(V,E)
(a) Flow f (e)
(b)Arc e=(v, w) E

Flow

capacity
11/16

S
Residual Graph:

V1

Gf =(V, Ef)

(a) Residual arcs e= (V, w) and eR


(b) Undo flow sent.
S

=(W,V)
Residual Capacity

V1

11
Residual Capacity

Therefore, we can represent the residual graph as follows

Residual Network:
3
Augmenting Path

The residual capacity of this augmenting path is 4

Ford-Fulkerson Method
Depends on two ideas1.
Residual networks
2.
Augmented path

Example:

Augmenting path

Flow Network

Original Network

Resulting Flow =4

Residual Network

19

CSE 3101

Flow Network
Resulting Flow =11

Residual Network

Flow Network

Resulting Flow =19

Residual Network

Flow Network
Resulting Flow =23

Residual Network
No augmenting path
Maxflow=23

MAXIMUM BIPARTITE MATCHING

BIPARTITE GRAPH
A Bipartite graph G(V,E) is a graph in which all vertices

are divided into disjoint subsets say L and R, such that

every edge in E, is between a vertex in L and a vertex in R

People

Tasks

Suppose we have a set of

people L and set of jobs R.


Each person can do only

some of the jobs


Can model this as a bipartite

graph
L

MATCHING
A matching in a graph is a subset of edges in which no two

edges are adjacent. It may also be an entire graph consisting


of edges without common vertices.

BIPARTITE MATCHING

A matching in a graph is a subset M of E, such that for all vertices v in V, at


most one edge of M is incident on v.

MAXIMUM MATCHING

A maximum matching is a matching with the largest possible

number of edges; it is globally optimal.

So, want a maximum matching: one that contains as many


edges as
possible.

Advantages
Cost is low

Time is redeuced

Disadvantages
It is an unidirectional network

THANK YOU

Вам также может понравиться