There is a minimization procedure designed to locate a minimum on the potential energy surface of the nuclear geometry. Programs that can calculate the molecular energy will use the energy criterion to systematically search for the geometry with the lowest energy. The methods for doing this have three main phases.
Steepest descent
Conjugate gradient
Newton Raphson
The steepest descent uses the derivatives on the potential energy surface to find the downhill direction. Successive attempts are usually normal to the initial step so that steepest descent follows a zig-zag pattern that moves to lower energy. Conjugate gradient uses the gradient information on previous steps to find a more direct approach in the direction of the minimum. It is more computationally expensive so one usually uses conjugate gradient after steepest descent. Has been used for a number of steps. The Newton-Raphson method uses second derivative information to more rapidly locate an actual minimum. The Newton-Raphson method is only applicable when the system is close to the minimum. The three phases of geometry optimization are discussed in the pdf document.