<s>
The	O
closest	B-Algorithm
pair	I-Algorithm
of	I-Algorithm
points	I-Algorithm
problem	I-Algorithm
or	O
closest	B-Algorithm
pair	I-Algorithm
problem	I-Algorithm
is	O
a	O
problem	O
of	O
computational	O
geometry	O
:	O
given	O
points	O
in	O
metric	O
space	O
,	O
find	O
a	O
pair	O
of	O
points	O
with	O
the	O
smallest	O
distance	O
between	O
them	O
.	O
</s>
<s>
The	O
closest	B-Algorithm
pair	I-Algorithm
problem	I-Algorithm
for	O
points	O
in	O
the	O
Euclidean	O
plane	O
was	O
among	O
the	O
first	O
geometric	O
problems	O
that	O
were	O
treated	O
at	O
the	O
origins	O
of	O
the	O
systematic	O
study	O
of	O
the	O
computational	B-General_Concept
complexity	I-General_Concept
of	O
geometric	O
algorithms	O
.	O
</s>
<s>
It	O
is	O
also	O
possible	O
to	O
solve	O
the	O
problem	O
without	O
randomization	O
,	O
in	O
random-access	B-Application
machine	I-Application
models	O
of	O
computation	O
with	O
unlimited	O
memory	O
that	O
allow	O
the	O
use	O
of	O
the	O
floor	O
function	O
,	O
in	O
near-linear	O
time	O
.	O
</s>
<s>
In	O
even	O
more	O
restricted	O
models	O
of	O
computation	O
,	O
such	O
as	O
the	O
algebraic	B-Application
decision	I-Application
tree	I-Application
,	O
the	O
problem	O
can	O
be	O
solved	O
in	O
the	O
somewhat	O
slower	O
time	O
bound	O
,	O
and	O
this	O
is	O
optimal	O
for	O
this	O
model	O
,	O
by	O
a	O
reduction	O
from	O
the	O
element	O
uniqueness	O
problem	O
.	O
</s>
<s>
Both	O
sweep	B-Algorithm
line	I-Algorithm
algorithms	I-Algorithm
and	O
divide-and-conquer	B-Algorithm
algorithms	I-Algorithm
with	O
this	O
slower	O
time	O
bound	O
are	O
commonly	O
taught	O
as	O
examples	O
of	O
these	O
algorithm	O
design	O
techniques	O
.	O
</s>
<s>
Round	O
the	O
input	O
points	O
to	O
a	O
square	O
grid	O
of	O
points	O
whose	O
size	O
(	O
the	O
separation	O
between	O
adjacent	O
grid	O
points	O
)	O
is	O
,	O
and	O
use	O
a	O
hash	B-Algorithm
table	I-Algorithm
to	O
collect	O
together	O
pairs	O
of	O
input	O
points	O
that	O
round	O
to	O
the	O
same	O
grid	O
point	O
.	O
</s>
<s>
The	O
algorithm	O
will	O
always	O
correctly	O
determine	O
the	O
closest	B-Algorithm
pair	I-Algorithm
,	O
because	O
it	O
maps	O
any	O
pair	O
closer	O
than	O
distance	O
to	O
the	O
same	O
grid	O
point	O
or	O
to	O
adjacent	O
grid	O
points	O
.	O
</s>
<s>
Instead	O
,	O
a	O
different	O
algorithm	O
goes	O
through	O
two	O
phases	O
:	O
a	O
random	O
iterated	O
filtering	O
process	O
that	O
approximates	O
the	O
closest	O
distance	O
to	O
within	O
an	O
approximation	B-Algorithm
ratio	I-Algorithm
of	O
,	O
together	O
with	O
a	O
finishing	O
step	O
that	O
turns	O
this	O
approximate	O
distance	O
into	O
the	O
exact	O
closest	O
distance	O
.	O
</s>
<s>
The	O
dynamic	B-General_Concept
version	I-General_Concept
for	O
the	O
closest-pair	O
problem	O
is	O
stated	O
as	O
follows	O
:	O
</s>
<s>
Given	O
a	O
dynamic	O
set	O
of	O
objects	O
,	O
find	O
algorithms	O
and	O
data	B-General_Concept
structures	I-General_Concept
for	O
efficient	O
recalculation	O
of	O
the	O
closest	B-Algorithm
pair	I-Algorithm
of	O
objects	O
each	O
time	O
the	O
objects	O
are	O
inserted	O
or	O
deleted	O
.	O
</s>
<s>
If	O
the	O
bounding	B-Algorithm
box	I-Algorithm
for	O
all	O
points	O
is	O
known	O
in	O
advance	O
and	O
the	O
constant-time	O
floor	O
function	O
is	O
available	O
,	O
then	O
the	O
expected	O
-space	O
data	B-General_Concept
structure	I-General_Concept
was	O
suggested	O
that	O
supports	O
expected-time	O
insertions	O
and	O
deletions	O
and	O
constant	O
query	O
time	O
.	O
</s>
<s>
When	O
modified	O
for	O
the	O
algebraic	B-Application
decision	I-Application
tree	I-Application
model	O
,	O
insertions	O
and	O
deletions	O
would	O
require	O
expected	O
time	O
.	O
</s>
<s>
The	O
complexity	O
of	O
the	O
dynamic	O
closest	B-Algorithm
pair	I-Algorithm
algorithm	O
cited	O
above	O
is	O
exponential	O
in	O
the	O
dimension	O
,	O
and	O
therefore	O
such	O
an	O
algorithm	O
becomes	O
less	O
suitable	O
for	O
high-dimensional	O
problems	O
.	O
</s>
