🏠 Home · ← Prev: CPH — Implementation
The Maximum Diversity Problem (MDP) consists of selecting a set of elements from a larger collection so that the selected elements have the most varied characteristics among themselves (Kuo et al., 1993). An example application of this problem arises in biodiversity preservation. In that setting, a limited number of resources is available to save only a given number of species. Here it is more appropriate to save the species that display the most varied set of characteristics.
From a computational point of view, the MDP is an intractable problem; that is,
no algorithm is known that guarantees obtaining a solution (and verifying that it
is optimal) within a reasonable amount of running time. For this reason, it
becomes necessary to build an approximate algorithm to solve it. From a
mathematical point of view, and letting
Kuo et al. (1993) use this formulation to show that the clique problem (which
is
| Nº | Sex | Race | Region | Education | Class | Political |
|---|---|---|---|---|---|---|
| 1 | Female | White | West | Higher voc. | Middle | Right |
| 2 | Male | White | East | University | Middle | Nonpartisan |
| 3 | Male | Black | West | High school | Lower-middle | Left |
| 4 | Female | Black | Center | Basic | Lower-middle | Right |
| 5 | Female | White | Center | University | High | Nonpartisan |
| 6 | Male | Black | East | University | Middle | Nonpartisan |
| 7 | Male | White | West | Higher voc. | High | Left |
| 8 | Male | White | Center | High school | Low | Right |
| 9 | Male | White | East | Higher voc. | Middle | Left |
| 10 | Female | Black | East | University | High | Right |
Table 1. Characterized inhabitants.
To illustrate the maximum diversity problem, a complete example based on Kuo et al. (1993) is presented. Consider the inhabitants of a city characterized by their sex, race, education, etc., as shown in Table 1. For a pollster who can only conduct a given number of surveys, it is useful to choose those inhabitants with the most varied characteristics among themselves. The problem can be modeled as an instance of the MDP. The first step is to define a distance between each pair of inhabitants. To do so, we choose a numerical encoding for each characteristic as shown in Table 2.
| Characteristic | Value 1 | Value 2 | Value 3 | Value 4 |
|---|---|---|---|---|
| Sex | Male | Female | ||
| Race | White | Black | ||
| Region | East | Center | West | |
| Education | Basic | High school | Higher voc. | University |
| Class | Low | Lower-middle | Middle | High |
| Political | Left | Nonpartisan | Right |
Table 2. Encoding of characteristics.
Applying that encoding, the inhabitants are defined as vectors in a
seven-dimensional space (one dimension
| Nº | Sex | Race | Region | Education | Class | Political |
|---|---|---|---|---|---|---|
| 1 | 2 | 1 | 3 | 3 | 3 | 3 |
| 2 | 1 | 1 | 1 | 4 | 3 | 2 |
| 3 | 1 | 2 | 3 | 2 | 2 | 1 |
| 4 | 2 | 2 | 2 | 1 | 2 | 3 |
| 5 | 2 | 1 | 2 | 4 | 4 | 2 |
| 6 | 1 | 2 | 1 | 4 | 3 | 2 |
| 7 | 1 | 1 | 3 | 3 | 4 | 1 |
| 8 | 1 | 1 | 2 | 2 | 1 | 3 |
| 9 | 1 | 1 | 1 | 3 | 3 | 1 |
| 10 | 2 | 2 | 1 | 4 | 4 | 3 |
Table 3. Representation of the inhabitants as vectors in a 7-dimensional space.
We can therefore compute a distance matrix containing the distance between each
pair of inhabitants. This matrix appears in Table 4. For this particular example
we are going to select the 3 most varied inhabitants; that is, we have to model
the problem as an MDP with
| 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 2.65 | 2.83 | 2.65 | 2 | 2.83 | 2.45 | 2.65 | 3 | 2.65 |
| 2 | 3.32 | 3.74 | 1.73 | 1 | 2.65 | 3.16 | 1.41 | 2 | |
| 3 | 2.65 | 3.46 | 3.16 | 2.45 | 2.65 | 2.65 | 4.12 | ||
| 4 | 3.87 | 3.61 | 3.87 | 2 | 3.46 | 3.74 | |||
| 5 | 2 | 2 | 3.87 | 2.24 | 1.73 | ||||
| 6 | 2.83 | 3.32 | 1.73 | 1.73 | |||||
| 7 | 3.87 | 2.24 | 3.32 | ||||||
| 8 | 3.16 | 4 | |||||||
| 9 | 2.83 |
Table 4. Distance matrix of the inhabitants.
To apply a metaheuristic framework such as scatter search to a specific problem, it is necessary to design some parts of the framework specifically for it. In particular, for scatter search, it is necessary to define a distance between solutions, so that it can be used when solutions are selected by diversity. In addition, the methods for generating diverse solutions, generating subsets, combining solutions, and the improvement method must be designed.
To determine the most suitable methods, three variants of scatter search for the MDP have been implemented. The differences between these variants are based on the methods used to build diverse solutions, combine solutions, and improve them. Table 5 lists the methods used in each of the configurations. The procedure called "No information" does not use any problem-specific information. The procedure called "With information" implements several MDP-specific strategies. The "With memory" procedure uses, in addition to problem information, memory structures that are typical of tabu search implementations (Glover & Laguna, 1997).
Through several preliminary experiments, it was decided to use a
| Configuration | Solution Generation | Combination | Improvement |
|---|---|---|---|
| No information | Random selection of |
Random selection of |
Best-improvement Local Search (LS) |
| With information | GRASP_D-2, based on randomizing the D-2 destructive heuristic | Applying D-2 to the union of the elements of the solutions being combined | First-improvement Improved Local Search (I_LS) |
| With memory | Tabu_D-2, based on adding memory structures to D-2 | Applying Tabu_D-2 to the union of the elements of the solutions being combined | Local Search Tabu Search (LS_TS) with short-term memory |
Table 5. Scatter search variants.
The following subsections define the distance between solutions and each of the methods used in each variant. In addition, the last subsection mentions an improvement made to the general scatter search scheme.
The distance is used to measure how diverse a solution is with respect to a set
of solutions. Specifically, for the MDP,
The formula simply counts the number of times each element selected in the
candidate solution
This section describes the methods used in the different configurations for generating diverse solutions.
This method consists of selecting
The GRASP_D-2 procedure, developed by Duarte & Martí (2006), is based on
randomizing the destructive heuristic developed by Glover, Kuo & Dhir (1998).
D-2 starts with an infeasible solution for which
The randomization of D-2 used in GRASP_D-2 consists of selecting $i^$ from a
Reduced Candidate List (RCL) formed by all those elements $i$ such that
$D(i) \leq (1 - \alpha) D(i^)$. The value of
The Tabu_D-2 method was presented in Duarte & Martí (2006). It is based on adding
memory structures to the D-2 method. At each step of the procedure, the element
where
In this modified distance computation,
The simplest method for subset generation has been considered. This method consists of generating one subset for each distinct pair of the solutions to be combined.
This section describes the methods used for combining solutions in each of the
scatter search variants presented. To illustrate the different methods, we use
the detailed example presented in the introduction to the MDP. Suppose that,
during the execution of the algorithm, two reference solutions
This method consists of selecting
This method consists of applying the D-2 destructive heuristic to the union of
the elements of the solutions being combined. The method starts by selecting all
the elements in the union and deselects one element at a time until only
The minimum
This consists of applying the Tabu_D-2 procedure to the union of the elements of the reference solutions that have to be combined. This method uses information about the solutions generated in the past, as well as information associated with those combined solutions. To illustrate how the procedure works, a combination based on the example from A Detailed Example is presented. For this, we assume that after a number of iterations the information in Table 6 is available.
| Element | Frequency | Quality |
|---|---|---|
| 1 | 13 | 7.73 |
| 2 | 19 | 7.25 |
| 3 | 17 | 8.69 |
| 4 | 8 | 9.37 |
| 5 | 45 | 6.64 |
| 6 | 17 | 7.71 |
| 7 | 16 | 8.42 |
| 8 | 16 | 9.09 |
| 9 | 19 | 7.44 |
| 10 | 13 | 8.50 |
Table 6. Information about previous solutions.
We use Table 6 to compute the modified
The minimum
This section describes the methods used for improving solutions in each of the scatter search variants presented.
The Local Search (LS) method (Ghosh, 1996) scans the set of selected elements looking for the best swap to replace a selected element with an unselected one. The method performs moves as long as the objective-function value increases. It ends its execution when no element swap that improves the solution can be found. This improvement method is classified among the methods that apply the move that improves the most; that is, the best move (best improvement).
The Improved Local Search (I_LS) method (Duarte & Martí, 2006) selects the
element $i^$ ($x_{i^} = 1$) that provides the smallest contribution to the
objective-function value of the current solution. It then looks for an element
The improvement method used in the Hybrid Tabu Search configuration is based on
the Local Search Tabu Search (LS_TS) method (Duarte & Martí, 2006). It implements
a short-term tabu search method based on swaps. An iteration of this method
begins with the selection of the element
The original LS_TS method was modified when it was added to our scatter search
framework. The modification consists of using an asymmetric tabu tenure in
which the elements added to the solution have a smaller tabu tenure than the one
assigned to the elements that have been removed from the solution. Also, the tabu
tenure and the maximum number of iterations have been made dependent on the
number of elements in the solution. According to the experimentation presented in
Duarte & Martí (2006), the tabu tenure of the selected elements is set to
In some initial tests during the design of the algorithm, it was detected that the diversification and combination methods obtain the same solution more than once. To avoid applying the improvement method to the same solution more than once, a hash map data structure was developed. This data structure stores all solutions and their corresponding improvement. It is indexed using the hash function of the algorithm below. This hash function was selected because it is the default implementation for the encoding used in the Java programming language.
Algorithm 1. Hash function.
This method is able to filter 0.5% of the solutions in the Hybrid GRASP procedure and 82% of the solutions in the Hybrid Tabu Search procedure. Before applying the improvement procedure, the hash function is used to check whether that solution already exists in the data structure. In that case, the previously improved solution — which is also stored in the data structure — is used.
- Kuo, C.-C., Glover, F., & Dhir, K. S. (1993). Analyzing and modeling the maximum diversity problem by zero-one programming.
- Glover, F., & Laguna, M. (1997). Tabu Search.
- Glover, F., Kuo, C.-C., & Dhir, K. S. (1998). Heuristic algorithms for the maximum diversity problem.
- Ghosh, J. B. (1996). Computational aspects of the maximum diversity problem.
- Duarte, A., & Martí, R. (2006). Tabu search and GRASP for the maximum diversity problem.