Optimization models for train load and transport planning problems

Optimization of rail transport is complex because of the industry’s multiple constraints. The transport of containers is very particular since it is characterized in addition to its specificities as a product to be loaded and transported by a strong instability of the demand. So far research in this area has dealt only with the separate treatment of the train load and transport problem. The present study focuses on optimizing resources facing unstable demand for the combined problem. Mathematical models are proposed to assign customers demands to wagons and for railcars allowance per axis depending on the available park, the locomotive capacity and the train length. An algorithm for the train load problem is also suggested. The models have been tested to measure their efficiency by comparing them to an existing train planning model and to manual assignment adopted in the rail industry. Some test results are finally reported to show how a novel formulation can simplify the resolution of a complex problem.


Introduction and literature review
Rail transport is a unique production of services that involves several stakeholders at once to respond to customers orders for different products to be transported.Each product imposes specific constraints.The design of efficient rail supply chain is challenging particularly containers transport and that for several reasons.The orders are divided into forecasted and sudden orders which we know about only the day before.The characteristics of the demand are variable over time, in terms of quantities (number of containers) and technical specifications (nature of containers and their weights).The demand is also very unstable.The delivery times of these products are very low in a highly competitive market.This traffic is also characterized by the multiplicity of stakeholders which makes its management particularly difficult.The rail network and the transport plan impose strict constraints that need to be respected.
The optimization of rail transport can be done by different methods that aim to the most appropriate planning.We can therefore intervene on loading on trains, allocation on the network or strategic planning of needed trains.Some works treated loading on trains particularly intermodal ones.Corry and Kozan [1] propose a mixed-integer programming model to determine the spatial arrangement of containers on a train known as the train planning problem to minimize a weighted total number of wagons required and equipment working time.They then use heuristics local search and simulated annealing algorithm because of the large number of variable.Ambrosino and Siri [2] propose mathematical models to find the optimal assignment of containers to train slots while allowing the e-mail: lamiaadahite@gmail.compossibility of reshuffles in the stacking area and to not sequentially load the train to minimize the unproductive movements.Foti et al. [3] present a basic model of the train load planning problem which is then extended in order to be more realistic and to better represent the re-handling operations in the storage area.The results were obtained by boolean optimization.Large problems can be generated even with a low number of containers and wagons.The model gives small formulas to counter this difficulty.
Another stream of research was about allocation in the network.Zhao et al. [4] propose a mathematical model for the empty cars allocation problem in railway networks with dynamic demands to minimize the total cost incurred by transferring and storing empty cars in different stages of the demand.They then propose a genetic algorithm to generate approximate optimal solutions.Mutyavavire and Battle [5] establish a linear mathematical model as a decision support system to the empty wagon re-distribution management problem.They focus mainly on network capacity and resources constraints in their formulation.Lam et al. [6] propose an approximate dynamic approach for determining optimal strategies to relocate empty containers in the containerized sea-cargo.They use a simulation based approach known as the temporal difference learning for average cost minimization to determinate approximate optimal solutions to the stochastic model (two-ports two-voyages).Azanov et al. [7] use graph theory to formulate a model to minimize the number of locomotives used for the transportation of the trains by choosing routes of the trains and locomotives.Mathematical definitions of a railway haul, a train path, a train route, and a locomotive route are suggested to do so.An heuristic search algorithm is then proposed to find an approximate solution of the problem by maximizing the usage of locomo- tives that started earlier compared to others.Newman and Yano [8] address the problem of determining day-of-week schedules for both direct and indirect trains and containers routing decisions in a rail intermodal setting.The integer program proposed seek to minimize operating, handling and yard storage costs while meeting on-time delivery requirements.They also develop a decomposition procedure that yields near-optimal solutions and a method for providing tight bounds of the objective function.The article [9] can be classified in the last category.Jonaitis [9] highlights the importance of planning process of rail transportation.These problems are strategic, tactical and operational.They also can have different targets weather they concern the timetable, the rolling stock and the crew.He focuses on planning the structure and volume of the rolling stock.He proposes two approaches to determine the demand for trains, the first seeks to find quantitative parameters of rolling stock and the second relies on them.The determination of optimal service life of the trains, is important too, considering elements such as repair costs, number of overhauls, current expenses and operational characteristics.
This article deals with the problems of trains loading and allocating railcars to a destination taking into account the constitution of the trains.These problems are treated separately in all the reviewed articles.The models proposed aim to jointly minimize resources and maximize loading on the trains by considering several relevant train constitution and transport constraints.An algorithm suggested provides an optimal solution for the train load problem.

Problem definition and formulation
The model proposed to optimize containers rail transport focuses mainly on the train load problem and combines it to take into account the constraints of the axis assignment.This work is based on the reality of the Moroccan rail network and Moroccan containers trains, but a generic model that can be applied to any other network is proposed.
We need first to specify all loading patterns in advance.Our decision variable will then be the number of wagons of each loading pattern.In the Moroccan railways, customer demand is formulated with the number of containers 40 foot (l=2) and 20 foot (l=1) to transport and the tonnage of each container.We have two types of wagons 19.9m (k=1) and 14m (k=2).The weight constraints in this case will always be respected and can therefore be omitted from the model except for the arrangement d= 1 where we can place 3 containers 20 foot given lengths constraints.However, if the three containers are very full, their weights can exceed the maximum weight of the wagon.In this case the wagon 19.9 m will only support 2 containers 20 foot in this disposition.We solve therefore the problem with only four loading patterns since the first one will become similar to the third with a longer wagon.It is interesting to choose in this case this less long loading pattern for the economy of length.Other important assumptions to describe the model can be enumerated.Axis assignment constraints such as the wagons offer, the length of the train to be sent and the maximum capacity offered by the locomotive are considered.The assignment per axis is unique since it considers not only the quantity to be sent in number of wagons, but also the quantity of each loading pattern to be sent, hence the quantity of each type of wagons to send in such a way that customer demand is placed on the trains according to the loading patterns obtained.Figure 1 represents all the five possible configurations of which 4 maximize the loading on trains.

Parameters
The following parameters are used to define the problem throughout the paper: • n dl : Number of containers type l loaded in the disposition d.
• q l : Number of containers of type l in the order.
• T max k : Maximum weight a wagon of type k can support.• e k : The non useful extremities of a wagon of type k (length that remains unused from the flat railcar after having loaded containers).
• O k : Available offer of saint wagons type k.
• T ar k : Tare or empty weight of a wagon of type k. • L k : Length of wagons type k.
• L a,t : Maximum length of the train allowed on the axis a.
• T max i jm : Maximum weight that a locomotive m can tow on the line section (i, j).
• T max am : Maximum weight that a locomotive m can tow on the axis a where T max am =Min(T max i jm ).• T a : Total tonnage of the order transported to a.We have: • N: Total number of possible arrangements of all types of containers and wagons.
• L: Number of type of containers used in the problem.
• K: Number of the type of wagons.
• l m : Length of the locomotive of series m.
• S (d): Number of containers locations in the disposition or number of slots in the disposition.
• L(d): Number of types of containers in the disposition.

Variables
In the the next models, the variables considered are: The number of wagons of loading pattern d, to transport for the order of the site.
• y k : The number of wagons type k to be transported for the site is as the following: x d For model 2, we will need an additional binary variable to ensure compliance with maximum weight of wagons.
• z clds : is equal to 1 if the container c type l is assigned to the location s in the loading pattern d, and 0 otherwise.
x d and z clds represent the decisions variables.It is interesting to use x dk instead of x d in the models since this formulation is easily adaptable to others load configurations and industries.
• x dk : The optimal number of wagon type k and loading pattern d.In this case: x dk

First mathematical model for train load and transport problem
This first model tests the weight constraint of the first disposition since the others are always verified.We set 3 loops to go through the indices of the three containers placed on the first disposition.The containers must naturally not have the same index.We ensure to have that by a condition.Whenever the total weight of the 3 containers do not exceed the maximum weight that the disposition 1 can support, the submodel 1 is executed.If the weight constraints of the first load configuration are not verified, the model eliminates disposition 1 since it becomes equivalent to 3 and the problem is solved for the four remaining patterns (submodel 2).We can also retain the indices of the containers to be placed together for this disposition after testing weight constraints.
The submodel 1 can be formulated as follows: The submodel 2 that considers only four dispositions if weights constraints are not verified for the first disposition is: The objective function (1a) minimizes the total number of wagons used of each loading pattern.The constraints (1b) aim to maximize loading of containers of the customers demand on the train.Constraints (1c) represent the offer constraint.Constraints (1d) guarantee the respect of the train length during the formation.The maximum length permitted depends on the axis (specificities of the design of the network).Constraints (1e) ensure that the tonnage of the train do not exceed the maximum tonnage that the locomotive can support on each axis for full containers.This tonnage varies from one locomotive to another and from one section of the line to the other.Constraints (1f) are dedicated to the case of empty containers transport.So, we will have (1e) or (1f) depending on the case.Constraints (1g) specify the nature of the variables.The objective function (2a) and constraints (2c) to (2h) are similar to the above objective function and constraints but are applied for the second condition.The additional constraint (2b) fixes now the number of loading patterns for wagon k=1 to 1 instead of 2 since one loading pattern that uses this type of wagon is eliminated.
This model generates few numbers of variables but a large number of constraints because of the conditions we test.The second model we present is therefore better.
The first model which executes the appropriate mathematical submodel depending on the case considered is structured as represented in the algorithm 1.

Second mathematical model for train load and transport problem
This second model tests weight constraints of the first disposition thanks to the binary variable.It also provides us with the indices c type l=1 of the containers to place on each slot of the disposition 1.We do not need the loops Execute submodel 2 and the conditions anymore.So we add to constraints (1b) to (1f), the following constraints: S x d , y k ∈ N, z c11s binary (3g) Constraint (3a) tests the weight of containers to place them on the slots of the disposition 1. Constraint (3b) ensures that the total number of containers assigned to each slot in the disposition is equal to the number of wagons of the loading pattern multiplied by the total number of containers in this loading pattern.Constraints (3c) illustrate that for the same slot and disposition, the number of different containers is at most equal to the number of wagons of the disposition.Constraints (3d) guarantee that one container can be placed only in one slot in a load configuration.Constraints (3e) and (3f) are specific to the formulation of the model and are used to avoid contradictions.Finally (3g) specify the nature of the variables.This model can be easily generalized to test weight constrains of all load configurations.It generates an acceptable number of variables and constraints.They are here more reduced because we test only one loading pattern.

An algorithm for the train load problem
The following algorithm provides an optimal solution for the train load problem considering both weight and length constraints of containers and wagons.We need to start first such as the previous models by determining all possible load configurations considering only length constraints.
At this step, we know exactly how many containers and from which type to be placed on each type of wagon to maximize loading on the train.We have then to define an order of the dispositions that the algorithm must follow.We order the load configurations from the most optimal one to the least.In our case study for example, to maximize loading on the trains, d =1 is better than d =3, since in the first disposition there is 3 containers for one wagon and in the third disposition only 2 in the wagon.Similarly d =3 is better than d =5, since for the same type of wagon, it contains one container more.Moreover, if we have 2 containers of different types, the second disposition is better than the fourth or the fifth.If there is no particular order for the rest, we just place the remaining dispositions in an arbitrary way.Here the order is d =2, d =1, d =4, d =3 and finally d =5.Consider sigma the permutation of the elements of the set of dispositions {1, 2, 3, 4, 5} so as to have the predefined order.Let us denote O(d) this predefined order and here this set is O(d) = {2, 1, 4, 3, 5} where sigma(1)=2, sigma(2)=1, sigma(3)=4,sigma(4)=3 and sigma(5)=5.
The algorithm then tests the weight constraints for each disposition from the first in the defined order to the last.If the weight configuration is not verified, it passes to the next disposition.If this condition is verified, it increments the number of wagon of this disposition, change Var l to one to specify that the containers on that wagon have been assigned and finally it stores the indices of containers to be placed together in this loading pattern and that are already assigned in indice d .T l (i ls ) represents the tonnage of container i ls type l. i ls is the index of the container in a location s.In this section we use L(d) presented previously which is the number of types of containers in the disposition.For instance, L(d) =2 for disposition 2 since it carries 2 types of containers 20 foot and 40 foot and L(d)=1 for all the remaining dispositions.
This algorithm can easily include train constitution and transport constraints.

Experiment results
In this section, we first present results of the two mathematical models and the algorithm for the Moroccan railways.A second subsection deals with the comparison between the train planning base model (TPM) and the part of our model that consider only length constrains since it is the case of TPM.

Comparison with manual planning
We have tested our models and algorithm in the case of Moroccan railways.We compared the operator's manual planning with our results.The table below presents the data of the day 24 May 2014.In the database, we have only the total tonnage of the containers of the same category so we considered that they all have the same weight.However, the models solve even containers of different tonnage.The table 1 shows that our models and algorithm provide an optimal number of wagons to send to the customer compared to manual planning.There is a difference Algorithm 2: Solving the train load problem 1 Set the tables T l (q l ) , Var l (q l ) with l={1,.12 if (T l (i ls ) > 0 and Var l (i ls ) = 0 and (i ls i l s or i ls i ls ) or i ls i l s ) then 13 (this condition tests all i ls in the nested loops and defined above) in the dispositions obtained by the models and the algorithm due to the fact that the two mathematical models consider the train's length constraints.The dispositions obtained by them are therefore shorter than the algorithm which solves only the load problem.With the first order of the table, our models propose to send 14 wagons with a total length 266.8 m while the algorithm propose the same number for a length of 272.7 m.In the

Comparison with train planning model
The objective of the train planning model (TPM) is to decide where each particular container should be loaded on a given train while minimizing the weighted sum of the number of wagons used in the train loading plan.It considers lengths of containers, slots and wagons by using a binary decision variable U cwds which is equal to 1 if container c is assigned to slot s in pattern d of wagon w.Each slot can carry a container of the same length.The mixed integer linear programing model (MILP) of train planning, TPM, generates a large number of variables which makes most authors try to simplify and extend it.For example, TPM generates 40000 binary variables for 50 containers, 40 wagons, an average of 10 patterns each and 2 slots per wagon [1].
In the comparison below, we consider the part in our models that take into account only length constrains of wagons and containers.Let us also choose another example apart the one of the Moroccan industry to show the adaptability of the proposed models to other industries.Consider we have one type of wagon of length 19.9 meters and 3 types of containers, 20 foot, 30 foot and 40 foot.We first need to define all possible loading patterns.We obtain dispositions that can carry two containers.Another specific hypothesis to this example is to limit the number of slots to 2, so we consider that the containers transported are filled to their maximum capacity.In this case the first disposition can only carry two containers 20 foot. Figure 2 presents all the permitted configurations considering length constraints.In this specific example, weight constrains are respected which justifies also not including them.n dl x d = q l , l ∈ L (4b) The model for this example is as follows: x 2 + 2x 4 = q 2 (5c) Table 5 illustrates the difference between the two models in terms of number of constraints and variables.The proposed model formulated as an integer linear programing model (ILP) reduces them considerably compared to the basic model existing in the literature which makes it easily extendable to take more elements into account.In the previous section for instance, we integrated weight constraints for a more realistic load problem but also train constitution and transport constraints for a combined resolution.Computational times for the instances considered are not reported since there are very low for both the models and the algorithm (around one second).

Conclusion
The paper deals with the train load and transport planning problem.The objective is to minimize the number of wagons and to maximize loading on trains while satisfying train constitution and transport constraints.We have proposed two mathematical models different in formulation that can be used to solve the combined problem.An algorithm that provides optimal results is also proposed for the train load problem.The models and the algorithm have been tested on real data of railway industry.The part of our model that considers only length constraints has been compared to the base train planning model that takes into account only these elements.Our proposed model simplifies the formulation and therefore reduces considerably the number of constraints and variables.The two models can be extended specially the part of transport per axis to treat multiples destinations in each axis and multiples axes.We also can consider strategic planning over multiple periods.

Figure 1 :
Figure 1: All possible loading patterns in Moroccan railways

4 d=sigma( j), 5 (
. .,L(d)} and T l > 0, indice d (x d ,S (d)) for d={1,. . .,N} 2 Initialize Var l =0 l={1,. . .,L}, indice d =0 d={1,. . .,N} 3 for j = 1 to N do Enter to the d in the order defined) 6 l, l ={1,. . .,L(d)}, s, s ={1,. . .,n dl }, 7 for l = 1 to L(D) do 8 for s = 1 to n dl do 9 i ls 10 for i ls = 1 to q l do 11 (This instruction is structured as nested loops for i ls obtained above, It is applied the number of time the locations are in the disposition, S(d) times) d +1 16 for l = 1 to L(d) do 17 for s = 1 to n dl do 18 Var l (i ls ) =1 19 for s" = 1 to S (d) do 20 indice d (x d , s") =i ls 21 -Eliminate the location s" and the container assigned i ls so that 22 to have (indice d (x d , s") indice d (x d , s" )) 23 for s" ={1,. . .,S(d)} -Assign the next container i ls to the next location by reentering this loop

Figure 2 :
Figure 2: All possible loading patterns of the example

table 1
d refers to the optimal solution with the models and x * * d to the optimal solution with the algorithm.Table2illustrates the results for the whole month where 262 could be saved for more orders.This month was chosen because it represents the highest season. *

Table 2 :
Results of the case study for May 2014They are several indicators that can be used to demonstrate the efficiency of our models and to evaluate the performance of rail transport.Some of them are presented in table3and calculated in table 4 to measure improvement.

Table 3 :
Definition of indicators

Table 4 :
The improvement of indicators in the case study

Table 1 :
Comparison between models, algorithm and manual planning the 24 May 2014

Table 5 :
Comparison between the proposed model and the TPM