A 3D ultrasound image is desired in many medical examinations. However, the implementation of a 2D array, which is needed for a 3D image, is challenging with respect to fabrication, interconnection and cabling. A 2D sparse array, which needs fewer elements than a dense array, is a realistic way to achieve 3D images. Because the number of ways the elements can be placed in an array is extremely large, a method for optimizing the array configuration is needed. Previous research placed the target point far from the transducer array, making it impossible to optimize the array in the operating range. In our study, we focused on optimizing a 2D sparse array transducer for 3D imaging by using a simulated annealing method. We compared the far-field optimization method with the near-field optimization method by analyzing a point-spread function (PSF). The resolution of the optimized sparse array is comparable to that of the dense array.