t039 - a new genetic algorithm for optimal routes generation in public transport network

Upload: ikhsan854n

Post on 03-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 t039 - A New Genetic Algorithm for Optimal Routes Generation in Public Transport Network

    1/8

    XIII INTERNATIONAL CONFERENCE - SYSTEM MODELLING and CONTROL

    SMC2009 OCTOBER 12-14, 2009, Zakopane, Poland

    A NEW GENETIC ALGORITHM FOR OPTIMAL ROUTESGENERATION IN PUBLIC TRANSPORT NETWORK

    Jolanta Koszelew, Anna Piwoska

    Bialystok Technical University, Wiejska 45A, 15-351 Bialystok, Poland

    [email protected], [email protected]

    Abstract - This paper presents a new genetic algorithm, called Routes Generation Genetic Algorithm(RGGA), for determining routes with optimal travel time. The algorithm is illustrated on the simple

    example of transportation network. The method was implemented and tested on the real transport network

    in Bialystok city. Effectiveness of the method was compared with another algorithm Routes Generation

    Matrix Algorithm (RGMA) which is based on special transfer matrices.

    1. IntroductionThere are many economic and ecological arguments for using public transport in modern cities.Therefore portals with journey planners are very popular. Users of such system determine sourceand destination point of the travel, the start time, their preferences and system returns as a result,

    information about optimal routes. In practice, public transport users preferences may be various,

    but the most important of them are: a minimal number of transfers and a minimal travel time.Finding routes with minimal number of transfers is not a difficult problem, but generating routes

    with minimal time of realization is much more complexity task.

    Standard shortest path algorithms [3] find the shortest paths in networks with static anddeterministic links, meanwhile algorithms for a scheduled transportation network are time-

    dependent. Moreover, standard algorithms considered graphs with one kind of links. Graph which

    models a public transport network includes two kinds of edges: directed links which representconnections between bus stops and undirected edges correspond to the travel between each pair ofneighboring nodes (bus stops) on foot. Additionally, with each node in graphs that represent

    transportation network, is concerned detail information about: timetables, coordinates of bus stops,etc. This information is necessarily to determine weights of links during realization of the

    algorithm. Those three differences between graphs in standard shortest paths problem and publictransportation networks cause that complexity of algorithms which solve routing problem in suchoriginal network representation, increase. Special approximation methods have to be compiled for

    a construction of optimal paths in this model.

    There are only few methods which solve this special kind of routing problem. Some of them arebased on KSP problem (K-shortest paths problem) [1] and label-setting technique [10]. Anotheruse transfer matrix [5-6].

    Authors present a new original genetic algorithm, called RGGA for determination routes withoptimal travel time. The method was implemented and tested on the real public transport network

    in Bialystok city. Effectiveness of the method was compared with another solution, called RGMA,which is described in [5]. RGMA uses two special matrices, called transfer matrix and minimal

    distance matrix and realizes the following assumption: routes with minimal (or close to minimal)

  • 7/29/2019 t039 - A New Genetic Algorithm for Optimal Routes Generation in Public Transport Network

    2/8

    number of transfers or with minimal length (number of bus stops on the route) have probablyoptimal time of realization.

    Next section includes definition of optimal routes generation problem and description of publictransport network model. In the third section authors present RGGA and illustrates it by a simple

    example. Section 4 is concerned on the comparison of effectiveness of both methods (RGGA andRGMA) in two aspects: time complexity and quality of results. This comparison is based on

    experimental results which were performed on realistic data. The paper ends section with someremarks about future work on improving of RGGA.

    2. Network Model and Problem Definition

    A public transportation network in our model is represented as a bimodal weighted graph [7]

    tEVG ,,= , where Vis a set of nodes, Eis a set of edges and tis a function of the weights. Each

    node in G corresponds to a certain transport station. We assume, for simplification, that there is

    only one kind of public transportation the bus, so each node corresponds to a bus stop. Thisassumption does not limit the applications of the presented methods. We also assume that bus stops

    are represented with numbers from 1 to n. The directed edge ( ) Elji ,, is an element of the set E,the bus line number l connects the stop number i as a source point and the stop number j as a

    destination. One directed edge called bus link corresponds to one possibility of the connection

    between two stops. Each edge has a weight tij which is equal to the travel time (in minutes) betweennodes i andj which can be determined on the base of timetables. A set of edges is bimodal because

    it includes, besides directed links, undirected walk links. The undirected edge { } Eji , is anelement of the set E, if walk time in minutes between i and j stops is not greater then limitw

    parameter. The value of limitw parameter has a big influence on the number of network links(density of graph). The tij value for undirected edge {i,j} called walk link is equal to walk time inminutes between i andj stops. We assume, for simplification, that a walk time is determine as an

    Euclidian distance between bus stops. It is very important to take the walk links into consideration,

    because public transportation network is very rare in small cities or peripherals districts of big

    cities, and walk links increases chance of finding at least one route between bus stops, which arelocated in such regions.

    A graph representation of public transportation network is shown in Fig. 1. It is a very simpleexample of the network which includes only nine bus stops. In the real world the number of nodes

    is equal to 1500 for the city with 250 ts. citizens.

    Formal definition of our problem is the following. At the input we have: graph of transportationnetwork, timetables times of departures for each stops and each line, source point of the travel,

    destination point of the travel, starting time of the travel, number of the resulting paths (k),

    maximum number of transfers (maxt) and limit for walk links. maxt parameter is required only forRGMA method. At the output we want to have the set of resulting routes, contains at most kquasi-

    optimal paths with minimal time of realization (in minutes), with at most maxt transfers

    assumption important only for RGMA.

    The tij values are marked in Fig. 1 only for walk links, because only this kind of links is timeindependent. Weights for bus links are strongly dependent on the starting time parameter and can

    be compute only during the realization of algorithm. We can determine tij values for bus links using

    timetables. We assume, for simplification, that each bus line has the same timetables for eachweekday.

  • 7/29/2019 t039 - A New Genetic Algorithm for Optimal Routes Generation in Public Transport Network

    3/8

    Fig. 1. Representation of a simple transportation network (different styles of bus links mark

    different bus lines)

    3. The Routes Generation Genetic Algorithm

    The RGGA starts with a population ofP randomly generated initial solutions of our problem. Each

    solution is a valid route and is generated in a special way, taking into account the graph oftransportation network. Starting from source point of the travel, we randomly choose the number of

    bus line (or walk link if presented) and the next bus stop, from all possible edges coming out from

    this node with equal probability. The bus stop at the end of selected edge is then considered as thestarting node, from which we again randomly choose the edge and so on. This process continues

    until we reach destination point and the whole route is completed. Additional assumption is thatevery bus stop can be included to the route only once (there are no loops). Note that in thisproblem, unlike in TSP problem [4-8], chromosomes lengths are not equal. Fig. 2 presents example

    of two individuals for network illustrated in Fig. 1. Source point of the travel is bus stop 1,destination point of the travel is bus stop 9 and starting time of the travel is 6 a.m. Each rectanglerepresents one gene. The first field of a gene denotes a number of bus stop, the second arrival

    time at this bus stop, the third departure time from this bus stop.

    1

    6:00

    6:10

    2

    6:13

    6:20

    8

    6:23

    6:23

    5

    6:26

    6:26

    9

    6:28

    9

    6:28

    4

    6:07

    6:20

    5

    6:23

    6:26

    1

    6:00

    6:01

    6

    6:03

    6:03

    8

    6:05

    6:05

    7

    6:04

    6:04

    Fig. 2. Example of two individuals in the RGGA

  • 7/29/2019 t039 - A New Genetic Algorithm for Optimal Routes Generation in Public Transport Network

    4/8

    The next step is to evaluate individuals in the initial population by means of the fitness function. Itmeasures the quality of the represented solution - the time of realization of the tour, in minutes.Since we have minimalization problem, the smaller fitness value, the fitter individual is.

    Once we have the genetic representation and the fitness function defined, the RGGA starts to

    improve initial population through repetitive application of selection and crossover. In ourexperiments we used tournament selection with elite strategy [9]:Ebest solutions are copied to the

    next population and the remaining individuals are selected through P-E tournaments. Sincechromosomes lengths are different, we presented a new heuristic crossover operator, adjusted to

    our problem.

    In the first step, individuals, except the elite, are randomly coupled. Then, each couple is tested if

    crossover can take place. If two parents do not have at least one common bus stop, crossover can

    not be done and parents remain unchanged. Crossover is implemented in the following way. First

    we randomly choose one common bus stop, it will we the crossing point. Then we exchangefragments of tours from the crossing point to the end bus stop in two parent individuals. The

    example is presented in Fig. 3. In this figure numbers in squares denote bus stop numbers andnumbers above lines denote bus line numbers. Each bus line is drawn with different line.

    12 3

    1 1

    4 2 5

    2 2

    4 2 32 1

    1 2 51 2

    parents offsprings

    Fig. 3. Crossover operator (bus stop number 2 is the crossing point)

    After crossover, we must correct offspring individuals in two ways. First we eliminate so called

    bus stop loops. An individual contains a bus stop loop if a given bus stop is presented twice in atour. Elimination of such loop is simply deleting all bus stops between repeating bus stop.

    The second step is to eliminate so called line loops. A line loop is presented when series of onebus line is separated by another bus line. In this situation we simply replace appearance of another

    bus line by original one.

    The last step of RGGA is mutation operator. It can take place for each individual in the population,

    except the elite, with the probabilitym

    p . When a given individual is to be mutated, the algorithm

    first randomly choose two bus stops between which more then one edge exists. Then the edge

    between bus stops is replaced by another one, randomly chosen with equal probability.

    These steps are repeated a predefined number of generations and as the result we obtain thepopulation from the last generation, sorted by the time of realization of tours.

    4. Experimental Results

    The number of computer tests was conducted on real data of transportation network in Bialystokcity. This network consists of about 700 bus stops, connected by about 30 bus lines. There was

    assumption about length of walk links they were limited to 15 minutes. The parameters of RGGAwas: P=100,E=2,pm=0.1.

  • 7/29/2019 t039 - A New Genetic Algorithm for Optimal Routes Generation in Public Transport Network

    5/8

    The first experiment was conducted on the route from Pulaskiego street (bus stop Kindergarten) toWarszawska street (bus stop Piastowska). This case is an example of the set of routes (labeled A) in

    which the source point and the destination point of travel are connected with at least one direct busline. Another feature of this kind of routes is their length: they are relatively long. The inputparameters of both algorithms were: start time was equal to 7:00 a.m., kind of day of week:

    weekday, length of walk links was equal to 5 minutes. The RGGA returned as a result the rout with

    time realization equal to 14 minutes (route without transfers, one bus line nr 2), the RGMA

    returned the rout with time realization equal to 25 minutes (route with one transfer, bus lines nr 26and 28). These results are illustrated on the below picture.

    Fig 4. The best results found by the RGGA (on the top) and the RGMA (on the bottom) the first experiment

    The second experiment was conducted on the route from the Church of Saint Jadwiga bus stop toMoniuszki street bus stop. This case is an example of the set of routes (labeled B) with many

    possibilities of reaching from the source point to the destination point of travel. Another feature ofthis kind of routes is relatively large number of required transfers. The input parameters of both

    algorithms were: start time was equal to 4:00 p.m., kind of day of week: weekday, length of walklinks was equal to 10 minutes. The RGGA returned as a result the rout with time realization equal

  • 7/29/2019 t039 - A New Genetic Algorithm for Optimal Routes Generation in Public Transport Network

    6/8

    to 29 minutes (route with one transfer, bus lines nr 20 and 6), the RGMA returned the rout withtime realization equal to 36 minutes (route with one transfer, bus lines nr 21 and 13). These results

    are illustrated on the below picture.

    Fig 5. The best results found by the RGGA (on the top) and the RGMA (on the bottom) the second

    experiment

    For the purpose of comparison of two algorithms, we carried out two kinds of experiments, firstfor investigating the time complexity of algorithms, second for examining quality of returned

    routes (time of realization).

    The comparison of the time complexity of RGGA and RGMA is presented in Fig. 6.

  • 7/29/2019 t039 - A New Genetic Algorithm for Optimal Routes Generation in Public Transport Network

    7/8

    Fig. 6 The comparison of the time complexity of RGGA and RGMA

    On the horizontal axis there are points representing the minimal number of bus stops on a route.

    These vaules were computed as a result of standard BFSgraph search method [2] and they are

    correlated with difficulty of the route. On the vertical axis there is marked time of execution in ms(processor Pentium 3.0 GHz).

    Each possible route with a given number of the minimal number of bu-stops was tested by twoalgorithms at starting time equal to 7:00 a.m., weekday. The executing time of algorithms was

    averaged over every tested routes. We can see that RGGA performes in shorter time than RGMA.

    For the purpose of comparison of quality of algorithms, we performed another set of tests. Weperformed 20 experiments, 10 for routes from set A and 10 for routes from set B. On the verticalaxis we marked time of the reazlization of the routes, averaged over 20 test cases, for starting time

    of the journey from 5:00 a.m. to 10:00 p.m. during weekday (horizontal axis).

    Fig. 7 The comparison of the quality of RGMA (on the top) and RGGA (on the bottom)

  • 7/29/2019 t039 - A New Genetic Algorithm for Optimal Routes Generation in Public Transport Network

    8/8

    Observing above Fig. 7 one can see that both algorithms return results with comparable quality.

    We can conclude on the base of our experiments that RGGA returns results as good as RGMA, but

    is significantly faster.

    5. Conclusions

    The reason of developing a new heuristic algorithm was high complexity of matrix based

    algorithms [5-6]. The time of computing sub-optimal routes in matrix algorithm was not acceptable

    for big and dense transportation networks. Computer experiments have shown that geneticalgorithm (RGGA) generates routes as good as matrix based algorithms (RGMA), but significantlyfaster.

    The problem with RGGA is its premature convergence which can be solved by including to the

    algorithm additional mechanisms [4-8]. Another method of improving RGGA can be based on

    special heuristics of generation of initial population, taking into account geographical location ofbus stops on routes.

    The future work will be focused on testing RGGA on bigger and more dense transportation

    networks, for example for Warsaw city. We also plan to test algorithm on country-wide busnetwork (PKS in Poland).

    References

    [1] R. K. Ahuja, R. Orlin, J.B. Pallotino, S. & Scutella, M.G. Dynamic shortest path minimizing travel times

    and costs, Networks, vol. 41(4), pp. 197-205, 2003

    [2]T. H. Cormen, C. E. Leiserson, Ronald L. Rivest, and C. Stein, Introduction to Algorithms (Second

    Edition), MIT Press, 2001

    [3] E. Dijkstra, A note on two problems in connection with graphs, Mumerische Mathematik 1, pp 269-271,1959

    [4] D. E. Goldberg, Algorytmy genetyczne i ich zastosowania. WNT, Warsaw, 1995

    [5] J. Koszelew, Two methods of quasi-optimal routes generation in public transportation network, IEEE.

    Computer Society, pp 231-236, 2008

    [6] J. Koszelew, Approximation method to route generation in public transportation network, Polish Journal

    Environment Studies - Vol.17, nr 4C, pp 418-422, 2008

    [7] J. Koszelew, The Theoretical Framework of Optimization of Public Transport Travel,6th InternationalConference on Computer Information Systems and Industrial Management Applications IEEE-CISIM07,

    Elk, Poland,eds. Khalid Saeed, Ajith Abraham, Romuald Mosdorf;[org.] Bialystok Technical University [et

    al.], pp 65-70, 2007

    [8] Z. Michalewicz: Algorytmy genetyczne + struktury danych = programy ewolucyjne. WNT, Warsaw,

    1996

    [9] M. Mitchell: An Introduction to Genetic Algorithms. MIT Press, Cambridge, MA, 1996

    [10] Q. WU, J. K. Hartley, Accommodating User Preferences in the Optimization of Public Transport Travel,

    International Journal of Simulation Systems, Science & Technology: Applied Modeling & Simulation, pp

    12-25, 2004