I am a political scientist interested in malapportionment. I have a population data which has the municipality-level population and polygon format, so it can show how many people are living in the specific area on the map. (In the example map, the color gets darker as there are more people).
+-------------------+------------+
| Municipality_Name | Population |
+-------------------+------------+
| A | 123456 |
+-------------------+------------+
| B | 234567 |
+-------------------+------------+
Since I am considering the single-member district, each district elects one representative. I would like to combine several municipalities into a district so that each district has a (similar) number of population and each representative is responsible to the (similar) number of people.
For example, in the table below, each district has around six people.
+-------------------+------------+---------------+
| Municipality_Name | Population | District_Code |
+-------------------+------------+---------------+
| A | 2 | 1 |
+-------------------+------------+---------------+
| B | 4 | 1 |
+-------------------+------------+---------------+
| C | 1 | 2 |
+-------------------+------------+---------------+
| D | 2 | 2 |
+-------------------+------------+---------------+
| E | 3 | 2 |
+-------------------+------------+---------------+
| F | 6 | 3 |
+-------------------+------------+---------------+
| G | 2 | 4 |
+-------------------+------------+---------------+
| H | 5 | 4 |
+-------------------+------------+---------------+
Is there any way to conduct this kind of analysis in ArcMap? If there isn't, is there any useful resources/articles for this issue (I can use R/Python)?