← Back to all sparks
R

redist

ANALYTICS
Velocity0.0

Simulation Methods for Legislative Redistricting

redist keeps rewriting the sampler underneath a district-drawing API it has held stable since 4.0.

rredistrictingmonte-carlosamplingparallelism
Current state
redist simulates redistricting plans via sequential Monte Carlo, merge-split MCMC and short-burst optimization, and it is the analysis tool behind a good deal of published districting work. The user-facing shape was set by 4.0.1's constraint interface and the split of metrics into the redistmetrics package; since then the changes are in the algorithms. The most consequential recent one replaces the SMC label-counting adjustment with a backward kernel that removes approximation error outright.
Where it's heading
The direction is toward exactness and throughput at once — the new kernel is described as both eliminating approximation error and costing far less computation, and successive releases keep adding parallelism, most recently to the flip algorithm. Feature growth has moved into the optimization side, where short-burst gained multiple independent scorers and a Pareto frontier. The release notes are not a reliable ledger: 4.3.1 ships the identical text as 4.3.0.
Prediction
Expect the remaining single-threaded algorithms to gain the chains-style parallelism that flip just received, following the pattern SMC established several releases ago.

Recent moves

  1. 6mo ago

    Parallel chains for redist_flip()

    Adds a chains argument to redist_flip() so the flip algorithm runs in parallel, extending to flip the parallelism SMC has had since 4.0.1. The rest is CRAN URL housekeeping.

    View source ↗
  2. 6mo ago

    Patch release reusing the 4.3.0 notes

    Published with release notes byte-identical to 4.3.0 from four months earlier, so this entry documents no work of its own. Treat the backward-kernel and shortburst fixes described here as belonging to 4.3.0.

    View source ↗
  3. 10mo ago

    SMC backward kernel removes label-counting approximation error

    Replaces the SMC label-counting adjustments with a backward kernel that eliminates approximation error and costs far less computation, and pre-allocates memory when drawing spanning trees. Plans sampled after this release are not drawn from the same approximation as those before it, so results are not comparable across the boundary.

    View source ↗
  4. 2y ago

    Multi-objective short-burst search with Pareto frontier

    Short-burst optimization gains multiple independent scoring functions, exploring stochastically toward the largest Pareto frontier rather than a single objective. Also deprecates what redistmetrics now owns and speeds up contiguity checking.

    View source ↗
  5. 3y ago

    redist_ci interface and faster loop-erased random walk

    Adds the redist_ci interface for confidence intervals, improves final-stage SMC resampling efficiency, and speeds up the loop-erased random walk and RNG in C++. Steady work on the sampler that the 4.3.x kernel change would later build on.

    View source ↗
  6. 4y ago

    redist_constr() unifies constraints and admits user-defined ones

    ⚡ SPARK

    The release that fixed the package's current shape: one constraint interface across all three algorithms, user-defined constraints for the first time, metrics split out into redistmetrics, and parallel SMC. Every release since has changed algorithms underneath this API rather than the API itself.

    View source ↗