Algorithm Design | Network Flow | Ford-Fulkerson Algorithm | MAXIMAL FLOW PROBLEM | MAX FLOW PROBLEM

EduSyl
11 Mar 202426:39

Summary

TLDRThis educational video delves into the Max Flow problem using the Ford-Fulkerson algorithm, a crucial concept in network flow. The script begins by explaining fundamental terms like source, sink, capacity, and residual capacity, essential for understanding network flow applications, such as water supply systems. The instructor illustrates the importance of maximum flow in practical scenarios and then outlines the steps of the Ford-Fulkerson algorithm, including assigning initial flow, selecting augmenting paths, and updating flow until no more paths can be found. The video provides a step-by-step example to find the maximum flow in a given network, focusing on non-full forward edges, and concludes with a summary of the algorithm's process and its application in solving network flow problems.

Takeaways

  • πŸ“š The video discusses the Max Flow problem using the Ford-Fulkerson algorithm, which is part of Network Flow.
  • πŸ” Prerequisites for understanding Network Flow include terms like source, sink, capacity, residual capacity, and augmented path.
  • πŸ’§ An analogy for Network Flow is provided using water pipes in a home, emphasizing the importance of proper flow management.
  • πŸš€ The importance of Network Flow is highlighted with examples from computer networks and everyday scenarios like water supply.
  • πŸ”‘ Key terms are defined: 'source' has no incoming edges, 'sink' has no outgoing edges, and 'bottleneck' refers to the limiting factor in flow.
  • πŸ”„ The Ford-Fulkerson algorithm involves assigning initial flow as zero, selecting augmenting paths, finding residual capacities, and updating the flow.
  • πŸ”’ Residual capacity is calculated as the original capacity minus the flow, determining how much more flow can be sent through a path.
  • πŸ” Augmenting paths are paths from source to sink with available capacity; they must be selected carefully to maximize flow.
  • πŸ” The algorithm continues until no more augmenting paths can be found with a residual capacity greater than zero.
  • πŸ“ˆ The maximum flow is determined by summing the flows through all the augmenting paths identified during the algorithm.
  • 🚫 The script specifies that backward edges are not considered in this particular example, focusing only on non-full forward edges.

Q & A

  • What is the main topic discussed in the video?

    -The main topic discussed in the video is the Max Flow problem using the Ford-Fulkerson algorithm.

  • What are the prerequisites for understanding the Network Flow?

    -The prerequisites for understanding Network Flow include terms such as source, sink, capacity, residual capacity, and augmented path.

  • Why is Network Flow important?

    -Network Flow is important because it is used in solving problems related to computer networks and can be likened to real-life scenarios such as water flow in a household system.

  • What does the term 'source' represent in Network Flow?

    -In Network Flow, the 'source' represents the starting point of the flow, similar to a water tank where water is stored and has no incoming edges.

  • What is meant by 'sink' in the context of Network Flow?

    -A 'sink' in Network Flow is the endpoint or destination where the flow terminates, having no outgoing edges.

  • Can you explain the concept of 'bottleneck capacity' in the video?

    -The 'bottleneck capacity' refers to the maximum flow that can pass through a particular path, similar to the narrow neck of a water bottle that restricts the flow.

  • What is an 'augmented path' in the Ford-Fulkerson algorithm?

    -An 'augmented path' in the Ford-Fulkerson algorithm is a path from the source to the sink in the residual graph that has a residual capacity greater than zero, allowing for an increase in the total flow.

  • How does the Ford-Fulkerson algorithm find the maximum flow?

    -The Ford-Fulkerson algorithm finds the maximum flow by iteratively finding augmenting paths in the residual graph and updating the flow along these paths until no more augmenting paths can be found.

  • What does 'residual capacity' mean in the context of the Ford-Fulkerson algorithm?

    -In the Ford-Fulkerson algorithm, 'residual capacity' refers to the remaining capacity of an edge after accounting for the current flow, which can be used to increase the flow from the source to the sink.

  • How is the initial flow assigned in the Ford-Fulkerson algorithm?

    -In the Ford-Fulkerson algorithm, the initial flow is assigned as zero for all paths in the network.

  • What is the significance of finding the minimum residual capacity in the algorithm?

    -The significance of finding the minimum residual capacity in the algorithm is to determine the amount by which the flow can be increased along the augmenting path, as it represents the bottleneck for that path.

  • How does the video script illustrate the concept of network flow?

    -The video script illustrates the concept of network flow by using the analogy of water flow in a household system, where the water tank is the source, the taps are the sinks, and the pipes represent the paths with their capacities.

Outlines

00:00

πŸ“š Introduction to Network Flow and Ford-Fulkerson Algorithm

This paragraph introduces the concept of network flow, which is essential for solving traffic problems in computer networks, using a relatable example of water flow in a home's plumbing system. The speaker explains the importance of proper flow and introduces key terms such as 'source', 'sink', 'capacity', 'residual capacity', and 'augmented path'. The paragraph sets the stage for a detailed discussion on the Ford-Fulkerson algorithm for finding the maximum flow in a network.

05:01

πŸ” Understanding Prerequisites for Network Flow

The speaker delves deeper into the prerequisites for network flow, emphasizing the significance of understanding terms like 'bottleneck capacity' and 'residual capacity'. The explanation of 'residual capacity' is illustrated with the analogy of a water bottle, where the narrow neck represents the limiting factor in flow. The paragraph also introduces the concept of an 'augmenting path', which is crucial for the Ford-Fulkerson algorithm, and distinguishes between two types: those with only forward edges and those with a combination of forward and backward edges.

10:02

πŸ›  Steps of the Ford-Fulkerson Algorithm

This paragraph outlines the steps involved in the Ford-Fulkerson algorithm. It begins with assigning an initial flow of zero to all paths in the network. The speaker then explains the process of selecting an augmenting path from the source to the sink, calculating the residual capacity of this path, and updating the flow. The algorithm continues this process, finding new augmenting paths and updating flows until no more can be found, indicating that the maximum flow has been reached.

15:05

πŸ”„ Application of Ford-Fulkerson Algorithm to a Sample Problem

The speaker applies the Ford-Fulkerson algorithm to a sample problem, explaining how to assign initial flows, select augmenting paths, and calculate residual capacities. The paragraph provides a step-by-step guide on how to update the flow through the network based on the minimum residual capacity found in an augmenting path. It also discusses the concept of non-conflict paths and how to manage the flow to ensure that the network operates efficiently.

20:07

πŸ“‰ Continuing the Ford-Fulkerson Algorithm with Residual Capacities

This paragraph continues the application of the Ford-Fulkerson algorithm, focusing on the importance of residual capacities in finding new augmenting paths. The speaker demonstrates how to calculate and compare residual capacities to select the path that will contribute to the maximum flow. The explanation includes updating the flow through the network and marking paths that can no longer be used when their residual capacity reaches zero.

25:10

🏁 Conclusion and Final Calculation of Maximum Flow

In the final paragraph, the speaker concludes the Ford-Fulkerson algorithm by summing up the residual capacities collected throughout the process to determine the maximum flow. The paragraph emphasizes the importance of following the algorithm's steps carefully to ensure accurate results. The speaker also hints at the next topic to be covered in the series, which involves mean cut and its relation to maximum flow.

Mindmap

Keywords

πŸ’‘Network Flow

Network Flow is a concept that models the movement of resources through a network, such as water through pipes or data through computer networks. In the context of the video, it is the main theme and refers to the process of finding the maximum amount of flow from a source to a sink in a network while adhering to the capacities of the edges. The script uses the analogy of water flow in a home to explain the concept, emphasizing the importance of proper flow management.

πŸ’‘Ford-Fulkerson Algorithm

The Ford-Fulkerson Algorithm is a method used to compute the maximum flow in a flow network. It works by finding augmenting paths in the residual graph and augmenting the flow along these paths until no more augmenting paths can be found. The video script discusses this algorithm in detail, explaining its steps and how it is applied to solve network flow problems.

πŸ’‘Source

In network flow, the Source is the starting point of the flow, where resources originate. The script mentions the Source (represented as 's') as the point from which the flow begins, using the water tank analogy to illustrate that water is stored in the tank and flows out through pipes to various destinations.

πŸ’‘Sink

The Sink, also referred to as the destination, is the endpoint of the flow in a network. It is where the flow terminates, and no outgoing edges are present from the Sink. The script uses the Sink (represented as 't') to illustrate the end of the flow path, like a tap where water is used.

πŸ’‘Capacity

Capacity in the context of network flow refers to the maximum amount of flow that a particular edge or pipe can handle. The script explains capacity by comparing it to the size of a water bottle's neck, which limits the rate at which water can be consumed, thereby setting a limit on the flow.

πŸ’‘Residual Capacity

Residual Capacity is the remaining capacity of an edge after accounting for the current flow. It is used to determine how much more flow can be sent through a particular path. The script discusses how residual capacity is calculated by subtracting the flow from the original capacity and emphasizes its importance in the Ford-Fulkerson Algorithm.

πŸ’‘Augmenting Path

An Augmenting Path is a path from the Source to the Sink in the residual graph that has a positive residual capacity. The Ford-Fulkerson Algorithm uses these paths to increase the total flow. The script explains that finding an augmenting path is a key step in the algorithm, and it uses the term 'augmented' to refer to a path that has been used to increase flow.

πŸ’‘Flow

Flow represents the movement of resources through the network. In the script, flow is initially set to zero and is incrementally increased by finding augmenting paths. The video uses the term to describe the amount of resource (like water or data) that is being transferred through the network.

πŸ’‘Prerequisites

The term Prerequisites in the script refers to the fundamental concepts or terms that must be understood before delving into the details of the Ford-Fulkerson Algorithm. These include understanding the Source, Sink, capacity, residual capacity, and augmenting path, which are essential for grasping how the algorithm works.

πŸ’‘Non-full Forward Edges

Non-full Forward Edges are edges in the residual graph that have a positive residual capacity and can therefore be used to increase the flow. The script specifies that the algorithm will consider non-full forward edges, meaning edges that still have capacity available for additional flow, when searching for augmenting paths.

Highlights

Introduction to the Max Flow problem using Ford-Fulkerson algorithm.

Explanation of prerequisites for Network Flow, including terms like source, sink, capacity, residual capacity, and augmented path.

Importance of Network Flow in traffic solving problems and computer networks, with a practical example of water flow in a home.

Definition of source and sink in the context of Network Flow.

Concept of bottleneck capacity and its comparison to the size of a water bottle's neck.

Explanation of residual capacity as original capacity minus the current flow.

Discussion on augmenting paths, including non-full forward edges and the importance of selecting the minimum residual capacity.

Step-by-step guide on how to implement the Ford-Fulkerson algorithm, starting with assigning an initial flow of zero.

Selection of an augmenting path and the process of finding the residual capacity to update the flow.

Strategy for stopping the algorithm when the residual capacity of a path becomes zero, indicating no further flow is possible.

Example problem demonstration of finding the maximum flow in a given network using Ford-Fulkerson algorithm.

Process of updating the flow through each edge in the network based on the selected residual capacity.

Illustration of how to handle multiple paths and the selection of paths with non-conflicting minimum residual capacities.

Final calculation of the maximum flow by summing up all the residual capacities collected during the algorithm's execution.

Conclusion and summary of the Ford-Fulkerson algorithm's steps and its application in finding the max flow.

Preview of the next topic, mean cut, and its relation to max flow.

Transcripts

play00:00

hello students welcome to ucil in this

play00:02

video we are going to discuss about Max

play00:05

flow problem using Ford Focus and

play00:07

algorithm it's a part of our Network

play00:10

flow before going in detail about the

play00:12

algorithm we should know the

play00:14

prerequisites of network flow here in

play00:17

this network flow uh we have certain

play00:19

prerequisites or you can say terms to be

play00:23

known named our sorts syn buttoning

play00:26

capacity residual capacity augmented

play00:29

path these are certain terms which we

play00:31

will be using throughout while solving

play00:34

the

play00:35

problem uh before going in detail about

play00:37

the algorithm one more thing we should

play00:40

know why netf flow is important for this

play00:43

algorithm and what is this basically so

play00:46

Network flow uh in general term I must

play00:49

say we have used in our traffic solving

play00:54

problems in uh computer networks or else

play00:58

you can say a simple example nowadays we

play01:00

are providing is like uh we are having

play01:03

uh water tabs in our home okay so where

play01:07

we're staying that we are having the

play01:09

tabs and the problem is like it's stored

play01:12

like the water tank is there on the top

play01:14

of it there are definitely so many pipes

play01:16

are getting connected but whenever we

play01:19

need it the flow should be a proper flow

play01:23

we should uh be uh you know really

play01:26

interested for like the profer flow in

play01:28

the sense like if you going for a PA so

play01:30

in that sense what exactly does like uh

play01:34

if the flow of the water okay if you're

play01:37

using sour there suppose uh if your flow

play01:41

is not that much adequate or might be

play01:44

that it's not a proper flow which you

play01:46

are expecting it's not a proper flow uh

play01:49

there while you using sink or might be

play01:52

you can say s suppose you are going to

play01:54

take it and it's not a proper flow that

play01:57

time what happen like the definitely the

play01:59

tank is on the the above of it above of

play02:01

any roof so what it does like there are

play02:03

many connections okay from uh the tank

play02:07

to the uh tab okay so tank is the source

play02:11

there and you have the tab with you

play02:14

which is a syn let us take an example of

play02:16

syn why I'm using these terms because

play02:19

these terms are going to be used in this

play02:21

network flow so the flow should be

play02:23

proper that's why we are reading it as

play02:26

maximum flow means we may say it's a

play02:29

flow but maximum means as for our

play02:31

requirement we are getting it that's why

play02:33

we are saying it's a Max flow okay

play02:35

insert we are saying it's Max flow but

play02:38

uh if I'll say it's a maximum flow also

play02:41

it's correct okay so sorts is something

play02:44

where uh we do not have any inward edges

play02:47

only outward edges would be there like

play02:49

IND degree is zero means not towards

play02:52

anything like you know if I told you

play02:54

like you just think the example of the

play02:57

water tank water tank we will store the

play03:00

water there there is no other path to be

play03:03

connected only one path might be you can

play03:05

consider those a practical problem

play03:07

definitely we are storing the water

play03:10

there that's why we need one pipe or two

play03:12

pipes Max to Max but from there whenever

play03:15

we are expecting the water should be

play03:17

utilized by us that time we shouldn't

play03:20

take any other path because we are

play03:22

storing the water there so here also we

play03:24

are thinking the sours okay next sink

play03:29

you can say destination also as a part

play03:31

of syn where out degree is zero means no

play03:34

such out degree will expect there only

play03:36

this is the end point okay next bottling

play03:39

capacity and residual capacity which is

play03:41

much needed to understand it well why

play03:44

because bottling

play03:46

capacity uh you just think like we have

play03:49

a water bottle so water bottle

play03:51

definitely the mouth of the ble could be

play03:55

smaller why because we need a flow might

play03:59

be you can think it's a Max flow but

play04:00

whenever we are taking that one so the

play04:03

bottle or the neck of the bottle should

play04:05

be slow or the narrow as compared to the

play04:08

body of the bottle or might be sometimes

play04:11

you have seen like the still for all the

play04:13

cases like the the opening mouth with

play04:16

the body is also same not an issue but

play04:19

we are talking about those bottles who

play04:21

having the neck is small in size why

play04:24

because it's easy for us to intake it

play04:26

well okay so that is why we are focusing

play04:28

on the capacity though we are focusing

play04:31

on the pipes based on the pipes like the

play04:33

capacity is good so definitely the flow

play04:36

is also we will expect in a good way

play04:38

sometimes the pipes are bigger sometimes

play04:40

the pipes are also smaller okay so that

play04:43

is what exactly the buttling capacity is

play04:45

if any uh you know there is a path like

play04:49

we can have source to might be there are

play04:52

many distances if you have syn syn is

play04:55

represented as T in our book okay source

play04:58

is represented as s this is not always

play05:00

correct but SD we are representing as

play05:03

for the book in future there are certain

play05:06

uh contents you can expect like SD Cod

play05:10

there are many Concepts out there that's

play05:11

why I'm representing it from s to D okay

play05:15

next residual capacity residual capacity

play05:17

some capacity you can say like we have

play05:20

certain original capacity of the of like

play05:22

whenever we'll go in detail that could

play05:24

be very much easy for us to understand

play05:26

before that we just discussing about

play05:28

what are the prerequisites to be know

play05:29

okay like residual capacity which is

play05:32

like original capacity with the current

play05:34

flow whenever we are writing it so the

play05:36

flow should be written in this order

play05:39

this way flow will be in the right left

play05:42

hand side and the right hand side will

play05:44

be the capacity capacity or you can say

play05:47

it's the original capacity original

play05:50

capacity original capacity of what like

play05:52

the path or the pipe you can say Okay

play05:55

flow this side original capacity will be

play05:58

the right hand side next augmenting path

play06:00

or augmented path once we have done the

play06:03

proper flow we can say it's augmented

play06:05

path as for the English okay but

play06:07

whenever we are not doing it or mightbe

play06:09

we are in a processing we can say it's

play06:11

augmenting path there are two types of

play06:13

augmenting path one is nonone full

play06:16

forward edges you can say there is only

play06:18

forward edges okay from

play06:21

s2t uh

play06:24

s2t next nonempty backward like you can

play06:28

expect the backward from any point

play06:30

suppose this is R from R you can expect

play06:33

some back Wes there are also

play06:35

combinations of this also possible but

play06:38

right now in our example we'll be

play06:39

focusing on non full forward ages okay

play06:43

let us start with the for Fulon

play06:44

algorithm here the solution steps I have

play06:47

written for you as for the solution step

play06:49

first we will understand how it is

play06:51

running once it is done then we'll be

play06:53

focusing on our one of the problems once

play06:55

it is easy for you to understand then we

play06:58

can say all over the IDE idea like which

play07:00

we are targeting to read it using the

play07:02

for focus and algorithm finding the max

play07:04

flow that's could be easy for us once we

play07:07

complete this algorithm steps uh with

play07:09

the implementation of it okay so step

play07:12

one assign initial flow of zero whenever

play07:15

we have uh like question I'll be having

play07:18

the next slide I'll show that one but

play07:20

still the steps we should know first

play07:22

what it represents like assign all the

play07:25

initial flow as zero next is select any

play07:28

augment path you can say it's augmenting

play07:31

sometimes also you can see it like

play07:34

augmenting and augmenting the main

play07:36

reason actually why I'm using this as

play07:38

augmented once uh the path we have

play07:40

selected once we have the residual

play07:42

capacity of any once you have selecting

play07:44

any path like from source to destination

play07:47

so that path is considered as augmented

play07:49

path this path should be having the

play07:52

connection from source to destination is

play07:54

called as augmented path otherwise we

play07:57

cannot say any path as augmented path if

play07:59

the path is considering source to

play08:02

destination only so this is what it is

play08:04

representing okay source to sync okay so

play08:07

once the path connected the connected

play08:09

paths are from source to sync we have

play08:12

then we say it's augmented path if we

play08:15

doing work on this so we can say it's

play08:17

augmenting path once it is done we say

play08:19

it augmented path okay so find the

play08:22

residual capacity and upgrate the final

play08:25

flow as previous flow whatever the

play08:27

previous flow you have with a current

play08:30

residual capacity or you can say I'm

play08:33

just saying it in a residual okay like

play08:36

we should know why it is important so

play08:38

that's why I kept bold it uh next of

play08:42

that agented part next step three we

play08:44

will be resting the path if the residual

play08:47

capacity of the selected path is zero

play08:50

means we will be like you can say if in

play08:53

a class in a class uh if a teacher is

play08:56

teaching you mightbe he or see knows it

play08:59

well like how much assignment we can

play09:01

give as a just for a you know you can

play09:05

say the people will understand like

play09:07

suppose uh let us take your your faculty

play09:10

is giving you two assignments uh for one

play09:13

week okay so it's good enough to tackle

play09:17

all the problems if you can think for

play09:19

each day two two different different

play09:21

assignments have been given to you so

play09:24

that could create a pressure this is

play09:26

what uh management of pressure is all

play09:29

about the network flow we reading that

play09:31

one only okay so a residual capacity

play09:34

like What's Your Capacity suppose you

play09:36

can do uh you can read up to four hours

play09:39

suppose for a day okay so the

play09:42

assignments have been given to you the

play09:44

assignments will take two hours so

play09:46

definitely you have two Ledger hours for

play09:47

other studyed okay or other study is

play09:50

like you know study material you can go

play09:52

for or might be network uh through

play09:54

internet you can serve just think about

play09:57

like you have four RS for the study you

play10:00

can dedicate Max to max four arts and

play10:02

four Arts is given for the

play10:04

assignments so the residual capacity is

play10:06

zero means you do not have any other

play10:08

Arts to recaf other subjects to okay

play10:12

this is what the problem is we are

play10:14

actually trying to release our pressure

play10:17

this is what exactly we're doing in our

play10:18

Network flow okay so step four what it

play10:22

has step two and step three we will be

play10:24

continuing until the flow from the

play10:27

source to sync is is having the residual

play10:30

capacity as zero until that we will be

play10:33

running it like each path we have to

play10:35

focus like from source to syn whatever

play10:38

the path that we are having if we'll cut

play10:41

all the sours as residual capacity as

play10:43

zero then we say we stopped here because

play10:45

from Source we can expect there is a

play10:48

flow okay if Source the path which are

play10:50

connected immediate connection to the

play10:52

source if the paths are having residual

play10:56

capacity as zero then we cannot flow it

play10:58

this is what the for focus and algorithm

play11:00

says okay now we'll focus on a question

play11:03

how we'll be going to solve it once it

play11:05

is uh being understood by you then uh

play11:09

you can say we have completed this

play11:11

network Flow by finding the four FAL and

play11:14

algorithm uh see these are question uh

play11:17

with you can say you can expect in this

play11:19

order or else a table will be given to

play11:22

you where the paths are get like parts

play11:25

are given with the capacity might be

play11:28

okay

play11:29

so here as for the question we have the

play11:31

graph with us and the question is

play11:34

written find the maximum flow or Max

play11:36

flow through the given network using for

play11:39

focus and algorithm considering non full

play11:41

forward edges here no backward edges are

play11:43

considered So based on a non full

play11:45

forward edes how we'll find out the max

play11:49

flow okay so as I said in the step one

play11:54

assign all the flow initial flow as zero

play11:57

okay so you can check

play12:00

whenever we are writing the original

play12:02

capacity will be always the right hand

play12:04

side of it okay so always will keep the

play12:07

right hand side as our original capacity

play12:13

and the left hand side is considered as

play12:15

the flow of the path of flow of the

play12:19

network

play12:21

okay initially we said it is zero for us

play12:25

okay I'll change the color when I

play12:28

picking one by one

play12:29

I'll be changing the color I'm writing

play12:32

here as augmented

play12:35

path augmented

play12:40

path next is a residual

play12:49

capacity why I'm saying residual

play12:51

capacity I'll be telling you that one

play12:54

bottl capacity how do we find so the

play12:57

bottl could be found out if the flow is

play12:59

zero initially if the flow is zero there

play13:02

is the capacity is 10 here the capacity

play13:05

is four here the capacity is 10 so the

play13:07

augmented path is this one is considered

play13:10

as the augmented path there are many

play13:12

augmented path could be formed not an

play13:14

issue if the source and sync is there in

play13:17

a path we will say it's augmented path

play13:20

this is considered as a augmented

play13:24

path okay there are many augmented path

play13:27

could be possible if source in could be

play13:29

there then we can say it's a augmented

play13:31

path then the capacity is given to us as

play13:34

10 41 so the minimum capacity which is

play13:37

four is considered as our but

play13:43

capacity okay we can say it's a but

play13:46

capacity but the initial flow should be

play13:48

zero then only we can say it's a but

play13:50

capacity then for the residual capacity

play13:53

how do we find Initial it is zero so for

play13:56

this the residual will be 10 which which

play13:58

is the original capacity minus the flow

play14:00

is zero so the residual capacity I'm

play14:03

saying it is RC residual capacity is z

play14:06

10 why because 10 minus capacity minus

play14:10

flow will be a residual capacity here

play14:13

the residual capacity is four here the

play14:15

residual capacity is 10 so out of this

play14:18

the minimum residual capacity will be

play14:19

considered as four so we can say the

play14:22

minimum capacity residual capacity will

play14:24

be uh selected okay this is how we will

play14:28

be knowing the concept So based on the

play14:31

uh idea we first uh you know the

play14:33

prerequisites which we studied first

play14:36

we'll complete this

play14:38

one then only we go in depth of this

play14:42

problem it's done now argumented path

play14:46

like you can have a table might be the

play14:48

table could be having uh four five rows

play14:52

based on the augmented path which you

play14:53

have selected so I'm just creating it in

play14:56

such way which might be helpful for us

play14:59

in future so uh whenever I'm picking so

play15:01

I'm just changing the color here

play15:04

initially I'm I'm just picking this as

play15:07

green so whenever you are finding the

play15:09

answer you always think the source to

play15:12

syn the best way is this one and this

play15:16

one okay so you can do one by one okay

play15:20

uh so this would be better like why

play15:22

because whenever we do not have any

play15:24

conflict here also we can expect no

play15:26

conflict whenever we are finding you

play15:29

just remember the minimum capacity which

play15:32

is four will be selected why because the

play15:34

residual capacity is zero each augmented

play15:37

path whenever we are finding always the

play15:39

residual capacity of any path will be

play15:41

zero we'll be finding out you can check

play15:43

here I'm just putting it green so I'll

play15:46

start the flow finding the flow there

play15:49

here I'm finding the flow out of this

play15:52

whichever the minimum residual capacity

play15:54

we found we have to select this one so s

play15:59

then a then B then T this is what the

play16:04

augmented path is so the minimum

play16:06

residual capacity is 4 here we can find

play16:10

because 10 4 10 the minimum is 4 so what

play16:14

we have to do we have to add it it is

play16:16

written there so what we have to do

play16:19

previous flow plus current residual

play16:21

capacity previous flow was

play16:23

Zero current residual capacity is four

play16:26

so total flow will be four

play16:29

this is what how we can find it out

play16:32

previously the flow was zero and the

play16:34

residual capacity we have selected is

play16:36

four that's why it is updated as

play16:39

four

play16:41

okay is updated as four here also it is

play16:45

updated as four why because previous

play16:47

flow plus selected residual capacity

play16:50

will be considered as the current flow

play16:52

of this augmented clth so here I will

play16:55

say the residual capacity is 4 now okay

play16:58

you you could have to write it but

play16:59

capacity not an issue if it initial uh

play17:02

flow is zero you can write it butl

play17:05

capacity sometimes we'll expect the

play17:07

repetion of it that's why we can say we

play17:10

have to stop there okay by saying uh

play17:13

butling capacity here 4 - 4 is 0 that's

play17:18

why we said we just put a circle by

play17:21

making it this path could not be uh used

play17:24

further why because the residual

play17:25

capacity is zero you can say you can

play17:27

read up to 4 4 hours and if four hours

play17:30

is given as an assignment you cannot

play17:32

flow like other students are having like

play17:34

a to A and B to T there are two

play17:36

different students who are having their

play17:38

dedicating 10 hours for study and you

play17:40

are dedicating 4 hours of study so the

play17:43

capacity we have to maintain like 4

play17:45

hours only if I'll enhance it so you

play17:48

cannot you know overcome it because our

play17:51

Target is the pipe shouldn't be brushed

play17:53

the pipe should have its own capacity

play17:55

Max to Max this much capacity could be

play17:57

available not not not an issue for us if

play18:00

I'll say No 5 hours of assignments you

play18:03

have to do by any means there is certain

play18:05

rules now you cannot go ahead of it you

play18:08

have dedicated 4S means the 4S will be

play18:10

dedicated to you uh the study whatever

play18:13

the thing is that you have decide it Tak

play18:15

4 hours means 4 hours but within the 4S

play18:17

if I'll be doing so this is how we are

play18:19

releasing the pressure or we are

play18:21

managing the pressure okay so for this

play18:23

augmented path we said residual capacity

play18:26

is zero for here the residual capacity

play18:28

will be considered as a original

play18:29

capacity minus the flow which we

play18:32

selected is this is what our residual

play18:35

capacity which is RC now residual Capac

play18:38

based on the residual capacity we'll be

play18:39

doing but initially what we are doing we

play18:42

are focusing on non-conflict one okay

play18:46

like here the first one will be

play18:47

non-conflict for us then this one also

play18:50

non-conflict for us here the minimum we

play18:53

have like 9 is a minimum why because 10

play18:55

10 and 9 the minimum will be selected

play18:58

okay so whenever we added to the flow

play19:01

here this will be added to previous flow

play19:04

plus the selected residual capacity

play19:06

which is nine then you put nine here

play19:08

okay so I'm just cutting this one always

play19:11

you write in this like you cut this and

play19:14

you write it nine the main reason of

play19:16

writing this means you are updating the

play19:19

flow okay this is what we are doing or

play19:22

else I could have to write by omitting

play19:24

this no this is not correct okay because

play19:27

as for the rule which is defined we

play19:29

should have to follow that

play19:32

one so the augmented path is s to C then

play19:37

D then T the total residual capacity is

play19:41

considered as N9 here as I told you

play19:45

whenever we are selecting augmented path

play19:47

definitely any of these paths like four

play19:50

paths could be selected five paths could

play19:52

be selected definitely one augmented

play19:54

means definitely the residual capacity

play19:57

of any path could would be zero more

play19:59

than one or at least one definitely will

play20:01

have the residual capacity of zero here

play20:03

you can say 9 - 9 the capacity minus

play20:07

flow is zero that's why what we did like

play20:09

we put a circle like we'll not choose

play20:12

further because through this we cannot

play20:14

go ahead like here there are three

play20:16

students 9 RS is the maximum RS for a

play20:18

student like he or she cannot go further

play20:21

but other students have 10s so we cannot

play20:23

follow the 10 Hearts we could have to

play20:25

like manage the pressure so definitely

play20:28

follow the last one okay whenever the

play20:30

class is running smooth if all the

play20:33

students will understand that doesn't

play20:34

mean that only fast Venture students

play20:36

will understand or second Venture

play20:38

students will understand this is not

play20:39

what we have to do we have to go for

play20:41

like whatever the students are like 18

play20:44

students or 20 students if all student

play20:47

will understand then only we can go

play20:48

ahead this is what the releasing of

play20:51

pressure or maintaining of a class okay

play20:54

next we have done this argumented path

play20:57

now I'm changing the

play21:01

color you can check path could be

play21:04

established like based on the residual

play21:06

right now we are working with the

play21:07

initial zero now Fe started from source

play21:10

to whether we have to like we have to

play21:13

find whether there is any other path

play21:15

could be established or being possible

play21:17

or not here the residual capacity we

play21:20

have to always keep in mind here the

play21:21

residual capacity is six I'm just saying

play21:25

the residual capacity by a color

play21:27

whenever I'm doing the finding out the

play21:29

residual capacity 10 - 4 is 6 is our

play21:32

residual capacity here the residual

play21:34

capacity is 8 - 0 is 8 here the residual

play21:38

capacity like from this it could be a

play21:40

possible Direction so from this we can

play21:43

write 6 - 0 is 6 okay so here the

play21:47

residual capacity we can expect is 10 -

play21:49

4 which is 6 so out of this 6 8 6 then

play21:54

six out of this we have the minimum one

play21:56

which is six that that's why we are

play21:58

focusing on the residual that's why I'm

play22:00

writing it here as residual otherwise I

play22:02

could have the option to write it water

play22:04

leg we will work first time second time

play22:07

it up to you like we can work with the

play22:09

but like not an issue but further

play22:12

directions of further finding the

play22:13

argumented PA is based on the residual

play22:16

capacity that's why I'm writing the

play22:17

residual capacity in this side okay so

play22:20

whenever we are going to choose this one

play22:23

we have to first find out the residual

play22:25

capacity so the residual capacity is 10

play22:28

- 4 like original of capacity minus the

play22:32

flow okay so that's why I have to select

play22:35

the minimum one the minimum you can take

play22:37

is this six okay or else if you have any

play22:43

doubt you can check other paths too

play22:46

clear so other paths suppose other paths

play22:48

you are going to check this one also a

play22:50

path could be established but here I

play22:52

have selected this one so that's why I'm

play22:54

following this path right now we have

play22:57

the minimum be six I'm just using this

play23:00

one as a row for us next this next this

play23:06

next this this is on path we have

play23:10

selected S2

play23:12

a then a to T then b b to T there are

play23:18

four 1 2 3 4 four edges are there so the

play23:23

residual capacity we have selected is

play23:25

six okay once we have selecting what we

play23:28

are doing you just check

play23:33

it what the residual capacity we

play23:35

selected is 6 4 + 6 is 10 we have to

play23:41

write there as 10 the updating value is

play23:44

10 now

play23:47

okay next it's previously it was Zero

play23:52

now it will be updated as 6 0 + 6 is 6 6

play23:57

is the flow now now

play24:01

next here is zero previously existing

play24:05

now we put six here previously it was

play24:09

four now it will be considered as 10 why

play24:12

because current residual capacity which

play24:15

you found are definitely the previous

play24:18

low will be added so here 10 10 we found

play24:23

res capacity here we found res capacity

play24:26

zero here we found residual capacity as

play24:29

zero I said you know one example I have

play24:32

given through which I said definitely

play24:36

whenever we found an augmented path

play24:38

there at least one path is considered as

play24:43

the residual capacity is having zero

play24:45

residual capacity having zero means we

play24:47

cannot go further we cannot accommodate

play24:50

further we cannot flow further with the

play24:52

capacity is finalized as for the

play24:54

capacity we made the flow more than

play24:57

capacity flow could not be there like

play24:59

like you say suppose capacity is six the

play25:02

flow could not be seven for each path

play25:04

definitely we have to keep in mind so

play25:06

here in this path which we found is and

play25:09

now changing the

play25:16

color okay this is what we found as our

play25:20

augmented paths and if you have any

play25:23

doubt like can we do further you can

play25:25

check here is the residual capacity is

play25:26

one here's resal capacity Zero from here

play25:29

I can switch but from here only one path

play25:32

is there through which we can reach to

play25:34

SN so augmented path could not be formed

play25:37

that's why we have to stop it clear once

play25:39

we are stopping like to find Max

play25:42

flow Max flow or maximum flow the answer

play25:47

could be the augmented for the residual

play25:49

uh the sum sum of all the residual

play25:51

capacity which you have collected

play25:54

4 + 9 +

play25:58

6 total is 19 this is what the answer is

play26:04

the max flow or maximum flow we can find

play26:08

in this uh directions first we'll keep

play26:10

an augmented path whether the augmented

play26:13

path could be formed well if is the

play26:15

residual capacity will focus the minimum

play26:18

residual capacity will be selected okay

play26:21

this is how we have completed the for

play26:23

Focus an algorithm and we can find out

play26:25

the max flow the next video we have like

play26:28

mean cut and how through mean cut how

play26:30

we'll say the mean cut will be the max

play26:32

FL so I hope it is understood by you so

play26:35

thank you for watching have a good day

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Network FlowFord-FulkersonAlgorithmMax FlowResidual CapacityAugmented PathComputer NetworksEducationalTutorialFlow Problems