Aggregates contiguous units into k contiguous zones: a random contiguous start
(Philox-drawn seeds growing one random neighbour per round) or init, then
AZP local search moving border units while the donor stays contiguous and the
objective falls. objective = "ssd" minimises the within-zone sum of squared
deviations; "balance" minimises the squared deviations of zone weight
totals from their mean (redistricting).
Usage
AutomaticZoning(
X,
adjacency,
k,
objective = c("ssd", "balance"),
weights = NULL,
init = NULL,
seed = 0,
max_iter = 1000
)
Arguments
- X
Attribute matrix (units in rows).
- adjacency
0/1 contiguity matrix or list of 1-based neighbour vectors.
- k
Number of regions.
- objective
"ssd" or "balance".
- weights
Per-unit weights for min_weight.
- init
Initial zone labels (1-based), or NULL.
- seed
Philox seed.
- max_iter
Maximum sweeps.
Value
list(labels, objective, initial, sweeps).
References
Openshaw, S. (1977). A geographical solution to scale and
aggregation problems in region-building, partitioning and spatial modelling.
Transactions of the Institute of British Geographers 2, 459-472.
Examples
AutomaticZoning(matrix(c(0, 0.1, 0.2, 5, 5.1, 5.2)), list(2, c(1, 3), c(2, 4), c(3, 5), c(4,
6), 5), 2)$labels
#> [1] 1 1 1 2 2 2