election-methods@mailman.electorama.com

Technical discussion of election methods

View all threads

Re: [EM] Shortest splitline maps with 2010 (2013) data

RF
Raph Frank
Sun, Nov 27, 2016 10:17 PM

I have improved the population balancing and the html formatting.

The new link is at

http://raphfrk.com/district/2010/html/index.html

PS
The original mail bounced since my EM membership expired.

On Sun, Nov 27, 2016 at 2:48 AM, Raph Frank raphfrk@gmail.com wrote:

I haven't posted here in a while.

I re-implemented my code in Java to process the 2010 data.  The new code
can process the shapefiles, so it has information about the block
boundaries and connectivity.

The software generates tiles that can be viewed online using the Leaflet
interactive map library.

I tried to make it flexible.  So far it supports "official districts" and
"splitline".

The latest (splitline) maps can be viewed at this link.

http://raphfrk.com/splitline_2010/html/Alabama.html

(I am not sure how much bandwidth this uses, but hopefully, it doesn't
kill my webhost.)

Details:

2010 Census block level data is used.

The census defines an internal point for each block.

The population of the block is considered concentrated at that point.

The state boundary is the boundary of the combination of all the blocks.

When a split is part of the boundary, I use the line.  It doesn't
recompute the block based boundary.

(Using the block boundaries to determine longest split could be abused
anyway)

Gnonomic projection is used because the lines are actually great circles.

The shortest splitline algorithm is run using the block internal points.

Once the splitline algorithm completes, I run a post processing step using
the connectivity data.

This moves isolates blocks into the district that envelops them so that
the districts are contiguous.

Then it moves blocks that are on the boundary to another district to
balance population.

The post processor moves at most 0.25% of the population of a state
around.  In most cases, it is around 0.1%

In many cases the post processor gets the population to a range of 1 or
2.  Some maps are harder to balance.

I have improved the population balancing and the html formatting. The new link is at http://raphfrk.com/district/2010/html/index.html PS The original mail bounced since my EM membership expired. On Sun, Nov 27, 2016 at 2:48 AM, Raph Frank <raphfrk@gmail.com> wrote: > I haven't posted here in a while. > > I re-implemented my code in Java to process the 2010 data. The new code > can process the shapefiles, so it has information about the block > boundaries and connectivity. > > The software generates tiles that can be viewed online using the Leaflet > interactive map library. > > I tried to make it flexible. So far it supports "official districts" and > "splitline". > > The latest (splitline) maps can be viewed at this link. > > http://raphfrk.com/splitline_2010/html/Alabama.html > > (I am not sure how much bandwidth this uses, but hopefully, it doesn't > kill my webhost.) > > Details: > > 2010 Census block level data is used. > > The census defines an internal point for each block. > > The population of the block is considered concentrated at that point. > > The state boundary is the boundary of the combination of all the blocks. > > When a split is part of the boundary, I use the line. It doesn't > recompute the block based boundary. > > (Using the block boundaries to determine longest split could be abused > anyway) > > Gnonomic projection is used because the lines are actually great circles. > > The shortest splitline algorithm is run using the block internal points. > > Once the splitline algorithm completes, I run a post processing step using > the connectivity data. > > This moves isolates blocks into the district that envelops them so that > the districts are contiguous. > > Then it moves blocks that are on the boundary to another district to > balance population. > > The post processor moves at most 0.25% of the population of a state > around. In most cases, it is around 0.1% > > In many cases the post processor gets the population to a range of 1 or > 2. Some maps are harder to balance. >
KM
Kristofer Munsterhjelm
Mon, Nov 28, 2016 8:01 PM

On 11/27/2016 11:17 PM, Raph Frank wrote:

I have improved the population balancing and the html formatting.

The new link is at

http://raphfrk.com/district/2010/html/index.html

Perhaps you could try a Sierpinski space-filling curve approximation
next? http://rangevoting.org/SpaceFillCurve.html

In essence, you use a space-filling curve to turn the 2D map into 1D,
trivially partition the line, then map back. I imagine you'd have to use
postprocessing to even out the fractal boundaries a little, however, and
to ensure that the districts are contiguous, but it's conceptually a
very simple algorithm.

On 11/27/2016 11:17 PM, Raph Frank wrote: > I have improved the population balancing and the html formatting. > > The new link is at > > http://raphfrk.com/district/2010/html/index.html Perhaps you could try a Sierpinski space-filling curve approximation next? http://rangevoting.org/SpaceFillCurve.html In essence, you use a space-filling curve to turn the 2D map into 1D, trivially partition the line, then map back. I imagine you'd have to use postprocessing to even out the fractal boundaries a little, however, and to ensure that the districts are contiguous, but it's conceptually a very simple algorithm.
RF
Raph Frank
Mon, Nov 28, 2016 11:24 PM

I wrote a quick implementation using the Hilbert space.  I think I have the
point comparison correct.  It uses the center of the bounding box of the
district as the middle of the Hilbert curve.

The largest curve goes top left to bottom left to bottom right to top right.

http://raphfrk.com/district/2010/html/index.html

It doesn't actually give contiguous districts, since the curve isn't
restricted to the state boundary.

On Mon, Nov 28, 2016 at 8:01 PM, Kristofer Munsterhjelm <
km_elmet@t-online.de> wrote:

On 11/27/2016 11:17 PM, Raph Frank wrote:

I have improved the population balancing and the html formatting.

The new link is at

http://raphfrk.com/district/2010/html/index.html

Perhaps you could try a Sierpinski space-filling curve approximation
next? http://rangevoting.org/SpaceFillCurve.html

In essence, you use a space-filling curve to turn the 2D map into 1D,
trivially partition the line, then map back. I imagine you'd have to use
postprocessing to even out the fractal boundaries a little, however, and
to ensure that the districts are contiguous, but it's conceptually a
very simple algorithm.

I wrote a quick implementation using the Hilbert space. I think I have the point comparison correct. It uses the center of the bounding box of the district as the middle of the Hilbert curve. The largest curve goes top left to bottom left to bottom right to top right. http://raphfrk.com/district/2010/html/index.html It doesn't actually give contiguous districts, since the curve isn't restricted to the state boundary. On Mon, Nov 28, 2016 at 8:01 PM, Kristofer Munsterhjelm < km_elmet@t-online.de> wrote: > On 11/27/2016 11:17 PM, Raph Frank wrote: > > I have improved the population balancing and the html formatting. > > > > The new link is at > > > > http://raphfrk.com/district/2010/html/index.html > > Perhaps you could try a Sierpinski space-filling curve approximation > next? http://rangevoting.org/SpaceFillCurve.html > > In essence, you use a space-filling curve to turn the 2D map into 1D, > trivially partition the line, then map back. I imagine you'd have to use > postprocessing to even out the fractal boundaries a little, however, and > to ensure that the districts are contiguous, but it's conceptually a > very simple algorithm. >
KM
Kristofer Munsterhjelm
Tue, Nov 29, 2016 6:50 PM

On 11/29/2016 12:24 AM, Raph Frank wrote:

I wrote a quick implementation using the Hilbert space.  I think I have
the point comparison correct.  It uses the center of the bounding box of
the district as the middle of the Hilbert curve.

The largest curve goes top left to bottom left to bottom right to top right.

http://raphfrk.com/district/2010/html/index.html

It doesn't actually give contiguous districts, since the curve isn't
restricted to the state boundary.

Ah, yes. I imagine it would be possible to warp the state into a square,
assign points, and then warp back, but I'm not sure if that would
preserve the approximation to optimality. I think it wouldn't cause too
great a distortion since how far you go along the path depends on the
population rather than on the length of the path, but I can't be
entirely certain.

According to Warren, the Sierpinski curve is better than the Hilbert one
as well, so it'd be interesting to see if it would produce better
results in practice. However, one'd probably have to solve the
non-contiguous problem first.

On 11/29/2016 12:24 AM, Raph Frank wrote: > I wrote a quick implementation using the Hilbert space. I think I have > the point comparison correct. It uses the center of the bounding box of > the district as the middle of the Hilbert curve. > > The largest curve goes top left to bottom left to bottom right to top right. > > http://raphfrk.com/district/2010/html/index.html > > It doesn't actually give contiguous districts, since the curve isn't > restricted to the state boundary. Ah, yes. I imagine it would be possible to warp the state into a square, assign points, and then warp back, but I'm not sure if that would preserve the approximation to optimality. I think it wouldn't cause too great a distortion since how far you go along the path depends on the population rather than on the length of the path, but I can't be entirely certain. According to Warren, the Sierpinski curve is better than the Hilbert one as well, so it'd be interesting to see if it would produce better results in practice. However, one'd probably have to solve the non-contiguous problem first.