Gridding reconstruction is a method to reconstruct data onto a Cartesian grid from a set of nonuniformly sampled measurements. This method is appreciated for being robust and computationally fast. However, it lacks solid analysis and design tools to quantify or minimize the reconstruction error. Least squares reconstruction (LSR), on the other hand, is another method which is optimal in the sense that it minimizes the reconstruction error. This method is computationally intensive and, in many cases, sensitive to measurement noise. Hence, it is rarely used in practice. Despite their seemingly different approaches, the gridding and LSR methods are shown to be closely related. The similarity between these two methods is accentuated when they are properly expressed in a common matrix form. It is shown that the gridding algorithm can be considered an approximation to the least squares method. The optimal gridding parameters are defined as the ones which yield the minimum approximation error. These parameters are calculated by minimizing the norm of an approximation error matrix. This problem is studied and solved in the general form of approximation using linearly structured matrices. This method not only supports more general forms of the gridding algorithm, it can also be used to accelerate the reconstruction techniques from incomplete data. The application of this method to a case of two-dimensional (2-D) spiral magnetic resonance imaging shows a reduction of more than 4 dB in the average reconstruction error.