On a mesh-connected computer, moving data across the mesh is the most time-consuming operation in many algorithms. This time can be reduced by using a mesh with smaller diameter, that is with fewer processing elements. To accomodate inputs of the same size, this requires that the processors have more memory. For image-processing and graph-theoretic algorithms an analysis is made of the time as a function of the mesh diameter and problem size. It is shown that for many problems, smaller diameters can yield faster algorithms, and that there is a choice of diameter that is simultaneously best for several of these problems. Further, for these problems and this number of processing elements (or any smaller number), the mesh is an optimal interconnection scheme.