Maximum Flow Networks - PowerPoint PPT Presentation

About This Presentation
Title:

Maximum Flow Networks

Description:

Min cut Max flow theorem. Enmond kalp algorithm. Max Bipartite matching ... If f is a flow then net flow across the cut (S,T) is defined to be f(S,T) ... – PowerPoint PPT presentation

Number of Views:221
Avg rating:3.0/5.0
Slides: 27
Provided by: range
Learn more at: https://ranger.uta.edu
Category:
Tags: cut | flow | maximum | networks

less

Transcript and Presenter's Notes

Title: Maximum Flow Networks


1
Maximum Flow Networks
  • Hiren Patel
  • Ujjval Patel

2
CONTENTS
  • Network flows on directed acyclic graphs
  • Ford-fulkerson Algorithms
  • -Residual networks
  • Min cut Max flow theorem
  • Enmond kalp algorithm
  • Max Bipartite matching

3
Network flows on directed acyclic graphs
  • DAG is a directed graph with no cycles.
  • Flow network a flow network G (V,E) is a
    directed graph in which each edge (u,v) ? E has a
    nonnegative capacity c(u,v) gt 0. if (u,v) ? E ,
    we assume that c(u,v) 0.
  • We distinguish two vertices in flow network ,
    source s and sink t.
  • The source produces the material at a steady rate
    .
  • The sink consumes the material at a steady rat
  • Objective how much of material can be
    imposed through network that network can
    handle

4
  • Flow A flow in G is a real-valued function f V
    V ? R that satisfies three properties
  • 1. Capacity constraint For all u,v ? V, we
    require f(u,v) c(u,v).
  • The net flow from one vertex to another must not
    exceed the given capacity.
  • 2. Skew symmetry For all u,v ? V, we require
    f(u,v) -f(v,u).
  • The net flow from a vertex u to a vertex v is the
    negative of the net flow in the
  • 3. Flow conservation For all u ? V - s,t, we
    require
  • ? f(u,v) 0.
  • v ? V
  • The quantity f(u,v),which can be positive or
    negative , is called the net flow from vertex u
    to v.
  • The value of the flow is defined as f ?
    f(s,v) that is the totat net Flow out of the
    source. v ? V

5
Consider the network G(V,E) shown in the figure
below. Each edge (u,v) ? E in the network is
labeled with its capacity c(u,v).
a
4
2
s
t
1
5
3
b
a
4
2
s
t
1
1
1
1
5
3
Flow 1
b
6
Residual graph
a
4
1
1
s
t
1
1
5
2
b
a
1/4
2/2
s
t
1/1
5
1/3
b
7
Residual graph
a
3
2
1
s
t
1
1
5
2
b
a
2/4
2/2
s
t
0/1
1/5
1/3
b
8
a
2
2
2
s
t
1
1
1
4
2
b
a
2/4
2/2
s
t
1
3/5
3/3
b
9
a
2
2
2
s
t
1
2
3
3
b
Max Flow 5
10
Ford fulkerson algorithm
  • The Ford_Fulkerson method is iterative,
  • Starts with f(u,v) for (u,v) ? V, initial flow
    of value 0.
  • The method is based on the augmenting path which
    is
  • defined as a path from s to t along which we can
    push
  • more flow and then augment flow along this path.

11
  • Procedure Ford_Fulkerson_method(G,s,t) For each
    edge (u,v) ? EG
  • do fu,v ? 0
  • fv,u ? 0
  • While there exists a path p from s to t in
    the residual network G1
  • do c1(p) ? min c1(u,v)(u,v) is in p
  • for each edge (u,v) in p
  • do fu,v? fu,v c1(p)
  • fu,v? -fu,v

12
  • Running time for this algorithms is O(E f)
    where f is the maximum flow found by algorithm.
  • First three Lines take time ?(E).
  • The while loop of last five lines is executed at
    most f times, since the flow value increases
    by at least one unit in each iteration.

13
Example
12
v1
v2
20
16
9
4
s
t
10
7
14
13
v4
v3
4
4/12
v1
v2
20
4/16
4/9
4
s
t
10
7
4/14
13
v4
v3
4/4
14
8
v1
v2
20
12
4
5
4
s
t
10
7
4
4
10
13
v4
v3
4
4
4/12
v1
v2
7/20
11/16
4/9
4
s
t
7/10
7/7
11/14
13
v4
v3
4/4
15
8
v1
v2
13
5
4
5
11
s
t
7
3
11
7
4
3
13
v4
v3
4
11
12/12
v1
v2
15/20
11/16
4/9
1/4
s
t
10
7/7
11/14
8/13
v4
v3
4/4
16
12
v1
v2
5
5
5
3
s
t
15
11
11
7
4
8
3
5
v4
v3
4
11
12/12
v1
v2
19/20
11/16
9
1/4
s
10
t
7/7
11/14
12/13
v4
v3
4/4
17
v1
v2
12
1
5
9
3
s
t
11
19
11
7
12
3
1
4
v4
v3
11
18
Cut of flow netwoks
  • Cut a cut (S,T) of flow network G (V,E)
  • is a partition of V into S and T V-S such
  • that s ? S and t ? T.
  • If f is a flow then net flow across the cut
    (S,T) is defined to be f(S,T).
  • The capacity of the cut (S,T) is c(S,T).

19
Max flow min cut theorem
  • The ford fulkerson method repeatedly augments the
    flow along the augmenting paths until the a max.
    flow has been found.
  • This theorem tell us that a flow is max. if and
    only if its residual network contains no
    augmenting path.

20
  • Theorem states that ,
  • If f is a flow in a flow network,
  • G (V,E) with the source s and sink t then
  • The following conditions are equivalent
  • F is a max. flow in G.
  • The residual network G1 contains no augments
    paths.
  • F c(S,T) for some cut (S,T) of G.

21
Edmond karp algorithm
  • The bound on Ford fulkerson can be improved if we
    implement the computation of the augmenting path
    p with a breadth first search, that is , if the
    augmenting path is a shortest path from s to t in
    the residual network,where each edge has unit
    distance (weight).
  • we call ford fulkerson method so implemented
    the Edmonds-Karp algorithm.
  • Edmonds-Karp algorithm runs in O(VEE).

22
Example
a
100
100
s
t
1
100
100
b
Applying breadth first search
a
100
100
s
t
100
b
23
Residual graph
a
100/100
100/100
s
t
0/1
0/100
0/100
b
Again Run BFS So the obvious path is s-b-t
a
100/100
100/100
s
t
0/1
100/100
100/100
b
24
Maximum Bipartite Matching
  • Given an undirected graph G(V,E), maching is a
    subset of edges M is subset of E such that for
    all vertices v ? V,
  • at most one edge of M is incident on v.We say
    that a vertex v ?V is matched by matching M if
    some edge in M is incident on v
  • otherwise, v id unmatched.A maximum matching is
    a matching of maximum cardinality,
  • that is, a matching M such that for any
    matchimng M,we have Mgt M.

25
A bipartite graph G(V,E) with vertex partition
V L U R
A matching with Cardinality 2
A matching with Cardinality 3
26
  • We can solve the maximum match finding problem
    using flow networks.
  • Put source and sink on the graph such that source
    connects all the vertices on left side of the
    graph with single edge to each vertex and do the
    same for the sink. Now assign weight 1 to all the
    edges in the graph.
  • Run ford fulkerson algorithm to find max flow.
  • Max. cardinality Max flow
Write a Comment
User Comments (0)
About PowerShow.com