The aim of forming collaborative learning teams is that participating students acquire new knowledge and skills through the interaction with their peers. To reach this aim, teachers usually utilize a grouping criterion based on the students’ roles and on forming well-balanced teams according to the roles of their members. However, the implementation of this criterion requires a considerable amount of time, effort and knowledge on the part of the teachers. In this paper, we propose a deterministic crowding evolutionary algorithm with the aim of assisting teachers when forming well-balanced collaborative learning teams. Considering a given number of students who must be divided into a given number of teams, the algorithm both designs different alternatives to divide students into teams and evaluates each alternative as regards the grouping criterion previously mentioned. This evaluation is carried out on the basis of knowledge of the students’ roles. To analyze the performance of the proposed algorithm, we present the computational experiments developed on ten data sets with different levels of complexity. The obtained results are really promising since the algorithm has reached optimal solutions for the first four data sets and near-optimal solutions for the remaining six data sets