<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
multiway	B-Algorithm
number	I-Algorithm
partitioning	I-Algorithm
is	O
the	O
problem	O
of	O
partitioning	O
a	O
multiset	B-Language
of	O
numbers	O
into	O
a	O
fixed	O
number	O
of	O
subsets	O
,	O
such	O
that	O
the	O
sums	O
of	O
the	O
subsets	O
are	O
as	O
similar	O
as	O
possible	O
.	O
</s>
<s>
It	O
was	O
first	O
presented	O
by	O
Ronald	O
Graham	O
in	O
1969	O
in	O
the	O
context	O
of	O
the	O
Identical-machines	B-Algorithm
scheduling	I-Algorithm
problem	O
.	O
</s>
<s>
The	O
problem	O
is	O
parametrized	O
by	O
a	O
positive	O
integer	O
k	O
,	O
and	O
called	O
k-way	O
number	B-Algorithm
partitioning	I-Algorithm
.	O
</s>
<s>
The	O
input	O
to	O
the	O
problem	O
is	O
a	O
multiset	B-Language
S	O
of	O
numbers	O
(	O
usually	O
integers	O
)	O
,	O
whose	O
sum	O
is	O
k*T	O
.	O
</s>
<s>
This	O
objective	O
is	O
common	O
in	O
papers	O
about	O
multiway	B-Algorithm
number	I-Algorithm
partitioning	I-Algorithm
,	O
as	O
well	O
as	O
papers	O
originating	O
from	O
physics	O
applications	O
.	O
</s>
<s>
This	O
objective	O
is	O
equivalent	O
to	O
one	O
objective	O
for	O
Identical-machines	B-Algorithm
scheduling	I-Algorithm
.	O
</s>
<s>
The	O
goal	O
is	O
to	O
partition	O
the	O
jobs	O
among	O
the	O
processors	O
such	O
that	O
the	O
makespan	B-Algorithm
(	O
the	O
finish	O
time	O
of	O
the	O
last	O
job	O
)	O
is	O
minimized	O
.	O
</s>
<s>
This	O
objective	O
corresponds	O
to	O
the	O
application	O
of	O
fair	O
item	O
allocation	O
,	O
particularly	O
the	O
maximin	B-Algorithm
share	I-Algorithm
.	O
</s>
<s>
The	O
partition	B-Algorithm
problem	I-Algorithm
-	O
a	O
special	O
case	O
of	O
multiway	B-Algorithm
number	I-Algorithm
partitioning	I-Algorithm
in	O
which	O
the	O
number	O
of	O
subsets	O
is	O
2	O
.	O
</s>
<s>
The	O
3-partition	B-Algorithm
problem	I-Algorithm
-	O
a	O
different	O
and	O
harder	O
problem	O
,	O
in	O
which	O
the	O
number	O
of	O
subsets	O
is	O
not	O
considered	O
a	O
fixed	O
parameter	O
,	O
but	O
is	O
determined	O
by	O
the	O
input	O
(	O
the	O
number	O
of	O
sets	O
is	O
the	O
number	O
of	O
integers	O
divided	O
by	O
3	O
)	O
.	O
</s>
<s>
The	O
uniform-machines	B-Algorithm
scheduling	I-Algorithm
problem	O
-	O
a	O
more	O
general	O
problem	O
in	O
which	O
different	O
processors	O
may	O
have	O
different	O
speeds	O
.	O
</s>
<s>
Most	O
algorithms	O
below	O
were	O
developed	O
for	O
identical-machines	B-Algorithm
scheduling	I-Algorithm
.	O
</s>
<s>
Greedy	B-Algorithm
number	I-Algorithm
partitioning	I-Algorithm
(	O
also	O
called	O
the	O
Largest	O
Processing	O
Time	O
in	O
the	O
scheduling	O
literature	O
)	O
loops	O
over	O
the	O
numbers	O
,	O
and	O
puts	O
each	O
number	O
in	O
the	O
set	O
whose	O
current	O
sum	O
is	O
smallest	O
.	O
</s>
<s>
Largest	B-Algorithm
Differencing	I-Algorithm
Method	I-Algorithm
(	O
also	O
called	O
the	O
Karmarkar-Karp	B-Algorithm
algorithm	I-Algorithm
)	O
sorts	O
the	O
numbers	O
in	O
descending	O
order	O
and	O
repeatedly	O
replaces	O
numbers	O
by	O
their	O
differences	O
.	O
</s>
<s>
The	O
Multifit	B-Algorithm
algorithm	I-Algorithm
uses	O
binary	O
search	O
combined	O
with	O
an	O
algorithm	O
for	O
bin	O
packing	O
.	O
</s>
<s>
In	O
the	O
worst	O
case	O
,	O
its	O
makespan	B-Algorithm
is	O
at	O
most	O
8/7	O
for	O
k	O
=	O
2	O
,	O
and	O
at	O
most	O
13/11	O
in	O
general	O
.	O
</s>
<s>
Several	O
polynomial-time	B-Algorithm
approximation	I-Algorithm
schemes	I-Algorithm
(	O
PTAS	B-Algorithm
)	O
have	O
been	O
developed	O
:	O
</s>
<s>
Sahni	O
presented	O
a	O
PTAS	B-Algorithm
that	O
attains	O
(	O
1+ε	O
)	O
OPT	O
in	O
time	O
.	O
</s>
<s>
This	O
is	O
a	O
PTAS	B-Algorithm
.	O
</s>
<s>
For	O
greedy	B-Algorithm
number	I-Algorithm
partitioning	I-Algorithm
,	O
if	O
the	O
numbers	O
are	O
not	O
sorted	O
then	O
the	O
worst-case	O
approximation	O
ratio	O
is	O
1/k	O
.	O
</s>
<s>
Woeginger	O
presented	O
a	O
PTAS	B-Algorithm
that	O
attains	O
an	O
approximation	O
factor	O
of	O
in	O
time	O
,	O
where	O
a	O
huge	O
constant	O
that	O
is	O
exponential	O
in	O
the	O
required	O
approximation	O
factor	O
ε	O
.	O
</s>
<s>
The	O
algorithm	O
uses	O
Lenstra	O
's	O
algorithm	O
for	O
integer	B-Algorithm
linear	I-Algorithm
programming	I-Algorithm
.	O
</s>
<s>
Alon	O
,	O
Azar	O
,	O
Woeginger	O
and	O
Yadid	O
presented	O
general	O
PTAS-s	O
(	O
generalizing	O
the	O
PTAS-s	O
of	O
Sanhi	O
,	O
Hochbaum	O
and	O
Shmoys	O
,	O
and	O
Woeginger	O
)	O
for	O
these	O
four	O
problems	O
.	O
</s>
<s>
The	O
runtime	O
of	O
their	O
PTAS-s	O
is	O
linear	O
in	O
n	O
(	O
the	O
number	O
of	O
inputs	O
)	O
,	O
but	O
exponential	O
in	O
the	O
approximation	O
precision	B-Architecture
.	O
</s>
<s>
The	O
PTAS	B-Algorithm
for	O
minimizing	O
sum(f(Ci )	O
)	O
is	O
based	O
on	O
some	O
combinatorial	O
observations	O
:	O
</s>
<s>
The	O
PTAS	B-Algorithm
uses	O
an	O
input	O
rounding	O
technique	O
.	O
</s>
<s>
There	O
is	O
an	O
optimal	O
partition	O
of	O
S#( d	O
)	O
in	O
which	O
all	O
subset	B-Algorithm
sums	I-Algorithm
are	O
strictly	O
between	O
L#	O
/2	O
and	O
2L#	O
.	O
</s>
<s>
The	O
subset	B-Algorithm
sum	I-Algorithm
is	O
then	O
.	O
</s>
<s>
One	O
way	O
uses	O
dynamic	O
programming	O
:	O
its	O
run-time	O
is	O
a	O
polynomial	O
whose	O
exponent	O
depends	O
on	O
d	O
.	O
The	O
other	O
way	O
uses	O
Lenstra	O
's	O
algorithm	O
for	O
integer	B-Algorithm
linear	I-Algorithm
programming	I-Algorithm
.	O
</s>
<s>
Define	O
as	O
the	O
optimal	O
(	O
minimum	O
)	O
value	O
of	O
the	O
objective	O
function	O
sum(f(Ci )	O
)	O
,	O
when	O
the	O
input	O
vector	O
is	O
and	O
it	O
has	O
to	O
be	O
partitioned	O
into	O
k	O
subsets	O
,	O
among	O
all	O
partitions	O
in	O
which	O
all	O
subset	B-Algorithm
sums	I-Algorithm
are	O
strictly	O
between	O
L#	O
/2	O
and	O
2L#	O
.	O
</s>
<s>
Given	O
a	O
desired	O
approximation	O
precision	B-Architecture
ε>0	O
,	O
let	O
δ>0	O
be	O
the	O
constant	O
corresponding	O
to	O
ε/3	O
,	O
whose	O
existence	O
is	O
guaranteed	O
by	O
Condition	O
F*	O
.	O
</s>
<s>
In	O
contrast	O
to	O
the	O
above	O
result	O
,	O
if	O
we	O
take	O
f(x )	O
=	O
2x	O
,	O
or	O
f(x )	O
=(	O
x-1	O
)	O
2	O
,	O
then	O
no	O
PTAS	B-Algorithm
for	O
minimizing	O
sum(f(Ci )	O
)	O
exists	O
unless	O
P	O
=	O
NP	O
.	O
</s>
<s>
The	O
proof	O
is	O
by	O
reduction	O
from	O
partition	B-Algorithm
problem	I-Algorithm
.	O
</s>
<s>
There	O
are	O
exact	B-Algorithm
algorithms	I-Algorithm
,	O
that	O
always	O
find	O
the	O
optimal	O
partition	O
.	O
</s>
<s>
The	O
pseudopolynomial	B-Algorithm
time	I-Algorithm
number	I-Algorithm
partitioning	I-Algorithm
takes	O
memory	O
,	O
where	O
is	O
the	O
largest	O
number	O
in	O
the	O
input	O
.	O
</s>
<s>
The	O
Complete	O
Greedy	O
Algorithm	O
(	O
CGA	O
)	O
considers	O
all	O
partitions	O
by	O
constructing	O
a	O
k-ary	B-Data_Structure
tree	I-Data_Structure
.	O
</s>
<s>
Traversing	O
the	O
tree	O
in	O
depth-first	B-Algorithm
order	O
requires	O
only	O
O(n )	O
space	O
,	O
but	O
might	O
take	O
O(kn )	O
time	O
.	O
</s>
<s>
This	O
algorithm	O
finds	O
first	O
the	O
solution	O
found	O
by	O
greedy	B-Algorithm
number	I-Algorithm
partitioning	I-Algorithm
,	O
but	O
then	O
proceeds	O
to	O
look	O
for	O
better	O
solutions	O
.	O
</s>
<s>
The	O
Complete	B-Algorithm
Karmarkar-Karp	I-Algorithm
algorithm	O
(	O
CKK	O
)	O
considers	O
all	O
partitions	O
by	O
constructing	O
a	O
tree	O
of	O
degree	O
.	O
</s>
<s>
This	O
algorithm	O
finds	O
first	O
the	O
solution	O
found	O
by	O
the	O
largest	B-Algorithm
differencing	I-Algorithm
method	I-Algorithm
,	O
but	O
then	O
proceeds	O
to	O
find	O
better	O
solutions	O
.	O
</s>
<s>
In	O
practice	O
,	O
with	O
k	O
=	O
2	O
,	O
problems	O
of	O
arbitrary	O
size	O
can	O
be	O
solved	O
by	O
CKK	O
if	O
the	O
numbers	O
have	O
at	O
most	O
12	O
significant	B-Architecture
digit	I-Architecture
s	O
;	O
with	O
k	O
=3	O
,	O
at	O
most	O
6	O
significant	B-Architecture
digits	I-Architecture
.	O
</s>
<s>
CKK	O
can	O
also	O
run	O
as	O
an	O
anytime	B-Algorithm
algorithm	I-Algorithm
:	O
it	O
finds	O
the	O
KK	O
solution	O
first	O
,	O
and	O
then	O
finds	O
progressively	O
better	O
solutions	O
as	O
time	O
allows	O
(	O
possibly	O
requiring	O
exponential	O
time	O
to	O
reach	O
optimality	O
,	O
for	O
the	O
worst	O
instances	O
)	O
.	O
</s>
<s>
Korf	O
,	O
Schreiber	O
and	O
Moffitt	O
presented	O
hybrid	O
algorithms	O
,	O
combining	O
CKK	O
,	O
CGA	O
and	O
other	O
methods	O
from	O
the	O
subset	B-Algorithm
sum	I-Algorithm
problem	I-Algorithm
and	O
the	O
bin	O
packing	O
problem	O
to	O
achieve	O
an	O
even	O
better	O
performance	O
.	O
</s>
<s>
Recursive	O
Number	B-Algorithm
Partitioning	I-Algorithm
(	O
RNP	O
)	O
uses	O
CKK	O
for	O
k	O
=	O
2	O
,	O
but	O
for	O
k>2	O
it	O
recursively	O
splits	O
S	O
into	O
subsets	O
and	O
splits	O
k	O
into	O
halves	O
.	O
</s>
<s>
Hybrid	O
recursive	O
number	B-Algorithm
partitioning	I-Algorithm
(	O
HRNP	O
)	O
.	O
</s>
<s>
A	O
BP	O
solver	O
can	O
be	O
used	O
to	O
find	O
an	O
optimal	O
number	B-Algorithm
partitioning	I-Algorithm
.	O
</s>
<s>
The	O
idea	O
is	O
to	O
use	O
binary	O
search	O
to	O
find	O
the	O
optimal	O
makespan	B-Algorithm
.	O
</s>
<s>
Some	O
lower	O
bounds	O
on	O
the	O
makespan	B-Algorithm
are	O
:	O
(	O
sum	O
S	O
)	O
/k	O
-	O
the	O
average	O
value	O
per	O
subset	O
,	O
s1	O
-	O
the	O
largest	O
number	O
in	O
S	O
,	O
and	O
sk	O
+	O
sk+1	O
-	O
the	O
size	O
of	O
a	O
bin	O
in	O
the	O
optimal	O
partition	O
of	O
only	O
the	O
largest	O
k+1	O
numbers	O
.	O
</s>
<s>
If	O
the	O
result	O
contains	O
more	O
than	O
k	O
bins	O
,	O
then	O
the	O
optimal	O
makespan	B-Algorithm
must	O
be	O
larger	O
:	O
set	O
lower	O
to	O
middle	O
and	O
repeat	O
.	O
</s>
<s>
If	O
the	O
result	O
contains	O
at	O
most	O
k	O
bins	O
,	O
then	O
the	O
optimal	O
makespan	B-Algorithm
may	O
be	O
smaller	O
set	O
higher	O
to	O
middle	O
and	O
repeat	O
.	O
</s>
<s>
In	O
the	O
balanced	B-Algorithm
number	I-Algorithm
partitioning	I-Algorithm
problem	O
,	O
there	O
are	O
constraints	O
on	O
the	O
number	O
of	O
items	O
that	O
can	O
be	O
allocated	O
to	O
each	O
subset	O
(	O
these	O
are	O
called	O
cardinality	O
constraints	O
)	O
.	O
</s>
<s>
Another	O
variant	O
is	O
the	O
multidimensional	O
number	B-Algorithm
partitioning	I-Algorithm
.	O
</s>
<s>
One	O
application	O
of	O
the	O
partition	B-Algorithm
problem	I-Algorithm
is	O
for	O
manipulation	O
of	O
elections	O
.	O
</s>
<s>
If	O
the	O
votes	O
are	O
weighted	O
,	O
then	O
the	O
problem	O
can	O
be	O
reduced	O
to	O
the	O
partition	B-Algorithm
problem	I-Algorithm
,	O
and	O
thus	O
it	O
can	O
be	O
solved	O
efficiently	O
using	O
CKK	O
.	O
</s>
