Solution of the Problem of Empty Car Distribution between Stations and Planning of Way-Freight Train Route Using Genetic Algorithms

In this paper we consider the problem of distributing empty freight cars in a railway polygon. We show how the process can be improved using an optimization model. The optimization model can be characterized as a combination of minimum-cost flow problem with vehicle routing problem. In general, problem of empty railroad car distribution between stations and definition of way-freight train route is presented as integer combinatorial optimization problem. Computational tests show that the model can be solved in acceptable time for real size problems, and indicate that the model generates distribution plans that can improve the quality of the planning process.


Introduction
Railway transport is one of the main sectors of the national economy, playing a crucial role in the implementation of foreign and domestic economic relations. The standard of living, the integrity and interchange between the regions of the country, resources, productivity and competitiveness depends on the efficiency and stability of its functioning. Therefore, it shall ensure traffic regularity, high speed of transportation, high throughput and shipping capacity. New economic conditions facilitated emergence of multiple enterprises, which provide services for the transportation of different categories of goods. In order to gain competitive advantage, railway transport needs to improve the quality of customer service by means of providing an expanded range of services. One of the key issues for the transportation system is prompt provision of cars of the required type of all shippers in accordance with the bids. Settlement of such issue is complicated by the acute shortage of cars and their unsatisfactory status. In order to purchase a new rolling stock, a significant investment is required, so there occurs a task of rational use of the vehicles in operation. The rationalization option is development of new and improved existing approaches in carriage organization, based on the optimal use of the rolling stock. The most promising way to implement such approaches is to provide organization of the transportation process based on improvement of the operational planning technology in the rolling stock distribution at the polygons of Ukrainian railway.

Literature Review
Relevance of the problem of the distribution of empty cars is also evidenced by the fact that the number of scientific publications on this topic in recent years has not diminished. Article [1] proposes a mathematical model for the distribution of empty freight cars in a railway transport node, with regards to requirements of car owners for their use, operational level of loading at railway stations of the node and the possibility of including empty car groups into transferring, leaving trains and trains rotating by contact schedule. Article [2] is devoted to general task of the distribution of empty units of rolling stock and to classification of approaches to its solution, with regards to task features. In particular, it touches approaches to settle operational tasks aimed at distribution of large-scale empty cars, e.g. at the Federal Railway of Switzerland, whose daily distribution makes up 12,000 empty cars of 70 types. Article [3] also proposes a mathematical model for the distribution of empty cars with regards to technical parameters of the railway network, such as the throughput of railway stations and plots, as well as the business interests of rolling stock owners. Article [4] proposes a mathematical model with regards to requirements of clients as well as priority of order performance in accordance with their urgency. Article [5] proposes to use genetic algorithms in order to settle such optimization task. Article [6] proposes a method for task settlement by means of knowledge base. Article [7] also proposes to optimize the model of using the metaheuristic method of task settlement, known as the method of ant colonies. Article [8] proposed a method of distribution of empty cars based on optimization of a stochastic model. Article [9] proposes a graph mathematical model and a method for its optimization based on tabu-search aimed at task settlement. Article [10] proposes task settlement based on multi-commodity flow model under the criteria of minimum operating costs. The general flaws in settlement of tasks aimed at distribution of empty cars presented in the scientific literature can be attributed to the fact that the tasks of distribution of cars and the task of planning their traffic within the network are usually solved separately.

Problem Statement
The problem of the distribution of empty cars and the problem of determining the route of a way-freight train is expedient to be solved as part of one complex problem. In this formulation, the given problem can also be considered as a combination of two problems: the minimum-cost flow problem [11] and vehicle routing problem [12,13,14]. However, the solution of these two problems together and simultaneously in the composition of one common task will allow finding the solution closest to the optimal one and should improve the quality of operational planning in the railway transport. Thus, the solution of the complex problem of the distribution of empty cars and the determination of the train route can significantly complicate the decision process, but at the same time it can improve the quality of the solution. the way-freight train is designed for collection of cars from intermediate stations and freight stations and their delivery. The wayfreight train is formed at the sorting and precinct stations for adjacent areas of local work. The cars are selected by groups for each station of the detachment and placed in a way-freight train in sequence in accordance with the location of the stations on the site.. At passing station, the composition of the way-freight train is reduced by uncoupling-unloading and delivery of empty cars and increases due to the hook-loading and cleaning of empty cars. One of the crucial factors determining the task complexity is the possibility to have a significant number of alternatives in case when the aggregate demand for stations on empty cars, with regards to types of cars represented by the set D, can be satisfied as a result of the implementing one of a numerous possible variants of distributing empty cars. This situation occurs when there is an excess of empty cars and a set D can be represented as a subset-set S, as the aggregate supply of empty cars at the stations of the polygon. However, even in case when the set S can be represented as a subset D, i.e. when the aggregate demand for cars exceeds their offer, it is always necessary to make a decision and to determine which orders should be met first of all and which ones should be postponed. Even in the case of the identity of the sets S and D, i.e. when the qualitative and quantitative composition of empty cars available at the stations of the polygon fully matches with the qualitative and quantitative composition of cars, which require from station of the polygon to carry out a daily load plan, necessity in search for an optimal variant from the set of possible variants of the distribution of empty cars does not disappear. In this case, the choice is facilitated by presence of numerous stations having free empty cars of the same type, as well as by presence of numerous stations, which require for a single type of car. A more general and more likely case occurs when set S and set D are overlapping. In such case, it is necessary to decide simultaneously which orders shall be met first of all, and at the expense of which resources. As a criterion of search for an optimal variant of the plan for empty car delivery, it is advisable to choose a minimum operating cost criterion for this plan implementation. Therefore, operating costs should include such indicators as train-kilometers and train-hours, i.e. the values corresponding to the chosen route of the combined train. In addition, number of shunting operations, as well as total duration of such operations, material costs, empty car idle stay, their prompt delivery to the freight fronts depends on the selected variant of distributing empty cars. Therefore, the task of delivering empty cars at the polygon, represented by an extensive network structure, is to determine which cars will be shifted at which stations and to select the rational route of the combined train. However, these two tasks have a direct impact on each other and are closely interconnected. That is, the issue "which cars will be shifted at which stations" depends on the train route, while the route of the train depends on the chosen variant of distributing empty cars. These tasks should be solved simultaneously in the framework of a single optimization model. Objective function of the model can be represented as follows: where x is a variable vector that determines the train route and contains a sequence of stations where there is a need for traction and/or detachment of empty cars; y is a variable matrix containing information on which cars representing the set S will be moved to meet the certain needs of empty cars represented by the set D, while the matrix elements yij are equal to 1 if the group of cars i is used to meet the order j and 0 otherwise; et•km is a unit cost per train-kilometer, $/km; et•h is a unit cost per train-hour en route, $/hour; el•h is a unit cost per locomotive-hour of shunting works, $/hour; ts is duration of shunting operations on traction and/or detachment of cars; d is a matrix of distances between stations of a polygon; nD is the cardinality of set D, representing the need for stations in empty cars; nS is the cardinality of set S, representing the excessive empty cars at the stations of the polygon; v is a route speed of the way-freight train; sgn(x) is a sign function;  is a penalty ratio for unsatisfied demand in empty cars,  is a penalty ratio for undistributed groups of empty cars. The first and second added terms correspond to the operating costs, which depend on the length of the route and the duration of the train trip, the third added term represents the costs due to the amount of shunting work upon the traction, detachment and trailing of groups of cars, the fourth and the fifth added terms are a penalty functions minimizing the number of non-fulfilled orders for demand and supply of empty cars. Penalty function is a kind of soft restriction, violation of which is undesirable, but possible [15]. For optimization problems with conventional smooth inequality constraints, the penalty function method is, in general, recognized as an efficient method [16]. While optimizing the model, technological constraints must take into account. First of all, it is necessary to prevent exceeding the maximum length of the combined train at any stage of the route performance, while planning: where k is number of route stations; ni the number of cars in the train at the time of departure from station i; nmax is the maximum allowed number of cars in the train. In order to avoid zero values while optimizing the target function and maximizing the export of empty cars, the following limitation should also be taken into account: This restriction is necessary to prevent full removal of empty cars from their dislocation stations in case when the aggregate demand for empty cars exceeds their total availability; while in case when the aggregate demand for empty cars is less than their total availability such restriction should secure full satisfaction of all orders. Only the basic restrictions are listed here. The constraint system can be extended in accordance with the specific conditions of the problem. As a mechanism for optimizing the created model, it is expedient to apply a mathematical apparatus of genetic algorithms related to metaheuristic search methods. The practice of its application allows us to assert that it provides the opportunity to solve properly the tasks of combinatorial and discrete optimization, simultaneously with regards to logical and technological constraints, including qualitative ones. In particular, it is used successfully for route search tasks [5]. One of the positive aspects of the application of  genetic algorithms is that they allow handling restrictions of almost any type and allowing it to be done simultaneously.
In order for the application of the mathematical apparatus of genetic algorithms to become possible, it is necessary to solve the optimization problem of the distribution of empty cars as a special vector called the chromosome. The elements of which this vector (chromosome) consists are called genes. The positions of genes, that is, their positions within the chromosome are called loci. The mechanisms of functioning of genetic algorithms are inspired by the mechanisms that are present in living nature, such as, for example, generation of populations, selection, crossing, mutation. Thus genetic algorithm is an optimization algorithm that simulates the process of biological evolution [17]. Although genetic algorithms are one of the best optimization mechanisms for optimizing tasks related to topology and graphs [18,19], there are specific problems associated with their application for this type of problem. The solution of the problem of the distribution of empty cars must contain variables of two types. First type variables are needed to present a plan for which groups of cars, that are located at the same stations, will be used to satisfy requests for empty cars, which are available at other stations. Second type variables are needed to represent the route of the way-freight train, which collect and transport cars through the stations. Both these sets of variables must be represented by genes within the chromosome. The number of variables of the first type can be known in advance and can be unchanged during the solution of the problem. The number of variables of the first type is determined by the number of requests for empty cars. The second type of variables must be used to describe the train route. However, the difficulty lies in the fact that if each gene represents the station number of the test site, then the train route options may differ not only in the order of the stations but also in the composition of the stations. And this means that the length of the route expressed through the station numbers can be different. The length of the route can be changed also because the train can visit the same station more than once. This means that the vector (chromosome) representing the solution of the problem can have different lengths. Representation of the solution of the problem in this form makes it impossible to use genetic algorithms of common types. Barring a few notable exceptions, most current genetic algorithms (GAs) use decidedly neat codings and operators [20]. Whether the domain is search, optimization, or machine learning, fixed-length, fixed-locus strings processed by one-or two-cut recombination operators are the rule [20]. Although these words were said back in 1989, they are still valid today. A possible way out of the situation is the use of special types of genetic algorithms. There are many types of genetic algorithms, but the most suitable type is a genetic algorithm with variable length. To solve our complex problem, the left side of the chromosome must be of fixed length. But since the number of requests for the supply and demand of empty cars may differ, the number of genes must be equal to the larger of these two numbers. Figure 1 shows an example of interpretation of a part of chromosome, which represents an empty car distribution plan in case of excess supply of cars over demand.

Computational Results
Optimization of the proposed model was performed in Matlab environment (Matlab R2017A 64-bit, The MathWorks Inc., Natick, MA, USA). Figure 2 shows the convergence dynamics of the fitness (penalty) function during the execution time of the genetic algorithm.   Simulation was performed using a computer with an Intel Core-i5 processor. Solution took about 2 minutes. The polygon numbered several dozen stations. At the polygon, only sorting, midway or freight stations are represented. The way-freight train passed through 19 stations. Figure 1 demonstrates a clear convergence of the algorithm, which is an indirect evidence of the fundamental convergence of the fitness function and the correct description of the mathematical model on which it was based.

Conclusions
It is reasonable to settle the task to distribute empty cars jointly with definition of the route of the combined train. In such context, the task of transporting empty cars at the polygon having an extensive network structure is the task of discrete combinatorial optimization. The use of mathematical apparatus of genetic algorithms as an optimization mechanism facilitates successful settlement of such class tasks and finding a solution being close to the optimal one for the accepted period.