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):
(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)
creates the blank map of a certain state divided into counties
creates the colored map and manipulates shared counties to assign the right color
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
District: This column identifies the district number of the county in column 3.
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.
County: This column contains the name of the county.
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.
Democrats: This contains the total number of votes in favor of the Democratic party in the county identified by column 1 and column 2.
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
(2) Data for the state of Texas
(3) Data for the state of Virginia
(4) Data for the state of Pennsylvania