<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
2-satisfiability	B-Application
,	O
2-SAT	B-Application
or	O
just	O
2SAT	B-Application
is	O
a	O
computational	O
problem	O
of	O
assigning	O
values	O
to	O
variables	O
,	O
each	O
of	O
which	O
has	O
two	O
possible	O
values	O
,	O
in	O
order	O
to	O
satisfy	O
a	O
system	O
of	O
constraints	B-Application
on	O
pairs	O
of	O
variables	O
.	O
</s>
<s>
It	O
is	O
a	O
special	O
case	O
of	O
the	O
general	O
Boolean	B-Algorithm
satisfiability	I-Algorithm
problem	I-Algorithm
,	O
which	O
can	O
involve	O
constraints	B-Application
on	O
more	O
than	O
two	O
variables	O
,	O
and	O
of	O
constraint	B-Application
satisfaction	I-Application
problems	I-Application
,	O
which	O
can	O
allow	O
more	O
than	O
two	O
choices	O
for	O
the	O
value	O
of	O
each	O
variable	O
.	O
</s>
<s>
But	O
in	O
contrast	O
to	O
those	O
more	O
general	O
problems	O
,	O
which	O
are	O
NP-complete	O
,	O
2-satisfiability	B-Application
can	O
be	O
solved	O
in	O
polynomial	O
time	O
.	O
</s>
<s>
Instances	O
of	O
the	O
2-satisfiability	B-Application
problem	O
are	O
typically	O
expressed	O
as	O
Boolean	O
formulas	O
of	O
a	O
special	O
type	O
,	O
called	O
conjunctive	B-Application
normal	I-Application
form	I-Application
(	O
2-CNF	O
)	O
or	O
Krom	B-Application
formulas	I-Application
.	O
</s>
<s>
Alternatively	O
,	O
they	O
may	O
be	O
expressed	O
as	O
a	O
special	O
type	O
of	O
directed	O
graph	O
,	O
the	O
implication	O
graph	O
,	O
which	O
expresses	O
the	O
variables	O
of	O
an	O
instance	O
and	O
their	O
negations	O
as	O
vertices	O
in	O
a	O
graph	O
,	O
and	O
constraints	B-Application
on	O
pairs	O
of	O
variables	O
as	O
directed	O
edges	O
.	O
</s>
<s>
Both	O
of	O
these	O
kinds	O
of	O
inputs	O
may	O
be	O
solved	O
in	O
linear	O
time	O
,	O
either	O
by	O
a	O
method	O
based	O
on	O
backtracking	B-Algorithm
or	O
by	O
using	O
the	O
strongly	O
connected	O
components	O
of	O
the	O
implication	O
graph	O
.	O
</s>
<s>
Resolution	O
,	O
a	O
method	O
for	O
combining	O
pairs	O
of	O
constraints	B-Application
to	O
make	O
additional	O
valid	O
constraints	B-Application
,	O
also	O
leads	O
to	O
a	O
polynomial	O
time	O
solution	O
.	O
</s>
<s>
The	O
2-satisfiability	B-Application
problems	O
provide	O
one	O
of	O
two	O
major	O
subclasses	O
of	O
the	O
conjunctive	B-Application
normal	I-Application
form	I-Application
formulas	O
that	O
can	O
be	O
solved	O
in	O
polynomial	O
time	O
;	O
the	O
other	O
of	O
the	O
two	O
subclasses	O
is	O
Horn-satisfiability	O
.	O
</s>
<s>
2-satisfiability	B-Application
may	O
be	O
applied	O
to	O
geometry	O
and	O
visualization	O
problems	O
in	O
which	O
a	O
collection	O
of	O
objects	O
each	O
have	O
two	O
potential	O
locations	O
and	O
the	O
goal	O
is	O
to	O
find	O
a	O
placement	O
for	O
each	O
object	O
that	O
avoids	O
overlaps	O
with	O
other	O
objects	O
.	O
</s>
<s>
In	O
computational	O
complexity	O
theory	O
,	O
2-satisfiability	B-Application
provides	O
an	O
example	O
of	O
an	O
NL-complete	O
problem	O
,	O
one	O
that	O
can	O
be	O
solved	O
non-deterministically	O
using	O
a	O
logarithmic	O
amount	O
of	O
storage	O
and	O
that	O
is	O
among	O
the	O
hardest	O
of	O
the	O
problems	O
solvable	O
in	O
this	O
resource	O
bound	O
.	O
</s>
<s>
The	O
set	O
of	O
all	O
solutions	O
to	O
a	O
2-satisfiability	B-Application
instance	O
can	O
be	O
given	O
the	O
structure	O
of	O
a	O
median	O
graph	O
,	O
but	O
counting	O
these	O
solutions	O
is	O
#P	O
-complete	O
and	O
therefore	O
not	O
expected	O
to	O
have	O
a	O
polynomial-time	O
solution	O
.	O
</s>
<s>
Random	O
instances	O
undergo	O
a	O
sharp	O
phase	O
transition	O
from	O
solvable	O
to	O
unsolvable	O
instances	O
as	O
the	O
ratio	O
of	O
constraints	B-Application
to	O
variables	O
increases	O
past	O
1	O
,	O
a	O
phenomenon	O
conjectured	O
but	O
unproven	O
for	O
more	O
complicated	O
forms	O
of	O
the	O
satisfiability	B-Algorithm
problem	I-Algorithm
.	O
</s>
<s>
A	O
computationally	O
difficult	O
variation	O
of	O
2-satisfiability	B-Application
,	O
finding	O
a	O
truth	O
assignment	O
that	O
maximizes	O
the	O
number	O
of	O
satisfied	O
constraints	B-Application
,	O
has	O
an	O
approximation	B-Algorithm
algorithm	I-Algorithm
whose	O
optimality	O
depends	O
on	O
the	O
unique	O
games	O
conjecture	O
,	O
and	O
another	O
difficult	O
variation	O
,	O
finding	O
a	O
satisfying	O
assignment	O
minimizing	O
the	O
number	O
of	O
true	O
variables	O
,	O
is	O
an	O
important	O
test	O
case	O
for	O
parameterized	B-General_Concept
complexity	I-General_Concept
.	O
</s>
<s>
A	O
2-satisfiability	B-Application
problem	O
may	O
be	O
described	O
using	O
a	O
Boolean	O
expression	O
with	O
a	O
special	O
restricted	O
form	O
.	O
</s>
<s>
It	O
is	O
a	O
conjunction	O
(	O
a	O
Boolean	O
and	O
operation	O
)	O
of	O
clauses	B-Application
,	O
where	O
each	O
clause	O
is	O
a	O
disjunction	O
(	O
a	O
Boolean	O
or	O
operation	O
)	O
of	O
two	O
variables	O
or	O
negated	O
variables	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
following	O
formula	O
is	O
in	O
conjunctive	B-Application
normal	I-Application
form	I-Application
,	O
with	O
seven	O
variables	O
,	O
eleven	O
clauses	B-Application
,	O
and	O
22	O
literals	O
:	O
</s>
<s>
The	O
2-satisfiability	B-Application
problem	O
is	O
to	O
find	O
a	O
truth	O
assignment	O
to	O
these	O
variables	O
that	O
makes	O
the	O
whole	O
formula	O
true	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
2-satisfiability	B-Application
instance	O
represented	O
by	O
this	O
expression	O
is	O
satisfiable	O
.	O
</s>
<s>
The	O
"	O
2	O
"	O
in	O
this	O
name	O
stands	O
for	O
the	O
number	O
of	O
literals	O
per	O
clause	O
,	O
and	O
"	O
CNF	O
"	O
stands	O
for	O
conjunctive	B-Application
normal	I-Application
form	I-Application
,	O
a	O
type	O
of	O
Boolean	O
expression	O
in	O
the	O
form	O
of	O
a	O
conjunction	O
of	O
disjunctions	O
.	O
</s>
<s>
They	O
are	O
also	O
called	O
Krom	B-Application
formulas	I-Application
,	O
after	O
the	O
work	O
of	O
UC	O
Davis	O
mathematician	O
Melven	O
R	O
.	O
Krom	O
,	O
whose	O
1967	O
paper	O
was	O
one	O
of	O
the	O
earliest	O
works	O
on	O
the	O
2-satisfiability	B-Application
problem	O
.	O
</s>
<s>
Because	O
of	O
this	O
equivalence	O
between	O
these	O
different	O
types	O
of	O
operation	O
,	O
a	O
2-satisfiability	B-Application
instance	O
may	O
also	O
be	O
written	O
in	O
implicative	O
normal	O
form	O
,	O
in	O
which	O
we	O
replace	O
each	O
or	O
clause	O
in	O
the	O
conjunctive	B-Application
normal	I-Application
form	I-Application
by	O
the	O
two	O
implications	O
to	O
which	O
it	O
is	O
equivalent	O
.	O
</s>
<s>
A	O
third	O
,	O
more	O
graphical	O
way	O
of	O
describing	O
a	O
2-satisfiability	B-Application
instance	O
is	O
as	O
an	O
implication	O
graph	O
.	O
</s>
<s>
Several	O
algorithms	O
are	O
known	O
for	O
solving	O
the	O
2-satisfiability	B-Application
problem	O
.	O
</s>
<s>
described	O
the	O
following	O
polynomial	O
time	O
decision	O
procedure	O
for	O
solving	O
2-satisfiability	B-Application
instances	O
.	O
</s>
<s>
Suppose	O
that	O
a	O
2-satisfiability	B-Application
instance	O
contains	O
two	O
clauses	B-Application
that	O
both	O
use	O
the	O
same	O
variable	O
x	O
,	O
but	O
that	O
x	O
is	O
negated	O
in	O
one	O
clause	O
and	O
not	O
in	O
the	O
other	O
.	O
</s>
<s>
Then	O
the	O
two	O
clauses	B-Application
may	O
be	O
combined	O
to	O
produce	O
a	O
third	O
clause	O
,	O
having	O
the	O
two	O
other	O
literals	O
in	O
the	O
two	O
clauses	B-Application
;	O
this	O
third	O
clause	O
must	O
also	O
be	O
satisfied	O
whenever	O
the	O
first	O
two	O
clauses	B-Application
are	O
both	O
satisfied	O
.	O
</s>
<s>
For	O
instance	O
,	O
we	O
may	O
combine	O
the	O
clauses	B-Application
and	O
in	O
this	O
way	O
to	O
produce	O
the	O
clause	O
.	O
</s>
<s>
Krom	O
writes	O
that	O
a	O
formula	O
is	O
consistent	O
if	O
repeated	O
application	O
of	O
this	O
inference	O
rule	O
cannot	O
generate	O
both	O
the	O
clauses	B-Application
and	O
,	O
for	O
any	O
variable	O
.	O
</s>
<s>
For	O
,	O
if	O
a	O
formula	O
is	O
not	O
consistent	O
,	O
it	O
is	O
not	O
possible	O
to	O
satisfy	O
both	O
of	O
the	O
two	O
clauses	B-Application
and	O
simultaneously	O
.	O
</s>
<s>
At	O
each	O
of	O
these	O
extension	O
steps	O
,	O
one	O
of	O
these	O
two	O
clauses	B-Application
may	O
always	O
be	O
added	O
while	O
preserving	O
consistency	O
,	O
for	O
if	O
not	O
then	O
the	O
other	O
clause	O
could	O
be	O
generated	O
using	O
the	O
inference	O
rule	O
.	O
</s>
<s>
However	O
,	O
his	O
method	O
leads	O
to	O
a	O
polynomial	O
time	O
bound	O
for	O
solving	O
2-satisfiability	B-Application
problems	O
.	O
</s>
<s>
By	O
grouping	O
together	O
all	O
of	O
the	O
clauses	B-Application
that	O
use	O
the	O
same	O
variable	O
,	O
and	O
applying	O
the	O
inference	O
rule	O
to	O
each	O
pair	O
of	O
clauses	B-Application
,	O
it	O
is	O
possible	O
to	O
find	O
all	O
inferences	O
that	O
are	O
possible	O
from	O
a	O
given	O
2-CNF	O
instance	O
,	O
and	O
to	O
test	O
whether	O
it	O
is	O
consistent	O
,	O
in	O
total	O
time	O
,	O
where	O
is	O
the	O
number	O
of	O
variables	O
in	O
the	O
instance	O
.	O
</s>
<s>
This	O
formula	O
comes	O
from	O
multiplying	O
the	O
number	O
of	O
variables	O
by	O
the	O
number	O
of	O
pairs	O
of	O
clauses	B-Application
involving	O
a	O
given	O
variable	O
,	O
to	O
which	O
the	O
inference	O
rule	O
may	O
be	O
applied	O
.	O
</s>
<s>
In	O
terms	O
of	O
the	O
implication	O
graph	O
of	O
the	O
2-satisfiability	B-Application
instance	O
,	O
Krom	O
's	O
inference	O
rule	O
can	O
be	O
interpreted	O
as	O
constructing	O
the	O
transitive	O
closure	O
of	O
the	O
graph	O
.	O
</s>
<s>
As	O
observes	O
,	O
it	O
can	O
also	O
be	O
seen	O
as	O
an	O
instance	O
of	O
the	O
Davis	O
–	O
Putnam	O
algorithm	O
for	O
solving	O
satisfiability	B-Algorithm
problems	I-Algorithm
using	O
the	O
principle	O
of	O
resolution	O
.	O
</s>
<s>
Its	O
polynomial	O
time	O
bound	O
follows	O
from	O
the	O
fact	O
that	O
each	O
resolution	O
step	O
increases	O
the	O
number	O
of	O
clauses	B-Application
in	O
the	O
instance	O
,	O
which	O
is	O
upper	O
bounded	O
by	O
a	O
quadratic	O
function	O
of	O
the	O
number	O
of	O
variables	O
.	O
</s>
<s>
describe	O
a	O
technique	O
involving	O
limited	O
backtracking	B-Algorithm
for	O
solving	O
constraint	B-Application
satisfaction	I-Application
problems	I-Application
with	O
binary	O
variables	O
and	O
pairwise	O
constraints	B-Application
.	O
</s>
<s>
They	O
apply	O
this	O
technique	O
to	O
a	O
problem	O
of	O
classroom	O
scheduling	O
,	O
but	O
they	O
also	O
observe	O
that	O
it	O
applies	O
to	O
other	O
problems	O
including	O
2-SAT	B-Application
.	O
</s>
<s>
This	O
either	O
leads	O
to	O
a	O
contradiction	O
and	O
a	O
backtracking	B-Algorithm
step	O
,	O
or	O
,	O
if	O
no	O
contradiction	O
is	O
derived	O
,	O
it	O
follows	O
that	O
the	O
choice	O
was	O
a	O
correct	O
one	O
that	O
leads	O
to	O
a	O
satisfying	O
assignment	O
.	O
</s>
<s>
They	O
state	O
only	O
that	O
by	O
"	O
using	O
appropriate	O
data	O
structures	O
in	O
order	O
to	O
find	O
the	O
implications	O
of	O
any	O
decision	O
"	O
,	O
each	O
step	O
of	O
the	O
algorithm	O
(	O
other	O
than	O
the	O
backtracking	B-Algorithm
)	O
can	O
be	O
performed	O
quickly	O
.	O
</s>
<s>
However	O
,	O
some	O
inputs	O
may	O
cause	O
the	O
algorithm	O
to	O
backtrack	O
many	O
times	O
,	O
each	O
time	O
performing	O
many	O
steps	O
before	O
backtracking	B-Algorithm
,	O
so	O
its	O
overall	O
complexity	O
may	O
be	O
nonlinear	O
.	O
</s>
<s>
As	O
soon	O
as	O
the	O
test	O
for	O
one	O
of	O
these	O
two	O
assignments	O
would	O
create	O
another	O
choice	O
point	O
,	O
the	O
other	O
test	O
is	O
stopped	O
,	O
so	O
that	O
at	O
any	O
stage	O
of	O
the	O
algorithm	O
there	O
are	O
only	O
two	O
branches	O
of	O
the	O
backtracking	B-Algorithm
tree	O
that	O
are	O
still	O
being	O
tested	O
.	O
</s>
<s>
In	O
this	O
way	O
,	O
the	O
total	O
time	O
spent	O
performing	O
the	O
two	O
tests	O
for	O
any	O
variable	O
is	O
proportional	O
to	O
the	O
number	O
of	O
variables	O
and	O
clauses	B-Application
of	O
the	O
input	O
formula	O
whose	O
values	O
are	O
permanently	O
assigned	O
.	O
</s>
<s>
found	O
a	O
simpler	O
linear	O
time	O
procedure	O
for	O
solving	O
2-satisfiability	B-Application
instances	O
,	O
based	O
on	O
the	O
notion	O
of	O
strongly	O
connected	O
components	O
from	O
graph	O
theory	O
.	O
</s>
<s>
There	O
are	O
several	O
efficient	O
linear	O
time	O
algorithms	O
for	O
finding	O
the	O
strongly	O
connected	O
components	O
of	O
a	O
graph	O
,	O
based	O
on	O
depth-first	B-Algorithm
search	I-Algorithm
:	O
Tarjan	B-Algorithm
's	I-Algorithm
strongly	I-Algorithm
connected	I-Algorithm
components	I-Algorithm
algorithm	I-Algorithm
and	O
the	O
path-based	B-Algorithm
strong	I-Algorithm
component	I-Algorithm
algorithm	I-Algorithm
each	O
perform	O
a	O
single	O
depth-first	B-Algorithm
search	I-Algorithm
.	O
</s>
<s>
Kosaraju	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
performs	O
two	O
depth-first	B-Algorithm
searches	I-Algorithm
,	O
but	O
is	O
very	O
simple	O
.	O
</s>
<s>
In	O
terms	O
of	O
the	O
implication	O
graph	O
,	O
two	O
literals	O
belong	O
to	O
the	O
same	O
strongly	O
connected	O
component	O
whenever	O
there	B-Algorithm
exist	I-Algorithm
chains	O
of	O
implications	O
from	O
one	O
literal	O
to	O
the	O
other	O
and	O
vice	O
versa	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
two	O
literals	O
must	O
have	O
the	O
same	O
value	O
in	O
any	O
satisfying	O
assignment	O
to	O
the	O
given	O
2-satisfiability	B-Application
instance	O
.	O
</s>
<s>
Topologically	B-Algorithm
order	I-Algorithm
the	O
vertices	O
of	O
the	O
condensation	O
.	O
</s>
<s>
In	O
practice	O
this	O
may	O
be	O
efficiently	O
achieved	O
as	O
a	O
side	O
effect	O
of	O
the	O
previous	O
step	O
,	O
as	O
components	O
are	O
generated	O
by	O
Kosaraju	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
in	O
topological	O
order	O
and	O
by	O
Tarjan	O
's	O
algorithm	O
in	O
reverse	O
topological	O
order	O
.	O
</s>
<s>
Due	O
to	O
the	O
reverse	O
topological	B-Algorithm
ordering	I-Algorithm
and	O
the	O
skew-symmetry	O
,	O
when	O
a	O
literal	O
is	O
set	O
to	O
true	O
,	O
all	O
literals	O
that	O
can	O
be	O
reached	O
from	O
it	O
via	O
a	O
chain	O
of	O
implications	O
will	O
already	O
have	O
been	O
set	O
to	O
true	O
.	O
</s>
<s>
A	O
number	O
of	O
exact	O
and	O
approximate	O
algorithms	O
for	O
the	O
automatic	B-Application
label	I-Application
placement	I-Application
problem	O
are	O
based	O
on	O
2-satisfiability	B-Application
.	O
</s>
<s>
In	O
general	O
,	O
finding	O
a	O
label	B-Application
placement	I-Application
that	O
obeys	O
these	O
constraints	B-Application
is	O
an	O
NP-hard	O
problem	O
.	O
</s>
<s>
However	O
,	O
if	O
each	O
feature	O
has	O
only	O
two	O
possible	O
locations	O
for	O
its	O
label	O
(	O
say	O
,	O
extending	O
to	O
the	O
left	O
and	O
to	O
the	O
right	O
of	O
the	O
feature	O
)	O
then	O
label	B-Application
placement	I-Application
may	O
be	O
solved	O
in	O
polynomial	O
time	O
.	O
</s>
<s>
For	O
,	O
in	O
this	O
case	O
,	O
one	O
may	O
create	O
a	O
2-satisfiability	B-Application
instance	O
that	O
has	O
a	O
variable	O
for	O
each	O
label	O
and	O
that	O
has	O
a	O
clause	O
for	O
each	O
pair	O
of	O
labels	O
that	O
could	O
overlap	O
,	O
preventing	O
them	O
from	O
being	O
assigned	O
overlapping	O
positions	O
.	O
</s>
<s>
If	O
the	O
labels	O
are	O
all	O
congruent	O
rectangles	O
,	O
the	O
corresponding	O
2-satisfiability	B-Application
instance	O
can	O
be	O
shown	O
to	O
have	O
only	O
linearly	O
many	O
constraints	B-Application
,	O
leading	O
to	O
near-linear	O
time	O
algorithms	O
for	O
finding	O
a	O
labeling	O
.	O
</s>
<s>
They	O
represent	O
these	O
three	O
positions	O
using	O
two	O
binary	O
variables	O
in	O
such	O
a	O
way	O
that	O
,	O
again	O
,	O
testing	O
the	O
existence	O
of	O
a	O
valid	O
labeling	O
becomes	O
a	O
2-satisfiability	B-Application
problem	O
.	O
</s>
<s>
use	O
2-satisfiability	B-Application
as	O
part	O
of	O
an	O
approximation	B-Algorithm
algorithm	I-Algorithm
for	O
the	O
problem	O
of	O
finding	O
square	O
labels	O
of	O
the	O
largest	O
possible	O
size	O
for	O
a	O
given	O
set	O
of	O
points	O
,	O
with	O
the	O
constraint	B-Application
that	O
each	O
label	O
has	O
one	O
of	O
its	O
corners	O
on	O
the	O
point	O
that	O
it	O
labels	O
.	O
</s>
<s>
They	O
show	O
that	O
these	O
elimination	O
rules	O
cause	O
the	O
remaining	O
points	O
to	O
have	O
only	O
two	O
possible	O
label	B-Application
placements	I-Application
per	O
point	O
,	O
allowing	O
a	O
valid	O
label	B-Application
placement	I-Application
(	O
if	O
one	O
exists	O
)	O
to	O
be	O
found	O
as	O
the	O
solution	O
to	O
a	O
2-satisfiability	B-Application
instance	O
.	O
</s>
<s>
By	O
searching	O
for	O
the	O
largest	O
label	O
size	O
that	O
leads	O
to	O
a	O
solvable	O
2-satisfiability	B-Application
instance	O
,	O
they	O
find	O
a	O
valid	O
label	B-Application
placement	I-Application
whose	O
labels	O
are	O
at	O
least	O
half	O
as	O
large	O
as	O
the	O
optimal	O
solution	O
.	O
</s>
<s>
That	O
is	O
,	O
the	O
approximation	B-Algorithm
ratio	I-Algorithm
of	O
their	O
algorithm	O
is	O
at	O
most	O
two	O
.	O
</s>
<s>
Similarly	O
,	O
if	O
each	O
label	O
is	O
rectangular	O
and	O
must	O
be	O
placed	O
in	O
such	O
a	O
way	O
that	O
the	O
point	O
it	O
labels	O
is	O
somewhere	O
along	O
its	O
bottom	O
edge	O
,	O
then	O
using	O
2-satisfiability	B-Application
to	O
find	O
the	O
largest	O
label	O
size	O
for	O
which	O
there	O
is	O
a	O
solution	O
in	O
which	O
each	O
label	O
has	O
the	O
point	O
on	O
a	O
bottom	O
corner	O
leads	O
to	O
an	O
approximation	B-Algorithm
ratio	I-Algorithm
of	O
at	O
most	O
two	O
.	O
</s>
<s>
Similar	O
applications	O
of	O
2-satisfiability	B-Application
have	O
been	O
made	O
for	O
other	O
geometric	O
placement	O
problems	O
.	O
</s>
<s>
In	O
graph	O
drawing	O
,	O
if	O
the	O
vertex	O
locations	O
are	O
fixed	O
and	O
each	O
edge	O
must	O
be	O
drawn	O
as	O
a	O
circular	O
arc	O
with	O
one	O
of	O
two	O
possible	O
locations	O
(	O
for	O
instance	O
as	O
an	O
arc	O
diagram	O
)	O
,	O
then	O
the	O
problem	O
of	O
choosing	O
which	O
arc	O
to	O
use	O
for	O
each	O
edge	O
in	O
order	O
to	O
avoid	O
crossings	O
is	O
a	O
2-satisfiability	B-Application
problem	O
with	O
a	O
variable	O
for	O
each	O
edge	O
and	O
a	O
constraint	B-Application
for	O
each	O
pair	O
of	O
placements	O
that	O
would	O
lead	O
to	O
a	O
crossing	O
.	O
</s>
<s>
However	O
,	O
in	O
this	O
case	O
it	O
is	O
possible	O
to	O
speed	O
up	O
the	O
solution	O
,	O
compared	O
to	O
an	O
algorithm	O
that	O
builds	O
and	O
then	O
searches	O
an	O
explicit	O
representation	O
of	O
the	O
implication	O
graph	O
,	O
by	O
searching	O
the	O
graph	O
implicitly	B-Data_Structure
.	O
</s>
<s>
In	O
VLSI	O
integrated	O
circuit	O
design	O
,	O
if	O
a	O
collection	O
of	O
modules	O
must	O
be	O
connected	O
by	O
wires	O
that	O
can	O
each	O
bend	O
at	O
most	O
once	O
,	O
then	O
again	O
there	O
are	O
two	O
possible	O
routes	O
for	O
the	O
wires	O
,	O
and	O
the	O
problem	O
of	O
choosing	O
which	O
of	O
these	O
two	O
routes	O
to	O
use	O
,	O
in	O
such	O
a	O
way	O
that	O
all	O
wires	O
can	O
be	O
routed	O
in	O
a	O
single	O
layer	O
of	O
the	O
circuit	O
,	O
can	O
be	O
solved	O
as	O
a	O
2-satisfiability	B-Application
instance	O
.	O
</s>
<s>
They	O
observe	O
that	O
this	O
version	O
of	O
the	O
problem	O
may	O
be	O
solved	O
as	O
a	O
2-satisfiability	B-Application
instance	O
,	O
in	O
which	O
the	O
constraints	B-Application
relate	O
the	O
orientations	O
of	O
pairs	O
of	O
modules	O
that	O
are	O
directly	O
across	O
the	O
channel	O
from	O
each	O
other	O
.	O
</s>
<s>
As	O
a	O
consequence	O
,	O
the	O
optimal	O
density	O
may	O
also	O
be	O
calculated	O
efficiently	O
,	O
by	O
performing	O
a	O
binary	O
search	O
in	O
which	O
each	O
step	O
involves	O
the	O
solution	O
of	O
a	O
2-satisfiability	B-Application
instance	O
.	O
</s>
<s>
One	O
way	O
of	O
clustering	B-Algorithm
a	I-Algorithm
set	I-Algorithm
of	I-Algorithm
data	I-Algorithm
points	I-Algorithm
in	O
a	O
metric	O
space	O
into	O
two	O
clusters	O
is	O
to	O
choose	O
the	O
clusters	O
in	O
such	O
a	O
way	O
as	O
to	O
minimize	O
the	O
sum	O
of	O
the	O
diameters	O
of	O
the	O
clusters	O
,	O
where	O
the	O
diameter	O
of	O
any	O
single	O
cluster	O
is	O
the	O
largest	O
distance	O
between	O
any	O
two	O
of	O
its	O
points	O
.	O
</s>
<s>
If	O
the	O
target	O
diameters	O
of	O
the	O
two	O
clusters	O
are	O
known	O
,	O
a	O
clustering	O
that	O
achieves	O
those	O
targets	O
may	O
be	O
found	O
by	O
solving	O
a	O
2-satisfiability	B-Application
instance	O
.	O
</s>
<s>
To	O
test	O
whether	O
a	O
given	O
sum	O
of	O
diameters	O
can	O
be	O
achieved	O
without	O
knowing	O
the	O
individual	O
cluster	O
diameters	O
,	O
one	O
may	O
try	O
all	O
maximal	O
pairs	O
of	O
target	O
diameters	O
that	O
add	O
up	O
to	O
at	O
most	O
the	O
given	O
sum	O
,	O
representing	O
each	O
pair	O
of	O
diameters	O
as	O
a	O
2-satisfiability	B-Application
instance	O
and	O
using	O
a	O
2-satisfiability	B-Application
algorithm	O
to	O
determine	O
whether	O
that	O
pair	O
can	O
be	O
realized	O
by	O
a	O
clustering	O
.	O
</s>
<s>
The	O
time	O
bound	O
for	O
this	O
algorithm	O
is	O
dominated	O
by	O
the	O
time	O
to	O
solve	O
a	O
sequence	O
of	O
2-satisfiability	B-Application
instances	O
that	O
are	O
closely	O
related	O
to	O
each	O
other	O
,	O
and	O
shows	O
how	O
to	O
solve	O
these	O
related	O
instances	O
more	O
quickly	O
than	O
if	O
they	O
were	O
solved	O
independently	O
from	O
each	O
other	O
,	O
leading	O
to	O
a	O
total	O
time	O
bound	O
of	O
for	O
the	O
sum-of-diameters	O
clustering	O
problem	O
.	O
</s>
<s>
As	O
they	O
show	O
,	O
the	O
problem	O
is	O
NP-complete	O
,	O
even	O
when	O
each	O
teacher	O
has	O
at	O
most	O
three	O
available	O
hours	O
,	O
but	O
it	O
can	O
be	O
solved	O
as	O
an	O
instance	O
of	O
2-satisfiability	B-Application
when	O
each	O
teacher	O
only	O
has	O
two	O
available	O
hours	O
.	O
</s>
<s>
In	O
this	O
problem	O
,	O
each	O
variable	O
corresponds	O
to	O
an	O
hour	O
that	O
teacher	O
must	O
spend	O
with	O
cohort	O
,	O
the	O
assignment	O
to	O
the	O
variable	O
specifies	O
whether	O
that	O
hour	O
is	O
the	O
first	O
or	O
the	O
second	O
of	O
the	O
teacher	O
's	O
available	O
hours	O
,	O
and	O
there	O
is	O
a	O
2-satisfiability	B-Application
clause	O
preventing	O
any	O
conflict	O
of	O
either	O
of	O
two	O
types	O
:	O
two	O
cohorts	O
assigned	O
to	O
a	O
teacher	O
at	O
the	O
same	O
time	O
as	O
each	O
other	O
,	O
or	O
one	O
cohort	O
assigned	O
to	O
two	O
teachers	O
at	O
the	O
same	O
time	O
.	O
</s>
<s>
apply	O
2-satisfiability	B-Application
to	O
a	O
problem	O
of	O
sports	O
scheduling	O
,	O
in	O
which	O
the	O
pairings	O
of	O
a	O
round-robin	O
tournament	O
have	O
already	O
been	O
chosen	O
and	O
the	O
games	O
must	O
be	O
assigned	O
to	O
the	O
teams	O
 '	O
stadiums	O
.	O
</s>
<s>
Once	O
one	O
of	O
the	O
breakless	O
teams	O
is	O
chosen	O
,	O
one	O
can	O
set	O
up	O
a	O
2-satisfiability	B-Application
problem	O
in	O
which	O
each	O
variable	O
represents	O
the	O
home-away	O
assignment	O
for	O
a	O
single	O
team	O
in	O
a	O
single	O
game	O
,	O
and	O
the	O
constraints	B-Application
enforce	O
the	O
properties	O
that	O
any	O
two	O
teams	O
have	O
a	O
consistent	O
assignment	O
for	O
their	O
games	O
,	O
that	O
each	O
team	O
have	O
at	O
most	O
one	O
break	O
before	O
and	O
at	O
most	O
one	O
break	O
after	O
the	O
game	O
with	O
the	O
breakless	O
team	O
,	O
and	O
that	O
no	O
team	O
has	O
two	O
breaks	O
.	O
</s>
<s>
Therefore	O
,	O
testing	O
whether	O
a	O
schedule	O
admits	O
a	O
solution	O
with	O
the	O
optimal	O
number	O
of	O
breaks	O
can	O
be	O
done	O
by	O
solving	O
a	O
linear	O
number	O
of	O
2-satisfiability	B-Application
problems	O
,	O
one	O
for	O
each	O
choice	O
of	O
the	O
breakless	O
team	O
.	O
</s>
<s>
Tomography	B-Algorithm
is	O
the	O
process	O
of	O
recovering	O
shapes	O
from	O
their	O
cross-sections	O
.	O
</s>
<s>
In	O
discrete	B-Algorithm
tomography	I-Algorithm
,	O
a	O
simplified	O
version	O
of	O
the	O
problem	O
that	O
has	O
been	O
frequently	O
studied	O
,	O
the	O
shape	O
to	O
be	O
recovered	O
is	O
a	O
polyomino	O
(	O
a	O
subset	O
of	O
the	O
squares	O
in	O
the	O
two-dimensional	O
square	O
lattice	O
)	O
,	O
and	O
the	O
cross-sections	O
provide	O
aggregate	O
information	O
about	O
the	O
sets	O
of	O
squares	O
in	O
individual	O
rows	O
and	O
columns	O
of	O
the	O
lattice	O
.	O
</s>
<s>
For	O
instance	O
,	O
in	O
the	O
popular	O
nonogram	O
puzzles	O
,	O
also	O
known	O
as	O
paint	O
by	O
numbers	O
or	O
griddlers	O
,	O
the	O
set	O
of	O
squares	O
to	O
be	O
determined	O
represents	O
the	O
dark	O
pixels	B-Algorithm
in	O
a	O
binary	B-Algorithm
image	I-Algorithm
,	O
and	O
the	O
input	O
given	O
to	O
the	O
puzzle	O
solver	O
tells	O
him	O
or	O
her	O
how	O
many	O
consecutive	O
blocks	O
of	O
dark	O
pixels	B-Algorithm
to	O
include	O
in	O
each	O
row	O
or	O
column	O
of	O
the	O
image	O
,	O
and	O
how	O
long	O
each	O
of	O
those	O
blocks	O
should	O
be	O
.	O
</s>
<s>
In	O
other	O
forms	O
of	O
digital	O
tomography	B-Algorithm
,	O
even	O
less	O
information	O
about	O
each	O
row	O
or	O
column	O
is	O
given	O
:	O
only	O
the	O
total	O
number	O
of	O
squares	O
,	O
rather	O
than	O
the	O
number	O
and	O
length	O
of	O
the	O
blocks	O
of	O
squares	O
.	O
</s>
<s>
An	O
equivalent	O
version	O
of	O
the	O
problem	O
is	O
that	O
we	O
must	O
recover	O
a	O
given	O
0-1	B-Algorithm
matrix	I-Algorithm
given	O
only	O
the	O
sums	O
of	O
the	O
values	O
in	O
each	O
row	O
and	O
in	O
each	O
column	O
of	O
the	O
matrix	O
.	O
</s>
<s>
Although	O
there	B-Algorithm
exist	I-Algorithm
polynomial	O
time	O
algorithms	O
to	O
find	O
a	O
matrix	O
having	O
given	O
row	O
and	O
column	O
sums	O
,	O
the	O
solution	O
may	O
be	O
far	O
from	O
unique	O
:	O
any	O
submatrix	O
in	O
the	O
form	O
of	O
a	O
2×2	O
identity	B-Algorithm
matrix	I-Algorithm
can	O
be	O
complemented	O
without	O
affecting	O
the	O
correctness	O
of	O
the	O
solution	O
.	O
</s>
<s>
Therefore	O
,	O
researchers	O
have	O
searched	O
for	O
constraints	B-Application
on	O
the	O
shape	O
to	O
be	O
reconstructed	O
that	O
can	O
be	O
used	O
to	O
restrict	O
the	O
space	O
of	O
solutions	O
.	O
</s>
<s>
For	O
instance	O
,	O
one	O
might	O
assume	O
that	O
the	O
shape	O
is	O
connected	O
;	O
however	O
,	O
testing	O
whether	O
there	B-Algorithm
exists	I-Algorithm
a	O
connected	O
solution	O
is	O
NP-complete	O
.	O
</s>
<s>
Improving	O
several	O
previous	O
solutions	O
,	O
showed	O
how	O
to	O
reconstruct	O
connected	O
orthogonally	O
convex	O
shapes	O
efficiently	O
,	O
using	O
2-SAT	B-Application
.	O
</s>
<s>
The	O
idea	O
of	O
their	O
solution	O
is	O
to	O
guess	O
the	O
indexes	O
of	O
rows	O
containing	O
the	O
leftmost	O
and	O
rightmost	O
cells	O
of	O
the	O
shape	O
to	O
be	O
reconstructed	O
,	O
and	O
then	O
to	O
set	O
up	O
a	O
2-satisfiability	B-Application
problem	O
that	O
tests	O
whether	O
there	B-Algorithm
exists	I-Algorithm
a	O
shape	O
consistent	O
with	O
these	O
guesses	O
and	O
with	O
the	O
given	O
row	O
and	O
column	O
sums	O
.	O
</s>
<s>
They	O
use	O
four	O
2-satisfiability	B-Application
variables	O
for	O
each	O
square	O
that	O
might	O
be	O
part	O
of	O
the	O
given	O
shape	O
,	O
one	O
to	O
indicate	O
whether	O
it	O
belongs	O
to	O
each	O
of	O
four	O
possible	O
"	O
corner	O
regions	O
"	O
of	O
the	O
shape	O
,	O
and	O
they	O
use	O
constraints	B-Application
that	O
force	O
these	O
regions	O
to	O
be	O
disjoint	O
,	O
to	O
have	O
the	O
desired	O
shapes	O
,	O
to	O
form	O
an	O
overall	O
shape	O
with	O
contiguous	O
rows	O
and	O
columns	O
,	O
and	O
to	O
have	O
the	O
desired	O
row	O
and	O
column	O
sums	O
.	O
</s>
<s>
A	O
part	O
of	O
a	O
solver	O
for	O
full	O
nonogram	O
puzzles	O
,	O
used	O
2-satisfiability	B-Application
to	O
combine	O
information	O
obtained	O
from	O
several	O
other	O
heuristics	B-Algorithm
.	O
</s>
<s>
Given	O
a	O
partial	O
solution	O
to	O
the	O
puzzle	O
,	O
they	O
use	O
dynamic	B-Algorithm
programming	I-Algorithm
within	O
each	O
row	O
or	O
column	O
to	O
determine	O
whether	O
the	O
constraints	B-Application
of	O
that	O
row	O
or	O
column	O
force	O
any	O
of	O
its	O
squares	O
to	O
be	O
white	O
or	O
black	O
,	O
and	O
whether	O
any	O
two	O
squares	O
in	O
the	O
same	O
row	O
or	O
column	O
can	O
be	O
connected	O
by	O
an	O
implication	O
relation	O
.	O
</s>
<s>
They	O
also	O
transform	O
the	O
nonogram	O
into	O
a	O
digital	O
tomography	B-Algorithm
problem	O
by	O
replacing	O
the	O
sequence	O
of	O
block	O
lengths	O
in	O
each	O
row	O
and	O
column	O
by	O
its	O
sum	O
,	O
and	O
use	O
a	O
maximum	B-Algorithm
flow	I-Algorithm
formulation	O
to	O
determine	O
whether	O
this	O
digital	O
tomography	B-Algorithm
problem	O
combining	O
all	O
of	O
the	O
rows	O
and	O
columns	O
has	O
any	O
squares	O
whose	O
state	O
can	O
be	O
determined	O
or	O
pairs	O
of	O
squares	O
that	O
can	O
be	O
connected	O
by	O
an	O
implication	O
relation	O
.	O
</s>
<s>
If	O
either	O
of	O
these	O
two	O
heuristics	B-Algorithm
determines	O
the	O
value	O
of	O
one	O
of	O
the	O
squares	O
,	O
it	O
is	O
included	O
in	O
the	O
partial	O
solution	O
and	O
the	O
same	O
calculations	O
are	O
repeated	O
.	O
</s>
<s>
However	O
,	O
if	O
both	O
heuristics	B-Algorithm
fail	O
to	O
set	O
any	O
squares	O
,	O
the	O
implications	O
found	O
by	O
both	O
of	O
them	O
are	O
combined	O
into	O
a	O
2-satisfiability	B-Application
problem	O
and	O
a	O
2-satisfiability	B-Application
solver	O
is	O
used	O
to	O
find	O
squares	O
whose	O
value	O
is	O
fixed	O
by	O
the	O
problem	O
,	O
after	O
which	O
the	O
procedure	O
is	O
again	O
repeated	O
.	O
</s>
<s>
Batenburg	O
and	O
Kosters	O
report	O
that	O
,	O
although	O
most	O
newspaper	O
puzzles	O
do	O
not	O
need	O
its	O
full	O
power	O
,	O
both	O
this	O
procedure	O
and	O
a	O
more	O
powerful	O
but	O
slower	O
procedure	O
which	O
combines	O
this	O
2-satisfiability	B-Application
approach	O
with	O
the	O
limited	O
backtracking	B-Algorithm
of	O
are	O
significantly	O
more	O
effective	O
than	O
the	O
dynamic	B-Algorithm
programming	I-Algorithm
and	O
flow	O
heuristics	B-Algorithm
without	O
2-satisfiability	B-Application
when	O
applied	O
to	O
more	O
difficult	O
randomly	O
generated	O
nonograms	O
.	O
</s>
<s>
Next	O
to	O
2-satisfiability	B-Application
,	O
the	O
other	O
major	O
subclass	O
of	O
satisfiability	B-Algorithm
problems	I-Algorithm
that	O
can	O
be	O
solved	O
in	O
polynomial	O
time	O
is	O
Horn-satisfiability	O
.	O
</s>
<s>
In	O
this	O
class	O
of	O
satisfiability	B-Algorithm
problems	I-Algorithm
,	O
the	O
input	O
is	O
again	O
a	O
formula	O
in	O
conjunctive	B-Application
normal	I-Application
form	I-Application
.	O
</s>
<s>
found	O
a	O
generalization	O
of	O
this	O
class	O
,	O
renamable	O
Horn	O
satisfiability	O
,	O
that	O
can	O
still	O
be	O
solved	O
in	O
polynomial	O
time	O
by	O
means	O
of	O
an	O
auxiliary	O
2-satisfiability	B-Application
instance	O
.	O
</s>
<s>
To	O
do	O
so	O
,	O
Lewis	O
sets	O
up	O
a	O
2-satisfiability	B-Application
instance	O
with	O
one	O
variable	O
for	O
each	O
variable	O
of	O
the	O
renamable	O
Horn	O
instance	O
,	O
where	O
the	O
2-satisfiability	B-Application
variables	O
indicate	O
whether	O
or	O
not	O
to	O
negate	O
the	O
corresponding	O
renamable	O
Horn	O
variables	O
.	O
</s>
<s>
In	O
order	O
to	O
produce	O
a	O
Horn	O
instance	O
,	O
no	O
two	O
variables	O
that	O
appear	O
in	O
the	O
same	O
clause	O
of	O
the	O
renamable	O
Horn	O
instance	O
should	O
appear	O
positively	O
in	O
that	O
clause	O
;	O
this	O
constraint	B-Application
on	O
a	O
pair	O
of	O
variables	O
is	O
a	O
2-satisfiability	B-Application
constraint	B-Application
.	O
</s>
<s>
By	O
finding	O
a	O
satisfying	O
assignment	O
to	O
the	O
resulting	O
2-satisfiability	B-Application
instance	O
,	O
Lewis	O
shows	O
how	O
to	O
turn	O
any	O
renamable	O
Horn	O
instance	O
into	O
a	O
Horn	O
instance	O
in	O
polynomial	O
time	O
.	O
</s>
<s>
By	O
breaking	O
up	O
long	O
clauses	B-Application
into	O
multiple	O
smaller	O
clauses	B-Application
,	O
and	O
applying	O
a	O
linear-time	O
2-satisfiability	B-Application
algorithm	O
,	O
it	O
is	O
possible	O
to	O
reduce	O
this	O
to	O
linear	O
time	O
.	O
</s>
<s>
2-satisfiability	B-Application
has	O
also	O
been	O
applied	O
to	O
problems	O
of	O
recognizing	O
undirected	O
graphs	O
that	O
can	O
be	O
partitioned	O
into	O
an	O
independent	O
set	O
and	O
a	O
small	O
number	O
of	O
complete	O
bipartite	O
subgraphs	O
,	O
inferring	O
business	O
relationships	O
among	O
autonomous	O
subsystems	O
of	O
the	O
internet	O
,	O
and	O
reconstruction	O
of	O
evolutionary	O
trees	O
.	O
</s>
<s>
A	O
nondeterministic	O
algorithm	O
for	O
determining	O
whether	O
a	O
2-satisfiability	B-Application
instance	O
is	O
not	O
satisfiable	O
,	O
using	O
only	O
a	O
logarithmic	O
amount	O
of	O
writable	O
memory	O
,	O
is	O
easy	O
to	O
describe	O
:	O
simply	O
choose	O
(	O
nondeterministically	O
)	O
a	O
variable	O
v	O
and	O
search	O
(	O
nondeterministically	O
)	O
for	O
a	O
chain	O
of	O
implications	O
leading	O
from	O
v	O
to	O
its	O
negation	O
and	O
then	O
back	O
to	O
v	O
.	O
If	O
such	O
a	O
chain	O
is	O
found	O
,	O
the	O
instance	O
cannot	O
be	O
satisfiable	O
.	O
</s>
<s>
By	O
the	O
Immerman	O
–	O
Szelepcsényi	O
theorem	O
,	O
it	O
is	O
also	O
possible	O
in	O
nondeterministic	O
logspace	O
to	O
verify	O
that	O
a	O
satisfiable	O
2-satisfiability	B-Application
instance	O
is	O
satisfiable	O
.	O
</s>
<s>
2-satisfiability	B-Application
is	O
NL-complete	O
,	O
meaning	O
that	O
it	O
is	O
one	O
of	O
the	O
"	O
hardest	O
"	O
or	O
"	O
most	O
expressive	O
"	O
problems	O
in	O
the	O
complexity	O
class	O
NL	O
of	O
problems	O
solvable	O
nondeterministically	O
in	O
logarithmic	O
space	O
.	O
</s>
<s>
Completeness	O
here	O
means	O
that	O
a	O
deterministic	O
Turing	O
machine	O
using	O
only	O
logarithmic	O
space	O
can	O
transform	O
any	O
other	O
problem	O
in	O
NL	O
into	O
an	O
equivalent	O
2-satisfiability	B-Application
problem	O
.	O
</s>
<s>
Analogously	O
to	O
similar	O
results	O
for	O
the	O
more	O
well-known	O
complexity	O
class	O
NP	O
,	O
this	O
transformation	O
together	O
with	O
the	O
Immerman	O
–	O
Szelepcsényi	O
theorem	O
allow	O
any	O
problem	O
in	O
NL	O
to	O
be	O
represented	O
as	O
a	O
second	O
order	O
logic	O
formula	O
with	O
a	O
single	O
existentially	B-Algorithm
quantified	I-Algorithm
predicate	O
with	O
clauses	B-Application
limited	O
to	O
length	O
2	O
.	O
</s>
<s>
The	O
set	O
of	O
all	O
solutions	O
to	O
a	O
2-satisfiability	B-Application
instance	O
has	O
the	O
structure	O
of	O
a	O
median	O
graph	O
,	O
in	O
which	O
an	O
edge	O
corresponds	O
to	O
the	O
operation	O
of	O
flipping	O
the	O
values	O
of	O
a	O
set	O
of	O
variables	O
that	O
are	O
all	O
constrained	O
to	O
be	O
equal	O
or	O
unequal	O
to	O
each	O
other	O
.	O
</s>
<s>
Conversely	O
,	O
any	O
median	O
graph	O
can	O
be	O
represented	O
as	O
the	O
set	O
of	O
solutions	O
to	O
a	O
2-satisfiability	B-Application
instance	O
in	O
this	O
way	O
.	O
</s>
<s>
describes	O
an	O
algorithm	O
for	O
efficiently	O
listing	O
all	O
solutions	O
to	O
a	O
given	O
2-satisfiability	B-Application
instance	O
,	O
and	O
for	O
solving	O
several	O
related	O
problems	O
.	O
</s>
<s>
#2SAT	O
is	O
the	O
problem	O
of	O
counting	O
the	O
number	O
of	O
satisfying	O
assignments	O
to	O
a	O
given	O
2-CNF	O
formula	O
.	O
</s>
<s>
Moreover	O
,	O
there	O
is	O
no	O
fully	B-Algorithm
polynomial	I-Algorithm
randomized	I-Algorithm
approximation	I-Algorithm
scheme	I-Algorithm
for	O
#2SAT	O
unless	O
NP	O
=	O
RP	O
and	O
this	O
even	O
holds	O
when	O
the	O
input	O
is	O
restricted	O
to	O
monotone	O
2-CNF	O
formulas	O
,	O
i.e.	O
,	O
2-CNF	O
formulas	O
in	O
which	O
each	O
literal	O
is	O
a	O
positive	O
occurrence	O
of	O
a	O
variable	O
.	O
</s>
<s>
The	O
fastest	O
known	O
algorithm	O
for	O
computing	O
the	O
exact	O
number	O
of	O
satisfying	O
assignments	O
to	O
a	O
2SAT	B-Application
formula	O
runs	O
in	O
time	O
.	O
</s>
<s>
One	O
can	O
form	O
a	O
2-satisfiability	B-Application
instance	O
at	O
random	O
,	O
for	O
a	O
given	O
number	O
n	O
of	O
variables	O
and	O
m	O
of	O
clauses	B-Application
,	O
by	O
choosing	O
each	O
clause	O
uniformly	O
at	O
random	O
from	O
the	O
set	O
of	O
all	O
possible	O
two-variable	O
clauses	B-Application
.	O
</s>
<s>
More	O
precisely	O
,	O
if	O
m/n	O
is	O
fixed	O
as	O
a	O
constant	O
α	O
≠	O
1	O
,	O
the	O
probability	O
of	O
satisfiability	O
tends	O
to	O
a	O
limit	B-Algorithm
as	O
n	O
goes	O
to	O
infinity	O
:	O
if	O
α1	O
,	O
the	O
limit	B-Algorithm
is	O
one	O
,	O
while	O
if	O
α1	O
,	O
the	O
limit	B-Algorithm
is	O
zero	O
.	O
</s>
<s>
In	O
the	O
maximum-2-satisfiability	O
problem	O
(	O
MAX-2-SAT	O
)	O
,	O
the	O
input	O
is	O
a	O
formula	O
in	O
conjunctive	B-Application
normal	I-Application
form	I-Application
with	O
two	O
literals	O
per	O
clause	O
,	O
and	O
the	O
task	O
is	O
to	O
determine	O
the	O
maximum	O
number	O
of	O
clauses	B-Application
that	O
can	O
be	O
simultaneously	O
satisfied	O
by	O
an	O
assignment	O
.	O
</s>
<s>
Like	O
the	O
more	O
general	O
maximum	B-Application
satisfiability	I-Application
problem	I-Application
,	O
MAX-2-SAT	O
is	O
NP-hard	O
.	O
</s>
<s>
The	O
proof	O
is	O
by	O
reduction	O
from	O
3SAT	B-Algorithm
.	O
</s>
<s>
By	O
formulating	O
MAX-2-SAT	O
as	O
a	O
problem	O
of	O
finding	O
a	O
cut	B-Algorithm
(	O
that	O
is	O
,	O
a	O
partition	O
of	O
the	O
vertices	O
into	O
two	O
subsets	O
)	O
maximizing	O
the	O
number	O
of	O
edges	O
that	O
have	O
one	O
endpoint	O
in	O
the	O
first	O
subset	O
and	O
one	O
endpoint	O
in	O
the	O
second	O
,	O
in	O
a	O
graph	O
related	O
to	O
the	O
implication	O
graph	O
,	O
and	O
applying	O
semidefinite	O
programming	O
methods	O
to	O
this	O
cut	B-Algorithm
problem	O
,	O
it	O
is	O
possible	O
to	O
find	O
in	O
polynomial	O
time	O
an	O
approximate	O
solution	O
that	O
satisfies	O
at	O
least	O
940	O
...	O
times	O
the	O
optimal	O
number	O
of	O
clauses	B-Application
.	O
</s>
<s>
A	O
balanced	O
MAX	O
2-SAT	B-Application
instance	O
is	O
an	O
instance	O
of	O
MAX	O
2-SAT	B-Application
where	O
every	O
variable	O
appears	O
positively	O
and	O
negatively	O
with	O
equal	O
weight	O
.	O
</s>
<s>
For	O
this	O
problem	O
,	O
Austrin	O
has	O
improved	O
the	O
approximation	B-Algorithm
ratio	I-Algorithm
to	O
.	O
</s>
<s>
If	O
the	O
unique	O
games	O
conjecture	O
is	O
true	O
,	O
then	O
it	O
is	O
impossible	O
to	O
approximate	O
MAX	O
2-SAT	B-Application
,	O
balanced	O
or	O
not	O
,	O
with	O
an	O
approximation	B-Algorithm
constant	I-Algorithm
better	O
than	O
943	O
...	O
in	O
polynomial	O
time	O
.	O
</s>
<s>
Various	O
authors	O
have	O
also	O
explored	O
exponential	O
worst-case	O
time	O
bounds	O
for	O
exact	O
solution	O
of	O
MAX-2-SAT	O
instances	O
.	O
</s>
<s>
In	O
the	O
weighted	O
2-satisfiability	B-Application
problem	O
(	O
W2SAT	O
)	O
,	O
the	O
input	O
is	O
an	O
-variable	O
2SAT	B-Application
instance	O
and	O
an	O
integer	O
,	O
and	O
the	O
problem	O
is	O
to	O
decide	O
whether	O
there	B-Algorithm
exists	I-Algorithm
a	O
satisfying	O
assignment	O
in	O
which	O
exactly	O
of	O
the	O
variables	O
are	O
true	O
.	O
</s>
<s>
Each	O
edge	O
of	O
the	O
graph	O
may	O
be	O
represented	O
by	O
a	O
2SAT	B-Application
clause	O
that	O
can	O
be	O
satisfied	O
only	O
by	O
including	O
either	O
or	O
among	O
the	O
true	O
variables	O
of	O
the	O
solution	O
.	O
</s>
<s>
Then	O
the	O
satisfying	O
instances	O
of	O
the	O
resulting	O
2SAT	B-Application
formula	O
encode	O
solutions	O
to	O
the	O
vertex	O
cover	O
problem	O
,	O
and	O
there	O
is	O
a	O
satisfying	O
assignment	O
with	O
true	O
variables	O
if	O
and	O
only	O
if	O
there	O
is	O
a	O
vertex	O
cover	O
with	O
vertices	O
.	O
</s>
<s>
Moreover	O
,	O
in	O
parameterized	B-General_Concept
complexity	I-General_Concept
W2SAT	O
provides	O
a	O
natural	O
W[1]-complete	O
problem	O
,	O
which	O
implies	O
that	O
W2SAT	O
is	O
not	O
fixed-parameter	O
tractable	O
unless	O
this	O
holds	O
for	O
all	O
problems	O
in	O
W[1]	O
.	O
</s>
<s>
That	O
is	O
,	O
it	O
is	O
unlikely	O
that	O
there	B-Algorithm
exists	I-Algorithm
an	O
algorithm	O
for	O
W2SAT	O
whose	O
running	O
time	O
takes	O
the	O
form	O
.	O
</s>
<s>
As	O
well	O
as	O
finding	O
the	O
first	O
polynomial-time	O
algorithm	O
for	O
2-satisfiability	B-Application
,	O
also	O
formulated	O
the	O
problem	O
of	O
evaluating	O
fully	O
quantified	O
Boolean	O
formulae	O
in	O
which	O
the	O
formula	O
being	O
quantified	O
is	O
a	O
2-CNF	O
formula	O
.	O
</s>
<s>
The	O
2-satisfiability	B-Application
problem	O
is	O
the	O
special	O
case	O
of	O
this	O
quantified	O
2-CNF	O
problem	O
,	O
in	O
which	O
all	O
quantifiers	O
are	O
existential	B-Algorithm
.	O
</s>
<s>
showed	O
that	O
it	O
can	O
be	O
solved	O
in	O
linear	O
time	O
,	O
by	O
an	O
extension	O
of	O
their	O
technique	O
of	O
strongly	O
connected	O
components	O
and	O
topological	B-Algorithm
ordering	I-Algorithm
.	O
</s>
<s>
The	O
2-satisfiability	B-Application
problem	O
can	O
also	O
be	O
asked	O
for	O
propositional	O
many-valued	O
logics	O
.	O
</s>
