1 Introduction

The bus rapid transit (BRT) system also known as Transitway or Metro is being used in different parts of the world as a public transportation system. It is reliable in terms of its capacity, time efficiency, and affordability, as compared to that of the conventional bus system. For several years, the urban rail transit system has remained the only system to efficiently tackle the emerging transport problems in high urban areas; however, the BRT systems have outshined it in terms of construction, operation and maintenance cost of the system, the time required to develop the system, greater flexibility, and the comparatively high throughput capacity [1]. Another study is conducted by developing a model to contrast BRT, light rail, and heavy rail system, and it suggested that the high standard BRT is the most cost-efficient system in terms of users’ and operators’ cost, while the rest can only be superior if the operating speed kept faster than the BRT [2]. Thus, for the ever-increasing urban population, the BRT system appears to be a quite useful mode of transport in the future’s aspect due to its merits over other modes of transport.

A very important and key component in the designing phase of the BRT system is the determination of the density and the locations of the stations, along with the intended route, where the facility has to be provided. The density and the locations of the BRT stations play a crucial part in determining the accessibility of the BRT system, whereas the accessibility factor is very important to be considered, as the efficiency and the Level of Service (LOS) of the BRT system primarily depends on the accessibility [3]. Accessibility for the passengers can be improved by increasing the number of stations; however, it would possibly increase the delays due to the excessive accelerations and decelerations at all stations. These additional delays would eventually affect the total in-vehicle time as well as the operator’s cost due to the requirement of additional buses to serve every station [4].

Thus, the objective of this study is to provide with a complete framework that is useful in determining the density and locations of the BRT stations by optimizing the users’ and operator’s cost. The user’s cost composed of users’ in-vehicle cost is mainly depending on the time users spend in the vehicle and the value associated with that time. To minimize this cost, there should be a minimum, collective in-vehicle time spent by the users. Similarly, the users’ access cost is also a part of the user’s cost and it depends on the time users required to reach the BRT system and the value associated with that time. This time should be as minimum as possible in order to minimize the users’ access cost. Lastly, the operator’s cost fundamentally depends on the fleet size that should involve the minimum optimal number of buses to avoid the soaring in the total cost.

Similar work has been carried out by Chien and Qin [3], who developed and optimized the mathematical model using the genetic algorithm (GA). The GA can optimize both continuous and discrete functions as well as multi-objective problems. However, besides advantages, one major disadvantage of GA is that an unfavorable choice of GA parameters might affect the outcome of the application. The choice of vital GA parameters such as crossover and rate of mutation as well as selection criteria of the new population should be carried out carefully. Any inappropriate choice of these parameters will make it difficult for GA to converge or it will simply produce meaningless outcomes [5, 6]. Inspired from the work done by Chien and Qin [3], in our paper, we have modified the total cost function and determined the optimal BRT stations’ density and locations along the service corridor. The BRT operating in-vehicle cost is modified and the BRT personal and maintenance cost is embedded into it. Addition of a new station on BRT service corridor may considerably affect the personal and administrative cost and influence the cost at operator’s end. Similarly, number of stations on the service corridor causes buses to accelerate and decelerate, which has influence on the maintenance of bus. Moreover, we have also used three different evolutionary algorithms (EA) which are particle swarm optimization (PSO), differential evolution (DE), and GA for the optimization of total cost function. In contrast to the previous study, a comprehensive sensitivity analysis is done for in-depth analysis of various independent variables used in the total cost function, also, the framework provides with the single optimal solution against the particular number of stations as compared to the multiple combinations presented in the previous study. Consequently, these advancements result in developing the new framework that is simple, efficient, and scientifically reliable in policy making.

EAs which have been used for optimization problems now became very famous among most of the researchers in the recent past decades. These algorithms have been applied to many engineering and applied sciences fields for finding out the optimized solutions due to their simple framework and applicability. Amidst the various techniques proposed, the three algorithms that are very similar and famous are DE, GA, and PSO. As the genetic algorithm is most conformist and well established among the other due to its earlier introduction [7], relatively recent DE and PSO became widely known due to their ability for finding out the optimized solutions for continuous and discrete problems. GA is a population-based meta-heuristic optimization technique which employs a mechanism that is inspired by the living organisms like the processes of selection, reproduction, and mutation, which works on the principle of “survival of the fittest” [8].

Almost all the EAs share the relatively same processes and operations. There are three main operation and processes in all the EAs, where the first step is the initialization in which the randomly generated initial population of individuals is produced with respect to some specified solution representation, as solution representation is the most critical part in any evolutionary algorithm that in which way it should be represented. It should be represented with respect to the elements of some specific evolutionary method as it is responsible for producing the feasible solution. If the solution representation is not done in a good way, then it may lead to an infeasible solution. Besides solution representation, two more critical parameters must be taken into account before getting into the program (i.e., size of the population and the maximum number of iterations), It should be determined initially, as these two parameters have a great influence on solution’s time and quality. After the initialization, the next step is to evaluate each solution present in the population with respect to the fitness values. The purpose of evaluating the solution is to find out the average fitness population or to rank each solution in the population for the sake of selection. At last, the generation of the new population is created using perturbation of solutions in the current population. Figure 1 shows these three processes of the EA. For a novel comprehensive discussion of EA, see [9, 10].

Fig. 1
figure 1

Flowchart representing the basic steps for evolutionary algorithms

To illustrate the EA operations as shown in Fig. 1, the steps for basic EA are listed below:

  1. 1.

    Generating the initial population.

  2. 2.

    Evaluating individual fitness values

  3. 3.

    Check that either all the stopping criteria met or not? If yes, then the program will be stopped and the required solution is accomplished. If it is no, then it will go to the next step.

  4. 4.

    Generating the new population and go up for evaluating the fitness values. This loop will continue to run until all the required stopping criterion is met.

Many researchers have successfully employed EAs in the field of transportation engineering, Saeidi [11] worked on improving the efficiency of the public transportation system by optimizing the routes using the GA, Koh [12] used DE in the field of transportation planning for solving bi-level programming problems. Wu et al. [13] comprehensively reviewed the applications of PSO in the railway engineering domain. It was concluded that the PSO has seen ever-increasing applications in the field of railway engineering, whereas network layout planning, scheduling, and active controls are the main research areas. Moreover, many researchers claimed that PSO is a viable method and its computational efficiency is better than GA and DE [14,15,16,17]. Also, there is a cluster of studies that used PSO in solving the BRT route optimization problem and the Transportation Network Design Problems (TNDP) in high-density urban areas [18,19,20,21]. Many studies focused on the bus stations’ spacing in urban areas. Saka [22] proposed a model to optimize the bus stations’ spacing and concluded that right spacing of the bus stations can cause a reduction in the headway and travel time which would ultimately create an impact in lowering the operator’s cost. Moreover, the optimized spacing of the bus stations results in a smaller number of buses in the fleet which reduces the operator’s cost. Moura et al. [23] presented a two-stage model to find the optimal locations of the bus stations. At the first stage, the associated cost with the system was minimized by strategically locating the bus stations, while the second stage maximized the operating speed by tactically locating the bus stations. Thus, concluded that the locations of the bus station influence the commercial operating speed of the buses. Ceder et al. [24] designed a model to optimize the bus stop locations in a given route for uneven topography. Some other studies also carried out particularly focusing on urban areas [25, 26].

Besides presenting the models and solutions to the station spacing problem, numerous researchers also studied the relationship between stations’ spacing and influencing parameters, for instance, headway and speed. Chien et al. [27] specifically studied the relationship between bus headway and the spacing of the bus station. They developed the mathematical model and have taken the travel time of users as an objective function. It is also important to note that a realistic wait time was considered during the study. It was observed that there is an inverse relationship between the fleet size and the optimal headway & stations’ spacing, while there is a direct relationship between passenger demand and travel time. Chang and Schonfeld [28] also worked on the optimization of headway in their study and developed the analytic model for optimizing the BRT. Apart from headway, Tirachini [29] conducted a comprehensive study on the relationship between the bus operating speed and bus stations’ spacing. He concluded that if the bus operating speed is constant and the passenger’s demand is increasing then there should be decreased spacing among the bus stations, while on the other hand if the bus operating speed is increasing then the bus stations should be spaced at large distances despite the rise in demand.

There are several studies where the researchers efficiently used various tools and techniques to undergo the study on optimal stations’ spacing problem. Dell'Olio [30] proposed a model that can locate the bus stations and carry out the optimization of bus frequencies by taking into account the cost pertaining to the construction of the bus stations, services’ provision, and operation of the bus system. Two levels are defined, the first level is about the systems’ cost and the other is about the behavior of the user considering the public transport assignment model. The model reduced the access, travel, and wait times of the users, while on the operator’s end, it was noted that the good services were provided with the small increase in the cost of operation. The model was also applied to a case which shows that if the practical situation criteria are to be considered then there is less cost saving as compared to considering the scientific criteria of the applied model. Overall, the model showed satisfactory results when applied to practical problems. Li and Bertini [31] considered two cost components: the first one is passengers access cost and second is the in-vehicle passenger stopping cost using the high-resolution archived stop-level data and used in the model to find the optimal spacing of bus stations. Furth and Rahbee [32] used geographic modeling and dynamic programming approach to find the optimal location and spacing of the bus stations. Furth et al. [33] have done an improved analysis of bus stations’ spacing by using the Geographic Information System (GIS).

The notations to be used throughout our paper are enlisted in Table 1. The forthcoming sections are enumerated as follows: The description of the BRT service line is stated in Sect. 2, whereas Sect. 3 explains the model formulation and preparation of total cost function. Then, the concept and application of DE, GA, and PSO are explained in Sect. 4. Then, the computational experiments, i.e., the designed numerical example and sensitivity analysis are presented, and subsequently, the conclusion is summarized in the last section of this paper.

Table 1 Variable definitions

2 Description of BRT Service Corridor

Figure 2 illustrates the configuration of the BRT service corridor. The transit bus can be provided at the desired routes as the figure shows that there are several access points to which the service corridor can be connected. To locate any access point at the service line, the first access point is taken as a benchmark, thus the distances of all the access points are considered with respect to the first access point as represented in Fig. 2.

Fig. 2
figure 2

Configuration of the BRT service line with “f” access points and “e” number of stations

3 Cost Function Formulation

The development of a cost function is discussed in this section. Few assumptions are made in order to support the formulation process and the framework. Following are enumerated the assumptions that are taken into account while developing the mathematical model and framework:

3.1 Assumptions

  1. 1.

    There can be no more than one bus station located between the two consecutive access points, whereas if the minimum cost is coming against the number of stations that are equal to the number of access points, i.e., \(e = f\), then all the BRT stations will be located exactly at the access points. In such a case, the users’ access distance would become zero and so the users’ access cost.

  2. 2.

    Users will always use the nearest bus station from the concerned access point; thus, the access cost can be determined as the ratio of access distance to the nearest station and the commuter walking speed.

  3. 3.

    Buses are not skipping any station and serving each station; hence, the acceleration and deceleration delays are assumed to be the same at all stations. Moreover, the bus headway is also assumed to be constant and the wait time is assumed to be half of the headway. Thus, the wait time does not affect the optimization and \(E_{d}\), the wait cost is not considered in the total cost function.

  4. 4.

    A fixed BRT service corridor with an elevated signal-free corridor is considered, whereas the demand can only access it from the access points. The boarding and alighting demand are distributed uniformly over a time period, but this demand can be different for each access point.

  5. 5.

    The commuters’ demand coming from the access point \(k\) in the direction \(x\), is known as the boarding demand in direction \(x\) at the access point \(k\) and denoted as \(a_{xk}\), while the commuters’ demand bounded for the access point \(k\) in the direction \(x\), is known as alighting demand in direction \(x\) at access point \(k\) denoted as \(d_{xk}\). Moreover, commuter demand in both directions is considered to be identical, so \(a_{1k}\) in direction 1 is equal to the \(d_{2k}\) in direction 2. This assumption is taken into consideration so that the optimal density and locations of the stations would remain similar for both service direction, otherwise, it could be neglected but the results for both directions would be different.

  6. 6.

    To estimate the user cost which is a nonlinear function of time, a quadratic function of time is assumed to estimate the user cost. Let’s assume that, if the user travel time is \(t\), the user cost would be \(t^{2}\) multiplied by the value of time and the commuters’ boarding and alighting demand.

3.2 The Total Cost Function \(\left( {E_{{{\text{TC}}}} } \right)\)

The total cost function is the sum of all costs, and this is our objective function that is to be minimized to get the optimal density and locations of the BRT stations. The BRT system is associated with the service providers, i.e., the operator, and the service utilizers, i.e., the users, and both are an integral part of any BRT system. The operating cost is incurred by the parameters, for example, consumption of fuel, and the maintenance of the bus fleet. It is worth noting that the density and location of stations affect the operators’ cost as the non-optimized number of stations can increase the acceleration and deceleration delays hence can also affect the extra fuel consumption due to additional buses required to fulfill the requirement. On the other hand, stations’ spacing and locations, proportionally influence the riding and access time of users. If the number of stations increases, the users’ average access time decreases and if the number of stations decreased, the user riding time decreases, whereas there is a cost associated with both vital times, in terms of the values of users’ access time and riding time.

Therefore, to make a trade-off between the interest of users and operators, we need to find an optimum cost that alleviates the costs associated with both parties. Thus, an optimal number of stations is found out by minimizing the objective function comprising of users’ and operators’ cost. Numerous researchers in the past studies have also considered the users’ and operators’ cost as an objective function [34,35,36]. The breakdown of the total cost function is illustrated in Fig. 3.

Fig. 3
figure 3

Components of the total cost function

3.2.1 Operator’s Cost \(\left( {E_{{{\text{OC}}}} } \right)\)

It is the cost related to the service provider and basically the sum of all bus operation costs, i.e., bus operating in-vehicle cost, bus maintenance, and personal costs.

Bus Operating In-Vehicle Cost \(\left( {E_{{\text{O-inc}}} } \right)\)

It depends on the fleet size and the operating cost of the bus. The total bus operating in-vehicle cost is basically the product of the fleet size, \(\left( C \right)\) and in-vehicle operating cost per vehicle \(\left( {O_{{\text{B}}} } \right),\) i.e.,

$$E_{{\text{O-inc}}} = CO_{{\text{B}}}.$$
(1)

The bus fleet size can be obtained through the ratio of round-trip time to the bus headway \(\left( {B_{{\text{h}}} } \right)\). The round time of bus consists of the travel time \(\left( {T_{{\text{s}}} } \right)\) along the service corridor and the layover time \(\left( {t_{{\text{l}}} } \right)\) at each station. To formulate the numerical expression for fleet size, the equation derived by Chien [37] is applied. Thus:

$$C = \frac{{2\left( {T_{{\text{s}}} + \sum\nolimits_{i = 1}^{e} {t_{{\text{l}}} } } \right)}}{{B_{{\text{h}}} }},$$
(2)

where travel time \(\left( {T_{{\text{s}}} } \right)\) is function of travel distance and the bus operating speed \(\left( {\overline{{v_{{{\text{os}}}} }} } \right)\). Thus, it can be calculated as:

$$T_{{\text{s}}} = \frac{{\sum\nolimits_{i = 1}^{e} {\left( {h_{l} - h_{l - 1} } \right)} }}{{\overline{{v_{{{\text{os}}}} }} }},$$
(3)

where \(h_{l}\) and \(h_{l - 1}\) represent the distance of station l from the first access point, and the distance of the station, previous to the station \(l\), from the first access point, respectively. Thus, the final expression to calculate the in-vehicle operation cost is represented by Eq. (4).

$$E_{{\text{O-inc}}} = \frac{{2O_{{\text{B}}} \left[ {\left\{ {\frac{{\sum\limits_{i = 1}^{e} {\left( {h_{l} - h_{l - 1} } \right)} }}{{\overline{{v_{{{\text{os}}}} }} }}} \right\} + \sum\limits_{i = 1}^{e} {t_{{\text{l}}} } } \right]}}{{B_{{\text{h}}} }}.$$
(4)

BRT Personal and Maintenance Cost \(\left( {E_{{\text{O-mpc}}} } \right)\)

The bus personal and maintenance cost \(\left( {E_{{\text{O-mpc}}} } \right)\) constitute maintenance, repair and tire costs of buses as well as drivers and administrative cost. This cost basically depends on the round-trip distance (two times the total length of the service corridor) and the bus fleet size. The dwell time of buses at each station has an effect on personal cost, therefore, total dwell time as well as boarding and alighting demand at each station is also incorporated in bus maintenance and personal cost and can be written as Eq. (5)

$$E_{{\text{O-mpc}}} = 2O_{{{\text{mpc}}}} \left[ {\left( {B_{{\text{f}}} z_{{\text{l}}} } \right) + \sum\limits_{k = 1}^{f} {\left\{ {\left( {a_{xk} + d_{xk} } \right)T_{b} } \right\}} } \right].$$
(5)

3.2.2 User’s Cost \(\left( {E_{{{\text{UC}}}} } \right)\)

The user’s cost \(\left( {E_{{{\text{UC}}}} } \right)\) is the cost that is induced by the transit patrons using the BRT service. It is the sum of the two constituent costs, i.e., user’s access and in-vehicle cost, and can be represented as \(E_{{\text{u-ac}}}\) and \(E_{{\text{u-inv}}}\), respectively.

$$E_{{{\text{UC}}}} = E_{{\text{u-ac}}} + E_{{\text{u-inv}}}.$$
(6)

We use the numerical expressions developed by Chien and Qin [3] to determine the total users’ cost as mentioned in Eq. (6).

Users’ Access Cost \(\left( {E_{{\text{u-ac}}} } \right)\)

The users’ access cost is basically the expense, which is imposed on commuters using the bus transit system. The commuters who have access to the transit stations mainly incur the access cost. It is the cost associated with the time of accessing the bus stations from the access points, hence it can be obtained as the access time of the commuters, \(i_{tk}\), multiplied with the value of access time of commuters, \(V_{i}\). Numerically, it can be estimated by using Eq. (7)

$$E_{{\text{u-ac}}} = 2V_{i} \sum\limits_{k = 1}^{f} {\left[ {\left( {a_{xk} + d_{xk} } \right)i_{tk}^{2} } \right]}.$$
(7)

As per assumption 2, the commuters will go to the nearest station from the particular access point. So, the user’s access time,\(i_{tk}\), can be calculated from Eq. (8):

$$i_{tk} = \frac{{\min \left[ {\left| {s_{k - 1} - h_{1} } \right|, \ldots ,\left| {s_{k - 1} - h_{{\text{e}}} } \right|} \right]}}{{p_{{\text{s}}} }},$$
(8)

where \(s_{k - 1}\) is the distance of the access point \(k\) to the first access point. The equation shows that access time is the ratio of distance to the nearest bus station from the access point \(k\) and the commuter walking speed.

Users’ In-Vehicle Cost \(\left( {E_{{\text{u-inv}}} } \right)\)

Users’ in-vehicle cost is incurred by the time users spend in the vehicle, the value associated with that and the total demand. It is the product of the aforementioned parameters. It consists of two costs components:

$$E_{{\text{u-inv}}} = E_{{m_{1} }} + E_{{m_{2} }}.$$
(9)

If the extension is to be made in an existing BRT system then the first component, \(E_{{m_{1} }}\) is used. It represents the in-vehicle cost incurred by through flow in direction \(x\),\(M_{x}\) and it can be determined by using Eq. (10). Moreover, in this scenario, \(M_{x}\) is to be determined beforehand, while for a new BRT system, its value is zero and the cost component would consist of:\(E_{{m_{2} }}\) only. \(E_{{m_{2} }}\) represents the cost incurred by the commuters that are boarding and alighting along the new route.

$$E_{{m_{1} }} = 2V_{m} M_{x} \left( {T_{a} + T_{b} } \right)^{2}.$$
(10)

The total acceleration/deceleration delay, \(T_{a}\) can be determined using Eq. (11)

$$T_{a} = ew_{t}.$$
(11)

In Eq. (11), \(e\) represents the number of stations, and acceleration/deceleration time at a single station,\(w_{t}\) can be calculated by using Eq. (12) derived by Chien [38]. Therefore,

$$w_{t} = \frac{{\overline{{v_{os} }} }}{{2v_{a} }} + \frac{{\overline{{v_{os} }} }}{{2v_{b} }}.$$
(12)

In Eq. (10), total dwell time, \(T_{b}\) depends on, boarding and alighting commuters on new stations, \(H_{da}\), and average boarding and alighting time per commuter, \(\overline{{w_{da} }}\). \(T_{b}\) can be determined by using Eq. (13):

$$T_{b} = H_{da} \overline{{w_{da} }}.$$
(13)

In Eq. (13), \(H_{da}\) can be determined by using Eq. (14) as:

$$H_{da} = B_{{\text{h}}} \sum\limits_{k = 1}^{f} {\left( {a_{xk} + d_{xk} } \right)}.$$
(14)

From \(T_{a}\) and \(T_{b}\), the size of the fleet, required to serve the demands for new bus stations can be determined using Eq. (15):

$$\frac{{2\left( {T_{a} + T_{b} } \right)}}{{B_{{\text{h}}} }}.$$
(15)

Subsequently, for determining the second component of the total users’ in-vehicle cost \(\left( {E_{{m_{2} }} } \right)\), the service line is divide into three segments in terms of the service corridors, each segment is contributing its cost that is resulting in making the respective costs \(E_{{m_{21} }}\), \(E_{{m_{22} }}\) and \(E_{{m_{23} }}\) as represented in Eq. (16). The entire service line with \(f\) access points can be divided into the total number of stations plus one, i.e., \(e + 1\) service corridors. Thus, \(E_{{m_{21} }}\) is the round-trip users’ in-vehicle cost occurring on the first segment that is composed of service corridor 1, where service corridor 1 is for serving the demand from the first access point to the first station.

$$E_{{m_{2} }} = E_{{m_{21} }} + E_{{m_{22} }} + E_{{m_{23} }}.$$
(16)

\(E_{{m_{21} }}\) can be determined by using Eq. (17):

$$E_{{m_{21} }} = 2V_{m} \left( {\partial M_{x} + D_{1} } \right)t_{1}^{2},$$
(17)

where \(E_{{m_{21} }}\) is the product of the value of in-vehicle time, \(V_{m}\) the weighted round-trip travel time on the service corridor \(z\),\(2t_{1}^{2}\), and the updated or increased hourly demand that is \(\partial M_{x} + D_{1}\). The travel time on the service corridor \(z\) and the increased hourly demand can be determined by using Eqs. (18) and (19).

$$\partial M_{x} + D_{1} = \sum\limits_{k = 1}^{f} {d_{xk} }$$
(18)
$$t_{1} = \frac{{z_{1} }}{{\overline{{v_{{{\text{os}}}} }} }} + \frac{{\overline{{v_{{{\text{os}}}} }} }}{{2v_{b} }},$$
(19)

where \(z_{1}\) is the distance of the first bus station to the first access point and it is equal to \(h_{1}\). For \(i \ge 2\), \(z_{i} = h_{i} - h_{i - 1}\). Now, \(E_{{m_{22} }}\) is the round-trip user in-vehicle cost occurring on the second segment of the BRT service line. It comprises all the service corridors between the first and the last service corridor, i.e.,\(2 \le z \le e\), the service corridor \(z\) connects stations \(z - 1\) and \(z\). The value \(E_{{m_{22} }}\) can be determined by using Eq. (20):

$$E_{{m_{22} }} = 2V_{m} \sum\limits_{z = 2}^{e} {\left( {D_{z} t_{z}^{2} } \right)},$$
(20)

where the through demand for the service corridor \(z\), \(D_{z}\), can be obtained by Eq. (21):

$$D_{z} = \left( {\partial M_{x} + D_{1} } \right) + \sum\limits_{k = 1}^{{N_{z} }} {\left( {a_{xk} - d_{xk} } \right)},$$
(21)

where the total travel time on the service corridor \(z\) is represented by Eq. (22)

$$t_{z} = \frac{{z_{{\text{l}}} }}{{\overline{{v_{{{\text{os}}}} }} }} + \left( {\frac{{\overline{{v_{{{\text{os}}}} }} }}{{2v_{a} }} + \frac{{\overline{{v_{{{\text{os}}}} }} }}{{2v_{b} }}} \right),$$
(22)

where \(z_{{\text{l}}}\) represents the length of the service corridor \(z\). It is measured from the station \(z - 1\) to station \(z\). For all the service corridors falling under the segment two, acceleration and deceleration delays are considered as shown in Eq. (22). The third and the last segment is composed of only one service corridor that is the last: (\(e + 1\)). Now, the round-trip user in-vehicle cost occurring on the third segment of the BRT service line \(E_{{m_{23} }}\) can be determined by Eq. (23):

$$E_{{m_{23} }} = 2V_{m} D_{e + 1} t_{e + 1}^{2},$$
(23)

where \(D_{e + 1}\) is the increased demand on the service corridor \(e + 1\) and can be obtained by using Eq. (24):

$$D_{e + 1} = \sum\limits_{k = 1}^{f} {q_{xk} }$$
(24)

and the total travel time on the service corridor \(e + 1\) can be calculated by Eq. (25):

$$t_{e + 1} = \frac{{S - \sum\limits_{z = 1}^{e} {z_{{\text{l}}} } }}{{\overline{{v_{{{\text{os}}}} }} }} + \frac{{\overline{{v_{{{\text{os}}}} }} }}{{2v_{a} }},$$
(25)

where \(S - \sum\nolimits_{z = 1}^{e} {z_{{\text{l}}} }\) is the length of the service corridor \(e + 1\). For the last station \(\left( e \right)\), the deceleration delay is not considered. Now, substituting Eqs. (17), (20) and (23) in Eq. (16) provides with the total users’ in-vehicle cost as Eq. (26):

$$E_{{\text{u-inv}}} = 2V_{m} M_{x} \left( {T_{a} + T_{b} } \right)^{2} + 2V_{m} \left( {\partial M_{x} + D_{1} } \right)t_{1}^{2} + 2V_{m} \sum\limits_{z = 2}^{e} {\left( {D_{z} t_{z}^{2} } \right)} + 2V_{m} D_{e + 1} t_{e + 1}^{2}.$$
(26)

As we discussed earlier, the total cost consists of users’ cost and operator’s cost, whereas the wait cost in the total users’ cost is constant. Therefore, the total cost function can be estimated by summing up \(E_{{\text{o-inc}}}\), \(E_{{\text{o-mpc}}}\), \(E_{{\text{u-ac}}}\) and \(E_{{\text{u-inv}}}\) by using Eqs. (4), (5), (7) and (26), respectively, to determine the optimal BRT, bus rapid transit, stations’ density and locations.

$$\begin{aligned} E_{{{\text{TC}}}} & = 2V_{m} M_{x} \left( {T_{a} + T_{b} } \right)^{2} + 2V_{m} \left( {\partial M_{x} + D_{1} } \right)t_{1}^{2} + 2V_{m} \sum\limits_{z = 2}^{e} {\left( {D_{z} t_{z}^{2} } \right)} + 2V_{m} D_{e + 1} t_{e + 1}^{2} \\ & \quad + \,2V_{i} \sum\limits_{k = 1}^{f} {\left[ {\left( {a_{xk} + d_{xk} } \right)i_{tk}^{2} } \right]} + 2O_{{{\text{mpc}}}} \left[ {\left( {B_{{\text{f}}} z_{{\text{l}}} } \right) + \sum\limits_{k = 1}^{f} {\left\{ {\left( {a_{xk} + d_{xk} } \right)T_{b} } \right\}} } \right] + 2O_{{\text{B}}} B_{{\text{h}}}^{ - 1} \left[ {\left\{ {\frac{{\sum\limits_{i = 1}^{e} {\left( {h_{l} - h_{l - 1} } \right)} }}{{\overline{{v_{{{\text{os}}}} }} }}} \right\} + \sum\limits_{i = 1}^{e} {t_{{\text{l}}} } } \right]. \\ \end{aligned}$$
(27)

Equation (27) represents the total cost function that is the objective function in this study.

4 Application of Evolutionary Algorithms

The three evolutionary algorithms (i.e., DE, GA, and PSO) are applied to optimize our objective function (total cost function) to compute the optimal locations of BRT stations’ and their density. The subsections of evolutionary algorithms comprise of explanation and implementations of DE, GA, and PSO. Each algorithms’ implementations are discussed individually with the help of flowchart for better understanding.

4.1 Optimization by Differential Evolution

The differential evolution (DE) is a well-exploited heuristic technique that is a population-based stochastic search method for solving optimization problems over continuous space like the genetic algorithm. It was first proposed by Storn [39] for global optimization. Its framework and applicability are quite simple and easy, also it requires a smaller number of control variables which can lead someone to think that its convergence property might not be good, but it performs well in convergence. Figure 4 shows the flowchart of the DE algorithm.

Fig. 4
figure 4

Optimization by using differential evolution

Differential evolution is an efficient yet powerful technique which became widely famous due to its new form of solution and used in many engineering fields as well as in many other scientific fields. A vector population-based stochastic algorithm is like GA as it also works on the three operators name as selection, crossover, and mutation, but it uses the randomly sample pairs object vectors in the process of mutation which makes it relatively recent and new algorithm when comparing other evolutionary techniques, for example, GA, it produces the randomly generated initial population, then three random individuals are selected for each individual and a new vector is produced by adding the weighed difference of two individuals. As in GA, crossover operator was one of the main operators but it is complementary in the DE algorithm. When this whole process is accomplished using all the individual, then fitness is evaluated. As a result, if the new fitness value is better than that of old fitness value, then it simply replaces the old individual with a new one. This whole process is repeated until the convergence is reached or the maximum number of generations is accomplished. DE produces a new solution by merging various solutions with the candidate or standard solution.

To illustrate the DE operations as shown in Fig. 4, the step for basic DE are listed below:

  • Step 1 Initialization

DE algorithm generates in \(D\) dimensional search space a population of \({\text{NP}}\) called individuals. In our case study, individuals are spacing of stations from the first access point to the station. In generation \(G\) population of individuals can be written as:

\(X_{i,G} = \left\{ {x_{1,G} ,x_{2,G} , \ldots ,x_{Di,G} } \right\}\quad {\text{where}}\;i = 1,2, \ldots ,{\text{NP}}.\)

The entire search space is covered by the initial population. The initial value of \(j{\text{th}}\) parameter when \(G = 0\) is:

\(x_{ji} ,0 = rand\left( {0,1} \right)\left( {x_{j}^{{{\text{UL}}}} - x_{j}^{{{\text{LL}}}} } \right) + x_{j}^{{{\text{LL}}}},\) where \(i = 1,2, \ldots ,{\text{NP}}\) and \(j = 1,2, \ldots ,D\). The values generated randomly are uniformly distributed with the range (0, 1); \(x_{j}^{{{\text{UL}}}}\), and \(x_{j}^{{{\text{LL}}}}\) are the upper and lower limits of \(j{\text{th}}\) parameter.

  • Step 2 Mutation

For each target vector \(X_{i,G}\), mutation operation is performed by DE to generate a mutant vector \(V_{i,G} = \left\{ {v_{1,G} ,v_{2,G} , \ldots ,v_{Di,G} } \right\}\). The DE strategy used in our work is: \(DE/best/1/bin\) which is best defined as:

\(V_{i,G} = X_{{{\text{best}},G}} + F\left( {X_{r1,G} - X_{r2,G} } \right),\) where \(r_{1} ,r_{2} \in \left[ {1,\,{\text{NP}}} \right]\) and \(r_{1} \ne r_{2} \ne i\). \(F\) satisfies \(F \in \left[ {0,\,2} \right]\) and is a constant and a real factor. For \(G{\text{th}}\) generation, \(X_{{{\text{best}},G}}\) is the best fitness vector.

  • Step 3 Crossover Operation

Trial vector: \(U_{i,G} = \left\{ {u_{1,G} ,u_{2,G} , \ldots ,u_{Di,G} } \right\}\) is generated in this operation from mutant vector \(V_{i,G}\) and target vector \(X_{i,G}\). The crossover strategy is expressed as:

$$u_{ji,G} = \left\{ \begin{gathered} v_{ji,G} \hfill \\ x_{ji,G} \hfill \\ \end{gathered} \right. \, \begin{array}{*{20}c} {{\text{if}}\;rand\;\left( {0,1} \right) \le CR} \\ {{\text{otherwise}}} \\ \end{array}.$$
  • Step 4 Selection

In this operation, at each target vector \(f\left( {X_{i,G} } \right)\) and trial vector \(f\left( {U_{i,G} } \right)\), objective function values are compared for smaller fitness function values. These values remain in the next generation, while others are disregarded. The strategy for selection is as follows:

$$X_{i,G + 1} = \left\{ \begin{gathered} U_{i,G} \hfill \\ X_{i,G} \hfill \\ \end{gathered} \right. \, \begin{array}{*{20}c} {{\text{if}}\;f\left( {U_{i,G} } \right) \le f\left( {X_{i,G} } \right)} \\ {{\text{otherwise}}} \\ \end{array}.$$
  • Step 5 Termination

Mutation, crossover and selection are repeated generation by generation until the stopping criteria are reached. For the optimization problem’s solution, the best vector \(\left( {X_{{{\text{best}},G}} } \right)\) of the current population is returned as the answer.

4.2 Optimization by Genetic Algorithm

The genetic algorithm (GA) is a well-exploited heuristic technique that mimics the natural or genetic selection. It was proposed by J. Holland's and became widely known in the coming years due to its ability for finding out the global optimal solutions effectively without any prior information. It is an evolutionary heuristic technique which is typically population-based search method. This global optimal technique works on the principle of “survival of the fittest” and motivated by Darwin’s theories of evolution [40]. It represents the solution set as chromosomes (population). Figure 5 shows the flowchart of GA.

Fig. 5
figure 5

Optimization by using genetic algorithm

A genetic algorithm technique is an iterative process which is based on the schema theorem [41]. The solutions here represent the chromosomes which are first evaluated for the best fitness value, then the very next task is that they are ranked from the best to worst with respect to that fitness values. In GA, it mimics the natural selection to produce new solutions, this whole process can be carried out by employing the three genetic operators (i.e., selection of better chromosomes, crossover to produce new offspring, and the mutation to inject or employ the diversity), and the continuous application of these three operators can give an optimal solution. First of all, what does the selection of chromosomes mean? It means to pick better chromosomes and make them parents to generate or produce the new chromosomes (new offspring) with better fitness value along with higher probabilities rather than poorer fitness value along with lower probabilities. Fitness values are typically used as a benchmark to decide either the individuals or chromosomes are elitist or not, based on the method proposed. As it is described above that this algorithm works on the principle of “survivor of the fittest,” so, the chromosomes with better fitness are selected. Now, what does crossover means in GA, once a selection phase is done, the operator of the crossover amalgamates that chromosomes to generate new offspring. As the fittest individual or chromosomes are picked often, so there is a probability that the new solution that we have achieved become nearly identical after various generations, so the diversity may drop or fall and this process can lead to a phenomenon known as population stagnation, so, as to avoid the stagnation in population, we use the mechanism name as mutation, which adds diversity to reduce the effect of population stagnation.

As the size of the population and the number of iterations are the most important factors in this algorithm, similarly, there is a need to observe a different set of decisions that must be adopted beforehand. The first set can be the selection method and the mechanism for probability assignment, which should be based on fitness. Various selection methods are used in literature, but the three very popular methods are Roulette Wheel Selection, rank selection, and elitism selection [42] Likewise, the second set can be crossover method and crossover probability, many crossover methods are used in literature, but the three very popular methods are single-point crossover, two-point crossover, and uniform crossover. The mutation method and mutation probability is the third set of decision, as it can help in balancing the diversity by adding the new chromosomes in the population.

To illustrate the GA operations as shown in Fig. 5, the steps for basic GA are listed below:

  • Step 1 Chromosomes Representation

In our case of study, the chromosomes represent the spacing of stations from the first access point to the stations. The chromosome of each solution is made of \(m\) genes. \(X = \left[ {x_{1} , \, x_{2} , \, . \, . \, . \, , \, x_{m} } \right]^{T}\), where \(x_{1} , \, x_{2} , \, . \, . \, . \, , \, x_{m}\) are \(m\) number of decision variables. The \(m\) dimensional discrete vector represents a solution.

  • Step 2 Initialization

\(N\) number of solutions are generated for \(X_{i} = \, \left[ {x_{i1} , \, x_{i2} , \, . \, . \, . \, , \, x_{im} } \right]^{T}\), \(i = 1,2, \, . \, . \, . \, , \, N\) randomly within the defined boundaries of each variable so that \(X_{i}\) satisfies the problem constraints. A \(N\) number of integers are generated between 0 and 7 using rand () function of MATLAB.

  • Step 3 Fitness Value

In general, objective function has a relationship to fitness function to a certain degree. To find fitness of each solution of \(P\left( T \right)\), we evaluate \(\left( {P\left( T \right)} \right)\).

  • Step 4 Selection Process and Crossover Operator

The parent solution set \(P\left( T \right)\) is selected to form \(n\) number of offsprings by one-point crossover operator, and the enlarged population space set \(P^{{\prime }} \left( T \right)\) is now composed of \(\left( {N + n} \right)\) solutions. The roulette_wheel \(\left( {P^{{\prime }} \left( T \right)} \right)\) operator is used to generate the next generation solution set \(P_{1} \left( T \right)\). Chromosome’s selection probability of being proportional to its fitness value compared to the other chromosomes in the population is by means of this method.

  • Step 5 Reproduction

The best individuals are selected and copied to the next generation from the current generation. This strategy is known as elitist, which means that the population is led by individuals with the best fitness value, hence, they are termed as elite individuals. By reproduction, the best solution improves from one generation to the next monotonically.

  • Step 6 Mutation

The mutation operator is used to prevent premature convergence of the population. Instead of mutating gene-to-gene, new individuals are introduced into \(P_{1} \left( T \right)\). Generation of the new mutants is random like the generation of the original population and therefore current population’s genetic material is not brought in.

  • Step 7 Stopping Criterion

This evolutionary process, when the best solution is found or when the total iterations have been run, is halted. In our case, the stopping criterion is when total iterations have been completed.

4.3 Optimization by PSO Algorithm

Particle swarm optimization (PSO) is an intelligent optimization algorithm which is based on the paradigm of swarm intelligence developed by Kennedy and Eberhart [43]. PSO is inspired by the social behavior of animals like fish and birds, in which the individuals are termed as particles and population is termed as a swarm. In a defined space, each particle is assigned a position and a velocity. All the particles then search individually for food. When a favorable location of the food is discovered by a particle, the information is then relayed to all other particles, in that space, who then rush toward that particle immediately. The particles wander around in the given space, conveying favorable locations to others, and alter their velocities and positions based on these favorable locations [44].

PSO belongs to a class of algorithms called meta-heuristics. It is similar to other evolutionary algorithms, like genetic algorithm, in a way that it uses a population bases approach to retain and refine numerous possible solutions, frequently using population attributes in conducting the exploration. Unlike GA, the evolutionary procedure in PSO only develops locations of the particles, rather than generating new particles.

The total cost function formulated in Eq. (27) is to be minimized, to find the optimal number of stations and their respective locations. The optimization algorithm is to be run for the different numbers of stations, starting from \(e = 1\) to \(e = f\), separately and, the particular minimized cost for each number of stations is to be found. The decision variable \(h_{{\text{l}}}\) used in the total cost function \(E_{{{\text{TC}}}}\) will determine the location of the bus stations. Figure 6 shows the flowchart of the PSO algorithm.

Fig.6
figure 6

Optimization by using particle swarm optimization algorithm

PSO is initialized with a variety of possible solutions as a swarm of particles. Each particle explores the new possible solutions repetitively by its motion in defined space with an altered velocity according to both the preceding finest solution of itself and the swarm. The finest solution observed by the current particle is termed as local best, while the finest solution explored by the swarm is termed as global best. All the particles are connected through global best, that is, each particle is guided by the finest solution of the whole swarm; the local best is used to consider the capacity of each particle to recall its previous individual successes [45].

Consider the dimension of the defined space as a positive integer \(D\). The location of \(i{\text{th}}\) particle is denoted by \(\left( {x_{ij}^{t} } \right)_{j = 1, \ldots ,D}\), where \(x_{ij}^{t}\) is the location of \(i{\text{th}}\) particle in the \(j{\text{th}}\) dimensional value at the \(t{\text{th}}\) iteration. The rate at which the location change (velocity) is denoted by \(\left( {v_{ij}^{t} } \right)_{j = 1, \ldots ,D}\), where \(v_{ij}^{t}\) being velocity in \(j{\text{th}}\) dimension of \(i{\text{th}}\) particle at the \(t{\text{th}}\) iteration. The fitness function which computes the quality for the location of the particle \(i\). Every particle recollects its own finest location achieved so far (the location corresponding to the finest function) as \(P_{{{\text{best}},i}}^{t}\), where \(P_{{{\text{best}},i}}^{t}\) is the finest location of \(i{\text{th}}\) at the \(t{\text{th}}\). The finest location observed so far by the population is denoted as \(G_{{{\text{best}}}}\). During the \(t{\text{th}}\) iteration, velocity for \(j{\text{th}}\) dimension of every particle \(i\) is updated by [44]

$$v_{ij}^{t + 1} = wv_{ij}^{t} + c_{1} r_{1,j}^{t} \left[ {P_{{{\text{best}},i}}^{0} - x_{ij}^{t} } \right] + c_{2} r_{2,j}^{t} \left[ {G_{{{\text{best}}}} - x_{ij}^{t} } \right],$$

where \(w\) is the inertia weight, \(c_{1}\) and \(c_{2}\) are constant values multiplied by randomly generated numbers \(r_{1}\) and \(r_{2}\), respectively. These random numbers are used to retain heterogeneity of the swarm and are allocated consistently in the interval \([0,\,1]\) [45]. Based on its current direction \(\left( {v_{ij}^{t} } \right)\), its personal best memory \(\left( {P_{{{\text{best}},i}}^{t} } \right)\) and its inclination to like the finest particle in the swarm, each particle moves. The \(i{\text{th}}\) particle location is updated by the addition of its preceding location and the new velocity as;

$$x_{ij}^{t + 1} = x_{ij}^{t} + v_{ij}^{t + 1}$$

Every particle \(i\) hunts in the defined space for the solution \(x_{ij}^{t}\). We define this search space by defining the limits: upper limit (UL) and lower limits (LL), in which we want the desired outcome in the form of the optimum solution. In the scenario of this research, \(S\), the length of the study segment will be the defined search space such as \(0\) be the LL and \(S\) be the UL. The particles will converge to the optimum solutions within this defined search space and the optimum results will be coming in the form of the optimum location of the stations along the length of the study segment. To lead the particles productively, the moving distance, in the defined space with a range \(\left[ {{\text{UL}},{\text{LL}}} \right]\) in any iteration, must be clamped in between the maximum range \([ - v_{\max } ,v_{\max } ]\). If we do not clamp the velocity, it would result in the rapid position changing of the particles in the search space, so clamping results in providing the efficient results by creating the balance between the global exploration and the local exploration.

  • Step A Derivation of Total Cost Function

To begin, take \(e = 1\) and derive the total cost function using Eq. (27). The function will have only one decision variable \(h_{{\text{l}}}\) that will determine the location of a single bus station. The total number of stations \(e\) cannot exceed the total number of access points \(f\). Therefore, the equations for all the stations: \(e \le f\) will be derived.

  • Step B Minimizing the Total Cost by PSO

Minimize the total cost \(E_{w,e}\) for the \(e\) number of stations using the PSO approach. The optimized cost function will give the minimum cost, as well as the optimal location of bus stations. The PSO algorithm is coded into the MATLAB programming environment for minimizing the function using the distance of BRT station from the first access point as a decision variable. The following steps show the implementation of PSO in our work.

  • Step 1 Initialization

Define parameters such as decision variable \(x_{ij}^{t}\), velocity \(v_{ij}^{t}\), upper limit (\({\text{UL}}\)) and lower limit (\({\text{LL}}\)) of the decision variables, no of maximum iterations \(N\), max no of particles \(P\), define max velocity \(v_{\max } = 0.2*[{\text{UL}} - {\text{LL}}]\) and min velocity \(v_{\min } = - v_{\max }\), the set value of global best \(G_{{{\text{best}}}} = \inf\) and iteration counter \(t = 0\).

For \(i = 1\) to \(n\): randomly generate the position of the decision variable \(x_{ij}^{0}\) in \([{\text{UL}},{\text{LL}}]\) with a population size of \(P\) particles.

  • Step 2 Updating Position and Velocity of Each Particle

For \(i = 1\) to \(n\): generate randomly \(r_{1,j}^{t}\) in \([0,\,1]\) and \(r_{2,j}^{t}\) in \([0,\,1]\) and update \(v_{ij}^{t + 1} \leftarrow v_{ij}^{t} + c_{1} r_{1,j}^{t} \left[ {P_{{{\text{best}},i}}^{0} - x_{ij}^{t} } \right] + c_{2} r_{2,j}^{t} \left[ {G_{{{\text{best}}}} - x_{ij}^{t} } \right]\); update \(x_{ij}^{t + 1} \leftarrow x_{ij}^{t} + v_{ij}^{t + 1}\).

  • Step 3 Calculating Position of Each Particle

For \(i = 1\) to \(n\): run the algorithm on the total cost function \(f_{ij}^{t}\) using \(x_{ij}^{t}\) and other given inputs in Step 1 and Step 2. Select min cost value from \(f_{ij}^{t}\) and its corresponding \(x_{ij}^{t}\) from the results generated.

  • Step 4 Updating of Local Bests and Global Bests

For \(i = 1\) to \(n\): using the results from Step 3, if \(f_{ij}^{t} \le f_{{{\text{best}},i}}\) then update \(f_{{{\text{best}},i}} \leftarrow f_{ij}^{t}\) and \(P_{{{\text{best}},i}}^{t} \leftarrow x_{ij}^{t}\); if \(f_{ij}^{t} \le f_{{g{\text{best}}}}\) then update \(f_{{g{\text{best}}}} \leftarrow f_{ij}^{t}\) and \(G_{{{\text{best}}}} \leftarrow x_{ij}^{t}\).

  • Step 5 Ending Condition

Set value of \(t = t + 1\). If the ending condition is not met then go to Step 2. If not then \(G_{{{\text{best}}}}\) is the best possible position of the particles with the total cost function \(f_{{g{\text{best}}}}\). Extract the necessary information and stop.

  • Step C Finding the Optimal Solution

Once, the minimized total costs for \(e = 1\) to \(e = f\) are determined, search for the number of stations with the minimum total cost. The values of the decision variables resulting from the optimized cost function of that particular number of stations will determine the optimal locations of stations.

5 Computational Experiments

To practically demonstrate the applicability of the developed model, a numerical example is designed, and the supposed scenario imitates the real-life conditions. For demonstration purpose, the values of different variables are assumed.

5.1 Numerical Example

Let assume, an extension is to be made on the existing BRT route, to provide the facility to the residents of a newly developed suburb. A different number of stations can be situated along the BRT track, whereas the commuters can access the facility from five different access points. Figure 7 illustrates the distances between consecutive access points as 1.7, 2, 1.5, and 1.8 miles, respectively.

Fig. 7
figure 7

Configuration of BRT service line in numerical example

Now, taking into account the key parameters, i.e., the users’ in-vehicle time, users’ access time, and the operator’s interest, various numbers of stations can be added to the BRT system as discussed. The boarding and alighting demands at the five access points are enumerated in Table 2. The optimization algorithms are used and the optimal results are worked out.

Table 2 Commuters demand distribution for access points

After applying PSO, GA, and DE on our total cost function for stations one to four in MATLAB programming environment, the results of the number of iterations versus best costs, as shown in Fig. 8, are plotted. The graphs show that among these three algorithms PSO clusters rapidly and also its swarm becomes stagnant. In the case of GA, clustering is not very obvious, but the reinitialization process shows randomness being injected to improve the diversity toward an optimal solution. While in the case of DE, it can be seen that clustering is least and reinitialization has the least effect in DE. The robustness of PSO as it converges to the best optimal solution way before DE and GA can be clearly seen in the figure.

Fig. 8
figure 8figure 8

Plot of PSO versus GA and DE showing number of iterations versus best costs for a one station, b two stations, c three stations, d four stations

Since the scope of our work revolves around PSO and in proving its efficiency over GA, which we have set as our benchmark, therefore, in the upcoming sections, the work done is mainly through the use of PSO.

Figure 9 illustrates the optimal distance and cost against the number of BRT stations. The highest achieved optimal cost is 43,085 USD/h against 1 station with the optimal location at 3.60 miles at the 7-mile-long track. On the other hand, the lowest achieved optimal cost is. 2536.3 USD/h against the four stations, with the optimal locations at 0.07, 1.76, 4.44, and 6.90 miles. Furthermore, the cost against 2 stations is 20,621 USD/h and the optimal locations are 0.91 and 5.49 miles. For 3 stations, the optimal cost is 4550.8 USD/h and the optimal locations are 0.97, 4.43, and 6.90 miles. The locations for the 5 stations would be the same as the locations of the access points due to the assumption (1), whereas the optimal cost is 14,295 USD/h. Consequently, the aforementioned density and locations of the BRT stations against the total optimal cost of 2536.3 USD/h would be considered as the optimal solution of the numerical example under consideration.

Fig. 9
figure 9

Optimal distance and cost against number of BRT stations

Moreover, the optimal density and locations of the stations, lead to the average access distance of 0.31 miles per commuter and, the average access time of 7.44 min, considering the commuter access speed at 2.5 mph. Additionally, the dwell time, \(T_{b}\) and, the increased travel time due to the acceleration and deceleration of the Bus, \(Ta\), results at 0.14 h and, 0.16 h, respectively. Consequently, the increased travel time of the Bus, in the result of serving commuter at each station is 0.6 h. Assuming the headway at 0.2 h, Eq. (15) suggests that two additional buses are required to serve the demand at the new stations of the BRT system. The optimal locations of the stations along the BRT track are shown in Fig. 10.

Fig. 10
figure 10

Configuration of BRT service lines with optimal spacing

5.2 Sensitivity Analysis

Sensitivity analysis is the process that determines how the variations in the independent variables used in the objective function can impact the dependent variable that is the optimal cost in this study. A comprehensive sensitivity analysis is carried out in order to observe the effects of various variables used in the objective function, as derived in Eq. (27), on the optimal cost. The optimal costs against the multiple values of different parameters are checked and the results are elaborated in this section.

Figure 11 shows the optimal cost for the different numbers of stations against multiple values of users’ in-vehicle time, \(V_{m}\). It can be seen that the optimal cost increases with the increase in \(V_{m}\) and vice versa. Furthermore, it is important to note that for all the values of the \(V_{m}\), optimal cost remained minimum at the 4 stations which shows that changes in \(V_{m}\) can alter the optimal cost but does not impact the density of stations. Similarly, Fig. 12 shows the optimal cost for the different numbers of stations against different values of users’ access time, \(V_{i}\).

Fig. 11
figure 11

Optimal cost versus number of stations for varying values of user’s in-vehicle time

Fig. 12
figure 12

Optimal cost versus number of stations for varying values of user’s access time

The general trend shows that an increase in the values of users’ access time, \(V_{i}\), increases the optimal cost. However, another important feature is the reduction in the variation of the optimal cost with the increment in the number of stations. At the start with 1 station, the optimal cost against different values of \(V_{i}\) varying a lot but as the number of stations increases, for example, station 4 and 5, there is very less difference among the optimal costs.

Figure 13a, b illustrates that the optimal cost slightly decreases with the increase in the bus headway,\(B_{{\text{h}}}\), and average vehicle operating speed, \(\overline{{v_{{{\text{os}}}} }}\). On the other hand, change in these parameters do not affect the optimal number of stations as the 4 stations, acquire all the minimum costs against different values.

Fig. 13
figure 13

Optimal cost versus number of stations for varying values of a bus headway and b average vehicle operating speed

It can be observed from Fig. 14a–c, that variation in the bus operating cost, \(E_{{\text{OC}}}\), through flow in the direction \(x\), \(M_{x}\), and the acceleration and deceleration delay at a station have a negligible impact on the optimal cost. Therefore, the bus operating cost that is comprised of many factors, for example, fuel consumption, bus maintenance cost, and the wages of bus operators do not impact the optimal density or locations of the BRT stations. Moreover, the flow of commuters already bounded to the news stations from the existing stations, and the acceleration/deceleration delay also play no important role in determining the optimal density and locations of new stations.

Fig. 14
figure 14

Optimal cost versus number of stations for varying values of a bus operating cost, b through flow in direction x and c acceleration/deceleration delay time at a station

Figure 15 of the demand multipliers versus the optimal cost shows about the most striking relation of sensitivity analysis. It is worth noting that the variations in the demand can dramatically change the optimal costs. Unlike the other variables, the demand is the only variable that impacts the objective function most as both of the cost: user and operator, are directly influenced by the demand. Therefore, an increase in demand will increase the optimal cost. However, it does not affect the optimal quantity of stations as even with the variations, 4 number of stations have the minimum costs against different demands.

Fig. 15
figure 15

Optimal cost versus number of stations for varying values of demand multipliers

The walking speed of commuters also influences the optimal cost as shown in Fig. 16. Increment in the walking speed reduced the optimal cost which means that if the commuters mostly consist the young people whom walking speed is more would lead to low optimal cost as compared to the commuters consists of elderly or children. However, this variation converges with the increase in the number of stations, for example, the variation in optimal cost against the different walking speed at 4 stations is less than the variation at 3 stations and so on.

Fig. 16
figure 16

Optimal cost versus number of stations for varying value of commuters walking speed

6 Conclusion and Recommendations

This paper has studied the problem of optimal locations and densities of BRT stations, by using PSO, GA, and DE algorithms and presented a complete framework in order to determine them. First, a mathematical model is developed by considering the realistic demand patterns. The model composed of the operator’s cost and the users’ cost, i.e., in-vehicle cost, access cost, while the wait cost is considered as constant. Secondly, the model is applied to a designed numerical example with five access points and the total objective function is minimized. Thirdly, as our results show that the PSO has outclassed the GA and DE, therefore, the sensitivity analysis is carried out using only PSO algorithm to analyze the behavior of optimal cost with the variations in different independent variables used in the objective function.

The computational experiments reveal that:

  1. 1.

    The model can be applied to any scenario consisting of an elevated and a signal-free corridor with multiple access points, varying distances among the access points and for any boarding and alighting demand distribution.

  2. 2.

    The optimal density of the bus rapid transit stations along the new track or the extension in the existing track can be determined.

  3. 3.

    In addition to the optimal density, the optimal locations of stations minimizing the users’ in-vehicle, access time, and the fleet size for catering the demand can be found out.

  4. 4.

    The optimized cost can be varied the most by the fluctuation in the demand, more the demand more is the optimal cost and vice versa.

  5. 5.

    Value of users’ in-vehicle time and access time directly influences the optimal cost, while the commuters’ walking speed inversely impacts the optimal cost. Moreover, variations in the bus operating speed and its headway slightly affects the optimal cost. On the other hand, bus operating cost, through flow in direction d showed no influence on the optimal cost.

  6. 6.

    Variation in the value of any single value can affect the optimal cost but it can never alter the density of the stations.

  7. 7.

    Our results showed the robustness of PSO in terms of convergence rate as compared to GA and DE. Hence, our work proved that by using PSO we can reach the optimal solution with the same population size in a fewer number of generations as compared to the other two evolutionary algorithms.