• Keine Ergebnisse gefunden

The improvement heuristic used in the existing approach is a VNS with an embedded VND as described in section 3.1. The implemented VND uses the following neighbourhood structures (Figure 4.3):

shift job: This move shifts one jobj ∈ Jpre from one tourRi1 to another tourRi2, i1 6= i2. In the new tour the best position (according to the objective function) is searched for the shifted job.

reposition job: A job Rni1 ∈ Jpre of a nursen ∈ N is moved to another positioni2, where i2= 1, . . . ,|Rn|andi26=i1, without reordering the other jobs.

swap nurses: By this move, two nursesn1 ∈ N andn2 ∈ N are swapped with each other, i.e., the tour of the first nurse is then handled by the second nurse and vice versa. Excluded from the swap are nurses with at least one jobj ∈ Jpre assigned to them.

Table 4.1:Influencing terms in the objective function γi

v1 — contains the number of invalid job-assignments, i.e. either a missing assign-ment of a job to a nurse or an insufficient qualification of a nurse (Constraint 1 - 3)

v2 — counts the number of travel time violations, i.e., the number of times a nurse cannot reach a customer before the service should start. (Constraint 4) v3 — contains the number of violations of nurse availabilities, i.e. the number of

jobs that are assigned to nurses outside of the nurses’ time window. (Con-straint 5)

v4 — contains the number of violations concerning pre-allocated jobs that must not be shifted to other times or nurses. (Constraint 6)

v5 0.2 quantifies the distances from the required qualificationqj of all jobsj ∈ J to the qualificationqnof the assigned nursen ∈ N. The distance between two qualificationsqi andqi0 is defined as|i−i0|. (Constraint 7)

v6 0.2 quantifies the deviation from the start time windows[sj,ej]of all jobsj∈ J. Violations of these time windows are penalized using a quadratic function except that deviations of three hours and above are considered equally bad.

(Constraint 8)

v7 0.1 quantifies the deviation from the desired start time tj of all jobs j ∈ J. Deviations from the start time are linearly penalized, except that similarly to time window violations, deviations of one hour and above are assumed to be equally bad. (Constraint 9)

v8 0.2 quantifies violations of preferences stated by nurses and customers and is normalized over the number of jobs. (Constraint 10)

v9 0.1 quantifies the working time outside the daily maximal working time (addi-tional hours of work are counted as overtime and are therefore higher paid, resulting in higher costs for the employer)

v10 0.1 quantifies the working time of all nurses n ∈ N up to the daily maximal working time

v11 0.1 quantifies the overall travel time of all nurses.

As step function a next improvement strategy is applied and the initial neighbourhood order isshift jobs,swap nurses, followed byreposition job.

Although this initial neighbourhood order leads to rapid improvements during the starting phase of VND, preliminary tests revealed that dynamic neighbourhood reordering as applied in [45] frequently leads to better results. This reordering is done by first storing the improve-22

n1

Figure 4.3: Examples for the 3 neighbourhood structures: (a) shift job, (b) reposition job and (c) swap nurse.

ment/examined ratio of each neighbourhood and then reordering them when an improved solu-tion has been found. The outline of the VND approach can be seen in algorithm 4.1.

As the algorithm may get stuck in a rather poor local optimum using VND only, it is embed-ded as a local search phase in a general VNS scheme as described in section 3.1 using a random shift job move as shaking procedure andk= 1, . . . ,5(see Algorithm 4.2).

Input: Solutionσ, Neighborhood orderingN Output: Best solutionσfound

1 l←1;lmax← |N|;σ ←σ;

2 whilel≤lmaxdo

3 σ ←Ni);

4 Nl.examined←Nl.examined+ 1;

5 ifob(σ)< ob(σ)then

6 σ ←σ;

7 l←1;

8 Nl.improved←Nl.improved+ 1;

9 reorder(N);

10 else

11 l←l+ 1;

12 end

13 end

14 returnσ;

Algorithm 4.1:VND

Input: Solutionσ, Integerkmax

Output: Best solutionσfound

1 k←1;σ ←σ;

2 whilek≤kmaxdo

3 σ ←shaking(k, σ); // perform k random shift moves on σ

4 σ ←VND(σ); // do local search (in our case the VND)

5 ifob(σ)< ob(σ)then

6 σ ←σ;

7 k←1;

8 else

9 k←k+ 1;

10 end

11 end

12 returnσ;

Algorithm 4.2:VNS

24

CHAPTER 5

Metaheuristics

Based on the methods described so far, this chapter will present the three metaheuristics im-plemented into the existing framework to tackle the MHS problem. An important feature of the solving architecture developed at the AIT is the ability to be adapted to the requirements of different providers easily, thus the use of constraint dependent solving methods have been omitted.

Additional information about the parameters and operators used is also provided in the re-spective sections of the metaheuristics. Further preliminary experiments are described in the next chapter.

5.1 Simulated Annealing Hyper-Heuristic

The developed approach differs from Bai et al.’s SAHH (see section 3.2) as the low-level heuris-tics and parameters have been adapted to solve the MHS problem. The outline of the algorithm is shown in algorithm 5.1.

The low-level heuristics for the NRP proposed in the work of Bai et al. uses low-level heuristics creating solutions based on specific constraints. As this thesis focus on a constraint-independent approach, more general low-level heuristics have been implemented. These are variants of simple local search procedures, which are created by combining every move type described in section 4.4 with two improvement strategies, i.e. the classic next improvement and a random-improvement strategy, leading to a total number of six low-level heuristics.

The use of random improvement is obvious as the SAHH should be able to accept also worse solutions in order to escape local optima. Using next improvement in favour of best improvement provides the higher chance to escape a local optimum after a worse solution of the same neighbourhood structure has been accepted. Another feature of next improvement is the lower search time needed in average as not the whole neighbourhood has to be searched. The same arguments can be used when comparing with the best of improvement strategy.

Bai et al. suggest that around 10% of the solutions should be accepted at the beginning (rstart) and only0.5%at the end of the search (rend). As described in section 3.2 the probabilistic

Input: Solutionσ

Output: Best solution foundσ

1 i←1;σ←σ;

21 ifreheating=truethen

22 timp←timp/(1−(beta()∗timp));

Algorithm 5.1:Simulated Annealing Hyper-Heuristic procedure 26

Table 5.1:Parameter settings for SAHH SAHH Parameters Settings

K (# iterations) 10000

acceptance prob. (start) 0.10 acceptance prob. (end) 0.005

learn period K/500

nrep (#iter/temp) 6 (#neighbourhoods)

min weight 0.1

change of temperaturet Lundy and Mees’ nonlinear function:tt/(1 +βt), β= ((tstarttend)·nrep/K·tstart·tend)

decision whether to accept an inferior solution is based on the formulae−d/t. To calculate the start and end temperature a proper value for the term din the following equations has to be found:e(−d/tstart)= 0.1ande(−d/tend)= 0.005.

After some preliminary testingd = 1.0 was selected, thus 10% of the solutions with an objective value of 1.0 worse than the current one are selected at the beginning and0.5%at the end. The final settings are summarized in table 5.1.

5.2 Memetic Algorithm

As described in section 3.3 an MA might be encoded using a alternative form of representation to benefit from special recombination operators or heuristic decoding algorithms. In an early stage of development, a binary as well as an integer based encoding has been considered to represent an assignment of a job to a nurse of vice versa. The both binary approaches as well as the integer representation of the nurses assigned to a job would need a decoding algorithm to determine the order in which the jobs are served. This would need additional computational effort or perhaps another heuristic which would decrease the overall performance of this approach. The other integer encoding (job to nurse) is the existing representation when each job only occurs once and the number of jobs per nurse is known.

Another design choice made early was the number of offsprings created in each iteration.

The final choice of a single offspring per iteration was made after first test runs indicated that the creation of a larger number of offsprings with the additional local search calls lead to a slow converge of the population to good solution regions.

In the following, the initialization, selection and replacement as well as the special operators implemented for this representation and problem are described in detail. A summary of the final operators used can be found in table 5.2.

Initialization. To avoid duplicates as well as to provide an initial diversity of the population a random diverse constructor was implemented to create the initial solutions. These are con-structed using a memory of already used assignments in previously generated solutions. To construct a new solution most different from the already constructed ones, for each job j, a

Table 5.2:Operator setup for the Memetic Algorithm (MA) MA Operator Settings

selection binary tournament recombination tour replace crossover

mutation move all unfixed missions to best other nurse

replacement replace the worst similar solution in the population pool improvement cyclic search of neighborhoods

- reorder mission neighborhood (best of improvement) - shift mission neighborhood (best of improvement) - swap nurse neighborhood (best of improvement)

nurse that has been least often assigned to j is selected and jobj is added to the end of the tour of the nurse. Possible ties are broken randomly. The constructor memory is initialized with the starting solution (CP or random) by increasing the count of the corresponding job to nurse assignments. This solution is also always part of the initial population.

Selection. As selection strategy a binary tournament selection is used where solutions are se-lected by repeatedly picking two solutions at random and including the better one into the set of selected solutions. Note that this approach does not check for duplicates, i.e., solutions may appear multiple times in the set of selected ones.

Recombination Operator. As solutions are lists of tours (one for each nurse), a special re-combination operator was implemented (Figure 5.1): given two parent solutions (P1, P2), the offspring is initially set to have the same tours asP2. Then one nurse ofP1 is selected at ran-dom (n). Each non-preallocated job of the tourRnassigned inP1 is removed in the offspring solution. Then every remaining job ofRnin the offspring solution is moved to the best other nurses’ toursRm, wheren6=m, m∈ N. In the final step, the jobs ofRninP1are assigned to Rnin the offspring solution.

This recombination operator was implemented early in the thesis and performed very well due to the fact that the changes made to the parent solution are rather small – only the jobs of two tour are moved – thus preserving much of the solution structure. By selecting a nurses’

tour at random, the operator need very little computational time which allows the local search procedure more of the overall runtime. An additional design choice was made by allowing not only the parent so be identical, but also to allow the random selection of a nurses’ tour which is identical in both parents. By allowing parents to become offsprings, a possible local search call will improve this parent further, thus this intentional creation of duplicates enhance the ability of the MA to exploit the search space.

Mutation. To provide higher diversity during the search of the MA, the offspring is mutated by selecting a tourRnat random and reassigning all unfixed jobs of this tour to other toursRm, wheren6=mandn, m∈ N, minimizing the objective value.

This mutation procedure was considered due to the structure of the MHS problem. The idea is to support the search to remove nurses from the schedule by clearing their tours, i.e., 28

R1 j3 j6 j4

Figure 5.1:An example for the recombination operator (whereR2is selected) step by step: (a) offspring is set to be asP2, (b) all jobs ofR2inP1are removed from the offspring, (c) all remaining jobs inR2in the offspring are moved, (d)R2in the offspring is filled with the jobs ofR2inP1

performing chained shift job moves which may not be considered by the local search procedure.

Another mutation operator tested was a single job shift move but preliminary results showed that the other operator performs better.

Local Search. For a given probability, a local search heuristic tries to further improve the offspring. To achieve a controlled balance between exploration and exploitation, the heuristic aborts after a certain time limit. Two local search algorithms are applied: a VND, as described in section 4.4 and a cyclic search of neighbourhoods (CNS). The CNS is similar to the VND but always turns to the next neighbourhood structure in a cyclic manner when a local optimum in one neighbourhood structure or a time limit has been reached.

A similar approach is the so-calledtoken-ring searchproposed by Gaspero et al. [29]. Pre-liminary results showed that the CNS yields better results than the VND.

Replacement. The population is replaced using a slightly changed steady-state approach [35], where an offspring always replaces the most similar solution in the current population that is

Table 5.3:Parameter settings for SS SS Parameters Settings

RefSet size 5

combination operator path-relinking

smax 100

time-limit LS 10sec

termination time limit or no improvement after an iteration

worse than the offspring. To calculate the similarity of two solutions, the number of same job to nurse assignments in the compared solutions are counted.

This straight forward approach ensures a minimal grade of diversity by omitting duplicates.

In preliminary tests a alternative replacement strategy was tested. This alternative replaced the most similar worse solution in the population with the newly created one. This lead to a slow converge of the average quality of the solutions in the population and did not yield considerable better results.

5.3 Scatter Search

Like for the MA a scatter search metaheuristic also consists of several operators like the subset combination and the improvement operator. For the subset generation the classic approach as described in section 3.4 is used with a minor modification: instead of creating all three types of subsets, only type 1 and 2 are created andkwas set to four. Thus only one subset containing the best four solutions is created and added toU.

This has been modified after preliminary results showed that the metaheuristic need very high runtimes to find reasonable solutions, thus the number of solutions generated and improved per iteration was reduced.

For the improvement the same local search procedures as described in the previous section are used. The initialization is also done using a random diverse constructor. In the remainder of this section the implemented subset combination methods will be described in detail as well as the update method. The final settings are summarized in table 5.3.

Subset Combination 1. For the combination of solutions for each subset a ’construction by voting’ combination algorithm as suggested by Glover et al. [31] and described by Burke et al. [14] was implemented. This approach creates a new solution using candidates. A candidate for our problem is an assignment of a jobj to a tour Rn. Figure 5.2 shows an example using two solutions as voters and procedure itself is outlined in algorithm 5.2.

First, all possible candidates are created and the solutions from the subset with the same assignment are linked to the corresponding candidate. Then the list of candidates are sorted descending by the number of solutions (voters) linked to it. After this step, the construction starts at the beginning of the list.

30

R1 j2 j1

Figure 5.2:Example for the construction by voting subset combination method: using a list of candidates (middle) of two solutions (left) to create a new solution (right). Unused candidates are grey.

Input: set of solutionsU

Algorithm 5.2:Subset Combination: “construction by voting”

If an assignment of a jobjhas two candidates with the same number of voters, a tie breaking mechanism is used to decide, which candidate will be applied. First the number of successful votes of the voters are counted (i.e. how many times a candidate of a solution was used to construct the new solution), and the candidate with the least used voters is used. As this count could also be equal, a second tie breaker compares the sum of objective values of the voters and takes the candidate with the lowest sum.

If a candidate with an already assigned job is encountered during the search, the candidate is removed.

Input: sorted set of solutionsU ={u1, . . . , ul}of sizel, where

Subset Combination 2. After some preliminary tests indicating that the previously described approach does not perform well, a second approach was designed and implemented using a path-relinking algorithm (see section 3.4). Instead of using the proposed approach when using multiple guiding solutions in Glover et al. [31] – where the initial solution moves to a solution created by combining all parent solutions – a different procedure was designed: To create a solutionσnewout of a sorted subsetU ={u1, . . . , ul}of sizel, whereob(u1) ≥. . .≥ob(ul), the algorithm moves iteratively from the worst solution u1 to the bestul. Then σnew = u0l, where

u0i =u0i−1P R ui, i= 2, ..., l, u01=u1 (5.1) and the path-relinking operatorA→P RBmovesAdifference(A, B)/lsteps toB(the function differencereturns the number of different job to tour assignments). To determine which moves are performed first, the change in the objective per move is calculated and the move with the best change (which can also be worse) is performed. In order to prevent high runtimes due to a possible large set of moves to be tested, the number of moves to be calculated is restricted with a parametersmax. The outline of this algorithm is shown in alg. 5.3.

This approach is built upon the idea that a good solution for further improvement is situated between solutions in the reference set. Thus by performing a fixed number of steps toward these solutions and trying to improve the first solution as much and deteriorate as least as possible, a solution not only of good quality in terms of the objective function should be generated but also a solution with an rather unexamined neighbourhood space.

Reference Set Update. After each combination of a subset, the generated solution will be improved and replaces the worst solution in the current reference set, but only if it is not already 32

in the set. The diversity control, as considered in the original scatter search proposed by Glover et al. [31] will be not be maintained. Burke et al. [14] recommend this step in order to have more computational time to search in better regions (based on the objective value). Preliminary results suggested that the use of a diverse set does not improve the overall performance.

CHAPTER 6

Results

This section describes the experimental results obtained. This includes the comparison of all described approaches with long runtimes as well as parameter tests with shorter but reasonable runtimes.

6.1 Test Environment

The tests used 8 instances with the following dimensions:

day 1 day 2 day 3 day 4 day 5 day 6 day 7 day 8

# nurses 509 491 504 482 496 518 500 505

# missions 711 700 679 682 708 699 717 679

The real-world instances tested were taken from a random selection of 2011 instances pro-vided by Sozial Global. All techniques have been implemented within the same framework in Java 1.6.

The tests for the final comparison where run on a single core of a Intel(R) Core(TM)2 Quad CPU Q9300 2.50GHz with (at most) 4GB RAM assigned. The parameter tests were run on a Intel(R) Core(TM) i7-2630QM CPU 2.0GHz with (at most) 16GB RAM assigned.