WEBVTT

00:00:00.000 --> 00:00:17.400 align:middle line:84%
[SQUEAKING]
[RUSTLING] [CLICKING]

00:00:17.400 --> 00:00:21.080 align:middle line:84%
PETER SHOR: And this network
could be all sorts of things.

00:00:21.080 --> 00:00:32.720 align:middle line:84%
I mean, it could
be pipes, roads,

00:00:32.720 --> 00:00:34.820 align:middle line:90%
electronic communications.

00:00:34.820 --> 00:00:42.000 align:middle line:90%


00:00:42.000 --> 00:00:45.820 align:middle line:90%
And each edge has a capacity.

00:00:45.820 --> 00:00:53.120 align:middle line:90%


00:00:53.120 --> 00:01:01.280 align:middle line:84%
And the question is, how
much whatever can you

00:01:01.280 --> 00:01:08.070 align:middle line:90%
get from a source to a sink?

00:01:08.070 --> 00:01:15.960 align:middle line:90%


00:01:15.960 --> 00:01:19.520 align:middle line:90%
So here, we have an example.

00:01:19.520 --> 00:01:21.840 align:middle line:90%
This is a network.

00:01:21.840 --> 00:01:26.520 align:middle line:84%
This 6 says that only
six units of flow

00:01:26.520 --> 00:01:30.140 align:middle line:84%
can pass over this
edge at any given time.

00:01:30.140 --> 00:01:32.120 align:middle line:90%
This says 4.

00:01:32.120 --> 00:01:33.520 align:middle line:90%
This is 3.

00:01:33.520 --> 00:01:35.600 align:middle line:84%
And the question is,
how many units of flow

00:01:35.600 --> 00:01:39.360 align:middle line:90%
can you get from s to t?

00:01:39.360 --> 00:01:45.160 align:middle line:84%
And we will call the
source s And the sink t.

00:01:45.160 --> 00:01:47.580 align:middle line:84%
And these are the standard
letters that are used for them.

00:01:47.580 --> 00:01:50.880 align:middle line:84%
I don't know whether they
stand for anything or not.

00:01:50.880 --> 00:01:54.820 align:middle line:84%
I mean, clearly S presumably
stands for source.

00:01:54.820 --> 00:01:58.880 align:middle line:84%
But I don't know
why t is the sink.

00:01:58.880 --> 00:02:01.570 align:middle line:84%
So the question
is, how much flow

00:02:01.570 --> 00:02:03.670 align:middle line:90%
can you get from here to here?

00:02:03.670 --> 00:02:08.530 align:middle line:90%


00:02:08.530 --> 00:02:15.330 align:middle line:84%
Well, let's try putting
flow from here to here.

00:02:15.330 --> 00:02:17.950 align:middle line:84%
Does anybody see a path
you could run flow on?

00:02:17.950 --> 00:02:26.410 align:middle line:90%


00:02:26.410 --> 00:02:28.230 align:middle line:90%
OK, this is an easy question.

00:02:28.230 --> 00:02:31.690 align:middle line:90%
What is some path from s to t?

00:02:31.690 --> 00:02:35.570 align:middle line:90%
Let's say s to--

00:02:35.570 --> 00:02:41.110 align:middle line:84%
oh my, I have left out
the numbers on the nodes.

00:02:41.110 --> 00:02:43.490 align:middle line:90%
So this is 4.

00:02:43.490 --> 00:02:46.250 align:middle line:90%
And this is 5.

00:02:46.250 --> 00:02:52.690 align:middle line:84%
So S to 2 to 4 to t, you
could run three units of flow

00:02:52.690 --> 00:02:53.470 align:middle line:90%
along this path.

00:02:53.470 --> 00:02:55.810 align:middle line:90%
So let's put them there.

00:02:55.810 --> 00:02:59.130 align:middle line:84%
Now, are there other
paths you could take?

00:02:59.130 --> 00:03:00.730 align:middle line:90%
Yeah, of course, there are.

00:03:00.730 --> 00:03:04.070 align:middle line:84%
You could run two units
of flow from here to here.

00:03:04.070 --> 00:03:10.770 align:middle line:90%
So that's 2, 2, 2.

00:03:10.770 --> 00:03:14.530 align:middle line:90%
And is this all?

00:03:14.530 --> 00:03:16.970 align:middle line:84%
Well, no, because you
could run two units of flow

00:03:16.970 --> 00:03:23.770 align:middle line:90%
from here to here to here.

00:03:23.770 --> 00:03:27.510 align:middle line:84%
And we have two units
of flow already on here.

00:03:27.510 --> 00:03:29.530 align:middle line:90%
So this gives you 4.

00:03:29.530 --> 00:03:32.390 align:middle line:84%
You have 0 units
of flow already.

00:03:32.390 --> 00:03:33.690 align:middle line:90%
So this is 2.

00:03:33.690 --> 00:03:35.350 align:middle line:84%
You have three
units of flow here.

00:03:35.350 --> 00:03:38.730 align:middle line:90%
So that gives you 5.

00:03:38.730 --> 00:03:42.690 align:middle line:90%
Now, is that the maximum?

00:03:42.690 --> 00:03:44.380 align:middle line:90%
Does anybody see any more paths?

00:03:44.380 --> 00:03:54.700 align:middle line:90%


00:03:54.700 --> 00:03:55.620 align:middle line:90%
Yes?

00:03:55.620 --> 00:04:00.615 align:middle line:84%
STUDENT: You could do
one from s 2, 3, 5?

00:04:00.615 --> 00:04:04.580 align:middle line:84%
PETER SHOR: Yeah, you
could do one from here.

00:04:04.580 --> 00:04:08.160 align:middle line:90%
Wait-- oh, you're right.

00:04:08.160 --> 00:04:09.580 align:middle line:90%
This was 4.

00:04:09.580 --> 00:04:10.260 align:middle line:90%
No, wait.

00:04:10.260 --> 00:04:11.420 align:middle line:90%
Yeah, this was 4.

00:04:11.420 --> 00:04:14.340 align:middle line:84%
But you could run
one up here, 4.

00:04:14.340 --> 00:04:23.460 align:middle line:84%
You could run one down here,
1 and 3, and one up here,

00:04:23.460 --> 00:04:25.220 align:middle line:90%
and one up here.

00:04:25.220 --> 00:04:28.100 align:middle line:84%
And there's still one
more path you could do,

00:04:28.100 --> 00:04:34.820 align:middle line:84%
which I guess is one here,
one here, one here, one here,

00:04:34.820 --> 00:04:35.800 align:middle line:90%
and one here.

00:04:35.800 --> 00:04:37.380 align:middle line:90%
So that's pretty complicated.

00:04:37.380 --> 00:04:39.540 align:middle line:90%
But this would be 5.

00:04:39.540 --> 00:04:41.900 align:middle line:90%
And this would be 2.

00:04:41.900 --> 00:04:48.220 align:middle line:90%
And this would be 3 and 2.

00:04:48.220 --> 00:04:49.660 align:middle line:90%
No wait.

00:04:49.660 --> 00:04:53.160 align:middle line:84%
And you could run
one here from 4 to t.

00:04:53.160 --> 00:04:54.120 align:middle line:90%
So that's there.

00:04:54.120 --> 00:04:56.020 align:middle line:90%
And now, we have a flow.

00:04:56.020 --> 00:04:59.300 align:middle line:90%


00:04:59.300 --> 00:05:00.820 align:middle line:84%
The flow through
every edge is less

00:05:00.820 --> 00:05:02.320 align:middle line:90%
than the capacity on that edge.

00:05:02.320 --> 00:05:03.740 align:middle line:90%
So that's good.

00:05:03.740 --> 00:05:12.840 align:middle line:84%
And we have gotten 9 units
of flow from here to here.

00:05:12.840 --> 00:05:17.300 align:middle line:90%


00:05:17.300 --> 00:05:21.540 align:middle line:90%
OK, I guess I copied down the--

00:05:21.540 --> 00:05:23.538 align:middle line:84%
no, I didn't copy
anything wrong.

00:05:23.538 --> 00:05:25.580 align:middle line:84%
I'm just looking at the
green numbers rather than

00:05:25.580 --> 00:05:27.226 align:middle line:90%
the blue numbers.

00:05:27.226 --> 00:05:31.670 align:middle line:90%
So here is a flow of 9 units.

00:05:31.670 --> 00:05:39.100 align:middle line:90%


00:05:39.100 --> 00:05:42.860 align:middle line:84%
So what we're going to do later
is write down a linear program.

00:05:42.860 --> 00:05:44.540 align:middle line:84%
And the solution to
this linear program

00:05:44.540 --> 00:05:46.780 align:middle line:90%
will be the maximum flow.

00:05:46.780 --> 00:05:49.380 align:middle line:84%
But first, I want
to talk about cuts.

00:05:49.380 --> 00:05:52.180 align:middle line:90%
So how could you prove--

00:05:52.180 --> 00:05:59.150 align:middle line:90%


00:05:59.150 --> 00:06:02.520 align:middle line:84%
how can you prove that
this flow is maximum?

00:06:02.520 --> 00:06:19.950 align:middle line:90%


00:06:19.950 --> 00:06:23.950 align:middle line:84%
Well, let's look at
these three edges--

00:06:23.950 --> 00:06:27.350 align:middle line:84%
this one, this
one, and this one.

00:06:27.350 --> 00:06:33.930 align:middle line:84%
There's four units of
capacity on this edge,

00:06:33.930 --> 00:06:35.830 align:middle line:84%
two units of capacity
on this edge,

00:06:35.830 --> 00:06:39.590 align:middle line:84%
and three units of
capacity on that edge.

00:06:39.590 --> 00:06:43.230 align:middle line:90%
And so this defines a cut.

00:06:43.230 --> 00:06:50.350 align:middle line:84%
And at most, 9 units of
flow can cross this cut.

00:06:50.350 --> 00:06:53.220 align:middle line:84%
So that shows that 9
units of flow is maximum.

00:06:53.220 --> 00:06:57.350 align:middle line:90%


00:06:57.350 --> 00:07:09.150 align:middle line:84%
Cuts-- a cut is
defined as a subset

00:07:09.150 --> 00:07:20.210 align:middle line:84%
of the vertices or subset
containing s but not t.

00:07:20.210 --> 00:07:31.270 align:middle line:90%


00:07:31.270 --> 00:07:39.230 align:middle line:84%
And so to make this a subset of
the vertices, gosh, what we do

00:07:39.230 --> 00:07:44.950 align:middle line:84%
is we make the subset
this guy and this guy.

00:07:44.950 --> 00:08:05.440 align:middle line:84%
And maybe we should call
it C. Edges from C to C-bar

00:08:05.440 --> 00:08:06.700 align:middle line:90%
are edges in the cut.

00:08:06.700 --> 00:08:13.680 align:middle line:90%


00:08:13.680 --> 00:08:19.140 align:middle line:84%
And let's say the capacity
of an edge is u of the edge.

00:08:19.140 --> 00:08:23.320 align:middle line:90%


00:08:23.320 --> 00:08:33.640 align:middle line:84%
So summation over E
equals i j inc j in C-bar.

00:08:33.640 --> 00:08:36.847 align:middle line:90%


00:08:36.847 --> 00:08:42.949 align:middle line:84%
u of i j equals, I
guess, the value of cut.

00:08:42.949 --> 00:08:48.320 align:middle line:90%


00:08:48.320 --> 00:08:55.960 align:middle line:84%
And it should be fairly
easy that the maximum flow

00:08:55.960 --> 00:08:59.520 align:middle line:84%
is less than or equal
to the minimum cut

00:08:59.520 --> 00:09:02.400 align:middle line:84%
because if you have
a flow from s to t,

00:09:02.400 --> 00:09:07.160 align:middle line:84%
it must cross every
edge of the cut.

00:09:07.160 --> 00:09:11.600 align:middle line:84%
So if the flow is
9 units, then--

00:09:11.600 --> 00:09:13.260 align:middle line:84%
or rather, if the
cut is 9 units,

00:09:13.260 --> 00:09:17.010 align:middle line:84%
then you can't have a
flow larger than 9 units.

00:09:17.010 --> 00:09:20.160 align:middle line:90%


00:09:20.160 --> 00:09:24.320 align:middle line:84%
And the theorem we
will prove later.

00:09:24.320 --> 00:09:34.830 align:middle line:84%
The value of max flow equals
the value of minimum cut.

00:09:34.830 --> 00:09:38.600 align:middle line:90%


00:09:38.600 --> 00:09:47.650 align:middle line:84%
So you probably recognize this
as being somewhat something

00:09:47.650 --> 00:09:50.250 align:middle line:90%
like LP duality.

00:09:50.250 --> 00:09:59.650 align:middle line:84%
And this is the
primal solution of LP.

00:09:59.650 --> 00:10:06.560 align:middle line:84%
And this will turn out to be
the solution of the dual LP.

00:10:06.560 --> 00:10:09.290 align:middle line:90%


00:10:09.290 --> 00:10:18.530 align:middle line:84%
And by the strong duality
theorem of linear program,

00:10:18.530 --> 00:10:20.730 align:middle line:90%
this guy equals this guy.

00:10:20.730 --> 00:10:25.750 align:middle line:84%
So the maximum flow
equals the minimum cut.

00:10:25.750 --> 00:10:29.050 align:middle line:84%
So there's a bunch of
things we have to do

00:10:29.050 --> 00:10:31.490 align:middle line:90%
before we prove this theorem.

00:10:31.490 --> 00:10:33.070 align:middle line:90%
So what do we do?

00:10:33.070 --> 00:10:38.490 align:middle line:90%


00:10:38.490 --> 00:10:40.740 align:middle line:84%
First thing we do is write
down the linear program.

00:10:40.740 --> 00:10:58.810 align:middle line:90%


00:10:58.810 --> 00:11:00.810 align:middle line:84%
Does anybody have
suggestions for what

00:11:00.810 --> 00:11:02.110 align:middle line:90%
the variables should be?

00:11:02.110 --> 00:11:07.450 align:middle line:90%


00:11:07.450 --> 00:11:08.570 align:middle line:90%
Yeah?

00:11:08.570 --> 00:11:12.596 align:middle line:84%
STUDENT: How many
units you load to each.

00:11:12.596 --> 00:11:14.970 align:middle line:84%
PETER SHOR: Through
each edge, exactly.

00:11:14.970 --> 00:11:20.770 align:middle line:84%
So the variables are
going to be x sub i j--

00:11:20.770 --> 00:11:26.650 align:middle line:90%
that's the flow over edge i j.

00:11:26.650 --> 00:11:30.890 align:middle line:90%


00:11:30.890 --> 00:11:35.350 align:middle line:84%
And any suggestions
for constraints?

00:11:35.350 --> 00:11:41.380 align:middle line:90%


00:11:41.380 --> 00:11:42.580 align:middle line:90%
Yeah?

00:11:42.580 --> 00:11:44.080 align:middle line:84%
STUDENT: For any
you don't know, you

00:11:44.080 --> 00:11:47.010 align:middle line:84%
put the srt, like maybe the
flow inverse is the [INAUDIBLE].

00:11:47.010 --> 00:11:47.760 align:middle line:90%
PETER SHOR: Right.

00:11:47.760 --> 00:11:51.040 align:middle line:84%
So flow conservation, I
guess, you could call it.

00:11:51.040 --> 00:11:55.980 align:middle line:90%


00:11:55.980 --> 00:11:58.030 align:middle line:90%
And let me write this down.

00:11:58.030 --> 00:12:15.600 align:middle line:90%


00:12:15.600 --> 00:12:18.810 align:middle line:84%
Summation, hope
I'm getting this--

00:12:18.810 --> 00:12:21.340 align:middle line:90%


00:12:21.340 --> 00:12:29.460 align:middle line:84%
j such that i j is in the
set of edges x sub i j.

00:12:29.460 --> 00:12:36.300 align:middle line:84%
So this is a set of
things going into node i

00:12:36.300 --> 00:12:41.490 align:middle line:84%
and a set of things going
out of node i equals--

00:12:41.490 --> 00:12:46.900 align:middle line:90%


00:12:46.900 --> 00:12:47.480 align:middle line:90%
no, wait.

00:12:47.480 --> 00:12:48.938 align:middle line:84%
This is the set of
things going out

00:12:48.938 --> 00:12:53.140 align:middle line:84%
of node i j and the set of
things going into node i.

00:12:53.140 --> 00:13:03.140 align:middle line:84%
And let's put a minus sign here
so that k such that k i is in a.

00:13:03.140 --> 00:13:06.300 align:middle line:84%
So this is a set of
things going into node i,

00:13:06.300 --> 00:13:12.100 align:middle line:90%
x sub k i equals 0 because--

00:13:12.100 --> 00:13:15.060 align:middle line:84%
linear programs, it's
nice to write down,

00:13:15.060 --> 00:13:19.380 align:middle line:84%
so you have the variables on
the left side of the equations

00:13:19.380 --> 00:13:23.500 align:middle line:84%
and our inequalities and the
constants on the right side

00:13:23.500 --> 00:13:25.700 align:middle line:90%
of the inequalities.

00:13:25.700 --> 00:13:29.260 align:middle line:84%
And there's another
set of constraints.

00:13:29.260 --> 00:13:32.260 align:middle line:84%
Can anybody figure
out what it is?

00:13:32.260 --> 00:13:33.740 align:middle line:90%
Yep?

00:13:33.740 --> 00:13:37.198 align:middle line:90%
STUDENT: [INAUDIBLE]

00:13:37.198 --> 00:13:37.865 align:middle line:90%
PETER SHOR: Yes?

00:13:37.865 --> 00:13:38.970 align:middle line:90%
STUDENT: The capacities?

00:13:38.970 --> 00:13:40.178 align:middle line:90%
PETER SHOR: Yeah, capacities.

00:13:40.178 --> 00:13:42.310 align:middle line:84%
We need to use
capacities somewhere.

00:13:42.310 --> 00:13:48.150 align:middle line:84%
And x i j is less
than or equal to--

00:13:48.150 --> 00:13:51.670 align:middle line:90%
we call them u of i j.

00:13:51.670 --> 00:13:59.070 align:middle line:84%
And also, xij had better be
greater than or equal to 0.

00:13:59.070 --> 00:14:02.950 align:middle line:90%
And what do we want to maximize?

00:14:02.950 --> 00:14:08.670 align:middle line:84%
So what we want to do is we want
to maximize some of the things

00:14:08.670 --> 00:14:16.547 align:middle line:90%
into the sink, which is node t.

00:14:16.547 --> 00:14:19.130 align:middle line:84%
But actually, we're going to do
this a slightly different way.

00:14:19.130 --> 00:14:23.690 align:middle line:84%
We're going to write out a
new constraint summation.

00:14:23.690 --> 00:14:27.390 align:middle line:90%


00:14:27.390 --> 00:14:30.870 align:middle line:90%
Let's write down for all i.

00:14:30.870 --> 00:14:49.170 align:middle line:84%
And I want to write down k
such that kt x sub kt is in a.

00:14:49.170 --> 00:14:56.210 align:middle line:84%
So this is all the things
going into the sink.

00:14:56.210 --> 00:15:01.510 align:middle line:90%
x sub kt is equal to z.

00:15:01.510 --> 00:15:03.290 align:middle line:90%
And we want to maximize z.

00:15:03.290 --> 00:15:08.385 align:middle line:90%


00:15:08.385 --> 00:15:13.650 align:middle line:84%
I did not leave enough
room, so maximize z.

00:15:13.650 --> 00:15:38.690 align:middle line:90%


00:15:38.690 --> 00:15:45.320 align:middle line:90%
So that is the linear program.

00:15:45.320 --> 00:15:51.720 align:middle line:84%
And I have a sneaking
suspicion that I messed up

00:15:51.720 --> 00:15:53.520 align:middle line:90%
a sign somewhere.

00:15:53.520 --> 00:15:56.360 align:middle line:90%
But it doesn't really--

00:15:56.360 --> 00:15:58.340 align:middle line:90%
I mean, it doesn't matter.

00:15:58.340 --> 00:16:00.260 align:middle line:84%
I mean, this is
a linear program,

00:16:00.260 --> 00:16:01.770 align:middle line:90%
which does give the solution.

00:16:01.770 --> 00:16:03.520 align:middle line:84%
So it doesn't really
matter if I messed up

00:16:03.520 --> 00:16:08.800 align:middle line:84%
a sign, except then when we take
the dual, it's going to be--

00:16:08.800 --> 00:16:12.930 align:middle line:84%
it's not going to
be quite as nice.

00:16:12.930 --> 00:16:33.280 align:middle line:90%


00:16:33.280 --> 00:16:37.240 align:middle line:84%
OK, let's just keep on going
and write down the dual.

00:16:37.240 --> 00:16:43.320 align:middle line:84%
And if I got the sign wrong,
we'll fix it after that.

00:16:43.320 --> 00:16:45.420 align:middle line:84%
I want to say the
sign is not wrong.

00:16:45.420 --> 00:16:52.640 align:middle line:84%
This is a perfectly good
linear program for max flow.

00:16:52.640 --> 00:16:59.005 align:middle line:84%
It's just I am a little worried
that, when we take the dual,

00:16:59.005 --> 00:17:00.630 align:middle line:84%
we're going to have
to flip some signs.

00:17:00.630 --> 00:17:05.268 align:middle line:90%


00:17:05.268 --> 00:17:10.319 align:middle line:84%
So why don't I
take the dual now?

00:17:10.319 --> 00:17:22.160 align:middle line:84%
To take dual, each equation
gives a constraint,

00:17:22.160 --> 00:17:24.839 align:middle line:90%
or each inequality--

00:17:24.839 --> 00:17:27.079 align:middle line:84%
no, each variable
gives a constraint.

00:17:27.079 --> 00:17:33.330 align:middle line:84%
Each constraint
gives a variable.

00:17:33.330 --> 00:17:36.770 align:middle line:90%
So we have two classes.

00:17:36.770 --> 00:17:38.930 align:middle line:84%
Well, actually, I guess
we have three classes

00:17:38.930 --> 00:17:45.130 align:middle line:90%
of equations and inequalities.

00:17:45.130 --> 00:17:49.110 align:middle line:84%
But I just want to
use two of them.

00:17:49.110 --> 00:17:57.010 align:middle line:84%
I'm going to call this one alpha
sub ij, and this one beta sub i,

00:17:57.010 --> 00:18:05.050 align:middle line:84%
and this one beta sub z, because
this really is a lot like this,

00:18:05.050 --> 00:18:07.750 align:middle line:90%
except slightly different.

00:18:07.750 --> 00:18:11.260 align:middle line:84%
And I really should make
this minus z equals 0.

00:18:11.260 --> 00:18:23.290 align:middle line:90%


00:18:23.290 --> 00:18:32.590 align:middle line:84%
So how do we get the
variables of the--

00:18:32.590 --> 00:18:37.610 align:middle line:84%
how do we get the
constraints of the dual

00:18:37.610 --> 00:18:40.210 align:middle line:84%
and the objective
function of the dual?

00:18:40.210 --> 00:18:43.410 align:middle line:84%
Well, the objective function of
the dual is just the right-hand

00:18:43.410 --> 00:18:45.350 align:middle line:90%
sides of the--

00:18:45.350 --> 00:18:49.062 align:middle line:90%


00:18:49.062 --> 00:18:53.520 align:middle line:84%
right-hand sides of the
constraints of the primal.

00:18:53.520 --> 00:19:07.450 align:middle line:90%


00:19:07.450 --> 00:19:10.370 align:middle line:90%
So we will have minimum--

00:19:10.370 --> 00:19:14.430 align:middle line:84%
because the original primal
LP was a maximization,

00:19:14.430 --> 00:19:16.530 align:middle line:90%
we want to have a minimization.

00:19:16.530 --> 00:19:27.230 align:middle line:84%
And the minimization summation
alpha ij u of ij subject to--

00:19:27.230 --> 00:19:32.940 align:middle line:90%


00:19:32.940 --> 00:19:39.860 align:middle line:84%
OK, we're going to have a
equation for each variable.

00:19:39.860 --> 00:19:46.580 align:middle line:84%
So let's say the equation
corresponding to variable x sub

00:19:46.580 --> 00:19:51.660 align:middle line:84%
ij is just-- you look
at all the places

00:19:51.660 --> 00:19:54.300 align:middle line:90%
where xij appears in equation.

00:19:54.300 --> 00:20:01.540 align:middle line:84%
So x sub ij appears in beta
sub i and in alpha sub ij.

00:20:01.540 --> 00:20:08.140 align:middle line:90%


00:20:08.140 --> 00:20:19.740 align:middle line:84%
And we should have alpha ij
plus beta sub i minus beta sub j

00:20:19.740 --> 00:20:23.220 align:middle line:90%
is greater than or equal to 0.

00:20:23.220 --> 00:20:27.900 align:middle line:84%
So it's greater than or
equal to because these

00:20:27.900 --> 00:20:29.700 align:middle line:90%
were positive variables.

00:20:29.700 --> 00:20:33.740 align:middle line:84%
And when we go from a
maximization to a minimization,

00:20:33.740 --> 00:20:35.300 align:middle line:90%
you're minimizing this.

00:20:35.300 --> 00:20:38.480 align:middle line:84%
You want a greater than or equal
to sign in your constraints.

00:20:38.480 --> 00:20:46.579 align:middle line:90%


00:20:46.579 --> 00:20:48.510 align:middle line:90%
Now, there's one more--

00:20:48.510 --> 00:20:54.780 align:middle line:90%


00:20:54.780 --> 00:21:00.860 align:middle line:84%
well, I guess z was
also a variable in this.

00:21:00.860 --> 00:21:12.660 align:middle line:84%
And so there's an equation, a
constraint corresponding to z.

00:21:12.660 --> 00:21:15.980 align:middle line:84%
And z appears in the
objective function.

00:21:15.980 --> 00:21:18.580 align:middle line:84%
So this should be greater
than or equal to 1.

00:21:18.580 --> 00:21:22.030 align:middle line:90%
And z also appears in--

00:21:22.030 --> 00:21:26.150 align:middle line:90%


00:21:26.150 --> 00:21:29.950 align:middle line:84%
well, I just want to say it
only appears in one equation.

00:21:29.950 --> 00:21:31.750 align:middle line:90%
That's beta sub z.

00:21:31.750 --> 00:21:36.190 align:middle line:84%
So beta sub z is
greater or equal to 1.

00:21:36.190 --> 00:21:37.740 align:middle line:90%
No, actually it appears in--

00:21:37.740 --> 00:21:43.570 align:middle line:90%


00:21:43.570 --> 00:21:44.070 align:middle line:90%
yeah.

00:21:44.070 --> 00:22:01.150 align:middle line:90%


00:22:01.150 --> 00:22:07.210 align:middle line:90%
Yeah, so this is the dual.

00:22:07.210 --> 00:22:10.210 align:middle line:90%
STUDENT: [INAUDIBLE]

00:22:10.210 --> 00:22:12.830 align:middle line:90%


00:22:12.830 --> 00:22:14.078 align:middle line:90%
PETER SHOR: What?

00:22:14.078 --> 00:22:15.950 align:middle line:90%
STUDENT: Why do [INAUDIBLE]?

00:22:15.950 --> 00:22:17.250 align:middle line:90%
PETER SHOR: Not negative 1?

00:22:17.250 --> 00:22:20.350 align:middle line:90%


00:22:20.350 --> 00:22:27.470 align:middle line:84%
Because I should have written
this equation minus and plus.

00:22:27.470 --> 00:22:34.590 align:middle line:84%
And now, this left-hand side
is things leading into--

00:22:34.590 --> 00:22:38.710 align:middle line:84%
oh, this is beta sub
t not beta sub z.

00:22:38.710 --> 00:22:39.840 align:middle line:90%
I'm sorry.

00:22:39.840 --> 00:22:41.090 align:middle line:90%
That was a very good question.

00:22:41.090 --> 00:22:42.630 align:middle line:90%
Beta sub t.

00:22:42.630 --> 00:22:53.150 align:middle line:90%
And this thing is k--

00:22:53.150 --> 00:23:01.390 align:middle line:84%
this should be edges
leading into t.

00:23:01.390 --> 00:23:05.590 align:middle line:84%
And if we look down here,
edges leading into i

00:23:05.590 --> 00:23:07.070 align:middle line:90%
have a minus sign.

00:23:07.070 --> 00:23:10.430 align:middle line:84%
So to make it consistent,
this has to have a minus sign.

00:23:10.430 --> 00:23:12.750 align:middle line:90%
And then this is a plus sign.

00:23:12.750 --> 00:23:20.370 align:middle line:84%
And we have beta sub t
greater than or equal to 1.

00:23:20.370 --> 00:23:22.000 align:middle line:90%
That was a very good question.

00:23:22.000 --> 00:23:26.740 align:middle line:84%
And that explains why I was
worried about the signs.

00:23:26.740 --> 00:23:27.240 align:middle line:90%
Good.

00:23:27.240 --> 00:23:39.720 align:middle line:90%


00:23:39.720 --> 00:23:43.050 align:middle line:84%
So what do solutions of
this equation look like?

00:23:43.050 --> 00:23:51.720 align:middle line:90%


00:23:51.720 --> 00:23:59.080 align:middle line:84%
Well, how do you get cuts out
of solutions to this equation?

00:23:59.080 --> 00:24:01.630 align:middle line:90%
And this is a very--

00:24:01.630 --> 00:24:20.920 align:middle line:90%


00:24:20.920 --> 00:24:25.236 align:middle line:90%
this is a rather tricky thing.

00:24:25.236 --> 00:24:31.320 align:middle line:90%


00:24:31.320 --> 00:24:33.690 align:middle line:90%
So for this, we have--

00:24:33.690 --> 00:24:40.560 align:middle line:90%


00:24:40.560 --> 00:24:53.040 align:middle line:84%
we put numbers on the
nodes of this network.

00:24:53.040 --> 00:25:00.760 align:middle line:84%
And we want to maximize alpha
sub ij times the capacity

00:25:00.760 --> 00:25:07.760 align:middle line:84%
and subject to the capacity
beta i minus beta j

00:25:07.760 --> 00:25:10.120 align:middle line:90%
is greater than or equal to 0.

00:25:10.120 --> 00:25:23.410 align:middle line:84%
And first, I want to say,
for optimal alpha sub ij

00:25:23.410 --> 00:25:29.170 align:middle line:84%
is equal to, well,
either alpha ij--

00:25:29.170 --> 00:25:32.450 align:middle line:90%


00:25:32.450 --> 00:25:37.010 align:middle line:84%
oh, did I write forget to
write down alpha ij bigger than

00:25:37.010 --> 00:25:39.210 align:middle line:90%
or equal to 0?

00:25:39.210 --> 00:25:50.130 align:middle line:84%
Because alpha sub ij
was an inequality in--

00:25:50.130 --> 00:26:00.690 align:middle line:90%


00:26:00.690 --> 00:26:05.190 align:middle line:84%
the constraint corresponding to
alpha sub ij was an inequality.

00:26:05.190 --> 00:26:09.530 align:middle line:84%
So alpha ij is greater
than or equal to 0.

00:26:09.530 --> 00:26:13.350 align:middle line:84%
And the beta sub i's
are unconstrained.

00:26:13.350 --> 00:26:18.010 align:middle line:90%


00:26:18.010 --> 00:26:21.570 align:middle line:84%
For the optimal, well, you
want to make alpha sub ij

00:26:21.570 --> 00:26:25.810 align:middle line:84%
as small as possible,
subject to the constraints

00:26:25.810 --> 00:26:29.690 align:middle line:84%
that alpha sub ij is bigger
or equal to 0 and alpha sub

00:26:29.690 --> 00:26:34.370 align:middle line:84%
ij is bigger than
beta j minus beta i.

00:26:34.370 --> 00:26:39.090 align:middle line:84%
So you want to make alpha
ij equal to maximum of 0

00:26:39.090 --> 00:26:44.980 align:middle line:84%
and beta j minus beta
sub i and the optimal.

00:26:44.980 --> 00:26:51.910 align:middle line:90%


00:26:51.910 --> 00:26:57.610 align:middle line:84%
So we're going to put
values on the nodes.

00:26:57.610 --> 00:27:03.970 align:middle line:84%
And we're going to make
alpha sub ij for maximum 0

00:27:03.970 --> 00:27:06.410 align:middle line:90%
and beta j minus beta i.

00:27:06.410 --> 00:27:18.580 align:middle line:84%
Now, suppose each
alpha ij equals 0 or 1.

00:27:18.580 --> 00:27:22.660 align:middle line:84%
And now, what we
have is we have--

00:27:22.660 --> 00:27:30.645 align:middle line:84%
and I'm just going to
say here, because we

00:27:30.645 --> 00:27:32.520 align:middle line:84%
want to make everything
as small as possible,

00:27:32.520 --> 00:27:35.140 align:middle line:90%
we'll take beta sub t equal 1.

00:27:35.140 --> 00:27:48.100 align:middle line:84%
And we'll take beta sub s equals
0 because if there is no--

00:27:48.100 --> 00:27:58.900 align:middle line:84%
because if s-- if
s is one of these--

00:27:58.900 --> 00:28:03.020 align:middle line:84%
if we're looking at ij
or i equals s for this,

00:28:03.020 --> 00:28:06.460 align:middle line:84%
then really we don't
have a beta sub i.

00:28:06.460 --> 00:28:11.790 align:middle line:84%
And the equation is alpha
i sub j minus beta j

00:28:11.790 --> 00:28:13.040 align:middle line:90%
is greater than or equal to 0.

00:28:13.040 --> 00:28:15.020 align:middle line:84%
But you can just make
everything uniform

00:28:15.020 --> 00:28:17.540 align:middle line:90%
by setting beta s equal to 0.

00:28:17.540 --> 00:28:19.040 align:middle line:90%
So we have beta t equals 1.

00:28:19.040 --> 00:28:19.990 align:middle line:90%
Beta s equals 0.

00:28:19.990 --> 00:28:26.340 align:middle line:90%


00:28:26.340 --> 00:28:28.700 align:middle line:90%
So we have 0, 0.

00:28:28.700 --> 00:28:30.110 align:middle line:90%
OK, I should put some--

00:28:30.110 --> 00:28:34.340 align:middle line:90%


00:28:34.340 --> 00:28:36.420 align:middle line:90%
This is 1.

00:28:36.420 --> 00:28:41.500 align:middle line:84%
Let's make this 1,
this 0, et cetera.

00:28:41.500 --> 00:28:44.460 align:middle line:90%


00:28:44.460 --> 00:28:46.740 align:middle line:84%
So alpha sub ij is
the maximum of 0

00:28:46.740 --> 00:28:48.780 align:middle line:90%
and beta j minus beta sub i.

00:28:48.780 --> 00:28:51.500 align:middle line:84%
So that means that
this is going to be 1.

00:28:51.500 --> 00:28:53.460 align:middle line:90%
This is going to be 0.

00:28:53.460 --> 00:28:54.850 align:middle line:90%
This is going to be 1.

00:28:54.850 --> 00:29:01.860 align:middle line:90%


00:29:01.860 --> 00:29:05.280 align:middle line:84%
This would be minus 1,
except that's less than 0.

00:29:05.280 --> 00:29:07.580 align:middle line:90%
So this had better be 0.

00:29:07.580 --> 00:29:09.300 align:middle line:90%
This is 0.

00:29:09.300 --> 00:29:11.660 align:middle line:90%
This is 0 for the same reason.

00:29:11.660 --> 00:29:13.830 align:middle line:90%
This is 1.

00:29:13.830 --> 00:29:20.110 align:middle line:90%
This is 1.

00:29:20.110 --> 00:29:20.900 align:middle line:90%
And this is 0.

00:29:20.900 --> 00:29:24.190 align:middle line:90%


00:29:24.190 --> 00:29:34.030 align:middle line:84%
The 1 edges are a cut
because the 1 edges are just

00:29:34.030 --> 00:29:38.150 align:middle line:84%
the edges leading
out of the things--

00:29:38.150 --> 00:29:43.110 align:middle line:84%
nodes with alpha-- nodes
with beta i equals 0

00:29:43.110 --> 00:29:46.710 align:middle line:84%
and to the nodes beta
i equals 1, which

00:29:46.710 --> 00:29:50.670 align:middle line:90%
was our definition of cut.

00:29:50.670 --> 00:29:54.410 align:middle line:84%
So that means that
this is a cut between--

00:29:54.410 --> 00:30:01.093 align:middle line:90%


00:30:01.093 --> 00:30:02.010 align:middle line:90%
which nodes are zeros?

00:30:02.010 --> 00:30:04.570 align:middle line:90%


00:30:04.570 --> 00:30:08.900 align:middle line:84%
Between the green nodes
and the other nodes.

00:30:08.900 --> 00:30:11.590 align:middle line:90%


00:30:11.590 --> 00:30:18.110 align:middle line:84%
So there's one here,
one here, and one here.

00:30:18.110 --> 00:30:21.830 align:middle line:90%
So when you add up the--

00:30:21.830 --> 00:30:25.790 align:middle line:84%
you look at the
objective function,

00:30:25.790 --> 00:30:34.830 align:middle line:84%
it's just the sum over all
of the edges in the cut

00:30:34.830 --> 00:30:36.830 align:middle line:90%
times their capacity--

00:30:36.830 --> 00:30:39.850 align:middle line:84%
or 1 for all the edges in
the cut times their capacity.

00:30:39.850 --> 00:30:42.140 align:middle line:84%
So it's just the
value of the cut.

00:30:42.140 --> 00:30:46.790 align:middle line:90%


00:30:46.790 --> 00:30:57.390 align:middle line:84%
So this is dual
objective function--

00:30:57.390 --> 00:31:00.970 align:middle line:90%


00:31:00.970 --> 00:31:04.460 align:middle line:90%
value of cut f.

00:31:04.460 --> 00:31:07.030 align:middle line:90%


00:31:07.030 --> 00:31:11.560 align:middle line:90%
Beta sub i is in 0, 1.

00:31:11.560 --> 00:31:17.960 align:middle line:84%
Now, here comes the trickiest
part of this whole thing.

00:31:17.960 --> 00:31:25.040 align:middle line:84%
Why can we assume it's the
minimum cut rather than this?

00:31:25.040 --> 00:31:27.160 align:middle line:84%
In other words,
why can we assume

00:31:27.160 --> 00:31:31.600 align:middle line:84%
that the optimal
solution of the dual

00:31:31.600 --> 00:31:34.760 align:middle line:84%
has integer values rather
than fractional values

00:31:34.760 --> 00:31:36.300 align:middle line:90%
for the variables?

00:31:36.300 --> 00:31:42.240 align:middle line:90%


00:31:42.240 --> 00:31:51.840 align:middle line:84%
Look at-- OK, we're going to
look at this graph in another

00:31:51.840 --> 00:31:52.880 align:middle line:90%
way--

00:31:52.880 --> 00:32:00.100 align:middle line:84%
graph above, wrong
in another way.

00:32:00.100 --> 00:32:03.200 align:middle line:90%


00:32:03.200 --> 00:32:13.440 align:middle line:84%
So let's put s beta sub s equals
0 on the left side, beta sub t

00:32:13.440 --> 00:32:28.560 align:middle line:84%
equals 1 on the right side, and
beta sub 2, beta sub 3, beta sub

00:32:28.560 --> 00:32:30.330 align:middle line:90%
4, beta sub 5.

00:32:30.330 --> 00:32:40.800 align:middle line:90%


00:32:40.800 --> 00:32:44.400 align:middle line:84%
I want to say that there's
no reason these beta i's have

00:32:44.400 --> 00:32:46.240 align:middle line:90%
to be in order.

00:32:46.240 --> 00:32:56.120 align:middle line:84%
Put beta i's online
at value of beta i

00:32:56.120 --> 00:32:57.740 align:middle line:84%
in the optimal
solution of the dual.

00:32:57.740 --> 00:33:02.360 align:middle line:90%


00:33:02.360 --> 00:33:06.930 align:middle line:84%
So if beta was equal to 0.2,
then the optimum solution

00:33:06.930 --> 00:33:11.090 align:middle line:84%
of the pool at this
point would be 0.2.

00:33:11.090 --> 00:33:14.610 align:middle line:84%
And now, let's look at
the edges in this graph.

00:33:14.610 --> 00:33:23.530 align:middle line:90%
And this is 6.

00:33:23.530 --> 00:33:27.690 align:middle line:90%
This is 4.

00:33:27.690 --> 00:33:28.880 align:middle line:90%
This is 2.

00:33:28.880 --> 00:33:32.130 align:middle line:90%


00:33:32.130 --> 00:33:44.010 align:middle line:84%
There is an edge 3, value 3
going from beta 2 to beta 4.

00:33:44.010 --> 00:33:46.210 align:middle line:90%
So this is 3.

00:33:46.210 --> 00:33:51.530 align:middle line:84%
There's an edge from
beta 3 to beta 4.

00:33:51.530 --> 00:33:53.020 align:middle line:90%
So that is 3.

00:33:53.020 --> 00:33:58.050 align:middle line:90%


00:33:58.050 --> 00:34:02.370 align:middle line:84%
There's an edge from
beta 4 to beta 5.

00:34:02.370 --> 00:34:07.410 align:middle line:84%
Wait, there's an edge
from beta 5 to beta 4,

00:34:07.410 --> 00:34:11.810 align:middle line:90%
which is this way, 2.

00:34:11.810 --> 00:34:16.150 align:middle line:84%
There's an edge from
beta 4 to t So this is 8.

00:34:16.150 --> 00:34:18.929 align:middle line:90%


00:34:18.929 --> 00:34:20.310 align:middle line:90%
And this is 2.

00:34:20.310 --> 00:35:06.620 align:middle line:90%


00:35:06.620 --> 00:35:31.400 align:middle line:84%
So the claim-- edges crossing
a vertical line form a cut.

00:35:31.400 --> 00:35:35.260 align:middle line:90%


00:35:35.260 --> 00:35:38.570 align:middle line:90%
So let's look at this edge.

00:35:38.570 --> 00:35:44.900 align:middle line:90%


00:35:44.900 --> 00:35:50.440 align:middle line:84%
This vertical line, this has
edge 2, 3, and 4 crossing it.

00:35:50.440 --> 00:35:57.460 align:middle line:84%
And we have beta s and beta
2 are on the left side.

00:35:57.460 --> 00:36:05.380 align:middle line:90%
So that is just this cut.

00:36:05.380 --> 00:36:07.752 align:middle line:84%
You have s and 2 on the
left side of the cut

00:36:07.752 --> 00:36:09.960 align:middle line:84%
and all the other edges on
the right side of the cut.

00:36:09.960 --> 00:36:13.420 align:middle line:84%
And we have 4, and 2,
and 3 crossing them.

00:36:13.420 --> 00:36:15.980 align:middle line:90%
Now, let's try another cut.

00:36:15.980 --> 00:36:19.030 align:middle line:84%
And I probably should
use a different color.

00:36:19.030 --> 00:36:23.780 align:middle line:90%


00:36:23.780 --> 00:36:31.390 align:middle line:90%
So let's try this cut.

00:36:31.390 --> 00:36:35.420 align:middle line:90%


00:36:35.420 --> 00:36:38.660 align:middle line:84%
Now, we have 5 and t on the
right side and the other four

00:36:38.660 --> 00:36:40.180 align:middle line:90%
edges on the left.

00:36:40.180 --> 00:36:44.690 align:middle line:84%
So what cut does that
correspond to here?

00:36:44.690 --> 00:36:47.860 align:middle line:90%


00:36:47.860 --> 00:36:51.430 align:middle line:84%
That's not a different
color I'm sorry.

00:36:51.430 --> 00:36:54.260 align:middle line:90%


00:36:54.260 --> 00:36:57.350 align:middle line:90%
Let's try making it purple.

00:36:57.350 --> 00:37:04.510 align:middle line:90%


00:37:04.510 --> 00:37:10.980 align:middle line:84%
And I see I have
drawn things wrong.

00:37:10.980 --> 00:37:13.950 align:middle line:90%


00:37:13.950 --> 00:37:20.710 align:middle line:84%
I left out an edge because
there's an edge from b3 to b5.

00:37:20.710 --> 00:37:25.110 align:middle line:84%
So that should look
like this because we

00:37:25.110 --> 00:37:27.470 align:middle line:90%
have three going to 5.

00:37:27.470 --> 00:37:29.330 align:middle line:90%
And that edge had capacity 4.

00:37:29.330 --> 00:37:39.710 align:middle line:90%


00:37:39.710 --> 00:37:45.270 align:middle line:90%
So the value of this cut is 2.

00:37:45.270 --> 00:37:50.070 align:middle line:90%
No wait, it's 4 plus 8.

00:37:50.070 --> 00:37:51.670 align:middle line:90%
That's 12.

00:37:51.670 --> 00:37:55.430 align:middle line:84%
And we don't count
this edge 2 because it

00:37:55.430 --> 00:37:57.510 align:middle line:90%
crosses the cut backwards.

00:37:57.510 --> 00:38:01.430 align:middle line:84%
And we only count edges
that cross the cut forwards.

00:38:01.430 --> 00:38:09.140 align:middle line:90%
And here, we have that cut is--

00:38:09.140 --> 00:38:15.630 align:middle line:90%


00:38:15.630 --> 00:38:19.040 align:middle line:84%
OK, I need a purple line
here, purple line here.

00:38:19.040 --> 00:38:32.310 align:middle line:90%


00:38:32.310 --> 00:38:34.120 align:middle line:90%
No, those are the wrong--

00:38:34.120 --> 00:38:36.950 align:middle line:90%


00:38:36.950 --> 00:38:38.100 align:middle line:90%
I'm sorry about that.

00:38:38.100 --> 00:38:40.610 align:middle line:90%


00:38:40.610 --> 00:38:43.610 align:middle line:84%
So 5 and t are on
one side of this cut.

00:38:43.610 --> 00:38:48.990 align:middle line:84%
So this, this, and this
edge is not across the cut

00:38:48.990 --> 00:38:51.190 align:middle line:84%
because it crosses
the cut backwards.

00:38:51.190 --> 00:38:55.550 align:middle line:90%
So the value of that cut is--

00:38:55.550 --> 00:39:01.100 align:middle line:90%


00:39:01.100 --> 00:39:01.600 align:middle line:90%
no.

00:39:01.600 --> 00:39:05.080 align:middle line:90%


00:39:05.080 --> 00:39:06.380 align:middle line:90%
These vertices are in the cut.

00:39:06.380 --> 00:39:09.420 align:middle line:84%
So the edges are the ones that
go from something not in the cut

00:39:09.420 --> 00:39:10.420 align:middle line:90%
to something in the cut.

00:39:10.420 --> 00:39:18.880 align:middle line:84%
So that's 4 to t, 3 to 5,
and 5 to 4 is backwards edge.

00:39:18.880 --> 00:39:24.940 align:middle line:84%
So the value of that cut
is 8 plus 3, which is 11,

00:39:24.940 --> 00:39:26.100 align:middle line:90%
which is bigger than 9.

00:39:26.100 --> 00:39:27.520 align:middle line:90%
So it's not the minimum cut.

00:39:27.520 --> 00:39:40.360 align:middle line:90%


00:39:40.360 --> 00:39:42.680 align:middle line:84%
STUDENT: I think
the beta 3 to beta 5

00:39:42.680 --> 00:39:44.860 align:middle line:90%
might have the wrong value.

00:39:44.860 --> 00:39:46.400 align:middle line:84%
PETER SHOR: I
think you're right.

00:39:46.400 --> 00:39:51.000 align:middle line:90%
So beta 3 to beta 5 is 4.

00:39:51.000 --> 00:39:53.660 align:middle line:90%
And I put down 3 on here.

00:39:53.660 --> 00:40:00.440 align:middle line:90%


00:40:00.440 --> 00:40:05.880 align:middle line:84%
So let's see beta
3 to beta 5, 3.

00:40:05.880 --> 00:40:08.520 align:middle line:84%
So this is supposed
to be a three.

00:40:08.520 --> 00:40:09.220 align:middle line:90%
Thank you.

00:40:09.220 --> 00:40:20.640 align:middle line:90%


00:40:20.640 --> 00:40:27.080 align:middle line:84%
So we have a cut of
value 11 for there.

00:40:27.080 --> 00:40:31.080 align:middle line:90%
So these are cuts.

00:40:31.080 --> 00:40:40.770 align:middle line:84%
Now, I want to claim the
value of the dual optimum.

00:40:40.770 --> 00:40:56.610 align:middle line:90%


00:40:56.610 --> 00:40:58.810 align:middle line:84%
Well, I want to
label these cuts.

00:40:58.810 --> 00:41:19.470 align:middle line:84%
So let's label this one
as C1, C2, C3, C4, C5.

00:41:19.470 --> 00:41:26.010 align:middle line:90%


00:41:26.010 --> 00:41:33.250 align:middle line:84%
And let's assume that the betas
are put down in order because we

00:41:33.250 --> 00:41:38.650 align:middle line:84%
can always renumber
the variables so

00:41:38.650 --> 00:41:46.090 align:middle line:84%
that the third variable is the
one right after the second cut.

00:41:46.090 --> 00:41:51.750 align:middle line:84%
So the value of the optimum and
the dual is equal to summation.

00:41:51.750 --> 00:41:54.370 align:middle line:90%


00:41:54.370 --> 00:42:04.890 align:middle line:84%
Well, summation
alpha sub ij u of ij,

00:42:04.890 --> 00:42:24.970 align:middle line:84%
which is equal to summation beta
j minus beta j minus 1 times c

00:42:24.970 --> 00:42:28.110 align:middle line:90%
sub j minus 1.

00:42:28.110 --> 00:42:32.250 align:middle line:90%


00:42:32.250 --> 00:42:34.450 align:middle line:90%
Why is that?

00:42:34.450 --> 00:42:37.040 align:middle line:84%
Well, let's look at
this picture again.

00:42:37.040 --> 00:42:43.810 align:middle line:90%


00:42:43.810 --> 00:42:53.300 align:middle line:84%
So we have alpha i sub
j equals maximum of 0

00:42:53.300 --> 00:42:55.280 align:middle line:90%
and beta j minus beta sub i.

00:42:55.280 --> 00:43:00.100 align:middle line:90%


00:43:00.100 --> 00:43:10.580 align:middle line:84%
So this is equal to summation
over forward edges beta j

00:43:10.580 --> 00:43:14.380 align:middle line:90%
minus beta i u of ij.

00:43:14.380 --> 00:43:19.380 align:middle line:90%


00:43:19.380 --> 00:43:21.780 align:middle line:90%
Now, let's look at this edge.

00:43:21.780 --> 00:43:25.140 align:middle line:90%
This edge appears in two cuts.

00:43:25.140 --> 00:43:31.940 align:middle line:84%
And its value in the first
cut is beta t minus beta 5

00:43:31.940 --> 00:43:35.000 align:middle line:90%
times the value times 8.

00:43:35.000 --> 00:43:37.900 align:middle line:84%
The value of contributing
the second cut

00:43:37.900 --> 00:43:43.180 align:middle line:90%
is beta 5 minus beta 4 times 8.

00:43:43.180 --> 00:43:48.100 align:middle line:84%
So adding them up, when
you sum up all the cuts,

00:43:48.100 --> 00:43:54.800 align:middle line:84%
you get beta t minus beta
4 times 8 for the value

00:43:54.800 --> 00:44:05.020 align:middle line:84%
this edge contributes to the
dual, which is exactly what it's

00:44:05.020 --> 00:44:05.840 align:middle line:90%
supposed to be.

00:44:05.840 --> 00:44:12.020 align:middle line:90%


00:44:12.020 --> 00:44:13.880 align:middle line:84%
OK, so this is the
trickiest part.

00:44:13.880 --> 00:44:17.360 align:middle line:84%
So should I explain
it some more?

00:44:17.360 --> 00:44:31.120 align:middle line:90%


00:44:31.120 --> 00:44:40.220 align:middle line:84%
So the cuts only
come from the edges

00:44:40.220 --> 00:44:42.540 align:middle line:84%
where beta 5 is
bigger than beta 4.

00:44:42.540 --> 00:44:47.250 align:middle line:84%
So this edge does not
contribute anything to the cut.

00:44:47.250 --> 00:44:49.750 align:middle line:84%
If there's an edge
that goes forward,

00:44:49.750 --> 00:44:55.990 align:middle line:84%
it contributes beta t minus beta
5 times 8 to this cut and beta

00:44:55.990 --> 00:44:59.830 align:middle line:84%
5 minus beta 4
times 8 to this cut.

00:44:59.830 --> 00:45:01.390 align:middle line:84%
And adding those
two things up, you

00:45:01.390 --> 00:45:09.790 align:middle line:84%
get beta t minus beta 4 times
8 to the total objective

00:45:09.790 --> 00:45:16.210 align:middle line:84%
function of the dual, which is
just what it's supposed to be,

00:45:16.210 --> 00:45:20.090 align:middle line:84%
because alpha ij is equal
to beta j minus beta i.

00:45:20.090 --> 00:45:45.430 align:middle line:90%


00:45:45.430 --> 00:45:47.900 align:middle line:84%
Oh, wait, I think I
wanted to keep that.

00:45:47.900 --> 00:46:30.150 align:middle line:90%


00:46:30.150 --> 00:46:40.270 align:middle line:84%
Objective function of
dual is summation beta j

00:46:40.270 --> 00:46:45.940 align:middle line:84%
minus beta j minus
1 c sub j minus 1.

00:46:45.940 --> 00:46:53.320 align:middle line:90%


00:46:53.320 --> 00:46:58.760 align:middle line:84%
But summation beta j
minus beta j minus 1

00:46:58.760 --> 00:47:04.160 align:middle line:84%
is equal to beta t minus
beta s is equal to 1

00:47:04.160 --> 00:47:06.470 align:middle line:84%
because beta t was
1, beta s was 0.

00:47:06.470 --> 00:47:10.160 align:middle line:90%


00:47:10.160 --> 00:47:17.720 align:middle line:84%
Let beta j minus beta j
minus 1 equals lambda j.

00:47:17.720 --> 00:47:24.400 align:middle line:84%
So this equals summation
lambda j c j minus 1.

00:47:24.400 --> 00:47:30.440 align:middle line:84%
OK, maybe lambda j minus 1,
lambda J minus 1, c j minus 1,

00:47:30.440 --> 00:47:35.900 align:middle line:84%
where summation lambda
j minus 1 equals 1.

00:47:35.900 --> 00:47:42.280 align:middle line:90%


00:47:42.280 --> 00:47:56.932 align:middle line:84%
This is an average
of values of cuts

00:47:56.932 --> 00:47:59.480 align:middle line:84%
just by the
definition of average.

00:47:59.480 --> 00:48:02.440 align:middle line:84%
But the average of
a bunch of things

00:48:02.440 --> 00:48:05.360 align:middle line:84%
is bigger than the minimum
of the bunch of things.

00:48:05.360 --> 00:48:12.600 align:middle line:84%
So this is greater than or
equal to the minimum cut.

00:48:12.600 --> 00:48:16.520 align:middle line:84%
And in the optimal
solution of the dual,

00:48:16.520 --> 00:48:18.640 align:middle line:84%
you take the
minimum cut, you can

00:48:18.640 --> 00:48:23.460 align:middle line:84%
put zeros on the beta sub j's
that are to the left of the cut

00:48:23.460 --> 00:48:26.340 align:middle line:84%
and 1 on the beta j's
to the right of the cut.

00:48:26.340 --> 00:48:28.360 align:middle line:84%
So you get the minimum
value of the cut

00:48:28.360 --> 00:48:30.560 align:middle line:90%
for the solution of the dual.

00:48:30.560 --> 00:48:38.880 align:middle line:84%
So the value of the
dual substitution

00:48:38.880 --> 00:48:43.010 align:middle line:90%
is equal to the minimum cut.

00:48:43.010 --> 00:48:46.570 align:middle line:84%
And we know that the value
of the primal solution

00:48:46.570 --> 00:48:50.410 align:middle line:84%
is equal to the maximum
flow because that's

00:48:50.410 --> 00:48:52.210 align:middle line:90%
the way we set up the LP.

00:48:52.210 --> 00:48:55.520 align:middle line:84%
So the maximum flow is
equal to the minimum cut.

00:48:55.520 --> 00:49:04.170 align:middle line:90%


00:49:04.170 --> 00:49:11.450 align:middle line:84%
So the next thing I want to
do, which I don't think I'm

00:49:11.450 --> 00:49:14.070 align:middle line:84%
going to quite get through
all the lecture notes today--

00:49:14.070 --> 00:49:19.650 align:middle line:84%
but what I've done today
so far is the thing

00:49:19.650 --> 00:49:21.930 align:middle line:90%
that I really want you to take--

00:49:21.930 --> 00:49:26.370 align:middle line:84%
the lesson I want you to take
home, that looking at the duals

00:49:26.370 --> 00:49:30.250 align:middle line:84%
and analyzing them can give
you very interesting theorems

00:49:30.250 --> 00:49:33.200 align:middle line:90%
about linear programs.

00:49:33.200 --> 00:49:37.620 align:middle line:90%


00:49:37.620 --> 00:49:44.090 align:middle line:84%
I want to say this is
a fundamental principle

00:49:44.090 --> 00:49:46.330 align:middle line:90%
in combinatorial optimization.

00:49:46.330 --> 00:49:52.410 align:middle line:84%
And if you actually get a
linear program from somewhere,

00:49:52.410 --> 00:49:54.710 align:middle line:84%
one of the first things you
do is you look at the dual.

00:49:54.710 --> 00:49:55.610 align:middle line:90%
You stare at it.

00:49:55.610 --> 00:50:01.930 align:middle line:84%
And you say, what does this mean
in terms of the actual problem

00:50:01.930 --> 00:50:03.490 align:middle line:90%
you're studying?

00:50:03.490 --> 00:50:07.890 align:middle line:84%
And often, it will give you
some insight into the problem.

00:50:07.890 --> 00:50:09.030 align:middle line:90%
Sometimes, it won't.

00:50:09.030 --> 00:50:18.210 align:middle line:84%
Sometimes, it just looks
like a bunch of variables

00:50:18.210 --> 00:50:19.870 align:middle line:84%
that you can't
understand at all.

00:50:19.870 --> 00:50:37.180 align:middle line:90%


00:50:37.180 --> 00:50:38.880 align:middle line:90%
I think we can erase this now.

00:50:38.880 --> 00:50:59.340 align:middle line:90%


00:50:59.340 --> 00:51:18.840 align:middle line:84%
Suppose you have a maximum flow
problem with integer capacities.

00:51:18.840 --> 00:51:29.860 align:middle line:90%


00:51:29.860 --> 00:51:33.350 align:middle line:90%
Then the solution is an integer.

00:51:33.350 --> 00:51:43.060 align:middle line:90%


00:51:43.060 --> 00:51:53.810 align:middle line:84%
Proof-- the dual
solution is a cut.

00:51:53.810 --> 00:51:56.380 align:middle line:90%


00:51:56.380 --> 00:52:09.980 align:middle line:84%
So it's a sum of integers
because the capacity of a cut

00:52:09.980 --> 00:52:11.760 align:middle line:84%
is the sum of the
capacities of the edges.

00:52:11.760 --> 00:52:14.540 align:middle line:84%
And the capacities of
the edges are integers.

00:52:14.540 --> 00:52:34.030 align:middle line:84%
So we can ask the question,
does the primal solution also

00:52:34.030 --> 00:52:37.040 align:middle line:90%
have, I guess, integer flows?

00:52:37.040 --> 00:52:44.950 align:middle line:90%


00:52:44.950 --> 00:52:46.790 align:middle line:90%
Because maybe it doesn't.

00:52:46.790 --> 00:52:51.830 align:middle line:84%
I mean, there are certainly
solutions where it doesn't.

00:52:51.830 --> 00:52:59.990 align:middle line:84%
I mean, you can
imagine coming up

00:52:59.990 --> 00:53:07.470 align:middle line:84%
with a solution where you have,
I guess, 6.5 units of flow

00:53:07.470 --> 00:53:12.710 align:middle line:84%
flowing over this edge and 1.5
units flowing over that edge

00:53:12.710 --> 00:53:15.330 align:middle line:90%
and adding up to 9.

00:53:15.330 --> 00:53:17.730 align:middle line:84%
So I guess I can't
do arithmetic.

00:53:17.730 --> 00:53:21.830 align:middle line:90%


00:53:21.830 --> 00:53:26.590 align:middle line:84%
But you also know that all
the edges, all the flows going

00:53:26.590 --> 00:53:30.030 align:middle line:84%
across a cut have to be equal
to the value of that cut--

00:53:30.030 --> 00:53:32.040 align:middle line:84%
the edges and the
capacities in that cut.

00:53:32.040 --> 00:53:34.510 align:middle line:84%
So you know some edges
have to be integers.

00:53:34.510 --> 00:53:36.870 align:middle line:84%
So the question is,
do all the edges--

00:53:36.870 --> 00:53:40.990 align:middle line:84%
can you find a solution
with all the edges integers?

00:53:40.990 --> 00:53:46.030 align:middle line:90%
And the answer is yes.

00:53:46.030 --> 00:53:49.670 align:middle line:84%
And I don't know
how to do it easily,

00:53:49.670 --> 00:53:51.790 align:middle line:90%
working from the linear program.

00:53:51.790 --> 00:53:57.470 align:middle line:84%
So there's another algorithm
for integer flows--

00:53:57.470 --> 00:54:02.780 align:middle line:90%
algorithm for max flow--

00:54:02.780 --> 00:54:05.710 align:middle line:90%


00:54:05.710 --> 00:54:08.610 align:middle line:84%
which I'm going to call
augmenting paths algorithm.

00:54:08.610 --> 00:54:17.150 align:middle line:90%


00:54:17.150 --> 00:54:33.235 align:middle line:84%
And the idea-- find a
path, push as much flow

00:54:33.235 --> 00:54:34.810 align:middle line:90%
over this path as possible.

00:54:34.810 --> 00:54:47.480 align:middle line:90%


00:54:47.480 --> 00:54:53.720 align:middle line:84%
So as much flow over
this path as possible,

00:54:53.720 --> 00:54:58.240 align:middle line:84%
you will take the
minimum residual capacity

00:54:58.240 --> 00:55:02.080 align:middle line:90%
in every edge and the path.

00:55:02.080 --> 00:55:10.440 align:middle line:84%
And that means that the residual
capacity is always an integer

00:55:10.440 --> 00:55:14.360 align:middle line:84%
because the flows are integers
and the capacities are integers.

00:55:14.360 --> 00:55:18.180 align:middle line:84%
So that means that the whole
thing will be an integer.

00:55:18.180 --> 00:55:19.300 align:middle line:90%
So let's try this.

00:55:19.300 --> 00:55:23.760 align:middle line:90%


00:55:23.760 --> 00:55:25.400 align:middle line:90%
And let's see.

00:55:25.400 --> 00:55:27.480 align:middle line:90%
We have a simple network--

00:55:27.480 --> 00:55:39.960 align:middle line:90%


00:55:39.960 --> 00:55:49.400 align:middle line:90%
2, 2, 3, 3.

00:55:49.400 --> 00:55:50.600 align:middle line:90%
These are the capacities--

00:55:50.600 --> 00:55:52.040 align:middle line:90%
2, 2.

00:55:52.040 --> 00:55:57.760 align:middle line:84%
And let's put another edge from
here to here with a capacity 3.

00:55:57.760 --> 00:56:00.030 align:middle line:84%
And we're going to direct
all the edges to the right.

00:56:00.030 --> 00:56:05.870 align:middle line:90%


00:56:05.870 --> 00:56:06.370 align:middle line:90%
Good.

00:56:06.370 --> 00:56:10.200 align:middle line:90%


00:56:10.200 --> 00:56:13.160 align:middle line:90%
So the first step--

00:56:13.160 --> 00:56:19.900 align:middle line:84%
let's take the best path to
push flow from here to here.

00:56:19.900 --> 00:56:25.820 align:middle line:84%
So let's take 3 along here, 3
along here, and 3 along here.

00:56:25.820 --> 00:56:29.664 align:middle line:90%


00:56:29.664 --> 00:56:35.810 align:middle line:84%
Now, how much capacity
remains in the graph?

00:56:35.810 --> 00:56:42.390 align:middle line:84%
Well, there's 0 left in this
edge, 0 left along this edge,

00:56:42.390 --> 00:56:44.730 align:middle line:90%
and 0 left along this edge.

00:56:44.730 --> 00:56:50.370 align:middle line:84%
So it looks like we have a
cut between the left side

00:56:50.370 --> 00:56:54.410 align:middle line:90%
and the right side with--

00:56:54.410 --> 00:56:59.690 align:middle line:84%
and you can't put
any more flow across.

00:56:59.690 --> 00:57:01.530 align:middle line:84%
But of course, you
should know-- you

00:57:01.530 --> 00:57:05.410 align:middle line:84%
should realize that you
could easily put a flow of 4

00:57:05.410 --> 00:57:07.770 align:middle line:90%
on the original graph.

00:57:07.770 --> 00:57:16.590 align:middle line:84%
So you have to be clever
to use this algorithm.

00:57:16.590 --> 00:57:22.650 align:middle line:90%


00:57:22.650 --> 00:57:28.280 align:middle line:84%
So how can we push more
flow across this graph?

00:57:28.280 --> 00:57:31.490 align:middle line:90%


00:57:31.490 --> 00:57:33.960 align:middle line:84%
I want to claim that
we could use this path.

00:57:33.960 --> 00:57:41.610 align:middle line:90%


00:57:41.610 --> 00:57:47.210 align:middle line:84%
So this path, we push a 2
across here, push 2 across here.

00:57:47.210 --> 00:57:49.890 align:middle line:84%
And now, we're going the
wrong way in the edge.

00:57:49.890 --> 00:57:51.970 align:middle line:84%
But we can do that
because there's already

00:57:51.970 --> 00:57:54.570 align:middle line:90%
a flow of 3 across this edge.

00:57:54.570 --> 00:58:00.930 align:middle line:84%
And so to get a flow of 2 this
way, we just reduce this 3 to 1.

00:58:00.930 --> 00:58:06.730 align:middle line:84%
And then we can push another
flow of 2 across here

00:58:06.730 --> 00:58:10.130 align:middle line:84%
and another flow
of 2 across here.

00:58:10.130 --> 00:58:15.530 align:middle line:84%
So you can push flow across
edges backwards, as long

00:58:15.530 --> 00:58:21.870 align:middle line:90%
as there is a flow left--

00:58:21.870 --> 00:58:24.560 align:middle line:90%


00:58:24.560 --> 00:58:29.060 align:middle line:84%
as long as there's a flow
already along an edge.

00:58:29.060 --> 00:58:34.510 align:middle line:84%
So I want to claim
define residual network.

00:58:34.510 --> 00:58:42.220 align:middle line:90%


00:58:42.220 --> 00:59:01.020 align:middle line:84%
If an edge has flow x
sub ij less than u of ij,

00:59:01.020 --> 00:59:10.380 align:middle line:84%
the new capacity is u
of ij minus x sub ij.

00:59:10.380 --> 00:59:15.580 align:middle line:90%


00:59:15.580 --> 00:59:26.620 align:middle line:84%
If an edge has flow x
sub ij greater than 0,

00:59:26.620 --> 00:59:36.860 align:middle line:84%
there's an edge in
residual network with--

00:59:36.860 --> 00:59:42.552 align:middle line:90%


00:59:42.552 --> 00:59:57.060 align:middle line:84%
so let's call this edge eij e
sub ji with capacity x sub ij.

00:59:57.060 --> 01:00:00.700 align:middle line:90%


01:00:00.700 --> 01:00:07.860 align:middle line:84%
So what is the residual
network for this graph when we

01:00:07.860 --> 01:00:12.240 align:middle line:90%
put the orange flow across it?

01:00:12.240 --> 01:00:21.350 align:middle line:90%


01:00:21.350 --> 01:00:24.710 align:middle line:90%
Well, this had capacity 3.

01:00:24.710 --> 01:00:31.230 align:middle line:84%
So now, that edge has capacity
3 in the opposite direction.

01:00:31.230 --> 01:00:32.290 align:middle line:90%
This edge has 0.

01:00:32.290 --> 01:00:36.750 align:middle line:90%
So that has capacity 0, 2, 2.

01:00:36.750 --> 01:00:41.210 align:middle line:84%
This edge also has capacity
3 and flow 3 in the forward.

01:00:41.210 --> 01:00:47.150 align:middle line:84%
So now, we get capacity 3 going
in the backwards direction.

01:00:47.150 --> 01:00:51.150 align:middle line:84%
And this one, we have capacity
3 in the backwards direction.

01:00:51.150 --> 01:00:54.553 align:middle line:84%
And this has capacity 3 in the
forwards and the capacity 3

01:00:54.553 --> 01:00:55.220 align:middle line:90%
in the forwards.

01:00:55.220 --> 01:00:59.640 align:middle line:90%


01:00:59.640 --> 01:01:01.500 align:middle line:90%
So this is a residual network.

01:01:01.500 --> 01:01:12.198 align:middle line:90%


01:01:12.198 --> 01:01:14.670 align:middle line:84%
And now, you can see that
there's a flow of 2 that

01:01:14.670 --> 01:01:19.710 align:middle line:90%
goes bum, bum, bum, bum, bum.

01:01:19.710 --> 01:01:23.270 align:middle line:90%
So we push this flow of 2 here.

01:01:23.270 --> 01:01:26.770 align:middle line:84%
And we get-- here, I'm
going to redraw this.

01:01:26.770 --> 01:01:33.270 align:middle line:90%


01:01:33.270 --> 01:01:46.150 align:middle line:84%
We get 2, 2, and 1 going this
way, and 3 going this way,

01:01:46.150 --> 01:01:50.180 align:middle line:90%
and 2, 2, and 3.

01:01:50.180 --> 01:01:55.550 align:middle line:90%


01:01:55.550 --> 01:02:01.670 align:middle line:84%
So now, we have a flow from the
source to the sink with value 5.

01:02:01.670 --> 01:02:03.790 align:middle line:84%
And that's the best you
can do because you can see

01:02:03.790 --> 01:02:06.630 align:middle line:90%
that there's a cut of value 5.

01:02:06.630 --> 01:02:10.270 align:middle line:84%
With just taking t
and everything else,

01:02:10.270 --> 01:02:13.890 align:middle line:84%
you can get at most
value 5 across this cut.

01:02:13.890 --> 01:02:33.200 align:middle line:90%


01:02:33.200 --> 01:03:04.360 align:middle line:84%
So claim-- if there is no
flow in residual network,

01:03:04.360 --> 01:03:11.750 align:middle line:84%
then there is a cut
in original graph.

01:03:11.750 --> 01:03:18.200 align:middle line:90%


01:03:18.200 --> 01:03:23.160 align:middle line:90%
So if you have a value--

01:03:23.160 --> 01:03:26.400 align:middle line:84%
so I guess I should
have started this

01:03:26.400 --> 01:03:41.440 align:middle line:84%
with suppose you have
a flow of value z.

01:03:41.440 --> 01:03:45.840 align:middle line:84%
If there is no augmenting
path in the residual network,

01:03:45.840 --> 01:04:11.320 align:middle line:84%
then there's a cut in the
original graph of value v.

01:04:11.320 --> 01:04:35.210 align:middle line:84%
If there's no flow in the
residual network, let s be--

01:04:35.210 --> 01:04:48.590 align:middle line:84%
maybe c be set of nodes
you can reach from s.

01:04:48.590 --> 01:04:53.970 align:middle line:90%


01:04:53.970 --> 01:04:58.530 align:middle line:90%
So let's say we have this thing.

01:04:58.530 --> 01:05:03.350 align:middle line:84%
So what nodes can
you reach from s?

01:05:03.350 --> 01:05:05.610 align:middle line:84%
Actually, you can't
reach any nodes from s

01:05:05.610 --> 01:05:08.910 align:middle line:90%
because this is at capacity.

01:05:08.910 --> 01:05:10.410 align:middle line:90%
This is at capacity.

01:05:10.410 --> 01:05:24.970 align:middle line:84%
So we could have made this
capacity 4 and this capacity 4.

01:05:24.970 --> 01:05:29.290 align:middle line:84%
And this is still a good
flow in the residual network.

01:05:29.290 --> 01:05:32.520 align:middle line:84%
And now, what
nodes can we reach?

01:05:32.520 --> 01:05:38.290 align:middle line:90%


01:05:38.290 --> 01:05:44.560 align:middle line:90%
Well, we can reach this node.

01:05:44.560 --> 01:05:47.850 align:middle line:90%


01:05:47.850 --> 01:05:52.490 align:middle line:84%
We cannot reach this node
because this is at capacity.

01:05:52.490 --> 01:05:54.400 align:middle line:90%
We can reach this node.

01:05:54.400 --> 01:05:58.110 align:middle line:90%


01:05:58.110 --> 01:05:58.610 align:middle line:90%
Oops.

01:05:58.610 --> 01:06:05.010 align:middle line:90%


01:06:05.010 --> 01:06:15.900 align:middle line:84%
And we actually can reach this
node because it's at capacity.

01:06:15.900 --> 01:06:17.300 align:middle line:90%
But we cannot reach this node.

01:06:17.300 --> 01:06:19.020 align:middle line:90%
And we cannot reach this node.

01:06:19.020 --> 01:06:21.580 align:middle line:90%
So we have a cut here.

01:06:21.580 --> 01:06:26.580 align:middle line:84%
And that corresponds
to this cut here.

01:06:26.580 --> 01:06:42.740 align:middle line:84%
So every edge from c to c-bar,
the flow is equal to u of ij

01:06:42.740 --> 01:06:45.420 align:middle line:84%
because, otherwise,
you could push flow

01:06:45.420 --> 01:06:51.620 align:middle line:84%
from c to c-bar and
every edge from c-bar to

01:06:51.620 --> 01:06:55.900 align:middle line:90%
c x sub ij equals 0.

01:06:55.900 --> 01:06:58.820 align:middle line:84%
Because otherwise, you
could push extra flow

01:06:58.820 --> 01:07:02.740 align:middle line:90%
backwards along this edge.

01:07:02.740 --> 01:07:19.020 align:middle line:84%
And that says the cut
equals some c c-bar u of ij

01:07:19.020 --> 01:07:19.770 align:middle line:90%
equals flow.

01:07:19.770 --> 01:07:22.700 align:middle line:90%


01:07:22.700 --> 01:07:28.300 align:middle line:84%
So if you cannot find
any augmenting paths,

01:07:28.300 --> 01:07:35.200 align:middle line:84%
if you already have a partial
flow, then you're done.

01:07:35.200 --> 01:07:37.290 align:middle line:90%
You cannot get any further.

01:07:37.290 --> 01:07:42.700 align:middle line:90%


01:07:42.700 --> 01:07:45.220 align:middle line:90%
Yeah, I mean, then you have--

01:07:45.220 --> 01:07:48.640 align:middle line:84%
that is the value
of the maximum flow

01:07:48.640 --> 01:07:53.500 align:middle line:84%
because you have found a minimum
cut that is equal to your flow.

01:07:53.500 --> 01:07:57.980 align:middle line:84%
So this says that you can
use the augmenting paths

01:07:57.980 --> 01:08:03.740 align:middle line:90%
algorithm to find max flows.

01:08:03.740 --> 01:08:08.310 align:middle line:84%
And it will give
you an integer flow

01:08:08.310 --> 01:08:11.430 align:middle line:84%
if all the capacities
are integer, which

01:08:11.430 --> 01:08:16.069 align:middle line:90%
is what we wanted to show.

01:08:16.069 --> 01:08:20.590 align:middle line:84%
And actually, there's
an application

01:08:20.590 --> 01:08:24.950 align:middle line:84%
of this, which maybe I'm
going to get through.

01:08:24.950 --> 01:08:26.219 align:middle line:90%
And this is König's theorem.

01:08:26.219 --> 01:08:29.649 align:middle line:90%


01:08:29.649 --> 01:08:30.149 align:middle line:90%
Oops.

01:08:30.149 --> 01:08:48.990 align:middle line:90%


01:08:48.990 --> 01:08:49.830 align:middle line:90%
All right.

01:08:49.830 --> 01:08:57.670 align:middle line:84%
In a bipartite graph,
the cardinality

01:08:57.670 --> 01:09:11.050 align:middle line:84%
of the maximum matching
equals cardinality.

01:09:11.050 --> 01:09:13.790 align:middle line:90%


01:09:13.790 --> 01:09:15.470 align:middle line:90%
of minimum vertex cover.

01:09:15.470 --> 01:09:33.183 align:middle line:90%


01:09:33.183 --> 01:09:34.100 align:middle line:90%
Let's look at a graph.

01:09:34.100 --> 01:09:44.430 align:middle line:90%


01:09:44.430 --> 01:09:46.830 align:middle line:90%
So this is a bipartite graph.

01:09:46.830 --> 01:09:53.830 align:middle line:84%
And what would be
a maximum matching?

01:09:53.830 --> 01:10:02.030 align:middle line:84%
Well, I mean, we clearly
should put this vertex

01:10:02.030 --> 01:10:05.800 align:middle line:84%
in the matching, this
vertex in the matching.

01:10:05.800 --> 01:10:07.860 align:middle line:84%
I guess we need
another vertex here.

01:10:07.860 --> 01:10:12.920 align:middle line:90%


01:10:12.920 --> 01:10:16.243 align:middle line:84%
And we can put this vertex in
the matching and this vertex

01:10:16.243 --> 01:10:16.910 align:middle line:90%
in the matching.

01:10:16.910 --> 01:10:20.200 align:middle line:90%


01:10:20.200 --> 01:10:28.120 align:middle line:84%
So the maximum
matching equals 4.

01:10:28.120 --> 01:10:31.480 align:middle line:84%
So the maximum matching
is just the maximum set

01:10:31.480 --> 01:10:34.030 align:middle line:84%
of edges such that no
two share an point.

01:10:34.030 --> 01:10:37.120 align:middle line:90%


01:10:37.120 --> 01:10:52.070 align:middle line:84%
Minimum vertex cover-- set of
vertices that touch every edge.

01:10:52.070 --> 01:10:57.360 align:middle line:90%


01:10:57.360 --> 01:11:07.240 align:middle line:84%
And clearly, vertex
cover is greater than

01:11:07.240 --> 01:11:14.040 align:middle line:84%
or equal to the
matching because there

01:11:14.040 --> 01:11:18.102 align:middle line:84%
must be a vertex that
touches one endpoint of each

01:11:18.102 --> 01:11:19.310 align:middle line:90%
of the edges in the matching.

01:11:19.310 --> 01:11:24.580 align:middle line:90%


01:11:24.580 --> 01:11:28.560 align:middle line:84%
I mean, you're not going
to get less than that.

01:11:28.560 --> 01:11:31.560 align:middle line:84%
But Konig's theorem is
that these two quantities

01:11:31.560 --> 01:11:33.940 align:middle line:90%
are actually equal.

01:11:33.940 --> 01:11:51.580 align:middle line:84%
And proof-- maximum
flow, mincut.

01:11:51.580 --> 01:12:02.210 align:middle line:90%


01:12:02.210 --> 01:12:06.890 align:middle line:84%
We want a flow whose value
is equal to the matching.

01:12:06.890 --> 01:12:08.070 align:middle line:90%
So what are we going to do?

01:12:08.070 --> 01:12:16.770 align:middle line:84%
Well, we're going to
take s on the left

01:12:16.770 --> 01:12:20.170 align:middle line:84%
and put an put an
edge of weight 1

01:12:20.170 --> 01:12:23.690 align:middle line:90%
to every vertex in the matching.

01:12:23.690 --> 01:12:28.450 align:middle line:90%
And now, we're going to--

01:12:28.450 --> 01:12:32.450 align:middle line:84%
and let's do the same
thing on the right.

01:12:32.450 --> 01:12:39.450 align:middle line:84%
We'll put an edge to the
sink from every point

01:12:39.450 --> 01:12:41.810 align:middle line:84%
on the right side of
the bipartite graph.

01:12:41.810 --> 01:12:46.690 align:middle line:84%
And these capacities
are going to be 1.

01:12:46.690 --> 01:12:52.150 align:middle line:90%
And now, let's see.

01:12:52.150 --> 01:13:16.924 align:middle line:90%


01:13:16.924 --> 01:13:26.200 align:middle line:84%
There is a max flow
with integer values.

01:13:26.200 --> 01:13:29.860 align:middle line:90%


01:13:29.860 --> 01:13:34.060 align:middle line:90%
And what that means is that--

01:13:34.060 --> 01:13:39.100 align:middle line:84%
oh, and we can let the
capacities of these middle edges

01:13:39.100 --> 01:13:40.370 align:middle line:90%
be infinity if we want.

01:13:40.370 --> 01:13:48.660 align:middle line:90%


01:13:48.660 --> 01:13:53.300 align:middle line:84%
Well, what that
means is that there

01:13:53.300 --> 01:13:58.780 align:middle line:84%
are going to be some number
of edges in the middle which

01:13:58.780 --> 01:14:02.480 align:middle line:90%
have weight 1 here.

01:14:02.480 --> 01:14:05.380 align:middle line:84%
So I want to claim that those
are clearly a maximum matching

01:14:05.380 --> 01:14:16.460 align:middle line:84%
because, on the right-hand
side, if there's

01:14:16.460 --> 01:14:19.220 align:middle line:84%
1 unit of flow
from here to here,

01:14:19.220 --> 01:14:24.900 align:middle line:84%
then no other edge
could use this vertex.

01:14:24.900 --> 01:14:28.020 align:middle line:84%
So if you have a flow
from here to here,

01:14:28.020 --> 01:14:33.000 align:middle line:84%
then this edge is
in the matching.

01:14:33.000 --> 01:14:34.920 align:middle line:84%
And neither of these
edges is in the matching

01:14:34.920 --> 01:14:36.620 align:middle line:90%
and similarly on the left.

01:14:36.620 --> 01:14:42.860 align:middle line:84%
So the maximum flow gives
you a maximum matching.

01:14:42.860 --> 01:14:47.660 align:middle line:90%
Dual is a cut.

01:14:47.660 --> 01:14:50.900 align:middle line:84%
And that means that
there's a cut whose value

01:14:50.900 --> 01:14:53.220 align:middle line:90%
is equal to the maximum flow.

01:14:53.220 --> 01:14:57.940 align:middle line:84%
And there are going to be
some edges on the right, which

01:14:57.940 --> 01:15:03.940 align:middle line:84%
are cut, and some edges on the
left, which are in the cut.

01:15:03.940 --> 01:15:16.700 align:middle line:84%
And I don't think
I did that right.

01:15:16.700 --> 01:15:26.140 align:middle line:84%
But if the edge is in
the cut, then this vertex

01:15:26.140 --> 01:15:28.220 align:middle line:90%
is in the vertex cover.

01:15:28.220 --> 01:15:33.340 align:middle line:84%
And now, we know that there
aren't any other paths from s

01:15:33.340 --> 01:15:34.220 align:middle line:90%
to t.

01:15:34.220 --> 01:15:39.940 align:middle line:84%
And that means that we know
that every vertex, every edge

01:15:39.940 --> 01:15:41.560 align:middle line:84%
is covered by at
least one vertex

01:15:41.560 --> 01:15:44.500 align:middle line:84%
because, otherwise, there
would be a path from s to t

01:15:44.500 --> 01:15:45.680 align:middle line:90%
going through that edge.

01:15:45.680 --> 01:15:59.830 align:middle line:90%


01:15:59.830 --> 01:16:00.730 align:middle line:90%
Let me see.

01:16:00.730 --> 01:16:17.790 align:middle line:90%


01:16:17.790 --> 01:16:21.390 align:middle line:84%
OK, I did not prepare this
quite properly enough.

01:16:21.390 --> 01:16:24.790 align:middle line:90%
So this is an edge in the cut.

01:16:24.790 --> 01:16:26.850 align:middle line:84%
This, I believe, has to
be an edge in the cut.

01:16:26.850 --> 01:16:39.635 align:middle line:90%


01:16:39.635 --> 01:16:42.130 align:middle line:84%
And you can just say this
is an edge in the cut.

01:16:42.130 --> 01:16:44.950 align:middle line:90%


01:16:44.950 --> 01:16:46.600 align:middle line:90%
There should be one more thing.

01:16:46.600 --> 01:16:52.040 align:middle line:90%


01:16:52.040 --> 01:16:56.740 align:middle line:84%
And that means so there are
three edges in this cut.

01:16:56.740 --> 01:17:00.200 align:middle line:84%
And I think that cut
actually cuts all the paths

01:17:00.200 --> 01:17:02.920 align:middle line:90%
from left to right.

01:17:02.920 --> 01:17:09.200 align:middle line:84%
So we should have a
maximum matching of only 3.

01:17:09.200 --> 01:17:13.560 align:middle line:90%
And well, it's easy--

01:17:13.560 --> 01:17:16.780 align:middle line:90%
1, 2, 3.

01:17:16.780 --> 01:17:20.480 align:middle line:90%


01:17:20.480 --> 01:17:23.170 align:middle line:84%
And you can't get any more
things in the maximum matching

01:17:23.170 --> 01:17:23.670 align:middle line:90%
because--

01:17:23.670 --> 01:17:27.680 align:middle line:90%


01:17:27.680 --> 01:17:30.200 align:middle line:90%
because there's a cut.

01:17:30.200 --> 01:17:33.560 align:middle line:90%
So this is Konig's theorem.

01:17:33.560 --> 01:17:36.060 align:middle line:84%
And I seem to be
completely out of time.

01:17:36.060 --> 01:17:40.720 align:middle line:84%
So I will see you
next time on Thursday

01:17:40.720 --> 01:17:44.910 align:middle line:84%
when we start a new topic
on information theory.

01:17:44.910 --> 01:17:51.000 align:middle line:90%