The analysis and exploration of traces of mobility produced by various mobile objects is a research topic that has attracted great interest in recent years. In this article, we present a classification (or clustering) approach adapted to the data of people moving under the constraints of a road network. A similarity measure is proposed to compare the trajectories studied with each other, taking into account the displacement constraints imposed by the network. This measurement is exploited to build a graph translating the different similarity relations maintained by the trajectories between them. We partition this graph using an algorithm using the notion of modularity as a quality criterion in order to discover communities (or clusters) of trajectories which are strongly linked and which exhibit a common behavior. We have implemented and tested the proposed approach on several synthetic datasets through which we show its operation.