Flow network graph definition
A flow network is built on a directed graph with the restriction . The lecturer says antiparallel edges are disallowed to simplify equations and presents this as a mild assumption.
Udacity · YouTube · 2:16
This 136-second whiteboard lecture introduces flow networks from the ground up. It first defines the underlying directed graph and excludes antiparallel edges. It then distinguishes a source s, a sink t, and internal vertices, assuming no edges enter s and no edges leave t. Next, the lecturer defines a capacity function C on vertex pairs, illustrated by red numbers on a sample graph, and then defines a flow function f with constraints and . Conservation of flow at internal vertices is introduced via f^{in}(u)=f^{out}(u), with a spoken numerical check at one vertex. The segment closes by defining the value of a flow as |f|=f^{out}(s)=f^{in}(t).
Use the learning inspector for key ideas and moments, or open the reading tabs for the complete notes.
Generated from the video's visuals and explanation; not verbatim speech.
The lecture opens by defining a flow network through its underlying structure: a directed graph , with the explicit rule . The speaker says this removes antiparallel edges mainly to simplify later equations.
Next, two special vertices are introduced. The leftmost vertex is labeled , the source, and the rightmost is labeled , the sink; all remaining vertices are called internal. The board adds the boundary condition , matching the spoken assumption that nothing enters and nothing leaves .
The lecturer then attaches a capacity to every ordered pair of vertices via , with when . On the example graph, red numbers on the edges visualize these capacities, and the speaker notes that integer capacities are a temporary simplifying assumption.
After that, the flow itself is defined as a function . Two pairwise constraints are written and explained: , so flow never exceeds capacity, and , so at least one direction between any pair carries zero flow. Blue numbers are added beside the red ones to show a concrete flow assignment.
The next step is conservation at internal vertices. The board defines and , then requires for internal . The lecturer checks this on the example by saying one node has coming in and going out, both totaling , and explains intuitively that internal nodes cannot generate or absorb flow.
Finally, the segment defines the value of the whole flow in a boxed formula: . This ties the earlier definitions together by measuring the network output at the source and equivalently the input received at the sink.
A flow network is built on a directed graph with the restriction . The lecturer says antiparallel edges are disallowed to simplify equations and presents this as a mild assumption.
The network distinguishes a source and a sink , with all other vertices called internal. The video also assumes no edge enters and no edge leaves .
Every ordered pair of vertices has a capacity , taken here to be a nonnegative integer. If is not an edge, then its capacity is defined to be .
A flow is a function such that and . Thus flow is nonnegative, bounded by capacity, and cannot be positive in both directions between the same pair.
For each internal vertex , total incoming flow equals total outgoing flow. The video defines these totals by sums over all vertices and checks one example numerically as .
The overall value of a flow is the amount leaving the source, equivalently the amount entering the sink.
Explore conditions, steps and evidence. Supplementary explanations are labeled separately from content shown in the video.
The board writes under the heading Flow Network.
The lecturer says a flow network consists of, among other things, a directed graph G.
G
The directed graph component of a flow network.
A pair (V, E) of vertex set and edge set.
appears on the board.
The lecture refers to vertices in the graph and to pairs of vertices.
V
The vertex set of the directed graph G.
A finite set of vertices.
and (u,v) are written on the board.
The lecturer says antiparallel edges are disallowed.
E
The edge set of the directed graph G.
A set of ordered pairs of vertices.
The board uses (u,v) and .
The lecturer speaks about every pair of vertices and about flow between two vertices.
(u,v)
An ordered pair of vertices, used to denote a directed edge or a capacity/flow value between u and v.
u, .
The board writes "source" s and , (v,s),(t,v) .
The leftmost node is labeled s.
The lecturer says a source, typically labeled s, is where whatever is flowing through the network starts from.
s
The source vertex of the flow network.
A distinguished vertex in V.
The board writes "sink" t and , (v,s),(t,v) .
The rightmost node is labeled t.
The lecturer says a sink, typically labeled t, is where the flow ends up.
t
The sink vertex of the flow network.
A distinguished vertex in V.
The board writes C : \{0\} and if (u,v) .
The lecturer says associated with every pair of vertices is a capacity.
C
The capacity function assigning a nonnegative integer capacity to each ordered pair of vertices.
C : \{0\}.
The board writes Flow f : [0,).
The lecturer says the flow itself is a function from pairs of vertices to the nonnegative reals.
f
The flow function on ordered pairs of vertices.
f : [0,).
The board writes f^{in}(u) = .
The lecturer defines f in to be the flow into a vertex.
f^{in}(u)
Total incoming flow at vertex u.
Defined for by summing over all .
The board writes f^{out}(u) = .
The lecturer defines f out to be the flow out.
f^{out}(u)
Total outgoing flow at vertex u.
Defined for by summing over all .
The board writes Flow Value |f| = f^{out}(s) = f^{in}(t).
The lecturer says the overall value of the flow is defined as the flow going out of the source or equivalently the flow going into the sink.
|f|
The value of the flow.
A nonnegative real number determined by the flow function f.
The board shows ; (u,v) .
The lecturer says a flow network consists of, among other things, a directed graph G, and that antiparallel edges are disallowed to simplify equations.
The video introduces a flow network by first specifying its underlying structure: a directed graph , together with the restriction that if (u,v) is an edge then (v,u) is not. The lecturer explicitly says this restriction is imposed to simplify later equations and is not a serious limitation.
The graph is directed.
Antiparallel edges are disallowed.
This restriction is stated as a simplifying assumption.
The board writes "source" s, "sink" t, "internal" and , (v,s),(t,v) .
The leftmost node is labeled s and the rightmost node is labeled t.
The lecturer distinguishes a source s, a sink t, and calls all other vertices internal; he also assumes no incoming edges into s or outgoing edges from t.
A flow network has two distinguished vertices: a source s and a sink t. All remaining vertices are called internal. The video further imposes boundary conditions so that no edge enters s and no edge leaves t.
s is the source.
t is the sink.
All other vertices are internal.
No incoming edges into s.
No outgoing edges from t.
The board writes C : \{0\} and if (u,v) .
Red numbers appear on the edges of the drawn graph.
The lecturer says every pair of vertices has a capacity indicating how much flow can be sent directly between them, that capacities are nonnegative integers, and that if there is no edge then the capacity is zero.
Each ordered pair of vertices is assigned a capacity . In this presentation capacities are nonnegative integers, and pairs that are not edges have capacity 0. The diagram illustrates this by placing red numeric labels on the directed edges.
Capacities are nonnegative integers.
If (u,v) is not an edge, then .
Capacity measures how much flow can be sent directly between two vertices.
The board writes Flow f : [0,) where 1) and 2) .
The lecturer says the flow is a function from pairs of vertices to the nonnegative reals, must be nonnegative, cannot exceed capacity, and at least one direction between any two vertices must be zero.
A flow is a function f on ordered pairs of vertices taking values in the nonnegative reals. The video states two immediate constraints: flow never exceeds capacity, and for any pair of vertices at least one of the two opposite directions has zero flow.
f is nonnegative.
cannot exceed .
For each pair u,v, at least one of and is 0.
The board writes f^{in}(u)=, f^{out}(u)=, and f^{in}(u)=f^{out}(u) for internal u.
The lecturer says flow must be conserved at every internal vertex, defines f in and f out, and explains intuitively that internal nodes cannot generate or absorb flow.
For every internal vertex u, total incoming flow equals total outgoing flow. The video defines these totals by sums over all vertices and states that only the source and sink may generate or absorb net flow.
The equality is required for internal vertices u.
Incoming and outgoing flow are defined by sums over all .
The board writes Flow Value |f| = f^{out}(s) = f^{in}(t).
The lecturer says the overall value of the flow is the flow going out of the source or equivalently the flow going into the sink.
The value of a flow is defined as the amount leaving the source, equivalently the amount entering the sink. This uses the previously defined outgoing and incoming flow functions.
s is the source.
t is the sink.
The definition relies on the earlier definitions of f^{out} and f^{in}.
The lecturer says antiparallel edges are disallowed to simplify some of the equations and that this is not a serious limitation.
The restriction (u,v) is imposed to simplify later equations and is presented as not a serious limitation.
We are defining the class of flow networks used in this lecture.
For the flow networks considered in this segment.
The lecturer says capacities are assumed to be nonnegative integers, that this makes arguments easier, and that it is not a serious limitation because a later algorithm will overcome it.
Assuming capacities are nonnegative integers simplifies the arguments and is not a serious limitation because a later algorithm will overcome it.
Capacities are taken in \{0\} in this presentation.
For the algorithms discussed later in the course, according to the lecturer's statement.
The lecturer says intuitively this just means that internal nodes can't generate or absorb any of the stuff that's flowing; those are the jobs of the source and the sink.
Flow conservation at internal vertices means internal nodes cannot generate or absorb flow; only the source and sink play that role.
The conservation condition f^{in}(u)=f^{out}(u) holds for internal u.
For every internal vertex u.
The lecturer says, 'So for example, in this node here, I have four plus two coming in, and I have five plus one going out. These are both six, so we say that flow is conserved at this vertex.'
The pen points to an internal vertex in the worked example graph while discussing incoming and outgoing amounts.
The exact identity of the referenced internal vertex is visually approximate, but the spoken arithmetic is clear.
The lecturer adds the two incoming flow amounts at the chosen internal vertex.
Directly stated in the audio.
The lecturer adds the two outgoing flow amounts at the same vertex.
Directly stated in the audio.
Both totals equal 6, so the vertex satisfies conservation.
Arithmetic comparison of the two sums.
At the cited internal vertex, incoming flow equals outgoing flow, so flow is conserved there.
A six-vertex directed graph is shown with source s on the left and sink t on the right.
Red edge labels show capacities and blue labels show flows, including pairs such as , , , , , , , , and .
The lecturer uses the graph to explain capacities, flows, and conservation at an internal vertex.
Some edge-to-label correspondences are visually approximate because the board is handwritten and the pen moves quickly.
Illustrate the definitions of capacity, flow, and conservation on a concrete directed graph with source s and sink t.
A directed graph with vertices including s and t.
Capacities written in red on edges.
Flows written in blue on edges.
One internal vertex is checked with incoming amounts 4 and 2 and outgoing amounts 5 and 1.
Show how the displayed numbers instantiate the definitions of C, f, and conservation.
The red numbers on the graph represent capacities of the corresponding directed edges.
Diagram plus the lecturer's definition of capacity.
The blue numbers represent the actual flow assigned to each directed edge.
Diagram plus the lecturer's definition of flow.
At the cited internal vertex, total incoming flow equals total outgoing flow.
Explicit spoken numerical check.
The example graph instantiates a flow network by assigning integer capacities and nonnegative flows that satisfy the stated constraints, with conservation verified at the cited internal vertex.
The lecturer verifies conservation numerically at one internal vertex by comparing incoming and outgoing sums.
The board title reads Flow Networks, with a small directed graph drawn on the right and the formula ; (u,v) on the left.
A hand with a stylus points around the formula and graph while the lecturer introduces the definition.
Title 'Flow Networks'
Formula for
Small directed graph with six vertices
The stylus points to the formula and then to the graph.
The graph remains directed.
The antiparallel-edge restriction stays visible on the board.
The opening visual establishes that a flow network is built on a directed graph with no antiparallel edges.
Green text appears: "source" s, "sink" t, "internal", and , (v,s),(t,v) .
The leftmost and rightmost nodes of the graph are labeled s and t.
Graph vertices
Labels s and t
Green boundary-condition formula
The leftmost node receives label s.
The rightmost node receives label t.
Boundary-condition text is added below the initial definition.
The underlying directed graph structure remains the same.
The no-antiparallel-edge condition remains in force.
The visual step distinguishes the two special vertices and encodes the assumption that nothing enters s and nothing leaves t.
Red numbers appear next to the directed edges of the graph.
The board adds C : \{0\} and if (u,v) .
Exact mapping of every red number to a specific ordered pair is visually approximate.
Directed graph
Red numeric edge labels
Capacity formulas
Red capacity values are written onto the edges.
The capacity function definition is added on the left.
The graph topology and source/sink labels remain unchanged.
The red labels visualize the capacity function C on selected vertex pairs.
Blue numbers are added beside the red ones, producing paired labels such as , , , , , , , , and .
The board adds Flow f : [0,) with constraints 1) , 2) , and later the conservation formulas.
Some paired labels are handwritten and their exact edge association is approximate.
Graph edges
Blue flow labels
Flow definition formulas
Conservation formulas
Blue flow values are written alongside red capacities.
The flow function definition and constraints are added.
The conservation equations are written below.
The capacity labels remain visible.
The source and sink labels remain fixed.
The paired red/blue labels illustrate a concrete assignment of capacities and flows satisfying the stated constraints.
A boxed heading Flow Value appears at the lower right with |f| = f^{out}(s) = f^{in}(t).
The stylus points to the boxed formula as the lecturer defines the overall value of the flow.
Boxed heading 'Flow Value'
Formula |f| = f^{out}(s) = f^{in}(t)
A new boxed definition is added at the lower right.
The earlier graph and definitions remain on screen.
The closing visual summarizes the scalar quantity associated with the whole flow.
The lecturer says it doesn't make sense to have flow going from one vertex to another only to send it back again.
The board states .
One might imagine sending positive flow in both directions between the same pair of vertices.
The video imposes , so at least one direction must be zero; simultaneous positive flow in opposite directions is excluded.
The lecturer says internal nodes can't generate or absorb any of the stuff that's flowing; those are the jobs of the source and the sink.
A reader might think intermediate vertices can add or remove flow.
Conservation requires f^{in}(u)=f^{out}(u) at internal vertices, so only s and t account for net generation or absorption.
The source/sink notation is added directly beneath the initial graph definition.
The lecturer first defines the directed graph and then distinguishes special vertices s and t.
The definition of a flow network builds on the directed graph by adding distinguished source and sink vertices and boundary conditions on incident edges.
The conservation clause is written 'for internal u' after the source/sink/internal distinction.
The lecturer says flow must be conserved at every internal vertex and later contrasts internal nodes with source and sink.
Understanding conservation requires knowing which vertices are internal as opposed to the source and sink.
The flow constraint directly references the capacity function.
The lecturer says flow can't exceed the capacity for any pair of vertices.
The flow definition depends on capacity because one of its constraints is an upper bound by .
The final boxed formula |f| = f^{out}(s) = f^{in}(t) uses the previously defined f^{out} and f^{in}.
The lecturer defines the overall value of the flow using source-outflow and sink-inflow.
The notion of flow value applies the incoming/outgoing flow machinery to the special vertices s and t.
Opening board shows ; (u,v) .
The lecturer begins with the definition of a flow network.
The lecturer says antiparallel edges are disallowed to simplify some of the equations.
The board labels source s, sink t, internal, and writes the boundary condition.
The lecturer explains where flow starts and ends.
The board writes if (u,v) .
The lecturer says if there is no edge in the graph, then the capacity is defined to be zero.
The board lists and .
The lecturer states the nonnegativity, capacity bound, and one-direction-zero requirements.
The lecturer gives the versus example and says internal nodes cannot generate or absorb flow.
The boxed formula reads |f| = f^{out}(s) = f^{in}(t).
The lecturer defines the overall value of the flow.
Covered · Opening definition of a flow network as a directed graph with no antiparallel edges.
Covered · Introduction of source s, sink t, internal vertices, and boundary conditions.
Covered · Definition of capacity function and display of red capacity labels on the example graph.
Covered · Definition of flow function and pairwise constraints, with blue flow labels added to the graph.
Covered · Conservation at internal vertices, including a numerical example on the board.
Covered · Final boxed definition of the value of a flow.
Reviewed subject paths