Aimed at the problem that the existing K-means clustering (KMC) algorithm is greatly affected by initialization, and the randomly generated clustering center can easily make the clustering result fall into local optimum and stop iterating, resulting in low clustering accuracy and poor robustness, a K-means hybrid iterative clustering algorithm based on memory transfer sailfish optimization (MTSFO-HIKMC) is proposed. First, learning from the existing improvement ideas, the maximum and minimum distance product is introduced to initialize the KMC cluster center, to avoid the uncertainty caused by random initialization. At the same time, in the iterative process, the current optimal solution is made to locally perform adaptive memory transfer correction to solve the problem of poor global optimization ability and insufficient search accuracy caused by the single search path of the sailfish algorithm. Using the Iris, Seeds, CMC and Wine international standard data sets, the MTSFO-HIKMC, the sailfish optimized K-means hybrid iterative clustering (SFO-KMC) algorithm, the introduction of the improved Moth-to-fire K-means cross iterative clustering (IMFO-KMC) algorithm, the KMC algorithm, and the fuzzy C-means (FCM) algorithm are compared and tested. From the obtained convergence curves and performance indicators, it can be seen that the MTSFO-HIKMC algorithm proposed in this paper has a faster convergence speed than IMFO-KMC. Compared with the IMFO-KMC algorithm, the dimensional space has a higher search accuracy. Compared with the KMC algorithm and FCM, it has a higher search accuracy. Compared with the SFO-KMC algorithm, its convergence speed and search accuracy are significantly improved, especially in high-dimensional data sets.