1 Introduction

When solving problems in continuous search space, there are many alignment alternatives between two points, which are characterized by topography, land ownership, and environmental issues. The objective function of the problem depends on various cost factors, which include supplier costs, user costs and out-of-system costs [1].

There are a number of constraints in railway alignment design, which can be classified as Capacity and alignment traffic constraints, Horizontal alignment constraints and Vertical alignment constraints [2].

Given the existing complexities in railway alignment design, researchers have considered many simplifying assumptions for the model railway alignment problem to achieve the proper alignment. Generally, these simplifications have led to final model solutions that are not applicable or cannot approximate the optimal solution obtained from the actual models. This work aims to reduce the simplifying assumptions and to modify optimization methods for existing algorithms. Results show that the applicability of the solutions of the proposed model are improved.

The paper is organized as follows: After the introduction, a review of the literature on methods previously developed for optimizing railway and highway alignments is provided in Sect. 2. Major railway costs and constraints associated with railway construction are discussed in Sect. 3, and the methodology developed for the railway alignment optimization model is introduced. In Sect. 4, we describe how we represent the railway alignment optimization problem in particle swarm optimization algorithms (PSO), and we discuss our approach to modeling railway alignments and structures in Sect. 5. Section 6 describes a basic model formulation. In Sect. 7 we demonstrate the model’s capability and feasibility by applying it to real-world problems. Sections 8 and 9 provide a discussion and conclusions drawn from this study.

2 Literature Review

Originally, railway alignment design was a 3D optimization model. This model has a multivariate objective function, and there are many nonlinear constraints in it. Because of the behavioral complexity of the three-dimensional profile of the track, it requires a multistep solution to the problem. The three-dimensional solution seems to be a problem owing to a variety of design options and multiplicity of parameters involved. For this reason, in many studies, railway alignment design has been performed in two steps. In the first step, the horizontal alignment is determined, and the vertical alignment is then adjusted correspondingly. Because the horizontal and vertical alignments are interdependent, various studies have explored ways to solve these two problems at the same time [3].

Shafahi and Bagherian [3] categorized highway and rail path optimization models into three broad categories:

  1. a.

    Vertical alignment optimization models

  2. b.

    Horizontal alignment optimization models

  3. c.

    3D optimization models (simultaneous horizontal and vertical alignment optimization)

Horizontal alignment optimization models are more complex than vertical alignment models, primarily because of the various parameters that must be considered, such as socioeconomic and environmental issues. Shafahi and Shahbazi [1] studied the design of optimal railway alignment using a genetic algorithm. The Shahbazi optimization model is non-backtracking. The vertical alignment is formed within an allowed range along the horizontal alignment for the maximum allowable gradient of the railway track. Turner and Miles [4] reported on a cost/benefit alignment optimization model using the shortest path in a raster grid. Other studies have used calculus of variations [5,6,7,8] and network optimization [9,10,11,12].

Many studies in the literature have examined the optimization of vertical alignment. The most important parameter in the vertical alignment cost function is the volume of earthwork. The design of the vertical alignment, the problem of generating backtracking alignment, and the possibility of disconnecting alignments has not been posed because the vertical alignment is designed along the horizontal alignment.

Fwa et al. [13] proposed a method for optimizing vertical alignment by assuming a given horizontal alignment. They considered various constraints on the design of the vertical alignment, such as longitudinal slope, vertical curve, fixed points, and limitations of vertical curve on horizontal curves in the proposed model. A genetic algorithm was used as an optimization method, and a penalty function with a finite fixed unit was used to avoid unacceptable solutions.

The study by Easa [14] was one of the first to focus on alignment optimization. In order to optimize the longitudinal profile of the route and reduce the cost of earthwork, he proposed a model that minimizes the cost of earthwork and also fulfills the necessary geometric characteristics. In his model, the project line creates the necessary balance between earthwork sections (cut and fill sections), and the longitudinal slope and vertical curvature are subject to a maximum limit, while the minimum distance between the successive vertical curves is taken into account.

The major cost associated with the design of the vertical profile of a route is the cost of earthwork, which was addressed in a study by Goktepe et al. [15] on optimizing project line points with regard to the cost of earthwork units (embankment and excavation). They used the concept of weighted ground equivalency (WGE), which was achieved by placing the total embankment and excavation (earthwork) vectors in each cross section.

Studies using dynamic programming algorithms [16,17,18,19] and linear programming algorithms [20, 21] have been reported in the field of vertical alignment optimization.

Chew et al. [22] were the first researchers to solve the problem of simultaneous optimization of 3D alignment for horizontal and vertical profiles. They used a numerical search method in their study.

The use of a meta-heuristic algorithm for routing began with Jong’s [23] research. Jong and Schonfeld [24] then tried to ameliorate some of the defects using genetic algorithms. They provided a solving order with genetic algorithm changes which are used in routing problems.

Jha and Schonfeld [25] used a geographic information system (GIS) and genetic algorithms to solve the problem of optimal alignment. Assuming that the search area is a rectangular region, they divide this area into a grid with similar square cells. The cells are considered small enough that an assumption of similarity of properties within them (e.g., land costs, height) is reasonable. Hasany and Shafahi [2] used an ant colony optimization (ACO) method for optimizing railroad alignment. The modeling study was done in continuous space and utilizing GIS. In 2006, De Smith [26] used a network optimization method with limitations on curve radii and alignment gradient for route, railway, and pipeline routing. In the same year, Cheng and Lee [27] provided a 3D route optimization model using the neighborhood search method to determine a horizontal path and mixed hybrid planning to optimize the vertical path. Shafahi and Bagherian [3] used a relatively new and effective method in 2013 to solve the path routing problem with a particle optimization algorithm (bird swarm algorithm). This model uses geospatial data as a search space and performs searches in a continuous environment. Considering the geometric constraints in the design of the route, this model features the ability to produce return routes and the possibility of constructing the bridge and tunnel along the path, aligning with the list table, improving the cost functions used in previous studies and global search capability, and thus finding a near-optimal real-world path. To determine an alignment, first, a number of intersection points are indicated that make a broken and rugged alignment. Then, with the help of other algorithms, the horizontal and vertical curves are matched to achieve a smooth alignment. The intersection points from the optimization problem are variables. The range of these point changes are on lines parallel to one another.

Similarly, Lai and Schonfeld [28] proposed a methodology for concurrent optimization of station locations and rail transit alignment connecting those stations, by accommodating multiple system objectives, satisfying various design constraints, and integrating the analysis models with a GIS database. Li et al. [29, 30] used a genetic algorithm and bidirectional distance transform to optimize railway alignments in mountainous terrain. Concurrent optimization of mountain railway alignment and station locations using a distance transform algorithm was recently reported by Pu et al. [31].

Many studies have been carried out for three-dimensional route optimization with genetic algorithms, including Kim [32], Jong and Schonfeld [24], Tat and Tao [33], Kim et al. [34,35,36,37], and Kang et al. [38,39,40,41].

3 Railway Costs and Constraints

Several parameters directly or indirectly affect the construction or design of a railway track. Initial construction costs have a direct effect on the design (earthwork costs, superstructure costs), but other costs, including user costs and out-of-system costs, have an indirect impact on the design of the alignment, and therefore should be considered in the design process. It is very important that all the critical costs of the project are taken into account when designing the alignment in order to obtain the optimal alignment. Various railway costs have been examined in a number of studies [1, 2]. The costs considered in these articles include the following:

  • Right-of-way-dependent costs

  • Length-dependent costs

  • Traffic-dependent costs

  • Volume-dependent costs

  • Hydrology and hydrologic-dependent costs

  • Bridge- and tunnel-dependent costs

3.1 Right-of-Way-Dependent Costs

The costs associated with a road or railway route, depending on the passageway, include land acquisition and other costs for crossing the track from one area. Because of this, the railway track passageway has a special significance. According to the accuracy requirements, the study area is divided into cells with specific dimensions. It is assumed that each cell in the study area represents an area with the same cost of production. Crossing the railways from different cells carries different costs, and the final costs for the location depend on the total costs of the path components in the cells. With this cost system, cells that are located in areas where the railroad does not have to cross them (such as historic sites, or marsh locations or other special locations) can be defined as cells with a very high unit cost. This routing process will cause the total cost of the transit route in this area to be increased, and the probability of choosing it will be reduced.

3.2 Length-Dependent Costs

The hypothesized superstructure in this paper is a ballasted one. This type of track includes ballast, tie, fastener, and rail. The use of ballast is very common, as ballasted tracks have very good performance. Although the maintenance cost for this type of track is high, its construction cost is lower than for ballastless tracks. There have been no major changes in the principles of ballasted superstructures since railway tracks first emerged, but certain developments have occurred within the railway transport industry in order to promote greater safety and speed, such as continuous welded rail (CWR), the use of concrete ties and heavier rail sections, elastic fastenings, machining repair operations, and the development of advanced equipment for measuring various parameters of track components, maintenance management, and so on.

3.3 Traffic-Dependent Costs

In road design, typically only the costs of route construction are reviewed, while the effect of alignment selection in railways involves other costs, including operating costs. In this paper, in addition to construction costs, operating costs are also considered, which include the following [2]:

  1. a.

    The cost of purchasing, maintaining, and replacing rolling stock

    • Locomotive purchases

    • Locomotive maintenance

    • Wagon purchases

    • Wagon maintenance

  2. b.

    Track maintenance and reconstruction cost

  3. c.

    Cost in terms of the value of cargo and passenger time

3.4 Volume-Dependent Costs

In this paper, the average end-area method is used to calculate the volume of earthwork [42]. To calculate the volume of earthwork (excavation and embankment operations) on horizontal alignment at specified intervals, the area of transverse sections (stations) is determined, and the volume of soil operations between the two stations is then calculated. Accuracy in estimating the volume of earthwork is dependent on the distance between stations. When the distance is smaller, a more accurate estimate of earthwork will be achieved [43]. Here, for calculating the volume of earthwork, the distance between stations is considered to be identical and equal to 50 m.

3.5 Hydrology and Hydrologic-Dependent Costs

Since moisture and pore water pressure play a decisive role in the durability of ballast aggregates, the strength of construction, and stability of slopes, surface and underground water control are considered as key factors in the design and maintenance of railways. Given the importance of this issue with regard to railways, in this paper we have tried to consider the costs of the alignment of hydrologic affairs as much as possible.

Here, for transverse drainage, an approximate objective function is used. This function was developed using studies to determine the hydraulic sections in the second phase of the Chabahar–Zahedan railway project in Iran. We have tried to consider the mountainous and plain areas separately. In this case study (the second phase of the Chabahar–Zahedan railway project), the alignment was in the plain area from 15 to 85 km, and so a culvert was used every 370 m on average. Alignment was also considered to be a mountainous area from 85 to 155 km, with an average of 290 m used for the distance between the culverts (in a type of cost depending on the alignment length and location). In addition, the dimensions of the technical hydraulic structures used vary depending on the project and existing ground line location, and the average cost of each project is considered. Therefore:

$$C_{{{\text{H}}1}} = \frac{L}{370} \times C$$
(1)

CH1 is the cost of technical structures in the plain areas, L is alignment length (m), and C is the average cost of one technical structure.

$$C_{{{\text{H}}2}} = \frac{L}{290} \times C$$
(2)

CH2 is the cost of technical structures in mountainous areas, L is alignment length (m), and C is the average cost of one technical structure.

3.6 Bridge- and Tunnel-Dependent Costs

Bridges and tunnels are used as a substitute for bulky embankments and excavations as well as a solution for crossing inaccessible areas such as rivers. Given the complexity of the cost function of the bridge and tunnel and its dependence on various parameters such as topography and land diversification, calculating the cost of construction and efficiency, and determining the optimal location of the bridge and tunnel becomes a complex problem. Because of the high cost of a bridge or tunnel, its proper alignment during the design stage can prevent substantial waste. In this section, the use of bridges and tunnels in alignment optimization is investigated. Here, only an approximate estimate of the cost of bridge construction is required, and thus some errors are neglected. To estimate the bridge construction cost, the linear cost function provided by O’Connor [44] is used. Given that bridge maintenance and repair is of great importance, a previously proposed method [39] was used to estimate the bridge maintenance. The cost for the tunnel is considered according to the formulas presented in [43]. In this paper, we have tried to take an additional step in order to complete the alignment of the railway tracks, taking into account the bridge and tunnel and adding it to the original model. In order to determine the position of the alignment required for the construction of a technical structure, the following are considered:

  • If the excavation height exceeds the permissible level according to the material, then a tunnel needs to be constructed.

  • If the height of the embankment exceeds the virtual limit, it is necessary to construct a bridge along the alignment.

  • The bridge should be constructed if an alignment passes through an environmentally sensitive, marshy or river-bound area with operational problems on the embankment.

3.7 Constraints in Railway Track Alignment

Limitations on the design of railroad geometry are a major consideration. Several studies have investigated how to consider the constraints in evolutionary and ontological methods. Six general approaches were mentioned in [45] and their cases were explained in [3]. The alignment problem-solving method chosen in the present work is based on artificial intelligence. In the following, the proposed solving method for dealing with the constraints in this paper, which is based mainly on the definition of the appropriate penalty function for violating any of these constraints, is described. Considering that there are many constraints in the design of the railway alignment, in this paper, in order to achieve an alignment that is feasible to implement in the real world, the following three important constraints are considered in the model:

  1. 1.

    Minimum radius of horizontal curve

  2. 2.

    Minimum vertical curve length

  3. 3.

    Maximum longitudinal slope of the alignment

3.7.1 Penalty Function for Violating the Minimum Horizontal Curve Radius

As long as the minimum radius of the track can be met along the way, the curvature limits of the alignment have been fulfilled. However, due to the small distance between the two points of intersection, there may be a discontinuity in horizontal alignment which is solved this problem using the algorithm reported in [46]. If the radius of the existing alignment is less than the minimum allowed radius of the route (\(R_{\hbox{min} }\)) according to Formula (3) (288 code in Iran), for the penalty of the alignment, the method presented in [47] is used.

$$R_{m(i)} = \frac{{V^{2}_{\hbox{max} } (i) - V^{2}_{\hbox{min} } (i)}}{12.71}$$
(3)

\(V_{\hbox{max} }\) and \(V_{\hbox{min} }\) is the speed of passenger and freight trains, respectively (\({\text{km}}/{\text{h}}\)), \(R_{m(i)}\) is minimum circular curve radius (m).

3.7.2 Penalty Function for Violating the Minimum Vertical Curve Length

In order to observe the minimum vertical curve length, an approach similar to that of the horizontal curve radius is used. To correct the discontinuity of the vertical curves, the method presented in [43] is used. If the minimum length of the vertical curve is less than the minimum allowed length of the vertical curve (\(L_{\hbox{min} }\)) according to Formula (5) [48], the penalty of the alignment presented in [47] is used.

$$L_{{m_{i} }} = \frac{{DV^{2} K}}{A}$$
(4)

\(L_{{m_{i} }}\): minimum vertical curve length (ft.), D: the absolute magnitude of the slope variation on both sides of the curve (decimal), V: design speed (mph), K: conversion ratio (2.15), and A: the vertical acceleration, equal to 0.6 for passenger trains and 0.1 for freight trains

The minimum length of the vertical curve relative to the speed of the freight and passenger trains is equal to the maximum of the following:

$$L_{{m_{i} }} = \hbox{max} \left\{ {\frac{{DV^{2}_{\hbox{max} } K}}{0.6},\frac{{DV^{2}_{\hbox{min} } K}}{0.1}} \right\}$$
(5)

3.7.3 Penalty Function for Violating the Maximum Gradient of the Alignment

For the penalty function in the case of nonobservance of the maximum gradient for successive intersections i and i+1, a similar approach was encountered with two previous modes. The maximum allowed gradient for this part is considered to be 1.25%.

4 Representation of Railway Alignment in PSO

In the proposed railway alignment optimization model, a horizontal alignment is defined by the tangents, circular curves, and the connecting transition curve sections. A vertical alignment is defined by the graded tangents connected with parabolic curves. This arrangement of elements depends on the points of intersection of the horizontal alignment (PIs), so the definition of generating alignments can be summarized in the choice of different points of intersection. In this paper, the PSO algorithm is used to find the optimal railway track alignment.

The particle swarm optimization (PSO) algorithm is a one of the wide category of swarm Intelligence methods for solving optimization problems. The basic PSO algorithm was developed by Kennedy and Eberhart [49] and Tu et al. [50]. Execution of the PSO algorithm to solve highway alignment optimization problems is convenient for two reasons. First, PSO is inherently designed to solve continuous problems, and its efficiency has been reported in previous studies. Second, unlike the other algorithms proposed for highway alignment optimization (e.g., genetic algorithms), the PSO implicitly considers the spatial relations during the search process. Therefore, this algorithm can be considered as a promising method for alignment optimization problems [3].

PSO can be easily implemented, and it is computationally inexpensive compared with genetic algorithms, since its memory and CPU speed requirements are lower [50].

In the basic PSO algorithm, the position (x) and velocity (v) of each particle in the swarm can be updated after each iteration, using the following equations:

$$x(t + 1) = x(t) + v(t + 1)$$
(6)
$$v(t + 1) = v(t) + C_{1} r_{1} (t)[g(t) - x(t)] + C_{2} r_{2} (t)[p(t) - x(t)]$$
(7)

where C1 and C2 are the accelerator constants, r1 and r2 are randomly generated numbers distributed uniformly in the [0, 1] interval, g is the best solution found by the population to that point, and p is the best solution found by each particle.

There are many extensions of the basic PSO designed to improve its convergence behavior. Shi and Eberhart [51] introduced the “inertia weight model,” in which the inertia of the particle [the v(t) term] is multiplied by a parameter w, known as inertia weight. Consequently, Eq. (7) can be rewritten as

$$v(t + 1) = wv(t) + C_{1} r_{1} (t)[g(t) - x(t)] + C_{2} r_{2} (t)[p(t) - x(t)]$$
(8)

In this equation, the inertia weight can either stay constant or decrease during the execution of the algorithm. Another modification is velocity clamping [52]. In each iteration, if the calculated displacement of a particle exceeds the specified maximum velocity, it is set to the maximum value. Let Vmax,j denote the maximum velocity allowed in dimension j. The particle velocity is then adjusted before the position update using

$$v_{ij} (t + 1) = \left\{ {\begin{array}{*{20}l} {v^{\prime }_{ij} (t + 1)} \hfill & {{\text{if}}\;v^{\prime }_{ij} (t + 1) \le V_{\hbox{max} ,j} } \hfill \\ {V_{\hbox{max} ,j} } \hfill & {{\text{if}}\;v^{\prime }_{ij} (t + 1) \ge V_{\hbox{max} ,j} } \hfill \\ \end{array} } \right\}$$
(9)

where \(v^{\prime }_{ij} (t + 1)\) is the speed of the particle, obtained from Eq. (8), and \(v_{ij} (t + 1)\) equals the modified value which is considered to be the particle’s speed at step t+1.

In this model, each alignment is represented by a particle. Each particle contains the coordinates of the point of intersection [PIi (xi, yi, zi)] which is shown as PI in the model. In the PSO algorithms used for the railway alignment optimization model, first, a number of initial alignments are generated (each of which represents a particle). The various methods for producing the initial alignments are fully described by Shafahi and Bagherian [3]. In this paper, to cover the entire zone, the alignments are generated randomly at the study area. According to the studies conducted in this field and solving various examples, 25 alignments (particles) were selected as the initial alignment and 100 repetitions were considered as the criterion for stopping the PSO algorithms. Figure 1 shows orthogonal cutting planes where the PIs of a railway alignment are generated. The total number of cutting planes indicates the number of points of intersection. Here, the distance between the cutting planes is chosen to be equal, and each PI on these cutting planes has its own coordinates x, y, z. These points are generated in each replication of the algorithm for optimal alignment.

Fig. 1
figure 1

A series of points of intersection generated on corresponding orthogonal cutting planes [46]

The number of cutting planes that are used affects the shape and even the cost of the alignment generated. For urban areas or areas with more complex topography, increasing the number of cutting planes will increase the accuracy of the solution, and for areas with simple topography or that are outside the city, an optimal solution can be achieved with fewer cutting planes [46]. Therefore, in this paper, the number of cutting planes is selected depending on the studied region, which is investigated in the results section.

It is important to note that in this paper, the cutting plane method was used, and since the alignment is non-backtracking, this method is not suitable for mountainous regions, as they have a length limit and should be backtracked.

5 Modeling Railway Alignments

5.1 Horizontal Alignment Model

The railway horizontal alignment is composed of a series of tangent and horizontal curves. Horizontal curves include transition and circular curves. Transition curves are typically used between the straight alignment (tangent) and the circular curve. This prevents a sudden change in the curve radius, and when travel from the straight alignment to the circular curve occurs, transition curves prevent an increase in lateral acceleration. In railways, the implementation of transition curves has particular importance.

5.2 Horizontal Alignment Model Formulation

Figure 2 shows an example of a horizontal alignment with point of intersection (PIi), circular curves and transition curves. The start and end points of the alignment are shown respectively by S and E. The important points used in the curve are defined in Table 1. It is clear in Fig. 2 that the points \(ST_{i}\) and \(TS_{i + 1}\) are connected to each other by the direct line between \(PI_{i}\) and \(PI_{i + 1}\), point \(TS_{i}\) is connected to \(SC_{i}\) and \(CS_{i}\) to \(ST_{i}\) by a transition curve, and \(SC_{i}\) to \(CS_{i}\) by a circular curve (\(\forall i = 1, \ldots ,n\)).

Fig. 2
figure 2

Horizontal alignment plan [46]

Table 1 Definition of the critical points used in the horizontal curve [46]

If the deviation angle of a PI is zero, then that point contains all points \(TS_{i}\), \(SC_{i}\), \(CS_{i}\), \(ST_{i}\), and \(PI_{i}\).

To formulate the alignment, first, the coordinates of the intersection points are determined on the cutting planes. Then the coordinate positions \(TS_{i}\), \(SC_{i}\), \(CS_{i}\), and \(ST_{i}\) are calculated for (\(\forall i = 1, \ldots ,n\)). Figure 3 shows the details of the transition and circular curves [46].

Fig. 3
figure 3

Geometric properties of a horizontal curve with two clothoid curves and a circular curve [46]

In Fig. 3, AB and CD are connected by a transition curve (clothoid) and BC by a circular curve . The point A (\(TS_{i}\)) is the start of the clothoid and has an infinite radius (mean \(R_{{s_{i} }} = \infty\) in \(TS_{i}\)) and a curve degree of zero. The radius of the transition curve along its length (\(l_{{s_{i} }}\)) decreases slowly until it reaches the radius of the circular curve at point B, which is the end point of the clothoid and the beginning of the circular curve (mean \(R_{{s_{i} }} = R_{{c_{i} }}\) in \(SC_{i}\)). These rules are also applied on the other side of the curve. A complete calculation can be seen in [53].

The point \(TS_{i}\) is the starting point for the clothoid on the line between \(PI_{i - 1}\) and \(PI_{i}\), and the distance between \(PI_{i}\) and \(TS_{i}\) is displayed by \(L_{{TS_{i} }}\). The point \(ST_{i}\) is the starting point of the tangent on the other side of the curve; it is between points \(PI_{i}\) and \(PI_{i + 1}\), and its distance from point \(PI_{i}\) is equal to the length \(L_{{TS_{i} }}\). The next point, which represents the end of the clothoid and the beginning of the circular curve, is represented by \(SC_{i}\). The point \(CS_{i}\) also connects the circular curve to the transition curve (clothoid) in the other direction. In accordance with the equations in the Appendix, the coordinates of the points can be calculated [46].

5.2.1 Condition for Establishing a Transition Curve

As seen in Fig. 3, the conditions for establishing the connecting curve are as follows:

$$\theta_{{PI_{i} }} \ge 2 \times \theta_{{ST_{i} }}$$
(10)

\(\theta_{{PI_{i} }}\): deviation angle of main tangents for each \(PI_{i}\), and \(\theta_{{ST_{i} }}\): deviation angle of clothoid \(\theta_{{ST_{i} }} = \frac{{L_{{TS_{i} }} }}{{2R_{{C_{i} }} }}\)

If this condition is not met, the curve cannot be fitted with geometric specifications. In this paper, the algorithm for horizontal curves is implemented in such a way that a circular curve with a large radius is used instead of the curve with the clothoid-circle-clothoid properties. In such a situation where the alignment has a geometric problem, a circular curve with a radius greater than 3000 m is used, in which there is no need to apply the superelevation for the railway alignment. Because of the lack of cant, no further use of clothoid is required.

5.3 Determining the Vertical Cutting Plane

In order to achieve three-dimensional alignment, a vertical plane is assumed on a cutting plane which allows the generation of three-dimensional alignments. In this paper, these vertical planes are limited to the maximum and minimum possible height in its top and bottom and search is performed in this range. Figure 5 shows the HZ diagram of an alignment, whose horizontal axis represents the length of the alignment and vertical axis represents the alignment height. In this graph H is the length of the alignment and Z is the altitude (height) [43]. As shown in Fig. 4, in this paper, the vertical curve on the alignment is used from the circular curve midpoint. The algorithm checks that the vertical curves are not located on the horizontal transition curves, and if this happens, the model will reduce the vertical curve length to overlap only the vertical curve with the horizontal circular curves. The coordinates of this point are determined by the following equation on the horizontal alignment:

$$VPI_{i} = \left[ {\begin{array}{*{20}c} {x_{{V_{i} }} } \\ {y_{{V_{i} }} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {x_{{\delta_{i} }} } \\ {y_{{\delta_{i} }} } \\ \end{array} } \right] + R_{i} \times \frac{{PI_{i} - \delta_{i} }}{{\left\| {PI_{i} - \delta_{i} } \right\|}}$$
(11)

where \(\left\{ {\begin{array}{*{20}c} {x_{{\delta_{i} }} } \\ {y_{{\delta_{i} }} } \\ \end{array} } \right\}\) corresponds to the coordinates of the circular curve center.

Fig. 4
figure 4

Geometric relationship of the reference points for designing the vertical curve on the alignment plan

At points \(VPI_{i} , \ldots ,VPI_{n + 1}\) the vertical curve is braced to make the alignment smoother. The coordinates of points \(VPI_{0}\) and \(VPI_{n + 1}\) are the coordinates of the points at the beginning and the end of the alignment, respectively. Therefore, the length of the horizontal alignment to point \(VPI_{i}\) must be calculated for each point to determine the horizontal axis \(VPI_{i}\) in the longitudinal profile (vertical alignment).

6 Basic Model Formulation

The objective function of this problem is a total cost function (\(C_{T}\)) comprising nine major components: environmental costs (\(C_{N}\)), earthwork costs (\(C_{E}\)), length-dependent costs (\(C_{L}\)), track maintenance costs (\(C_{M}\)), bridge- and tunnel-dependent costs (\(C_{B}\)), hydrology and hydrologic-dependent costs (\(C_{H}\)), penalty for violating the minimum horizontal curve radius (\(C_{R}\)), penalty for violating the minimum vertical curve length (\(C_{V}\)), penalty for violating the maximum gradient of the alignment (\(C_{G}\)). Therefore, a basic formulation for minimizing the total cost of railway alignments can be expressed as follows:

$$C_{T} ={\text{Minimize}\;( C_{N} + C_{E} + C_{L} + C_{M} + C_{B} + C_{H} + C_{R} + C_{V} + C_{G})}$$
(12)
$$L_{i} \le d_{i} \le U_{i} ,\;L^{'}_{i} \le Z_{i} \le U^{'}_{i} \;{\text{for}}\;{\text{all}}\;i = 1,2,3, \ldots ,n_{PI}$$
(12a)
$$R_{i} \le R_{\hbox{min} } ,\;L_{i} \le L_{\hbox{min} } ,\;g_{i} \le g_{\hbox{min} } \;{\text{for}}\;{\text{all}}\;i = 1,2,3, \ldots ,n_{PI}$$
(12b)

\(R_{i} ,L_{i} \,{\text{and}}\,g_{i}\): based on the corresponding calculations obtained in the model. \(R_{\hbox{min} } ,L_{\hbox{min} } \,{\text{and}}\,g_{\hbox{min} }\): the calculations are presented in the previous sections.

The functions are fully described in Sect. 3.

7 Case Studies

In this part of the paper, three examples are discussed. The first example is hypothesized to validate the model. In the second and third examples, real cases using topographic data obtained from maps of 1/25,000 of a region between the cities of Isfahan and Shahreza in Isfahan province are considered, with two different points at the beginning and the end.

7.1 Design Parameters and Constraints Considered to Solve Examples

In the proposed model, three main constraints regarding the geometric design of the railway alignment are considered and are described, and explanations are provided as to how to deal with these constraints. In each of the three examples, the proposed railway track has a design specification in accordance with Table 2.

Table 2 Railway design assumptions

The distance between the stations is considered 50 m to calculate the earthwork volume.

7.2 Parameters Considered for the Problem-Solving Algorithm

To use the problem-solving algorithm that is fully described in Chapter 5, the parameters in Table 3 are used. It should be noted that in this paper, each of the alignments is considered a particle, and the initial solutions were produced randomly. The program’s stop requirement is set to be 100 repetitions.

Table 3 The constant parameters of the PSO algorithms

7.3 Number of Cutting Planes

In the alignment optimization problem, the number of cutting planes [representing the number of points of intersection (PIs) pathway] can vary for different regions. For example, for urban areas that have many complexities (the urban train alignment optimization problem), an increased number of cutting planes should be considered in order to obtain better results, but for suburban regions, this number can be smaller given the lower complexity (for example, the problem of optimizing the alignment of suburban railways).

As the number of points of intersection (and hence the number of cutting planes) increases, the calculation time increases. In each of the three examples, the number of cutting planes was considered for several different conditions and the solutions were compared. In order to make the design more realistic, these unit costs are based on the price list for the technical structure of the road and railways in 2014. In the following sections, the results and outputs obtained from the hypothetical example are first examined, and then the results of the second and third examples are presented as case studies of the Isfahan-Shahreza area.

7.4 The First Example

The study area is assumed to be a hypothetical domain as shown in Fig. 5. To investigate the model performance, the area is designed with a variety of restrictions and has two hills and one lake. The map dimensions in the east–west (EW) and north–south (NS) directions are equal to 10,800 and 8700 m, respectively. The origin coordinates in the lower left-hand side of the map are assumed to be (x = 0, y = 0).

Fig. 5
figure 5

Control points on HZ profile [43]

In this case, the positions of the first station and the last station are shown in Fig. 6. Cell dimensions are considered for calculating the costs mentioned in Chapter 3. These dimensions are considered to be 5 m in the first example and 10 m in the second and third examples in the transverse and longitudinal directions.

Fig. 6
figure 6

Horizontal alignments with different numbers of cutting planes in Example 1

Because of the importance of the number of cutting planes in solving the alignment optimization problem, we first attempted to evaluate the effect of the number of cutting planes. As previously mentioned, increasing the number of cutting planes increases the horizontal and vertical curves and increases the solving time. Here, four different numbers of cutting planes (2, 3, 4, and 5) are used. In Fig. 6, the plan with the considered alignments is displayed. Fig. 7 shows the vertical alignment. As expected, the alignments generated for different modes differ from one another due to the differences in the number of cutting planes (and thus the number of horizontal and vertical curves). The comparison of the alignments, as expected, shows that the alignment from the application of five cutting planes has a lower cost than the alignments produced with the lower cutting line. The profiles of the above alignments are presented in Table 4.

Fig. 7
figure 7

The vertical alignments with different numbers of cutting planes in Example 1

Table 4 Comparison of alignment cost in Example 1

7.4.1 Sensitivity Analysis of Model Parameters

In this section, sensitivity analysis of the parameters used in the objective function is carried out. In all of these analyses, the alignments are constructed by assuming five cutting planes.

Two scenarios were designed to analyze the model performance. In the first scenario, all costs except the cost of earthwork, bridge, and tunnel are considered, and in the second scenario, the earthwork cost is added to the model to be evaluated.

7.4.1.1 Scenario 1: Solving the Model Taking into Account the Length-Dependent Costs (All Costs Except Costs Related to the Volume of Earthwork, Bridges, and Tunnels)

In this case, the model provides an alignment regardless of the cost of the earthwork, bridges ,and tunnels. Specifically, the final solution is a straight line that connects the origin and destination, and of course, all of the alignment restrictions are followed, and that is what was expected. Figure 8 shows the horizontal alignment and Fig. 9 shows the vertical alignment.

Fig. 8
figure 8

Horizontal alignment for Scenario 1, Example 1

Fig. 9
figure 9

Vertical alignment for Scenario 1, Example 1

7.4.1.2 Scenario 2: Solving the Model with All Costs Without the Possibility of Having a Bridge or Tunnel

In this scenario, since the model lacks the exploration of the bridge and tunnel option, it is expected that the optimal alignment will make detours around hills and lakes to avoid a high volume of earthwork. It should be noted that in this model, due to the lack of technical structures of the bridge and tunnel, the maximum altitude for earthwork is not considered, and the model assumes that the alignment can pass through the river and the lake at the embankment. As expected, the alignment tries to cross an area that is smaller in width than the rest of the river, and it is assumed that the river connected to the lake can be filled with soil and at a single cost such as drought. This is just a matter of sensitivity analysis, and it is clear that the result will not be an acceptable alignment.

In this example, the maximum slope is 0.5%. Figure 10 shows the map of the resulting alignment from the implementation of the model, and Fig. 11 shows the vertical alignment. As expected, the proposed alignment also detours around the mountain and the lake to avoid earthwork costs.

Fig. 10
figure 10

Horizontal alignment for Scenario 2, Example 1

Fig. 11
figure 11

Vertical alignment for Scenario 2, Example 1

7.5 The Second Example

The region selected as the study area in Example 2 is an area of almost all plain and hillside near the city of Isfahan, as shown in Fig. 12. The origin of the map is equal to (x = 559,081.537, y = 3,540,762.092). The area in the EW and NS direction is 23,270 m and 27,595 m respectively. In this example, the positions of the beginning of the alignment (first station) and the end of the alignment (the last station) are shown in Fig. 13.

Fig. 12
figure 12

The study area in Example 2

Fig. 13
figure 13

Horizontal alignments for different numbers of cutting planes in Example 2

In this example, the model is executed for the four different modes, with 11, 13, 15, and 17 cutting planes. The plan for the resulting alignments is displayed in Fig. 13. As expected, the alignments generated for different modes vary slightly due to the differences in the number of cutting planes (and consequently the number of horizontal and vertical curves). Figure 13 shows the horizontal alignments, and the vertical alignments are given in Fig. 14. The cost of these alignments is presented in Table 5. As expected, the alignment generated for the largest number of cutting planes (17 cutting planes) has the lowest cost.

Fig. 14
figure 14

The vertical alignments with the different numbers of cutting planes in Example 2

Table 5 Comparison of alignment costs in Example 2

7.6 The Third Example

The study area for Example 3 includes the region in the second example and its surroundings south of Isfahan province and north of Shahreza. The area was selected to include the Isfahan and Shahreza railway stations, in order to compare the alignment produced by the model with the current alignment of the Isfahan–Shahreza railway. This region, as previously mentioned, is almost all plain and hill-like terrain, and is shown in Fig. 15. The origin of the map is equal to (x = 589,081.537, y = 3,540,762.092). The length of the area in the EW and NS direction is 35,225 and 41,300 m, respectively. The coordinates of the first station are equal to (x = 579,069.785, y = 550,198.34, z = 1845.5), and the last station coordinates are equal to (x = 579,069.785, y = 3,581,720.48, z = 1680). The alignment production by the model with different numbers of cutting planes showed that the alignment obtained with the most cutting planes (17) is the best alignment, as was also the case in Example 2. Horizontal and vertical alignments are displayed in Figs. 16 and 17, respectively. The cost of these alignments is presented in Table 6.

Fig. 15
figure 15

The study area in Example 3

Fig. 16
figure 16

Horizontal alignments with different numbers of cutting planes in Example 3

Fig. 17
figure 17

Vertical alignments with different numbers of cutting planes in Example 2

Table 6 Comparison of alignment costs in Example 3

The track between the two cities of Isfahan and Shahreza is also shown in yellow. As we can see, the alignment obtained according to the proposed model differs from the existing alignment. Due to the inaccessibility of the longitudinal profile of the existing alignment and the impossibility of calculating the volume of earthwork or the number of bridges and tunnels along the alignment, a comparison of the alignment costs obtained in this paper with the existing alignment was limited to the length of the alignment and its corridor. According to Google Earth, the length of the existing alignment is approximately 50 km. Therefore, the present study is only able to compare the passing location and the alignment length with that discussed for this model. It should be noted that the final alignment in the model is shorter than the existing alignment.

8 Discussion

In this work, the first example was hypothetical and meant to validate the model. The second example was evaluated based on real topography, and finally, the third example was a case study of the region between Shahreza and Isfahan.

The computer system used to run the model has the following characteristics.

  • Processor: Intel® Core™ i7 CPU

  • RAM: 8 GB

  • System type: 64-bit operating system

A period of approximately 6 hours was needed to run the largest problems in this paper with the above-mentioned computer setup.

In each example, a different number of cutting planes (with different values) was used in this model. As expected, it was shown that the model provided different solutions by changing the number of orthogonal cutting planes. Due to the high geometrical constraints of railway alignments, it is important to include bridges and tunnels in the model. Using transition curves for the railway alignment plays a very important role in avoiding abrupt changes in radii of alignments and increased lateral acceleration when trains approach curves from a straight alignment.

9 Conclusion

This paper presented a railway alignment optimization model in which the sensitivity costs of alignments considering their geometric characteristics were included. Also, the solutions obtained were applicable in real-world scenarios. In this model, particle swarm optimization was used. The highlights of this paper can be noted as follows:

  1. 1.

    Three-dimensional optimization considering the transition curve on the horizontal alignment

  2. 2.

    Considering the possibility of constructing bridges and tunnels on the railway alignment

  3. 3.

    Considering the different characteristics of the railway alignment design to find the alignment that is most applicable

  4. 4.

    Improving the cost function used in previous studies and modifying simplifications that reduced the accuracy of the calculations

  5. 5.

    Handling data in a geographic information system

  6. 6.

    Using particle swarm optimization in railway alignment optimization.