<s>
In	O
computer	B-General_Concept
science	I-General_Concept
and	O
graph	O
theory	O
,	O
the	O
zero-weight	B-Algorithm
cycle	I-Algorithm
problem	I-Algorithm
is	O
the	O
problem	O
of	O
deciding	O
whether	O
a	O
directed	O
graph	O
with	O
weights	O
on	O
the	O
edges	O
(	O
which	O
may	O
be	O
positive	O
or	O
negative	O
or	O
zero	O
)	O
has	O
a	O
cycle	O
in	O
which	O
the	O
sum	O
of	O
weights	O
is0	O
.	O
</s>
<s>
This	O
related	O
problem	O
can	O
be	O
solved	O
in	O
polynomial	O
time	O
using	O
the	O
Bellman	B-Algorithm
–	I-Algorithm
Ford	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
If	O
there	O
is	O
no	O
negative	O
cycle	O
,	O
then	O
the	O
distances	O
found	O
by	O
the	O
Bellman	B-Algorithm
–	I-Algorithm
Ford	I-Algorithm
algorithm	I-Algorithm
can	O
be	O
used	O
,	O
as	O
in	O
Johnson	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
,	O
to	O
reweight	O
the	O
edges	O
of	O
the	O
graph	O
in	O
such	O
a	O
way	O
that	O
all	O
edge	O
weights	O
become	O
non-negative	O
and	O
all	O
cycle	O
lengths	O
remain	O
unchanged	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
special	O
case	O
of	O
the	O
zero-weight	B-Algorithm
cycle	I-Algorithm
problem	I-Algorithm
,	O
on	O
graphs	O
with	O
no	O
negative	O
cycle	O
,	O
has	O
a	O
polynomial-time	O
algorithm	O
.	O
</s>
<s>
In	O
particular	O
,	O
there	O
is	O
a	O
reduction	B-Algorithm
from	O
the	O
Hamiltonian	O
path	O
problem	O
,	O
on	O
an	O
-vertex	O
unweighted	O
graph	O
with	O
specified	O
starting	O
and	O
ending	O
vertices	O
and	O
,	O
to	O
the	O
zero-weight	B-Algorithm
cycle	I-Algorithm
problem	I-Algorithm
on	O
a	O
weighted	O
graph	O
obtained	O
by	O
giving	O
all	O
edges	O
of	O
weight	O
equal	O
to	O
one	O
,	O
and	O
adding	O
an	O
additional	O
edge	O
from	O
to	O
with	O
weight	O
.	O
</s>
