This function performs the core thinning algorithm used to reduce the density of points in spatial data while maintaining spatial representation. It iteratively removes the points with the most neighbors until no points with neighbors remain. The algorithm supports multiple trials to find the optimal thinning solution.
Arguments
- neighbor_indices
A list of integer vectors where each element contains the indices of the neighboring points for each point in the dataset.
- trials
A positive integer specifying the number of thinning trials to perform. Default is 10.
- all_trials
A logical value indicating whether to return results of all attempts (`TRUE`) or only the best attempt with the most points retained (`FALSE`). Default is `FALSE`.