The aim of this article is to propose a new innovative grouping approach using the genetic algorithm (GA) to enhance the interaction and collaboration among peers by considering the complementary degree of students' learning status and their social relationships. In order to validate our approach, experiments were designed with a group of students and the outcomes were tested with an e-Learning system. The auto-grouping mechanism is developed using GA for better learning results, which is justified based on the performance of students tested on the e-Learning system. The outcomes clearly indicate that the proposed approach can generate a high degree of heterogeneous grouping and encourage students to learn better. The technical contribution of this article can be implemented in any massive open online course platforms with thousands of students, with regard to identifying peers for collaborative works.