For some decades now, theories on learning methodologies have advocated collaborative learning due to its good results in terms of effectiveness and learning types and its promotion of educational and social values. This means that teachers need to be able to apply different criteria when forming heterogeneous groups of students and to use automated techniques to assist them. In this study, we have created an approach based on complex network theory to design an algorithm called Minimum Entropy Collaborative Groupings (MECG) in order to form these heterogeneous groups more effectively. The algorithm was tested firstly under a synthetic framework and secondly in a real situation. In the first case, we generated 30 synthetic classrooms of different sizes and compared our approach with a genetic algorithm and a random grouping. In the latter case, the approach was tested on a group of 200 students on two subjects of a master’s degree in teacher training. For each subject there were 4 large groups of 50 students each, in which collaborative groups of 4 students were created. Two of these large groups were used as random groups, another group used the CHAEA test and the fourth group used the LML test. The results showed that the groups created with MECG were more effective, had less uncertainty and were more interrelated and mature. It was observed that the randomized groups did not obtain significantly better LML results and that this cannot be related to any emotional or motivational effect because the students performed the test as a placebo measure. In terms of learning styles, the results were significantly better with LML than with CHAEA, whereas no significant difference was observed in the randomized groups.