0% found this document useful (0 votes)
25 views

Submitted By: Muhammad Ahmad Submit To: Umer SB BSCS: 4 Semester SESSION: 2017-2021 ROLL# 170125

The document discusses network flows and how to find the maximum flow in a network. It defines a network as a directed graph with a source node, target node, and edge capacities. A flow must satisfy the capacity and conservation constraints. The maximum flow problem is to find the maximum amount of flow that can be sent from the source to the target. This can be solved by finding augmenting paths in the residual graph to incrementally increase the flow.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Submitted By: Muhammad Ahmad Submit To: Umer SB BSCS: 4 Semester SESSION: 2017-2021 ROLL# 170125

The document discusses network flows and how to find the maximum flow in a network. It defines a network as a directed graph with a source node, target node, and edge capacities. A flow must satisfy the capacity and conservation constraints. The maximum flow problem is to find the maximum amount of flow that can be sent from the source to the target. This can be solved by finding augmenting paths in the residual graph to incrementally increase the flow.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

ASSIGNMENT

SUBMITTED BY:
MUHAMMAD AHMAD

SUBMIT TO: UMER SB

BSCS: 4TH SEMESTER

SESSION: 2017-2021

ROLL# 170125
ALI FATIMAH COLLEGE PF SCIENCE AND
MANAGEMEN
Muhammad Ahmad Mian
03216687630
Network Flows
Network
A directed graph G = (V, E) such that
• each directed edge e has its nonnegative capacity denoted by ce
• there is a node s (source) with no incoming edges
• there is a node t (target) with no outgoing edges

u,v - internal
Nodes

u
20 10
s 30 t
10 20
v
Flow
S-t flow in G = (V, E) is a function f from E to R+

• capacity condition: for each e, 0  f(e)  ce


• conservation condition: for each internal node v, ∑e in v f(e) = ∑e out
v f(e)
• there is a node t (target) with no outgoing edges

Property: ∑e in t f(e) = ∑e out s f(e)

Muhammad Ahmad Mian


03216687630
Network: Flow:
u
u
20 10
20 10
10 t
s 30 t s
10 20
10 20
V v
Useful definitions
Given s-t flow f in G = (V, E) and any subset of
Nodes S
• f in(S) = ∑e in S f(e)
• f out(S) = ∑e out S f(e)
Property: f in(t) = f out(s)
Example: f in(u, v) = f out(u, v) = 30
Network: Flow:
u
u
20 10
20 10
10 t
s 30 t s
10 20
10 20 v
v
Muhammad Ahmad Mian
03216687630
Problem(s)
• What is the maximum value of f in(t) (flow) for a
given graph G = (V, E) ?
• How to compute it efficiently?
Assumption: capacities are positive integers.
Example: f in(t) = f out(s) = 30
Network: Flow:
u
u
20 10
20 10
10 t
s 30 t s
10 20
10 20 v
v

Residual graph
Assume that we are given a flow f in graph G.
Residual graph Gf
• The same nodes, internal and s,t

Muhammad Ahmad Mian


03216687630
• For each edge e in E with ce > f(e) we put
weight ce - f(e) (residual capacity)
• For each edge e = (u,v) in E we put weight
f(e) to the backward edge (v,u) (residual
capacity)

New u
flow: 20 10
s 1020 10 t
10 20

New
Network: residual
graph:
u u
20 10 20 10

s 30 t s 10 20 t
10 10 20
20
v v
Muhammad Ahmad Mian
03216687630
Augmenting path & augmentation
Assume that we are given a flow f in graph G, and
the corresponding residual graph Gf
1. Find a new flow in residual graph - through a path
with no repeating nodes, and value equal to the
minimum capacity on the path (augmenting path)
2. Update residual graph along the path
New
u
New residual
Network: u 20 10 u
flow: graph:
20 10 1020 10 t 20 10
s
s 30 t 10 20 s 10 20 t
10 20 v 10 20
10
v v
Flow: u Residual u
20 0 Graph: 20 10

s 20 t s 20 10 t
0 20 10 20
v v
New residual graph:
u u
New
flow: 20 10 20 10

s 10 20 10 t s 10 20 t
10 20 10 20
v v
Muhammad Ahmad Mian
03216687630

You might also like