All work should be done on your own. If you discuss this assignment in any way with anyone else, or find help for getting the answer from any source, you must state so clearly at the top of your submission. There should be no working together except to understand the question.
Consider the problem of finding the maximum number of floors that a student may be dropped from and survive. Assume that all students are equally resilient and will die from the same height. Given three students and that students are relatively heavy, what is an algorithm to minimize the number of trials in the experimental process?
This problem is potentially addressed through a process called balancing. Balancing divides the problem into among subsolutions that deal with particular elements of the problem effectively. These subsolutions are then balanced in running time to find an efficient solution. For the student dropping problem with two students an effective division is:
The value of k to balance these factors is:
When adding an additional student the algorithm simply repeats. The first student is used to find a grand division, the second divides the grand division and the third is sequential within those bounds. The balancing of these three factors is:
Suppose a graph is known to be four-colorable. Design an algorithm that colors a graph with a minimum number of colors in the worst case. The algorithm should use the following properties:
Consider first the problem of coloring a graph that is known to be three-colorable. One method is to balance two strategies:
The algorithm operates by only considering uncolored vertices and using the first method until there are no vertices with a degree ≥ k remaining. This will use, in the worst case, colors. The remaining vertices are then colored with the second method. This will use colors in the worst case.
Balancing these two factors is simply:
The basic method used in the algorithm can be extended to handle four-colorable graphs through simple recognition that the neighborhood of a vertex in a four-colorable graph is a three-colorable graph.
In the worst case, the number of colors used in the three-coloring algorihm when (recalling the sides are balanced at k) is:
So, consider an algorithm where while there is a vertex with degree ≥ j, then three color the neighborhood of x. When there are no uncolored vertices remaining with degree ≥ j color the remainder with distinct colors. The balancing of these two stategies then is:
Consider a three-colorable graph with edges. Design a polynomial time algorithm to color the edges with colors.
To say that a graph has edges means that the number edges is ≤ .
Consider the previously presented balancing solution for coloring a graph that is known to be three-colorable, with an additional step added
The previous analysis looked at computational complexity in terms of the number of vertices eliminated. It is also possible to conceptualize the complexity in terms of edges eliminated. Because each iteration of the algorithm draws from a new set of colors, if a vertex at one end of an edge is colored during one iteration the other vertex can only be colored with the same colors during that particular step. Future iterations will draw from a different set of colors. So, once one end of an edge has been colored the edge can no longer be a source of conflict in the coloring problem.
The maximum number of vertices connected with m edges is if each edge connects two vertices with degree 1. In this situation there are 2m nodes with degree > 0. In a graph with m vertices, there must be ≥ n - 2m initially disconnected vertices (degree(x) = 0). Additionally, each iteration of the other two coloring schemes will each leave a disconnected vertex.
The addition of a consideration for those disconnected vertices in a graph with a low number of edges allows the number of colors to be bounded by the number of edges rather than the number of vertices. Omitting the one color used at the end to color all the degree 0 vertices, the balancing peoblem is now:
The number of colors used with this value of k is:
A clique within a graph is a fully connected subgraph. Suppose that a graph has a clique of size . Show that there is a polynomial time algorithm to find a clique of size .