A genetic algorithm for public transport driver scheduling

A genetic algorithm for public transport driver scheduling

Computers Ops Res. VoL 22, No. l, pp. IOl-llO, 1995 Perlpunon 03043-0548(93)EOO22-L A GENETIC Copyright © 1994 ElsevierS~'noe Ltd Printed in Great...

815KB Sizes 10 Downloads 72 Views

Computers Ops Res. VoL 22, No. l, pp. IOl-llO, 1995

Perlpunon

03043-0548(93)EOO22-L

A GENETIC

Copyright © 1994 ElsevierS~'noe Ltd Printed in Great Britain. All rights reaerced 0305-0548/95 S7.00+ 0.130

ALGORITHM FOR PUBLIC TRANSPORT DRIVER SCHEDULING

ANTHONY WREN? a n d DAVID O. WREN S School of Computer Studies, University of Leeds, Leeds LS2 9JT, England Seo~ and Perpme~Public transport driver scheduling is the construction of a set of shifts which together cover precisely a predefined vehicle schedule. The vehicles (buses, trains, etc.) may be engaged in urban transport (transit) operations, or may have a wider functionality. Drivers can be changed only when vehicles are at suitable positions, and their shifts are subject to a variety of rules. The complexities of the problem are such that a human scheduler has difficolty in producing a near-optimal schedule in the time available, and computer solutions have therefore been adopted over the past decade in many of the world's transit organisations. The problem has been addressed in a series of international workshops and in other literature. While several methods are available which regularly solve driver scheduling problems for individual users, and some methods have been adapted to wide ranges of clients, none of the existing methods can claim optimality for any but relatively trivial problems. Genetic algorithms may be a means of solving larger problems more robustly, more speedily and more cost effectively than existing methods. This paper presents some initial investigations of this field. Abstract--The problem of constructing daily shifts for public transport (generally bus) drivers is explained, and some of the currently available computer based solution methods are introduced. The need for improved methods is set out, and one of the more widely applied current methods is outlined in sufficient detail to show where new approaches may profitably be introduced. A feasibifity study is described in which a simple genetic algorithm has been developed in order to examine the suitability of such an approach. This has required the development of a new crossover operator. Such an algorithm could ultimately replace part of the presented existing method, making it more efficient in terms of both of quafity of result and of time taken to produce a good schedule. The simple algorithm has been shown to produce comparable results to the existing method on a test problem. The results encourage further investigation, but some complexities which can exist in real problems require further study. The results of the present experiments are presented, and the further complexities are discussed in the context of the genetic approach.

INTRODUCTION

The problem of constructing sets of shifts for public transport drivers which together efficiently cover previously scheduled vehicle work has attracted the attention of researchers since the mid 1960s [6-8]. A series of international workshops addressing this was initiated in Chicago in 1975 (unpublished) and continued from 1980 onwards [1-4]. Most of the published work refers to bus operation, and this paper is therefore written in terms of buses. However, many of the methods used have also been applied to rail transport. Several bus driver scheduling systems are now in widespread commercial application and produce solutions which are assessed by clients as better than those which previously existed. However, no current method can give a guaranteed optimal solution to anything but a relatively trivial problem, and there is scope for examination of alternative methods. In this paper we present the results of a feasibility study in which a genetic algorithm has been developed which might be expanded to treat parts of full scale problems. First, we describe the problem of bus driver scheduling and introduce some standard solution methods. We then set out tAnthony Wren is Professor of Scheduling and Constraint Management in the School of Computer Studies in the University of Leeds. He was responsible for the implementation of the world's first computer produced rail schedule in 1963. Since then he has initiated and led research on a variety of transport scheduling problems, most notably in connection with the bus industry. His work has led to the development of the BUSMAN scheduling system installed widely in the U.K. and elsewhere. ~David Wren, son of the above, undertook this work while on vacation from the University of Oxford where he has taken a degree in Physics. After completing a Master's course in Artificial Intelligence in the University of Edinburgh he is now studying there for a Ph.D. CAOR2z:I-H

101

102

ANTHONY WREN and DAVID O. WREN

in more detail one method which is in general use. The genetic algorithm is then described. Experiments to date have yielded very encouraging results. BUS DRIVER SCHEDULING Given a bus schedule which sets out the precise work to be undertaken by each bus in a fleet during the course of day, it is necessary to form drivers' shifts so that every bus has a driver at all times except when it is in a depot or at certain other designated points. The bus driver scheduling problem differs from many manpower scheduling problems in that drivers can only be changed when a bus is at one of a relatively small number of designated relief points. There is usually only one relief point associated with any journey; this may, for example, be one of the end-points, or outside a bus depot or other place with canteen facilities. Bus driver scheduling is similar to train driver scheduling, and some programs written to solve one problem have been successfully applied to the other. There is only a weak link to air crew scheduling. In most organizations, the formation of drivers' shifts (work for a single driver for a day) is subject to very strict rules governing such things as the amount of time that can be worked without a break, the elapsed time (spreadover) between start and finish of a shift, and the amount of daily work. These rules and their interaction make the formation of efficient schedules very difficult. Bus driver schedules in the U.K. usually contain up to about one hundred shifts, although larger ones are not uncommon, and some of three or four hundred are encountered. Larger numbers are quite common in some other countries. One of the authors first became involved in driver scheduling in 1967, and from then until the late 1970s led a research team developing heuristic approaches to the problem [9]. Some successful implementions were achieved, as reported by Parker and Smith [10], but substantial work had to be undertaken to adapt the heuristics to new situations. From 1978, the team turned its attention to mathematical programming approaches, leading to the IMPACS [5], system which was implemented by London Transport in 1984, and is now used in about forty operating sites in several countries. Several other bus driver scheduling methods exist (e.g. [12, 13]). All the major systems rely on a combination of mathematical programming with heuristics which restrict the problems to reasonable sizes, but the approaches adopted are very different. The objective is normally to minimize the number of shifts and to produce a solution in which the cost (normally expressed in hours paid) is acceptably low. It is a feature of the problem that there is usually a range of acceptable solutions. Scheduling systems normally produce one of these, but the extent to which the cost of that solution exceeds the true minimum is often not known. We shall shortly outline the IMPACS system in order to show later how the genetic approach may integrate with an existing system. We may however at this stage ask why a new approach is needed. Several of the existing systems consistently produce results which are claimed to be better than those of conventional manual systems. Our own experience shows that IMPACS can produce excellent solutions to the problems of the bus industry, with very little customization needed for new users, and that it can be extended to problems of rail driver scheduling. However, none of the existing methods can guarantee an optimal solution to any but the smallest problems. Lack of optimality in large problems is hidden from the user by the fact that optimal solutions are not known; indeed, manual solutions may be far from optimal. Computer systems generally claim savings of 1-4% over manual solutions. Drivers' costs in an urban operation of one thousand buses may amount perhaps to about £40 million per annum. Thus, even a small further improvement in efficiency has very great benefits. Solution times using present systems for large complex problems, while acceptable compared to manual methods, are still longer than is desirable, and some systems require several proving runs or further interactive adjustment before a satisfactory solution is obtained. A new system which finds solutions faster will allow the user to experiment with different operating strategies and thus to adjust services more rapidly to changing public needs. Although it is not always admitted by purveyors of commercial systems, it is known that all of these sometimes have difficulty in adapting to new situations. A more robust method is therefore desirable.

103

A genetic a l g o r i t h m for p u b l i c t r a n s p o r t d r i v e r s c h e d u l i n g Table 1. A selection of pos~ble drivers' shifts, including all those on bus No. 1 Shift

Report

Bus

Place

Time

Place

Time

Off

Stretch

Work

Spread

3

0529

74 18

Garage Baker

0549 1004

Delta Charlie

0915 1431

1446

3:46 4:42

8:28

9:17

1028 1816

4:34 3:50

8:24

12:22

18

0554 1426

1 18

Garage Charlie

0614 1431

Baker Delta

1023 1801

41

1008

1 33

Baker Charlie

1023 1514

Delta Garage

1422 1815

1835

4:14 3:21

7:35

8:27

55

1231

2 1

Garage Delta

1251 1639

Foxtrot Abel

1535 2138

2153

3:04 5:14

8:18

9:22

63

1407

1 53 81

Delta Baker Abel

1422 1655 1915

Delta Garage Garage

1639 1820 2311

2331

4:13 4:16

8:29

9:24

83

1502

31 25 1

Garage Baker Abel

1522 1920 2138

Garage Baker Garage

1815 2120 2319

88

1515

2 17

Foxtrot Foxtrot

1535 1901

Foxtrot Garage

1844 2332

3:13 2339

4:19

7:32

8:37

2352

3:29 4:31

8:00

8:37

We now present the driver scheduling problem in greater detail. As already stated, drivers can only join and leave buses at specific times, when they are at the garage, or when at certain designated relief points. The work of any bus may therefore be partitioned into a number of individuble units bounded by these times. A shift for a bus driver contains a number of such units of work chosen so that the shift satisfies the legal requirements and operating agreements; these units may be on a single bus, or on several buses. Because bus drivers are usually required to have meal breaks in most western countries, shifts usually cover more than one bus. (In some places, bus work is rearranged after formation of shifts so that a driver retains the same vehicle after the break, but logically this rearrangement process follows and is independent from driver scheduling.) Operating rules and terminology vary widely from one organization to another. We therefore introduce a terminology here. Examples of typical shifts are given in Table 1. A driver schedule is a statement showing how each shift is made up of several sequences of work units. (In some places sequences of units may be offered as overtime portions outside the normal shift structure, but such portions may be regarded as specialised shift types.) We define a spell of work as a series of consecutive units on the same bus covered by the same shift. Thus, a shift consists of one or more spells, while a spell consists of one or more units. A series of spells without an intervening meal break is called a stretch. Although other situations exist, normally each shift contains two or more stretches, each of one or more spells; each spell will contain one or more (usually more) units. A typical maximum strength length would be four and a half to five hours, including reporting time at the beginning or end. Normally a shift has two stretches, and in most situations the ideal stretch will consist of only one spell, as time spent changing bus within a stretch will count as worked time without contributing to productivity. However, it is generally impossible to construct an efficient schedule without using some shifts with three or more spells, and a good schedule will usually be a mixture of two-spell and three-spell shifts; sometimes particular operating rules require the introduction of shifts with four or more spells. Shifts are generally of two principal types; straight shifts of two stretches separated by a meal break of 30-60 min, and split shifts with a spreadover of perhaps about 12 h and consisting of two stretches separated by a gap of several hours. The meal break in a straight shift may or may not be paid. The work of a bus (e.g. bus No. 1 which is partially shown in Table 1) is often set out graphically as illustrated below, showing the shifts covering the individual units of work: 18 G ..... 0614

IS A ..... 0741

IS A....

0913

41 B.......

1023

41 A ....... 1254

63 D ........ 1422

55 D ..... 1639

55 B......

1811

55 C ..... 1949

83 A .....

2138

G 2319

The bus leaves the garage at 0614, passes relief point A (Abel) at 0741 and again at 0913, relief point B (Baker) at 1023, and so on, eventually returning to the garage at 2319. These point-time

104

ANraoNY WREN and DAvm O. WIEN

pairs (G-0614, A-0741, etc.) are relief opportunities, and define the units of work, 0614-0741, 0741-0913, and so on. In practice, there would probably be more frequent relief opportunities than can conveniently be shown here. Split shift 18, for example, covers the three units from 0614 to 1023, which therefore form a spell. A driver schedule in practice may consist of several hundred shifts, although many organizations schedule smaller groups of services separately. Computer methods have been successfully applied to all sizes of schedule, from a handful of shifts upwards. THE IMPACS DRIVER S C H E D U L I N G SYSTEM

The stages of IMPACS are summarized below. Fuller details of the heuristic precesses, which depend on analysis of the bus schedule, on parameters defining the working conditions, and on other parameters reflecting the quality of individual shifts, are found in 1"5]. (1) Remove any relief opportunities which are unlikely to be necessary. (2) Build several thousand potential shifts. (3) Apply an integer linear programming (ILP) approach using a specialized branch and bound technique to select from the potential shifts a subset such that all bus work is covered in an efficient way. At this stage constraints on the total number of shifts of certain types or durations may be imposed. The subset obtained comprises a driver schedule in which some units of bus work may be covered by more than one shift. Such duplicated assignment does not generally have a significant effect on the cost, as it is normally possible to obtain a solution with little duplication, and the cost of duplication is often marginal. It should be noted that the resultant schedule is in general not optimal because: some relief opportunities have been discarded; all possible shifts have not been built; the branch and bound search is terminated when a solution is found reasonably close to the continuous optimum. (4) Apply specialized heuristics to adjust the shifts selected in (3) so as to eliminate duplication and to refine the cost further. Larger problems may pass through a decomposition and reconciliation process, an early version of which is described in [11]. In order to find faster solution processes, and to avoid the need for decomposition which is wrongly perceived by some potential users as risky, research has continued on a wide front, with a view to replacing some or all of IMPACS with new methods, either for large problems or entirely. Investigation of genetic algorithms is one component of this research, and has concentrated initially on replacing stage (3) of the IMPACS process, the ILP. For the purpose of the present argument, salient points are that a large set of potential shifts has been obtained by stage (2) of IMPACS and that a good schedule has been obtained by the end of stage (3); this schedule is a subset of the stage (2) set. Success in the current genetic approach may result in stages (3) and (4) being superseded and may allow more shifts to be generated in stage (2), thereby reducing the danger of failing to include some shift that is vital to an optimal solution. A G E N E T I C A P P R O A C H TO D R I V E R S C H E D U L I N G

The problem addressed by stage (3) of IMPACS may be expressed as: Given a set of potential drivers' shifts which together cover the total bus work to be scheduled many times over, select a subset which will cover every piece of bus work at least once, in such a way that the total cost as expressed by some function is minimized and that certain constraints on combinations of shifts are satisfied. Given solutions with a certain number of shifts, optimality will usually be expressed in terms of wage cost combined with some measure of quality. In the remainder of this paper it is assumed that the primary objective is to minimize the number of shifts, while wage costs have been used to differentiate solutions with the same number of shifts.

A geneticalgorithm for publictransport driver scheduling

105

Goldberg [14] and others note the correspondence between natural chromosomes consisting of strings of genes, and strings in the artificial systems of genetic algorithms. A natural c h r o m o s o m e may be represented as:

lax l a 2 1 a s l a 4 [ . . ,

la(,_l) la, I

where ai is the value (allele) of the gene in the ith position (locus). This bears a striking resemblance to the graphical representation of a bus and its driver schedule already shown, and indeed if we pre-define the units by their bounding relief opportunities, the schedule, or solution, for bus number 1 may be represented as: I 181 181 18141 141 1631551 551 551 831 We may then string the work of all buses together, as long as we preserve elsewhere the definitions of the units and the buses to which they belong, and number these units sequentially: 1181181181411411631551551551 1 2

3

4

5

6

7

8

9

831 551 551 881etc. 12 13

10 * 11

The asterisk is included above to assist the reader; it shows the position in the string of the start oftbe second bus, but is not logically necessary. It may be noted that the units are not in chronological order here; shift 55 commences with a spell (units 11 and 12) at the start of the second bus and continues with a later spell (units 7 to 9, 1639 to 2138) on the first bus (see Table 1). In this example, the fourth unit in the string is covered by shift 41, i.e. locus 4 has value 41. Unlike the conventional binary representation of a string in GAs, which has already been argued against by Antonisse [15], the allele for a particular locus can be any of the shifts generated in stage (2) of IMPACS which cover the corresponding unit of work. However, if one locus takes a value n, then all loci covered by shift n must also take that value. That is, if shift n is used, then it covers all units of work included in it. (Here shift 41 covers units 4 and 5, and others on bus 33--see Table 1.) Before considering the implications of this, let us consider how a population of solutions may be generated. Stage (2) of IMPACS provides a set of shifts which together cover all the units to be scheduled, in general many times. We shall call any such set a cover, and the particular set of all shifts a primeval cover. The primeval cover is reduced by discarding shifts until a basic cover is obtained, i.e. a cover from which no further shift can be discarded without leaving some unit uncovered. The units are taken in chronological order of starting time, and at each stage the remaining shifts covering the current unit are treated, and discarded if this does not leave any work uncovered. Currently, in the feasibility study, the order in which the shifts covering a unit are treated is generated randomly; it would be possible to bias this process towards treating "bad" ones first, and this will be considered in further work. In general, such a basic cover will result in several units being over-covered. For example: 118118118/41141141163155155155183155155)881etc. 1 2 3 4 5 6 7 8 9 10 11 12 13 Here the third unit is covered both by shift 18 and by an extended shift 41 starting at 0913. Such over-cover indicates a slack schedule, the slack being caused either because the driver schedule is bad, or because the bus schedule contains periods during which more drivers than necessary can be available. In either situation all but one of the shifts which over-cover a unit may be curtailed to yield a valid schedule. By varying randomly the order in which shifts are considered for discarding, one may generate a whole initial population of solutions, the members of which are basic covers with in general several instances of over-cover as above. We call the above process of obtaining a basic cover from any starting cover distillation. Although we now have an initial population, it is not immediately obvious how a crossover operation could be designed for a genetic algorithm. While in natural genetics, an offspring may be a crossover consisting of part of one parental string and part of the other, such a crossover is meaningless in driver scheduling. An offspring which consisted of the front part of the above solution string, up to the end of unit 8, and the remainder of another string, would contain some of shift

106

ANTHONY WREN and DAVID O. WREN

55, as shown above, while the units covered in the above solution by the remainder of shift 55 (units 9, 11 and 12) might be assigned to a different shift or shifts. There would be no meaning to a solution which included part of a shift, but assigned the work of the other part of that shift to different drivers. Syswerda [16] has presented an alternative crossover operation in which sequences of genes are exchanged between parents to produce offspring. This would allow sequences of units which contained complete shifts only to be exchanged for other such sequences. Although such sequences could be found by suitable reordering of the units, the opportunities for straightforward exchanges involving other covers of the same units are severely limited, as was demonstrated during attempts in the 1970s to produce heuristics for this problem [9]. Others have used genetic algorithms to tackle problems with ordering dependencies. For example Whitley et al. [17] present a recombination operator which they have applied to travelling salesman and job shop problems. However, in the present problem the dependencies are more complex: if a gene (unit) takes a certain value (shift), then several other genes must take the same value. More strictly, since a unit can be covered by several shifts in a solution, the allele is the set of shifts coveting the unit, and any shift present in one allele is present in the alleles of all the units covered by that shift. We therefore define a new crossover operation. In this, the union of the shifts of the parents is formed to give a fertilized cover, and the distillation process is applied to this in order to obtain a new basic cover. Specifically, the set of all shifts contained in any parent is formed. Units of bus work are taken in chronological order, and shifts covering a specific unit are taken in random order and discarded from the set if doing so does not leave any unit uncovered. This operation may be called balls in the air since it is analogous to throwing all the genes of the parents into the air and catching only enough for a new offspring. We may note that by varying the random order in which shifts are discarded, one may obtain many different offspring from the same parents. More radically, the number of parents need not be restricted to two. Although the random ordering used in the distillation processes could have been biased in order to attempt to obtain good offspring, within the context of the feasibility study described here it was determined to keep matters simple, and, as in the distillation of the starting population from the primeval cover, no bias was used. INVESTIGATIONS

Tests were undertaken on a small problem for which a manual solution had been obtained with 17 shifts. By applying IMPACS it was subsequently determined that a solution with 15 shifts existed, but for technical reasons it was not possible to use IMPACS on this problem during the period of the study. A primeval cover of 539 shifts had previously been built using the first two stages of IMPACS; the costs of these shifts ranged from 420 to 626, measured in minutes of paid time. GENERATION

OF OFFSPRING

First, the process of mating and generating offspring was investigated without any formation of a new population. A trial population was generated by applying the distillation process randomly 1200 times to the primeval cover, using different random number seeds. Of this population, two members contained 17 shifts, while others contained up to 25. From this population, 1200 pairs of parents were chosen at random, and from each pair a fertilized cover was obtained which was then distilled once so that 1200 offspring were obtained. These offspring were observed to be on average better than the average of their parents, although the mating and the distillation of embryos had been obtained by unbiased random processes. There were in fact, five occurrences of 17 shifts among the offspring, and the average number of shifts was 20.40 compared with 21.21 among the parents. The average cost in hours paid was also lower among the offspring, but this is likely to have been simply because of the reduction in the numbers of shifts. No explanation is offered for this improvement which is reported here as a matter of interest. A preliminary conclusion was that there would be a fair chance of obtaining the number of shifts in the manual solution, given a suitably large initial population, and that the application of genetic

107

A genetic algorithm for public transport driver scheduling

techniques should enable these solutions to be improved. This encouraged the authors to proceed with further experiments. The experiment was next extended by "mating" 1200 sets of three parents chosen randomly. The balls in the air operator was applied to obtain the union of throe parents as a fertilized cover and to distil this in the established manner, with similar results to the two parent situation, and a slight improvement in average quality of offspring measured in terms of numbers of shifts (20.29). Eight further sets of 1200 basic covers were then generated by using different random number seeds in the distillation process, and from each, 1200 pairs and 1200 triples were mated, with the result that one out of the total of 10,800 initial solutions used only 16 shifts, as did two of the offspring. This caused some surprise that the manual solution had been bettered, but then led to concern that the newly established supposed optimum number of shifts had been obtained only three times in over 30,000 solutions. It had to be hoped that coding of the full evolutionary process including replacement of weak members of the population by offspring would improve the chance of obtaining optimal solutions. The table below shows the distribution of the numbers of shifts in the original populations and in the offspring of pairs and of triples of parents: Shifts Original Offspring: 2 parents 3 parents

16

17

18

19

20

21

22

23

24

25

26

27 Mean

1

19

223

869

2184

3106

2556

1286

438

107

10

1

21.21

2 0

70 82

591 682

1962 2104

3242 3339

2886 2821

1463 1300

475 414

93 57

14 I

2 0

0 0

20.40 20.29

The two offspring of 16 shifts had total costs of 8556 and 8568, while the original 16 had a cost of 8666. However, the offspring of 16 were each the result of mating two solutions of 21. The original 16 was a parent in a pairing twice: 16 & 20--, 19;

16 & 20--) 19;

and in a tripling five times: 16&19&20~ 19; 16&20&21 ~ 18; 16&20&22--* 19; 16&21&21 --, 20; 16&22&24 --, 20. This indicated that there was no close relationship between quality of parent and quality of offspring and that it would be dangerous in a genetic algorithm to discard population members simply because they contained significantly more shifts than the current best. This was consistent with the earlier experiments with heuristics [91 and indicated that certain poor solutions contained features that could lead to good offspring.

EVOLUTION

The incorporation of offspring into the population was then coded, but the population size had to be restricted to 100 for the feasibility study because of limitations in the version of C available. It has already been pointed out that the number of parents need not be restricted to two. In theory the number could be varied randomly across an evolutionary process, but for the current exercise, the number was provided as a parameter to the system, so that in every evolutionary experiment the number was fixed for all matings. Generation of the initial population, choice of parents, and order in which shifts were investigated during distillation were unbiased random processes. Whereas in many genetic algorithms, a whole population is reproduced and then used as the basis of a further evolutionary stage, here the more natural process of continuous evolution was followed. Offspring were allowed to enter the population immediately after they were distilled, provided they were better than the worst member, which was then discarded. The population was thus allowed to evolve gradually rather than as a series of leaps from one generation to the next. Naturally, a more sophisticated replacement process could have been used, but as in all parts of this feasibility study, the desire was to keep things simple at first. A total of ten initialpopulations of I00 members was generated, and each was allowed to evolve

108

ANTHONY WREN a n d DAVID O. WREN

Table 2. Ten experiments with each of two, three, four and five parents. Entries other than the cost rows show the iteration numbers at which solutions with 17, 16 and 15 shifts were first achieved, and the iteration numbers at which the best solutions were first achieved Experiment

1

2

3

4

5

6

7

8

9

10

Initial range

18-24

18-25

17-24

18-25

18-25

18-26

18-24

17-24

17-25

18-24

With two parents: 17 achieved at 16 achieved at 15 achieved at Best cost at iteration

136 243 -8215 670

35 339 -8326 531

0 208 773 7897 824

47 242 . 8385 817

54 155

30 81

0 163

8320 921

44 145 . 8388 478

8399 845

8332 895

0 217 631 7951 716

113 146 -8320 917

With three parents: 17 achived at 16 achieved at 15 achieved at Best cost at iteration

63 263 717 8030 915

26 381

0 156

84 202

29 162

4 57

8299 766

0 196 517 7920 517

0 80 532 7942 635

64 72

8310 990

14 261 912 7865 941

8356 667

With four parents: 17 achieved at 16 achieved at 15 achieved at Best cost at iteration

43 279 -8289 931

24 237 554 7899 865

0 251 843 8010 843

16 219 . 8374 699

0 298 689 7952 882

-72 -8427 981

With five parents: 17 achieved at 16 achieved at 15 achieved at Best cost at iteration

119 365 -8432 991

49 107 830 7965 846

0 17

105 267 710 8017 710

-

-

-

-

-

-

8315 17

.

.

-

-

-

.

-

-

-

-

-

8300 700

8322 849

8233 957

48 310

7 103

24 319

. 8270 953

8284 853

0 231 669 7975 953

49 203

32 191

0 247

0 361

12 174

8378 276

8385 828

8325 328

.

. 8335 883 41 228 971 8237 971

.

8364 580

.

.

8373 433

.

.

through four separate evolutionary processes, using two, three, four and five parents. It was desired to keep a complete record of the stages passed through during the evolution, and it was thus necessary to impose a limit on the number of matings. In accordance with the amount of storage available, this limit was set at 1000. The process was terminated before this limit was reached if all members of the population had the same cost, as happened in about 80% of the experiments. The results are summarized in Table 2. This shows, for each experiment, the range of numbers of shifts in the initial population. Then for each of two, three, four and five parents, the iteration number (mating) is shown at which 17, 16 and 15 shifts were first obtained, if at all. Often, once a solution had been found with a particular number of shifts, several iterations passed before the best solution with that number was found. The iteration number at which the best solution was obtained is therefore also shown, as is the cost of that solution. Thus in the first experiment, solutions in the initial population ranged from 18 to 24 shifts; a solution with 17 shifts was first obtained after 136 matings and with 16 shifts after 243 matings. The best solution (with 16 shifts) was obtained after 670 matings and had a cost of 8215. The first surprise was that several solutions with 15 shifts were found, two fewer shifts than in the manual solution. In every case these appeared after several generations, strengthening the case for genetic algorithms over earlier heuristics which had generally failed to progress from a poor solution to one with a lower number of shifts. Solutions with 15 shifts have been found for all numbers of parents, with costs varying from 7865 to 8237. While the results of the genetic algorithm would appear to be inconsistent, with best solutions having either 15 or 16 shifts, and varying costs, it would be reasonable to claim that by repeated application of the genetic algorithm, a solution with 15 shifts and a cost of 7865 has been obtained. If it had been possible to work with larger populations than 100, it would have been interesting to have seen the result of replacing the ten separate experiments for each number of parents with a single experiment on a population of 1000. It would also be tempting to conclude from Table 2 that three, four and five parents were better than two, but such reasoning would be dangerous without further evidence, and it certainly would n o t be safe to restrict the genetic algorithm to three parents, which happens to give the best solution here. The work was carried out on a PC with a 286 chip. Each experiment took approx. 5 min to generate the initial population, and a total of 10 min to evolve the four final populations, with two, three, four and five parents taking progressively longer to evolve.

A genetic algorithm for public transport driver scheduling

109

Following the completion of this work the problem was run through the IMPACS system. Although for this size of problem, IMPACS could produce an optimal solution, it was decided to apply the normal termination rules used in stage (3) in the hope of indicating what might happen in a larger problem. The solution had 15 shifts with a cost of 7890. The best solution obtained by the genetic algorithm is slightly better than this, with a cost of 7865, indicating that IMPACS terminated before optimality. Subsequently, IMPACS was allowed to run to optimality and obtained a solution with a cost of 7865 on the same machine after about 3 min.

COMMENTS

Unfortunately, time and finance did not allow experiments with larger data sets, which would have entailed restructuring the code because of limits on the version of C being used. However, the results demonstrate that, at least for this small problem, even a crude genetic algorithm can produce very good solutions, given a large enough population, or set of populations. The genetic algorithm has been coded in a very short period, while stage (3) of IMPACS contains code which has been refined over a period of 10 years. It is recognized that a much larger investigation is desirable. In particular, although several mutation operators were considered which might improve the process, their incorporation was beyond the scope of the study. As a result of an initial report, funding has been made available to enable a full-scale investigation to be carried out. This will examine many extensions of the algorithm. It will also enable the best role of the genetic algorithm within or instead of the existing IMPACS process to be determined. It will be interesting to discover whether larger problems will yield a higher or lower proportion of good solutions in the initial cover or in the subsequent generations. Intuition based on over 20 years' experience with heuristic solutions to this problem leads one to believe that the power of genetic algorithms will be most apparent in large problems provided that intelligently biased choice may be incorporated. SUMMARY

A new crossover operator has been applied to a problem type for which conventional crossover is not appropriate. Results of a genetic algorithm incorporating this compare favourably in a feasibility study with those produced by an established method. It is hoped in further work to extend the process by including mutation and other features, and to establish a full system replacing some or all of the established method. REFERENCES 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14.

A. Wren (Ed.), Computer Scheduling of Public Transport. North-HoUand, Amsterdam (1981). J.-M. Rousseau (Ed.), Computer Scheduling of Public Transport--2. North-Holland, Amsterdam (1985). J. R. Daduna and A. Wren (Eds), Computer-aided Transit Scheduling. Springer, Berlin (1988). M. Desrochers and J.-M. Rousseau (Editors) Computer-aided Transit Scheduling. Springer, Berlin (1992). B. M. Smith and A. Wren, A bus crew scheduling system using a set covering formulation. Transportation Res. 22A, 97-108 (1988). S.E.G. Elias, The use of digital computers in the economic scheduling for both man and machine in public transportation. Kansas State University Bulletin, Special Report No. 49 (1964). A. Wren, Computers in Transport Planning and Operation. Ian Allan, London (1971). A. Wren, A general review of the use of computers in scheduling buses and their crews. In Computer Scheduling of Public Transport (Edited by A. Wren), North-Holland, Amsterdam (1981). B. Manington and A. Wren, A general computer method for bus crew scheduling. Presented at the Workshop on Automated Techniquesfor Scheduling of Vehicle Operators for Urban Public Transportation Services, Chicago (1975). M. E. Parker and B. M. Smith, Two approaches to computer crew scheduling. In Computer Scheduling of Public Transport (Edited by A. Wren), pp. 193-221. North-Holland, Amsterdam (1981). A. Wren and B. M. Smith, Experiences with a crew scheduling system based on set covering. In Computer-aidedTransit Scheduling (Edited by J. R. Daduna and A. Wren), pp. 104-118. Springer, Berlin (1988). J.-Y. Blais and J.-M. Rousseau, Overview of HASTUS current and future versions. In Computer-aided Transport Scheduling (Edited by J. R. Daduna and A. Wren), pp. 175-187. Springer, Berlin (1088). J. R. Daduna and M. Mojsilovic, Computer-aided vehicle and duty scheduling using the HOT programme system. In Computer-aided Transit Scheduling (Edited by J. R. Daduna and A. Wren), pp. 133-146. Springer, Berlin (1988). D. E. Goldberg, Genetic Algorithms in Search, Optimization, and Machine Learning. Addison-Wesley, Reading, Mass. (1989).

110

ANTHONYWRENand DAVIDO. WREN

15. J. Antonisse, A new interpretation of schema notation that overturns the binary encoding constraints. In Proc. Third Int. Conf. Genetic Algorithms, pp. 86-91. Morgan Kaufman, San Marco (1989). 16. G. Syswerda, Uniform crossover in genetic algorithms. In Proc. Third lntl Conf. Genetic Aloorithms, pp. 2-9. Morgan Kaufman, San Mateo (1989). 17. D. Whitley, T. Starkweather and D'A. Fuquay, Scheduling problems and travelling salesmen: the genetic edge recombination operator. In Proc. Thirdlnt. Conf. Genetic Algorithms, pp. 133-140. Morgan Kaufman, San Mateo (1989). 18. R. S. K. Kwan, A. Wren and L. Zhao, Driver scheduling using intelligent estimation techniques with heuristic searches. In Computer-aided Transit Scheduling (Edited by M. Desrochersand J.-M. Rousseau),pp. 379-395. Springer,Berlin(1992).