• No se han encontrado resultados

5.2 Introducir destino

5.2.4 Destinos especiales

2: currentSolution ← RandomSolution

3: whileterminate == false do

4: candidateSolution← RandomNeighbour(currentSolution) 5: if(Score(candidateSolution) 6 Score(currentSolution)) then 6: currentSolution← candidateSolution

7: end if 8: end while

9: return currentSolution .return best solution discovered 10: end procedure

For RMHC, the call to RandomNeighbour mutates a single locus of the current solution at random [16], in effect taking a single dimensional step. This contrasts with simple hill climbing, and is in fact the only difference, which generates each neighbour of the current solution in turn until one is found that is improving.

4.2.2 Global Optimisation with Hill Climbing

As hill climbing algorithms are local methods that maintain only a single solution at a time, when performing global optimisation, they can easily become trapped in local optima. Extension of the basic algorithms to search within multiple local neighbourhoods provides the needed diversification to avoid this problem. Approaches such as: random-restart hill climbing, local beam search and stochastic beam search can provide diversification through repetition of the search process - accomplished by various means each with different properties. Simulated annealing can also be considered as a global variation of hill climbing utilising non-deterministic search, however, this is covered separately in section 4.5. The next few subsections will cover these other global hill climbing approaches in more detail.

4.2.2.1 Random-restart Hill Climbing

Another approach to improving on the quality of solution discovered by local search techniques such as hill climbing is to simply restart the search from a different randomly selected initial point in the search space. This is the basis of random restart hill climbing, the motivation being the hope that the global optimum will eventually be found through trial and error. Again there are several variations, each determined either by how a restart of the algorithm is triggered - after a given length of time or until the algorithm terminates naturally - or whether a fixed number of restarts are used or not. These variations are not mutually exclusive and can be combined. An obvious disadvantage of this approach is that it requires more time and computational resources than a single repeat of the standard hill climbing algorithm used, increasing linearly with the number of restarts required. Another problem with this approach is that as the problem instance size increases, random sampling has a much reduced chance of finding a point in the search space that would lead the algorithm to converge on a solution of higher quality [80] - this chance reducing further as the current solution quality approaches optimality. Therefore, reaching these higher quality solutions requires more of a biased sampling which can be facilitated by stochastic search [80]. Despite its issues, random-restart hill climbing is fairly easy to implement, requiring only one or two additional parameters, an additional loop surrounding the main hill climbing algorithm and some very minor modifications e.g. keeping track of the overall best solution globally rather than returning the best overall solution from a single local repeat.

4.2.2.2 Local Beam Search

Instead of making use of only a single solution as in local hill climbing algorithms, local beam search maintains a population of k solutions. Here, k solutions are randomly generated over the search space and all members of their neighbourhoods are generated [127]. The k members over all neighbourhoods are selected and the algorithm begins a new iteration. Although this might appear as though several repeats of hill climbing are being performed concurrently, the repeats run independently and no information is shared between search processes; on the other hand, local beam search does share information between localities by considering all neighbourhood members to become part of the newly maintained set of size k [127]. In this way, areas of the search space that do not hold much promise can be rejected in order to redirect search efforts to more promising regions. This however leads to the disadvantage that over time the maintained set of k solutions can still converge to a local optimum as weaker but more diverse solutions and regions are quickly rejected.

4.2.2.3 Stochastic Beam Search

To address the disadvantage of local beam search eventually becoming stuck in local optima, stochastic beam search does not select the best k members from the whole list of k neighbour- hood members, but instead selects k members randomly with a probability of selection given by an increasing function of a members quality [127].

4.2.2.4 Iterated Local Search (ILS)

The main basis of iterated local search (ILS) is that the search should not focus on the entire set of all possible feasible solutions S, but instead, the resulting solutions returned from some underlying heuristic - usually local search - in other words, the far smaller set S∗of locally optimal solutions s∗ [81]. The search behaviour can therefore be categorised as a markov chain of locally optimal solutions returned from this underlying heuristic, leading to solutions better than those that can be found through random repeated trials - as with random restarts [80]. In practice, local search methods such as hill climbing have been the most commonly used search heuristic in ILS, but in fact, any optimisation algorithm can be used even if this is deterministic rather than stochastic [80, 81].

Lourenco, Martin and Stützl in [80] and [81] state two factors that determine whether an algorithm is an instance of ILS:

1. There must only be a single chain of solutions being followed - this then excludes the use of any population-based heuristics

2. The search for improving solutions must be taking place within a reduced search space defined by the output of the underlying search heuristic

ILS requires a mechanism for moving within the space S∗of local optima. Unlike random restart this mechanism - a perturbation of the current s∗ - provides a sampling biased by increasingly better local optima. However, as Blum and Roli point out in [11], it is - in most cases - infeasible to construct such a neighbourhood structure as S∗; therefore the trajectory between local optima has to be performed without introducing the notion of a neighbourhood structure explicitly [11].

However, and as discussed in section 4.2.2.1, the bias provided by ILS will still help alleviate the issue faced by the random restart method where random sampling has a decreasing chance of discovering new points in the space that would lead to convergence on a new s∗. The perturbation of the current local optima should neither be too large or too small

[80]. Too large and the new intermediate solution s0will be random, we lose the useful bias and the algorithm will degenerate into a random restart-like approach [80, 11]. If conversely, the perturbabtion is too small, the search will often return back to s∗meaning that little of the space of S∗will be investigated [80, 11].

4.2.3 Random Mutation Hill Climb: Implementation

4.2.3.1 Details and Description

As detailed above, a random mutation hill climbing algorithm does not generate all improving neighbourhood solutions, as with steepest ascent/descent hill climbing - but rather ‘mutates’ a single solution parameter selected uniformly at random and also mutating the selected parameter by uniform mutation (Section 4.3.2.3) - and accepts the solution as the new current solution if and only if the new solution is improving. Furthermore, the improving neighbour is not accepted by a probability based on the magnitude of the improvement but is instead accepted immediately as the ‘first choice’ generated. As with the simulated annealing im- plementation (Chapter 4 - Section 4.5) this implementation makes use of the neighbourhood function described in Section 4.1.3. As such, the implementation only uses a single tunable parameter - stepSize - that defines the neighbourhood of a solution.

4.2.3.2 Pseudocode