Algorithms for the rainbow vertex coloring problem on graph classes
aa r X i v : . [ c s . D M ] M a y Algorithms for the rainbow vertex coloring problem on graphclasses
Paloma T. Lima , Erik Jan van Leeuwen , and Marieke van der Wegen Department of Informatics, University of Bergen, Norway Department of Information and Computing Sciences, Utrecht University, The Netherlands Mathematical Institute, Utrecht University, The Netherlands [email protected], {e.j.vanleeuwen,m.vanderwegen}@uu.nl
Abstract
Given a vertex-colored graph, we say a path is a rainbow vertex path if all its internal verticeshave distinct colors. The graph is rainbow vertex-connected if there is a rainbow vertex pathbetween every pair of its vertices. In the
Rainbow Vertex Coloring (RVC) problem wewant to decide whether the vertices of a given graph can be colored with at most k colors so thatthe graph becomes rainbow vertex-connected. This problem is known to be NP -complete evenin very restricted scenarios, and very few efficient algorithms are known for it. In this work,we give polynomial-time algorithms for RVC on permutation graphs, powers of trees and splitstrongly chordal graphs. The algorithm for the latter class also works for the strong variantof the problem, where the rainbow vertex paths between each vertex pair must be shortestpaths. We complement the polynomial-time solvability results for split strongly chordal graphsby showing that, for any fixed p ≥ NP -complete whenrestricted to split ( S , . . . , S p )-free graphs, where S q denotes the q -sun graph. Graph coloring is a classic problem within the field of structural and algorithmic graph theory thathas been widely studied in many variants. One recent such variant was defined by Krivelevich andYuster [9] and has received significant attention: the rainbow vertex coloring problem. A vertex-colored graph is said to be rainbow vertex-connected if between any pair of its vertices, there isa path whose internal vertices are colored with distinct colors. Such a path is called a rainbowpath . Note that this vertex coloring does not need to be a proper one; for instance, a completegraph is rainbow vertex-connected under the coloring that assigns the same color to every vertex.The
Rainbow Vertex Coloring (RVC) problem takes as input a graph G and an integer k and asks whether G has a coloring with k colors under which it is rainbow vertex-connected. The rainbow vertex connection number of a graph G is the smallest number of colors needed in onesuch coloring and is denoted rvc ( G ). More recently, Li et al. [11] defined a stronger variant ofthis problem by requiring that the rainbow paths connecting the pairs of vertices are also shortestpaths between those pairs. In this case we say the graph is strong rainbow vertex-connected . Theanalogous computational problem is called Strong Rainbow Vertex Coloring (SRVC) andthe corresponding parameter is denoted by srvc ( G ).Both the RVC and the
SRVC problems are NP -complete for every k ≥ NP -complete even on bipartite graphs and split graphs [7]. Both problems are also NP -hard to1pproximate within a factor of n / − ǫ for every ǫ >
0, even when restricted to bipartite graphsand split graphs [7]. Contrasting these results, it was shown that
RVC and
SRVC are linear-timesolvable on bipartite permutation graphs and block graphs [7], and on planar graphs for everyfixed k [10]. Finally, RVC is also known to be linear time solvable on interval graphs [7].The above mentioned results on bipartite permutation graphs and interval graphs led Heggerneset al. [7] to formulate the following conjecture concerning diametral path graphs. Recall that agraph G is a diametral path graph if every induced subgraph H has a dominating path whoselength equals the diameter of H . Conjecture 1.1 (Heggernes et al. [7, Conjecture 15]) . Let G be a diametral path graph. Then rvc ( G ) = diam( G ) − . In this context, it is interesting to remark that both bipartite permutation graphs and intervalgraphs are diametral path graphs, and that Heggernes et al. [7] showed that the conjecture is truefor these graphs.
Our Results
Our main contribution is to show that the above conjecture is true for permutationgraphs.
Theorem A (=Theorem 3.16) . If G is a permutation graph on n vertices, then rvc ( G ) =diam( G ) − and the corresponding rainbow vertex coloring can be found in O ( n ) time. This generalizes the earlier result on bipartite permutation graphs [7]. The proof of our resultfollows from a thorough investigation of shortest paths in permutation graphs. We show that thereare two special shortest paths that ensure that a rainbow vertex coloring with diam( G ) − NP -hard and hard to approximate on split graphs [7], the hope for polynomial-time solvability rests either within subclasses of split graphs or other chordal graphs that are notinclusion-wise related to split graphs (such as the previously studied interval graphs and blockgraphs [7]). We make progress in both directions.First, we show that the problem is polynomial-time solvable on strongly chordal split graphs. Theorem B (=Theorem 4.3) . If G is a split strongly chordal graph with ℓ cut vertices, then rvc ( G ) = srvc ( G ) = max { diam( G ) − , ℓ } . In order to obtain the above result, we exploit an interesting structural property of split stronglychordal graphs. Namely, if G is a split strongly chordal graph with clique K and independent set S , there exists a spanning tree of G [ K ] such that the neighborhood of each vertex of S induces asubtree of this tree.Second, we show that RVC remains polynomial-time solvable on powers of trees. This proofis based on a case analysis, depending on whether the diameter of the tree is a multiple of thepower and how many long branches the tree has. We show that in some cases diam( G ) − G ) colors in order to be rainbowvertex colored. We provide a complete characterization of such graphs, as well as a polynomialtime algorithm to optimally rainbow vertex color any power of tree. Theorem C (=Theorem 5.10) . If G is a power of a tree, then rvc ( G ) ∈ { diam( G ) − , diam( G ) } ,and the corresponding optimal rainbow vertex coloring can be found in time that is linear in thesize of G .
2s far as we are aware, this result provides the first graph class in which the rainbow vertexconnection number is computable in polynomial time and does not always equal one of the twotrivial lower bounds on the number of colors ( e.g. , diam( G ) − Whenever we write graph, we will mean a finite undirected simple graph. We assume throughoutthat all graphs are connected and have at least four vertices.Let G = ( V, E ) be a graph. For two vertices u, v ∈ V , we use u ∼ v to denote that u and v areadjacent. For a vertex v ∈ V , we write d G ( v ) for its degree. For a subgraph H of G , we write V H forthe set of vertices of H . Specifically, for a path P in G , we write V P for the vertices of P . If X ⊆ V ,then by G [ X ] we denote the subgraph of G induced by X , that is, G [ X ] = ( X, E ∩ ( X × X )). Weuse N ( v ) = { u ∈ V | u ∼ v } and N [ v ] = N ( v ) ∪ { v } .The length of a path P equals the number of edges of P . The distance d G ( u, v ) is the lengthof a shortest u, v -path in G . If the graph G is clear from the context, we simply write d ( u, v ).The diameter diam( G ) of G is the length of the longest shortest path between two vertices in G , that is, diam( G ) = max { d G ( u, v ) | u, v ∈ V } . A center of a graph G is a vertex c such thatmax { d G ( c, v ) | v ∈ V } is maximum among all vertices of G . Note that a graph can have multiplecenters and that a tree can have at most two.A graph G is a permutation graph if it is an intersection graph of line segments between twoparallel lines (see Figure 1). The set of line segments that induce the permutation graph is calledan intersection model . Alternatively, if G has n vertices, then there is a permutation σ of { , . . . , n } such that vertex i and vertex j with i < j are adjacent in G if and only if j comes before i in σ .A graph G is a chordal graph if every cycle C = { c , . . . , c ℓ } on ℓ ≥ G is a split graph if V G can be split into two sets, K and S , such that K induces aclique in G and S induces an independent set in G .For any k ≥
3, we denote by S k the k -sun on 2 k vertices, that is, a graph with a clique c , . . . , c k on k vertices and an independent set v , . . . , v k of k vertices such that v i is adjacent to c i and c i +1 for every 1 ≤ i < k and v k is adjacent to c k and c . A graph G is a strongly chordal graph if it ischordal and it has no induced subgraph isomorphic to a k -sun for any k ≥ k -th power of a graph G for k ≥
1, denoted by G k , is the graph on the same vertex setof G where u ∼ v in G k if and only if there is a path of length at most k from u to v in G . Inparticular, G = G . If G is a tree, then G k is a chordal graph for any k ≥ Observation 1. If diam( G ) ≤ , then srvc ( G ) = rvc ( G ) = 1 .Proof. Color all vertices of G by color 1. It suffices to note that between any two vertices, there isa shortest path with at most one internal vertex. In this section, we consider rainbow coloring on permutation graphs. Let G be a permutationgraph. Let L and L be two parallel lines in the plane and for each v ∈ V G , let s v be the segmentassociated to v in the intersection model. We denote by t ( v ) the extreme of s v in L , that is t ( v ) = s v ∩ L , and we refer to t ( v ) as the top end point of s v . By b ( v ) we denote the extreme of3 t ( v ) b ( v ) v v v L L v v v v Figure 1:
An intersection model and the corresponding permutation graph. s v in L , the bottom end point of s v . Throughout, we assume that an intersection model is given;otherwise, one can be computed in linear time [12].Whenever we write “ u intersects v ” for two vertices u and v , we mean s u intersects s v . For twovertices u and v , with u = v , there are several options for u, v in the intersection model. If t ( u ) < t ( v ) and b ( u ) > b ( v ) , then u ∼ v , t ( u ) > t ( v ) and b ( u ) < b ( v ) , then u ∼ v , t ( u ) < t ( v ) and b ( u ) < b ( v ) , then we say ‘ u is left of v ’ and write u ≺ v , t ( u ) > t ( v ) and b ( u ) > b ( v ) , then we say ‘ u is right of v ’ and write u ≻ v .We also use the notation u (cid:22) v if t ( u ) ≤ t ( v ) and b ( u ) ≤ b ( v ). Notice that ‘ ≺ ’ is a partial orderingon the vertices of the graph, in particular, u ⊁ v does not imply that u (cid:22) v .For each pair u, v ∈ V ( G ), Mondal et al. [13] define two u - v paths, one of which is shortest.Define a path X u,v as follows. If u ∼ v , X u,v will be u, v . Otherwise, assume without loss ofgenerality that u ≺ v . Start with x = u . Of all vertices x that intersect u with t ( x ) > t ( u ), let x be the one with largest t ( x ). If there is no vertex x that intersects u with t ( x ) > t ( u ), we saythat the path X u,v does not exist. Otherwise, define x i , with i ≥
3, as follows. If x i − is incidentto v , set x i = v and end the path. Otherwise, if i is even (resp. odd), let x i be the vertex thatintersects x i − where t ( x i ) (resp. b ( x i )) is largest. Notice that it cannot be that x i − = x i , or G would not be connected.Analogously, we define the path Y u,v . This path starts with y = u . Let y be the vertex thatintersects u with largest b ( y ), if b ( y ) > b ( u ) (otherwise the path Y u,v does not exist). Now thenext vertex y i is the vertex that intersects y i − with largest b ( y i ) (resp. t ( y i )) if i is even (resp.odd). Notice that it cannot be that y i − = y i , or G would not be connected.The paths we just defined satisfy the following property. Let z , z , z , . . . , z a be a path. Forall 2 ≤ i ≤ a , t ( z i ) > t ( z i − ) and b ( z i ) < b ( z i − ) if i is even, (1) t ( z i ) < t ( z i − ) and b ( z i ) > b ( z i − ) if i is odd, (2)or, for all 2 ≤ i ≤ a , t ( z i ) < t ( z i − ) and b ( z i ) > b ( z i − ) if i is even, (3) t ( z i ) > t ( z i − ) and b ( z i ) < b ( z i − ) if i is odd. (4)Note that Equations (1) and (2) hold for X u,v , by definition, and that Equations (3) and (4) holdfor Y u,v , by definition. In later proofs we will often use this property.4 emma 3.1. X u,v or Y u,v is a shortest u, v -path.Proof. See [Mondal et al. [13, Lemma 5]], or see Appendix A.We define two special paths P and Q . For the definition of P , let p be the vertex such that t ( p ) is smallest among all vertices of G . Perform the same process as in the construction of X p , · :for i ≥
2, if i is even (resp. odd), let p i be the vertex that intersects p i − where t ( p i ) (resp. b ( p i ))is largest. Let P denote the resulting path and let p d denote the last vertex of P . Observe that P = X p ,p d .For the definition of Q , let q be the vertex such that b ( q ) is smallest among all vertices of G .Perform the same process as in the construction of Y q , · : for i ≥
2, if i is even (resp. odd), let q i bethe vertex that intersects q i − where b ( q i ) (resp. t ( q i )) is largest. Let Q denote the resulting pathand let q d ′ denote the last vertex of Q . Observe that Q = Y q ,q d ′ . Corollary 3.2. P is a shortest p , p d -path and Q is a shortest q , q d ′ -path.Proof. By Lemma 3.1, it follows that X p ,p d or Y p ,p d is a shortest p , p d -path. We claim that Y p ,p d does not exist. Assume the contrary and let y be the vertex that follows p on Y p ,p d .Then b ( y ) > b ( p ) by the definition and existence of Y p ,p d . Since y intersects p , it follows that t ( y ) < t ( p ). But this contradicts the definition of p . Hence, Y p ,p d does not exist. Therefore, X p ,p d = P is a shortest p , p d -path. Analogously, we can prove that Q is a shortest q , q d ′ -path.We will prove some more useful properties about the paths P and Q , before we show therainbow coloring. Lemma 3.3.
Let v t , resp. v b , be the segment that has the rightmost top, resp. bottom, end point.Then p d = v t and p d − = v b if d is even, and vice versa if d is odd. Furthermore, we have q d ′ = v b and q d ′ − = v t if d ′ is even, and vice versa if d ′ is odd.Proof. Suppose that p d = v t . Since the top of p d is rightmost, we see that d is even. Then, bydefinition of P , it holds that the segment, of all segments that intersect p d , that ends rightmost atthe bottom equals p d − . So, p d − = v b .Suppose that p d = v t and v t ∼ p d . It is clear that t ( p d ) < t ( v t ), thus b ( p d ) > b ( v t ). If d iseven, then v t ∼ p d − . But p d is the vertex that intersects p d − which has the rightmost top end,yielding a contradiction with the fact that t ( p d ) < t ( v t ). So d is odd. Since the path ends at p d , itfollows that the vertex that intersects p d that has the rightmost top is p d − . Hence p d − = v t . Bydefinition, p d is the vertex that intersects p d − that has the rightmost bottom. Thus p d = v b .Suppose that p d = v t and v t ≁ p d . It holds that p d is left of v t . Assume that d is even. Considerthe shortest p d , v t -path. We know that either X p d ,v t or Y p d ,v t is a shortest path. (See Figure 2.)Suppose that X u,v is the shortest. We know that t ( x ) > t ( p d ) and b ( x ) < b ( p d ). It follows that x intersects p d − . This yields a contradiction with the choice of p d . Suppose that Y u,v is theshortest path. By the definitions of y and P , it holds that y = p d − . Then y = p d = y , so Y u,v is not a shortest path. We conclude that either p d = v t or v t ∼ p d . The case for d odd isanalogous.The proof for Q is analogous. Lemma 3.4.
The sets V P \ { p d } and V Q \ { q d ′ } are dominating sets of G .Proof. Suppose that V P \ { p d } is not a dominating set, and let v be a vertex that is not dominated.We prove with induction that v is right of p i for all 1 ≤ i ≤ d − d − p d v t x p d − = y p d v t Figure 2:
See Lemma 3.3, case p d = v t , v t ≁ p d . Either X p d ,v t or Y p d ,v t is a shortest path. It is clear that v ≻ p , since v ≁ p and t ( v ) > t ( p ). Suppose that v ≻ p k − , for some k . Suppose that k is even. We use the induction hypothesis and Equation (1), to see that b ( v ) > b ( p i − ) > b ( p i ). Since v ≁ p i , it follows that v ≻ p i . Suppose that k is odd. Then t ( v ) > t ( p i − ) > t ( p i ), by the induction hypothesis and Equation (2). Since v ≁ p i , it follows that v ≻ p i .By Lemma 3.3, we know that p d − = v t or p d − = v b . In both cases, there is no vertex v with v ≻ p d − . This yields a contradiction, thus V P \ { p d } is a dominating set.The proof for V Q \ { q d ′ } is analogous. Lemma 3.5.
It holds that d = diam( G ) or d = diam( G )+1 , and d ′ = diam( G ) or d ′ = diam( G )+1 .Proof. Since P is a shortest path (by Corollary 3.2), we have that d − ≤ diam( G ). Or, equivalently d ≤ diam( G ) + 1.Let u and v be two vertices. Since the set V P \ { p d } is a dominating set (see Lemma 3.4), thereare p i , p j ∈ V P \ { p d } such that p i ∼ u , p j ∼ v . Without loss of generality, we assume that i ≤ j .Then the path u, p i , p i +1 , . . . , p j , v has length at most d . Thus diam( G ) ≤ d .The proof for d ′ is analogous.Now we start a breadth-first search from p . Call the layers L , L , . . . , L r . Since P is a shortestpath, it follows that p i ∈ L i for every i . Thus r ≥ d . Since V P \ { p d } is a dominating set, weconclude that r = d , thus the layers of the breadth-first search are L , L , . . . , L d . We also starta breadth-first search in q , and call the layers M , M , . . . , M d ′ . Again, we have that q i ∈ M i forevery i .A nice property of the path P is that every vertex p i is adjacent to all vertices in the next layer L i +1 . Lemma 3.6.
For every i , it holds that L i +1 ⊆ N ( p i ) and M i +1 ⊆ N ( q i ) .Proof. We will prove a somewhat stronger result by induction, namely that L i +1 ⊆ N ( p i ) and if i is even (resp. odd) we have that for every u in L i +1 : t ( u ) < t ( p i ) and b ( u ) > b ( p i ) (resp. t ( u ) > t ( p i ) and b ( u ) < b ( p i )). (5)We use a proof by induction. The first layer L contains only p . It is clear that every vertex inthe second layer L is a neighbour of p . Moreover, by the definition of p , we have that t ( u ) > t ( p )for all u ∈ L , and thus b ( u ) < b ( p ).Suppose that L i +1 ⊆ N ( p i ) and Equation (5) holds for every i < k . Let v be a vertex in L k +1 .We know that v does not intersect p k − , otherwise v would be contained in L k . So we know that t ( v ) > t ( p k − ) and b ( v ) > b ( p k − ). Since v is in layer L k +1 , v intersects u for some u ∈ L k (seeFigure 3). So we either have that t ( v ) < t ( u ) and b ( v ) > b ( u ) or we have t ( v ) > t ( u ) and b ( v ) < b ( u ).If k is even (resp. odd), we have t ( v ) < t ( u ) and b ( v ) > b ( u ) (resp. t ( v ) > t ( u ) and b ( v ) < b ( u )),6 k − p k u v Figure 3:
If a vertex v in layer L k +1 intersect a vertex u in layer L k , then it also intersects p k . See Lemma3.6. p L p L p L . . . p d − L d − p d L d Figure 4:
The layers of the BFS, the layers L , L , . . . , L d − are all assigned a different color. See Lemma3.7 otherwise, by the induction hypothesis, v would intersect p k − . By the induction hypothesis u intersects p k − , so by the definition of p k , we have that t ( p k ) ≥ t ( u ) (resp. b ( p k ) ≥ b ( u )). It followsthat t ( v ) < t ( p k ) (resp. b ( v ) < b ( p k )). We know that b ( p k ) < b ( p k − ) (resp. t ( p k ) < t ( p k − )),thus b ( v ) > b ( p k ) (resp. t ( v ) > t ( p k )). We conclude that v intersects p k , and t ( v ) < t ( p k ) and b ( v ) > b ( p k ) (resp. t ( v ) > t ( p k ) and b ( v ) < b ( p k )).So L k +1 ⊆ N ( p k ) for every k . The proof that M k +1 ⊆ N ( q k ) is analogous.For an illustration of the structure of G , see Figure 4. If d = diam( G ) or d ′ = diam( G ), we willcolor G layer by layer to obtain a rainbow coloring. Lemma 3.7. If d = diam( G ) or d ′ = diam( G ) , then rvc ( G ) = diam( G ) − .Proof. Assume that d = diam( G ). Consider the following coloring (see Figure 4): c ( v ) = i if v ∈ L i , 1 ≤ i ≤ d − d − G ) − u and v be two vertices. Then u ∈ L i , v ∈ L j for some i, j . Without loss of generality, assume that i ≤ j . If i = 1, then u = p . Then, by Lemma 3.6, the path p , p , . . . , p j − , v is a rainbow path.If i >
1, again by Lemma 3.6, the path u, p i − , p i , . . . , p j − , v is a rainbow path.We conclude that rvc ( G ) = diam( G ) −
1. The proof for d ′ = diam( G ) is analogous.Consider the case where d = d ′ = diam( G ) + 1. In this case, we will still color the layers ofa breadth-first search that starts at p , but we have to reuse the color of the first layer for layer7 p p . . . p d − d − p d − p d u v Figure 5:
The numbers indicate the colors of the layers. The path u, p , p , . . . , p d − , v is a rainbow path.See Lemma 3.8 L d − . We consider the coloring: c ( v ) = i if v ∈ L i , 1 ≤ i ≤ d − v ∈ L d − ,2 if v ∈ L d .We will show that this is a rainbow coloring. For almost every u and v , we readily construct arainbow path. Lemma 3.8.
For the following u and v , there exists a rainbow path:1. for u = p , and v arbitrary,2. for u ∈ L i with i ≥ , and v ∈ L j with j ≥ ,3. for u ∈ L , and v / ∈ L d ,4. for u ∈ L , u ∼ p , and v ∈ L d .Proof.
1. Suppose that v ∈ L i . By Lemma 3.6, we know that v ∼ p i − . The path p , p , . . . , p i − , v is a rainbow path.2. Without loss of generality, we assume that i ≤ j . By Lemma 3.6, we know that u ∼ p i − and v ∼ p j − . Consider the path u, p i − , p i , . . . , p j − , v . The internal vertices are in differentlayers between L and L d − . Hence, this is a rainbow path.3. Suppose that v ∈ L i , with i < d . Again, by Lemma 3.6, we know that v ∼ p i − . The path u, p , p , . . . , p i − , v is a rainbow path.4. Notice that the path u, p , p , . . . , p d − , v is a rainbow path.There are some vertices u and v , for which we did not yet construct a rainbow path. The casethat is left, is the following:5. for u ∈ L , u ≁ p , and v ∈ L d .The path via P , u, p , p , . . . , p d − , v , does not suffice in this case, because it uses p and p d − ,which are both colored with color 1. So this is not a rainbow path. For some cases we will showthat a similar path via Q is a rainbow path. For other cases, we can use the shortest u, v -path,that is, X u,v or Y u,v is a rainbow path. Lemma 3.9. If u ∈ L , u ≁ p , then u ∼ q or u ∼ q .Proof. Since u ∈ L , we know that u intersects p . Hence t ( u ) > t ( p ) and b ( u ) < b ( p ). If u ≁ q ,then u is right of q , since q has the leftmost bottom end. So t ( u ) > t ( q ) > t ( q ) by Equation(3). Since p and q both intersect q , we now that b ( q ) ≥ b ( p ), by the definition of q . Thus b ( u ) < b ( p ) ≤ b ( q ). We conclude that u intersects q .8 d − q d = p d − q d − v Figure 6:
If a vertex v in layer L d does not intersect q d − , then it intersects q d − . See Lemma 3.12. Lemma 3.10. If d = d ′ = diam( G ) + 1 , then p d = q d − and p d − = q d .Proof. By Lemma 3.3, we know that, if d is even, then p d = v t and p d − = v b , and conversely if d is odd. For Q we have that q d = v b and q d − = v t if d is even, and conversely if d is odd. Weconclude that p d = q d − and p d − = q d . Corollary 3.11. If d = d ′ = diam( G ) + 1 , it holds that q i ∈ L i +1 , for every ≤ i < d .Proof. It is clear that q ∈ L , since q ∼ p . By Lemma 3.10, we know that q d − = p d , so q d − ∈ L d . Since q , q , . . . , q d − is a path of length d −
1, it follows that q i ∈ L i +1 . Lemma 3.12. If d = d ′ = diam( G ) + 1 , then for every v ∈ L d , if v ≁ q d − , then v ∼ q d − .Proof. Since v ∈ L d , we know that v ∼ p d − , so by Lemma 3.10, v ∼ q d . (See Figure 6.) Assumethat d is even. Then q d = v b by Lemma 3.3. It follows that b ( v ) < b ( v b ) and t ( v ) > t ( v b ). If v ≁ q d − , we know that b ( v ) > b ( q d − ) > b ( q d − ). Since q d − = v t by Lemma 3.3, we know that t ( v ) < t ( q d − ). So, v intersects q d − .The case that d is odd is analogous.Now we can prove for even more vertices u and v that there is a rainbow path from u to v , seealso Figure 7. Lemma 3.13.
For the following vertices u and v , there is a rainbow path:5a. for u ∈ L , u ≁ p , v ∈ L d , and v ∼ q d − ,5b. for u ∈ L , u ≁ p , v ∈ L d , and v ≁ q d − , u ∼ q .Proof. u ∼ q or u ∼ q . By Corollary 3.11, we know that q , q , . . . , q d − are in layers L , L , . . . , L d − , each vertex in a different layer. So, either u, q , q , . . . , q d − , v or u, q , q , . . . , q d − , v is a rainbow path.5b. By Lemma 3.12, we know that v ∼ q d − . By Corollary 3.11, we know that q , q , . . . , q d − are in layers L , L , . . . , L d − , each vertex in a different layer. The path u, q , q , . . . , q d − , v is a rainbow path.Now there is still one case of vertices u and v for which we did not prove yet that there is arainbow path. Namely:5c. for u ∈ L , u ≁ p , v ∈ L d , and v ≁ q d − , u ≁ q .For this last case we will show that either X u,v or Y u,v is a rainbow path. Lemma 3.14. If u ∼ p , u ≁ p , u ≁ q , then u ≺ p . p p . . . p d − d − p d − p d = q d − q q q d − q d − u v Figure 7:
The numbers indicate the colors of the layers. If u ∼ q and v ∼ q d − , the path u, q , p , . . . , q d − , v is a rainbow path. If u ∼ q and v ≁ q d − , the path u, q , p , . . . , q d − , v is a rain-bow path. See Lemma 3.13 p u y p p y Figure 8:
Vertex y is in layer L . See Lemma 3.15. Proof.
Since u ≁ p , we know that either u ≺ p or u ≻ p . Suppose that u ≻ p . Then t ( u ) > t ( p ). By the definition of p , we know that t ( p ) ≥ t ( q ) and by Equation (3) we seethat t ( q ) > t ( q ). Altogether, we see that t ( u ) > t ( q ). By the definition of q , we know that b ( q ) ≥ b ( p ). Since u ∼ p , it holds that b ( u ) < b ( p ). Thus b ( u ) < b ( q ). This yields acontradiction with the fact that u ≁ q . We conclude that u ≺ p . Lemma 3.15.
For u and v satisfying case 5c, there is a rainbow path.Proof. We distinguish two cases, based on Lemma 3.1: either X u,v is a shortest u, v -path or Y u,v is a shortest u, v -path.Suppose that X u,v is a shortest u, v -path. Notice that X u,v has at least one vertex in everylayer L , L , . . . , L d . Since X u,v has length at most d −
1, there is at most one layer which containstwo vertices of X u,v . It is clear that x = u is in layer L . We will show that x is in layer L as well. By definition of x , we have t ( x ) > t ( u ) and b ( x ) < b ( u ). Since u ∼ p and p has theleftmost top end, we know that t ( u ) > t ( p ) and b ( u ) < b ( p ). We conclude that t ( x ) > t ( p ) and b ( x ) < b ( p ), thus x ∼ p . So we see that x and x are both in layer L , so all internal verticesof X u,v are in different layers. So X u,v is a rainbow path.Suppose that Y u,v is a shortest u, v -path. Write Y u,v = u, y , y , . . . , y α − , v . Then α = d or α = d −
1; note that α ≤ diam( G ) + 1 = d and that d − ≤ α because Y u,v contains a vertex fromevery layer. We prove by induction that y i ∈ L i +1 for all 2 ≤ i ≤ α − y and p both intersect u , by the definition of y , it follows that b ( y ) ≥ b ( p ). SeeFigure 8. If y = p , then y u,v = u, p , p , . . . , p d − , v . Notice that the length of this path is d = diam( G ) + 1. This yields a contradiction with the fact that Y u,v is a shortest u, v -path.Hence, y = p , and b ( y ) > b ( p ). Since p is the vertex with the leftmost top end, we see that t ( p ) < t ( y ). Hence y ≻ p . Since y does not intersect p , it follows that y / ∈ L .By the definition of y , we know that t ( y ) < t ( u ). By Lemma 3.14, it holds that t ( u ) < t ( p ),thus t ( y ) < t ( p ). Moreover, b ( y ) > b ( p ) > b ( p ) (by Equation (1)). Hence, y intersects p . Weconclude that y ∈ L . 10uppose that for all i < k , for some k >
2, it holds that y i ≻ p i − and y i ∈ L i +1 . Nowconsider y k . Suppose that k is even. By the induction hypothesis and Lemma 3.6, we know that y k − ∼ p k − , since y k − ∈ L k . By definition of y k , it follows that b ( y k ) ≥ b ( p k − ). And by Equation(1), we know that b ( p k − ) > b ( p k ), thus b ( y k ) > b ( p k ). Similarly, by the definition of p k , we knowthat t ( p k ) ≥ t ( y k − ). And by Equation (3), we know that t ( y k ) < t ( y k − ), hence t ( p k ) > t ( y k ). Weconclude that p k intersects y k . It follows that y k is in layer k − k or k + 1.Notice that if y k ∈ L k − , then the length of Y u,v is at least d = diam( G ) + 1. This yieldsa contradiction with the fact that Y u,v is a shortest u, v -path. Thus y k / ∈ L k − . Suppose that y k ∈ L k . Then y k intersects p k − . We have seen that b ( y k ) ≥ b ( p k − ), thus t ( y k ) < t ( p k − ). ByEquation (2), we have b ( p k − ) > b ( p k − ), Thus b ( y k ) > b ( p k − ). By Equation (2), we also havethat t ( p k − ) < t ( p k − ), thus t ( y k ) < t ( p k − ). It follows that y k ∼ p k − . This yields a contradictionwith the assumption that y k ∈ L k . We conclude that y k ∈ L k +1 .The case for k odd is analogous. Since y i ∈ L i +1 for all internal vertices y i of Y u,v , we concludethat Y u,v is a rainbow path. Theorem 3.16 (=Theorem A) . For every n -vertex permutation graph G , it holds that rvc ( G ) =diam( G ) − . Moreover, we can compute an optimal rainbow vertex coloring in O ( n ) time.Proof. By Lemma 3.5 we know that either d = diam( G ) or d = diam( G ) + 1, and either d ′ =diam( G ) or d ′ = diam( G ) + 1. If d = diam( G ) or if d ′ = diam( G ), we have seen a rainbow coloringof G with diam( G ) − d and d ′ equal diam( G ) + 1, then we haveseen a coloring of G with diam( G ) − rvc ( G ) = diam( G ) − t ( v )and b ( v ) for each vertex v ∈ V ( G ). Otherwise, a permutation model can be computed in lineartime [12]. First, compute d and d ′ . Following the description of P and Q , this takes linear time.Computing the diameter of G takes O ( n ) time using the algorithm of Mondal et al. [13]. Thecolorings given by Lemma 3.7 and before Lemma 3.8 can each be computed in linear time througha breadth-first search. By the preceding arguments, an optimal rainbow vertex coloring can becomputed in O ( n ) time. In this section, we show that
RVC and
SRVC are polynomial-time solvable on split strongly chordalgraphs. We show that this result is tight in the sense that both problems become NP -complete onsplit graphs if we forbid any finite family of suns.In order to prove our next theorem we will use the following property of dually chordal graphs,a graph class that contains that of strongly chordal graphs [1]. Lemma 4.1 (Brandstädt et al. [1]) . A graph G is dually chordal if and only if G has a spanningtree T such that every maximal clique of G induces a subtree of T . We prove a tree with a stronger property exists in split strongly chordal graphs.
Lemma 4.2.
Let G = ( V, E ) be a connected split strongly chordal graph, with V = K ∪ S , where K is a clique and S is an independent set. Then G has a spanning tree T such that every maximalclique of G induces a subtree of T and every vertex of S is a leaf of T . roof. Since G is a strongly chordal graph (and thus a dually chordal graph [1]), by Theorem 4.1, G has a spanning tree T ′ such that the vertices of every maximal clique of G induce a subtree of T ′ . We observe the following simple property.We will now modify T ′ in order to obtain another spanning tree of G that has the same prop-erty and, additionally, is such that every vertex of S is a leaf. Tree Modification.
Let x ∈ S be such that x is not a leaf of T ′ . Let u, v ∈ K be two neighborsof x in T ′ . Then(i) add the edge uv to T ′ ;(ii) delete the edge vx from T ′ .Observe that the result from this operation is still a tree and it is still spanning. Claim 1.
Let T ′′ be the tree obtained after the application of the Tree Modification to T ′ . Thenthe following holds:1. d T ′′ ( x ) < d T ′ ( x ) ;2. Every maximal clique of G induces a subtree of T ′′ .Proof. It is easy to see that 1. holds, since the edge vx was deleted in step (ii) and no other edgeincident to x was added. To see that 2. also holds note that since u is adjacent to both v and x and since G [ N ( x )] is a clique, every maximal clique D of G that contains v and x also contains u .Since uv, ux ∈ E ( T ′′ ), the vertices of D still induce a connected subgraph of T ′′ . y We now iteratively apply Tree modification to T ′ on non-leaf vertices of S . Indeed, if x ∈ S isnot a leaf of T ′ , then it has at least two neighbors in T ′ . Since T ′ is a spanning tree, any neighborsof x in T ′ must be adjacent to x in G , and thus are in K . Hence, Tree Modification can be applied.By Claim 1, we can safely apply Tree Modification repeatedly to T ′ until we obtain a tree T inwhich all the vertices of S have degree 1 in T . Theorem 4.3 (=Theorem B) . If G is a split strongly chordal graph with ℓ cut vertices, then rvc ( G ) = srvc ( G ) = max { diam( G ) − , ℓ } .Proof. Let G = ( V, E ) be a split strongly chordal graph, with V = K ∪ S , where K is a clique and S is an independent set. Note that if diam( G ) ≤
2, we can (strong) rainbow color G by assigningthe same color to all the vertices. Notice that in this case G has at most one cut vertex, thus rvc ( G ) = srvc ( G ) = max { diam( G ) − , ℓ } .Assume then that diam( G ) = 3 (recall that if G is a split graph, then diam( G ) ≤ G has a spanning tree T such that every maximal clique of G induces a subtree of T and every vertex of S is a leaf of T . Let T denote the subtree of T induced by the vertices of K , that is, the subtree of T obtained by the deletion of the leaves corresponding to vertices of S .Note that T is a tree with V T = K . Claim 2.
For every x ∈ S , N ( x ) induces a subtree of T .Proof. Since N [ x ] is a maximal clique of G , the vertices of N [ x ] induce a subtree of T . Since x isa leaf of T , we conclude that N ( x ) indeed induces a subtree of T . y We will now use the tree T to provide a (strong) rainbow coloring of G .Suppose first that G is 2-connected, that is, that no vertex of S has degree one in G . Colorthe vertices of K according to a proper 2-coloring of the vertices of T , and give arbitrary colors12o the vertices of S . Let φ be the coloring of G obtained in this way. Note that φ is indeed a(strong) rainbow coloring of G . To see this, let u, v ∈ V be such that d G ( u, v ) = 3. Since G is asplit graph, we have that u, v ∈ S . Since G is 2-connected, | N ( u ) | ≥ | N ( v ) | ≥
2. Moreover,since N ( u ) and N ( v ) induce subtrees of T , we know that these two sets are not monochromaticunder φ . Thus, there exist x ∈ N ( u ) and y ∈ N ( v ) such that φ ( x ) = φ ( y ), which shows that uxyv is a rainbow (shortest) path between u and v .We now consider the case in which G has cut vertices. Let C ⊂ V be the set of cut verticesof G . Consider a proper 2-coloring φ of T . If there exist c , c ∈ C such that φ ( c ) = φ ( c ), thenwe can obtain a (strong) rainbow coloring for G with ℓ colors by assigning distinct colors in theset { , . . . , ℓ } to the remaining cut vertices of G . Note that with this coloring of T , it still holdsthat for every w ∈ S , if | N ( w ) | >
1, then N ( w ) is not monochromatic under φ . Since all the cutvertices were assigned distinct colors, by the same argument used in the 2-connected case, this isindeed a (strong) rainbow coloring of G . Note that this reasoning also applies if | C | = 1, so fromnow on we may assume | C | ≥ C were assigned the same color, since φ was a proper 2-coloring of T , wehave that for every x, y ∈ C , d T ( x, y ) ≥
2. Let c , c ∈ C be two cut vertices such that the uniquepath connecting c and c in T contains no other vertex of C . Let z be the vertex adjacent to c inthis path. Note that z / ∈ C . We will consider the following coloring φ ′ of T . Let φ ′ ( c ) = φ ′ ( z ) = 1.Now we extend φ ′ by considering a proper 2-coloring of the subtree of T rooted in c (resp. z )that assigns color 1 to the vertex c (resp. z ). Note that now we have φ ′ ( c ) = 2. Finally, assigndistinct colors from { , . . . , ℓ } to the vertices of C \ { c , c } . Note that, under this coloring, if thereexists w ∈ S such that | N ( w ) | > N ( w ) is monochromatic under φ ′ , then N ( w ) = { c , z } . Toobtain a (strong) rainbow coloring of G with ℓ colors, we color the vertices of K according to φ ′ and give arbitrary colors to the vertices of S . To see that this is indeed a (strong) rainbow coloringof G , let u, v ∈ V be such that d G ( u, v ) = 3. If | N ( u ) | = | N ( v ) | = 1, the unique shortest pathbetween u and v is a rainbow path, since all cut vertices of G received distinct colors. Assume | N ( u ) | ≥ w ∈ S such that | N ( w ) | ≥ N ( w ) is monochromatic under φ ′ ,then N ( w ) = { c , z } . Moreover, since d G ( u, v ) = 3, we have N ( u ) ∩ N ( v ) = ∅ . If | N ( v ) | ≥ N ( u ) and N ( v ) is monochromatic. Thus there exists x ∈ N ( u ) and y ∈ N ( v ) such that φ ′ ( x ) = φ ′ ( y ), and hence uxyv is a rainbow (shortest) path between u and v .To conclude, consider the case in which | N ( v ) | = 1. Recall that c is the only cut vertex such that φ ′ ( c ) = 1. Therefore, if N ( v ) = { c } , then N ( u ) is not monochromatic, which implies that we canfind a vertex x ∈ N ( u ) such that φ ′ ( x ) = 1. Finally, if N ( v ) = { c } with c = c , then we can againfind x ∈ N ( u ) such that φ ′ ( x ) = φ ′ ( c ), since φ ′ ( c ) = 1, φ ′ ( c ) = φ ′ ( z ) = 1 and any monochromaticsubtree of T induced by the open neighborhood of a vertex of S is of the form { c , z } .We now show that both RVC and
SRVC are NP -complete if we only forbid a finite numberof suns. In what follows, we make use of the same reduction of Heggernes et al. [7] for splitgraphs. Their reduction is from Hypergraph Coloring . Given a hypergraph H = ( U, E ), where U = { u , . . . , u n } , they construct a split graph G = ( K ′ ∪ I ′ , E ), where K ′ = K ′ ∪ · · · ∪ K ′ n +1 with K ′ i := (cid:8) u it | u t ∈ U (cid:9) , I ′ = I ′ ∪ · · · ∪ I ′ n +1 with I ′ i := { x ie | e ∈ E} and E := { xy | x, y ∈ K ′ } ∪{ u it x ie | u t ∈ U, e ∈ E , u t ∈ e, ≤ i ≤ n + 1 } .In our case, we start with an instance of Graph Coloring restricted to ( C , . . . , C p )-freegraphs, a problem that was shown to be NP -complete by Král’ et al [8] (see also [6]) for every fixed k ≥
3. We can see an input G = ( V, E ) of
Graph Coloring as a hypergraph in which everyhyperedge has size two. We perform the same construction and obtain a graph G ′ . The fact that13 ′ is a yes instance to RVC (and
SRVC ) if and only if G is a yes instance to Graph Coloring follows from [7, Lemma 11]. We now show that G ′ is a split graph with no induced t -sun, with3 ≤ t ≤ p . Lemma 4.4. G ′ is a split ( S , . . . , S p ) -free graph.Proof. Let G = ( V, E ) be the ( C , . . . , C p )-free graph that originated G ′ . It is easy to see that G ′ is a split graph with clique K ′ and independent set I ′ . Suppose G ′ contains an induced t -sun, forsome t ∈ { , . . . , k } , on vertex set A = { v , . . . , v t , w , . . . , w t } , where G ′ [ { v , . . . , v t } ] is a clique, G ′ [ { w , . . . , w t } ] is an independent set, w i is adjacent to v i and v i +1 for 1 ≤ i ≤ t − w t isadjacent to v t and v . Since every vertex of I ′ has degree two and K ′ is a clique, we necessarilyhave that { v , . . . , v t } ⊂ K ′ and { w , . . . , w t } ⊂ I ′ . Moreover, note that, by construction, forevery j , N G ′ ( I ′ j ) ⊆ K ′ j . Hence, there exists p ∈ { , . . . , n + 1 } such that { v , . . . , v t } ⊂ K ′ p and { w , . . . , w t } ⊂ I ′ p . For simplicity assume v i = u pi . Since w i is adjacent to u pi and u pi +1 for 1 ≤ i < t ,we have that u i u i +1 ∈ E ( G ) for 1 ≤ i < t . Analogously, it holds that u t u ∈ E ( G ) as well. Thisimplies that u u . . . u t u is a cycle in G and therefore G contains an induced cycle of length atmost t . This is a contradiction since t ≤ p and G is ( C , . . . , C p )-free.From Lemma 4.4 and Lemma 11 of [7], we obtain the following theorem. Theorem 4.5.
For any fixed p ≥ , RVC and
SRVC are NP -complete on split ( S , . . . , S p ) -freegraphs for any fixed p ≥ . In this section we study powers of trees. Let T be a tree, and z in the center of T . Let e = zv be an edge that is incident to z , with v not in the center. When e is removed from the tree, thetree will fall apart in two parts, a branch is the part that does not contain z . If the center of T contains only one vertex, the number of branches equals the degree of z . Two trivial lower bounds for the rainbow coloring number of a graph G are the number of cutvertices in G and diam( G ) −
1. In squares of trees we found graphs that need more than diam( T ) − Lemma 5.1.
Let T be a tree such that the center of T consist of a single vertex z , T has diameterat least , and there are at least three branches from the center with maximum length. Then srvc ( T ) ≥ rvc ( T ) ≥ diam( T ) .Proof. Let v , v , and v be three vertices with maximum distance to z in three different branches.We consider the case that diam( T ) is odd. There is a unique shortest path P = v , p , p , . . . , p k , v from v to v in T . Analogously, there is a unique shortest path Q = v , q , q , . . . , q k , v from v to v in T . Notice that q = p , q = p , . . . , q j = p j , where j = ⌊ diam( T )2 ⌋ . That is, P and Q use the same vertices in the branch of v . The unique shortest path R in T from v to v is v , p k , . . . , p j +1 , q j +1 , . . . , q k , v . See Figure 9.We give a proof by contradiction. Let c be a rainbow vertex coloring that uses at mostdiam( T ) − P , Q , and R have length diam( T ). Therefore, foreach of these paths, all internal vertices are assigned different colors and all colors appear in thepath. Since the first j vertices of the paths P and Q are equal, we see that the colors used for14 = q p = q v p p v q q v Figure 9:
A graph T for which T needs diam( T ) colours, see Lemma 5.1. p j +1 , . . . , p k are the same as the colors used for q j +1 , . . . , q k . Since diam( T ) ≥ { p j +1 , . . . , p k } and { q j +1 , . . . , q k } are non-empty. Hence, there is a color that appears twice in R , which yields acontradiction. We conclude that rvc ( T ) ≥ diam( T ).The case that diam( T ) is even is analogous.The class of graphs described in the statement of Lemma 5.1 needs exactly diam( T ) colors.We define layer i as the set of all vertices with distance ⌊ diam( T ) / ⌋ − i to the center of T . For avertex v , we write l ( v ) for the layer that it is contained in, so l ( v ) = ⌊ diam( T ) / ⌋ − d , where d isthe distance of v to the center of T . Lemma 5.2.
Let T be a tree such that the center of T consist of a single vertex, T has diameterat least , and there are at least three branches from the center with maximum length. Then rvc ( T ) = diam( T ) .Proof. Consider the following coloring c : c ( v ) = i if v is in layer i , 1 ≤ i ≤ diam( T )2 . Notice that the number of colors in this coloring is diam( T )2 = diam( T ).We claim that this is a rainbow coloring. Let u and v be two vertices in T . Let w be thelowest common ancestor of u and v . Consider the following u − v -path: use the even layers to gofrom u to w , and the odd layers to go from w to v . See Figure 10. Notice that the internal verticesof such a path are in different layer, hence this is a rainbow path.Combining this with Lemma 5.1, we conclude that rvc ( T ) = diam( T ).Notice that this is not a strong rainbow vertex coloring, since the u − v -path described in theproof is not necessarily a shortest path.In squares of trees this is the only example that needs more than diam( T ) − T with diam( T ) ≤
4, it holds that diam( T ) ≤
2. This shows that rvc ( T ) = 1 in those cases. Wewill distinguishing two cases for the rest of the graphs. Lemma 5.3.
Let T be a tree such that the center of T consist of a single vertex, T has diameter atleast , and there are exactly two branches from the center with maximum length. Then rvc ( T ) =diam( T ) − . u v Figure 10:
A tree T . The numbers indicate the colouring of T . The gray square vertices are a rainbowpath in T from u to v . Proof.
Let B be one of the branches with maximum length. Let B be all other branches, togetherwith the center vertex. Suppose that diam( T ) is odd. Consider the following coloring c : c ( v ) = i if v ∈ B is in layer i , 1 ≤ i ≤ diam( T ) − i − v ∈ B is in layer 2 i , 1 ≤ i ≤ diam( T ) − i if v ∈ B is in layer 2 i −
1, 1 ≤ i ≤ diam( T ) − . Intuitively, we color B per layer, and we color B similar, but with the colors of layer 1 and 2swapped, and the colors of layers 3 and 4 swapped, etc. See Figure 11. The number of colors usedin this coloring equals diam( T ) − u and v be two vertices of T . We claim that there exists a rainbow path between u and v .If u and v are both in B i , for i = 1 ,
2, we can use the same path as in the proof of Lemma 5.2.Suppose without loss of generality that l ( u ) ≤ l ( v ) and let w be the lowest common ancestor of u and v . Use the even layers to go from u to w , and the odd layers to go from w to v . Notice thatevery layer has a unique color, except for the center vertex, which has the same color as layer 1in B and as layer 2 in B . When this path contains the center vertex, both u and v are in B .Because this path does not contain a vertex in layer 1 as an internal vertex, this is a rainbow path.If u ∈ B i and v ∈ B j , with i = j , consider the following path. Let P be the path from u takingthe even layers towards the center, as far as possible, so P ends at a neighbour of the center. Let P be the same from v . Then the path P followed by P reversed, is a path from u to v . This is arainbow path since the colors used in the even layers of B are exactly the colors of the odd layersof B and vice versa. We conclude that c is a rainbow coloring.Suppose that diam( T ) is even. We slightly modify the coloring c : c ( v ) = i if v ∈ B is in layer i , 1 ≤ i ≤ diam( T ) − i + 1 if v ∈ B is in layer 2 i , 1 ≤ i ≤ diam( T ) − i if v ∈ B is in layer 2 i + 1, 1 ≤ i ≤ diam( T ) − . u v
321 4321 145231131 u v Figure 11:
A tree T . The numbers indicate a rainbow colouring of T . The gray square vertices are arainbow path from u to v . See Lemma 5.3. The paths constructed above are rainbow paths in this coloring as well.Again, this is not a strong rainbow coloring.
Lemma 5.4.
Let T be a tree such that the center of T consist of two vertices and T has diameterat least . Then rvc ( T ) = diam( T ) − .Proof. We will color per layer: c ( v ) = i if v is in layer i , 1 ≤ i ≤ diam( T )2 . The number of colors used in this coloring equals ⌊ diam( T )2 ⌋ = diam( T ) − u and v be two vertices of T . Write z and z for the two center vertices. If u and v are both in a branch of z i , for i = 1 ,
2, we can use the samepath as in the proof of Lemma 5.2: Let w be the lowest common ancestor of u and v . Use the evenlayers to go from u to w , and the odd layers to go from w to v . Since we use at most one vertexper layer, this is a rainbow path.Otherwise, assume without loss of generality that u is in a branch of z and v in a branch of z . Use the even layers to go from u to z , and the odd layers to go from z to v . Again, this is arainbow path. See Figure 12. In this section we consider higher powers T k for k ≥
3. We will see that the same results holdfor the higher powers, but we have to distinguish more cases. Specifically, for the cases where thecenter consists of a single vertex, we have to consider whether diam( T ) ≡ k ) or not. Forsquares of trees we did not consider the case that diam( T ) k ), since the diameter isalways even if the center consists of a single vertex.17 654321 u v Figure 12:
A tree T . The numbers indicate the colouring of T . The gray square vertices are a rainbowpath in T from u to v . Lemma 5.5.
Let T be a tree such that the center of T consist of a single vertex, T has diameterat least k , diam( T ) ≡ k ) , and there are at least three branches from the center withmaximum length. Then srvc ( T k ) ≥ rvc ( T k ) ≥ diam( T k ) .Proof. This proof is analogous to the proof of Lemma 5.1.As for squares of trees, we can proof that diam( T k ) colors suffices in this case. Lemma 5.6.
Let T be a tree such that the center of T consist of a single vertex, T has diameterat least k , diam( T ) ≡ k ) , and there are at least three branches from the center withmaximum length. Then rvc ( T k ) = diam( T k ) .Proof. To describe a rainbow coloring with diam( T k ) colors, we need to count the layers bottomup. That is, we start counting the layers at the vertices that are furthest from the center. Recallthat l ( v ) is the number of the layer that contains v .Consider the following coloring c : c ( v ) = v is the center vertex, i if l ( v ) = i , and i ≡ k ) or i ≡ − k ), 0 < i < diam( T )2 ,1 otherwise . We will count the number of colors we used. We have one color for every layer i with i ≡ − i ≡ k ) minus layer 0 and the layer with the center vertex, and one extra color 1 forthe rest of the vertices. There are diam( T )2 layers excluding the center vertex. Divide the layers0 , , , . . . , diam( T )2 − k (the topmost block does not need to be a completeblock). The vertices in layers − k ) are exactly the topmost vertices of the complete blocks,and the vertices in layers 0 (mod k ) are exactly the lowest vertices in the blocks. The number ofcomplete blocks is ⌊ diam( T ) / k ⌋ , thus the number of layers that is − k ), is ⌊ diam( T ) / k ⌋ . Andthe total number of blocks is ⌈ diam( T ) / k ⌉ , so the number of layers that is 0 (mod k ), minus layer1865 u v Figure 13:
A tree T . Let k = 6. The numbers indicate the coloring of T , all unlabeled vertices have color1. The gray square vertices are a rainbow path in T from u to v . See Lemma 5.6.
0, is ⌈ diam( T ) / k ⌉ −
1. So the total number of colors used in this coloring is (cid:22) diam( T ) / k (cid:23) + (cid:24) diam( T ) / k (cid:25) − $ diam( T k )2 % + & diam( T k )2 ' = diam( T k ) . We claim that this is a rainbow coloring. Let u and v be two vertices in T k . Let w be thelowest common ancestor of u and v . Consider the following u − v -path: use the layers that are 0(mod k ) to go from u to w , and the layers that are − k ) to go from w to v . See Figure13. Notice that the internal vertices of such a path are in different layer, all of which are 0 or − k ), except for vertex w . Hence this is a rainbow path.Combining this with Lemma 5.5, we conclude that rvc ( T k ) = diam( T k ).As in squares of trees, these are the only powers of trees with rvc ( T k ) ≥ diam( T k ). For allother powers of trees it holds that rvc ( T k ) = diam( T k ) −
1. If diam( T ) ≤ k , then diam( T k ) ≤ Lemma 5.7.
Let T be a tree such that the center of T consist of a single vertex, T has diameterat least k + 1 , and diam( T ) k ) . Then rvc ( T k ) = diam( T k ) − .Proof. We will start with a partial coloring of the vertices, almost the same coloring as in the proofof Lemma 5.6: c ( v ) = n i if l ( v ) = i , and i ≡ k ) or i ≡ − k ), 0 < i < diam( T )2 . We colored every layer that is 0 or − k ), excluding layer 0 and the center vertex, with aunique color, see Figure 14. The idea of a rainbow path from a vertex u to a vertex v will be, as in194 54 54 54 54 54 Figure 14:
Trees T , k = 5. The numbers indicate the partial coloring of T k , as in Lemma 5.7. Lemma 5.6, that we walk from u to the lowest common ancestor w using the layer 0 (mod k ) andthen from w to v via the layer − k ). This time, since we want to use only diam( T k ) − w .First, we count the number of colors we used so far. The number of layers l excluding 0 andthe center is l = diam( T )2 −
1. We will divide those layers in blocks of size k , starting at layer 1(the topmost block does not need to be a complete block). Notice that the top two layers in everycomplete block are colored. There are ⌊ lk ⌋ complete blocks, so 2 ⌊ lk ⌋ colors for those blocks. If thetopmost block is not a complete block, it uses a color only if it has size k −
1. But then the centervertex is in a layer 0 (mod k ), which implies that diam( T ) ≡ k ), a contradiction with theassumptions. We conclude that the number of colors used is 2 ⌊ lk ⌋ .We distinguish cases for the coloring of rest of the vertices. Let z be the center vertex, andlet B and B be two longest branches from z . Define b as a vertex in B in the highest layer 0(mod k ) that is colored and b as a vertex in B in the highest layer 0 (mod k ) that is colored.Let d ( b , b ) be the distance between b and b in T .Suppose that d ( b , b ) > k . We claim that diam( T k ) − ≥ ⌊ lk ⌋ + 1. Let u ∈ B , v ∈ B be vertices in layer 0. A u, v -path contains a vertex in every complete block in B , a vertex inevery complete block in B and a vertex in a topmost incomplete block or z . All in all, this are2 ⌊ lk ⌋ + 1 internal vertices. So diam( T k ) − ≥ ⌊ lk ⌋ + 1. It follows that we can use one more colorin our coloring c . Use this extra color for all uncolored vertices. Then, for any two vertices u, v ,the path described before is a rainbow path: use the 0 (mod k ) layers to go from u to z and the − k ) layers to go from z to v .Now suppose that d ( b , b ) = k . It follows that k | diam( T ), a contradiction with the assump-tions of the lemma.Now suppose that d ( b , b ) ≤ k −
1. Color all uncolored vertices with the highest color used,that is color ki where i = ⌊ diam( T ) / − k ⌋ . Let u and v be two vertices. We distinguish two cases.If the lowest common ancestor w is in layer ki or lower, we use the same path described above:use the 0 (mod k ) layers to go from u to w and the − k ) layers to go from w to v . Because w is in layer ki or lower, no vertex of layer ki is used as internal vertex of the u − w and w − v w is unique in the path, and this is a rainbow path.If w is above layer ki , then we use the same path but exclude vertex w . Write w for the lastinternal vertex of the u − w -path, and w for the first internal vertex of the w − v -path. Noticethat w is in layer ki and w is in layer ki −
1. As d ( b , b ) ≤ k −
1, the distance between w and w is at most k , so there exists an edge w w in T k . We conclude that the path using the 0(mod k ) vertices to go from u to w combined with the path using the − k ) vertices to gofrom w to v is a rainbow path in T k . Lemma 5.8.
Let T be a tree such that the center of T consist of a single vertex, T has diameter atleast k , diam( T ) ≡ k ) , and there are exactly two branches from the center with maximumlength. Then rvc ( T k ) = diam( T k ) − .Proof. To prove this, we will combine the ideas of Lemma 5.3 and 5.7. Let B and B be thebranches with maximum length. Let B be all other branches. Suppose that diam( T k ) is even.Consider the following coloring c , see Figure 15: c ( v ) = i if v ∈ B is in layer i , i ≡ , − k ), 1 ≤ i < diam( T ) / − ki − v ∈ B is in layer ki , 1 ≤ ki < diam( T ) / − ki if v ∈ B is in layer ki −
1, 1 ≤ ki − < diam( T ) / − ki if v ∈ B is in layer ki , 1 ≤ ki < diam( T ) / − ki − v ∈ B is in layer ki + 1, 1 ≤ ki + 1 < diam( T ) / −
11 otherwise . First, we count the number of colors we used. We used the colors ki and ki − ≤ ki − < diam( T ) / −
1. These are 2 (cid:22) diam( T ) / − k (cid:23) = 2 (cid:22) diam( T ) /k − k (cid:23) = 2 $ diam( T k )2 − k % = 2 diam( T k )2 − ! = diam( T k ) − T k ) is even. We used one extra colorfor the rest of the vertices, which makes a total of diam( T k ) − u and v be two vertices of T . We claim that there exists a rainbow path between u and v in T k . We will distinguish several cases.Suppose that u ∈ B , v / ∈ B . Let z be the center of the graph. Use the layers 0 (mod k ), towalk from u to z , and the layers 0 (mod k ), to go from z to v . This is a rainbow path.Suppose that u ∈ B i , v ∈ B i , i = 1 ,
2. Let w be the lowest common ancestor of u and v . Usethe layers 0 (mod k ) to go from u to w , and the layers − k ) to go from w to v . This is arainbow path.Suppose that u ∈ B i , v ∈ B , i = 2 ,
3. Let w be the lowest common ancestor of u and v . Usethe layers 0 (mod k ) to walk from u to w , and the layers 1 (mod k ) to go from w to v . This is arainbow path. 21ow suppose that diam( T k ) is odd. We slightly change the coloring: use color ki with i = ⌊ diam( T ) / − k ⌋ for the case ‘otherwise’ instead of color 1. Notice that this is the highest color usedin the rest of the coloring. The number of colors used is:2 (cid:22) diam( T ) / − k (cid:23) = 2 (cid:22) diam( T ) /k − k (cid:23) = 2 $ diam( T k )2 − k % ≤ $ diam( T k )2 % = diam( T k ) − T k ) being even.Suppose that u ∈ B , v / ∈ B . Let z be the center of the graph. Let P be the path from u to z that uses the layers 0 (mod k ), and Q the path from z to v that uses the layers 0 (mod k ). Let p j be the last vertex before z in P and let q be the first vertex after z in Q . Notice that z hasthe same color as q , so we cannot include both z and q in a rainbow path. Notice that both p j and q are in the highest layer ki . Since the diameter diam( T ) ≡ k ) and diam( T k ) is odd,it follows that the distance between p j and q in T is exactly k . Thus there is an edge p j q in T k .Combine the paths P and Q but exclude vertex z , to obtain a path from u to v . This is a rainbowpath.Consider the other two cases, so, suppose that u ∈ B i , v ∈ B i , i = 1 , u ∈ B i , v ∈ B , i = 2 ,
3. Let w be the lowest common ancestor of u and v . If w is in layer i with i ≤ k ⌊ diam( T ) / − k ⌋ ,then use the same path as in the case diam( T k ) even. If w is in layer i with i > k ⌊ diam( T ) / − k ⌋ ,then w has the same color as its predecessor p j or successor q in the path described in the casediam( T k ) even. As in the previous case, the distance between p j and q in T is at most k , so thereexists an edge p j q in T k . So if we exclude w from the path described in the case diam( T k ) even,we still have a path, and this is a rainbow path. Lemma 5.9.
Let T be a tree such that the center of T consist of two vertices and T has diameterat least k + 1 . Then rvc ( T k ) = diam( T k ) − .Proof. Let z and z be the two center vertices. Let B be all branches of z , including z , and B be all branches of z , including z .Divide the layers 1 , , . . . , diam( T ) − in blocks of size k , starting at layer 1 (the topmost blockdoes not need to be a complete block). Let l be the number of complete blocks in B . Let a , a , . . . be the topmost vertices in the topmost complete blocks in B (possibly a = z ), that is, a , a , . . . are all vertices in B in layer kl . Analoguously, let b , b , . . . be the topmost vertices in the topmostcomplete blocks in B (possibly b = z ), that is, b , b , . . . are all vertices in B in layer kl . Let d ( a , b ) be the distance between a and b in T . We will distinguish two cases.First, suppose that 1 ≤ d ( a , b ) ≤ k . Consider the following partial coloring: c ( v ) = i if v ∈ B is in layer i , i ≡ , − k ), 1 ≤ i ≤ klki − v ∈ B is in layer ki , 1 ≤ ki ≤ klki if v ∈ B is in layer ki −
1, 1 ≤ ki − ≤ kl. Figure 15:
A tree T . The numbers indicate a rainbow colouring of T k , for k = 5, the unlabeled verticeshave color 1. See Lemma 5.8. Color the rest of the vertices with the highest color used in the partial coloring, that is, with color kl . Notice that the partial coloring colors the top two vertices of every complete block, so thenumber of colors we used equals 2 l . Let u be a vertex in layer 0 in B and v a vertex in layer 0 in B . Notice that a shortest path from u to v uses at least one vertex from every complete block.It follows that diam( T k ) ≥ l + 1. So we conclude that the number of colors we used is at mostdiam( T k ) − u ∈ B and v ∈ B be two vertices indifferent sets of branches. Consider the path P from u to its ancestor a using the layers that are0 (mod k ), and the path Q from the ancestor b j of v to v using the layers that are 0 (mod k ).Since d ( a i , b j ) = d ( a , b ) ≤ k , there exists an edge a i b j in T k . Hence we can combine P and Q toa path from u to v . This is a rainbow path.Let u and v be two vertices in the same set of branches, so u and v are both in B or bothin B . Let w be their lowest common ancestor, and let i be the layer that contains w . If i ≤ kl ,then consider the path P from u to w using the layer 0 (mod k ) and the path Q from w to v usingthe layers − k ). Combining them yields a rainbow path from u to v . Suppose that i > kl .Notice that we cannot simply use the path P Q , since w has the same color as the vertices in layer kl or kl − u and v are in B or B ). Let P and Q be as before and let p j be the last vertex before w in P and q the first vertex after w in Q . Notice that p j is in layer kl and q is in layer kl −
1. Then the distance between p j and q in T is at most d ( a , b ) ≤ k , hencethere is an edge p j q in T k . So combining P and Q but excluding vertex w is a path from u to v ,and it is a rainbow path. 23 a b b a b
954 1045 1045 1 15 a b b Figure 16:
Trees T , k = 5. The numbers indicate the colouring of T k . See Lemma 5.9. Second, suppose that d ( a , b ) > k . Consider the following coloring: c ( v ) = i if v ∈ B is in layer i , i ≡ , − k ), 1 ≤ i ≤ klki − v ∈ B is in layer ki , 1 ≤ ki ≤ klki if v ∈ B is in layer ki −
1, 1 ≤ ki − ≤ kl . The number of colors we used in this coloring is 2 l + 1. The diameter of this graph is also 2 l + 2:for a vertex u in layer 0 of B and v in layer 0 of B , a shortest path needs at least one vertexfrom every complete block and a vertex from the topmost (incomplete) blocks. Such a path haslength at least 2 l + 2. So the number of colors we used is at most diam( T k ) − u ∈ B and v ∈ B , we use thefollowing path: from u to z using the layers 0 (mod k ) and from z to v using the layers 0(mod k ). For two vertices u and v in the same set of branches, so both in B or both in B , usethe layers 0 (mod k ) to go from u to the lowest common ancestor w and the layers − k )to go from w to v . Those paths are rainbow paths. Theorem 5.10 (=Theorem C) . If G is a power of a tree, then rvc ( G ) ∈ { diam( G ) − , diam( G ) } ,and the corresponding optimal rainbow vertex coloring can be found in time that is linear in thesize of G .Proof. In Lemmas 5.2, 5.3, 5.4, 5.6, 5.7, 5.8, 5.9, it is shown that rvc ( G ) ∈ { diam( G ) − , diam( G ) } .24uppose that G = T k . If the tree T is unknown, it can be computed in linear time [2]. First,we compute the center of T , and then we distinguish cases as in Lemmas 5.2, 5.3, 5.4, 5.6, 5.7,5.8, 5.9. This costs linear time. In each of those lemmas, an optimal coloring is given that can becomputed in linear time. In this work, we provided polynomial-time algorithms to rainbow vertex color permutation graphs,powers of trees, and split strongly chordal graphs. The algorithm provided for split strongly chordalgraphs also works for the strong variant of the problem, where the rainbow paths connecting pairsof vertices are required to be also shortest paths.An interesting question to be answered towards solving Conjecture 1.1 is whether
RVC can besolved in polynomial time on AT-free graphs, i.e. graphs that do not contain an asteroidal triple.Conjecture 1.1 has been proved true for interval graphs [7] and, in this work, for permutationgraphs, both of which are important subclasses of AT-free graphs.Another direction of research within graph classes lies in determining the complexity of
RVC and
SRVC on strongly chordal graphs. Note that both powers of trees and split strongly chordal graphsform subclasses of strongly chordal graphs for which RVC is polynomial-time solvable, as we showin this work. Finally, note that every strongly chordal graph is also a chordal graph, and theproblems are known to be NP -hard when restricted to chordal graphs. References [1]
A. Brandstädt, F. Dragan, V. Chepoi, and V. Voloshin , Dually chordal graphs , SIAMJournal on Discrete Mathematics, 11 (2007), pp. 71 – 77.[2]
M.-S. Chang, M.-T. Ko, and H.-I. Lu , Linear-time algorithms for tree root problems ,Algorithmica, 71 (2015), pp. 471–495.[3]
L. Chen, X. Li, and H. Lian , Further hardness results on the rainbow vertex-connectionnumber of graphs , Theoretical Computer Science, 481 (2013), pp. 18–23.[4]
L. Chen, X. Li, and Y. Shi , The complexity of determining the rainbow vertex-connectionof a graph , Theoretical Computer Science, 412 (2011), pp. 4531–4535.[5]
E. Eiben, R. Ganian, and J. Lauri , On the complexity of rainbow coloring problems ,Discrete Applied Mathematics, 246 (2018), pp. 38–48.[6]
P. A. Golovach, M. Johnson, D. Paulusma, and J. Song , A survey on the computa-tional complexity of coloring graphs with forbidden subgraphs , Journal of Graph Theory, 84(2017), pp. 331–363.[7]
P. Heggernes, D. Issac, J. Lauri, P. T. Lima, and E. J. van Leeuwen , Rainbowvertex coloring bipartite graphs and chordal graphs , in Proceedings of MFCS 2018, vol. 117 ofLeibniz International Proceedings in Informatics, 2018, pp. 83:1–83:13.[8]
D. Král’, J. Kratochvíl, Z. Tuza, and G. J. Woeginger , Complexity of coloringgraphs without forbidden induced subgraphs , in Graph-Theoretic Concepts in Computer Sci-ence, A. Brandstädt and V. B. Le, eds., 2001, pp. 254–262.259]
M. Krivelevich and R. Yuster , The rainbow connection of a graph is (at most) reciprocalto its minimum degree , Journal of Graph Theory, 63 (2010), pp. 185–191.[10]
J. Lauri , Chasing the Rainbow Connection: Hardness, Algorithms, and Bounds , PhD thesis,Tampere University of Technology, 2016.[11]
X. Li, Y. Mao, and Y. Shi , The strong rainbow vertex-connection of graphs , Utilitas Math-ematica, 93 (2014), pp. 213–223.[12]
R. M. McConnell and J. P. Spinrad , Modular decomposition and transitive orientation ,Discrete Mathematics, 201 (1999), pp. 189 – 241.[13]
S. Mondal, M. Pal, and T. K. Pal , An optimal algorithm to solve the all-pairs shortestpaths problem on permutation graphs , Journal of Mathematical Modelling and Algorithms, 2(2003), pp. 57–65.
A Shortest paths in permutation graphs
As mentioned in Section 3, Lemma 3.1 can also be found in [13, Lemma 5], but for completeness wewrite the proof in this appendix. We first prove some basic lemmas about paths in the intersectionmodel.
Lemma A.1. If u ≺ z ≺ v , then for every u, v -path z (= u ) , z . . . , z a − , z a (= v ) , there is a vertex z i that intersects z (or equals z ).Proof. Suppose that none of the vertices z i intersects z . With induction we show that z i ≺ z forall 1 ≤ i ≤ a . By assumption u = z ≺ z . Suppose that z i − ≺ z . Since z i ∼ z i − , we have thatexactly one of t ( z i ) < t ( z i − ) < t ( z ) or b ( z i ) < b ( z i − ) < b ( z ). Because z i does not intersect z , itfollows that z i ≺ z . This yields a contradiction with z ≺ v . Lemma A.2. If u ≺ v and z is a vertex in an induced u, v -path, then z is not left of u and notright of v .Proof. Suppose that z ≺ u . Then by Lemma A.1, it follows that there is a vertex in the z, v -path that intersects u . This yields a contradiction with the fact that u, . . . , z, . . . , v is an induced u, v -path. We conclude that z is not left of u . Analogously, we see that z is not right of v . Lemma A.3. If u ≺ v and z (= u ) , z , z , . . . , z a (= v ) is a shortest u, v -path, then for all < i
2. Analogously, it holdsthat z i ≺ v for i < a − Lemma A.4. If z , z , z , . . . , z a is a shortest z , z a -path, then it either satisfies Equations (1) and (2) , or Equations (3) and (4) .Proof. We know that z intersects z , so we have either t ( z ) > t ( z ) and b ( z ) < b ( z ), or t ( z ) < t ( z ) and b ( z ) > b ( z ).Suppose that t ( z ) > t ( z ) and b ( z ) < b ( z ). Then we prove by induction that we are in thefirst case. Suppose that Equations 1 and 2 hold for all i < k . Then consider z k . Since z k is adjacentto z k − , we either have t ( z k ) > t ( z k − ) and b ( z k ) < b ( z k − ), or t ( z k ) < t ( z k − ) and b ( z k ) > b ( z k − ).26 k − z k − z k z k − z k − z k Figure 17:
See Lemma A.4. Since z k ∼ z k − , there are two cases: t ( z k ) < t ( z k − ) or t ( z k ) > t ( z k − ). x i − x i − x i x i +1 x i − x i x i +1 z i − z i Figure 18:
The thick lines indicate where the segment of z i − and z i can possibly end according toEquations (6) and (7). The dashed segments are examples of z i − and z i . See Lemma A.5. Suppose that k is even (See Figure 17). If t ( z k ) < t ( z k − ) and b ( z k ) > b ( z k − ), then, by theinduction hypothesis, we know that t ( z k ) < t ( z k − ) < t ( z k − ) and b ( z k ) > b ( z k − ) > b ( z k − ).Thus z k ∼ z k − . This yields a contradiction with the assumption that z , z , z , . . . , z a is a shortest z , z a -path. Hence, t ( z k ) > t ( z k − ) and b ( z k ) < b ( z k − ). The case that k is odd is analogous.Analogously, if t ( z ) < t ( z ) and b ( z ) > b ( z ), then we are in the second case. Lemma A.5.
Let Z = z = u, z , . . . , z a = v be a u, v -path and t ( z ) > t ( u ) . Then X u,v existsand the length of Z is at least the length of X u,v .Proof. Since t ( z ) > t ( u ) and z ∼ u , there exists a vertex x ∼ u with t ( x ) > t ( u ), hence the path X u,v exists.Let c − X u,v . Suppose that Z is a shorter path than X u,v , that is, a < c . Infact, let Z be a shortest u, v -path with t ( z ) > t ( u ).We will prove by induction that for 1 < i ≤ a , it holds that t ( z i ) ≤ t ( x i ) and b ( z i ) ≤ b ( x i − ) if i is even, (6) t ( z i ) ≤ t ( x i − ) and b ( z i ) ≤ b ( x i ) if i is odd. (7)Intuitively, this means that z i is not right of x i . See Figure 18 for the possible location of z i compared to x i .We start with the base case i = 2. We know that t ( z ) ≤ t ( x ) by the definition of x . And b ( z ) < b ( u ) = b ( x ), since z intersects u and t ( z ) > t ( u ).Suppose that Equations (6) and (7) hold for i = k −
1, where 3 ≤ k ≤ a . Suppose that k iseven. By Lemma A.4, we see that b ( z k ) < b ( z k − ). By the induction hypothesis, we know that b ( z k − ) ≤ b ( x k − ), thus b ( z k ) ≤ b ( x k − ).Now we distinguish two cases: z k ∼ x k − or z k ≁ x k − . In the first case, by the definition of x k , we have that t ( x k ) ≥ t ( z k ). In the second case, it holds that t ( z k ) ≤ t ( x k − ), since we alreadyproved that b ( z k ) ≤ b ( x k − ). By Equation (1), we have that t ( x k ) > t ( x k − ). We conclude that t ( z k ) ≤ t ( x k ). 27he case that k is odd is analogous.So, we conclude that t ( z a − ) ≤ t ( x a − ) and b ( z a − ) ≤ b ( x a − ) if a − t ( z a − ) ≤ t ( x a − ) and b ( z a − ) ≤ b ( x a − ) if a − a < c and X u,v is induced by definition, Lemma A.2 implies that x a − and x a − are both left of v . This yields a contradiction with the fact that z a − intersects v . Weconclude that Z is at least as long as X u,v . Lemma A.6.
Let Z = z = u, z , . . . , z a = v be a u, v -path and b ( z ) > b ( u ) . Then the length of Z is at least the length of Y u,v .Proof. This is analogous to the proof of Lemma A.5.
Proof of Lemma 3.1.
For every u, v -path Z = z , z , . . . , z a , it holds that either t ( z ) > t ( u ) or b ( z ) > b ( u ). By A.5 and A.6 it follows that the length of Z is at least the minimum of the lengthof X u,v and the length of Y u,v . Hence, at least one of X u,v and Y u,v is a shortest u, vu, v