• No results found

A Deterministic Generator for the Initial Subset

Chapter 5 Relaxation-Based Algorithms for the Continuous P −Centre

5.3 An Enhancement-Based Algorithm

5.3.1 A Deterministic Generator for the Initial Subset

2 of Figure 5.2)

The computational time required for the reverse relaxation algorithm has a great de- pendence on the subset selected at the beginning. The results in the previous section suggest that the algorithm works efficiently and quickly; however this is not always the case. The results in Section 5.2 only give the best computational times, and had the algorithm only run once for one value of k (rather than having several different values to choose from) the results may have yielded different computational times.

(a) Run One (b) Run Two

Figure 5.4: Initial subset for n = 439, p = 50, k = 5

The variance of computational times can be easily demonstrated with a small exam- ple. The reverse relaxation algorithm was run twice to solve the data set pr439 where p = 50 and k = 5. In this particular experiment, run one found the optimal solution after 169.1 seconds, whereas the second run found it in less than half the time at 72.9 seconds. Figures 5.4a and 5.4b show the initial subset of demand points for the first run and the second run respectively. In Figure 5.4a, the demand points are more clus- tered, whereas during the second run (see Figure 5.4b) the initial subset of demand points were more evenly spread throughout the full data set. This therefore makes the initial subset given in the second run closer to the optimal solution than its counterpart

subset generated in run one.

This simple example demonstrates the initial motivation for the first enhancement for the reverse relaxation algorithm by highlighting that it may be preferable is to select an evenly spread out initial subset over the data’s distribution in a deterministic way. This could lead to regaining computational time as the algorithm would be less sensitive to the initial subset of the demand points.

Generation of the initial subset of demand points

The first enhancement, which will be referred to as SubE1, proposes a scheme to find the minimum number of dispersed initial demand points. For clarity, let:

d′

i,l: the Euclidean distance from demand point i to demand point l;

Sub: the subset of demand points. SubE1: An Overview

i) Firstly, we construct the convex hull encompassing all the demand points. Let CS be the set of points defining the vertices of the convex hull. In this study we used the quickhull algorithm proposed by Barber, Dobkin & Huhdanpaa (1996). ii) The demand point ˆi ∈ I, that sits the greatest sum distance from all i′ ∈ CS,

is identified by

ˆi = Arg( Max

i∈I\CS{

X

i′∈CS

d′i,i′}), (5.1)

and set Sub = {ˆi}.

iii) The algorithm then enters the third stage where

a) All i ∈ I are allocated to their closest facility j ∈ Sub. This is represented by the allocation matrix Al.

Ali,j =     

1 if di,j ≤ di,j∗ ∀i ∈ I, ∀j, j∗ ∈ Sub : j 6= j∗,

0 else.

identified where jM ax = Arg(M ax j∈Sub{ X i∈I Ali,j}). (5.2)

c) The demand point that is both allocated to jM ax and sits the furthest

away from it, say i∗, is then identified as follows:

i∗ = Arg(M ax

i∈I (di,jmax : Ali,jM ax = 1). (5.3)

d) The demand point i∗ is then added to the initial subset (i.e., Sub =

Sub ∪ {i∗}).

We will now discuss the method used to determine the cardinality of the initial subset of demand points.

Determining the minimum |Sub|

The minimum number of demand points, r, needed for the initial subset to yield an initial solution (i.e. p circles) is found by Chen & Handler (1987). They state that the number of circles that can be formed using r′ demand points is derived from Equation

(5.4). r = M in r′∈N : r′ 3  +r ′ 2  + r′ ≥ p. (5.4) To save computational time, the algorithm finds (r − 1) demand points using SubE1. Note that r in Equation (5.4) represents the maximum number of circles made up from 1, 2 or 3 critical points first discussed in Section 2.2.4, Chapter 2.

The number of circles created from this initial subset of size r may not be large enough to form an initial solution (i.e. the number of circles < p), as some may be discarded due to the geometry of the critical demand points. If this is the case, the algorithm returns back to part (iii) and adds another demand point to the initial subset one by one until an initial solution can be found. The algorithm for SubE1 can be found in Figure 5.5.

1. Set Sub = ∅. Find the demand points i′ ∈ I that form the vertices of the

convex hull, defined as the set CS.

2. Find the demand point ˆi ∈ I \ CS that has the largest sum distance from all i′ ∈ CS using Equation (5.1). Set Sub = Sub ∪ {ˆi}.

3. Determine the value of r using Equation (5.4). 4. While |Sub| < r do:

Allocate all i ∈ I to their closest j ∈ Sub. Determine jM ax using Equation

(5.2) and then find the furthest demand point i∗ ∈ I that is allocated to j M ax

using Equation (5.3). Set Sub = Sub ∪ {i∗}.

5. Find all circles made by one, two or three demand points from i′′ ∈ Sub. If

the number of circles is ≥ p, return Sub as the initial subset and stop. Else, set r = r + 1 and go back to Step 4.

Figure 5.5: Initial Subset Algorithm (SubE1)

This method also allows the distribution of the data to be considered by allocating all demand points to their closest j ∈ Sub and noting the one that has the most allocated to it. This means the initial subset does not only yield a well dispersed set of demand points, but additionally it is proportionally dispersed over clustered areas and evenly spread areas. This gives a more efficient subset of demand points to begin the algo- rithm. Furthermore, by checking to see if the subset can produce an initial solution each time another demand point is added, the size of the subset is minimised and so reduces redundant calculations.

Illustrative Example

Figure 5.6 shows the demand points (diamonds) for the data pr439. Let p = 30, and four facilities, F1, F2, F3 and F4 have already been found using SubE1. Equation (5.4)

states that as p = 30 then r = 6, and so (at least) two more demand points must be added to the initial subset. If the furthest point from its allocated facility was taken, this would mean that point P1 would be selected next for Sub as it sits the furthest

from its allocated facility, F1, than all other demand points from their allocated facili-

ties. However, even though this is an extreme point, this is not the best point to select as it lies in an area where demand points are sparse.

Figure 5.6: Illustrative example of SubE1

inside the dashed circle area, as this is a highly populated area with only one facility. Therefore, by taking into account both a) the distance from a demand point to a fa- cility and b) the number of demand points a facility serves, SubE1 would select point P2 as the next facility. This creates a more evenly spread selection of facilities over the

data’s distribution.

Figure 5.7 shows the initial subset that has been found for the data set pr439 where p = 50 using SubE1. Note that |Sub| = 24. The Initial Subset Algorithm would proceed to find the extreme demand points that form the convex hull, and the point that has the greatest sum distance from these extreme points. The third stage would then find another six points straight away. This is due to 63 + 6

2 + 6 = 41 ( < p) and 7

3 + 7

2 + 7 = 63 ( > p), thus making r = 7. The third stage would then continue to

find the remaining 17 points one by one until an initial solution is obtained.

For comparison, Figure 5.8 shows the critical points of the circles for the optimal so- lution for pr439 where p = 50. Note that the number of critical points is 88. When comparing Figures 5.7 and 5.8, it can be seen that there are similarities as the demand points tend to be situated at extreme parts of clusters (in the corners or near the edge). Therefore, it suggests that enhancement one creates a good initial subset in a deterministic way.

Figure 5.7: Initial subset for n = 439, p = 50 using SubE1

Figure 5.8: Critical points for the optimal solution for n = 439, p = 50 Why all i′ ∈ CS are not necessarily added to the initial subset

Observation 1. Take two points i1, i3 ∈ CS and point i/ 2 ∈ CS. If the angle ∠i1i2i3 >

90◦, then the point i

2 can be encompassed by the covering circle formed from i1 and i3.

This observation is illustrated in Figure 5.9 with an example where the point i2 is

encompassed by a covering circle formed from the two points i1, i3 ∈ CS./

As the third part of SubE1 is designed to find the dispersed, extreme points in the plane it might seem reasonable to add all i ∈ CS to Sub automatically. However, observation 1 demonstrates that the extreme points that form the convex hull are not necessarily critical points for their covering circles. Although SubE1 could select some points that form the vertices of the convex hull to be in Sub, it is also designed to find a good initial subset based on the data distribution and thus be more selective about the

Figure 5.9: Observation 1

points that are chosen. Therefore, instead of automatically adding all i ∈ CS to Sub, we acknowledge that this may increase the problem size unnecessarily and so allow the third stage (part (iii)) to choose the most appropriate points.

Results using SubE1

Table 5.2 shows the comparison between the computational times for Chen & Chen’s results, our first results (found in Section 5.2) and the results with SubE1 added to the reverse relaxation algorithm for the TSP-Library data set pr439.

CPU Times (secs) Chen & Chen’s

Results

Our First Results Our Results With SubE1 p Z∗ Best(k = 2) Best(k = 3) Worst (k = 1) Average (k =

1, . . . , 10) Best⊥(k = 2) 10 1716.510 0.84 4.18 2.27 29.65 1.98 20 1029.715 2.63 3.22 2.31 18.94 2.12 30 739.193 6.16 3.75 5.05 27.10 42.39 40 580.005 93.38 38.69 29.29 57.96 38.96 50 468.542 207.45 63.62 69.20 127.83 67.84 60 400.195 62.19 24.49 77.55 54.59 14.18 70 357.946 103.28 57.12 52.18 107.24 45.33 80 312.500 172.59 41.62 620.60 188.09 52.39 90 280.903 157.07 63.24 274.08 85.05 85.45 100 256.680 60.40 17.32 119.36 51.92 31.59 Average 614.22 86.60 31.73 125.18 74.81 38.22

Best result for k = 1, . . . , 10.

Table 5.2: Results comparing the Reverse Relaxation Algorithm with and without SubE1

These results may suggest initially that the first enhancement does not improve the computational time when compared with our original results where k = 3. However, as stated before, SubE1 has the advantage of being deterministic. When compared with

Chen & Chen’s results, it can be seen that the reverse relaxation algorithm including SubE1 required less computational time. Due to the original algorithm being non- deterministic, some runs may be much faster than others. Therefore, it is promising to see the computational time taken by the algorithm including SubE1 is much closer to that of a ‘good’ run for the original algorithm. In addition, a deterministic selection method for the initial subset, such as SubE1, is more reliable as it can be replicated by other researchers while not requiring extremely large computational times that a random subset might incur.