Skip to content

Latest commit

 

History

History
166 lines (132 loc) · 6.58 KB

mmdp-description.md

File metadata and controls

166 lines (132 loc) · 6.58 KB

MaxMin Diversity Problem (MMDP)

🏠 Documentation home

This document describes the MaxMin Diversity Problem and the design of the algorithm used to solve it. The implementation details are covered in the MMDP implementation notes.

Problem Description

Given a set of n elements and a distance value for every pair of elements, the MaxMin Diversity Problem (MMDP) consists of selecting a subset of m elements (m < n) such that the smallest pairwise distance among the selected elements is as large as possible. The definition of distance depends on the specific application.

  • Solution structure: an unordered subset of exactly m elements out of the n available in the instance.
  • Constraints: the subset must contain exactly m elements; both n and m are fixed by the instance being solved.
  • Objective function: the minimum pairwise distance among every pair of selected elements.
  • Optimization sense: maximization of a minimum (a maximin objective) — solutions are compared by how large their worst (smallest) pairwise distance is.

This differs from the closely related Maximum Diversity Problem (MDP), whose objective is the sum of the pairwise distances instead of their minimum.

Letting $d_{ij}$ be the distance between elements $i$ and $j$, and $x_i \in {0,1}$ indicate whether element $i$ is selected, the MMDP can be formulated as the following binary quadratic problem:

$$ \begin{aligned} \text{maximize} \quad & z_{MM}(x) = \min_{i,,j,:,x_i = x_j = 1} d_{ij} \\ \text{subject to} \quad & \sum_{i=1}^{n} x_i = m \\ & x_i \in {0,1}, \quad i = 1, \ldots, n \end{aligned} $$

Instance format

Two instance sets are used: GKD-Ia (small instances, with n between 10 and 30 and various values of m, easier to solve) and GKD-Ic (larger instances, n = 500, m = 50, requiring more computational effort). Both sets share the same file format:

  • A first line with the values of n and m.
  • One line per pair of elements, giving the indices of the two elements and the distance between them. There is one distance for every pair of elements.
10 2
0 1 166.47234
0 2 170.18475
0 3 174.55453
0 4 153.28670
0 5 145.12186
...

Algorithm Design

The MMDP is solved with a multi-start local search: a random solution is built and (optionally) improved with a local search, and this is repeated many times within a time budget, keeping the best solution found across all restarts. Four configurations are compared experimentally, differing in how each restart is improved.

Constructive: random selection

The constructive method builds a feasible solution by selecting m elements out of the n available, chosen uniformly at random (no objective information is used). In the implementation, the node list is shuffled and the first m nodes are taken.

Neighborhood and moves

The local search explores a swap neighborhood: a move replaces one selected element with one that is not currently selected. Each candidate move is evaluated by recomputing the objective (the minimum pairwise distance) of the resulting subset; a move is improving when it increases that value.

Local search strategies

Two classic neighborhood-exploration strategies are compared:

  • Best improvement: the whole neighborhood is built and the move that improves the solution the most is applied. This repeats from the resulting solution until no improving move exists.
  • First improvement: the first move found that improves the current solution is applied immediately, without examining the rest of the neighborhood. This repeats until no improving move exists.

For first improvement, the order in which candidates are visited matters. If the order is always lexicographical (smaller indices first), the search explores more exhaustively the region where low-index elements are selected, and is unlikely to reach other regions that might contain the optimum. For this reason the candidate order is often randomized so that all regions of the search space are visited with similar probability. Both a lexicographical and a random candidate order are compared.

Configurations compared

Four configurations are run and compared:

Configuration Construction Improvement
Random random selection none
First improvement (random) random selection first improvement, random candidate order
First improvement (lexicographical) random selection first improvement, lexicographical candidate order
Best improvement random selection best improvement

Pseudocode

The multi-start driver builds and improves solutions until a restart budget or a time limit is reached, keeping the best (here, "better" means a larger minimum pairwise distance, because the MMDP is a maximization problem):

$$ \begin{aligned} &\textbf{function } \text{MultiStartSearch}(\text{instance},\ \text{timeout}) \\ &\quad best := \text{null} \\ &\quad \textbf{repeat } N \textbf{ times, or until } \text{timeout} \\ &\qquad s := \text{RandomConstructive}(\text{instance}) \\ &\qquad \textbf{if } \text{improvement enabled} \textbf{ then } \text{improveSolution}(s) \\ &\qquad \textbf{if } best = \text{null} \textbf{ or } s \text{ better than } best \textbf{ then } best := s \\ &\quad \textbf{return } best \end{aligned} $$

Best improvement applies, at each step, the move with the largest improvement:

$$ \begin{aligned} &\textbf{function } \text{BestImprovement}(s) \\ &\quad \textbf{repeat} \\ &\qquad bestMove := \text{none} \\ &\qquad \textbf{for each } (\text{selected } i,\ \text{unselected } j) \\ &\qquad\quad \textbf{if } \text{swap}(i,j) \text{ improves } s \text{ the most so far} \textbf{ then } bestMove := (i,j) \\ &\qquad \textbf{if } bestMove \ne \text{none} \textbf{ then apply } bestMove \textbf{ to } s \\ &\quad \textbf{until } bestMove = \text{none} \end{aligned} $$

First improvement applies the first improving move found over the ordered candidates:

$$ \begin{aligned} &\textbf{function } \text{FirstImprovement}(s,\ order) \\ &\quad candidates := \text{nodes sorted by } order\ (\text{random or lexicographical}) \\ &\quad \textbf{repeat} \\ &\qquad changed := \text{false} \\ &\qquad \textbf{for each } \text{selected } i,\ \textbf{for each } j \in candidates \\ &\qquad\quad \textbf{if } j \text{ unselected and } \text{swap}(i,j) \text{ improves } s \textbf{ then} \\ &\qquad\qquad \text{apply swap};\ changed := \text{true};\ \textbf{break} \\ &\quad \textbf{until } changed = \text{false} \end{aligned} $$


Next: MMDP — Implementation →