Abstract. Train formation planning faces two types of challenges; namely, the determination of the quantity of cargo trains run known as the frequency of cargo trains and the formation of desired allocations of demands to a freight train. To investigate the issues of train makeup and train routing simultaneously, this multiobjective model optimizes the total profit, satisfaction level of customers, yard activities in terms of the total size of a shunting operation, and underutilized train capacity. It also considers the guarantee for the yard-demand balance of flow, maximum and minimum limitations for the length of trains, maximum yard limitation for train formation, maximum yard limitation for operations related to shunting, maximum limitation for the train capacity, and upper limit of the capacity of each arc in passing trains. In this paper, a goal programming approach and an Lp norm method are applied to the problem. Furthermore, a simulated annealing (SA) algorithm is designed. Some test problems are also carried out via simulation and solved using the SA algorithm. Furthermore, a sample investigation is carried out in a railway company in Iran. The findings show the capability and performance of the proposed approach to solve the problems in a real rail network.