maximum flow network
TRANSCRIPT
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 1/30
Maximum Flow Network
Submitted By:-
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 2/30
Contents:
Maximum Flow Network
Cuts and Flows
Residual Network
Augmenting Path Ford-Fulkerson Method
Matching
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 3/30
Network Flows
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 4/30
Types of Networks Internet
Telephone
Cell
Highways
Rail
Electrical Power
Water
Sewer
Gas
…
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 5/30
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)
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 6/30
I. If (u,v)E, we assume that c(u,v)=0.
II. Two distinct vertices :a source s and a sink t.
Typical example:
Here IEI>=IVI-1; E represents edges and V represents vertices.
ae
f
s
a
t
3/3 2/2
1/4
2/3
2/2
0/2
3/3
2/3
Notation:
Flow/Capacity
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 7/30
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 Rsatisfying 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
vine vout e
e f e f .. ..
)()(
Flow:
When (u,v) E, there can be no flow from u to v and f(e)=0
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 8/30
Max Flow of a Network
Max flow is the flow from s-t that maximizes net flow out of the
source.
f
s
a
t
3/3 2/2
1/4
2/3
2/2
0/2
3/3
2/3
g j
Here |f|=f(s,g) + f(s,f) =3+2=5
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 9/30
uts of Flow Networks
Cuts: A cut (S,T)of flow network G=(V,E) is a partition of Vinto S and T=V-S such that sS and tT
11/16
12/1215/20
7/7
4/411/14
4/91/4
8/13
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 10/30
Residual Networks
The residual capacity of an edge (u, v) in a network with a flow f is
given by:
),(),(),( vu f vucvuc f
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.,
( , ), wheref f
G V E {( , ) : ( , ) 0}f f
E u v V V c u v
The network given by the undirected arcs andresidual capacities is called residual network.
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 11/30
Example of Residual Network
Flow Network:
Residual Network:
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 12/30
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.
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 13/30
Example: G =(V,E) be the given graph as shown below find, residual
graph and augmenting path.
Solution:
Original graph G=(V,E)
(a)Flow f (e)
(b)Arc e=(v, w) ϵ E
Flow Network:
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 14/30
S V111/16
Flow
capacity
Residual Graph: Gf =(V, Ef )
(a) Residual arcs e= (V, w) and eR =(W,V)
(b) “Undo” flow sent.
S V15
Residual Capacity
11
Residual Capacity
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 15/30
Therefore, we can represent the residual graph as follows
3
Residual Network:
Augmenting Path
The residual capacity of this augmenting path is 4
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 16/30
Ford-Fulkerson Method
Depends on two ideas-
1. Residual networks
2. Augmented path
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 17/30
Augmenting path
Original Network
Example:
Flow Network
Resulting Flow =4
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 18/30
CSE 310119
Residual Network Flow Network
Resulting Flow =11
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 19/30
Residual Network Flow Network
Resulting Flow =19
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 20/30
Residual Network Flow Network
Resulting Flow =23
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 21/30
Residual Network
No augmenting pathMaxflow=23
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 22/30
MAXIMUM BIPARTITE MATCHING
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 23/30
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
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 24/30
Suppose we have a set of
people L and set of jobs R.
Each person can do onlysome of the jobs
Can model this as a bipartite
graph
X
u
People Tasks
L R
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 25/30
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.
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 26/30
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 .
BIPARTITE MATCHING
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 27/30
MAXIMUM MATCHING
A maximum matching is a matching with the largest possible
number of edges; it is globally optimal.
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 28/30
So, want a maximum matching: one that contains as many
edges as
possible.
7/26/2019 Maximum Flow Network
http://slidepdf.com/reader/full/maximum-flow-network 29/30
Advantages
Cost is low
Time is redeuced
Disadvantages
• It is an unidirectional network