Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Runs redistricting analysis in R with the redistverse packages, covering data loading, simulation, constraints, metrics and visualization.
45% 86%+41 ptsof test cases passed
Passed 19 of 22 test cases with the skill, and 10 of 22 without it.
To obtain official Census Bureau Block Assignment Files (BAF) for state legislative redistricting reconciliation in R, which package provides a direct function to download these BAF files?
The response recommends using the baf package.
3 of 3 safety checks passed
Beyond the standard SMC and merge-split workflows, redist provides exact enumeration for small problems, short-burst heuristic optimization for finding extreme plans, and cycle-walk MCMC. Use these when you need to find optimal plans, exhaustively characterize small maps, or explore the Pareto frontier across competing criteria.
redist_enumpart() — Exact EnumerationUses zero-suppressed binary decision diagrams (ZDDs) to enumerate all valid plans. Practical only for maps with fewer than ~70 precincts. Returns either all valid plans or a uniform sample from them.
plans <- redist_enumpart(
map,
ndists = map$ndists,
pop_tol = 0.05,
save_all = TRUE # FALSE to uniform-sample instead of returning all
)
This is the only algorithm that can compute exact statistics (e.g., exact seat probabilities) because it covers the full space of valid plans.
redist_shortburst() — Short-Burst OptimizationFinds extreme plans by running short MCMC bursts and keeping the best plan seen. Useful for:
plans_opt <- redist_shortburst(
map,
score_fn = function(plans, map) part_egap(plans, map$ndv, map$nrv),
max_bursts = 200,
burst_size = 10, # MCMC steps per burst
maximize = TRUE, # TRUE to maximize, FALSE to minimize
constraints = constr,
verbose = TRUE
)
Next to this one in the catalogue, plus more from the same author.