• No results found

Designing bus route networks with algorithms

N/A
N/A
Protected

Academic year: 2021

Share "Designing bus route networks with algorithms"

Copied!
54
0
0

Loading.... (view fulltext now)

Full text

(1)

IN

DEGREE PROJECT MATHEMATICS, SECOND CYCLE, 30 CREDITS

,

STOCKHOLM SWEDEN 2020

Designing bus route

networks with algorithms

PHILIP SVENSSON

(2)
(3)

Designing bus route networks

with algorithms

PHILIP SVENSSON

Degree Projects in Systems Engineering (30 ECTS credits)

Master’s Programme in Applied and Computational Mathematics (120 credits) KTH Royal Institute of Technology year 2020

Supervisor at Integrated Transport Research Lab: Erik Almlöf Supervisor at KTH: Per Enqvist

(4)

TRITA-SCI-GRU 2020:245 MAT-E 2020:068

Royal Institute of Technology

School of Engineering Sciences

KTH SCI

(5)

Abstract

The aim of this thesis is to make use of real world travel time and demand data and implement an algorithm which designs bus networks. Consideration is taken to both passenger and bus operator interests. Thereafter answering the questions: How well does the algorithm perform when applied to Södertälje, Sweden? Can the proposed method assist in the network design stage of real bus network planning?

(6)
(7)

Sammanfattning

Målet med denna studie är att använda verklig resedata och efterfrågan och implementera en algoritm som designar busslinjenät med avseende på passagerar- och operatörsintressen. Därefter svara på frågorna: Hur bra presterar algoritmen när den tillämpas på Södertälje, Sverige? Kan den föreslagna algoritmen bidra i designfasen av ett verkligt busslinjenät?

(8)
(9)

Acknowledgements

I would like to thank Erik Almlöf, supervisor and PhD student working at Integrated Transport Research Lab, for the opportunity to work with him and for his guidance. As well as Jonas Hatzenbühler for his counseling in the field of heuristic algorithms. Thanks is also due to Andreas Persson and Anders Påhlman at Nobina, who have extracted travel time data. Also thanks to PhD student Matej Cebecauer for extracting travel demand data.

(10)
(11)

Contents

1 Introduction

1

1.1 Background . . . 1

1.1.1 An algorithm-based approach . . . 2

1.1.2 Dataset and simplificiations . . . 4

1.2 Objective . . . 6 1.3 Research Question . . . 6 1.4 Limitations . . . 6 1.5 Outline . . . 7

2 Method

8

2.1 Methodology . . . 8 2.2 Problem description . . . 9 2.2.1 Objective functions . . . 10

2.3 Shortest path and time complexity . . . 13

2.4 Creating an initial set . . . 14

2.4.1 Generating initial routes . . . 14

2.4.2 Generating initial networks . . . 15

2.5 NSGA-II . . . 16

2.5.1 Fitness value and pareto optimality . . . 17

2.5.2 Crowding distance . . . 18

2.5.3 Binary tournament and crossover . . . 19

2.5.4 Mutation . . . 19

2.6 Validity and Repair program. . . 20

3 Results

23

3.1 Settings . . . 23

(12)

CONTENTS 3.3 Final solutions . . . 24 3.3.1 58-node problem . . . 24 3.3.2 24-node problem . . . 26

4 Discussion

31

4.1 Computation time . . . 31 4.2 Results . . . 32

4.3 Method and future work . . . 33

4.4 Conclusion . . . 34

(13)

List of Figures

2.2.1 Example graph of nodes and links with undirected weights. . . 9

2.2.2Example of multiobjective solution. . . 11

2.5.1 NSGA-II method . . . 17

2.5.2 Fitness fronts . . . 18

2.6.1 Graphical representation of distance value W . . . . 21

3.0.1 Example solution of a network in Södertälje . . . 23

3.3.1 Full solution set for a network of 58 nodes and 20 routes. . . 26

3.3.2 Full solution set for a network of 58 nodes and 18 routes. . . 27

3.3.3 Last population for the network of 58 nodes and 20 routes. . . 28

3.3.4Last population for the network of 58 nodes and 18 routes. . . 28

3.3.5 First three pareto fronts for the network of 58 nodes and 20 routes. . . 29

3.3.6First three pareto fronts for the network of 58 nodes and 18 routes. . . 29

3.3.7 Full solution set for a network of 24 nodes and 4 routes. . . 30

(14)

Acronyms

UTNDP Urban Transit Network Design Problem NP Non-deterministic polynomial time

(15)

Chapter 1

Introduction

This master thesis is written at KTH Royal Institute of Technology, Stockholm. Data regarding travel patterns and operator costs have been collected from the authority SLL (Stockholms Läns Landsting) and the bus operator Nobina. The goal of this thesis is to investigate whether the proposed method can assist in the network design stage of a real bus network planning. There are 800 000 passengers travelling through Stockholm’s public transport system each day and the company managing it, SL (Storstockholms Lokaltrafik), has an annual turnover of about 20 billion SEK (SL, 2018). Even small improvements to this process can lead to large cost savings and socioeconomic gains, including environmental effects.

In the following chapter the reader is introduced to the background, objective, research question and the limitations in order to give the reader a thorough understanding of what comes in the following chapters.

1.1

Background

The planning and design of an urban transit network, also called UTNDP (Urban Transit Network Design Problem), may be divided into five main stages: network design, frequency setting, timetable, bus scheduling and driver scheduling. This paper focuses solely on bus networks and the network design stage, but the above theory may be applied on train rails, trams etc. (Ceder and Wilson, 1986, as cited in John et al., 2014).

(16)

CHAPTER 1. INTRODUCTION

point. Timetable planning decides the exact time when a bus in a given route is supposed to arrive at a station. Bus and driver scheduling determines which bus is used for a given route at a given time and driver scheduling determines the work schedule of each driver.

Network design encompasses the creation of bus routes and how they together as a network satisfy the demand in a region. Today, the design of bus line networks is done on a ”know-how” basis by experienced planners using data such as crowding and market surveys, according to traffic planner Andreas Persson at Nobina. For example, if one route is heavily crowded another route might be implemented or the frequency of the route increased. In the same way, a route with low demand may be incorporated into another one or get a reduced frequency. Common worldwide is that bus networks are continuously changing and being built upon. The reason being they have all started out small and due to urbanisation and increasing demand, the networks have evolved over time in order to adapt.

1.1.1

An algorithm-based approach

The current ways of devising network design has been found to work well in the past, as anyone who has ever travelled by bus well knows. Acoording to Zhao and Gan (Zhao and Gan, 2013, as cited in Fan and Mumford, 2010), there is however potential for improvement of the current method and especially in regard to larger networks where bus routes may number to hundreds and the number of stops to thousands. In such instances where the amount of possible solutions are so large, it is not difficult to imagine that a human making decisions based on former layouts of the system might not have found the best possible solution.

Modern tools and methods of gathering data are becoming more accessible. By the use of big data and tools of optimization, a new light may be shone on the design of bus line networks. Solving all of the five stages in the UTNDP simultaneously and finding an algorithm-based unbiased optimal solution, would in this context be the ultimate goal.

(17)

CHAPTER 1. INTRODUCTION

shorter routes implies less costs for the operator and less impact on the environment induced by lower emissions and wear on the roads. On the other hand, an optimal solution for the passengers would be to have an as efficient travel as possible i.e. minimizing their travel time. A common metric to evaluate the performance of a bus network is therefore time. Time or distance for the operator to drive and time for the passenger to complete their trip. In turn, time can be used to evaluate costs (Fan and Mumford, 2010).

Due to the complexity of each of the five phases, it is however difficult to combine the subproblems and solve them simultaneously. Finding an optimal network design while at the same time deciding the driver schedule would just be a way of complicating two detached problems. On the other hand, solving for an optimal network design and at the same time taking frequencies into consideration would definitely be valuable. The reason being that an optimal network design with fixed frequencies finds a local optimum and a global suboptimum and vice versa. Thus combining the subproblems could theoretically find a global optimum. The problem is that each of the subproblems are considered NP-hard, giving rise to further complexity (Mumford, 2013). NP-hard is a class of problems which are ”at least as hard as the hardest problems in NP”, NP being a class of problems which stands for non-deterministic polynomial time. What it sums down to is that an optimal verifiable solution cannot be found in realistic time.

Research regarding algorithm-based network design has been conducted several times before, for example in 1979 by Christoph Mandl (Mandl, 1979, as cited in John et al., 2014) who proposed to tackle the problem through heuristics by creating feasible routes and then improving upon them. Thereafter, several papers have been published using similar principles, some with a more theoretical approach in order to create benchmarks and compare different algorithms and methods, such as (Mumford, 2013). Whilst other papers instead focus on a practical approach where real collected data is used in order to compare with reality, such as the work by Soares, Mumford, Amponsah and Mao (Soares et al., 2019).

(18)

CHAPTER 1. INTRODUCTION

difficult and even impossible to verify for most settings of the problem. Since the number of possible solutions are too many for most settings of the UTNDP as well as the computation time being expensive, exploring the solution space through heuristics and meta-heuristic methods is one of the few ways to actually tackle the problem and the reason for them being so widely used, according to Mumford (Mumford, 2013). Meta-heuristics is a term used for higher order heuristics, i.e. a procedure which makes decisions about heuristics. In the case of the UTNDP, heuristics are used to create bus routes and combine them into networks based on demand and distance. These networks are then subjected to a meta-heuristic method which decides how to further improve them according to some metric. Some common meta-heuristics for the UTNDP as well as many other problems are genetic algorithms (GA), Simulated annealing and Tabu Search. However, according to Mumford’s paper from 2013 the lack of available benchmarks for the UTNDP is highlighted as an issue. Therefore, choosing the ”best” method for the problem is difficult.

According to earlier research, the main bottleneck of solving the UTNDP is the evaluation of the passenger objective (Mumford, 2013). The reason being that all origins and destinations need to have their shortest paths calculated for every candidate network (which has time complexity O(N3), with N number of stations)

according to the Floyd-Warshall algorithm applied in Mumford’s paper. Time complexity correlates the the number of elementary operations required in the algorithm to the input.

1.1.2

Dataset and simplificiations

(19)

CHAPTER 1. INTRODUCTION

Limiting the full data set of Stockholm is needed due to the scope and time restriction of this thesis. By conferring with supervisor and PhD student Erik Almlöf as well as traffic planner Andreas Persson at Nobina, the most suitable area is Södertälje outside of central Stockholm. This is due to multiple factors, such as Södertälje being a medium-sized city with both central and rural areas as well as having an existing developed bus network. Also due to the proximity to Stockholm, many people traffic the area either in order to get into Stockholm or travel from Stockholm to the many industries located in Södertälje.

In a recent paper (Soares et.al, 2019), a similar study was conducted on the city of Nottingham, UK. Their algorithm which had evolved over the course of several publications expected a runtime of about 600 hours for 500 stations. All stations in Södertälje amount to roughly below 400. In order to reduce the workload for the scope of this thesis, two different problem sizes are set up:

• The first consisting of 24 stops, based on larger stops found in four of the larger bus routes in Södertälje.

• The larger problem size consists of 58 stops. It is however not directly translatable to any existing routes.

Since all of Södertälje is not encompassed in the problem, the resulting solution is contingent upon a subsystem of the larger Södertälje system. Because Stockholm amounts to such a large part of the demand in the region, the demand to and from Stockholm has been implemented in a roundabout way. Locating the closest railway station (as the crow flies) to each bus stop, the demand has been transferred to and from that railway station instead of to and from Stockholm. Thus it is assumed that the passengers exit at the bus stop by the railway station and continues their journey by train and vice versa if the passenger originates in Stockholm.

(20)

CHAPTER 1. INTRODUCTION

is deemed most interesting for a single case study.

1.2

Objective

The objective of this thesis is to use existing research together with real travel patterns and operating costs, in order to create algorithm-based network designs of bus networks and discuss their usefulness. Broken down as follows:

• Defining an optimization problem which seeks to optimize bus line networks with regard to both passengers and bus operator in Södertälje.

• Implementing the problem and solution in MATLAB.

• Evaluating the performance of the algorithm: Is the result reasonable compared to existing networks? How well do the proposed networks fare against the existing ones in terms passenger and operator interests?

1.3

Research Question

Based on the objectives formulated above, the research questions are:

• How well does the algorithm-based algorithm perform when applied to Södertälje?

• Can the proposed method assist in the network design stage of real bus network planning?

1.4

Limitations

In order to focus the study and clarify the scope, further limitations are required: • No simulation is executed and therefore no approximations of how crowded the

buses might get nor how many buses are being used is considered.

• Only current bus stops are considered. The resulting bus lines and network are contingent upon fixed stops and the subsystems listed in Section 1.1.2.

(21)

CHAPTER 1. INTRODUCTION

• There is no overshadowing perspective of the public transport system as a whole. Meaning for example that the interaction between the bus line network and other forms of transportation is disregarded. An exception is where the demand to and from Stockholm instead assumes travel to the corresponding railway stations.

1.5

Outline

The remaining parts of this thesis will be structured the following way: • Chapter 2 - Method

The reader is introduced to the methodology, problem description and definitions, method and implementation.

• Chapter 3 - Results

The results are presented and explained. • Chapter 4 - Discussion

(22)

Chapter 2

Method

In the following chapter the reader will be introduced to the methodology, problem description, method and implementation.

2.1

Methodology

The use of heuristics and meta-heuristics in this thesis was decided early on. The main part of the literature review suggested a rapid development of such methods in the last 20 years and the widespread use of it regarding the UTNDP (Fan & Mumford, 2013). The heuristics concern the creation of initial bus routes and how to combine them into networks. Thereafter a meta-heuristic algorithm, such as a genetic algorithm (GA), tries to improve the quality of those.

Due to the similarity of the study done by Philipp Soares and his collegaues (Soares et al., 2019), much of the method is based on their approach. For example, their implementation also involves the use of predetermined end stations. Furthermore, the implementation of their heuristics have been developed and improved over the course of several publications, see (Fan & Mumford, 2010 & Mumford, 2013 & John et al., 2014). This does not imply that their heuristics are flawless nor that better heuristics cannot be found elsewhere. The success of their study, which presented improving networks possibly better than the ones in reality (in a constrained theoretical environment), suggests that their choice of method would be a good fit due to the study being overall very similar.

(23)

CHAPTER 2. METHOD

al., 2019) mentioned above. It is a genetic algorithm called Non-dominated Sorting Genetic Algorithm-II (NSGA-II). Several choices were considered, such as Ant Bee Colony, Tabu Search and Simulated annealing after having read papers about those methods applied to the UTNDP in earlier research. The reason for choosing NSGA-II is due to its simplicity and clear implementation guidelines. As mentioned earlier in the background, there is a lack of benchmarks comparing algorithms and where they perform best in junction with the UTNDP according to (Mumford, 2013).

2.2

Problem description

A bus line network can be represented as a graph consisting of nodes N and links

L. The nodes represent bus stops and the links connecting them are given a weight depicting the distance or travel time ti,j between them. In reality the links are directed

since travel to and from a pair of stops could result in different travel times due to the geographical layout. In counterpart an undirected weighted graph is shown in Figure 2.2.1, representing travel with a symmetric distance.

Figure 2.2.1: Example graph of nodes and links with undirected weights.

The travel times are stored in a non-symmetric matrix G∈ NN×N, where G(i, j) = t i,j.

Similarly the demand between nodes are stored in a matrix D ∈ NN×N, in which

D(i, j) = di,j. A route is defined as the path between two nodes and just as in reality, no

loops may occur within a route nor may nodes be visited more than once. A network is a set of routes with constraints given as:

(24)

CHAPTER 2. METHOD

|R| = 4 just as the number of routes it is based on. The second problem has

two variations,|R| = 18 and |R| = 20.

• Each route r has a minimum and maximum length of nodes, lmin and lmax

correspondingly.

• No route overlaps with another route in the same network. Thus identical routes cannot exist in a network as well as smaller routes fully overlapping somewhere along a longer route. The reason being that such an overlap has no useful interpretation in contrast to reality. In reality this would imply less crowding for the overlapping links, but there is no gain for such instances in this model since no simulation is being made.

• All routes in a network are connected thus enabling travel to and from all stops. This is ensured by checking iteratively that each route shares at least one node with another route and expanding the set of routes which this has been accepted for until|R| is reached. All nodes must also be present in a network.

• The frequencies of buses travelling along the routes are fixed at ten minutes, which is a common assumption regarding the UTNDP (John et al., 2014). The transfer time from one route to another is assumed deterministically to be five minutes. Since there is no simulation, the number of buses nor how crowded each bus might get is not considered.

• Each route r starts and ends at a terminal node which is a mirror of an end station in reality and implies the possibility of a u-turn.

2.2.1

Objective functions

The letters II in NSGA-II stands for two and implies it being a multiobjective algorithm with two objectives, namely operator and passenger objectives. An alternative method for this thesis could’ve used a single objective function by adding them together. This in turn would lead to making decisions regarding weights and how important each objective is in the sum. By using a multiobjective algorithm this can be avoided and is widely used in research regarding the UTNDP.

(25)

CHAPTER 2. METHOD

solution to choose as optimal then depends on how important the two objectives are subjectively. Generally the passenger and bus operator will want to use the extreme green solutions positioned to the down-right or up-left depending on which objective function corresponds to which axis. An agreement by the two parties might be the middle green solution which is closest to origo. More about pareto fronts is detailed in Section 2.5.1.

Figure 2.2.2: Example of multiobjective solution.

Pareto front in green. The axes correspond to the operator and passenger objective functions.

Travel is assigned as an ”all or nothing” decision. By that, it is assumed that all passengers travel along their shortest path from origin to destination in a given network. If the problem instead was simulated or put into another framework, passengers could have the choice of choosing another path or rejecting the transporting system altogether if the suggested path is insufficient.

There seems to be a general consensus in regards to how the passenger objective is modelled. There may be different variations, but time is always the main part of the function. The variation used in this thesis, as in other papers such as (Soares, 2019), is in its simplest form: Summing up all travel times when pasengers follow their shortest path and dividing by the amount of passengers. This gives a value of how well the network conforms to passenger demand with a lower value meaning a mean shorter travel time. The function for the passenger objective is

(26)

CHAPTER 2. METHOD

where di,jis the demand and αi,jthe shortest journey time going from node i to node j,

with|N| being the total number of nodes. Important to note here is that αi,j includes

the time needed to make transfers, thus

αi,j = Ti,j+ 5Si,j. (2.2)

The shortest journey time αi,jis a sum of the in-vehicle travel time Ti,jand the number

of route transfers Si,j made, which has a factor of five since the frequency of buses are

ten minutes and they occur determinstically. The operator objective is also modelled very simplistically by summing up the total time required to drive all routes one way. The function is given as

CO(R) = |R|i=j |r|−1 i=1 ti,i+1(r), (2.3)

where ti,i+1is the travel time from node i to i + 1. The sum limit|R| is the total number

of routes and|r| is the length of each route.

At first glance the objectives might seem too simple in regards to the complexity of the problem. One might for example wonder why the operator objective CO(R)is only

(27)

CHAPTER 2. METHOD

These are however beyond the scope of this thesis.

2.3

Shortest path and time complexity

Finding the shortest path from origin to destination through a given network is done by:

⇒ Constructing a matrix SP in MATLAB which consists of the travel times ti,jof the

links present in each route of the given network. It is similar to the full matrix travel G, except all links not present in the routes of the network are set to ti,j = 0

and thus disregarded.

⇒ Applying the the built-in MATLAB function shortestpath on the matrix SP ,

which uses Dijkstra’s shortest path algorithm. The output gives the path and distance for each origin and destination.

The exact method of Dijkstra’s shortest path algorithm is not specified in this report since it is not central. Explanation and analysis of it’s time complexity is however detailed at the end of this section.

When using the built-in function shortestpath, the bus transfers occurring during travel need to be implemented in a roundabout way:

⇒ For a network of N nodes SP ∈ NN×N if no transfers are modelled, whereN is the

set of natural numbers. The size is instead increased to SP ∈ N|R|(N×N), resulting in a much larger matrix where each node is represented once for every route in the network. If for example there are ten routes in a network, this implies that it is possible to get to and from a certain station by ten different ways, stored in the matrix accordingly. Travel within only the first route in the network occurs in the block SP (1:N, 1:N ), whilst travel within the third route occurs in the block

SP (2N + 1:3N, 2N + 1:3N ). Making a transfer from the first route to the second route is then modelled in the block SP (1:N, N + 1:2N ), where a penalty of five minutes is added to all travel times.

(28)

CHAPTER 2. METHOD

implying that the time complexity of Floyd-Warshall’s shortest path algorithm O(N3)

is based on N = 17.

In the description of Dijkstra’s shortest path algorithm in MATLAB’s help center, the algorithm is said to have O(log(N )E) time complexity, with N nodes and E links. This is from one node to all other nodes. Translation to an all pairs shortest path algorithm would indicate a time complexity of O(N ln(N )E). In a worst case scenario where all edges are nonzero, it would have a time complexity of O(N3ln(N )) which is worse than

Floyd-Warshall.

In the settings of the UTNDP, Dijkstra’s algorithm can most often be used more beneficially since only links which are part of routes in the network have nonzero

ti,j and therefore counted as a link in computation. Using the case mentioned above

as comparison: Floyd-Warshall has a time complexity of O(173 = 4913) whereas

Dijkstra’ algorithm has O(17 · ln(17) · 16 = 771), since there are 16 directed links in the example.

2.4

Creating an initial set

Before applying the meta-heuristic algorithm, an initial set of solutions must be created. The set is of size|P | = 50 in this study, which stands for population and will be improved upon through the use of NSGA-II. If the initial population is poorly created w.r.t. the objective values, for example by completely random selection, the NSGA-II will generally not work well since it’s starting farther away from local optimums.

2.4.1

Generating initial routes

A heuristic mentioned in (Kiliç & Gök, 2014) and applied in (Soares et al., 2019), bases the creation of an initial route set on the demand and travel time data. In this study a simplified version was applied. The demand between each pair of nodes was divided by the travel time for that link, resulting in a normalized usage measure

Ui,j =

di,j

ti,j

. (2.4)

(29)

CHAPTER 2. METHOD

is not valid if a third node is ”close enough” to its path. Thereafter a shortest path map is constructed where only valid links are taken into consideration. Dividing the usage of each link by the length of it, a normalized usage is found. The same idea is used in this paper except there is no process where valid links are decided and therefore the algorithm breaks down to the simple division seen in Equation (2.4).

Having constructed a usage map, a palette of routes are created iteratively. The size of the palette is chosen arbitrarily to 1000 in this study and must ensure that each node is part of at least one route in the palette. The application of the usage map is of a simpler form than specified in the literature and goes as follows:

⇒ The length of the route is decided by sampling from a uniform distribution |r| ∼ U[lmin, lmax].

⇒ The link with highest usage is deterministally chosen and gives the first two nodes

in the route, it is not known where in the finished route they will be.

⇒ All links possible to prepend or append to the route are now compared and the

highest usage is chosen deterministally. This process is continued until the length of the route is|r| − 2.

⇒ Two terminal nodes are appended to the network by choosing the ones with

highest usage in connection to the current ends of the route. The route is now complete and the process is reiterated.

⇒ In the beginning the busiest links will inevitably be used in the creation of routes.

By dividing the usage of each link by the factor 1.1 each time that link is put into a route, the links with initially low usage will eventually be put into routes as well (Soares et al. 2019). They will not occur as often as the links with initially high usage though.

2.4.2

Generating initial networks

Networks are created one at a time until a population|P | = 50 is reached. Combining routes into networks is done through two main ideas: ensuring connectivity to all nodes and all nodes being present in the full network.

(30)

CHAPTER 2. METHOD

to the network which maximises the number of new nodes introduced to it, if multiple choices exist then a route is sampled uniformly from those. Each time a route is added it is verified that the network shares at least one node with the new route to ensure connectivity. When all nodes are present in the network, the remaining routes are chosen randomly until the size of the network is|R|. The second network is then seeded with the second route in the palette and the process goes on until|P | = 50 networks have been created.

After the creation of a network it is verified whether the network fulfills the criterion in Section 2.2 on valid networks. All nodes to be present, connectivity to all nodes ensured and no overlap. If one of these occur, then a repair program is initiated which seeks to add the missing nodes or switch a route. The repair program is further explained in Section 2.6

2.5

NSGA-II

The implementation of NSGA-II is mainly based on the one in (Soares et al., 2019). The algorithm was first proposed in A Fast and Elitist Multiobjective Genetic Algorithm:

NSGA-II (Deb et al., 2002), where it is described to its full extent.

A graphical representation of the algorithm is demonstrated in Figure 2.5.1 where the initial population P0is inserted as Pt, representing Parent generation t. The details of

the algorithm are explained in the coming sections but summarized as:

The networks are evaluated and sorted into a series of Pareto fronts (F1, F2, ..) based on

their level of domination. Each solution is assigned a fitness value according to its front membership, with F1 being the fittest, F2 the second fittest, and so on. An offspring

population Q0, also of size |P |, is generated from P0 through binary tournament

selection, crossover and mutation. Next, the combined (mating) population M0 = P0 ∪ Q0 is used to select |P | route sets as a new parent population P1. This selection

is primarily based on domination but crowding distance is also taken into account. Crowding distance is an additional fitness measure used to obtain a wide spread of solutions that adequately covers the full extent of the Pareto front. The new parent P1

is used to generate Q1 via binary tournaments, crossover and mutation as previously.

(31)

CHAPTER 2. METHOD

Figure 2.5.1: NSGA-II method

2.5.1

Fitness value and pareto optimality

Fitness is a measure of how good a solution is, in our case it shows how good a network is with respect to the passenger CP and operator COobjective functions. The goal is to

have the objectives as low as possible and an example of different solutions, meaning each datapoint is a complete network of routes, are represented in Figure 2.5.2. The axes represent the objective functions. If operator and passengers objective are f1and f2 respectively, then the network i would have a lower operator objective but higher

passenger objective than network i + 1.

The dots marked black in Figure 2.5.2 are of a higher fitness value than the white ones, black belonging to front F1and white to F2. The data point i dominates the white point Ksince it is better with regard to both f1and f2and therefore belongs to a higher front.

Specifically, the network i(x1, y1)dominates network K(x2, y2)iff

(x1 ≤ x2 and y1 ≤ y2) and (x1 < x2 or y1 < y2), (2.5)

where x and y denote the location of the data point on the axes. The fronts are found iteratively by finding the first front F1then F2and so on, each time only extracting the

points which are not dominated by any other point.

(32)

CHAPTER 2. METHOD

Figure 2.5.2: Fitness fronts

The axes depict objective functions. Black dots are of a higher fitness value and therefore front since the white points are dominated by the black ones.

are merely fitness fronts. The difference is that the first fitness front F1 is pareto

optimal in relation to the other networks in the population |P |, not in relation to all possible variations of networks. Furthermore, when a generation of NSGA-II has been completed and if at least one network has been replaced by a more efficient one, i.e. taking its place in the parent population|P |, then a pareto improvement has occurred.

2.5.2

Crowding distance

Crowding distance is an additional fitness measure describing the networks. A high crowding distance implies that the solution is not very similar to any of the other solutions in the same front. It is a way of approximating whether the solution lies locally in the same solution space as the other solutions. It is a way of ensuring that new solutions are not limited to a local solution space. Calculation of the crowding distance is shown in Equation (2.6)

    

distance(f ront(min)) = distance(f ront(max)) =∞ distance(i) = distance(i) + o(max)o(i+1)−o(i−1)−o(min).

(2.6)

(33)

CHAPTER 2. METHOD figure.

2.5.3

Binary tournament and crossover

After finding the fitness values and crowding distance for the networks in the parent population Pt, a binary tournament and crossover takes place. Crossover is a process

where two parent networks are combined and a child is created. In order to decide which parents are to be combined, a binary tournament is held.

Two parents are randomly sampled from the parent population and the one with highest fitness wins, F1 being higher than F2. If they belong to the same front, the

highest crowding distance decides the winner. Pairs of winners are randomly selected and with a 90% crossover probability they are able mate and perform a crossover. With 10% probability one of the parents in the pair is chosen to be directly inserted as a child. At this stage the children are called ”non-mutated offspring” and is repeated until the number of offspring networks are of the same size as the parent population, namely

|P | = 50.

In the crossover, routes are picked alternately from the parent networks one by one. Always picking the route from the parent which introduces the most amount of new nodes to the child network, apart from the first route which is chosen randomly. It is important to verify that the child network created is valid according the constraints listed in Section 2.2. For instance that all nodes are present, connectivity ensured and no overlap between routes. If a network fails this test it is subject to a repair program further detailed in Section 2.6.

2.5.4

Mutation

Finally the offspring population is mutated, which means the networks are changed depending on the mutation operators applied on them. At the start of this phase a number is sampled from a binomial distribution B(|R|, 1

|R|)for each network, as done

in (Soares et al., 2019). It is the number of mutations applied on that network and for a network with four routes, |R| = 4, it can be any integer from zero to four. Which mutations and in what order they occur are chosen randomly and iteratively.

(34)

CHAPTER 2. METHOD

Three of which common to all prior research have been chosen for this study, namely

Add Nodes, Delete Nodes and Exchange. For the first two mutations a number Z U [0, ceil(lmax

2 )]is sampled, where ceil denotes a round-up if necessary and lmax being

the maximum allowed length of a route. The number Z decides how many nodes are to be added or deleted from a network. If a mutation operation is not possible to apply to a network, e.g. all routes already being full length when starting Add Nodes, the mutation is skipped.

• Add Nodes is a mutation in which Z nodes are added to the network. A route in the network is chosen randomly and nodes not already included in the route are either appended or prepended but only up to the maximum length lmaxand it

must end on a terminal node. Which nodes and in what order they are added is chosen randomly. The process is continued for a new random route until a total of Z have been added to the network.

• Delete Nodes is a mutation in which Z nodes are removed from the network. It is done similarly to Add Nodes in that it removes nodes from the ends and inward. A route is chosen randomly and all terminal nodes in it are found. The algorithm then tries to delete the set of nodes lying outside an inner terminal node. The process is continued for a new random route until a total of at least Z nodes have been removed. A route may not have less than lmin number of nodes.

• Exchange is a mutation in which two routes in a network exchange properties. The two routes are selected randomly and split at a common node. Exchanging these split routes with one another and merging is then attempted without violating a constraint.

After a mutation is applied on a network a validity and repair program is run, detailed in Section 2.6.

2.6

Validity and Repair program

The Validity and Repair program ensures the feasibility of a network. The following constraints, as previously mentioned in Section 2.2, are crosschecked:

(35)

CHAPTER 2. METHOD

• There is no overlap between routes. All duplicate routes or shorter routes which fully overlap with a longer route within a network therefore fails this test.

Each time a network is created through crossover or changed by mutation, it is subject to the Validity and Repair program. In the case of overlapping routes or duplicate routes, the shorter route is removed from the network and replaced by a route from the parent population which introduces the most number of nodes.

In (Soares et al., 2019) the missing nodes are added efficiently since they have specified ”valid” links as earlier explained in Section 2.4.1. Therefore a node C with high distance to both nodes A and B, which are very close and next to each other in a route, cannot be inserted in between them. Such an arrangement would be illogical as anyone who has travelled by bus well knows. Their definition of ”valid” links results in there most likely not being any links connecting nodes with high distance, since in most cases there will be another node disturbing that path.

Lacking an implementation of ”valid” links in this study, a new approach is taken. When a missing node is to be inserted into a network, it is determinstically chosen where by doing the following:

Figure 2.6.1: Graphical representation of distance value W .

⇒ For each link in a network, e.g. route {1-3-5-7} having links {{1-3}, {3-5}, {5-7}},

the missing node C is inserted in between all links. Resulting for example in a link {1-C-3}. The numbers 1,3,5,7 are indexes of nodes.

⇒ A distance value is calculated for each of the extended links. For an extended link

{A− C − B} the distance value W is graphically represented in Figure 2.6.1 and calculated as

(36)

CHAPTER 2. METHOD

⇒ The missing node is inserted between the two nodes having the smallest distance

(37)

Chapter 3

Results

In the following chapter the reader will be introduced to specifics about the MATLAB program, computation times and the final results regarding operator and passenger objective values of the solutions.

An example of a network is depicted in Figure 3.0.1. It is just a graphical representation of what a network could look like, not vital to the end results nor discussion.

Figure 3.0.1: Example solution of a network in Södertälje

3.1

Settings

(38)

CHAPTER 3. RESULTS

This was recommended by advisor and traffic planner Andreas Persson.

The actual time of transferring from one bus to another is set to 7.5 minutes instead of 5 minutes as stated in Section 2.2. This was done in an attempt to model a passengers unwillingness to stand waiting instead of spending their time in a vehicle. An arbitrary factor of 1.5 was therefore used as 5· 1.5 = 7.5. There are several index numbers for this factor to be found, for example in ASEK 6.1 (Trafikverket, 2018). In the case of this study however, analyzing and deciding on a factor would be over complicating the simplified problem at hand.

The different problem cases mentioned in Section 1.1.2 were created with different number of routes. The small problem consisting of 24 nodes with four routes|R|24 = 4,

just as the real routes to enable comparison. The larger problem consisting of 58 nodes had 18 routes for one case and 20 for another case,|R|58,1= 18and|R|58,2 = 20.

3.2

Run time

The program for each problem was computed on a Macbook Pro (Early 2015). CPU: 2,7 GHz Dual-Core Intel Core i5. RAM: 8 GB 1867 MHz DDR3. GPU: Intel Iris Graphics 6100 1536 MB. The run times of the respective problems are given as:

• The small problem with 24 nodes was run for 500 generations of NSGA-II. An exact running time could not be recorded, it took approximately 2 days.

• The case with 58 nodes and 18 routes required approximately 8 hours for one generation, some generations requiring more or less time. It was run for ten generations and the total computation time was approximately 80 hours.

• The case with 58 nodes and 20 routes required approximately 13 hours for one generation, some generations requiring more or less time. It was run for ten generations and the total computation time was approximately 130 hours.

3.3

Final solutions

3.3.1

58-node problem

(39)

CHAPTER 3. RESULTS

respective problem can be seen. One data point is a representation of a bus network, with the operator objective value specified on the x-axis and passenger objective on the y-axis. Each of the ten generations consists of |P | = 50 networks, implying that there are 50 green and red data points respectively. The reason for the black points not numbering to 400 is that efficient networks are saved and brought into the next generation. It is evident that the initial solutions (green) evolve to networks with lower overall costs during the course of NSGA-II in both problem setups. Another way of describing the evolution is to say that a pareto improvement occurs, some networks are dominated and replaced by more efficient children while some stay the same. No worse networks are brought into the next generation.

The final solution sets (last population) for both cases are shown in Figures 3.3.3 and 3.3.4 for 20 and 18 routes respectively. It is seen that the case with less routes reaches solutions which have just slightly lower operator objective value, 744.5 versus 764.5. Regarding the passenger objective the opposite is true, there it is approximately 9.86 for the smaller one and 9.40 for the longer one. Both results coincide with what is to be expected, more routes possible implies more links available to travel along whilst less routes ought to mean shorter distance driven. The general outlook of the plots show a tendency that networks are more centered towards lower operator objective in the case of less routes and vice versa regarding passenger objective for the case with more routes. The line marked in green in Figure 3.3.4 highlights densely positioned solutions for the case with less routes, a similar positioning of solutions can not be found in Figure 3.3.3 for 20 routes, where they are more widespread.

(40)

CHAPTER 3. RESULTS

Figure 3.3.1: Full solution set for a network of 58 nodes and 20 routes. Operator objective on x-axis and passenger objective on y-axis

3.3.2

24-node problem

The smaller problem consisting of 24 nodes was solved for 500 generations. The reason for so many generations being executed was due to the shorter computation time allowing it. The full solution set is depicted in Figure 3.3.7, each generation comprising of P = 50 networks. One data point is a representation of a bus network, with the operator objective value specified on the x-axis and passenger objective on the y-axis. It is evident that solutions improve over the course of the genetic algorithm, initial solution in green and later solutions in black. The dense area of black implies many solutions being located in that area. It also implies a sort of convergence since many solutions are centered there.

The final population is not clearly shown in Figure 3.3.7, it is located at the pareto front of the dense black area. A more clear representation of the last generation is shown in Figure 3.3.8. The real network which the problem is based on has CO = 149.5and

CP = 10.7. It is evident that the algorithm has created superior solutions in this model.

This does however not imply that the real world bus network would function better by replacing the existing routes with the proposed ones.

(41)

CHAPTER 3. RESULTS

Figure 3.3.2: Full solution set for a network of 58 nodes and 18 routes. Operator objective on x-axis and passenger objective on y-axis

(42)

CHAPTER 3. RESULTS

Figure 3.3.3: Last population for the network of 58 nodes and 20 routes. Operator objective on x-axis and passenger objective on y-axis

Figure 3.3.4: Last population for the network of 58 nodes and 18 routes. Operator objective on x-axis and passenger objective on y-axis. Green line highlits a

(43)

CHAPTER 3. RESULTS

Figure 3.3.5: First three pareto fronts for the network of 58 nodes and 20 routes. Operator objective on x-axis and passenger objective on y-axis

(44)

CHAPTER 3. RESULTS

Figure 3.3.7: Full solution set for a network of 24 nodes and 4 routes. Operator objective on x-axis and passenger objective on y-axis

Figure 3.3.8: Last population for the network of 24 nodes and 4 routes. Operator objective on x-axis and passenger objective on y-axis. The real network

(45)

Chapter 4

Discussion

In the following chapter the reader is introduced to an analysis of the main results and the method. Moving on to future work and finishing with a conclusion.

4.1

Computation time

The high computation time of the program greatly limits the capacity when solving the larger problems, 80 and 130 hours for only ten generations. Preferably more generations would have been computed if not for the run-time. Unfortunately, it is in larger problems the algorithm would be of greater use if applied on a real world scale. Due to the fact that traffic planners face a greater challenge when creating large-scale networks. The current process of network design is more focused towards adapting the current one and exploring local solution areas. The algorithm instead looks at the network design problem from an unbiased viewpoint and can therefore suggest networks of links and routes which might be harder to come up with.

(46)

CHAPTER 4. DISCUSSION

4.2

Results

Overall the results indicate that the algorithm performs well in regards to improving upon the initial solutions and finding better networks. Regarding the larger problems of 58 nodes it is hard to say how much better the networks would be if the algorithm was to continue running. Large pareto improvements are made during the course of the ten generations computed, depicted in Figures 3.3.1 and 3.3.2, indicating that longer run-time could enable even more efficient networks to be found. For the small problem of 24 nodes, the area of dense black datapoints in Figure 3.3.7 suggests that the pareto improvements made are not as drastic after many generations of NSGA-II. If a large network were to run longer, this behaviour might occur even later though since the solution space is larger. Solution space meaning the number of possible variations of networks and therefore the algorithm might not slow down in finding more efficient networks as fast.

When comparing the final populations of the two larger problems in Figures 3.3.3 and 3.3.4, it can be seen that 18 routes leads to more densely positioned solutions highlighted by the green line. It is obvious that fewer routes with the same number of nodes ought to mean less distance driven and therefore lower operator objective. Not obvious however, is that the solutions should be so densely populated in comparison to the case with 20 routes where they are more spread out. Fewer routes does mean smaller solution space which could lead to such a behaviour. The difference in widespread solutions might also depend on the random number generators executed in this run of the program. More runs of the program need to be made in order to describe the significance of increasing or decreasing the number of routes for a given number of nodes. It might also depend on how the algorithm is implemented, for example how many deterministic and statistic choices are made or how the mutations and repair program are implemented.

Whether the solutions are more widespread or not in regards to the number of routes inserted, the links and routes generated by the algorithm should not depend too much on small changes in route size. It is believed that as long as the number of routes specified in the program is closely similar in size to the number required in reality, the proposed links and routes might be of assistance.

(47)

CHAPTER 4. DISCUSSION

improved in comparison to ones in reality. The high computation time does however severely limit this possibility for problems of any size. There will always be circumstances in reality which are hard to implement in a model, therefore some degree of human decision making is unavoidable. Completely replacing the current way of creating bus networks might be overly ambitious. Rather the goal ought instead be creating a tool which assists in the current way of creating networks. Suggesting links or complete routes can be of help when a traffic planner constructs network designs and especially in large scale.

In the smaller problem where a comparison is made to real bus routes a superior solution is found, seen in Figure 3.3.8. As stated earlier though in Section 3.3.2, this does not imply the proposed network being superior in reality. Partly because a subsystem is modelled but also since one of the real bus routes does not translate well to the model since it almost overlaps with another route. This overlapping behaviour is not encouraged in the model since no simulation is made. Two similar routes in reality would be a way of relieving high crowding, in the model however there is only focus on the quality of the routes in terms of connectivity and distance.

It would be interesting to apply the algorithm on a semi-large real network which is geographically secluded. Then a better comparison can be made between the produced networks and the real one since a whole system is modelled and not a subsystem. Furthermore, it would be important to check that the routes in reality fits good into the model. Otherwise the same thing might occur as in this study, where one route overlapping affects how the network is evaluated.

4.3

Method and future work

(48)

CHAPTER 4. DISCUSSION

Most importantly, at least in relation to the approach taken in this study, would be investigating the importance of introducing ”valid” links as done in (Soares et al.,2019), mentioned in Section 2.4.1. If implemented, it might be that many illogical links can be avoided and better solutions found faster. On the other hand, some of these seemingly illogical links or routes which are then removed, might in fact be good depending on the distribution of demand. For example, a bus passing station B by 50 meters when going from station A to C might avoid rerouting to that station if the demand to and from station B is very low in comparison to the high demand A− C. This is however a specific case and if the algorithms purpose is to assist the traffic planner, such instances can be resolved afterwards.

Another point worth mentioning is the limited view the model has. No regard is taken to extreme travel times when finding the objective values. A maximum travel time for a passenger might be used as a constraint or punished in the passenger objective function Eq. 2.1. Another alternative could be that passengers with too long travel time choose to travel with other means of transportation. The number of people using alternate transportation could be modelled as an objective function and the problem would then try to minimize three functions instead of two.

One could argue that predetermined placement of stations is too limiting, instead of looking at areas of demand and placing stations as the routes are developed. Theoretically this would lead to even more efficient networks if the collected data models reality well. For a well developed area with many stations I would however rather argue for the former case. The reason being that demand data collected through the use of access cards is superior to other methods, such as market surveys. Removing the current stations and starting over from scratch would in that case both be costly and disqualify much of the demand data, as it is specific to stations. In reality this might be an unnecessary statement, since the incentive for placing stations is largely based on geography and surrounding population.

4.4

Conclusion

(49)

CHAPTER 4. DISCUSSION

(50)

Chapter 5

Bibliography

Cats, Oded & Jarlebring Rubensson, Isak & Cebecauer, Matej & Kholodov, Yaroslav & Vermeulen, Alex & Jenelius, Erik & Susilo, Yusak. (2018). FairAccess.

Ceder, Avishai & Wilson, Nigel. (1986). Bus network design. Transportation Research Part B: Methodological. 20. 331-344. 10.1016/0191-2615(86)90047-0.

Deb, Kalyan & Pratap, Amrit & Agarwal, Sameer & Meyarivan, T.. (2002). A fast and elitist multiobjective genetic algorithm: NSGA-II. Evolutionary Computation, IEEE Transactions on. 6. 182 - 197. 10.1109/4235.996017.

Fan, Lang & Mumford, Christine. (2010). A metaheuristic approach to the urban transit routing problem. J. Heuristics. 16. 353-372. 10.1007/s10732-008-9089-8.

Heyken Soares, Philipp & Mumford, Christine & Amponsah, Kwabena & Mao, Yong. (2019). An adaptive scaled network for public transport route optimisation. Public Transport. 10.1007/s12469-019-00208-x.

Jaramillo-Alvarez, Patricia & Gonzalez-Calderon, Carlos & Gonzalez-Calderon, Guillermo. (2013). Route optimization of urban public transportation. DYNA. 80. 41-49.

John, Matthew & Mumford, Christine & Lewis, Rhydian. (2014). An Improved Multi-objective Algorithm for the Urban Transit Routing Problem. 49-60. 10.1007/978-3-662-44320-0_5.

(51)

CHAPTER 5. BIBLIOGRAPHY

for public transit network design. Computers & Operations Research. 51. 21–29. 10.1016/j.cor.2014.05.001.

Mandl, C.E.: Applied network optimization. Academic Pr. (1979)

Mumford, Christine. (2013). New heuristic and evolutionary operators for the multi-objective urban transit routing problem. 2013 IEEE Congress on Evolutionary Computation, CEC 2013. 10.1109/CEC.2013.6557668.

SL. (2018). Årsredovisning [sll-arsredovisning-2018.pdf].

Available: https://www.sll.se/globalassets/bilagor-till-nyheter/2019/05/ sll-arsredovisning-2018.pdf [8/6 - 2020].

Trafikverket. (2018). Analysmetod och samhällsekonomiska kalkylvärden för transportsektorn: ASEK 6.1. MergedFile.

Available: https:

//www.trafikverket.se/contentassets/4b1c1005597d47bda386d81dd3444b24/ asek-6.1/asek_6_1_hela_rapporten_180412.pdf [8/6 - 2020].

(52)
(53)
(54)

TRITA -SCI-GRU 2020:245

References

Related documents

F Pneumatic lumbar support with infinitely adjustable height and depth.. G Feature to facilitate climbing in and out of the seat

The route choice model is therefore implemented as a hierarchical algorithm, including a continuous value of travel time (VTT) distribution.. The VTT distribution was

The neighbourhood is next to a neighbourhood which has com- plete services and infrastruc- ture (running water, electricity, running gas, sewage and street illumination)..

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

Stagmodellens inverkan: Normalkrafterna i brodäck (och pylon) är större vid harpamodell än vid radiella stag (solfjäder). Harpa passar därför sämre för stora spännvidder, eftersom

5.3 Utformning av valda designalternativ .... Enkät om kampanjmaterial för second hand Figurförteckning Figur 1. Teckensnitt och färger Stadsmissionernas grafiska profil

The herein presented RBEU concept, methods and results take these route based aspects of electrification utility and its use in network optimization

Industrial Emissions Directive, supplemented by horizontal legislation (e.g., Framework Directives on Waste and Water, Emissions Trading System, etc) and guidance on operating