This function implements the feasible and infeasible region search algorithm FIFR for anticlustering by Wu et al. (2025; <doi.org/10.1016/j.cor.2025.107030>). The description of their algorithm is given in Section 4 of their paper (in particular, see the Pseudocode in Algorithm 1).

feasible_and_infeasible_region_search_anticlustering(
  x,
  K,
  N,
  number_iterations = 50,
  clusters = NULL,
  upper_bound = NULL,
  lower_bound = NULL,
  beta_max = NULL,
  theta_max = NULL,
  theta_min = NULL,
  beta_min = NULL,
  phi = 0.8,
  tau = NULL,
  kmax = 4,
  alpha = NULL
)

Arguments

x

The data input. Can be one of two structures: (1) A feature matrix where rows correspond to elements and columns correspond to variables (a single numeric variable can be passed as a vector). (2) An N x N matrix dissimilarity matrix; can be an object of class dist (e.g., returned by dist or as.dist) or a matrix where the entries of the upper and lower triangular matrix represent pairwise dissimilarities.

K

Number of anticlusters to be formed.

N

Number of elements.

number_iterations

A number that defines how many times the steps in the search algorithm are repeated.

clusters

A vector of length M that specifies the number of elements each cluster can contain. If this vector is not NULL, the lower and upper bounds will be disregarded.

upper_bound

Maximum number of elements in each anticluster. By default, anticlusters are of equal size, calculated as the total number of items divided by the number of clusters.

lower_bound

Minimum number of elements in each anticluster. By default, anticlusters are of equal size, calculated as the total number of items divided by the number of clusters.

beta_max

The algorithm begins with a pool of random initial solutions of size beta_max. Over time, the size of the solution pool decreases linearly until it reaches beta_min.

theta_max

Parameter for the strength of undirected perturbation, which decreases linearly over time from theta_max to theta_min.

theta_min

Parameter for the strength of undirected perturbation, which decreases linearly over time from theta_max to theta_min.

beta_min

The minimum solution pool size the algorithm should reach before making a determination.

phi

Parameter that determines the population size when initiating a new round of exploration upon triggering the jump-back mechanism

tau

Parameter when "noImp" exceeds it, the algorithm transits from exploitation to exploration strategy

kmax

A parameter that determines the maximum degree of constraint violation in the IFR search

alpha

Parameter for weitghing the discrimitation of a slighlty worse local optiomal child solution

Value

A vector of length N that assigns a group (i.e, a number between 1 and K) to each input element.

Details

Details of the implementation of the algorithm can be found in the pseudocode of the paper Wu et al. (2025)

References

Wu, X., Feng, J., Yang, J., & Zhang, Y. (2025). Feasible and infeasible region search for the maximally diverse grouping problem. Computers & Operations Research, 179, 107030. https://doi.org/10.1016/j.cor.2025.107030

Author

David Buczynski david.buczynski@hhu.de, Martin Papenberg martin.papenberg@hhu.de

Examples


# Generate some random data
N <- 120
M <- 5
K <- 3
dat <- matrix(rnorm(N * M), ncol = M)
distances <- dist(dat)

# Perform three hase serach algorithm
results1 <- feasible_and_infeasible_region_search_anticlustering(distances, K, N)
results2 <- anticlustering(distances, K = K, method = "3phase")
results3 <- anticlustering(distances, K = K, method = "local-maximum", repetitions = 50)

# Compute objectives funtion
diversity_objective(distances, results1)
#> [1] 7021.706
diversity_objective(distances, results2)
#> [1] 7021.838
diversity_objective(distances, results3)
#> [1] 7021.635