AGT Take Home Exam - Gaston Bengolea

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Algorithmic Graph Theory

Gastn Bengolea Monzn- LU 379/09 o o UBA - Escuela de Ciencias Informticas - 2012 a

1. Let G be a connected graph and s, t two vertices of G. Show that the graph obtained from G by removing all the vertices not on any shortest path between s and t is bipartite. Proof. We could color the vertices with odd distance to s with one color and the even distance ones with another. This eectively colors all vertices and there isnt any edge between nodes of the same distance to s (because that would mean that there is a shortest path that goes through that edge and we could shorten it by one by taking the shortest path from s to the furthest one in the path) and there isnt an edge between two nodes with dierent distances but with the same parity in distance because that would mean that we could shorten the distance from the furthest node by more than one. 2. For a given collection L of geometric objects in the plane, its intersection graph is the graph with vertex set L in which two vertices are adjacent if and only if the two corresponding geometric objects intersect. a) Determine the set of forbidden induced subgraphs for the class of intersection graphs of lines in the plane. Intersection graphs of lines in the plane are the P3 -free Proof. First observe that if two vertices are independent it means that the corresponding lines are parallel (we are in the plane) and if they are connected by an edge, it means that either they are crossing or they are actually identical. We will restrict ourselves

EMail: gastonbm@hotmail.com

for the sake of simplicity to the case in which no two lines are identical. Notice that this graphs can be constructed as follows: (1) An empty graph (2) Joining an independent set (this way we could add a line and all that are parallel, eventually we would add all the parallel classes of equivalence). Also we can see that in building the intersection graph we cant have one vertex adjacent to just one vertex of an independent set because that would mean that the rst line cross the other but none of its parallel ones, and that is impossible in the plane, so we cant have a P3 in a line intersection graph. Now we should see that given a P3 -free graph we can construct a graph that is constructed using 1) and 2): If the graph is empty, its (1) and we are done. If not, then we can take one vertex v, and if we take all the independents to it the result its an independent set, otherwise there would be an induced P3 :
v

Also, because all non-adjacent vertices to v are in the independent set, then v dominates all the vertices of outside:

But this means that all vertices in the independent set must dominate all of the outer ones, otherwise there would be an induced P3 , and this is the join of a graph and an independent set, if we remove the later, we get a P3 -free graph and by induction it is a graph intersection of lines in the plane. b) Determine the structure of intersection graphs of half-planes in the plane. Intersection graphs of half-planes in the plane are the chordalK3 free.

Proof. Because the only way for two half-planes not to intersect is to have a parallel border and choose opposite directions, we cant have 3 half-planes independent of one another, i.e. we cant have K3 as an induced subgraph. Given a collection of half-planes in the plane, let us consider the relation of parallelism of the borders. This relation is an equivalence and induces a partition, and the intersection graph for each class can be seen as an intersection graph of rays in the line. Since a half-plane intersect all the ones that doesnt have a parallel border, the resulting intersection graph is the join of all the ray intersection graphs that correspond to each class, and because all this intersection graph are chordal the join is also chordal. Now we will construct given a chordalK3 -free graph G a collection of half-planes that admit G as its intersection graph: If G is empty we are done. If it is a complete graph we are also done: we could just put them all parallel to each other and facing in the same direction. If G is not complete, since the graph is chordal there are two nonadjacent vertices v and w that are simplicial (Diracs Theorem), meaning that N (v) and N (w) are complete, and because G is K3 free all the other vertices must be adjacent to at least one of them, resulting in a graph like this: v w

Now to construct the intersection graph we can make a ray intersection graph (a special case of a half-plane intersection graph). Let A be the vertices in N(v)-N(w) that doesnt have neighbors in N(w)-N(v) and B the vertices that are in N(w)-N(v) and are not adjacent to any vertex in N(v)-N(w), we could easily place v, w, A and B, and N(v)N(w) as this:

v A

w B N (v) N (w)

Then we can see how the remaining vertices can be sorted and put in the middle to complete the desired graph. Let v1 , v2 , ...vk be the remainings of N(v) sorted by degree (deg(vi ) deg(vj ) i j) and W be the remainings of N(w). We would like to see that if i j then N (vi ) N (vj ): If deg(vi ) = deg(vj ), suppose that N (vi ) = N (vj ) then there exists a vertex wi in N (vi ) N (vj ) and a vertex vj in N (vj ) N (vi ). But then I would have an induced C4 (vi wi wj vj vi ), and since G is chordal its a contradiction and N (vi ) = N (vj ). If deg(vi ) < deg(vj ), there must be a vertex wj N (vj ) N (vi ), and for every vertex w N (vi ) w must be in N (vj ), otherwise there would be an induced C4 (vi w wj vj vi ), therefore N (vi ) N (vj ). Finally we can put the remaining rays in the line as follows:
vk

v2 v1

v A
N (vi ) N (v2 ) N (vk )

w B N (v) N (w)

3. For two graphs H and G, H is an induced minor of G, if H can be obtained from G by a sequence of vertex removals and edge contractions. a) Show that the class of graph that do not contain Pk as an induced subgraph is closed under taking induced minors.

Proof. Let k be a xed number, and G a graph that do not contain a Pk as an induced subgraph. We will proceed by induction in the number of vertices: Its easy to see that removing a vertex cant lead to a graph that contains a Pk as an induced subgraph because that is actually the denition of not having it as an induced subgraph. Then by removing any vertex we have a graph with one less vertex and that dont contain a Pk as an induced subgraph. If we instead contract an edge and have an induced Pk , the contracted edge must belong to the path in the original or otherwise we could have removed one vertex in the original and have an induced Pk with is a contradiction. And if after contracting an edge of the path we have a Pk that means that in the original we had a Pk+1 ! This is a contradiction so contracting an edge cant produce a Pk and we will have a graph with one less vertex and no induced Pk , so by inductive hypothesis the graph is closed under taking induced minors. b) Determine the forbidden induced minor characterization for these graphs. The forbidden induced minor is Pk itself. Proof. If we have a graph that doesnt have a Pk as an induced subgraph we saw that we cant have it as an induced minor. And if we have a graph that has an induced subgraph Pk then it has a Pk as an induced minor, in particular, it can be obtained using only vertex removals. (This says that for Pk induced subgraph and induced minor are the same) c) Let G be a class of graphs closed under taking induced minors. Let H be the class of all graphs whose vertex set can be partitioned into two parts, such that one part induces a clique, and the other part induces a graph from G (When G is the class of edgeless graphs, H is the class of split graphs.) Show that H is also closed under taking induced minors. Proof. If we remove a vertex or contract an edge from the clique, then the rest from the clique will still be clique, only smaller. If we remove a vertex or contract an edge from the induced graph G

then because G is closed under taking induced minors the resulting graph is in H. If we contract an edge that goes between the clique and the induced G, then we can consider the new vertex part of the clique (that doesnt change at all) and if we consider the induced subgraph of the other part its like we have removed a vertex, an since that other part induces a graph in G that is closed under taking induced minors, in particular vertex removals, then the resulting graph is also in H. 4. Show that the class of all graphs is not well-quasi-ordered by the induced minor relation. Proof. We will construct an inne family of graphs that doesnt have any pair of comparable members. Let Gk be tha graph constructed as follows: even

2 3

odd This family of graphs is such that any vertex deletion or edge contraction of a graph leaves it irreversibly outside of the family. This way the K3,3 is a sentinel to prevent the deletion of the rst (0) and last (k) node in the numbers path (since the path with the oddeven nodes is a planar graph we know that we cant have this sentinels inside of them as an induced minor) and since and the odd and even nodes partition the path to prevent the contraction of consecutive numbers. Notice also that we cant delete any node of the K3,3 because that would leave a planar graph and planarity is closed under taking minors and in this family theyre all not planar. We cant delete the odd-even nodes because there are no others nodes that can replace them and we cant delete the number nodes because there wont be any way to restore the number path. We also cant contract two numbers because that would join the even-odd partition

and from then on we wont be able to separate them. For the same reason we cant contract an edge joining a number with its corresponding parity because that would mess the partition. 5. The diameter of a graph is the largest distance over all pairs of vertices of a graph. a) Show that any graph H can be an induced subgraph of a graph of diameter at most 2. Proof. Add a dominating vertex, the result is a graph with diameter at most two 2 and the original graph is an induced subgraph because it can be obtained removing this new vertex. b) Show that 4-coloring is NP-complete in the class of graphs of diameter at most 2. Proof. 3-coloring a graph is known to be in general NP-complete, so if we take a graph G and add a dominating vertex we have a graph with diameter at most 2, we can color it and then remove the dominating vertex (we have to use a dierent color for the dominating vertex, and color with the other 3 colors the rest), so we can color the graph with three colors i we can color the modied one with 4-colors. c) Show that 3-coloring is NP-complete in the class of graphs of diameter at most 4. Proof. We will reduce NAE-3SAT, a known NP-Complete problem, to 3-coloring in a graph with diameter 4. NAE-3SAT is like 3SAT but is satisfacible i in every clause there is a true and a false literal. So for example given an instance NAESAT of (X1 X 2 X3 ) (X 4 X5 X6 )

X1 X2 X3 X4 X5 X6

X1 X2 X3 X4 X5 X6

Notice that to see if 3 literals have at least one dierent value is very simple to reduce to 3-coloring: just put them connected to a K3 : If all the literals are valued true or false then in the K3 the coloring would have to repeat a color, so the instance cant be colored with 3 colors. If there is one dierent from the other two then the clique can use the 3 colors. Its trivial to see that these graph has diameter 4, and since NAE3SAT is NP-complete then 3-coloring in graphs of diameter at most 4 must be NP-complete. 6. Show that checking whether the input graph has a maximal matching of cardinality at most k is FPT in k. Proof. Useful Properties that we will use: If M1 and M2 are maximal matchings of G then |M1 | 2|M2 | and |M2 | 2|M1 | A maximum matching is in particular a maximal matching The maximum matching size denoted (G) can be computed in O(n3 ) Knowing this if we have that k < 2(G) then we know theres no maximal matching of size k, and we have k (G) then the the maximum matching is a maximal matching with size at most k. If none of the above happened we know that k 2(G). Let n = |V (G)| and m = |E(G)|. Let L(G) be the line graph of G. Then |V (L(G))| = m n(n1) = O(n2 ) 2

L(G)

maximal clique

Notice that in L(G) there are at most n cliques (each for one vertex in G) and since a matching in G is a dominating independent set in L(G), there are at most (G) cliques, and because k 2(G), there are at most 2k cliques in L(G). Now we will like to reduce the line graph to a size dependent only of k to search there a dominating independent set. To do this observe that in a clique we can only choose one vertex so for all the internal (the simplicial) vertices in a clique we can pick one to be the representative of them, and in the intersection of one (or many) cliques if two vertices participate in exact the same maximal cliques they are redundant because we can only choose one of them. So we will list all [maximal] cliques and tell a vertex in which cliques are, and then eliminate all the repeated ones. Once we are done removing redundant vertices, we will be left with a graph that has at most 1 vertex for every clique (the simplicial, the ones that belong only to that clique) and then at most 1 for every intersection of cliques, so if we had the number of cliques bounded by 2k, the compressed line graph has at most 2k+(2k)2 vertices, and then we can do a brute force to detect if there is a dominating independent 2 set in O(22k+(2k) ), that is in time complexity dependent only in k. The line graph can be computed in O(n4 ) The algorithm (taken from [Tsukiyama et al. 1977]) can list all the maximal cliques in time O(m3 ) for each clique, that is in total O(m3 2k). To eliminate all the redundant vertices is quadratic in the amount of vertices (m) and each check to see if they are equal can be done in O(2k), i.e. O(m2 2k). 9

Then the brute force algorithm to check if there is a dominating inde2 pendent set of size k can be done in O(22k+(2k) ), so the overall com2 plexity of the algorithm is (using that m = O(n2 )) : O(2(2k) +n6 2k) FPT of k. 7. A planar graph is called outerplanar if it has a drawing in which all vertices are incident with one face. Give a linear algorithm that 3colors outerplanar graphs. (Do not use Courcelles Theorem!) First we will prove the following Lemma: If G is a nonempty outerplanar graph then there exists a vertex with degree at most 2. Proof. We will suppose that all the vertices have degree greater or equal to 3. If we look at the block tree (the forest of [maximal] biconnected components of G) we can always choose a leaf of it (i.e. a biconnected component). Let B be the subgraph induced in G by this leaf biconnected component. It cant be just one vertex because that would mean that in the original we had a vertex with degree at most two, and because its a biconnected component it has at least 3 vertices, but it cant be a K3 because it would have vertices of degree at most 2, then it has at least 5 vertices. Take the vertex that connected to the rest of the graph in G or if the leaf biconnected component had no parent take any vertex. By hypothesis it has at least 3 edges incident to it, two of which must belong to the frontier with the outer face and the other go through the closed gure that is a biconnected component. Because we are not considering multigraphs one of these edges that cross the gure cuts the biconnected component in two and in each side there must be at least one vertex. v

10

We choose one side there must be at least two vertices because if there is only one it has to have degree 2 (it cant have an edge through the interior because it wont be planar so we have to put and edge through the outer face but that would leave some node isolated from the outer face). If we have more than one, the same applies: it has an edge with another one in the same side of the component. Then we can move to that smaller side of the component and repeat the argument. Eventually we will have one vertex (we cant run out of vertices because we ruled out multiedges) which is a contradiction, therefore we always have a vertex of degree at most 2. Proof. Using this lemma the algorithm is trivial: we can take a vertex of degree at most 2, remove it, color the rest of the graph recursively, and then put it back and color with the other color that we are not using in its neighbourhood (eventually we will use 3 colors!). Since removing the vertex doesnt change the graph outerplanarity and because we will have fewer nodes and we can always choose some vertex with degree at most 2, the algorithm nishes and colors the graph with 3 colors. 8. A planar graph is called a ring graph if it has a drawing in which there exists two faces such that each vertex is incident with at least one of the two faces. a) Show that the class of ring graphs is closed under taking minors. Proof. Let G be a ring graph. If we remove a vertex or and edge, then at most we merge the two faces and all the others still are incident to the two faces of the original (or to the new merged one). If we contract and edge it can happen that we destroy one or more faces in the current drawing. If we havent destroyed any face then all the vertices still are incident to the previous faces, and the vertex result of the contraction is incident to one (or both) of the incident faces of the contracted vertices. If after an edge contraction we have destroyed a face in the current drawing, then the edge was part of (possibly many) K3 . If the destroyed face wasnt the inner face of the ring, then we are done, all the vertices (including the contracted ones) remain incident to their previous face(s). But notice that if we removed the inner 11

face of the ring, then all the other nodes outside of the K3 (s) are adjacent to the other one, so for them is the same, and for the remaining vertices of the K3 (s) we will be left with a star with the center in the node result of the contraction and with at most one of the leaves (the one of the outermost K3 ) connected to some other things (the leaves corresponding to the inners K3 in the drawing can go in any face connected to the central node. We can choose to put them all in one of the faces and designate this new one as the new inner face of the ring and because all the others vertices are already incident to the outer one we restored the property of planar ring graph.

b) Determine the forbidden minor characterization of this class of graphs. Proof. Observe that

are minimal planar non-ring graph: any operation of vertex or edge deletion or edge contraction leaves a ring graph.

12

You might also like