Abstract In view of the problems such as a plurality of dominant water flow channels formed by flushing the reservoir and inferior development effect in the water injection oilfields, reconstructing the current well pattern and providing well pattern evaluation methods are important ways to enhance oil recovery by improving the injection–production relation and increasing the swept area of water flooding. However, the reservoir engineering methods, the simulation methods, and the artificial intelligence algorithms with few objectives enable comprehensive evaluation of the well pattern. In this article, considering multiple evaluation indexes in oilfield development by the glowworm swarm optimization algorithm and niche technology, automatic well pattern optimization is carried out. The glowworm swarm optimization algorithm has the advantage of efficient global search and simpler algorithm flow, which can speed up the convergence and reduce the parameter adjustment. The niche technology can better maintain the diversity of the solutions and solve the multimodal optimization problems more efficiently, accurately, and reliably. The new method was used to optimize the well pattern of one block in a water-flooding oilfield with high water-cut in a certain oilfield. The optimal well pattern is obtained by multiple iterations to maximize the control degree of the well pattern to the sand body. The results indicate that the injection production correspondence ratio and the reserves control degree of the well pattern to the sand body are improved by 4.48% and 7.94%, respectively.