<s>
The	O
Hungarian	B-Algorithm
method	I-Algorithm
is	O
a	O
combinatorial	O
optimization	O
algorithm	O
that	O
solves	O
the	O
assignment	B-Algorithm
problem	I-Algorithm
in	O
polynomial	O
time	O
and	O
which	O
anticipated	O
later	O
primal	B-Algorithm
–	I-Algorithm
dual	I-Algorithm
methods	I-Algorithm
.	O
</s>
<s>
It	O
was	O
developed	O
and	O
published	O
in	O
1955	O
by	O
Harold	O
Kuhn	O
,	O
who	O
gave	O
the	O
name	O
"	O
Hungarian	B-Algorithm
method	I-Algorithm
"	O
because	O
the	O
algorithm	O
was	O
largely	O
based	O
on	O
the	O
earlier	O
works	O
of	O
two	O
Hungarian	O
mathematicians	O
:	O
Dénes	O
Kőnig	O
and	O
Jenő	O
Egerváry	O
.	O
</s>
<s>
Ford	O
and	O
Fulkerson	O
extended	O
the	O
method	O
to	O
general	O
maximum	O
flow	O
problems	O
in	O
form	O
of	O
the	O
Ford	B-Algorithm
–	I-Algorithm
Fulkerson	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
In	O
2006	O
,	O
it	O
was	O
discovered	O
that	O
Carl	O
Gustav	O
Jacobi	O
had	O
solved	O
the	O
assignment	B-Algorithm
problem	I-Algorithm
in	O
the	O
19th	O
century	O
,	O
and	O
the	O
solution	O
had	O
been	O
published	O
posthumously	O
in	O
1890	O
in	O
Latin	O
.	O
</s>
<s>
The	O
problem	O
can	O
be	O
represented	O
in	O
a	O
matrix	B-Architecture
of	O
the	O
costs	O
of	O
the	O
workers	O
doing	O
the	O
jobs	O
.	O
</s>
<s>
The	O
Hungarian	B-Algorithm
method	I-Algorithm
,	O
when	O
applied	O
to	O
the	O
above	O
table	O
,	O
would	O
give	O
the	O
minimum	O
cost	O
:	O
this	O
is	O
$15	O
,	O
achieved	O
by	O
having	O
Alice	O
clean	O
the	O
bathroom	O
,	O
Dora	O
sweep	O
the	O
floors	O
,	O
and	O
Bob	O
wash	O
the	O
windows	O
.	O
</s>
<s>
In	O
the	O
matrix	B-Architecture
formulation	O
,	O
we	O
are	O
given	O
a	O
nonnegative	O
n×n	O
matrix	B-Architecture
,	O
where	O
the	O
element	O
in	O
the	O
i-th	O
row	O
and	O
j-th	O
column	O
represents	O
the	O
cost	O
of	O
assigning	O
the	O
j-th	O
job	O
to	O
the	O
i-th	O
worker	O
.	O
</s>
<s>
This	O
can	O
be	O
expressed	O
as	O
permuting	O
the	O
rows	O
of	O
a	O
cost	O
matrix	B-Architecture
C	O
to	O
minimize	O
the	O
trace	O
of	O
a	O
matrix	B-Architecture
,	O
</s>
<s>
where	O
P	O
is	O
a	O
permutation	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
If	O
the	O
goal	O
is	O
to	O
find	O
the	O
assignment	O
that	O
yields	O
the	O
maximum	O
cost	O
,	O
the	O
problem	O
can	O
be	O
solved	O
by	O
negating	O
the	O
cost	O
matrix	B-Architecture
C	O
.	O
</s>
<s>
The	O
Hungarian	B-Algorithm
method	I-Algorithm
finds	O
a	O
perfect	O
matching	O
and	O
a	O
potential	O
such	O
that	O
the	O
matching	O
cost	O
equals	O
the	O
potential	O
value	O
.	O
</s>
<s>
In	O
fact	O
,	O
the	O
Hungarian	B-Algorithm
method	I-Algorithm
finds	O
a	O
perfect	O
matching	O
of	O
tight	O
edges	O
:	O
an	O
edge	O
is	O
called	O
tight	O
for	O
a	O
potential	O
if	O
.	O
</s>
<s>
This	O
can	O
be	O
computed	O
by	O
breadth-first	B-Algorithm
search	I-Algorithm
.	O
</s>
<s>
Sometimes	O
it	O
may	O
turn	O
out	O
that	O
the	O
matrix	B-Architecture
at	O
this	O
stage	O
cannot	O
be	O
used	O
for	O
assigning	O
,	O
as	O
is	O
the	O
case	O
for	O
the	O
matrix	B-Architecture
below	O
.	O
</s>
<s>
All	O
zeros	O
in	O
the	O
matrix	B-Architecture
must	O
be	O
covered	O
by	O
marking	O
as	O
few	O
rows	O
and/or	O
columns	O
as	O
possible	O
.	O
</s>
<s>
Thus	O
,	O
when	O
lines	O
are	O
required	O
,	O
minimum	O
cost	O
assignment	O
can	O
be	O
found	O
by	O
looking	O
at	O
only	O
zeroes	O
in	O
the	O
matrix	B-Architecture
.	O
</s>
