Largest number p of contiguous regions whose summed weights reach
threshold: repeated random constructions (Philox) grow regions from
shuffled seeds and attach enclaves to the adjacent region of least SSD increase,
keeping the largest p and then the smallest SSD; an AZP local search that keeps
every donor above the threshold then lowers the SSD.
Usage
MaxPRegions(
X,
adjacency,
weights,
threshold,
n_construct = 50,
seed = 0,
local = TRUE,
max_iter = 1000
)Arguments
- X
Attribute matrix (units in rows).
- adjacency
0/1 contiguity matrix or list of 1-based neighbour vectors.
- weights
Per-unit weights for
min_weight.- threshold
Minimum summed weight per region.
- n_construct
Number of constructions.
- seed
Philox seed.
- local
Run the local search.
- max_iter
Maximum local-search sweeps.
