• No se han encontrado resultados

Algo traman las palomas

In document Febrero 2020, Montevideo, Uruguay. (página 31-63)

The main property rendering genetic solution representations convenient is that their parts are easily aligned due to their fixed size which, in turn, facilitates simple crossover operations [81]. Variable solution length representations may also be used, but crossover implementation is more complex in this case. Moreover, according to Nazif and Lee [106], it may often be necessary with genetic algorithms not to generate the entire offspring population by means of crossover operations. In their paper, for instance, they implement a crossover probability of 0.75 for every pair of parents and a swap operator (i.e. one-to-one exchange) otherwise. In [119], eight different crossover operators obtained from various previous publications are analysed in respect of transforming solution strings for VRPs, none of which deal with variable chromosome string lengths that are applicable to VRPs with customer profits, and this is the same in other, related publications. Consequently, due to the lack of adequate crossover operators in the literature, a functional crossover procedure for successfully creating feasible offspring solutions is proposed in this section for solving the MLE response selection problem by means of the NSGA-II. Given two selected parent solutions p1 and p2, letRp1 ={r1(p1), . . . , r|Vr|(p1)}, where rk(p1) represents the number of VOIs in route k ∈ Vr of the reduced string of parent solution p

1.

Similarly, let Rp2 = {r1(p2), . . . , r|Vr|(p2)}. The proposed crossover procedure consists of two sub-processes, where the second sub-process is only initiated if the first crossover sub-process fails (with respect to feasibility) after a certain number of mating attempts.

The first crossover sub-process may be described as an adapted version of the traditional cut- and-splice crossover operator (as described in §2.4.4), which attempts to swap genetic material from both parents as follows. First, the delimiter cells are removed from their reduced solu- tion strings to create two chromosome strings containing VOI cells only. A marker function fM : (|p1|, |p2|) → [1, min{|p1|, |p2|}] is specified by the user, where |p1| refers to the number of

cells in the chromosome string of p1 and|p2| to the number of cells in the chromosome string of p2. This user-defined step-function generates an integer, called the marker and denoted by M , in the specified range. The nature of the marker depends on the size of the parent strings, |p1|

and|p2|, as well as on their difference in size. Two offspring solutions o1 and o2 are constructed

by swapping partial strings from the parents (similarly to a cut-and-splice crossover operator), where the cut is defined by the marker M . A test is then carried out to ascertain whether any of the two offspring solutions contain duplicate cells in their chromosomes. If one or both of them do, then the marker value is reduced by one, and the cut-and-splice crossover process is repeated for p1 and p2, using the updated marker value. This crossover sub-process is terminated when two offspring chromosomes are formed which do not contain duplicate entries. Converting the offspring chromosome strings back into a solution format is achieved by configuring Ro1 =Rp2 and Ro2 = Rp1. These offspring solutions are then tested further for overall feasibility. If the marker value reaches zero, however, or if one or two of the offspring solutions is classified as infeasible with respect to overall feasibility (which includes the reinsertion and end-of-route assignment sub-transformations performed on these reduced offspring solution strings), then the first sub-process of this crossover procedure is aborted, and the second sub-process is initiated. An illustrative description of a successful procedure conducted during the first sub-process of this crossover operator is presented in Figure 7.18. Here, |p1| = 7 and Rp1 = {2, 3, 2}, while |p2| = 5 and Rp2 = {1, 2, 2}. For demonstration purposes, assume that the original marker value was specified as M = 3. Then, performing a cut-and-splice crossover procedure on the two parent chromosomes using this marker clearly results in an infeasible offspring chromosome (with respect to testing for duplicate entries), as the cell containing entry 5 is duplicated in the chromosome of the second offspring. However, as depicted in this example, lowering the marker

7.6. Multiobjective genetic algorithm methodology 165 2 7 0 4 10 5 0 3 11 Parent 1 solution 6 0 1 5 0 8 12 Parent 2 solution 2 7 4 10 5 3 11 Parent 1 chromosome 6 1 5 8 12 Parent 2 chromosome 6 1 4 10 5 3 11 Offspring 1 chromosome 2 7 5 8 12 Offspring 2 chromosome 6 1 0 4 10 5 0 3 11 Offspring 1 solution 2 0 7 5 0 8 12 Offspring 2 solution

Figure 7.18: Procedure (successfully) completed during the first sub-process of the proposed crossover operator.

value by one (i.e. setting M = 2) produces two feasible offspring chromosomes (again, only with respect to testing for duplicate entries), which may then be converted back into an appropriate solution format by reinserting the delimiter cells with the sets Ro1 and Ro2.

The second (backup) sub-process of the crossover procedure was inspired by the natural concept of asexual reproduction, in which an offspring solution is created from a single organism by inheriting (presumably good) genes from a single parent solution. This sub-process is therefore conducted for each parent solution independently. In this procedure, clones are defined as pairs of individuals which possess identical chromosome strings. Without loss of generality, this second sub-process is described for offspring o1only, and works as follows. First, let o1be configured as a

clone of p2, and letRo1 =Rp2. Two elements are randomly selected from the setRo1 such that at least one of these elements is larger than, or equal to, one. One of these two elements is then randomly selected (unless one of the elements is zero, in which case the other one is selected) and one is subtracted from it, while one is added to the other element. These new numbers of routes are implemented in order to convert the offspring chromosome to an offspring solution, and a test is carried out for overall feasibility. If the offspring solution is infeasible,Ro1 is reset toRp2 and the process is repeated by selecting two random elements from the set Ro1, and so forth. In genetic algorithms, the process by which attempts are made to convert infeasible offspring solutions into feasible ones by means of a local search operator falls in the class of education operators (see§2.4.1). This sub-process is terminated once a complete feasible offspring solution has been generated (i.e. once it has successfully been educated), or a pre-determined number of attempts Omax have been made. In the former case, the offspring solution is added to the

offspring population, while in the latter case the overall crossover procedure is aborted.

An illustrative description of a procedure conducted during the second sub-process of the crossover operator is presented in Figure 7.19. Here, the offspring chromosome string is ini- tially identical to the parent chromosome string, and Ro = Rp = {1, 2, 2}. The first and third elements of this set are then randomly selected and one is subtracted from the third element, while one is added to the first element, resulting in Ro = {2, 2, 1}. A pseudo-code description of the overall crossover procedure is provided in Algorithm 7.6.

Algorithm 7.6: Crossover procedure outline

Input : Two parent solutions p1, p2 with respective route sizesRp1 and Rp2, a marker function fM, and a maximum number of offspring generation attempts Omax.

Output: Possibly feasible offspring solutions o1 and o2.

M ← fM(|p1|, |p2|) 1 p1← [p11p12] with [p11] = [p1(1), . . . , p1(M )] and [p12] = [p1(M + 1), . . . , p1(|p1|)] 2 p2← [p21p22] with [p21] = [p2(1), . . . , p2(M )] and [p22] = [p2(M + 1), . . . , p2(|p2|)] 3 o1 ← [p11p22] 4 o2 ← [p21p12] 5

if either o1 or o2 contain duplicates then 6 M ← M − 1 7 if M ≥ 0 then 8 Go to step 2 9 else 10 o← o1 11 p← p2 12 t← 1 13

while (t≤ Omax) and (o is infeasible) do 14

Ro ← Rp

15

Generate random numbers r1, r2 such that either Ro(r1)≥ 1 or Ro(r2)≥ 1 16 if r1 ≥ 1 then 17 Ro(r1)← Ro(r1)− 1 18 Ro(r2)← Ro(r2) + 1 19 t← t + 1 20 else 21 Ro(r1)← Ro(r1) + 1 22 Ro(r2)← Ro(r2)− 1 23 t← t + 1 24 if o is feasible then 25

Append o to the offspring population

26

if The education operator has been carried onto both offspring solutions then

27 STOP 28 else 29 o← o2 30 p← p1 31 Go to step 13 32 else 33 Go to step 11 34

7.7. Design of a hybrid metaheuristic 167

In document Febrero 2020, Montevideo, Uruguay. (página 31-63)

Documento similar