Knowing how to derive the shape of a protein from X-ray diffraction data is one thing — but could it also help solve a Sudoku puzzle? Yes, say Veit Elser and colleagues (Proc. Natl Acad. Sci. USA 104, 418–423; 2007). They argue that their variant of a strategy used for decades in image reconstruction provides a general approach to tackling the kind of problem for which a solution can usually only be found by searching through a (typically large) set of possibilities. They have explored some of these problems — from protein folding, to identifying the ground state of spin glasses, to placing numbers in the correct squares of a Sudoku grid — and found that their general-purpose algorithm can keep up with those developed specifically for the respective applications.

Elser et al. realized that, in many search problems, two constraints can be formulated, such that the solution can be found in the set of elements that satisfy these two constraints simultaneously. Solving the overall problem might be hard, but finding a solution satisfying one constraint can be easy, as is finding a solution consistent with the other constraint. Take Sudoku for example: one constraint is that each block has to contain a permutation of the numbers 1 to 9, and the other is that each number appears only once in each row and column. Beginning with a random set of numbers on the Sudoku grid, it is relatively easy for a computer to find a valid solution that is consistent with either constraint — but it takes some artistry to arrive at a set of numbers that satisfies both at the same time.

And this is where the techniques of image reconstruction come into play. In the case of X-ray diffraction data, so-called iterated-map algorithms have been developed and refined since the 1980s. These algorithms do exactly what is required: with high computational efficiency, they direct a random 'point' in a particular search problem on a 'path' towards a point that satisfies simultaneously two competing constraints. Elser and colleagues' survey demonstrates, at last, the potential broader scope of iterated-map algorithms. For example, newspaper Sudokus can be solved using the algortihm in a matter of milliseconds; the puzzle pictured — contributed by 'Nick70' to the site www.setbb.com/phpbb, and the trickiest test of the approach so far — was solved in three seconds. How fast can you solve it?