Genetic Algorithms Implement in Railway Management Information System

The railway system is a complex system and accordingly, the processes of railway operations are very complicated. The essence of railway operations is to meet the demand assigned to railways through the optimization of usage of the railway transportation specific resources. So problem-solving oriented optimization algorithms or techniques form the basis, especially in the era when information technologies prevail, of modern railway operation, in which the most typical cases are, not limited to, as follows.  Railway management information systems design  Transportation resources allocation  Traffic control through dynamical transportation resources re-allocation


Introduction
The railway system is a complex system and accordingly, the processes of railway operations are very complicated. The essence of railway operations is to meet the demand assigned to railways through the optimization of usage of the railway transportation specific resources. So problem-solving oriented optimization algorithms or techniques form the basis, especially in the era when information technologies prevail, of modern railway operation, in which the most typical cases are, not limited to, as follows.


Railway management information systems design  Transportation resources allocation  Traffic control through dynamical transportation resources re-allocation These problems feature large scale, combinatorial complexity and nonlinearity etc and need optimization algorithms with searching efficiency, scale insensitivity, embedded heuristics and certainty of solution-finding. Genetic Algorithms (GA) have been proved suitable for the above mentioned railway application oriented problems solving.
The chapter consists of two parts. The first part will cover some recent development of and improvement to the generic GA. And the second part will outline several typical applications of GAs to solving optimization problems arising from railway management information system design, transportation resources allocation and traffic control for railway operation.
objective problem. We will introduce this improvement to the GA from our research group. We mainly introduce a variation of GA: The new kind of fast global convergent multiobjective genetic algorithm (Meng 2005).
The key step of genetic algorithm is to select the best chromosomes of each generation to generate the next generation, and the sorting methods of chromosomes are the most important, which determines the selecting results. So we focus on the sorting methods for selection and propose a new kind of sorting method---Improved Non-dominated Sorting method, constructing the basis of the fast global convergent multi-objective genetic algorithm.

Improved non-dominated sorting method
First, we calculate the number of dominating individuals for individual i ---1 n ; then, we propose the sets of dominated individuals by individual i---1 S . The steps are as follows.
Step 1. To find the individuals which satisfy the equation 1 0 n  and store them into 1 F .
Step 2. To propose i S . For every individual j in i S , there are j n -1 dominating individuals.
If j n -1=0, then store individual j into another set H .
Step 3. Set 1 F to be the first dominating individuals set. Continue these steps to deal with H till each individual is graded.
The time complexity of the algorithm is   2 Om N . m is the number of the objects and N is the population size of the chromosomes. P is the population, F is the non-dominating individuals set (It is the non-inferior solutions set). The algorithm is as follows.

Dynamic virtual adaptability strategy
The selection probability of the individual is usually based on the adaptability according to a direct ratio. As a result, the value of the virtual adaptability can affect the selection probability of the individuals. If the difference between the adaptabilities of different groups is obvious, the group which has the bigger adaptability is selected and the individuals in the group will get the dominating positions, which is an obstacle to maintain the diversity of the individuals. We propose a dynamic virtual adaptability strategy to avoid the effect.
As discussed above, the virtual adaptability functions 1 f of individual i is as follows, with its grade Level .
In the function definition, Maxgen is the maximal iteration times, gen is the current generation. Level is the grade of the individual i. A and B are the two adjustable parameters, which can be used to adjust the change speed of the difference between different grades according to the grades and the algebra. Take it for granted that the individuals can be divided into 50 grades and the changing graph can be attained according to equation (1), as shown in Figure 1. The smaller the generation is, the smaller the differences between the adaptabilities of different groups are. The difference becomes bigger and bigger when the iteration continues. And the higher the grade of the individual belongs to, the bigger adaptability the individual will get. Then, the probability of being selected is bigger which is propitious to make the process of searching the optimal solution convergent.

Maintenance of the diversity of individuals
The local convergence can often be found when solving the multi-objective problem, so something must be done to maintain the diversity of the individuals. To share the adaptability is a method. The basic idea is to take the adaptability as the public resources and to adjust the adaptability according to the number of the similar individuals and the similarity of an individual. This can lead to two results. One is to form a niche among the similar individuals. The other is to control the number of the individuals generated by the similar individuals which can help to maintain the diversity the individuals. The shared function  Sh  is introduced to measure the similarity between the individuals, which is defined as follows, shown in equation (2).
is the radii of the niche which can be estimated according to the expected minimal dividing degree of the individuals. ij d is the distance between i and j .

Fig. 1. Differences between virtual values of different grades
When the adaptability sharing function is defined, the adaptability of the individual iP  is the quotient of the adaptability before sharing operation and the number of niche --i m . i According the different definitions of ij d , the sharing methods can be divided into two kinds: the share in the objectives and the share in the solutions space. Here we introduce the first kind of method. j d is defined as equation (5).

Elitist strategy
To hire the elitist strategy can greatly improve the convergence of the Pareto solution set.
There are many kinds of methods for selection of elitists. Usually it can be selected from the non-inferior solutions set in which the solutions have been sorted. The number of the individuals to be selected is decided according to the problem condition. The methods to realize the elitist strategy are as follows. One is to add the elitist individuals into the current www.intechopen.com generation and delete some of the individuals which are worst. The other is to add the elitist individuals into an external set P , and select some of the individuals from P and replace some of the individuals of each generation. Then some of the elitist individuals of the current generation are selected to be added into P . And some methods are designed to control the number of the elements in P and the number of the similar individuals in P .
We design a new method here. Each individual in the first grade after grading is added into the elitists pool (the external set P ). And the new generation ' P is generated after selection, crossover, and mutation. Each individual (the number is suspended to be K ) in elitists pool is added into ' P directly. And to maintain the population size , NN K  non-elitist individuals are deleted randomly.

Algorithm flow
The steps of the algorithm are as follows.
Step 1. The initial population   0 P is generated through fake random method.
Step 2. To grade the individuals.
Step 3. To refresh the individuals in elitists pool. To store the individuals of the first grade in the elitists pool.
Step 4. To calculate the virtual adaptability according to equation (1).
Step 5. To apply the share strategy in objectives functions space according to equation (2) ~ equation (5).
Step 6. Selection: To select the individuals according to the adaptability ratio method (roulette).
Step 9. To generate the new generation ' P .
Step 10. To apply the elitist strategy and add the individuals in elitists pool into the new generation ' P and delete the non-elitist individuals in ' P randomly.
Step 11. To adjust the size of the new generation. Set the size to be N . The new generation is P .
Step 12. To check if the ceasing condition is satisfied. If no, go to step 2; else, cease.
The flow chart is shown in Figure 2.

Railway management information systems design
The most important work in railway management information system design is to design the physical structure. The essence of physical structure optimization is to allocate the physical resources of railway in order to realize logical structure, minimizing the costs and time.
The optimization objectives include customer satisfactory degree, response time, costs and so on. The constraints are reliability, safety and etc. So we can see the physical structure optimization problem features objective variety, combinatorial complexity and objective index nonlinearity etc.
www.intechopen.com A typical application of GA in railway management information system design is the physical structure optimization of emergency succoring system. The key points of implementing GA in the physical structure optimization of emergency succoring system are as follows.
(1) To describe the allocation plan of the physical equipments, the chromosome will be designed to be formed with two integers. The first integer denotes the allocation pattern of each function unit in the sub-systems while another describes the allocation pattern on the equipments of logical procedure.
(2) The objectives, the computing ability and operation cost can both be described with the chromosomes codes, forming the adaptive function formulas.
(3)The optimizing process is to find the optimal adaptive function value through all the iterations, with the chromosomes being selected, crossed over and mutated, deciding the optimal chromosome and the generation it belongs to.
A typical application of GA in railway management information system design is the physical structure optimization of emergency succoring system. Here we give the detailed implementing process of GA in physical structure optimization of emergency succoring system through a computing case study (Meng 2005).

The description of the physical structure optimization of emergency succoring system problem
The system is divided into 5 physical sub-systems, which are marked with   The Data Flow Diagram (DFD) of emergency succoring system is shown in Figure 3. The logic processes of the emergency succoring system can be abstracted into 18 function units.

The computing case
(1) Coding approach To distribute the meta-services on the physical sub-systems and optimize the allocation of the processes on the equipments, the genetic codes are designed to be planar. The chromosome consists of two integers shown in Figure 4. The first denotes the distributing modes of the function units on the system. For example, S denotes the number of the subsystem that the function unit i F belongs to and n is the total number of the function units. The second describes the allocating modes of the logic processes on the system equipments. For instance,   The constraints are as follows. (1) The number of the equipments constraint. In this case the number is set to be 5. (2) Some of the nodes must be allocated in some certain sub-systems. Thus the optimization process is to allocate other nodes in the sub-systems. The constraints are shown in Table 4. The computing results of the example of optimize the physical structure of the emergency succoring system are as follows.
www.intechopen.com (a) The results of the first calculation The parameters are as follows. The size of the population Popsize =300 and the maximal iteration number is 100. The intersecting probability is 0.9 and the mutation probability is 0.02. The computing results are shown in Figure 5. The parameters are as follows. The size of the population 500 Popsize  and the maximal iteration number _ Max gen is 100. The intersecting probability is 0.9 and the mutation probability is 0.02. The computing results are shown in Figure 6. '+' denotes the optimal individual chromosome after 20 iterations. '.' denotes the optimal individual chromosome after 30 iterations and '' for 40, '*' for 100. The number of the noninferior solution is 53. The typical solution is shown in Table 5. We can see from Table 5 that the distributions of the function units on the system according to different solutions are similar. For example, according to most of the plans, 3 equipments are allocated in sub-system 1, to receive the succoring application, retrieve information from the database and issue the accidents causations and etc. And 3 equipments are allocated in sub-system 2 to search for the succoring information, collect information of accidents scenes and plan for succoring. In addition, the plans for sub-system 3 and for sub-system 4 are the same. An equipment is allocated in the two sub-systems respectively to realize the functions www.intechopen.com of inspection of trains to ground equipments and inspection of ground equipments to trains. 3 equipments are allocated in sub-system 5 to dispatch the resources, equipments, maintaining services and succoring cars.
To sum up, the solutions are reasonable and the decision makers can choose one of the solutions. A typical solution is shown in Figure 7.

Train stops setting optimization
Train stops setting optimization problem is a typical problem of transportation resources allocation. In this case, the railway resources are the trains, which are the most important resources of railway. The coefficient of utilization of this kind of resource determines the service quality of the passenger transportation. So train stops setting is a key problem in railway resources allocation study. In this section, we will introduce GA application in train stops setting problem.
(1) Line planning Line plan is the allocation of trains respected to passenger transportation demand, which determines the grade, type, original stations and destination stations, number, paths, stops of passenger trains. It is also the basis of the train timetable, which is the most important arrangement of resources for railway transportation organization.

www.intechopen.com
General line planning is an extremely complex and difficult problem; even its sub-problems considered separately are already NP-hard from a computational complexity point of view. Its process is based on the following input: a public demand, the available railway line, a set of trains. The goal is to obtain a set of lines and associated timetables to which trains are assigned.
A typical sub-problem of line planning is to generate the stops plan of trains. A most valuable advantage of GA in line planning is that the codes in chromosome can exactly describe whether the trains will stop at all the stations, 0 standing for non-stop and 1 for stop. And the stop operation will cause costs, while it meets the passenger transportation demand. The costs and the benefits caused by meeting the passenger transportation demand can both be formulated by the chromosomes codes, generating the adaptive function formulas. Thus, the optimizing process is to find minimal costs adaptive function value and maximal benefits adaptive function value through the iterations.

Designing the stops of the trains
The problem to select the stops of a train is very hard. It can be described as a planning problem, with 0 standing for the train does not stop at a station and 1 denoting the train stops at a station. The searching space is very large and the decision variables are in great volume. So the heuristic algorithm has the superiority to solve this problem. Genetic algorithm is hired (Zha, Liu and Li 2008) and Simulate Anneal Arithmetic algorithm is used to solve the problem (Wang, Peng and Xie 2006). Tabu Searching algorithm is hired (Deng, Shi and Zhou 2009).
The steps of the algorithm are follows.
Step 1. To design the code of the problem; Step 2. To initialize the population     Step 4. To create the middle generation   r Xt; Step 5. To create the new generation   1 Xt based on the middle generation   1 r Xt  ; Step 6. 1 tt  ; If the exiting condition does not exist, go step 4.
The algorithm is designed for the train stops setting problem as follows.
(1) Solution coding of the problem Coding is to express the feasible solution as a characteristic string, which can describe the characteristic of the problem. And it is required that the codes are easy to be dealt with. The train stops can be coded as string and there is a 0 or 1 at each bit. 0 denotes that the train will not stop at a certain station and 1 denotes that it will. When the strings of all the trains are linked, a chromosome is formed.
In this section, the code of a single train stops is designed as a one-dimensional array i x . The length is i.
p is the number of the sections that the trains run through.   j q L denotes the number of the stops when train j runs through section j L . The code of a chromosome is constructed as shown in Figure 8. Initialization of the population is to construct the original population as the initial solution of the problem. To create the population of the initial solution is to generate pop_size chromosome, which is shown in Figure 8. And it is a constraint to meet the station capacity requirement. So it is necessary to judge whether the capacity constraint is satisfied during generating of the initial solution. (

3) Evaluating of the population
It is a must to evaluate the population to judge the quality of the population. The index is the value of the adaptive function. The adaptive function value is the symbol of the adaptability of the chromosome. The bigger the function value is, the more opportunity to survive the chromosome has. The adaptive function and the objective function are closely related to each other. The objective function can be seen as the mutation of the adaptive function. Generally speaking, the adaptive function can be used as the objective function when the objective function is non-negative or it is a maximal optimizing problem. When the objective function is negative or it is a minimum optimizing problem, the objective function can be designed as an equation that an enough large real number minus the objective functions. In this section, the passenger distributing speed is taken as the objective function and it is non-negative. And it is a maximal optimizing problem, so the adaptive function is designed to be equal to the objective function.
(4) Selection Selection is to select an outstanding chromosome from a generation and past its excellent gene to the next generation. The roulette method is often taken in programming. Roulette method is a proportion strategy. Its main idea is to select the chromosome by the adaptive function value. The four steps of roulette are as follows. (5) Crossover.
The crossover operation includes one-point crossover, multi-point crossover, part-crossover and etc. In this section the one-point crossover is hired. To select a single one-point place for the two father chromosomes, then from the crossover place, the two chromosome exchange the value of every bit till the end of the chromosome.
The task of the mutating is to change the value of a certain bit. In this section, mutating is to negate on the bit. That is to say, to change 1 into o and 0 to 1. It has two steps. The first step is to select a place to determine the bit to execute mutation operation. The second is to execute the negating operation. Then the new generation is created after step (2) to step (6).
(7) To judge if the loop can be cancelled. If it can then exit, else go step (2).

Calculating the number of the two types of the trains
In this section, a multiple unit contains 16 cars and its capacity A c is 1200. The low speed train contains 17 cars and has the capacity of 1400. We first calculate out the numbers of the two types of the trains, which is shown in Table 6.

Stops setting
We first set the intersecting probability to be 0.6 and mutation probability to be 0.1. The maximal iteration number is 10000.
The adaptive function raised value to its peal value 263.1k after 580 iterations. Then we get the stops plan through interpreting the best chromosome. The information about the stops is shown in Table 7.

Running section
Number

Train rescheduling
The dynamic transportation resources allocation optimization is to give online, real time solution of the resources allocation problem to assure the railway transportation system operate safely. Train rescheduling is a typical dynamic transportation resources optimization problem.
Train rescheduling is to reset the inbound and outbound time of trains at stations when the operating plan is affected by disturbances. Similar with timetable optimization, the interval time and buffer time must be considered to assure the feasibility and stability of the timetable. And most of the constraints in train rescheduling are as the same as that in timetable optimization problem. The difference is that there is disturbance, and the train rescheduling is an online dynamic process, which requires more efficient algorithm to give solution in time to dispatch the trains.
A typical application of GA in dynamical transportation resources re-allocation is train rescheduling. The approach to apply GA in train rescheduling is very similar with that in timetable optimization. We will hire the variation of GA to obtain higher calculating efficiency, generating satisfactory solution, not necessarily the optimal solution.

The fitness function
The fitness function is a function that evaluates the ability that the chromosome is adaptive to the environment.
The planned timetable is shown in Table 8. "-" denotes that the departing time of a train at a certain station is the same with the arriving time.
Then, it is assumed that the fifth train arrived at the first station five minutes later than it is planned in the timetable and other trains run according to the planned timetable. Then we began to reschedule the timetable. First, the rescheduling rules are listed as follows.

Rescheduling rules
There are many rules in train rescheduling, which should be applied in the algorithm. Here are the main rules.
1. The grades of the trains can not be changed in rescheduling 2. The higher grades trains can surpass the lower grades trains and the trains of the same grade can not surpass each other 3. A higher grade train can surpass many lower grade trains and a lower grade train can be surpassed by many higher grades trains. www.intechopen.com

Parameters setting
The population size of the chromosomes is 30, the crossover probability is 0.8 and the mutation probability is 0.001. The maximal number of iteration is 100.

Trains
The adaptive function value is 10. We can see from Table 9 that the operating time at station is compressed to 6 minutes, while the planned operating time is 8 minutes, which requires the station workforce to fasten the operation work. And it is still 3 minutes late when it departs from the first station. Then the running time from the first station to the second station is compressed to 36 minutes and the train is re-planned to arrive at the second station at 8:11. Thus it is only 1 minute late. The operating time is not changed at the second station. The train recovers to operate according to the planned timetable at the third station.
It can be concluded that the rescheduled timetable is reasonable and executable from the analysis above. And the algorithm is feasible and practical and the method can be embedded in the train dispatching system to support the operation work. www.intechopen.com

Conclusion of this chapter
The main findings are as follows.