The approach that we propose in this paper is part of the optimization of the learning path in the e-learning environment. It relates more precisely to the adaptation and the guidance of the learners according to, on the one hand, their needs and cognitive abilities and, on the other hand, the collective experience of co-learners. This work is done by an optimizer agent that has the specificity to provide to each learner the best path from the beginning of the learning process to its completion. The optimization of this approach is determined automatically and dynamically, by seeking the path that is more marked by success. This determination is concluding according to the vision of the pedagogical team and the collective experience of the learners. At the same time, we search of the path that is more adapted to the specificities of the learner regarding preferences, level of knowledge and learner history. This operation is accomplished by exploiting their profile for perfect customization, and the adaptation of ant colony algorithm for guidance tends towards maximizing the acquisition of the learner. The design of our work is unitary; it is based on the integration of individual, collective factors of the learner. Moreover, the results are very conclusive. They show that the proposed approach can efficiently select the optimal path and that it participates fully in the satisfaction and success of the learner.