<s>
The	O
Havel	B-Algorithm
–	I-Algorithm
Hakimi	I-Algorithm
algorithm	I-Algorithm
is	O
an	O
algorithm	O
in	O
graph	O
theory	O
solving	O
the	O
graph	O
realization	O
problem	O
.	O
</s>
<s>
That	O
is	O
,	O
it	O
answers	O
the	O
following	O
question	O
:	O
Given	O
a	O
finite	O
list	B-Language
of	O
nonnegative	O
integers	O
in	O
non-increasing	O
order	O
,	O
is	O
there	O
a	O
simple	O
graph	O
such	O
that	O
its	O
degree	O
sequence	O
is	O
exactly	O
this	O
list	B-Language
?	O
</s>
<s>
The	O
degree	O
sequence	O
is	O
a	O
list	B-Language
of	O
numbers	O
in	O
nonincreasing	O
order	O
indicating	O
the	O
number	O
of	O
edges	O
incident	O
to	O
each	O
vertex	O
in	O
the	O
graph	O
.	O
</s>
<s>
If	O
a	O
simple	O
graph	O
exists	O
for	O
exactly	O
the	O
given	O
degree	O
sequence	O
,	O
the	O
list	B-Language
of	O
integers	O
is	O
called	O
graphic	O
.	O
</s>
<s>
The	O
Havel-Hakimi	B-Algorithm
algorithm	I-Algorithm
constructs	O
a	O
special	O
solution	O
if	O
a	O
simple	O
graph	O
for	O
the	O
given	O
degree	O
sequence	O
exists	O
,	O
or	O
proves	O
that	O
one	O
cannot	O
find	O
a	O
positive	O
answer	O
.	O
</s>
<s>
The	O
Havel-Hakimi	B-Algorithm
algorithm	I-Algorithm
is	O
based	O
on	O
the	O
following	O
theorem	O
.	O
</s>
<s>
Let	O
be	O
a	O
finite	O
list	B-Language
of	O
nonnegative	O
integers	O
that	O
is	O
nonincreasing	O
.	O
</s>
<s>
Let	O
be	O
a	O
second	O
finite	O
list	B-Language
of	O
nonnegative	O
integers	O
that	O
is	O
rearranged	O
to	O
be	O
nonincreasing	O
.	O
</s>
<s>
List	B-Language
is	O
graphic	O
if	O
and	O
only	O
if	O
list	B-Language
is	O
graphic	O
.	O
</s>
<s>
If	O
the	O
given	O
list	B-Language
is	O
graphic	O
,	O
then	O
the	O
theorem	O
will	O
be	O
applied	O
at	O
most	O
times	O
setting	O
in	O
each	O
further	O
step	O
.	O
</s>
<s>
Note	O
that	O
it	O
can	O
be	O
necessary	O
to	O
sort	O
this	O
list	B-Language
again	O
.	O
</s>
<s>
This	O
process	O
ends	O
when	O
the	O
whole	O
list	B-Language
consists	O
of	O
zeros	O
.	O
</s>
<s>
In	O
each	O
step	O
of	O
the	O
algorithm	O
,	O
one	O
constructs	O
the	O
edges	O
of	O
a	O
graph	O
with	O
vertices	O
—	O
i.e.	O
,	O
if	O
it	O
is	O
possible	O
to	O
reduce	O
the	O
list	B-Language
to	O
,	O
then	O
we	O
add	O
edges	O
.	O
</s>
<s>
When	O
the	O
list	B-Language
cannot	O
be	O
reduced	O
to	O
a	O
list	B-Language
of	O
nonnegative	O
integers	O
in	O
any	O
step	O
of	O
this	O
approach	O
,	O
the	O
theorem	O
proves	O
that	O
the	O
list	B-Language
from	O
the	O
beginning	O
is	O
not	O
graphic	O
.	O
</s>
<s>
The	O
following	O
is	O
a	O
summary	O
based	O
on	O
the	O
proof	O
of	O
the	O
Havel-Hakimi	B-Algorithm
algorithm	I-Algorithm
in	O
Invitation	O
to	O
Combinatorics	O
(	O
Shahriari	O
2022	O
)	O
.	O
</s>
<s>
To	O
prove	O
the	O
Havel-Hakimi	B-Algorithm
algorithm	I-Algorithm
always	O
works	O
,	O
assume	O
that	O
is	O
graphic	O
,	O
and	O
there	O
exists	O
a	O
simple	O
graph	O
with	O
the	O
degree	O
sequence	O
.	O
</s>
<s>
To	O
test	O
whether	O
this	O
degree	O
sequence	O
is	O
graphic	O
,	O
we	O
apply	O
the	O
Havel-Hakimi	B-Algorithm
algorithm	I-Algorithm
:	O
</s>
