Background

Railroad blocking problem (RBP) is an important subject for freight railroad companies because its solution can reduce some extra costs. To reach a destination, a load on its route may traverse on many classification yards from its origin to its destination. In these places, the arriving load, which is usually composed of different individual shipments, is regrouped to be carried by departing trains. However, because the reclassification process is difficult and capital is intensive, this classification always produces some delay in the movement of these loads. Therefore, to avoid loads from being regrouped at every classification yard they pass through, it is better to group various shipments together to form a block. A block may contain individual shipments whose origin or destination may or may not be the origin or destination of the whole block. These shipments are regrouped only after reaching the final destination of the block.

The RBP is a network budget design problem (BDP). In the BDP, the flow cost of a set of commodities through a network is minimized while observing budget constraints on the fixed costs of the links used. BDP is related to several other problems, such as the fixed-charge network design problem and the multicommodity flow problem. The fixed-charge network design problem is different because the fixed costs for the arcs appear in the objective function. This problem is known as nondeterministic polynomial time-hard (NP-hard) combinatorial optimization problem (Magnanti and Wong [1984]; Minoux [1989]). No polynomial-time optimization techniques are known to solve the NP-hard problem. The multicommodity flow problem is a BDP with fixed binary arc selection variables. The interested reader of the network design problem should consult the surveys by Magnanti and Wong ([1984]), Minoux ([1989]), and the annotated bibliography of Balakrishnan et al. ([1997]), Crainic ([2000, 2006, 2009]).

We can define the RBP as follows. To reduce the intermediate handlings of shipments as they travel over the railroad network, a set of shipments is classified (or grouped together) at a railroad yard to create a group of cars called block. The aim of the RBP is to choose which blocks to put together at each yard and to determine the sequences of blocks that deliver each shipment to minimize the total miles that the shipments travel and their intermediate handlings (or reclassifications). In fact, the RBP aims to identify the classification plan for all shipments at all yards in the network to minimize the total shipment cost, i.e., to create a blocking plan which dictates which blocks should be built at each individual yard and which traffic should be assigned to each block as they travel from origins to destinations.

The RBP in real-life is a very large-scale problem with billions of decision variables. To solve it, we need to design the underlying blocking network, which is a virtual network that is overlaid on the physical network, and to route different commodities, where each set of railcars with the same origin-destination pair of nodes defines a separate commodity on the blocking network to minimize the system-wide transportation costs. Multicommodity flow and network-design problems are among the most difficult combinatorial problems in research operations. When they comprise a few hundred design variables, we try solving them optimally. However, the real-life RBP often contain over a million design variables and hundreds of billions of flow variables. Modeling and solving them, using commercial software, is nearly impossible.

A pioneer effort to place railroad modeling within a hierarchical structure is provided in the work of Assad ([1980]). The author offers a three-tiered hierarchy of models, including strategic, tactical, and operational levels. Differences in these levels are about planning horizon, required investment, and modeling methods (Assad [1980]). RBP is one of the main problems that need a decision in rail transportation planning, which is made in the tactical level of railroad operation.

Central to railroad operations is the operating plan that dictates the movement of shipments (railcar loads), crews, and locomotives over the railroad's network. Each railroad company has a service design department that is responsible for creating operating plans to enable efficient movement of shipments (Figure 1; Ahuja et al. [2007]).

Figure 1
figure 1

An operating plan consists of a blocking plan and a train schedule. Modified from Ahuja et al. ([2007]).

The blocking plan determines how to aggregate a large number of shipments into blocks of shipments as they travel from origins to destinations. Train scheduling consists of designing train routes, days of operation, timings, and routing of blocks on trains to minimize the total system wide cost; this cost includes car hire, crew, and locomotive costs. An operating plan dictates the flow of three important railroad assets: crews, locomotives, and railcars. A well-designed operating plan can reduce the costs of railroads significantly (Ahuja et al. [2007]).

Greedy heuristic methods produce solutions that are far from optimal and/or cannot handle real-life complexities of the blocking problem. As a result, no railroad company uses any optimization-based approach to determine blocking plans, but they rely on manual decision-making processes to make and change these plans. This manual process is very time intensive and does not save substantially on transportation costs. Consequently, we believe that there are major opportunities for cost saving using an optimization-based approach that can determine near-optimal blocking plans.

In this research, we used a population-based metaheuristic (p-metaheuristics) for solving RBP. The p-metaheuristics share many common concepts. They could be viewed as an iterative improvement in a population of solutions. First, the population is initialized; a new population of solutions is then generated. Finally, this new population is integrated into the current one, using some selection procedures. The search process is stopped when a given condition is satisfied (stopping criterion) (Talbi [2009]).

We use a mathematical model for RBP wherein its decision variables identify a blocking scheme and a commodity assignment to this block. For the first time, we proposed a new genetic algorithm-based solution method for the model, and several genetic search operators are used to find optimal solutions. To implement the proposed algorithm, we utilized the Java programming language (Oracle Corporation, Redwood City, CA, USA), and to validate the proposed algorithm, we made several blocking problems randomly and compared the proposed algorithm results with the results of the CPLEX software (IBM Corporation, Armonk, NY, USA) for these problems. The evaluating of results revealed the effectiveness and efficiency of the proposed solution method for RBP.

The outline of this paper is as follows. In the ‘Literature review’ subsection, related work is reviewed. ‘The railroad blocking problem’ subsection introduces the railroad blocking problem. Two mathematical models that include nod-arc and path-based formulations are presented in ‘The Mathematical formulation’ subsection of the ‘Methods’ section. In ‘The proposed algorithm’ subsection, the proposed algorithm is described. A small example is solved with the proposed algorithm in the ‘An example’ subsection. The next two sections presented are ‘Results and discussion’ and ‘Conclusions’, respectively.

Literature review

Previous surveys by Cordeau et al. ([1998]) and Crainic ([2000, 2002]) reviewed optimization models for rail transportation.

One of the first models for blocking belongs to Bodin et al. ([1980]) who suggested a nonlinear mixed integer programming formulation of the problem. The model is a multicommodity flow problem with additional side constraints that simultaneously determine the optimal blocking strategies for all the classification yards in a railroad system.

Assad ([1983]) proposed a solution approach for a problem defined on a line network. The cars are received at the first yard in arbitrary order and must be separated as they proceed along the line to allow each successive yard to extract the traffic destined for it.

Van Dyke ([1986, 1988]) described an interactive, heuristic approach that attempts to improve an existing blocking plan by solving a series of shortest-path problems on a network whose arcs represent available blocks.

Keaton ([1989]) proposed a nonlinear mixed integer program (MIP) model and a heuristic method based on Lagrangian relaxation for the combined problem of blocking, train routing, and makeup. In a subsequent paper by Keaton ([1992]), pure strategy constraints for blocking and maximum transit times for each origin-destination pair are also considered.

Huntley et al. ([1995]) developed a simulated annealing approach, and Gorman ([1998]) proposed a hybrid tabu search and genetic algorithm for constructing operating plans including blocking, train connections, and block-to-train assignments.

One of the significant researches on RBP has been done by Newton ([1996]) and Newton et al. ([1998]). They modeled the RBP as a network design model and formulated it as an MIP. They developed column generation and branch-and-price algorithms to solve it. Barnhart et al. ([2000]) used the same formulation as Newton et al. ([1998]) and proposed the Lagrangian relaxation technique to decompose the problem into two subproblems. Their approaches focused on determining a near-optimal solution. However, the running times are not scalable as the problem increases in size; this prohibits their use in practice.

Ahuja et al. ([2007]) developed an algorithm using a technique known as very large-scale neighborhood (VLSN) search that is able to solve the problem to near optimality using 1 to 2 h of computer time on a standard workstation computer. Jha et al. ([2008]) presented two formulations for the block-to-train assignment problem: an arc-based formulation and a path-based formulation. The latter is generally smaller than the former, and it can better handle practical constraints. They also proposed exact and heuristic algorithms based on the path-based formulation.

Zhu et al. ([2009]) attempted to combine blocking, makeup, and empty car distribution in an integrated dynamic model. To do this, they built a two-layer network, one for block flows and another for car flows. The objective function includes two fixed costs on open service and block, and a variable cost on all blocks. The model has three types of capacity constraints on maximum cars in each train, maximum car on each block, and maximum block being built in each yard at each time. They used a tabu search metaheuristic to solve the proposed model. Yang et al. ([2010]) proposed a freight transportation model with mixed uncertainty of randomness and fuzziness. Table 1 represents the well-known research in this field.

Table 1 The prominent railroad car blocking research

The railroad blocking problem

In this section, we describe the RBP and rail operations in general. In the RBP, the physical rail network (the railroad terminals and tracks) is already defined. The blocking network to be constructed is a virtual network that is overlaid on the physical network. The blocks are virtual express arcs which a commodity may take to have uninterrupted service between two terminals that are not necessarily connected by a physical link (Newton [1996]).

On railroads, a typical general merchandise shipment may pass through many terminals on its route from origin to destination (OD). At these terminals, the incoming traffic is reclassified (sorted and grouped together) to be placed on outgoing trains. On average, each reclassification results in a 1-day delay for the shipment. In addition, the classification process is labor and capital intensive since many workers and large quantities of equipment are needed to sort the traffic, and construction and maintenance of large terminals are necessary to handle the sorting task. To prevent shipments from being reclassified at every terminal they pass through, several shipments may be grouped together to form a block. A block has associated with it an OD pair, which may or may not be the OD pair of any of the individual cars contained in the block. Once a shipment is placed in a block, it is not reclassified until it reaches the destination of that block (Newton [1996]).The railroads develop the blocking plans that dictate which blocks should be built at each individual terminal and which traffic should be assigned to each block.

The objective of the RBP is to develop a feasible blocking plan which, in conjunction with other operating policies, minimizes the total cost of delivering the commodities. These costs are usually broken down into car-handling costs associated with handling (or blocking) a car and car-mile costs associated with the movement of a car. To solve the RBP, we must decide which blocks to include in the blocking plan and which blocks to use to deliver each commodity (Newton [1996]). An example of a rail system with four terminals is shown in Figure 2.

Figure 2
figure 2

Physical rail system and five blocking plans.

We define commodities as origin-destination pairs of terminals. We assume that the only commodities are A → B with 100 cars, A → C with 80 cars, and A → D with 90 cars. Terminal A has a volume capacity of 270 cars, which is its minimum since 270 cars originate there. Terminals B and C can each block 90 cars. Terminal A can build two blocks, whereas each of the other terminals can only build one block.

At each terminal, limited classification resources restrict the number of cars (or car volume), which can be classified, and the number of blocks. In terms of our graph, the car volume constraints would be the upper bounds on the flow through each node, and the number of block constraints would be limits on the out-degree of each node. One performance metric of a blocking plan is the total number of classifications necessary to deliver all commodities. We consider five different blocking plans for this example.

With blocking plan 1, at terminal A, all three commodities are sorted to move to terminal B. The resulting string (block) of cars may have the commodities intermingled. At terminal B, commodity A → B has reached its destination and leaves the system. Commodities A → C and A → D are blocked to be move to terminal C. At terminal C, commodity A → C has reached its destination and leaves the system, and commodity A → D is blocked to move to terminal D. Using this blocking plan, the 100 cars for commodity A → B use one block, (A, B), the 80 cars for commodity A → C use two blocks, (A, B) and (B, C), and the 90 cars for commodity A → D use three blocks, (A, B), (B, C), (C, D). Therefore, for blocking plan 1, there are 530 classifications; however, this plan is not feasible because it requires blocking 170 cars at terminal B that has a maximum volume of 90 cars.

Blocking plan 2 provides a direct block from terminal A to terminal D. Cars which travel in this block will still move along the physical track through terminals B and C, but since they are presorted for terminal D, they do not require classification resources at B or C. To deliver the three commodities using this blocking plan requires 350 classifications, since the 90 cars of commodity A → D now require only one block, (A, D). This blocking plan is feasible since it observes the limits on number and total volume of the blocks built at each terminal.

Similar calculations show that blocking plans 3, 4, and 5 require 360, 270, and 360 classifications, respectively. However, blocking plan 4 is infeasible since it requires three blocks for terminal A, which has a maximum capacity of two blocks. Commodities are always carrying directly to their destination, as in blocking plan 4.

Therefore, blocking plan 2 with 350 handlings is optimal with respect to the total number of classifications required. However, if the number of cars which could be blocked at B is reduced to less than 80 (or equivalently, the volume of commodity A → C were more than 80), then blocking plan 2 would be infeasible and blocking Plan 3 with 360 handlings would be optimal.

Methods

The mathematical formulation

The RBP can be modeled as a network design problem where the nodes represent the railroad terminals, and the arcs represent potential blocks (Newton [1996]). In this section, we present a node-arc MIP for the RBP. The parameters and variables used in this model are as follows:

• Parameters

G = (N, A):the graph with terminal set N and potential blocks set A.K:the set of all commodities k designated by an origin–destination pair of nodes.vk:the volume of commodity k.orig(k):the origin terminal for commodity k.dest(k):the destination terminal for commodity k.orig(a):the origin of potential block a.dest(a):the destination of potential block a.ua:the capacity of potential block a.ca:the per unit cost of flow on arc a.B(i):the number of blocks which may originated at terminal i.V(i):the volume which may be classified at terminal i.

• Variables

· x a k = 1 if the commodity k is flowing on block a; 0 otherwise.

· y a k : 1 if block a is included in the blocking network; 0 otherwise.

• Node-arc formulation

min k K a A c a v k x a k st.
(1)
a A orig a = i x a k a A dest a = i x a k = { 1 orig k = i 1 dest k = i 0 otherwise i N , k K
(2)
k K v k x a k u a y a a A
(3)
a A orig a = i y a B ( i ) i N
(4)
k K a A orig a = i v k x a k V ( i ) i N
(5)
y a 0 , 1 a A
(6)
x a k 0 , 1 a A , k K
(7)

The objective is to minimize the sum of the costs of delivering each commodity using the blocking network formed by blocks for which y a  = 1. For each terminal, constraints (2) are balance equations for the flow of each commodity. For each potential block, constraints (3) prevent flow on blocks, which are not built and enforce the upper bound u a on flow for blocks, which are built. The constraints (4) enforce the terminal limit B(i) for the sum of the blocks which leave the terminal. The constraints (5) model the volume of cars, which may be classified at each terminal.

We also present the path-based formulation for the RBP. The parameters and variables used in this model are as follows:

• Parameters Q(k): the set of legal paths for commodity k. orig(k): the origin node for commodity k. dest(k): the destination node for commodity k. P C q k : the path cost for flowing one unit of commodity k on path q. δ a q : the binary design parameter; δ a q = 1 if q th path contain arc (block) a th 0 otherwise.

• Variables y a : the binary design variable for including arc (block) a:y a  = 1 if arc a is selected; 0 otherwise. f q k : the binary flow variable; f q k : = 1 if commodity k flows on path q 0 otherwise. fqk:the binary flow variable; fqk: = 1 if commodity k flows on path q 0 otherwise.

The path-based mathematical model for RBP is explained as flowing equations:

• Path based formulation

min k Q q Q ( k ) P C q k v k f q k st .
(8)
k Q q Q ( k ) f q k v k δ a q u a y a 0 a A
(9)
q Q ( k ) f q k = 1 a A
(10)
a A o r i g a = i y a B ( i ) a A
(11)
k K q Q ( k ) a A o r i g a = i v k f q k δ a q V ( i ) i N
(12)
f q k 0 , 1 q Q k , k K
(13)
y a 0 , 1 a A
(14)

Equation 8 is the objective function of this model; it minimizes total costs of delivering each commodity on paths because classification must be done on all commodities at its origin and destination. In this model, classification cost is not considered at that place for each commodity. Constraints (9) ensure that flow is only allowed on arcs (blocks) included in the network. Constraints (10) ensure that all of each commodity is delivered. Constraints (11) limit the number of blocks, which may be built at each node, which is modeled by the node-budget constraints. Constraints (12) limit the volume of cars, which may be classified at each terminal.

The proposed algorithm

This section introduces the proposed p-metaheuristic algorithm for solving the RBP. The proposed solution method is based on genetic algorithms (GAs). GAs are one of the most famous p-metaheuristic algorithms which have been developed by J. Holland in the 1970s (University of Michigan, USA) to understand the adaptive processes of natural systems; Then, they have been applied to optimization and machine learning in the 1980s. A GA usually applies a crossover operator to two solutions that plays a major role, plus a mutation operator that randomly modifies the individual contents to promote diversity. GA uses a probabilistic selection that is originally the proportional selection. The replacement (survivor selection) is generational, i.e., the parents are replaced systematically by the offsprings. The crossover operator is based on the n-point or uniform crossover while the mutation is bit flipping. A fixed probability p m (p c ) is applied to the mutation (crossover) operator (Talbi [2009]). GAs have several advantages. Instead of single solution optimization, GAs use a population of solution simultaneously, so the probability of getting stuck in local minima is prevented; in comparison with other p-metaheuristic methods, GAs have high-quality solutions and good convergence speed.

General structure of the proposed algorithm

The proposed algorithm has several stages. At the first stage, solutions (feasible and infeasible) are encoded into the chromosome. The idea of this stage is simulation and good representation of all possible solutions for the next stage. Encoding solutions into chromosomes is important to other stages. In the proposed algorithm, to find solutions in a reasonable time, each possible solution is encoded into strings of integer numbers (chromosome). To construct the initial population, each possible solution is created randomly, but at least one feasible solution is added to the initial population. There are two approaches to find a feasible initial solution. If the car blocking problem is implemented for a railway which has a specified blocking plan for each O-D pairs, this blocking plan could be used as initial feasible solution. However, if a car blocking problem is implemented for a railway without a specified blocking plan for each O-D pairs, it needs a heuristic algorithm to initialize feasible solutions. To present a feasible solution, one must consider two problem constraints (i.e., number of block and car volume). Figure 3 represents the process of this heuristic.

Figure 3
figure 3

The heuristic steps for finding a feasible solution.

To do a comparison among chromosomes, we use a fitness function. A fitness value is assigned to each chromosome based on this function. This stage of the proposed algorithm for solving the problem is extremely important. Because it establishes a measure to indicate superiority or inferiority of each possible solution, the measure could attribute a real number to each possible solution; this number represents its degree of dominance, e.g., suppose f is a fitness function, and X1 and X2 are two chromosomes of a population and f(X1) = 3 and f(X2) = 5, then X2 is better than X1, or it has a greater fitness value.

After evaluating the fitness value of each chromosome of the initial population, the proposed GA randomly chooses two chromosomes according to the roulette wheel method; the chromosomes with greater fitness value are selected as the parents. In constructing a new generation of chromosomes, crossover and mutation operators are utilized. The crossover operator first selects two parents by roulette wheel selection method and chooses a place on each parent as crossover point randomly. To make the first (second) child, the algorithm swaps the content of the left (right) side of each parent with another one. The mutation operator selects a chromosome from the population randomly and then selects one point on the chromosome randomly, and the content of its gene is changed according to the mutation probability (p m ); this process is continued for all selected chromosome gene. After producing a new generation of chromosomes, the next generation is identified. In the stage of producing the next generation, the proposed algorithm keeps k as the best feasible solution of the current generation to include in the next generation. If m is the number of initial population, in order to create the next generation, the m and k chromosomes of new generation are initially selected randomly, and then, k is selected as the best feasible solution of the current population. Their union makes the next generation. The algorithm checks two termination conditions simultaneously: (1) if the iteration number does exceed N and (2) if after L iterations of the algorithm, the best solution so far does not improve. Figure 4 is a pseudocode for the proposed algorithm.

Figure 4
figure 4

The pseudocode for the proposed algorithm.

Parameter tuning

The metaheuristics are sensitive to the value of their parameters. The parameters are the configurable components of a metaheuristic algorithm. Parameter tuning may allow a larger flexibility and robustness to the algorithm but requires a careful initialization. Those parameters may have a great influence on the efficiency and effectiveness of the search. It is not obvious to define a priori which parameter setting should be used. The optimal values for the parameters depend mainly on the problem, and even the instance to deal with, and on the search time that the user wants to spend in solving the problem. A universally optimal parameter value set for a given metaheuristic does not exist.

One main step of this research is fine parameter tuning of algorithm. In the proposed algorithm, there are three main parameters which include the number of individuals of a population, crossover, and mutation rate. We use a trial-and-error procedure to obtain locally optimal values for the parameters. To tune parameters, we generated three instances with different sizes. For tuning, only one parameter changed at that time, while all other parameters didn’t change. Proper values of the parameters were then determined through running the algorithm 10 times over different values of the parameters and through calculating the average of the goal function for these 10 runs. The criteria for modifying parameters are the quality of solutions and time spent to find them. The final value for the parameter is as follows: the population size is 6 × the number of commodity, cross over rate is 0.7, and mutation rate is (1/the number of commodity).

An example

In the proposed method, each gene represents one commodity, and the value of this gene is the legal blocking path number (on the blocking network) which this commodity can select. To determine this legal path for each commodity, a comprehensive preprocess is needed. In the preprocess procedure, the legal paths for each commodity, cost of each path, number and type of block on each path are determined.

Figure 5 represents a physical rail network with four stations and six demands (A → B, A → C, A → D, B → C, B → D, and C → D). Demand A → B is named (1),…, and demand C → D is named (6), respectively.

Figure 5
figure 5

Physical rail network with four stations.

On the first step, the blocking network is made with respect to the physical rail network and demand. Figure 6 represents the blocking network for the presented physical rail network. Each arc on this network represents a legal block from each station.

Figure 6
figure 6

The blocking network.

The next step is to compose legal paths of each demand as shown in Figure 7, and then delivering cost of cars on a legal path, which contains the shipment cost of cars on the physical path and reclassification cost at the intermediate terminal (expect origins and destinations), is computed.

Figure 7
figure 7

Legal path for each demand.

According to this legal path, the chromosomes of the proposed algorithm are created. Figure 8 represents a schematic of these chromosomes that we used to solve the problem.

Figure 8
figure 8

A schematic of the proposed chromosomes.

To do a comparison among chromosomes, a fitness function is used as Equation 15, which X i is a chromosome of the population, K is set of commodity, c k x i is the cost of selected path at k th gene of X i chromosome, and vk is the volume of k th commodity:

f X i = k K v k c k X i
(15)

Note that the proposed algorithm has a possibility to produce infeasible solutions (chromosomes). Hence, after producing an infeasible chromosome, a penalty term is considered; this term is added to the fitness value of infeasible solutions as an extra cost.

To create a new generation, we select some chromosomes as parents to produce children. This selection must give greater chances not only to chromosomes with lower cost, but also to chromosomes with greater cost because they may have some genes with high quality. To do this, we implemented the roulette wheel method. Suppose a circular plane that is able to circle around its central point. On this plane, consider some sections; the number of these section is equal to the number of the population, and the area of this section has a direct relationship with the selection probability of an individual chromosome. Beside this plane is a fixed point; the plane spins around its central point to stop. A section that is in front of this fixed point is selected when the plane stops spinning. To simulate the roulette wheel action, according to Equation 16, each chromosome of the current generation initially gets a number between 0 to 1. X i is a chromosome; m is the number of population, and sumfitness = m j = 1 f ( x i ) .

( 1 ( f ( X i ) / sumfitness ) / ( m 1 ) ) .
(16)

A random number between 0 to 1 named r is selected, and n is selected as Equation 17.

n 1 i = 1 ( 1 ( f ( X i ) / sumfitness ) / ( m 1 ) ) r m i = 1 ( 1 ( f ( X i ) / sumfitness ) / ( m 1 ) ) .
(17)

After the parent selection, we use a one point crossover to produce a new generation. After selecting two parents from [1, L − 1] interval, this operator creates a random number (with uniform distribution) named k; L is the length of the chromosome. The gene at k + 1, k + 2,…, L − 1, and L from the first parent is replaced by the corresponding gene at the second parent to create two new strings. After the crossover action, the mutation operator changes some genes of the chromosome. The mutation operator on chromosome X i first creates a random number between 0 and 1; if this number is less than the mutation probability, then the algorithm changes the content of this gene. To change the value of gene k th of the chromosome, from interval [1, |Q(k)|], an integer number is initially created randomly (|Q(k)| is the number of legal path for commodity k). The algorithm then swaps the generated number with the previous one at gene k th of the chromosome.

Results and discussion

The proposed algorithm is implemented with the use of the Java programming language, and a personal computer with Intel® Pentium® processor (2M cache, 2 GHz; Santa Clara, CA, USA), 32-bit Windows 7 Ultimate operating system (Microsoft Corporation, Redmond, WA, USA), and 2-GB installed memory (RAM) is used to achieve all of the results.

Capacity to classification operations in each terminal, commodity volume, commodities' origin and destination, and physical location of each terminal were all under consideration. Through the process, the main issue was to create a problem similar to real-world conditions as possible. The generated problems were solved using the proposed algorithm, which were implemented with Java programming language and CPLEX 11.1 software, separately. The CPLEX software is designed for large and complex problems. It is capable to solve linear programming, quadratic programming, and integer programming problems. Each one of the simulated problems is solved using the proposed algorithm 10 times. Table 2 lists the average of the objective values and the average of CPU time spent for finding the solutions by the proposed algorithm.

Table 2 Comparison results of the proposed algorithm with CPLEX

The last column shows the error percentages. As illustrated in Table 2, the proposed algorithm found optimum solutions for problems SP1 to SP12 in a short time. The algorithm has superior performance than the CPLEX software with respect to time spent to generate the solutions. The error percentage for the first six of these problems is 0%, and for the six remaining is approximately near 0%.

Figure 9a,b,c,d represents convergence behavior of the proposed algorithm for some test problems to find optimal solution during the successive iteration. In this figure, (1) time was measured in one thousandth second (millisecond), and (2) the solid line represents the GA solutions.

Figure 9
figure 9

Time-cost graphs for (a) SP8, (b) SP9,(c) SP10, and (d) SP12.

The proposed algorithm checks two termination conditions simultaneously. In the first termination condition, if after 50 iterations there is not any improvement in the best-so-far solution, the algorithm stops. In the second termination condition, if the number of iterationsexceeds5,000 iterations, the algorithm stops.

Conclusions

This paper, for the first time, introduced an approach based on genetic algorithm metaheuristic to solve the railroad blocking problem in a short reasonable time and high accuracy. The seven simulated problems were solved using the CPLEX software and the proposed algorithm, the solution accuracy, and the CPU time spent to find the solutions used to make comparison. The results show high efficiency and effectiveness of the proposed algorithms. It is possible to make significant savings in time and costs of operations through applying solutions produced by the algorithm. Finding feasible solutions for the algorithm is a challenging task with respect to great solution space. Future research on this paper could have two directions; one direction is to develop a heuristic algorithm to find initial feasible solution to speed up convergence, and the other direction is to use a hybrid genetic algorithm and ant colony optimization to enable the algorithm for solving more large-scale problems and decrease solving time of algorithm.