Program and Data files for the paper

 

Tanima Chatterjee, Bhaskar DasGupta, Laura Palmieri, Zainab Al-Qurashi and Anastasios Sidiropoulos, Alleviating partisan gerrymandering: can math and computers help to eliminate wasted votes?, arXiv:1804.10577 [cs.CY], 2018.


 

o   Links for python source codes (to generate new redistricting maps):

o   prepare_data.py

o   ungerrymander.py

o   Instructions about how to compile and run the code

(The above links will be active at a later date. The unavailable codes may be available by request for non-commercial scientific (academic) purposes).

 

o   R code to create and manipulate the maps (save and then open with Notepad or similar text editors)

o   prepareStateCounties.R

creates the blank map of a certain state divided into counties

o   mapVisualization.R

creates the colored map and manipulates shared counties to assign the right color

o   Instructions about how to compile and run the code

 


 

 

Link to the data files for the three states used in the paper are below. Each data is an EXCEL spreadsheet.

 

Explanations of various columns of the spreadsheet

 

Column 1:

District: This column identifies the district number of the county in column 3.

 

Column 2:

County_id: Column 1 and column 2 together form an unique identifier for the counties in column 3. A county is identified by its County_id (column 2) and the District (column 1) it belongs to. This was specifically needed to identify and differentiate the counties that belonged to more than one district.

 

The software considers the counties belonging to different districts as separate entities.

 

Column 3:

County: This column contains the name of the county.

 

Column 4:

Republicans: This contains the total number of votes in favor of the Republican party (GOP) in the county identified by column 1 and column 2.

 

Column 4:

Democrats: This contains the total number of votes in favor of the Democratic party in the county identified by column 1 and column 2.

 

Column 5:

Neighbors: This column contains information about the neighboring counties of the given county. Neighboring counties represents the counties that share a boundary with the county identified by column 1 and column 2. Neighbors are separated by commas.

 

 

Links to the EXCEL spreadsheet data and maps

 

(1)  Data for the state of Wisconsin

a)     2012 election of the (federal) house of representatives, and corresponding map

b)     Un-gerrymandered districts proposed by our software, and corresponding map

(2)  Data for the state of Texas

a)     2012 election of the (federal) house of representatives, and corresponding map

b)     Un-gerrymandered districts proposed by our software, and corresponding map

(3)  Data for the state of Virginia

a)     2012 election of the (federal) house of representatives, and corresponding map

b)     Un-gerrymandered districts proposed by our software, and corresponding map

(4)  Data for the state of Pennsylvania

a)     2012 election of the (federal) house of representatives, and corresponding map

a)     Un-gerrymandered districts proposed by our software, and corresponding map