- Difference map algorithm
The difference map algorithm is a
search algorithm for generalconstraint satisfaction problems. It is ameta-algorithm in the sense that it is built from more basic algorithms that perform projections onto constraint sets. From a mathematical perspective, the difference map algorithm is adynamical system based on a mapping ofEuclidean space . Solutions are encoded as fixed points of the mapping.Although originally conceived as a general method for solving the
phase problem , the difference map algorithm has been used for theboolean satisfiability problem ,protein structure prediction ,Ramsey numbers ,diophantine equations , and "Sudoku " [V. Elser, I. Rankenburg, and P. Thibault, "Searching with iterated maps". "Proceedings of the National Academy of Sciences " USA. (2007). 104:418-423. http://www.pnas.org/cgi/content/short/104/2/418] . Since these applications includeNP-complete problems, the scope of the difference map is that of anincomplete algorithm . Whereas incomplete algorithms can efficiently verify solutions (once a candidate is found), they cannot prove that a solution does not exist.The difference map algorithm is a generalization of two
iterative methods : Fienup'shybrid input-output phase retrieval algorithm [J.R. Fienup, "Phase retrieval algorithms: a comparison". "Applied Optics ". (1982). 21:2758-2769.] and theDouglas-Rachford algorithm [H.H. Bauschke, P.L. Combettes, and D.R. Luke, "Phase retrieval, error reduction algorithm, and Fienup variants: a view from convex optimization". "Journal of the Optical Society of America A ". (2002). 19:1334-1345.] forconvex optimization . Iterative methods, in general, have a long history in phase retrieval and convex optimization. The use of this style of algorithm for hard, non-convex problems is a more recent development.Algorithm
The problem to be solved must first be formulated as a
set intersection problem in Euclidean space: find an "x" in the intersection of sets "A" and "B". Another prerequisite is an implementation of the projections "P""A" and "P""B" that, given an arbitrary input point "x", return a point in the constraint set "A" or "B" that is nearest to "x". One iteration of the algorithm is given by the mapping::"x" → "D"("x") = "x" + β [ "P""A"( "f""B"("x")) - "P""B"( "f""A"("x")) ] ,
::"f""A"("x") = "P""A"("x") - ("P""A"("x")-"x")/β ,
::"f""B"("x") = "P""B"("x") + ("P""B"("x")-"x")/β .
The real parameter β can have either sign; optimal values depend on the application and are determined through experimentation. As a first guess, the choice β = 1 (or β = -1) is recommended because it reduces the number of projection computations per iteration:
:"D"("x") = "x" + "P""A"(2 "P""B"("x") - "x") - "P""B"("x") .
The progress of the algorithm is monitored by inspecting the norm of the difference of the two projections:
:"Δ" = | "P""A"( "f""B"("x")) - "P""B"( "f""A"("x")) | .
When this vanishes, at fixed points of the map, a point common to both constraint sets has been found and the algorithm is terminated. The set of fixed points in a particular application will normally have a large
dimension , even when the solution set is a single point.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)::("q"1 or "q"2) and (~"q"1 or "q"3) and (~"q"2 or ~"q"3) and ("q"1 or ~"q"2)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:
:
This is followed by 2"P"B("x"0) - "x"0,
:
Here is the second iteration, "D"("x"1) = "x"2 :
:
This is a fixed point: "D"("x"2) = "x"2. The iterate is unchanged because the two projections agree. From "P""B"("x"2) ,
:
we can read off the satisfying truth assignment: "q"1 = "TRUE", "q"2 = "FALSE", "q"3 = "TRUE".
Chaotic dynamics
In the simple 2-SAT example above, the norm of the difference map increment "Δ" decreased monotonically to zero in three iterations. This contrasts the behavior of "Δ" when the difference map is given a hard instance of
3-SAT , where it fluctuates strongly prior to the discovery of the fixed point. As a dynamical system the difference map is believed to be chaotic, and that the space being searched is astrange attractor .Phase retrieval
In phase retrieval a signal or image is reconstructed from the modulus (absolute value, magnitude) of its
discrete Fourier transform . For example, the source of the modulus data may be theFraunhofer diffraction pattern formed when an object is illuminated withcoherent light .The projection to the Fourier modulus constraint, say "P""A", is accomplished by first computing the discrete Fourier transform of the signal or image, rescaling the moduli to agree with the data, and then inverse transforming the result. This is a projection, in the sense that the Euclidean distance to the constraint is minimized, because (i) the discrete Fourier transform, as a
unitary transformation , preserves distance, and (ii) rescaling the modulus (without modifying the phase) is the smallest change that realizes the modulus constraint.To recover the unknown phases of the Fourier transform the difference map relies on the projection to another constraint, "P""B". This may take several forms, as the object being reconstructed may be known to be positive, have a bounded support, etc. In the reconstruction of the Wikipedia logo, for example, the effect of the projection "P""B" was to zero all values outside a rectangular support and also to zero all negative values within the support.
References
Wikimedia Foundation. 2010.