
Recent Posts
 Code Generation With Unfixed Variable Locations May 18, 2022
 Code Generation With Address Expressions December 8, 2021
 Code Generation for Parallel Assignments November 17, 2021
 Code Generation With Unlimited Registers November 4, 2021
 Code Generation on a OneRegister Machine October 13, 2021
Recent Comments
 Linear regression with l0l_0 regularization – GrindSkills on Exact Cover by 3Sets
 Sean T. McCulloch on Satisfiability
 Jonathan Buss on Satisfiability
 Sean T. McCulloch on Pokemon
 Tim Knittel on Pokemon
Archives
 May 2022
 December 2021
 November 2021
 October 2021
 September 2021
 August 2021
 July 2021
 May 2021
 April 2021
 March 2021
 February 2021
 January 2021
 December 2020
 November 2020
 October 2020
 September 2020
 August 2020
 March 2020
 February 2020
 January 2020
 December 2019
 November 2019
 October 2019
 September 2019
 August 2019
 July 2019
 June 2019
 May 2019
 April 2019
 March 2019
 February 2019
 January 2019
 December 2018
 November 2018
 October 2018
 September 2018
 August 2018
 July 2018
 June 2018
 May 2018
 April 2018
 March 2018
 February 2018
 January 2018
 December 2017
 November 2017
 October 2017
 September 2017
 August 2017
 July 2017
 June 2017
 May 2017
 April 2017
 March 2017
 February 2017
 January 2017
 December 2016
 November 2016
 October 2016
 September 2016
 August 2016
 July 2016
 June 2016
 May 2016
 April 2016
 March 2016
 February 2016
 January 2016
 December 2015
 November 2015
 October 2015
 September 2015
 August 2015
 July 2015
 June 2015
 May 2015
 April 2015
 March 2015
 February 2015
 January 2015
 December 2014
 November 2014
 October 2014
 September 2014
 August 2014
 July 2014
 June 2014
Categories
 Algebra and Number Theory
 Appendix Algebra and Number Theory
 Appendix Automata and Language Theory
 Appendix Games and Puzzles
 Appendix Mathematical Programming
 Appendix Network Design
 Appendix Program Optimization
 Appendix Sets and Partitions
 AppendixGraph Theory
 AppendixLogic
 Appendix: Sequencing and Scheduling
 Appendix: Storage and Retrieval
 Chapter 3 Exercises
 Core Problems
 Overview
 Problems not in appendix
 Uncategorized
Monthly Archives: January 2016
Protected: Graph Partitioning
Enter your password to view comments.
Posted in Appendix Network Design
Tagged Difficulty 5, Graph Partitioning, ND14, Partition Into Triangles, uncited reduction
Protected: Geometric Steiner Tree
Enter your password to view comments.
Posted in Appendix Network Design
Tagged Difficulty 10, Geometric Steiner Tree, ND13, Steiner Tree
Protected: Multiple Choice Branching
Enter your password to view comments.
Posted in Appendix Network Design
Tagged 3sat, Difficulty 6, Multiple Choice Branching, No G&J reference, uncited reduction
Bounded Component Spanning Forest
This problem makes me think about how voting districts are apportioned, and how we can use algorithms to solve realworld situations like gerrymandering.
The problem: Bounded Component Spanning Forest. This is problem ND10 in the appendix.
The description: Given a graph G=(V,E) where each vertex has a nonnegative weight, and two integers K and B, can we partition the vertices of V into K (or less) disjoint subsets where each subset is connected and the sum of the weights of the vertices in each subset is at most B?
Example: Here’s a graph where each vertex is labeled with its weight. Note that in this example, the edge weights are distinct and sequential, and that doesn’t have to be the case.
If K=3 and B = 14, then we can partition this into {1,2,4,7}, {5,8}, and {3,6}. If K=3 and B=10, this can’t be solved. (The vertices 8 and 7 would have to each be in their own set, because anything they connect to would raise the total of that set beyond 10, and the sum of all of the other vertices is more than 10. So we need more than 3 sets to partition the vertices if each subset needs to be a connected set with total weight 10 or less)
Note: Here’s how this applies to the voting problem I alluded to above. Each congressional district is made up of several “precincts” local areas that have a smallish number of people. The boundaries of each congressional district is a connected group of wards. So, for example, I’m part of Ohio’s 12th congressional district, but even within the relatively small town I live in, there are at least 3 different precincts, and I have a specific one assigned to me.
We could apply the Bounded Component Spanning Forest problem to this situation by creating a graph, where each vertex in the graph represents a precinct and has a weight equivalent to the number of people living in that precinct. Two precincts have an edge between them if they’re geographically adjacent. We can be given a list of all of the precincts in the state, and then K would be the number of congressional districts to form. B would be a bound on how large (in terms of number of people) each district can be (or, how far from 1/Kth of the population each district can be). This works in creating congressional districts, and, as we’ll see, is already NPComplete, even before thinking about gerrymandering.
The only requirement so far is that each district has to be contiguous nothing has yet been said about the shape. But a natural definition of “nongerrymandered” could be “minimum diameter”, and so we can add a new parameter, D, to the problem, and force each of the K subsets of vertices to not only be connected, but be connected with diameter D or less. Since this is a generalization of the original problem, this is also NPComplete (by a difficulty 1 reduction).
So, there you go. Fixing gerrymandering (at least by this definition) is NPComplete. Since most states have hundreds (perhaps more it’s remarkably nontrivial to find a simple answer to “how many precincts are in Ohio”) of precincts, the best we could likely do is some heuristic mechanism, and of course, any heuristic has a chance of being suboptimal against one party or another, and so they will never accept it. Sigh.
Anyway, back to the math!
The reduction: From Partition into Paths of Length 2. We’re given a graph G that needs to be partitioned into paths of length 2. Recall that a path of length 2 has exactly 3 vertices, and that an instance of this problem promises that the number of vertices is a multiple of 3.
We’ll use the same graph for our Bounded Component Spanning Forest instance, and set K=V/3, give each vertex weight 1, and set B=3.
Now, each set of our partition has to be connected and have exactly 3 vertices, which is the same as having a path of length 2.
Difficulty: 2.