<s>
In	O
electrical	O
engineering	O
and	O
computer	B-General_Concept
science	I-General_Concept
,	O
Lloyd	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
,	O
also	O
known	O
as	O
Voronoi	B-Algorithm
iteration	I-Algorithm
or	O
relaxation	O
,	O
is	O
an	O
algorithm	O
named	O
after	O
Stuart	O
P	O
.	O
Lloyd	O
for	O
finding	O
evenly	O
spaced	O
sets	O
of	O
points	O
in	O
subsets	O
of	O
Euclidean	O
spaces	O
and	O
partitions	O
of	O
these	O
subsets	O
into	O
well-shaped	O
and	O
uniformly	O
sized	O
convex	O
cells	O
.	O
</s>
<s>
Like	O
the	O
closely	O
related	O
k-means	B-Algorithm
clustering	I-Algorithm
algorithm	I-Algorithm
,	O
it	O
repeatedly	O
finds	O
the	O
centroid	O
of	O
each	O
set	O
in	O
the	O
partition	O
and	O
then	O
re-partitions	O
the	O
input	O
according	O
to	O
which	O
of	O
these	O
centroids	O
is	O
closest	O
.	O
</s>
<s>
In	O
this	O
setting	O
,	O
the	O
mean	O
operation	O
is	O
an	O
integral	O
over	O
a	O
region	O
of	O
space	O
,	O
and	O
the	O
nearest	O
centroid	O
operation	O
results	O
in	O
Voronoi	B-Architecture
diagrams	I-Architecture
.	O
</s>
<s>
Lloyd	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
can	O
be	O
used	O
to	O
construct	O
close	O
approximations	O
to	O
centroidal	B-Application
Voronoi	I-Application
tessellations	I-Application
of	O
the	O
input	O
,	O
which	O
can	O
be	O
used	O
for	O
quantization	B-Algorithm
,	O
dithering	O
,	O
and	O
stippling	O
.	O
</s>
<s>
Other	O
applications	O
of	O
Lloyd	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
include	O
smoothing	O
of	O
triangle	B-Algorithm
meshes	I-Algorithm
in	O
the	O
finite	B-Application
element	I-Application
method	I-Application
.	O
</s>
<s>
The	O
algorithm	O
was	O
first	O
proposed	O
by	O
Stuart	O
P	O
.	O
Lloyd	O
of	O
Bell	O
Labs	O
in	O
1957	O
as	O
a	O
technique	O
for	O
pulse-code	B-Algorithm
modulation	I-Algorithm
.	O
</s>
<s>
Lloyd	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
starts	O
by	O
an	O
initial	O
placement	O
of	O
some	O
number	O
k	O
of	O
point	O
sites	O
in	O
the	O
input	O
domain	O
.	O
</s>
<s>
In	O
mesh-smoothing	O
applications	O
,	O
these	O
would	O
be	O
the	O
vertices	O
of	O
the	O
mesh	O
to	O
be	O
smoothed	O
;	O
in	O
other	O
applications	O
they	O
may	O
be	O
placed	O
at	O
random	O
or	O
by	O
intersecting	O
a	O
uniform	O
triangular	B-Algorithm
mesh	I-Algorithm
of	O
the	O
appropriate	O
size	O
with	O
the	O
input	O
domain	O
.	O
</s>
<s>
The	O
Voronoi	B-Architecture
diagram	I-Architecture
of	O
the	O
k	O
sites	O
is	O
computed	O
.	O
</s>
<s>
Each	O
cell	O
of	O
the	O
Voronoi	B-Architecture
diagram	I-Architecture
is	O
integrated	O
,	O
and	O
the	O
centroid	O
is	O
computed	O
.	O
</s>
<s>
Each	O
site	O
is	O
then	O
moved	O
to	O
the	O
centroid	O
of	O
its	O
Voronoi	B-Architecture
cell	I-Architecture
.	O
</s>
<s>
Because	O
Voronoi	B-Architecture
diagram	I-Architecture
construction	O
algorithms	O
can	O
be	O
highly	O
non-trivial	O
,	O
especially	O
for	O
inputs	O
of	O
dimension	O
higher	O
than	O
two	O
,	O
the	O
steps	O
of	O
calculating	O
this	O
diagram	O
and	O
finding	O
the	O
exact	O
centroids	O
of	O
its	O
cells	O
may	O
be	O
replaced	O
by	O
an	O
approximation	O
.	O
</s>
<s>
Alternatively	O
,	O
Monte	B-Algorithm
Carlo	I-Algorithm
methods	I-Algorithm
may	O
be	O
used	O
,	O
in	O
which	O
random	O
sample	O
points	O
are	O
generated	O
according	O
to	O
some	O
fixed	O
underlying	O
probability	O
distribution	O
,	O
assigned	O
to	O
the	O
closest	O
site	O
,	O
and	O
averaged	O
to	O
approximate	O
the	O
centroid	O
for	O
each	O
site	O
.	O
</s>
<s>
Since	O
a	O
Voronoi	B-Architecture
cell	I-Architecture
is	O
of	O
convex	O
shape	O
and	O
always	O
encloses	O
its	O
site	O
,	O
there	O
exist	O
trivial	O
decompositions	O
into	O
easy	O
integratable	O
simplices	O
:	O
</s>
<s>
In	O
one	O
dimension	O
,	O
this	O
algorithm	O
has	O
been	O
shown	O
to	O
converge	O
to	O
a	O
centroidal	O
Voronoi	B-Architecture
diagram	I-Architecture
,	O
also	O
named	O
a	O
centroidal	B-Application
Voronoi	I-Application
tessellation	I-Application
.	O
</s>
<s>
Therefore	O
,	O
real-world	O
applications	O
of	O
Lloyd	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
typically	O
stop	O
once	O
the	O
distribution	O
is	O
"	O
good	O
enough.	O
"	O
</s>
<s>
Lloyd	O
's	O
method	O
was	O
originally	O
used	O
for	O
scalar	B-Algorithm
quantization	I-Algorithm
,	O
but	O
it	O
is	O
clear	O
that	O
the	O
method	O
extends	O
for	O
vector	O
quantization	B-Algorithm
as	O
well	O
.	O
</s>
<s>
As	O
such	O
,	O
it	O
is	O
extensively	O
used	O
in	O
data	B-General_Concept
compression	I-General_Concept
techniques	O
in	O
information	O
theory	O
.	O
</s>
<s>
Lloyd	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
is	O
also	O
used	O
to	O
generate	O
dot	O
drawings	O
in	O
the	O
style	O
of	O
stippling	O
.	O
</s>
<s>
In	O
the	O
finite	B-Application
element	I-Application
method	I-Application
,	O
an	O
input	O
domain	O
with	O
a	O
complex	O
geometry	O
is	O
partitioned	O
into	O
elements	O
with	O
simpler	O
shapes	O
;	O
for	O
instance	O
,	O
two-dimensional	O
domains	O
(	O
either	O
subsets	O
of	O
the	O
Euclidean	O
plane	O
or	O
surfaces	O
in	O
three	O
dimensions	O
)	O
are	O
often	O
partitioned	O
into	O
triangles	O
.	O
</s>
<s>
It	O
is	O
important	O
for	O
the	O
convergence	O
of	O
the	O
finite	B-Application
element	I-Application
methods	I-Application
that	O
these	O
elements	O
be	O
well	O
shaped	O
;	O
in	O
the	O
case	O
of	O
triangles	O
,	O
often	O
elements	O
that	O
are	O
nearly	O
equilateral	O
triangles	O
are	O
preferred	O
.	O
</s>
<s>
These	O
applications	O
typically	O
use	O
a	O
smaller	O
number	O
of	O
iterations	O
of	O
Lloyd	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
,	O
stopping	O
it	O
to	O
convergence	O
,	O
in	O
order	O
to	O
preserve	O
other	O
features	O
of	O
the	O
mesh	O
such	O
as	O
differences	O
in	O
element	O
size	O
in	O
different	O
parts	O
of	O
the	O
mesh	O
.	O
</s>
<s>
In	O
contrast	O
to	O
a	O
different	O
smoothing	O
method	O
,	O
Laplacian	B-Algorithm
smoothing	I-Algorithm
(	O
in	O
which	O
mesh	O
vertices	O
are	O
moved	O
to	O
the	O
average	O
of	O
their	O
neighbors	O
 '	O
positions	O
)	O
,	O
Lloyd	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
can	O
change	O
the	O
topology	O
of	O
the	O
mesh	O
,	O
leading	O
to	O
more	O
nearly	O
equilateral	O
elements	O
as	O
well	O
as	O
avoiding	O
the	O
problems	O
with	O
tangling	O
that	O
can	O
arise	O
with	O
Laplacian	B-Algorithm
smoothing	I-Algorithm
.	O
</s>
<s>
However	O
,	O
Laplacian	B-Algorithm
smoothing	I-Algorithm
can	O
be	O
applied	O
more	O
generally	O
to	O
meshes	O
with	O
non-triangular	O
elements	O
.	O
</s>
<s>
Lloyd	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
is	O
usually	O
used	O
in	O
a	O
Euclidean	O
space	O
.	O
</s>
<s>
The	O
Euclidean	O
distance	O
plays	O
two	O
roles	O
in	O
the	O
algorithm	O
:	O
it	O
is	O
used	O
to	O
define	O
the	O
Voronoi	B-Architecture
cells	I-Architecture
,	O
but	O
it	O
also	O
corresponds	O
to	O
the	O
choice	O
of	O
the	O
centroid	O
as	O
the	O
representative	O
point	O
of	O
each	O
cell	O
,	O
since	O
the	O
centroid	O
is	O
the	O
point	O
that	O
minimizes	O
the	O
average	O
squared	O
Euclidean	O
distance	O
to	O
the	O
points	O
in	O
its	O
cell	O
.	O
</s>
<s>
For	O
example	O
,	O
used	O
a	O
variant	O
of	O
the	O
Manhattan	O
metric	O
(	O
with	O
locally	O
varying	O
orientations	O
)	O
to	O
find	O
a	O
tiling	O
of	O
an	O
image	O
by	O
approximately	O
square	O
tiles	O
whose	O
orientation	O
aligns	O
with	O
features	O
of	O
an	O
image	O
,	O
which	O
he	O
used	O
to	O
simulate	O
the	O
construction	O
of	O
tiled	O
mosaics	B-Application
.	O
</s>
<s>
In	O
this	O
application	O
,	O
despite	O
varying	O
the	O
metric	O
,	O
Hausner	O
continued	O
to	O
use	O
centroids	O
as	O
the	O
representative	O
points	O
of	O
their	O
Voronoi	B-Architecture
cells	I-Architecture
.	O
</s>
