3.3 Selector Operator
3.3.3 Algorithm
In an algorithm designed to visit all the vertices of the given network, a label can only be extended from vertex σi to successor vertex σi+1 with no possibility of skipping vertices. In such case, the extension of a label corresponds to appending an additional arc (i, i + 1) to a path from σ0 to σi, obtaining a feasible path from σ0 to σi+1. The process also implies updating the objective function value, the rank reached (i + 1) and the resource consumption.
In Selector , a similar operation occurs when a label is extended, but in this algo-rithm vertices may be skipped, so we consider that a label is extended from vertex σi to vertex σi+k, where k may take any of the following values {1, 2, 3, . . . , n − i − 1} with n = |V |. In addition, the extension of a label λ = [z, i|r1, r2, . . . , rm] from vertex σi to successor vertex σi+k, implies that one of two possible operations is performed: visit vertex σi+k, or skip vertex σi+k. If when extending a label it is decided that the vertex σi+k is skipped, the extension proceeds to vertex σi+k+1 and it is evaluated again if it is useful to visit it. Not visiting is possible, for example, when a vertex proves to be redundant or visiting it violates a restriction. However, no labels are created for skipped vertices. Only when the vertex is visited, a non-dominated label is stored.
When k = 1, the extension occurs to the immediate adjacent successor vertex. It is comparable to constructing an arc at some given level on the auxiliary graph H.
On the other hand, when 2 ≤ k ≤ n − i − 1, the extension occurs skipping a sequence of vertices. This is possible only if the side restrictions allow to skip the sequence
{σi+1, . . . , σi+k−1}. This extension is equivalent to constructing an arc whose head lies at least two levels down in the auxiliary graph H.
Algorithm 5 illustrates the core procedure of Selector . The algorithm may be un-derstood as first extending label λ = [0, 0, 0] from the depot σ0 to every level of graph H (lines 1-6). This is to say, extend the label λ to every vertex σi| i ∈ {1, 2, . . . , n − 1}
if possible, i.e., create the sequences of vertices {σ0, σi}. If the extension is successful, it is followed by an extension that repeatedly attempts to visit the immediate adjacent successor vertex trying to go as deeply as it proves useful. In other words, it attempts to construct sequence {σ0, σi, σi+1, σi+2, . . . , σi+j} | j = n − i − 1. However, at each step of the construction of this sequence, i.e., at every visited vertex, a non-dominated label is stored. Later, if possible, the labels that were stored at each step are extended more deeply but now considering skipping defined sequences of vertices (lines 7-10).
In other words, an initial set of labels is created for each visited vertex and the set is further extended later. The complexity of the first phase is O(n2). Figure 3.3 shows an example of the initial phase where only a small subset of V is shown for explanatory purposes.
Algorithm 5 : Selector
Input: giant tour σ, distance matrix D
Output: optimal tour of visited vertices T , cost value of tour c(T ) {build an initial set of labels, Λ}
1: for ( i = 1 to n − 1 ) do
2: if ( λi can be extended from σ0 to σi ) then
3: Λ ← Λ ∪ {λi} {λi is the label being treated}
4: Extend(λi) {see Algorithm 6}
5: end if
6: end for
{extend labels created skipping a defined sequence of vertices}
7: while ( Λ 6= ∅ ) do
8: λ ← Extract Best(Λ) {find label with best objective function value}
9: Extend Skipping(λ) {see Algorithm 7}
10: end while
Algorithm 6 depicts the general process of repeatedly extending a label λ to the immediate adjacent successor. Its main tasks are the following: (i) evaluate if it is useful/possible to visit a vertex; in case it is, (ii) update the label data; (iii) update the best-known solution if applicable and (iv) determine if the label is non-dominated. In this algorithm, stopping criteria other than reaching σn−1can be defined. For example, finding a complete solution or finding a path whose objective function value is worse than the best incumbent solution. The algorithm is adapted to the problem treated to make it efficient, so it is further detailed in each of the chapters that explain the application of Selector to solve a specific problem.
Algorithm 7 shows the next phase. The initial labels are further extended skipping defined sequences of vertices. These sequences are located after the last rank visited.
3.3. Selector Operator 47
Algorithm 6 : Extend(λ)
Input: label to be extended λ = [ζ, i | r1, . . . , rm], z∗ Output: labels derived from λ
{only non-dominated labels that can be later extended skipping are kept}
{z∗ represents the best known objective function value}
1: for ( j = i + 1 to n − 1 ) do
2: if ( vertex σj is visited ) then
3: update rank(λj) and resource consumption(λj)
4: compute z(λj)
Extending from vertex σi, the first successor that can be visited skipping intermediate vertices is σi+2, i.e., it skips one vertex. In addition, if the restrictions allow it, the maximum number of extensions ψ that can be done from σito successors σk| k ≥ i+2 is given by ψ = n − i − 2. Then, when a label λ is chosen for extension, it first attempts to reach vertex σi+2, this is, build sequence {σ0, . . . , σi, σi+2}, and from this point, it does an extension that iteratively attempts to visit the immediate adjacent successor vertex, i.e., it creates, if possible, sequence {σ0, . . . , σi, σi+2, σi+3, . . . , σi+j} | j = n − i − 1. It continues with the next possible extension for λ which is to successor vertex σi+3, in this case it skips two vertices. It proceeds again with an iterative extension to the immediate adjacent successor vertex, i.e., it creates sequence {σ0, . . . , σi, σi+3, σi+4, . . . , σi+j} | j = n − i − 1. The process repeats, if possible, until ψ is reached. The number of extensions possible, ψ, may not be reached if, for example, it is not feasible to skip a certain vertex within the subsequence because vertices may be left uncovered. Then, the remaining possibilities that consider even larger subsequences of skipped vertices are not feasible and, therefore, not worth analysing.
At each iteration, the label chosen for extension is always the one that documents the best objective function value and the execution of this second step continues until there are no labels to extend. Recall that at every extension, the best solution found is updated so that at the end it can be retrieved from this variable. The complexity of this extension is O(n2). Figure 3.4 shows an example with the same assumptions explained for Figure 3.3.
A distinctive and important characteristic of Selector is that aside from the con-straints mentioned in the definition of the problem, it does not impose any further restrictions on the selected vertices of V such as adjacency, for example. This operator can discard any vertex vi ∈ V at any point in the tour. Bouly et al. (2010) designed
Algorithm 7 : Extend Skipping(λ)
Input: label to be extended λ = [ζ, i | r1, . . . , rm] Output: labels derived from λ
1: for ( k = 2 to n − i − 1) do
2: if ( λi can be extended from σi to σi+k ) then
3: Extend(λi+k)
4: end if
5: end for
σ0 σ0+
level 1
σ22 σ23 σ24
level 2
σ33 σ34
level 3
Figure 3.3: Phase 1: Create initial list. The labels created in level 2 document se-quences: {σ0, σ2, σ0}, {σ0, σ2, σ3, σ0}. Label {σ0, σ2, σ3, σ4, σ0} is not created because it is either infeasible or useless. The labels created in level 3 store the following sequences:
{σ0, σ3, σ0}, {σ0, σ3, σ4, σ0}. Thus, the set of labels associated with each vertex contains Λ2 = {{σ0, σ2, σ0}}, Λ3 = {{σ0, σ2, σ3, σ0}, {σ0, σ3, σ0}}, and Λ4= {{σ0, σ3, σ4, σ0}}.