Heterogeneous congestion games make it possible to simulate traffic situations involving multiple classes of vehicles with different preferences in choosing routes. In this work, we prove the existence of a potential in a discrete congestion game with n classes of players. Examples are given in which we calculate equilibria and demonstrate the emergence of the Braess paradox, as well as use the constructed congestion game to analyze the distribution of vehicles in the graph of urban roads for the city of Petrozavodsk.