SlideShare a Scribd company logo
1 of 13
Download to read offline
Home Assignment 1
Advanced Algorithms and Data Structure
Siyi Wu
KRW521
Zhongxing Ren
CPJ395
Yu Pei
MQH875
Qianxi Yang
HSB264
December 6, 2022
1
1 Group Part
1.1 Answer of exercise 26.1-1 in CLRS
Solution1:
Suppose the maximum flow of a G = (V, E) is flow f, if after replacing (u,v) with
new edges (u,x) and (x,v) and getting a new flow network G′
= (V ′
, E′
), the flow
conservation property still holds because the flow in and out of v1 and v2 do not
change. Second, assume the number of cuts across the edge (u,v) in the original
graph G is n. After splitting, there will be n cuts across the edge (u,x) and n
cuts across (x,v). Since c(u, x) = c(x, v) = c(u, v), |f| =
P
v∈V f(s, v) remains
the same. Therefore, the maximum flow of G′
= (V ′
, E′
) remains the same as G.
Solution2:
Suppose the set of min-cut distinguished by G is S, T. If the min-cut edge does
not contain (u, v) then u, v, x nodes are in S or in T. In this case, the capacity
of the min-cut is not affected, that is, the maximum flow |f| remains unchanged.
If the min-cut edge contains (u, v), then when the new node is added, there are
two cases: 1. The new node x is added to S, then (x, v) replaces (u, v) when
calculating the capacity of the cut, because c(u, v) = c(x, v) so the capacity of
the cut remains the same and the maximum flow |f| is also the same.
2. The new node x is added to T, similarly (u, x) replaces (u, v), because
c(u, v) = c(u, x) so the capacity of the cut capacity remains the same, and the
maximum flow |f| remains the same.
1.2 Answer of exercise 26.1-4 in CLRS
To prove that αf1 +(1−α)f2 is a flow, it must be shown to satisfy conservation
of Capacity constraint and Flow conservation.
Proof of Capacity constraint:
First let f = αf1 + (1 − α)f2, so we have:
∀u, v ∈ V, f(u, v) = αf1(u, v) + (1 − α)f2(u, v) (1)
And because the value domain of f1(u, v) is [0, c(u, v)], the value domain of
f2(u, v) is [0, c(u, v)], and the value domain of α is [0, 1]. So the question be-
comes a problem of finding the limit of a quadratic equation.
When f1(u, v) and f2(u, v) both take c(u, v), f(u, v) has a maximum value
over the domain of definition:
fmax(u, v) = αc(u, v) + (1 − α)c(u, v) = c(u, v) (2)
Similarly, when f1(u, v) and f2(u, v) both take 0f(u, v) has a minimum value
2
over the domain of definition:
fmin(u, v) = α × 0 + (1 − α) × 0 = 0 (3)
Therefore the value domain of f is [0, c(u, v)].
Proof of Flow conservation:
By definition,
X
v∈V
f(v, u) =
X
v∈V
(αf1(v, u) + (1 − α)f2(v, u))
= α
X
v∈V
f1(v, u) + (1 − α)
X
v∈V
f2(v, u)
(4)
X
u∈V
f(u, v) =
X
u∈V
(αf1(u, v) + (1 − α)f2(u, v))
= α
X
u∈V
f1(u, v) + (1 − α)
X
u∈V
f2(u, v)
(5)
Because,
α
X
v∈V
f1(v, u) = α
X
u∈V
f1(u, v) (6)
And,
(1 − α)
X
v∈V
f2(v, u) = (1 − α)
X
u∈V
f2(u, v) (7)
Therefore,
X
v∈V
f(v, u) =
X
u∈V
f(u, v) (8)
1.3 Answer of exercise 26.1-7 in CLRS
It is sufficient to use the following structure instead of each node in the original
diagram.
3
Figure 1: Substitution Structure
Because in this structure, any flow passing through v must pass through the
edges (vin, vout), in order to get from the edges going into v to the edges going
out of v. Therefore, vin and vout are equivalent to bound together, and as long
as the flow passes through vin, it must also pass through vout. In addition, the
edge (vin, vout) only limits the node capacity and does not affect c(u, v) and
c(v, u) in the original graph, so the maximum flow does not change as a result.
Therefore G′
should have 2|V | nodes, |E| + |V | edges.
1.4 Answer of exercise 26.2-2 in CLRS
The flow across the cut({s, v2, v4}, {v1, v3, t}) is:
f(S, T) = f(s, v1) + f(v2, v1) + f(v4, v3) + f(v4, t) − f(v3, v2)
= 11 + 1 + 7 + 4 − 4 = 19
The capacity of this cut is:
c(S, T) = c(s, v1) + c(v2, v1) + c(v4, v3) + c(v4, t)
= 16 + 4 + 7 + 4 = 31.
1.5 Answer of exercise 26.2-3 in CLRS
The Edmonds-Karp algorithm is executed as follows.
4
Figure 2: The execution of the Edmonds-Karp algorithm
5
1.6 Answer of exercise 26.2-4 in CLRS
Figure 3: The minimum cut
A minimum cut (S,T) is S = {s, v1, v2, v4} and T = {v3, t}. The capacity of
this cut is c(S, T) = 12 + 7 + 4 = 23. The augmenting path in graph (c) cancels
flow (v3, v2) in graph (a) and flow (v2, v1) in graph (b).
1.7 Answer of exercise 26.2-7 in CLRS
Proof:
Firstly, we prove that fp satisfies capacity constraint:
Because cf (p) = min{cf (u, v) : (u, v) ∈ p} (p is the augmentation path in
residual network), cf (p) ≤ cf (u, v), (u, v) ∈ p. So for (u, v) ∈ p, fp(u, v) =
cf (p) ≤ cf (u, v). For (u, v) /
∈ p, fp(u, v) = 0 < cf (u, v). So for every edge (u,v)
in residual network, fp(u, v) ≤ cf (u, v). So fp satisfies capacity constraint.
Secondly, we prove that fp satisfies flow conservation:
For u ∈ V − {s, t} in residual network, if u is on the augmentation path, then
X
v∈V
f(v, u) =
X
v∈V
f(u, v) = fp(u, v) = cf (p) (9)
if u isn’t on the augmentation path, then
X
v∈V
f(v, u) =
X
v∈V
f(u, v) = 0 (10)
So, for u ∈ V − {s, t} in residual network, the equation
X
v∈V
f(v, u) =
X
v∈V
f(u, v) (11)
always holds. So fp satisfies flow conservation.
So fp is a flow in residual network Gf , and |fp| =
P
v∈V f(s, v)−
P
v∈V f(v, s) =
cf (p) > 0
6
1.8 Answer of exercise 26.2-9 in CLRS
If both f and f’ are flows in a network G, then:



0 ≤ f(u, v) ≤ c(u, v)
0 ≤ f′
(u, v) ≤ c(u, v)
(f ↑ f′
)(u, v) = f(u, v) + f′
(u, v)
(12)
where (u, v) ∈ E (E is the set of edge in network G), so
0 ≤ (f ↑ f′
)(u, v) ≤ 2c(u, v) (13)
so the augmented flow doesn’t satisfy the capacity constraint and it can’t be
regarded as a flow in network G.
For f, the value of input flow of u (u ∈ V − {s, t}, V is the set of vertices of
network G) equals to that of output flow of u. For f’, the value of input flow of
u (u ∈ V − {s, t}, V is the set of vertices of network G) equals to that of output
flow of u. So, for f ↑ f′
, the value of input flow of u (u ∈ V − {s, t}, V is the set
of vertices of network G) equals to that of output flow of u. So the augmented
flow satisfies the flow conservation.
1.9 Answer of exercise 26.3-2 in CLRS
Proof:
Here we use induction to prove the therom 26.10. After the first loop of Ford-
Fulkerson, because capacity function c takes on only integral values and all f(u,v)
((u, v) ∈ E, E is the set of edge in network) in the flow network are initially 0,
so the capability of every edge in residual network only takes integral values, so
cf (p) (cf (p) = min{cf (u, v) : (u, v) ∈ p} where p is the augmentation path in
residual network) takes on only integral values making all f(u,v) (u, v) ∈ E of
the flow network after augmentation are integral values (line 5 to line 8 in
FORD-FULKERSON). So |f| (|f| =
P
v∈V f(s, v) −
P
v∈V f(v, s)) takes on
only integral values.
Then, we assume that after nth loops, |f| and all f(u,v) ((u, v) ∈ E, E is the set
of edge in network) of the flow network are all integral values.
Next, because after nth loops |f| and all f(u,v) ((u, v) ∈ E, E is the set of edge
in network) of the flow network are both integral values, in (n+1)th loop, the
capability of every edge in residual network only takes integral values, so cf (p)
(cf (p) = min{cf (u, v) : (u, v) ∈ p} where p is the augmentation path in residual
network) takes on only integral values making all f(u,v) (u, v) ∈ E of the flow
network after (n+1)th loop are integral values (line 5 to line 8 in FORD-
FULKERSON). So |f| (|f| =
P
v∈V f(s, v)−
P
v∈V f(v, s)) also takes on only
integral values after (n+1)th loop.
So here we have proved that ”after each loop in FORD-FULKERSON |f|
7
and all f(u,v) ((u, v) ∈ E, E is the set of edge in network) of the flow are all
integers if the capacity function c takes on only integral values”. So, as the flow
that after the final loop of FORD-FULKERSON, the maximum flow also
has the fact that |f| and all f(u,v) ((u, v) ∈ E, E is the set of edge in network)
of the maximum flow are all integers if the capacity function c takes on only
integral values.
2 Own Summary of Each Group Member
2.1 Own summary of Siyi Wu (KRW521)
2.1.1 Flow network
1. Definition: G = (V, E) is a directed graph in which each edge (u, v) ∈ E
has a nonnegative capacity c(u, v) ≥ 0.
2. Capacity constraint: ∀u, v ∈ V, 0 ≤ f(u, v) ≤ c(u, v)
3. Flow conservation: ∀u ∈ V − {s, t},
P
v∈V f(v, u) =
P
v∈V f(u, v)
2.1.2 Residual networks & Cuts
Residual networks
cf (u, v) =





c(u, v) − f(u, v) if (u, v) ∈ E
f(v, u) if (v, u) ∈ E
0 otherwise
(14)
(f ↑ f′
) (u, v) =
(
f(u, v) + f′
(u, v) − f′
(v, u) if (u, v) ∈ E
0 otherwise
(15)
Figure 4: Residual network and an Augmenting path
8
Cuts
f(S, T) =
X
u∈S
X
v∈T
f(u, v) −
X
u∈S
X
v∈T
f(v, u) (16)
c(S, T) =
X
u∈S
X
v∈T
c(u, v) (17)
Figure 5: A minimum cut of a flow network
2.1.3 Ford-Fulkerson & Edmond-Karp
Ford-Fulkerson algorithm
1. Definition: Ford-Fulkerson algorithm is a way to calculate the maximum
flow.
2. Time complexity: O(E|f∗
|)
3. Depth first
Edmond-Karp algorithm
1. Definition: Edmond-Karp algorithm is a modified algorithm of Ford-
Fulkerson algorithm
2. Time complexity: O(V E2
)
3. Breadth first
9
2.2 Own summary of Zhongxing Ren (CPJ395)
• Start with a question: There are two cities: city A and city B, there is a
road network between them, but each road has a capacity of transporting
the goods, so how to transport the goods as much as possible from city A
to city B is a question. − > Abstract to ”how to figure out the max flow
in a flow network”.
• Flow net work definition: Capacity constraint and Flow conservation
• Using an hourglass-shape graph to introduce an intuitive equivalent rela-
tion between value of max flow and minimum cut capacity.
• Definition of augmentation flow:
(f ↑ f′
) (u, v) =
(
f(u, v) + f′
(u, v) − f′
(v, u) if (u, v) ∈ E
0 otherwise
(18)
• Rigorous derivation: Augmentation flow (will be used in line 5 to line
8 in FORD-FULKERSON) − > |f| ≤ c(S, T) − > |f| rigorously
increases after each loop until |f| = some c(S,T) (min of c(S,T)) − > f is
the max flow and its value |f| = some c(S,T) (min of c(S,T))
• Definition of residual network:
cf (u, v) =





c(u, v) − f(u, v) if (u, v) ∈ E
f(v, u) if (v, u) ∈ E
0 otherwise
(19)
• More rigorous: Basic process of Ford-Fulkerson (augment flow in each loop
until |f| = some c(S,T) (min of c(S,T))): building residual network − >
finding augmentation path − > figuring out fp − > augment flow − >
new loop until no augmentation path can be found in residual network,
then we can get the max flow f and its value |f|.
• A sample for implementing the Ford-Fulkerson algorithm and Edmonds-
Karp algorithm
Figure 6: algorithm implementation (Figure 26-7 in CLRS [1])
10
And it is also a good sample to introduce the consuming time (O(E|f∗
|)
and O(V E2
)) of these two algorithms (DFS, BFS in searching the aug-
mentation path in residual network)
• Using of Max Flow: Maximum bipartite matching (adding source point
and sink point additionally, unit capacity edges)
2.3 Own summary of Yu Pei (MQH875)
• Flow network: two properties, |f|
• Residual network Gf and residual capacity cf (u, v) of edge (u, v)
• Cut: flow f(S, T) and capacity c(S, T) of a cut
• Augmenting Path: residual capacity of path p: cf (p)
• Max-Flow and Min-Cut
• Ford-Fulkerson Algorithm: time complexity
• Edmonds-Karp algorithm
• Algorithm implementation instance:
Figure 7: Algorithm implementation instance
• Maximum bipartite matching
11
2.4 Own summary of Qianxi Yang (HSB264)
2.4.1 Flow network and Max flow
A network is a directed graph G with vertices V and edges E connected with a
function c, and each edge e ∈ E has a non-negative integer value: the capacity
of e. and we also need to additionally label two vertices, one as the source and
one as the sink.
Beyond capacity, a flow in a flow network is a function f that again gives
each edge e a non-negative integer value, namely the flow. The function has to
fulfill the following two constraints: Capacity constraint and Flow conser-
vation, one makes sure that the flow of an edge cannot exceed the capacity,
and the other one makes sure that the sum of the incoming flow of a vertex v
has to be equal to the sum of the outgoing flow of v.
Figure 8: Flow network graph
The value of the flow of a network is the sum of all the flows that go through
at the source s, and the Max flow is to Find this maximal flow of a flow network.
2.4.2 Ford-Fulkerson method
First, we need to define the concept of residual capacity and augmenting
path, a residual capacity of a directed edge is the capacity minus the flow, and
the augmenting path is a simple path in the residual graph, i.e. along the edges
whose residual capacity is positive.
The Ford-Fulkerson method works as follows. First, we set the flow of each
edge to zero. Then we look for an augmenting path from s to t. If such a path
is found, we can increase the flow along these edges. Then we keep on searching
for augmenting paths and summing the flow. Once we could not find another
augmenting path, the flow is maximal.
2.4.3 Edmonds-Karp algorithm
Edmonds-Karp algorithm is just an implementation of the Ford-Fulkerson method
that uses BFS for finding augmenting paths.
12
References
[1] Thomas H.Cormen, Charles E.Leiserson, Ronald L.Rivest, Clifford Stein,
Introduction to Algorithms, third edition
13

More Related Content

Similar to aads_assignment1_answer-1.pdf

Sequential and parallel algorithm to find maximum flow on extended mixed netw...
Sequential and parallel algorithm to find maximum flow on extended mixed netw...Sequential and parallel algorithm to find maximum flow on extended mixed netw...
Sequential and parallel algorithm to find maximum flow on extended mixed netw...csandit
 
SEQUENTIAL AND PARALLEL ALGORITHM TO FIND MAXIMUM FLOW ON EXTENDED MIXED NETW...
SEQUENTIAL AND PARALLEL ALGORITHM TO FIND MAXIMUM FLOW ON EXTENDED MIXED NETW...SEQUENTIAL AND PARALLEL ALGORITHM TO FIND MAXIMUM FLOW ON EXTENDED MIXED NETW...
SEQUENTIAL AND PARALLEL ALGORITHM TO FIND MAXIMUM FLOW ON EXTENDED MIXED NETW...cscpconf
 
Design and Analysis of Algorithms Assignment Help
Design and Analysis of Algorithms Assignment HelpDesign and Analysis of Algorithms Assignment Help
Design and Analysis of Algorithms Assignment HelpProgramming Homework Help
 
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...AIRCC Publishing Corporation
 
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...ijcsit
 
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...AIRCC Publishing Corporation
 
Lecture_10_Parallel_Algorithms_Part_II.ppt
Lecture_10_Parallel_Algorithms_Part_II.pptLecture_10_Parallel_Algorithms_Part_II.ppt
Lecture_10_Parallel_Algorithms_Part_II.pptWahyuAde4
 
Transmission line By Lipun
Transmission line By LipunTransmission line By Lipun
Transmission line By LipunNanigopal Jena
 
Algorithm Design and Complexity - Course 12
Algorithm Design and Complexity - Course 12Algorithm Design and Complexity - Course 12
Algorithm Design and Complexity - Course 12Traian Rebedea
 
Minimum cost maximum flow
Minimum cost maximum flowMinimum cost maximum flow
Minimum cost maximum flowSaruarChowdhury
 
Litvinenko_RWTH_UQ_Seminar_talk.pdf
Litvinenko_RWTH_UQ_Seminar_talk.pdfLitvinenko_RWTH_UQ_Seminar_talk.pdf
Litvinenko_RWTH_UQ_Seminar_talk.pdfAlexander Litvinenko
 
CAPS_Discipline_Training
CAPS_Discipline_TrainingCAPS_Discipline_Training
CAPS_Discipline_TrainingHannah Butler
 
Relay Vehicle Formations for Optimizing Communication Quality in Robot Networks
Relay Vehicle Formations for Optimizing Communication Quality in Robot NetworksRelay Vehicle Formations for Optimizing Communication Quality in Robot Networks
Relay Vehicle Formations for Optimizing Communication Quality in Robot NetworksMd Mahbubur Rahman
 

Similar to aads_assignment1_answer-1.pdf (20)

Sequential and parallel algorithm to find maximum flow on extended mixed netw...
Sequential and parallel algorithm to find maximum flow on extended mixed netw...Sequential and parallel algorithm to find maximum flow on extended mixed netw...
Sequential and parallel algorithm to find maximum flow on extended mixed netw...
 
SEQUENTIAL AND PARALLEL ALGORITHM TO FIND MAXIMUM FLOW ON EXTENDED MIXED NETW...
SEQUENTIAL AND PARALLEL ALGORITHM TO FIND MAXIMUM FLOW ON EXTENDED MIXED NETW...SEQUENTIAL AND PARALLEL ALGORITHM TO FIND MAXIMUM FLOW ON EXTENDED MIXED NETW...
SEQUENTIAL AND PARALLEL ALGORITHM TO FIND MAXIMUM FLOW ON EXTENDED MIXED NETW...
 
Design and Analysis of Algorithms Assignment Help
Design and Analysis of Algorithms Assignment HelpDesign and Analysis of Algorithms Assignment Help
Design and Analysis of Algorithms Assignment Help
 
Daa chpater14
Daa chpater14Daa chpater14
Daa chpater14
 
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...
 
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...
 
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...
ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED ...
 
Lecture_10_Parallel_Algorithms_Part_II.ppt
Lecture_10_Parallel_Algorithms_Part_II.pptLecture_10_Parallel_Algorithms_Part_II.ppt
Lecture_10_Parallel_Algorithms_Part_II.ppt
 
Transmission line By Lipun
Transmission line By LipunTransmission line By Lipun
Transmission line By Lipun
 
Algorithm Design and Complexity - Course 12
Algorithm Design and Complexity - Course 12Algorithm Design and Complexity - Course 12
Algorithm Design and Complexity - Course 12
 
Chapter 25 aoa
Chapter 25 aoaChapter 25 aoa
Chapter 25 aoa
 
Minimum cost maximum flow
Minimum cost maximum flowMinimum cost maximum flow
Minimum cost maximum flow
 
Computer Network Homework Help
Computer Network Homework HelpComputer Network Homework Help
Computer Network Homework Help
 
Litvinenko_RWTH_UQ_Seminar_talk.pdf
Litvinenko_RWTH_UQ_Seminar_talk.pdfLitvinenko_RWTH_UQ_Seminar_talk.pdf
Litvinenko_RWTH_UQ_Seminar_talk.pdf
 
CAPS_Discipline_Training
CAPS_Discipline_TrainingCAPS_Discipline_Training
CAPS_Discipline_Training
 
flows.ppt
flows.pptflows.ppt
flows.ppt
 
PCA on graph/network
PCA on graph/networkPCA on graph/network
PCA on graph/network
 
Relay Vehicle Formations for Optimizing Communication Quality in Robot Networks
Relay Vehicle Formations for Optimizing Communication Quality in Robot NetworksRelay Vehicle Formations for Optimizing Communication Quality in Robot Networks
Relay Vehicle Formations for Optimizing Communication Quality in Robot Networks
 
Maxflow
MaxflowMaxflow
Maxflow
 
ershov911
ershov911ershov911
ershov911
 

Recently uploaded

GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in managementchhavia330
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Dave Litwiller
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageMatteo Carbone
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Dipal Arora
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communicationskarancommunications
 
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsCash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsApsara Of India
 
RE Capital's Visionary Leadership under Newman Leech
RE Capital's Visionary Leadership under Newman LeechRE Capital's Visionary Leadership under Newman Leech
RE Capital's Visionary Leadership under Newman LeechNewman George Leech
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Roland Driesen
 
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒anilsa9823
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Lviv Startup Club
 
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
Tech Startup Growth Hacking 101  - Basics on Growth MarketingTech Startup Growth Hacking 101  - Basics on Growth Marketing
Tech Startup Growth Hacking 101 - Basics on Growth MarketingShawn Pang
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Serviceritikaroy0888
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Delhi Call girls
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMRavindra Nath Shukla
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear RegressionRavindra Nath Shukla
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesDipal Arora
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.Aaiza Hassan
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Servicediscovermytutordmt
 

Recently uploaded (20)

GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in management
 
Nepali Escort Girl Kakori \ 9548273370 Indian Call Girls Service Lucknow ₹,9517
Nepali Escort Girl Kakori \ 9548273370 Indian Call Girls Service Lucknow ₹,9517Nepali Escort Girl Kakori \ 9548273370 Indian Call Girls Service Lucknow ₹,9517
Nepali Escort Girl Kakori \ 9548273370 Indian Call Girls Service Lucknow ₹,9517
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
 
Insurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usageInsurers' journeys to build a mastery in the IoT usage
Insurers' journeys to build a mastery in the IoT usage
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communications
 
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsCash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
 
RE Capital's Visionary Leadership under Newman Leech
RE Capital's Visionary Leadership under Newman LeechRE Capital's Visionary Leadership under Newman Leech
RE Capital's Visionary Leadership under Newman Leech
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...
 
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
 
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
Tech Startup Growth Hacking 101  - Basics on Growth MarketingTech Startup Growth Hacking 101  - Basics on Growth Marketing
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Service
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSM
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear Regression
 
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best ServicesMysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
Mysore Call Girls 8617370543 WhatsApp Number 24x7 Best Services
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Service
 

aads_assignment1_answer-1.pdf

  • 1. Home Assignment 1 Advanced Algorithms and Data Structure Siyi Wu KRW521 Zhongxing Ren CPJ395 Yu Pei MQH875 Qianxi Yang HSB264 December 6, 2022 1
  • 2. 1 Group Part 1.1 Answer of exercise 26.1-1 in CLRS Solution1: Suppose the maximum flow of a G = (V, E) is flow f, if after replacing (u,v) with new edges (u,x) and (x,v) and getting a new flow network G′ = (V ′ , E′ ), the flow conservation property still holds because the flow in and out of v1 and v2 do not change. Second, assume the number of cuts across the edge (u,v) in the original graph G is n. After splitting, there will be n cuts across the edge (u,x) and n cuts across (x,v). Since c(u, x) = c(x, v) = c(u, v), |f| = P v∈V f(s, v) remains the same. Therefore, the maximum flow of G′ = (V ′ , E′ ) remains the same as G. Solution2: Suppose the set of min-cut distinguished by G is S, T. If the min-cut edge does not contain (u, v) then u, v, x nodes are in S or in T. In this case, the capacity of the min-cut is not affected, that is, the maximum flow |f| remains unchanged. If the min-cut edge contains (u, v), then when the new node is added, there are two cases: 1. The new node x is added to S, then (x, v) replaces (u, v) when calculating the capacity of the cut, because c(u, v) = c(x, v) so the capacity of the cut remains the same and the maximum flow |f| is also the same. 2. The new node x is added to T, similarly (u, x) replaces (u, v), because c(u, v) = c(u, x) so the capacity of the cut capacity remains the same, and the maximum flow |f| remains the same. 1.2 Answer of exercise 26.1-4 in CLRS To prove that αf1 +(1−α)f2 is a flow, it must be shown to satisfy conservation of Capacity constraint and Flow conservation. Proof of Capacity constraint: First let f = αf1 + (1 − α)f2, so we have: ∀u, v ∈ V, f(u, v) = αf1(u, v) + (1 − α)f2(u, v) (1) And because the value domain of f1(u, v) is [0, c(u, v)], the value domain of f2(u, v) is [0, c(u, v)], and the value domain of α is [0, 1]. So the question be- comes a problem of finding the limit of a quadratic equation. When f1(u, v) and f2(u, v) both take c(u, v), f(u, v) has a maximum value over the domain of definition: fmax(u, v) = αc(u, v) + (1 − α)c(u, v) = c(u, v) (2) Similarly, when f1(u, v) and f2(u, v) both take 0f(u, v) has a minimum value 2
  • 3. over the domain of definition: fmin(u, v) = α × 0 + (1 − α) × 0 = 0 (3) Therefore the value domain of f is [0, c(u, v)]. Proof of Flow conservation: By definition, X v∈V f(v, u) = X v∈V (αf1(v, u) + (1 − α)f2(v, u)) = α X v∈V f1(v, u) + (1 − α) X v∈V f2(v, u) (4) X u∈V f(u, v) = X u∈V (αf1(u, v) + (1 − α)f2(u, v)) = α X u∈V f1(u, v) + (1 − α) X u∈V f2(u, v) (5) Because, α X v∈V f1(v, u) = α X u∈V f1(u, v) (6) And, (1 − α) X v∈V f2(v, u) = (1 − α) X u∈V f2(u, v) (7) Therefore, X v∈V f(v, u) = X u∈V f(u, v) (8) 1.3 Answer of exercise 26.1-7 in CLRS It is sufficient to use the following structure instead of each node in the original diagram. 3
  • 4. Figure 1: Substitution Structure Because in this structure, any flow passing through v must pass through the edges (vin, vout), in order to get from the edges going into v to the edges going out of v. Therefore, vin and vout are equivalent to bound together, and as long as the flow passes through vin, it must also pass through vout. In addition, the edge (vin, vout) only limits the node capacity and does not affect c(u, v) and c(v, u) in the original graph, so the maximum flow does not change as a result. Therefore G′ should have 2|V | nodes, |E| + |V | edges. 1.4 Answer of exercise 26.2-2 in CLRS The flow across the cut({s, v2, v4}, {v1, v3, t}) is: f(S, T) = f(s, v1) + f(v2, v1) + f(v4, v3) + f(v4, t) − f(v3, v2) = 11 + 1 + 7 + 4 − 4 = 19 The capacity of this cut is: c(S, T) = c(s, v1) + c(v2, v1) + c(v4, v3) + c(v4, t) = 16 + 4 + 7 + 4 = 31. 1.5 Answer of exercise 26.2-3 in CLRS The Edmonds-Karp algorithm is executed as follows. 4
  • 5. Figure 2: The execution of the Edmonds-Karp algorithm 5
  • 6. 1.6 Answer of exercise 26.2-4 in CLRS Figure 3: The minimum cut A minimum cut (S,T) is S = {s, v1, v2, v4} and T = {v3, t}. The capacity of this cut is c(S, T) = 12 + 7 + 4 = 23. The augmenting path in graph (c) cancels flow (v3, v2) in graph (a) and flow (v2, v1) in graph (b). 1.7 Answer of exercise 26.2-7 in CLRS Proof: Firstly, we prove that fp satisfies capacity constraint: Because cf (p) = min{cf (u, v) : (u, v) ∈ p} (p is the augmentation path in residual network), cf (p) ≤ cf (u, v), (u, v) ∈ p. So for (u, v) ∈ p, fp(u, v) = cf (p) ≤ cf (u, v). For (u, v) / ∈ p, fp(u, v) = 0 < cf (u, v). So for every edge (u,v) in residual network, fp(u, v) ≤ cf (u, v). So fp satisfies capacity constraint. Secondly, we prove that fp satisfies flow conservation: For u ∈ V − {s, t} in residual network, if u is on the augmentation path, then X v∈V f(v, u) = X v∈V f(u, v) = fp(u, v) = cf (p) (9) if u isn’t on the augmentation path, then X v∈V f(v, u) = X v∈V f(u, v) = 0 (10) So, for u ∈ V − {s, t} in residual network, the equation X v∈V f(v, u) = X v∈V f(u, v) (11) always holds. So fp satisfies flow conservation. So fp is a flow in residual network Gf , and |fp| = P v∈V f(s, v)− P v∈V f(v, s) = cf (p) > 0 6
  • 7. 1.8 Answer of exercise 26.2-9 in CLRS If both f and f’ are flows in a network G, then:    0 ≤ f(u, v) ≤ c(u, v) 0 ≤ f′ (u, v) ≤ c(u, v) (f ↑ f′ )(u, v) = f(u, v) + f′ (u, v) (12) where (u, v) ∈ E (E is the set of edge in network G), so 0 ≤ (f ↑ f′ )(u, v) ≤ 2c(u, v) (13) so the augmented flow doesn’t satisfy the capacity constraint and it can’t be regarded as a flow in network G. For f, the value of input flow of u (u ∈ V − {s, t}, V is the set of vertices of network G) equals to that of output flow of u. For f’, the value of input flow of u (u ∈ V − {s, t}, V is the set of vertices of network G) equals to that of output flow of u. So, for f ↑ f′ , the value of input flow of u (u ∈ V − {s, t}, V is the set of vertices of network G) equals to that of output flow of u. So the augmented flow satisfies the flow conservation. 1.9 Answer of exercise 26.3-2 in CLRS Proof: Here we use induction to prove the therom 26.10. After the first loop of Ford- Fulkerson, because capacity function c takes on only integral values and all f(u,v) ((u, v) ∈ E, E is the set of edge in network) in the flow network are initially 0, so the capability of every edge in residual network only takes integral values, so cf (p) (cf (p) = min{cf (u, v) : (u, v) ∈ p} where p is the augmentation path in residual network) takes on only integral values making all f(u,v) (u, v) ∈ E of the flow network after augmentation are integral values (line 5 to line 8 in FORD-FULKERSON). So |f| (|f| = P v∈V f(s, v) − P v∈V f(v, s)) takes on only integral values. Then, we assume that after nth loops, |f| and all f(u,v) ((u, v) ∈ E, E is the set of edge in network) of the flow network are all integral values. Next, because after nth loops |f| and all f(u,v) ((u, v) ∈ E, E is the set of edge in network) of the flow network are both integral values, in (n+1)th loop, the capability of every edge in residual network only takes integral values, so cf (p) (cf (p) = min{cf (u, v) : (u, v) ∈ p} where p is the augmentation path in residual network) takes on only integral values making all f(u,v) (u, v) ∈ E of the flow network after (n+1)th loop are integral values (line 5 to line 8 in FORD- FULKERSON). So |f| (|f| = P v∈V f(s, v)− P v∈V f(v, s)) also takes on only integral values after (n+1)th loop. So here we have proved that ”after each loop in FORD-FULKERSON |f| 7
  • 8. and all f(u,v) ((u, v) ∈ E, E is the set of edge in network) of the flow are all integers if the capacity function c takes on only integral values”. So, as the flow that after the final loop of FORD-FULKERSON, the maximum flow also has the fact that |f| and all f(u,v) ((u, v) ∈ E, E is the set of edge in network) of the maximum flow are all integers if the capacity function c takes on only integral values. 2 Own Summary of Each Group Member 2.1 Own summary of Siyi Wu (KRW521) 2.1.1 Flow network 1. Definition: G = (V, E) is a directed graph in which each edge (u, v) ∈ E has a nonnegative capacity c(u, v) ≥ 0. 2. Capacity constraint: ∀u, v ∈ V, 0 ≤ f(u, v) ≤ c(u, v) 3. Flow conservation: ∀u ∈ V − {s, t}, P v∈V f(v, u) = P v∈V f(u, v) 2.1.2 Residual networks & Cuts Residual networks cf (u, v) =      c(u, v) − f(u, v) if (u, v) ∈ E f(v, u) if (v, u) ∈ E 0 otherwise (14) (f ↑ f′ ) (u, v) = ( f(u, v) + f′ (u, v) − f′ (v, u) if (u, v) ∈ E 0 otherwise (15) Figure 4: Residual network and an Augmenting path 8
  • 9. Cuts f(S, T) = X u∈S X v∈T f(u, v) − X u∈S X v∈T f(v, u) (16) c(S, T) = X u∈S X v∈T c(u, v) (17) Figure 5: A minimum cut of a flow network 2.1.3 Ford-Fulkerson & Edmond-Karp Ford-Fulkerson algorithm 1. Definition: Ford-Fulkerson algorithm is a way to calculate the maximum flow. 2. Time complexity: O(E|f∗ |) 3. Depth first Edmond-Karp algorithm 1. Definition: Edmond-Karp algorithm is a modified algorithm of Ford- Fulkerson algorithm 2. Time complexity: O(V E2 ) 3. Breadth first 9
  • 10. 2.2 Own summary of Zhongxing Ren (CPJ395) • Start with a question: There are two cities: city A and city B, there is a road network between them, but each road has a capacity of transporting the goods, so how to transport the goods as much as possible from city A to city B is a question. − > Abstract to ”how to figure out the max flow in a flow network”. • Flow net work definition: Capacity constraint and Flow conservation • Using an hourglass-shape graph to introduce an intuitive equivalent rela- tion between value of max flow and minimum cut capacity. • Definition of augmentation flow: (f ↑ f′ ) (u, v) = ( f(u, v) + f′ (u, v) − f′ (v, u) if (u, v) ∈ E 0 otherwise (18) • Rigorous derivation: Augmentation flow (will be used in line 5 to line 8 in FORD-FULKERSON) − > |f| ≤ c(S, T) − > |f| rigorously increases after each loop until |f| = some c(S,T) (min of c(S,T)) − > f is the max flow and its value |f| = some c(S,T) (min of c(S,T)) • Definition of residual network: cf (u, v) =      c(u, v) − f(u, v) if (u, v) ∈ E f(v, u) if (v, u) ∈ E 0 otherwise (19) • More rigorous: Basic process of Ford-Fulkerson (augment flow in each loop until |f| = some c(S,T) (min of c(S,T))): building residual network − > finding augmentation path − > figuring out fp − > augment flow − > new loop until no augmentation path can be found in residual network, then we can get the max flow f and its value |f|. • A sample for implementing the Ford-Fulkerson algorithm and Edmonds- Karp algorithm Figure 6: algorithm implementation (Figure 26-7 in CLRS [1]) 10
  • 11. And it is also a good sample to introduce the consuming time (O(E|f∗ |) and O(V E2 )) of these two algorithms (DFS, BFS in searching the aug- mentation path in residual network) • Using of Max Flow: Maximum bipartite matching (adding source point and sink point additionally, unit capacity edges) 2.3 Own summary of Yu Pei (MQH875) • Flow network: two properties, |f| • Residual network Gf and residual capacity cf (u, v) of edge (u, v) • Cut: flow f(S, T) and capacity c(S, T) of a cut • Augmenting Path: residual capacity of path p: cf (p) • Max-Flow and Min-Cut • Ford-Fulkerson Algorithm: time complexity • Edmonds-Karp algorithm • Algorithm implementation instance: Figure 7: Algorithm implementation instance • Maximum bipartite matching 11
  • 12. 2.4 Own summary of Qianxi Yang (HSB264) 2.4.1 Flow network and Max flow A network is a directed graph G with vertices V and edges E connected with a function c, and each edge e ∈ E has a non-negative integer value: the capacity of e. and we also need to additionally label two vertices, one as the source and one as the sink. Beyond capacity, a flow in a flow network is a function f that again gives each edge e a non-negative integer value, namely the flow. The function has to fulfill the following two constraints: Capacity constraint and Flow conser- vation, one makes sure that the flow of an edge cannot exceed the capacity, and the other one makes sure that the sum of the incoming flow of a vertex v has to be equal to the sum of the outgoing flow of v. Figure 8: Flow network graph The value of the flow of a network is the sum of all the flows that go through at the source s, and the Max flow is to Find this maximal flow of a flow network. 2.4.2 Ford-Fulkerson method First, we need to define the concept of residual capacity and augmenting path, a residual capacity of a directed edge is the capacity minus the flow, and the augmenting path is a simple path in the residual graph, i.e. along the edges whose residual capacity is positive. The Ford-Fulkerson method works as follows. First, we set the flow of each edge to zero. Then we look for an augmenting path from s to t. If such a path is found, we can increase the flow along these edges. Then we keep on searching for augmenting paths and summing the flow. Once we could not find another augmenting path, the flow is maximal. 2.4.3 Edmonds-Karp algorithm Edmonds-Karp algorithm is just an implementation of the Ford-Fulkerson method that uses BFS for finding augmenting paths. 12
  • 13. References [1] Thomas H.Cormen, Charles E.Leiserson, Ronald L.Rivest, Clifford Stein, Introduction to Algorithms, third edition 13