Social media platforms play a vital role in determining valuable tourist objectives, which greatly aids in optimizing tourist path planning. As data classification and analysis methods have advanced, machine learning (ML) algorithms such as the k-means algorithm have emerged as powerful tools for sorting through data collected from social media platforms. However, traditional k-means algorithms have drawbacks, including challenges in determining initial seed values. This paper presents a novel approach to enhance the k-means algorithm based on survey and social media tourism data for tourism path recommendations. The main contribution of this paper is enhancing the traditional k-means algorithm by employing the genetic algorithm (GA) to determine the number of clusters (k), select the initial seeds, and recommend the best tourism path based on social media tourism data. The GA enhances the k-means algorithm by using a binary string to represent initial centers and to apply GA operators. To assess its effectiveness, we applied this approach to recommend the optimal tourism path in the Red Sea State, Sudan. The results clearly indicate the superiority of our approach, with an algorithm optimization time of 0.01 s. In contrast, traditional k-means and hierarchical cluster algorithms required 0.27 and 0.7 s, respectively.