We propose an optical correlation algorithm illustrating a new general method for reconstructing the phase skeleton of complex optical fields from the measured two-dimensional intensity distribution. The core of the algorithm consists in locating the saddle points of the intensity distribution and connecting such points into nets by the lines of intensity gradient that are closely associated with the equi-phase lines of the field. This algorithm provides a new partial solution to the inverse problem in optics commonly referred to as the phase problem.