Difference-map Algorithm - Example: Logical Satisfiability

Example: Logical Satisfiability

Incomplete algorithms, such as stochastic local search, are widely used for finding satisfying truth assignments to boolean formulas. As an example of solving an instance of 2-SAT with the difference-map algorithm, consider the following formula (~ indicates NOT):

(q1 or q2) and (~q1 or q3) and (~q2 or ~q3) and (q1 or ~q2)

To each of the eight literals in this formula we assign one real variable in an eight dimensional Euclidean space. The structure of the 2-SAT formula can be recovered when these variables are arranged in a table:

x11 x12
(x21) x22
(x31) (x32)
x41 (x42)

Rows are the clauses in the 2-SAT formula and literals corresponding to the same boolean variable are arranged in columns, with negation indicated by parentheses. For example, the real variables x11, x21 and x41 correspond to the same boolean variable (q1) or its negation, and are called replicas. It is convenient to associate the values 1 and -1 with TRUE and FALSE rather than the traditional 1 and 0. With this convention, the compatibility between the replicas takes the form of the following linear equations:

x11 = -x21 = x41
x12 = -x31 = -x42
x22 = -x32

The linear subspace where these equations are satisfied is one of the constraint spaces, say A, used by the difference map. To project to this constraint we replace each replica by the signed replica average, or its negative:

a1 = (x11 - x21 + x41) / 3
x11a1 x21 → -a1 x41a1

The second difference-map constraint applies to the rows of the table, the clauses. In a satisfying assignment, the two variables in each row must be assigned the values (1, 1), (1, -1), or (-1, 1). The corresponding constraint set, B, is thus a set of 34 = 81 points. In projecting to this constraint the following operation is applied to each row. First, the two real values are rounded to 1 or -1; then, if the outcome is (-1, -1), the larger of the two original values is replaced by 1. Examples:

(-.2, 1.2) → (-1, 1)
(-.2, -.8) → (1, -1)

It is a straightforward exercise to check that both of the projection operations described minimize the Euclidean distance between input and output values. Moreover, if the algorithm succeeds in finding a point x that lies in both constraint sets, then we know that (i) the clauses associated with x are all TRUE, and (ii) the assignments to the replicas are consistent with a truth assignment to the original boolean variables.

To run the algorithm one first generates an initial point x0, say

-0.5 -0.8
(-0.4) -0.6
(0.3) (-0.8)
0.5 (0.1)

Using β = 1, the next step is to compute PB(x0) :

1 -1
(1) -1
(1) (-1)
1 (1)

This is followed by 2PB(x0) - x0,

2.5 -1.2
(2.4) -1.4
(1.7) (-1.2)
1.5 (1.9)

and then projected onto the other constraint, PA(2PB(x0) - x0) :

0.53333 -1.6
(-0.53333) -0.1
(1.6) (0.1)
0.53333 (1.6)

Incrementing x0 by the difference of the two projections gives the first iteration of the difference map, D(x0) = x1 :

-0.96666 -1.4
(-1.93333) 0.3
(0.9) (0.3)
0.03333 (0.7)

Here is the second iteration, D(x1) = x2 :

-0.3 -1.4
(-2.6) -0.7
(0.9) (-0.7)
0.7 (0.7)

This is a fixed point: D(x2) = x2. The iterate is unchanged because the two projections agree. From PB(x2),

1 -1
(-1) 1
(1) (-1)
1 (1)

we can read off the satisfying truth assignment: q1 = TRUE, q2 = FALSE, q3 = TRUE.

Read more about this topic:  Difference-map Algorithm

Famous quotes containing the word logical:

    The sensual and spiritual are linked together by a mysterious bond, sensed by our emotions, though hidden from our eyes. To this double nature of the visible and invisible world—to the profound longing for the latter, coupled with the feeling of the sweet necessity for the former, we owe all sound and logical systems of philosophy, truly based on the immutable principles of our nature, just as from the same source arise the most senseless enthusiasms.
    Karl Wilhelm Von Humboldt (1767–1835)