<s>
Dinic	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
or	O
Dinitz	O
's	O
algorithm	O
is	O
a	O
strongly	O
polynomial	O
algorithm	O
for	O
computing	O
the	O
maximum	B-Algorithm
flow	I-Algorithm
in	O
a	O
flow	B-Algorithm
network	I-Algorithm
,	O
conceived	O
in	O
1970	O
by	O
Israeli	O
(	O
formerly	O
Soviet	O
)	O
computer	O
scientist	O
Yefim	O
(	O
Chaim	O
)	O
A	O
.	O
Dinitz	O
.	O
</s>
<s>
The	O
algorithm	O
runs	O
in	O
time	O
and	O
is	O
similar	O
to	O
the	O
Edmonds	B-Algorithm
–	I-Algorithm
Karp	I-Algorithm
algorithm	I-Algorithm
,	O
which	O
runs	O
in	O
time	O
,	O
in	O
that	O
it	O
uses	O
shortest	O
augmenting	O
paths	O
.	O
</s>
<s>
The	O
introduction	O
of	O
the	O
concepts	O
of	O
the	O
level	O
graph	O
and	O
blocking	B-Algorithm
flow	I-Algorithm
enable	O
Dinic	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
to	O
achieve	O
its	O
performance	O
.	O
</s>
<s>
At	O
the	O
time	O
he	O
was	O
not	O
aware	O
of	O
the	O
basic	O
facts	O
regarding	O
the	O
Ford	B-Algorithm
–	I-Algorithm
Fulkerson	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
In	O
1974	O
,	O
Shimon	O
Even	O
and	O
(	O
his	O
then	O
Ph.D.	O
student	O
)	O
Alon	O
Itai	O
at	O
the	O
Technion	O
in	O
Haifa	O
were	O
very	O
curious	O
and	O
intrigued	O
by	O
Dinitz	O
's	O
algorithm	O
as	O
well	O
as	O
Alexander	O
V	O
.	O
Karzanov	O
's	O
related	O
idea	O
of	O
blocking	B-Algorithm
flow	I-Algorithm
.	O
</s>
<s>
Over	O
the	O
next	O
couple	O
of	O
years	O
,	O
Even	O
gave	O
lectures	O
on	O
"	O
Dinic	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
"	O
,	O
mispronouncing	O
the	O
name	O
of	O
the	O
author	O
while	O
popularizing	O
it	O
.	O
</s>
<s>
Even	O
and	O
Itai	O
also	O
contributed	O
to	O
this	O
algorithm	O
by	O
combining	O
BFS	B-Algorithm
and	O
DFS	B-Algorithm
,	O
which	O
is	O
how	O
the	O
algorithm	O
is	O
now	O
commonly	O
presented	O
.	O
</s>
<s>
For	O
about	O
10	O
years	O
of	O
time	O
after	O
the	O
Ford	B-Algorithm
–	I-Algorithm
Fulkerson	I-Algorithm
algorithm	I-Algorithm
was	O
invented	O
,	O
it	O
was	O
unknown	O
if	O
it	O
could	O
be	O
made	O
to	O
terminate	O
in	O
polynomial	O
time	O
in	O
the	O
general	O
case	O
of	O
irrational	O
edge	O
capacities	O
.	O
</s>
<s>
This	O
caused	O
a	O
lack	O
of	O
any	O
known	O
polynomial-time	O
algorithm	O
to	O
solve	O
the	O
max	B-Algorithm
flow	I-Algorithm
problem	I-Algorithm
in	O
generic	O
cases	O
.	O
</s>
<s>
Dinitz	O
's	O
algorithm	O
and	O
the	O
Edmonds	B-Algorithm
–	I-Algorithm
Karp	I-Algorithm
algorithm	I-Algorithm
(	O
published	O
in	O
1972	O
)	O
both	O
independently	O
showed	O
that	O
in	O
the	O
Ford	B-Algorithm
–	I-Algorithm
Fulkerson	I-Algorithm
algorithm	I-Algorithm
,	O
if	O
each	O
augmenting	O
path	O
is	O
the	O
shortest	O
one	O
,	O
then	O
the	O
length	O
of	O
the	O
augmenting	O
paths	O
is	O
non-decreasing	O
and	O
the	O
algorithm	O
always	O
terminates	O
.	O
</s>
<s>
A	O
blocking	B-Algorithm
flow	I-Algorithm
is	O
an	O
–	O
flow	O
such	O
that	O
the	O
graph	O
with	O
contains	O
no	O
–	O
path	O
.	O
</s>
<s>
Find	O
a	O
blocking	B-Algorithm
flow	I-Algorithm
in	O
.	O
</s>
<s>
It	O
can	O
be	O
shown	O
that	O
the	O
number	O
of	O
layers	O
in	O
each	O
blocking	B-Algorithm
flow	I-Algorithm
increases	O
by	O
at	O
least	O
1	O
each	O
time	O
and	O
thus	O
there	O
are	O
at	O
most	O
blocking	B-Algorithm
flows	I-Algorithm
in	O
the	O
algorithm	O
.	O
</s>
<s>
As	O
a	O
consequence	O
,	O
the	O
running	O
time	O
of	O
Dinic	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
is	O
.	O
</s>
<s>
Using	O
a	O
data	O
structure	O
called	O
dynamic	B-Data_Structure
trees	I-Data_Structure
,	O
the	O
running	O
time	O
of	O
finding	O
a	O
blocking	B-Algorithm
flow	I-Algorithm
in	O
each	O
phase	O
can	O
be	O
reduced	O
to	O
and	O
therefore	O
the	O
running	O
time	O
of	O
Dinic	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
can	O
be	O
improved	O
to	O
.	O
</s>
<s>
Each	O
blocking	B-Algorithm
flow	I-Algorithm
can	O
be	O
found	O
in	O
time	O
,	O
and	O
it	O
can	O
be	O
shown	O
that	O
the	O
number	O
of	O
phases	O
does	O
not	O
exceed	O
and	O
.	O
</s>
<s>
The	O
resulting	O
algorithm	O
is	O
also	O
known	O
as	O
Hopcroft	B-Algorithm
–	I-Algorithm
Karp	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
The	O
following	O
is	O
a	O
simulation	O
of	O
Dinic	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
The	O
paths	O
in	O
blue	O
form	O
a	O
blocking	B-Algorithm
flow	I-Algorithm
.	O
</s>
<s>
Therefore	O
,	O
the	O
blocking	B-Algorithm
flow	I-Algorithm
is	O
of	O
14	O
units	O
and	O
the	O
value	O
of	O
flow	O
is	O
14	O
.	O
</s>
<s>
Note	O
that	O
each	O
augmenting	O
path	O
in	O
the	O
blocking	B-Algorithm
flow	I-Algorithm
has	O
3	O
edges	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
blocking	B-Algorithm
flow	I-Algorithm
is	O
of	O
5	O
units	O
and	O
the	O
value	O
of	O
flow	O
is	O
14	O
+	O
5	O
=	O
19	O
.	O
</s>
<s>
Note	O
that	O
in	O
each	O
blocking	B-Algorithm
flow	I-Algorithm
,	O
the	O
number	O
of	O
edges	O
in	O
the	O
augmenting	O
path	O
increases	O
by	O
at	O
least	O
1	O
.	O
</s>
