The assembly of an optical system requires the correction of aberrations in the entire imaging field by making selected rigid-body motions of the optical elements. We present a rigorous method for determining which adjustment motions, called compensators, to use for alignment. These compensators are found by employing techniques from linear algebra that choose the most independent vectors from a set which are interdependent. The method finds the smallest number of compensators to correct for misalignments of a given magnitude. As an example the method is applied to a four-mirror scanning ring-field EUV lithography system. It is shown that out of 32 degrees of freedom in the configuration of the optical elements, only eight compensators are required on the optics. By adjusting these compensators a misaligned configuration giving 30 lambda wavefront error can be assembled to lambda/50 in the absense of measurement noise.