Difference Map Algorithm
   HOME

TheInfoList



OR:

The difference-map algorithm is a
search algorithm In computer science, a search algorithm is an algorithm designed to solve a search problem. Search algorithms work to retrieve information stored within particular data structure, or calculated in the search space of a problem domain, with eith ...
for general
constraint satisfaction In artificial intelligence and operations research, constraint satisfaction is the process of finding a solution through a set of constraints that impose conditions that the variables must satisfy. A solution is therefore a set of values for th ...
problems. It is a
meta-algorithm In computer science and mathematical optimization, a metaheuristic is a higher-level procedure (computer science), procedure or Heuristic (computer science), heuristic designed to find, generate, or select a heuristic (partial search algorithm) tha ...
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 a
dynamical system In mathematics, a dynamical system is a system in which a Function (mathematics), function describes the time dependence of a Point (geometry), point in an ambient space. Examples include the mathematical models that describe the swinging of a ...
based on a mapping of
Euclidean space Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, that is, in Euclid's Elements, Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics ther ...
. Solutions are encoded as fixed points of the mapping. Although originally conceived as a general method for solving the
phase problem In physics, the phase problem is the problem of loss of information concerning the phase that can occur when making a physical measurement. The name comes from the field of X-ray crystallography, where the phase problem has to be solved for the det ...
, the difference-map algorithm has been used for the
boolean satisfiability problem In logic and computer science, the Boolean satisfiability problem (sometimes called propositional satisfiability problem and abbreviated SATISFIABILITY, SAT or B-SAT) is the problem of determining if there exists an interpretation that satisfie ...
,
protein structure prediction Protein structure prediction is the inference of the three-dimensional structure of a protein from its amino acid sequence—that is, the prediction of its secondary and tertiary structure from primary structure. Structure prediction is different ...
,
Ramsey numbers In combinatorics, Ramsey's theorem, in one of its graph-theoretic forms, states that one will find monochromatic cliques in any edge labelling (with colours) of a sufficiently large complete graph. To demonstrate the theorem for two colours (say ...
,
diophantine equations In mathematics, a Diophantine equation is an equation, typically a polynomial equation in two or more unknowns with integer coefficients, such that the only solutions of interest are the integer ones. A linear Diophantine equation equates to a c ...
, and ''
Sudoku Sudoku (; ja, 数独, sūdoku, digit-single; originally called Number Place) is a logic-based, combinatorial number-placement puzzle. In classic Sudoku, the objective is to fill a 9 × 9 grid with digits so that each column, each row ...
'', as well as sphere- and disk-packing problems. Since these applications include
NP-complete In computational complexity theory, a problem is NP-complete when: # it is a problem for which the correctness of each solution can be verified quickly (namely, in polynomial time) and a brute-force search algorithm can find a solution by tryi ...
problems, the scope of the difference map is that of an incomplete 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 In computational mathematics, an iterative method is a mathematical procedure that uses an initial value to generate a sequence of improving approximate solutions for a class of problems, in which the ''n''-th approximation is derived from the pr ...
: Fienup's Hybrid input output (HIO) algorithm for phase retrieval and the Douglas-Rachford algorithm for
convex optimization Convex optimization is a subfield of mathematical optimization that studies the problem of minimizing convex functions over convex sets (or, equivalently, maximizing concave functions over convex sets). Many classes of convex optimization probl ...
. 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 In set theory, the intersection of two sets A and B, denoted by A \cap B, is the set containing all elements of A that also belong to B or equivalently, all elements of B that also belong to A. Notation and terminology Intersection is writt ...
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: : \begin x \mapsto D(x) &= x + \beta \left P_A \left( f_B(x)\right) - P_B \left( f_A(x)\right)\right \\ f_A(x) &= P_A(x) - \frac\left( P_A(x) - x\right), \\ f_B(x) &= P_B(x) + \frac\left( P_B(x) - x\right) \end The real parameter \beta should not be equal to 0 but can have either sign; optimal values depend on the application and are determined through experimentation. As a first guess, the choice \beta = 1 (or \beta = -1) is recommended because it reduces the number of projection computations per iteration: :D(x) = x + P_A\left( 2P_B(x) - x\right)-P_B(x) A point x is a fixed point of the map x \mapsto D(x) precisely when P_A\left(f_B(x)\right) = P_B\left(f_A(x)\right). Since the left-hand side is an element of A and the RHS is an element of B, the equality implies that we have found a common element to the two constraint sets. Note that the fixed point x itself need not belong to either A or B. The set of fixed points will typically have much higher dimension than the set of solutions. The progress of the algorithm can be monitored by inspecting the norm of the difference of the two projections: :\Delta = \left, P_A \left( f_B(x)\right) - P_B \left( f_A(x)\right)\. When this vanishes, a point common to both constraint sets has been found and the algorithm can be terminated.


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 In computer science, 2-satisfiability, 2-SAT or just 2SAT is a computational problem of assigning values to variables, each of which has two possible values, in order to satisfy a system of Constraint (mathematics), constraints on pairs of variabl ...
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: : 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 ''x''11, ''x''21 and ''x''41 correspond to the same boolean variable (''q''1) 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: :''x''11 = -''x''21 = ''x''41 :''x''12 = -''x''31 = -''x''42 :''x''22 = -''x''32 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: :''a''1 = (''x''11 - ''x''21 + ''x''41) / 3 :''x''11 → ''a''1   ''x''21 → -''a''1   ''x''41 → ''a''1 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 ''x''0, say : Using β = 1, the next step is to compute ''P''B(''x''0) : : This is followed by 2''P''B(''x''0) - ''x''0, : and then projected onto the other constraint, ''P''A(2''P''B(''x''0) - ''x''0) : : Incrementing ''x''0 by the difference of the two projections gives the first iteration of the difference map, ''D''(''x''0) = ''x''1 : : 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 with the behavior of ''Δ'' when the difference map is given a hard instance of
3-SAT In logic and computer science, the Boolean satisfiability problem (sometimes called propositional satisfiability problem and abbreviated SATISFIABILITY, SAT or B-SAT) is the problem of determining if there exists an interpretation that satisfie ...
, where it fluctuates strongly prior to the discovery of the fixed point. As a dynamical system the difference map is believed to be
chaotic Chaotic was originally a Danish trading card game. It expanded to an online game in America which then became a television program based on the game. The program was able to be seen on 4Kids TV (Fox affiliates, nationwide), Jetix, The CW4Kid ...
, and that the space being searched is a
strange attractor In the mathematical field of dynamical systems, an attractor is a set of states toward which a system tends to evolve, for a wide variety of starting conditions of the system. System values that get close enough to the attractor values remain ...
.


Phase retrieval

In phase retrieval a signal or image is reconstructed from the modulus (absolute value, magnitude) of its
discrete Fourier transform In mathematics, the discrete Fourier transform (DFT) converts a finite sequence of equally-spaced samples of a function into a same-length sequence of equally-spaced samples of the discrete-time Fourier transform (DTFT), which is a complex- ...
. For example, the source of the modulus data may be the
Fraunhofer diffraction In optics, the Fraunhofer diffraction equation is used to model the diffraction of waves when plane waves are incident on a diffracting object, and the diffraction pattern is viewed at a sufficiently long distance (a distance satisfying Fraunhofer ...
pattern formed when an object is illuminated with
coherent light In physics, two wave sources are coherent if their frequency and waveform are identical. Coherence is an ideal property of waves that enables stationary (i.e., temporally or spatially constant) interference. It contains several distinct concepts ...
. 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 In mathematics, a unitary transformation is a transformation that preserves the inner product: the inner product of two vectors before the transformation is equal to their inner product after the transformation. Formal definition More precisely, ...
, 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 Support may refer to: Arts, entertainment, and media * Supporting character Business and finance * Support (technical analysis) * Child support * Customer support * Income Support Construction * Support (structure), or lateral support, a ...
, etc. In the reconstruction of the surface image, for example, the effect of the projection ''P''''B'' was to nullify all values outside a rectangular support, and also to nullify all negative values within the support.


External links


Sudoku Solver
- A Sudoku solver based on Difference Map algorithm.


Notes

{{reflist, 2 Search algorithms Constraint programming