It has been shown experimentally that a decimation algorithm based on survey propagation~(SP) equations allows one to solve efficiently some combinatorial problems over random graphs. We show that these equations can be derived as sum–product equations for the computation of marginals in an extended space where the variables are allowed to take an additional value—*—when they are not forced by the combinatorial constraints. An appropriate ‘local equilibrium condition’ cost/energy function is introduced and its entropy is shown to coincide with the expected logarithm of the number of clusters of solutions as computed by SP. These results may help to clarify the geometrical notion of clusters assumed by SP for random K -SAT or random graph colouring (where it is conjectured to be exact) and help to explain which kind of clustering operation or approximation is enforced in general/small sized models in which it is known to be inexact.