4.3 Application of Selector to Solve the CTP
4.3.3 Extension of a Label
In the Selector algorithm, the extension of a label λ = [ζ, ν, ω] from vertex σν to a successor vertex σkwith k > ν implies that one of two possible operations is performed:
visit vertex σk or skip vertex σk. However, at every extension, feasibility must be maintained and redundant vertices must not be considered. Therefore, when no vertex wi ∈ W , is left uncovered the label λ is extended by skipping vertex σk. Whereas, when this restriction is not met, extension is done by visiting σk. The details of these operations are as follows.
Redundancy Checking. When extending the label by visiting σk, we need to ensure that σk is useful, i.e., that all the vertices wi it covers are not already covered. For computational efficiency, a matrix relating the coverage of the vertices wi ∈ W by the vertices vj ∈ V is precomputed and kept at hand, so that information needed for decision-making is readily available.
Feasibility Checking. Let Ω denote the subset of vertices of W that are not covered by the subpath represented by label λ. When extending the label by skipping vertex σk, we must be certain that each wi ∈ Ω is not affected by this decision. This is to say that, for each wi ∈ Ω there still remain vertices ahead of σk which can be visited to cover it. The number of such vertices is kept through field ω. Thus, for each wi ∈ Ω, feasible labels yield ω[i] > 0.
Look-Ahead Mechanism. This mechanism allows to further reduce the number of labels created. Let Ωk be the set of vertices wi that remain to be covered in the set of σk. If when extending a label it is found that a vertex σk must be visited in the future because it is the only one remaining that can cover a set Γ ⊆ Ωk, then all the vertices wi ∈ Ωk, but one, are marked as covered. One vertex wi ∈ Γ must remain uncovered, so that when vertex σk is reached, it proves useful. Looking ahead makes some label extensions unnecessary because redundant vertices are detected earlier and, therefore, are skipped. As a result, less labels are created. In addition, when the dominance test is applied, the sets compared are already taking into consideration vertices wi ∈ Ωk as covered, and this also helps to delete useless labels earlier.
Figure 4.2 provides an example where i < j < k. The label is extended to vertex σi, and it is found that for set Γ = {w5, w7} the only vertex that remains ahead which can cover it is vertex σk. Then, the vertices {w2, w4, w7, w9} ∈ Ωk are marked as covered.
Vertex w5 remains as uncovered, so that when vertex σk is reached, it is found useful.
This is, vertex w5 remains as a sentinel to ensure vertex σk is included. The former implies that set Ωj is now marked as covered, making vertex σj redundant. Therefore, when σj is reached no labels are produced.
σi−1 σi σj σk
. . . . . . . . . . . .
Ωj = {w2, w9} Ωk= {w2, w4, w5, w7, w9} Figure 4.2: Portion of a giant tour used to exemplify the look-ahead mechanism.
Algorithm for Extending a Label. Algorithm 9 shows the specific implementation of Algorithm 6 for the CTP. It depicts how a label is iteratively extended to the adjacent successor vertex to maintain feasibility and efficiency. Label λcurrent stores the last vertex visited in the path, and label λj memorizes the vertex to which the label is extended, σj. Set Ω contains the vertices wi ∈ W that are already covered by the path, and set Ωj contains the vertices that remain to be covered in the set of vertex σj. Set Λj contains the non-dominated labels stored at σj. At every step of the label extension, the following conditions are verified:
i. vertex to be included is not redundant (line 3) ii. ζ(λj) < UBbest (line 6)
iii. label is non-dominated (line 9)
First, it must be ensured that the vertex is useful. Any vertex that turns out to be redundant is simply skipped and the construction of the path continues, no labels are kept for skipped vertices. It is important to note that in this test the look-ahead mechanism is also applied and the resources (vector ω) are updated. If the vertex is worth visiting, the label cost and label index ν are updated. Next, test (ii) guarantees that the search in that trajectory is abandoned if the cost of the path turns out to be worse than the cost of the incumbent best-known solution. This acts as a bounding mechanism that enables to further control the proliferation of labels. If test (ii) is true, it is possible that the extension yields a complete solution. In such case, the incumbent best-known upper bound is updated in order to improve the limits for the creation of labels, and the extension in that direction stops. Otherwise (no complete solution exists), test (iii) makes sure only useful labels are kept.
4.4 Performance Improvements
A version of Selector which uses bidirectional search with bounding was implemented in order to study the performance improvement that could be attained. In this search, the recurrence equation, dominance rule, label-extension procedures, feasibility and redundancy checking and use of an upper bound are symmetrical to those previously presented, albeit the look-ahead mechanism is not used.
The bidirectional search, however, includes the computation of a lower bound on the cost of the tour, which aims at reducing label proliferation. Having a good lower bound allows to identify non-promising labels that can be pruned. Then, at each step
4.4. Performance Improvements 71
Algorithm 9 : Extend(λ) in the CTP
Input: label to be extended λ = [ζ, ν, ω], UBbest, |Ω|
Output: labels derived from λ = [ζ, ν, ω]
{only non-dominated labels that can later be extended skipping are kept}
1: λcurrent← λ
2: for ( j = ν + 1 to n − 1 ) do
3: if ( vertex σj is not redundant ) then
4: |Ω| ← |Ω ∪ Ωj|
5: ζ(λj) ← ζ(λcurrent) + cost(σcurrent, σj)
6: if ( ζ(λj) < UBbest ) then
7: if ( |Ω| 6= |W | ) then
8: λcurrent← λj
9: if ( λj non-dominated ) then
10: Λj ← Λj∪ {λj}
11: end if
12: else
13: UBbest← ζ(λj)
14: return {complete solution has been built}
15: end if
16: else
17: return {cost of path being explored is worse than best-known cost}
18: end if
19: end if
20: end for
of the label extension, a lower bound on the cost of the complete tour represented by the label needs to be computed. The obtained bound can be compared against the incumbent best-known cost in order to determine if the label created by visiting that vertex is worth storing for further extension. One way to estimate the cost of the path that remains to be searched is by solving a Fractional Knapsack Problem (FKSP).
Both mechanisms—computation of a bound and bidirectional search—are thoroughly explained in Chapter 3. Hereafter, the explanation indicates only the specifics of the computation of the lower bound. To estimate the cost of a complete path, Equation 4.1 can be used.
µ(λ) = ζ + h(λ) (4.1)
where
• λ = [ζ, i, ω] is a label that memorizes σi as the last visited vertex
• Ω is a set of vertices that remain to be covered
• h(λ) is a lower bound computed on the cost incurred to cover the vertices wj ∈ Ω visiting only vertices in the subsequence ϕ = {σi+1, . . . , σn−1}. This is, cover the remaining vertices wj using only vertices that lie ahead of σi.
In the FKSP solved in order to estimate the cost of the unexplored path, the profit of an object σi ∈ ϕ is given by the number of vertices wj ∈ W the object covers, and the capacity of the knapsack is given by |Ω|. The value of bound h(λ) is then the sum of the weight values of the vertices chosen from ϕ. Figure 4.3 shows an example. Let us consider that the figures in parenthesis indicate the vertices wi ∈ W covered by vertices σi | i ∈ {1, . . . , 6}, and that the label has been extended up to vertex σ3 and no vertex has been skipped. Also, |W | = 28 and 13 vertices wi ∈ W have been covered.
First, we determine the capacity of the knapsack which is given by the vertices that remain to be covered: C = |W | − |Ω| = |Ω|. Applying this equation to our example yields C = 28 − 13 = 15.
Next, we define the objects that will be put into the knapsack. These are vertices ϕ = {σ4, σ5, σ6}. The problem is solved with a greedy approach, so we need to deter-mine the ratio prof it/weight for each item in ϕ. The profit is a piece of data stored for each σi, and its weight di is computed in each iteration as follows. Let ∆i = {dji}i−1j=0 be the set of weights of the in-going edges of σi, those that connect vertex σi with each of its predecessor vertices in the giant tour σ, and ∆0i = {dik}n−1k=i+1∪ {di0} be the set of weights of the out-going edges of σi, those that connect vertex σi with each of its successor vertices in σ. Then, an estimation of the least travel cost (weight) of visiting vertex σi can be obtained by
di = min ∆i+ min ∆0i (4.2)
Exemplifying this for vertex σ4 we have ∆4 = {d(0, 4), d(1, 4), d(2, 4), d(3, 4)},
∆04 = {d(4, 5), d(4, 6), d(4, 0)}, and d4 = min ∆4 + min ∆04. The same applies for the rest of the vertices in ϕ. Since our greedy strategy is to choose the items with the largest profit per unit weight first, we order these items in decreasing order of their prof it/weight ratio. Let us suppose we get σ6, σ4, σ5. Then, we choose the items in this order, so we take all of σ6 and σ4, C = 15 − 7 − 6 = 2. However, the greedy algorithm never wastes any capacity in the FKSP, so we can use the 2 units of the remaining capacity to take 2
5 of σ5. Then, our total estimated cost for the path that remains to be explored is h(λ) = d6+ d4+2
5d5.
σ0 σ1 σ2 σ3 σ4 σ5 σ6
(0) (6) (5) (4) (6) (5) (7)
Figure 4.3: Giant tour used to exemplify the computation of a lower bound.
Applying this result to the original problem, if µ(λ) ≥ UBbest, the label can be pruned. Otherwise, the label is stored if it is non-dominated. In the bidirectional version