Modeling maps using trip data
It depends on the application and the Data.Could you provide more details about the data of the trips? Do you have GPS-positions for the trips?

There are Libraries such as Barefoot which support you in map-matching, meaning that it maps your positions to the underlying map, in most cases OpenStreetMap. This library uses Hidden Markov Models for online and offline Map Matching. Maybe this could help you as well, when implementing your own model.