topic badge
AustraliaVIC
VCE 12 General 2023

9.02 Flow problems

Lesson

Introduction

In this lesson we will discuss a type of network called a flow network, and a theorem related to flow networks called the max-flow min-cut theorem. The following video presents these same ideas using different examples.

Loading video...

Flow networks

Some directed networks have a clear beginning (called the source) and a clear end (called the sink). Such networks are flow networks. Each vertex has an amount of inflow capacity (total weight of all edges arriving at the vertex) and an outflow capacity (total weight of all edges leaving the vertex).

There are two principles of flow networks:

  1. The actual outflow from a vertex cannot be larger than the inflow capacity.

    Consider this network, where the weight represents the number of shirts that can be shipped from one location to another in a month:

    This image shows a flow network and its inflow and outflow capacity. Ask your teacher for more information.

    Even though 200+50+100=350 shirts can be shipped out of the warehouse in a month, only 120 can be shipped in. The outflow (the number of shirts being shipped to the three cities) can never be larger than 120, the inflow capacity.

  2. The actual outflow from a vertex cannot be larger than the outflow capacity.

    Consider this network, where the weights represent the number of students that can move from one place to another each minute:

    A flow network of student movement and its inflow and outflow capacity. Ask your teacher for more information.

    Even though 10+8=18 students can join the lunch line every minute, only 5 can make it out to the cafeteria tables. If there were 7 students coming in from the playground and 9 from the oval in one particular minute, the inflow would be 7+9=16, but the outflow would be only 5 students - the line would just get longer.

To find the maximum flow through a flow network using the minimum cut method, we:

  1. Draw in some cuts, separating the network into two parts one containing the source, and one containing the sink.

  2. Mark edges that cross from the source side to the sink side.

  3. Add up the outflow capacity of the marked edges, making a note of the smallest total as we go.

  4. Check other cuts to see if we can get a smaller value.

The maximum flow through the network is then equal to the capacity of the minimum cut. This is called the max-flow min-cut theorem.

This theorem is an extremely useful idea, since it allows us to answer a big question - “what is the maximum flow through a network?”. Flow networks have a wide variety of applications including scheduling, reliability frameworks, traffic flow, system flows for systems including electricity, water, gas and data. Calculating flow through a network has been used in a wide variety of applications from transport and shipping, to plumbing and architectural safety.

Now that we know these two principles, we’re going to put them together in an interesting way.

This network represents the connections between a number of international airports. The weights represent the maximum number of flights that can be scheduled between the two airports in a single day:

This image shows a flow network of international airports. Ask your teacher for more information.

Suppose 23 flights leave from \text{SFO} to \text{LAS}, and 8 flights leave from \text{SFO} to \text{SEA}. How many flights will make it all the way through the network to \text{ATL}?

Notice that there is one vertex where edges only come out (the source), and a vertex where the edges only come in (the sink):

This image shows a flow network of international airports. Ask your teacher for more information.

The following method can only be used when there is a single source and a single sink in the network.

Cut the network with a line as we did above, drawing through the edges and separating the network into two parts - one containing the source, and one containing the sink. There are many ways to cut the network to separate the source from the sink, and here are a few:

This image shows cuts to separate the source from the sink in a network. Ask your teacher for more information.

Each cut picks out some vertices to be on the “source” side of the line, and the rest are on the “sink” side.

By marking out every place where the edges cross the cut from the source part to the sink part, we get a diagram like this:

This image shows the intersections of edges and cuts in a network. Ask your teacher for more information.

Not every crossing between edge and cut has been marked - only when the edge starts at a vertex on the source side and connects across the cut to a vertex on the sink side. Two of the cuts have 2 markings, one has 3, and one has 5.

A cut with less marked crossings is more likely to have the minimum total capacity. So instead let's draw in some cuts with exactly 2 marked crossings on this network:

This image shows a network with cuts with 2 crossings. Ask your teacher for more information.

These are all cuts that have 2 crossings from the source side to the sink side.

We now add up the weights of the edges across these cuts:

This image shows a network where the weights of the edges are added along each cut. Ask your teacher for more information.

The least value obtained after considering each cut, in this case 26, has very special significance. It is the minimum cut, and tells us the maximum flow through the network. For this example we have an answer to our question - at most 26 flights can make it from \text{SFO }to \text{ATL }in a single day.

To be sure, we should check all cuts, including those we marked earlier that have 3 or more marked crossings - in this case, no cut can improve on this result. To understand this intuitively, we know that at most 26 flights can cross the purple line in a single day, and all flights must pass through this line on their way from source to sink.

Examples

Example 1

Which of the cuts shown on the network are valid? Select all the correct options

This image shows a flow network with cuts. Ask your teacher for more information.
A
C1
B
C2
C
C3
D
C4
E
C5
F
C6
Worked Solution
Create a strategy

Choose the cuts that divide the network into two where one part has the source and the other has the sink.

Apply the idea

The source is vertex 1 and the sink is vertex 9. So we need to choose cuts that have vertex 1 one one side and vertex 9 on the other.

Cuts C3, \, C5, and C6 divide the network into two where one part has the source and the other has the sink.

The answers are options C, E, and F.

Example 2

Find the maximum flow through the following graph using the max-flow min-cut theorem or otherwise.

This image shows a weighted flow network with vertices 1 to 6. Ask your teacher for more information.
Worked Solution
Create a strategy

Follow the steps using the max-flow min-cut theorem to find the minimum cut:

  1. Draw in some cuts, marking edges that cross from the source side to the sink side.

  2. Add up the outflow capacity of the marked edges, making a note of the smallest total as we go.

  3. Check all other cuts to see if we can get a smaller value.

Apply the idea

The source is vertex 1 and the sink is vertex 6.

The possible cuts that can be drawn may have the following outflow capacity.

\displaystyle C1 \text{ outflow}\displaystyle =\displaystyle 150+200+200Add the weights the cut intersects
\displaystyle =\displaystyle 550Evaluate
\displaystyle C2 \text{ outflow}\displaystyle =\displaystyle 150+200+320+60Add the weights the cut intersects
\displaystyle =\displaystyle 730Evaluate
\displaystyle C3 \text{ outflow}\displaystyle =\displaystyle 150+100+160+60Add the weights the cut intersects
\displaystyle =\displaystyle 470Evaluate
\displaystyle C4 \text{ outflow}\displaystyle =\displaystyle 230+160+300Add the weights the cut intersects
\displaystyle =\displaystyle 690Evaluate
\displaystyle C5 \text{ outflow}\displaystyle =\displaystyle 230+160+60Add the weights the cut intersects
\displaystyle =\displaystyle 450Evaluate

C5 has the smallest outflow, at 450.So the maximum flow is 450.

Idea summary

A flow network shows the clear beginning (source) and the clear end (sink) of a directed network.

Inflow capacity is the total weight of edges arriving at a vertex while the outflow capacity is the total weight of edges leaving at a vertex.

The maximum flow through a vertex is equal to the lower number out of the inflow and outflow for that vertex.

To find the maximum flow through a flow network using the minimum cut method, we:

  1. Draw in some cuts, separating the network into two parts one containing the source, and one containing the sink.

  2. Mark edges that cross from the source side to the sink side.

  3. Add up the outflow capacity of the marked edges, making a note of the smallest total as we go.

  4. Check other cuts to see if we can get a smaller value.

The maximum flow through the network is then equal to the capacity of the minimum cut. This is called the max-flow min-cut theorem.

Outcomes

U4.AoS2.4

transition diagrams and transition matrices and regular transition matrices and their identification

U4.AoS2.11

recognise the flow problem, use networks to model flow problems and determine the minimum flow problem by inspection, or by using the minimum cut/maximum flow theorem for larger scale problems

What is Mathspace

About Mathspace