Upper Bounding Rainbow Connection Number by Forest Number
L. Sunil Chandran, Davis Issac, Juho Lauri, Erik Jan van Leeuwen
UUpper Bounding Rainbow Connection Number by Forest Number
L. Sunil Chandran (cid:63) , Davis Issac (cid:63)(cid:63) , Juho Lauri (cid:63) (cid:63) (cid:63) , and Erik Jan van Leeuwen Indian Institute of Science, Bangalore, India. Hasso Plattner Institute, Potsdam, Germany. Utrecht University, The Netherlands.
Abstract.
A path in an edge-colored graph is rainbow if no two edges of it are colored the same, and thegraph is rainbow-connected if there is a rainbow path between each pair of its vertices. The minimum numberof colors needed to rainbow-connect a graph G is the rainbow connection number of G , denoted by rc( G ).A simple way to rainbow-connect a graph G is to color the edges of a spanning tree with distinct colorsand then re-use any of these colors to color the remaining edges of G . This proves that rc( G ) ≤ | V ( G ) | − t ( G ) − G ), where t ( G ) is the number of vertices in the largest induced tree of G ? The answer turns out to benegative, as there are counter-examples that show that even c · t ( G ) is not an upper bound for rc( G ) for anygiven constant c .In this work we show that if we consider the forest number f( G ), the number of vertices in a maximuminduced forest of G , instead of t ( G ), then surprisingly we do get an upper bound. More specifically, we provethat rc( G ) ≤ f( G ) + 2. Our result indicates a stronger connection between rainbow connection and tree-likestructures than that was suggested by the simple spanning tree based upper bound. Keywords: rainbow connection, forest number, upper bound
Let G be a connected, simple and finite graph. Consider any edge-coloring of G . A path in G is said tobe rainbow if no two edges of it are colored the same. The graph G is rainbow-connected if there is arainbow path between each pair of its vertices. If there is a rainbow shortest path between every pair ofits vertices, we say that G is strongly rainbow-connected . The minimum number of colors requiredto rainbow-connect G is known as the rainbow connection number of G , and denoted as rc( G ).Similarly, the minimum number of colors needed to strongly rainbow-connect G is the strong rainbowconnection number of G , denoted as src( G ). These measures of rainbow connectivity were introducedby Chartrand et al. [5] in 2008. The concept has gathered significant attention from both combinatorialand algorithmic perspectives. Indeed, the work of Chartrand et al. [5] has already amassed more than400 citations. In addition to being a theoretically interesting way of strengthening the usual notion ofconnectivity, rainbow connectivity has potential applications in networking [3], layered encryption [7],and broadcast scheduling [9].While introducing the parameters, Chartrand et al. [5] established basic bounds along with exactvalues of the parameters for some structured graphs. To repeat their results, recall that the diameter of G , denoted by diam( G ), is the length of a longest shortest path in G . Now, it is straightforward toverify that diam( G ) ≤ rc( G ) ≤ src( G ) ≤ m , where m is the number of edges of G . In other words, bothrc( G ) and src( G ) are always sandwiched between one and m . The extremal cases are not difficult to (cid:63) The major part of the work was done when this author was on a long-term research visit at Max Planck Institute forInformatics, Saarbr¨ucken, Germany. The visit was funded by the Alexander von Humboldt fellowship. (cid:63)(cid:63)
The major part of the work was done when this author was a PhD student at Max Planck Institute for Informatics,Saarbr¨ucken, Germany. (cid:63) (cid:63) (cid:63)
The major part of the work was done when this author was at Bell Labs, Dublin, Ireland. a r X i v : . [ m a t h . C O ] J un ee: rc( G ) = src( G ) = 1 if and only if G is complete; rc( G ) = src( G ) = m if and only if G is a tree.The authors also determined the exact rainbow connection numbers for cycle graphs, wheel graphs, andcomplete multipartite graphs.Much of the research on rainbow connectivity has focused on finding bounds on the parameters, eitherin terms of the number of vertices n or some other well-known parameters. It follows that rc( G ) ≤ n − G ) ≤ (cid:100) n/ (cid:101) , and this istight as witnessed by e.g., odd cycles. Further, it has turned out that domination is a useful concept whenderiving upper bounds on rc( G ) (see e.g., [2,11,4]). Specifically, Krivelevich and Yuster [11] showed thatrc( G ) ≤ nδ , later improved by Chandran et al. [4] to rc( G ) ≤ nδ +1 + 3, where δ denotes the minimumdegree of G . Moreover, the latter authors derived that when δ ≥
2, then rc( G ) ≤ γ c ( G )+2, where γ c ( G ) isthe connected domination number. For some structured graph classes, this leads to upper bounds of theform rc( G ) ≤ diam( G ) + c , where c is a small constant. For instance, it follows that rc( G ) ≤ diam( G ) + 1when G is an interval graph and rc( G ) ≤ diam( G ) + 3, when G is an AT-free graph, both bounds holdingwhen δ ≥
2. Basavaraju et. al. [1] show that for every bridgeless graph G with radius r , rc( G ) ≤ r ( r + 2),and for a bridgelss graph with radius r and chordality (length of a largest induced cycle) k , rc( G ) ≤ rk .In addition to domination, various authors (see e.g., [2]) have noted trees to be useful in boundingrc( G ). As mentioned earlier, rc( G ) ≤ n − G withdistinct colors. Moreover, Kamˇcev et al. [10] proved that rc( G ) ≤ diam( G ) + diam( G ) + c , where G = ( V, E ) and G = ( V, E ) are connected spanning subgraphs of G and c ≤ | E ∩ E | . For a morecomprehensive treatment, we refer the curious reader to the books [6,14] and the surveys [13,15] onrainbow connectivity.In light of the above results, it makes sense to search for bounds on rc( G ) in terms of other graphparameters, that possibly arise from “tree-related” and “dominating” graph structures. Intuitively, agraph structure that has both characteristics is a maximum induced forest of a graph. Hence, thequestion arises whether one can bound rc( G ) in terms of its forest number f( G ), the number ofvertices in the largest induced forest in the graph. We answer this in the affirmative by proving thefollowing theorem. Theorem 1.
A connected graph G with forest number f( G ) has rc( G ) ≤ f( G ) + 2 . Observe that the bound is tight up to an additive factor of 3 due to trees that have rc( G ) = n − G ) −
1. Our bound improves the upper bound of n − G ) ≥ n −
2. We leave as an open problem the question of whetherthe stronger upper bound of f( G ) − G ) is at most t ( G ), the number of vertices in the largest induced tree in the graph. However, this turns out to be nottrue. To see this, one can consider a graph G obtained by taking a K k for any k ≥ G ) = k whereas t ( G ) = 4.Finally, we note that the complement of an induced forest is a feedback vertex set . The feedback vertexset number is the size of the smallest set of vertices in a graph whose removal leaves an induced forest.Hence, Theorem 1 directly implies the following. Corollary 1.
A connected graph G with feedback vertex set number fvs( G ) has rc( G ) ≤ | V ( G ) |− fvs( G )+2 . We give the proof of the upper bound in three takes. In Take 1 in Section 2.1, we give a short proof thatrc( G ) ≤ G ) + 1. For this, we first observe that given a connected dominating set D such that eachf the remaining vertices have at least two neighbors in D , it is easy to find a rainbow coloring with | D | + 1 colors. Then we observe that any maximal induced forest F can be turned into such a connecteddominating set by adding at most 2 | F | more vertices. The bound of 3 f( G ) + 1 follows from these twoobservations.In Take 2 in Section 2.2, we strengthen our bound from 3 f( G ) + 1 to 2 f( G ) + 2. In this section, wealready introduce the main structures and insights used for our final bound in Take 3. We fix a maximuminduced forest F and define H to be the graph obtained from G by contracting each connected componentof G − F , each of which is a tree, of G into a single vertex. Thus H consists of tree vertices and non-treevertices . An edge from a non-tree vertex u to a tree-vertex x T is classified as a 2-edge if u has at leasttwo edges to the tree T (the tree that was contracted into the tree-vertex x T ), and as a 1-edge otherwise.We fix a carefully chosen spanning tree of H , root it at some (contracted) tree vertex, and direct all theedges towards root. We call this the skeleton B . The skeleton is chosen so that the number of 2-edgesin it is maximized. The inner skeleton B is defined to be B minus the leaves of B that are non-treevertices.Our idea is to color all the edges of the forest F with distinct colors and then associate each tree of F with two additional colors called surplus colors , and also keep aside two global surplus colors . Notethat this makes the total number of colors 2 f( G ) + 2 as required. Then, we show that the 2 surpluscolors per tree are sufficient to color the edges of the inner skeleton B so that there is a rainbow pathbetween every pair of vertices in B , also giving a corresponding rainbow path in G between every pairof vertices in B . We show that if each tree T can take care of the first three edges while following theoutward path to the root, then we cover all edges of B . Although we only have two surplus colors, thethree edges can indeed be taken care of. For this, we show that the third edge is not taken care of byany other tree only when the first outgoing edge is a 2-edge. In this case, this out-going 2-edge, say x T u can be colored with the same color as some edge in the path between the 2 neighbors of u in T , whilestill maintaining a rainbow connection in G between every pair of vertices in B .After rainbow-connecting B , we connect the vertices outside of the inner skeleton to the innerskeleton using the two global surplus colors. From the choice of the skeleton, we have that each outervertex has a 2-edge to at least one tree-vertex. Thus, the outer vertices have at least two edges to onetree, that we color with the two different global surplus colors. Thus to get a rainbow path between twoouter vertices x and y , we can travel from x into the inner skeleton using global surplus color 1, thenuse the path inside the inner skeleton, and then go to y using global surplus color 2.In Take 3 in Section 2.3, we improve the bound from 2 f( G ) + 2 to f( G ) + 2. The improvement comesfrom the fact that we use only one surplus color per tree instead of two. In order to make the coloringof B work with one surplus color per tree, we do a case analysis to color the edges around a vertex in B . The cases are differentiated mainly on the basis of the number of edges and the number of 2-edgesincident on a vertex. For a graph G , a subgraph H of G , and any E (cid:48) ⊆ E ( G ), we use E (cid:48) ( H ) to denote E (cid:48) ∩ E ( H ). For avertex v of (di)graph G , we use deg G ( v ) to denote the degree of v in G . We use dist G ( u, v ) to denotenumber of vertices in any shortest path between u and v in G . For graph G and S ⊆ V ( G ), we define G \ S := G [ V ( G ) \ S ]. We use uv for an edge between u to v and for a directed edge from u to v ,we use uv . For the latter, we may omit the arrow, when the direction is not relevant. For a directedgraph G , we denote by ˜ G , the underlying undirected graph of it. Since, for a forest F , each connectedcomponent is a tree, we will use the phrases “tree of F ” and “connected component of F ” analogously.An in-arborescence is a directed graph with a special root vertex such that all vertices have a uniqueirected path to the root vertex. For a tree T and vertices u and v in T , we use T uv to denote the uniquepath in T between u and v . Let G = ( V, E ) be a connected graph. Our goal is to prove that rc( G ) ≤ f( G ) + 2. In what is to follow, weproceed incrementally by starting from a weaker bound, namely that rc( G ) ≤ G ) − G ) ≤ G ) + 2 in Section 2.2. Finally, in Section 2.3,to prove our final result, we use the ideas presented in these proofs in a more detailed and technicallyinvolved manner. G ) ≤ G ) − In this subsection, as a starting point, we prove that rc( G ) ≤ G ) − Lemma 1.
If there is a set D ⊆ V such that G [ D ] is connected and every vertex in V \ D has at leasttwo neighbors in D , then rc( G ) ≤ | D | + 1 .Proof. Since G [ D ] is connected, it has at least one spanning tree T . Pick any spanning tree T of G [ D ]and color its edges with distinct colors from 1 to | D | −
1. By the second precondition of the lemma,every vertex v ∈ V \ D has at least two neighbors in D ; call them d ( v ) and d ( v ). Color the edge vd ( v )with color | D | and vd ( v ) with color | D | + 1. We will now prove that there is a rainbow path betweenany u, v ∈ V ( G ).When u, v ∈ V ( D ), the proof is trivial as G [ D ] is rainbow-connected using only edges from T , all ofwhich we colored distinctly. Similarly, when u ∈ D and v ∈ V \ D , a rainbow path between the two usesonly edges of T plus either vd ( v ) or vd ( v ), both colored with a color not appearing on any edge in T .Finally, suppose both u and v are in V \ D . Observe that there is a rainbow path between d ( u ) and d ( v ) using only edges from T , particularly not using colors | D | or | D | + 1. Since ud ( u ) is colored withcolor | D | and vd ( v ) is colored with color | D | + 1, we have a rainbow path between u and v , completingthe proof. (cid:117)(cid:116) To proceed, let F be a maximum induced forest of G . Let F = V ( F ), i.e., the set of vertices in F andlet T denote the set of connected components of F . The following structural observation will be usefulfor us. Lemma 2.
For any maximum induced forest F of G and for any v ∈ V \ F , there exists a connectedcomponent T of F such that v has at least two neighbors in T .Proof. Otherwise, G [ F ∪ { v } ] is a forest, contradicting the maximality of F . (cid:117)(cid:116) The proof of the following lemma is folklore after observing that F is a dominating set of G (by themaximality of F ), and proved here only for the sake of completeness. Lemma 3.
There exists a vertex set A ⊆ V \ F of size at most | F | − such that G [ F ∪ A ] is connected.Proof. Let B be a smallest subset of V \ F such that G [ F ∪ B ] has a smaller number of connectedcomponents than G [ F ]. We show that | B | ≤
2. From the minimality of B , it follows that B induces a T T T S (a) x T x T x T x T S (b) Fig. 1: (a)
A graph G is partitioned into a maximum induced forest F and S = V ( G ) \ V ( F ). Theconnected components (trees) of F are T , T , T and T . The edges between two black vertices, corre-sponding to vertices in V ( F ), are tree-edges. (b) The graph H obtained after contracting the connectedcomponents of F . We draw a 2-edge with 2 lines and a 1-edge with a single line.path in G that connects two connected components of F . Let b , b , . . . , b k be the vertices in this path,where b and b k are adjacent to some vertex in distinct connected components T and T respectively.Due to Lemma 2, b has an edge to some connected component T ∈ T . If T = T , then B \ { b } wouldalso connect T and T . Hence T (cid:54) = T . But then the vertex set { b , b } is sufficient to connect T and T and thereby reduce the number of components. This implies k = 2 and hence | B | ≤
2. Now, we add B to F to reduce the number of connected components by at least one. Then we can repeat the process againuntil we get a single connected component. At each stage, the currently existing connected componentstake the role of the T i ’s. We only need to repeat the process at most | F | − | F | − (cid:117)(cid:116) We then arrive at the following conclusion.
Theorem 2.
Any connected graph G has rc( G ) ≤ G ) − .Proof. By Lemma 3, we have a set A such that G [ F ∪ A ] is connected and | A | ≤ | F | −
2. Let D = F ∪ A .By Lemma 2, we have that each vertex in V \ F has at least two neighbors in F . This implies that eachvertex in V \ D has at least two neighbors in D . Thus, D satisfies both preconditions of Lemma 1 andhence rc( G ) ≤ | D | + 1 ≤ | F | + | A | + 1 ≤ | F | + (2 | F | −
2) + 1 = 3 f( G ) − . This completes the proof. (cid:117)(cid:116) G ) ≤ G ) + 2 In this subsection we strengthen the previous upper bound to 2 f( G ) + 2. Many of the concepts andtechniques that we use in the final proof are already introduced here.As in the previous subsection, let F be a maximum induced forest of G . Let F = V ( F ) be the set ofvertices in F . Let T be the set of connected components (trees) of F and let t = |T | . Let S := V \ F .Also, let f = | V ( F ) | = f( G ). We call an edge uv of G a tree-edge if both u and v belong to the sametree in T ; otherwise, the edge is called a non-tree edge .Let H be the graph obtained from G by contracting each connected component of F to a singlevertex (see Figure 1). Formally, we define H as: V ( H ) := V T ∪ S, where V T := { x T : T ∈ T } and E ( H ) := E ( G [ S ]) ∪ { ux T : u ∈ S, T ∈ T , u has at least one edge to V ( T ) in G } . e call the vertices in V T the tree vertices and the vertices in S the non-tree vertices of H . Noticethat V T is an independent set in H , because there are no edges in G between any two distinct connectedcomponents of F . We partition the edges of H into the following two sets: E := E ( G [ S ]) ∪ { ux T : u ∈ S, T ∈ T , u has exactly one edge to V ( T ) in G } and E := { ux T : u ∈ S, T ∈ T , u has at least two edges to V ( T ) in G } . The edges in E are called while those in E are See Figure 1 for an illustration ofthe above definitions. We define a function f T : V T → T that maps a tree vertex to its correspondingtree, i.e., f T ( x T ) = T . For each edge in H , we define its representatives in G as follows. Consider firsta 2-edge e between u ∈ S and x T ∈ V T . By definition of a 2-edge, u has at least two edges to V ( T ) in G . We arbitrarily choose two of these edges as the representatives in G of the 2-edge e in G and denotethem by ( e ) and ( e ) . For a 1-edge e between u ∈ S and x T ∈ V T , there is a unique edge between u and V ( T ) in G , by the definition of a 1-edge. We call this edge the representative of ux T in G , and denoteit ( e ) . For a 1-edge e between u ∈ S and v ∈ S , we call uv its own representative in G . For simplicity,we might simply say representatives instead of representatives in G . Whenever we say a representative,it is implicitly assumed that we are talking about an edge in G . For a 2-edge ux T with representatives uv and uv , we call the vertices v and v , the foots of ux T . The unique path between v and v in T is called the foot-path of ux T .A skeleton is an in-arborescence obtained by taking a spanning tree of H with an arbitrary node of V T fixed as its root with all edges directed towards the root. Let B be a skeleton such that the numberof 2-edges in B is as large as possible (or equivalently, the number of 1-edges is as small as possible, asthe total number of edges in a skeleton is always | V ( H ) | − parent of a non-root vertex v in B , denoted by par ( v ), is the unique out-neighbor of v in B . The children of v are the in-neighbors of v in B . Whenever we say the parent (or child), we mean the parent (or child) in B , even if B is notmentioned explicitly. We call a directed edge uv in B , a 1-edge (or 2-edge respectively), if uv is a 1-edge(or 2-edge respectively) in H . Let L S be the set of vertices of S that are leaves of B and let B be thesub-arborescence of B defined as B := B [ V ( B ) \ L S ]. We call B the inner skeleton . Let ˜ B be theunderlying undirected tree of B . These concepts are illustrated in Figure 2.We now prove a lemma that is useful for our coloring procedure. Lemma 4.
Every vertex in S has at least one 2-edge incident on it in B .Proof. Suppose for the sake of contradiction that v is a vertex in S that has only 1-edges incident on itin B . By Lemma 2, there exist a T ∈ T such that v has at least two edges to T in G . Therefore, vx T is a 2-edge in H . Let C be the connected component of B \ v that contains the vertex x T . Let e be theunique edge in B between v and C . Removing e from B and adding 2-edge vx T gives a skeleton withhigher number of 2-edges than B . This is a contradiction to the choice of B . (cid:117)(cid:116) x T x T x T x T par ( x T ) vL S (a) x T x T x T x T par ( x T ) v (b) Fig. 2: (a)
A skeleton B , where x T is the root. For vertex v , x T and x T are the children. (b) The innerskeleton B := B [ V ( B ) \ L S ]. T T T
11 771516 1615 1310 10921 3 64 5
Fig. 3: The rainbow coloring from Take 2 for the graph G in Figure 1. As an example, the color-givingedge of T is the edge colored with 1. Only relevant edges are shown. The direction of edges across S (the white vertices) and F (the black vertices) drawn according to the direction in B . The surpluscolors are s ( T ) = 7, s ( T ) = 8, s ( T ) = 9, s ( T ) = 10, s ( T ) = 11, s ( T ) = 12, s ( T ) = 13, and s ( T ) = 14 while the global surplus colors are g = 15 and g = 16.The above lemma has the following corollaries. Corollary 2.
For every vertex in L S , the unique edge incident on it in B is a 2-edge. Corollary 3.
Every leaf of B is a tree vertex.Proof. Suppose for the sake of contradiction that there is a leaf v of B that is a non-tree vertex. Clearly, v / ∈ L S by the definition of B . Hence, v is not a leaf of B . Then, there must be a vertex u in L S thathas an edge to v in B . Since both u and v are in S , the edge uv is a 1-edge. This is a contradiction toCorollary 2. (cid:117)(cid:116) Corollary 4.
For each -edge uv in B , either u is a tree vertex, or a child u (cid:48) of u in B is a tree vertexwith u (cid:48) u being a 2-edge.Proof. Suppose that u is not a tree vertex. Then there is an incoming 2-edge on u in B , because itsoutgoing edge is a 1-edge and there has to be at least one 2-edge incident on it due to Lemma 4. Letthe other endpoint of this edge be u (cid:48) . Since at least one of the endpoints of a 2-edge has to be a treevertex, u (cid:48) is a tree vertex. Since u (cid:48) is a tree vertex, it has to be in B . (cid:117)(cid:116) Coloring procedure:
We now give a rainbow coloring of G using f + t + 2 ≤ f + 2 colors (recall that t = |T | is the number of connected components in F and f = f( G ) = | V ( F ) | ). The coloring procedure x T x T x T x T Fig. 4: Coloring of B according to the coloring procedure in Take 2.s illustrated in Figure 3. Since F is a forest with t connected components, the number of edges in F is f − t . Color all the edges in F with distinct colors 1 , , . . . , f − t . We call colors g := f + t + 1 and g := f + t + 2, the global surplus colors . We use the global surplus colors to color the representativesof those edges of B that are incident on the vertices in L S . Each vertex in L S has only one edge incidenton it in B , and this edge is a 2-edge due to Corollary 2. Color one of the representatives of this 2-edgewith g and the other with g . Now there are 2 t unused colors, which are the colors f − t + 1 to f + t .We allocate each tree in T (i.e., each connected component of F ), two of these colors as its surpluscolors . That is, the i th tree T in T is allocated colors f − t + 2( i −
1) + 1 and f − t + 2( i −
1) + 2 as itssurplus colors. We denote the two surplus colors of T by s ( T ) and s ( T ).Finally, we give a coloring of the edges of B and then extend the coloring to their representativesin G (see Figure 4). Whenever we color an edge e in B with color c , we also color the representativesof e in G also with c , though we may not mention this explicitly. Pick each T ∈ T such that x T is notthe root of B and do the following: Let x T v be the outgoing edge of vertex x T in B , i.e., v = par ( x T );let w = par ( v ) (if parent of v exists, i.e., if v is not the root) and let z = par ( w ) (if w exists and parentof w exists, i.e., if w is not the root). Case 1. x T v is a 2-edge.We fix an arbitrary edge in the foot-path of x T v as the color-giving edge of T . If x T v is uncolored,then we color it with the same color as that of the color-giving edge of T . Note that the color-givingedge is already colored as we have already colored all the edges inside F . If w exists and vw is uncolored,color vw with s ( T ), the first surplus color of T . If z exists and wz is uncolored, color wz with s ( T ),the second surplus color of T . Case 2. x T v is a 1-edge.If x T v is uncolored, then color x T v with s ( T ). If w exists and vw is uncolored, then color vw with s ( T ).We will prove in Lemma 5 that the above procedure in fact colors all the edges of B , and moreoverdoes so with distinct colors. We extend this coloring of the edges of B to their representatives in G as mentioned before: for each edge e of B color their representatives (both representatives in case of2-edges and the only representative in case of 1-edge) with the color of e .At this point, there might be some edges in G that are still uncolored. We call them irrelevant edges .Indeed, when we exhibit rainbow paths between pairs of vertices later, these edges will not be used. Theedges of G that are not irrelevant are called relevant edges . To complete the edge-coloring of G , colorall the irrelevant edges with an arbitrary color from [ f + t + 2]. Lemma 5.
All the edges of B are colored and they are colored with distinct colors.Proof. It is easy to see that the colors are distinct as each color is used only once while coloring B .Therefore, it only remains to prove that all edges are colored. Assume for the sake of contradiction thatthere is an uncolored edge uv of B . Observe that in the coloring procedure, for each x T ∈ V T , we havecolored its outgoing edge and the outgoing edge of its parent (if such an edge exists) irrespective ofwhether Case 1 or 2 was applied. Hence, neither u or any child of u is a tree vertex. Since u / ∈ V T , itholds that u is not a leaf of B by Corollary 3, and consequently u has at least one child in B . Let x be one such child. As discussed above, x is not a tree vertex. Now, the edge xu is a 1-edge as bothendpoints are in S . Then, by Corollary 4, there is a tree vertex x T that is a child of x with x T x beinga 2-edge. Then, Case 1 of the coloring procedure was applied on T , during which edge uv would havebeen colored. (cid:117)(cid:116) We are now ready to prove that the coloring of the edges of G produced above is indeed a rainbowcoloring. We will prove that there is a rainbow path between every pair of vertices in G . For this, werst prove in Lemma 6 that there is a rainbow path between any pair of vertices in V ( G ) \ L S and thenin Lemma 7, we show that there is a rainbow path between any pair of vertices in V ( G ). The followingobservation is helpful in proving these lemmas. Observation 1
Let v , v , and v be three vertices in any tree T , and let e be an edge in T v v . Theneither T v v or T v v does not contain the edge e . For a vertex v in V ( G ), if v ∈ S define h ( v ) := v , otherwise (i.e., if v ∈ F ) define h ( v ) := x T , where T ∈ T is the tree containing v . Lemma 6.
For any pair of vertices v , v ∈ V ( G ) \ L S , there is a rainbow path between v and v in G that uses only colors in [ f + t ] .Proof. Consider a pair of vertices v , v ∈ V ( G ) \ L S . We will construct a rainbow path P from v to v using only the edges of G that have colors in [ f + t ]. From Lemma 5, we know that there is a rainbowpath between v (cid:48) := h ( v ) and v (cid:48) := h ( v ) in ˜ B that uses only the colors in [ f + t ]. Let this path be P (cid:48) .We will use the path P (cid:48) as a guide to construct our required rainbow path P in G . First, break P (cid:48) intotwo paths P (cid:48) and P (cid:48) as follows. Let v (cid:48) be the least common ancestor of v (cid:48) and v (cid:48) in B , let P (cid:48) be thepath from v (cid:48) to v (cid:48) and let P (cid:48) be the path from v (cid:48) to v (cid:48) .We will first construct a path P in G starting from v using the path P (cid:48) as a guide: we start with P being just the vertex v . We maintain a current vertex in G , denoted by v G , which is initialized to v . Let e be the outgoing edge from h ( v G ) in B . The edge e is the next edge in P (cid:48) to be processed. Aslong as h ( v G ) (cid:54) = v (cid:48) , repeat the following step. Case 1. h ( v G ) ∈ S .Append ( e ) to P . Also, update v G to be the other endpoint of ( e ) . Case 2. h ( v G ) ∈ V T .Let x T = h ( v G ). We then branch into two sub-cases. Case 2.1 e is a 1-edge.Let z be the endpoint of ( e ) in T . Append the path T v G z to P . Then append ( e ) to P . Update v G to be the endpoint of ( e ) outside T . Case 2.2 e is a 2-edge.Let z and z be the foots of e in T . Observe that v G ∈ V ( T ) as h ( v G ) = x T . By Observation 1,there exists a z ∈ { z , z } such that there is a path from v G to z that excludes the color-giving edge of T . Append this path to P . Now, append to P the representative of e having one of the endpoints as z . Update v G to be the endpoint outside T of this representative.Similarly, we also construct P starting from v using P (cid:48) as a guide. If v (cid:48) ∈ S , then we take P := P P .Otherwise, if v (cid:48) ∈ V T , we define P as follows. Let T = f T ( v (cid:48) ). There are vertices w , w ∈ V ( T ) thatare the endpoints of P and P , respectively. Let P be the path T w w . Take P := P P P .By construction, it is clear that P is indeed a path from v to v . It only remains to prove that P is a rainbow path whose colors are a subset of [ f + t ]. Observe that each edge that we have added to P is either a representative of an edge in P (cid:48) (call such edges E P P (cid:48) ) or an edge in F (call such edges E P F ). Recall that the representatives of an edge e in B were colored with the same color as that of e , and that each edge of P (cid:48) is colored with a color from [ f + t ]. Thus, each edge of E P P (cid:48) is a relevantedge that having a color in [ f + t ]. Also recall that each edge in F was colored with a color from [ f − t ].Thus, each edge of E P F is a relevant edge having a color in [ f − t ]. This means that all edges in P arerelevant edges with colors in [ f + t ]. In our coloring of the edges of G , each of the colors 1 , , . . . , f − t except the colors of the color-giving edges have been used only for one relevant edge. Also, the color ofhe color-giving edge of a tree T can possibly be repeated only on the representatives of the outgoingedge of x T in B . But when constructing P , we have taken care not to include the color-giving edge of T in P if P contains a representative of the outgoing edge in of x T . Also, we have included at most oneof the representatives of the outgoing edge of x T in P . Thus, the colors 1 , , . . . , f − t appear at mostonce in P . Each of the colors from f − t + 1 to f + t (surplus colors of the trees) appear on at most tworelevant edges. Further, if they appear on two edges, then those two edges are the two representatives ofsome 2-edge of B . Since we constructed P in such a way that at most one representative of any edge in B is included in P , each surplus color appears at most once in P . Thus P is a rainbow path, concludingthe proof. (cid:117)(cid:116) Lemma 7.
For any pair of vertices v , v ∈ V ( G ) , there is a rainbow path between v and v in G .Proof. Consider any pair of vertices v , v ∈ V ( G ). If both v , v ∈ V ( G ) \ L S , then we are done byLemma 6. So assume without loss of generality that v ∈ L S . Recall that if v ∈ L S , then there is2-edge e in B incident on v and that the representatives of e are colored with g and g . Let e be therepresentative of e that is colored g , and let a be the other endpoint of e . If v ∈ L S , let e be the edgeincident on v that is colored g , and let b be the other endpoint of e . If v / ∈ L S , let b = v . We knowthat there is a rainbow path P ab from a to b that uses only colors in [ f + t ] due to Lemma 6. We definethe path P := v aP ab bv . Since the edge v a is colored with g = f + t + 1, the edge bv is colored with g = f + t + 2, and path P ab uses only colors in [ f + t ], we have that the path P is indeed a rainbowpath between v and v . (cid:117)(cid:116) The following result is now immediate from the constructed coloring and Lemma 7.
Theorem 3.
Any connected graph G has rc( G ) ≤ G ) + 2 . G ) ≤ f ( G ) + 2 In this section, we prove our final bound, by further developing the ideas from the previous takes. Recallthat in Take 2, we gave two surplus colors to each tree. Here, we give only one surplus color to eachtree and thereby reduce the number of colors used. However, our analysis has to be tighter to make theproof work with only one surplus color per tree. This makes the proof much more technical and lengthy.Similar to Take 2, we fix a maximum induced forest F of G , but with an additional property as follows.Let F be the maximum induced forest that has the smallest number of connected components (trees) outof all the maximum induced forests of G . Now that F is fixed, we define T , F, S, H, V T , E , E , f T , f, t ,tree vertices, non-tree vertices, 1-edges, 2-edges, representatives, foots, foot-path and skeleton, the sameway as in Take 2. However, the selection of the skeleton B is done in a more involved way here. Given askeleton B with root r , we define the level of each node v , denoted by (cid:96) B ( v ), as its distance (in termsof number of vertices) to r in B . Note that (cid:96) B ( r ) = 1 per this definition. For a skeleton B , we define its configuration vector as the following vector: (cid:104) | E ( B ) | , Σ v : (cid:96) B ( v )=1 deg B ( v ) , Σ v : (cid:96) B ( v )=2 deg B ( v ) , . . . , Σ v : (cid:96) B ( v )= | V | deg B ( v ) (cid:105) , where deg B ( v ) is the total degree (sum of in-degree and out-degree) of v in B . We now fix a skeleton B such that it has the lexicographically highest configuration vector out of all possible skeletons. We alsodefine L S and the inner skeleton B the same way as in Take 2, i.e., L S is the set of vertices in S thatare leaves of B , and B = B [ V ( B ) \ L S ]. Let ˜ B be the underlying undirected tree of B . We note thatsince the first element of the configuration vector is the number of 2-edges, B would have been a validskeleton in Take 2 as well. In particular, Lemma 4 and Corollaries 2, 3 and 4 from Take 2 hold for B .e define a mapping h from G to H as follows. For a vertex v in V ( G ), if v ∈ S then define h ( v ) := v ,otherwise (i.e., if v ∈ F ) define h ( v ) := x T , where T ∈ T is the tree containing v . For a non-tree edge e = uv in G , we define h ( e ) to be the edge h ( u ) h ( v ). For a vertex subset U of V ( G ), we define h ( U ) to be (cid:83) a ∈ U h ( a ). For an edge subset E (cid:48) of E ( G ), we define h ( E (cid:48) ) to be { h ( e ) : e ∈ E (cid:48) and e is a non-tree edge } .For a subgraph G (cid:48) of G , we define h ( G (cid:48) ) as the subgraph of H with vertex set h ( V ( G (cid:48) )) and edge set h ( E ( G (cid:48) )).Let the palette of colors be { , , . . . , f + 2 } . We call colors f + 1 and f + 2 the global surpluscolors , and denote them by g and g . We reserve g and g to color the edges incident on L S . Wewill first give a coloring of some edges of G using colors { , , . . . , f } such that there is a rainbow pathbetween every pair of vertices in V ( G ) \ L S . Then we will extend the coloring to L S using the globalsurplus colors. We give our coloring procedure as a list of coloring rules .For a, b ∈ V ( G ) \ L S , let Q ab denote the unique path in the inner skeleton B between h ( a ) and h ( b ).For each such pair of vertices ( a, b ), we will maintain a subgraph P ab of G . Each P ab is initialized to ∅ .After the application of each coloring rule, we will apply a path rule for each pair ( a, b ), which (possibly)adds some newly colored edges to P ab . We say that an edge in B is colored if its representatives in G are colored (we will make sure that for a 2-edge, either both representatives are colored or both areuncolored at any point of time). Whenever an edge in B gets colored by a coloring rule and if it is in Q ab , we make sure that we add exactly one of its representatives to P ab in the subsequent path rule.Whenever it happens during a path rule that two edges u v and u v are in P ab such that both v and u are in some T ∈ T , but u and v are not in T , then we add the path T v u to P ab (if it is not alreadyincluded). Similarly, if it happens that there is an edge uv in P ab such that v, a ∈ V ( T ) ( v, b ∈ V ( T )resp.) but u / ∈ V ( T ), we add the path T va ( T vb resp.) to P ab . Also, if both a and b are in the same tree T ,then we add the path T ab to P ab (during Path Rule 1 below). Thus, when all the coloring rules and pathrules have been applied, we will have that for all a, b ∈ V ( G ) \ L S , it holds that P ab is a path between a and b . We will prove that P ab is also a rainbow path. For this, we will maintain the following invariant. Invariant 1
For each pair a, b ∈ V ( G ) \ L S , no two edges in P ab have the same color. We will prove that the invariant still holds after each path rule. Since new edges are added to P ab onlyduring path rules, this means that the invariant always holds. We also maintain the following threeauxiliary invariants. But they are rather straightforward to check from the coloring and path rules andhence we will not explicitly prove them. Invariant 2
For any 2-edge in B , either both representatives of it are colored or both are uncolored. A vertex in B is said to be completed if all the incident edges on it in B are colored and is said tobe incomplete otherwise. Invariant 3
For an incomplete tree-vertex x T , the colors of E ( T ) are disjoint from the colors of therest of the graph G . Invariant 4
A nonempty subset of internal edges of a tree T is contained in P ab only if a representativeof each edge in Q ab that is incident on x T (there can be at most two of such edges as Q ab is a path) isin P ab . Now, we start with the coloring and path rules.
Coloring Rule 1
Color all the edges in F with distinct colors , , . . . , f − t . Path Rule 1
For each a, b ∈ V ( G ) \ L S , if a and b are in the same tree T for some T ∈ T , then addthe path T ab to P ab . t is easy to see that Invariant 1 is satisfied after the above Path rule as the color of each edge is distinctso far.For each tree T ∈ T , we designate a color in [ f − t + 1 , f ] as its surplus color , denoted by s ( T ).More specifically, the surplus color of i th tree in T is defined as the color f − t + i . Also, the colors ofthe edges of T (colored by Coloring Rule 1) are called the internal colors of T . Coloring Rule 2
For each -edge uv in B : if u is a tree vertex, then color ( uv ) with s ( f T ( u )) ; oth-erwise, i.e., if u is not a tree vertex, by Corollary 4, there is at least one child of u in B that is a treevertex; pick one such tree vertex x T and color ( uv ) with color s ( T ) . Note that after Coloring Rule 2, any tree vertex x T such that T is just a single vertex, is completed. Path Rule 2
Do the following for each a, b ∈ V ( G ) \ L S . For each -edge e in Q ab , add ( e ) to P ab .Next, we add edges inside trees as follows. – If for some tree T it holds that a ∈ V ( T ) and there is a 1-edge ux T in Q ab , then add the path T wa to P ab , where w is the foot of the edge ux T in T . – If for some tree T it holds that b ∈ V ( T ) and there is a 1-edge ux T in Q ab , then add the path T wb to P ab , where w is the foot of the edge ux T in T . – If for some tree T there are two 1-edges ux T and vx T in Q ab , add the path T wz to P ab , where w isthe foot of the edge ux T in T and z the foot of the edge vx T in T . Lemma 8.
Invariant 1 is satisfied so far. Moreover, each color is used at most for one edge in G .Proof. It is clear that during Coloring Rule 1, all edges are colored distinct. In Coloring Rule 2, we usethe surplus colors, which are disjoint from the colors used in Coloring rule 1. It is also not difficult tosee that during Coloring Rule 2, the surplus color of a tree vertex is used for only one 1-edge. (cid:117)(cid:116)
For a colored edge e ∈ E ( G ), we define c ( e ) to be the color of e . For a subgraph G (cid:48) of G , we define c ( G (cid:48) ) to be the set of colors used in E ( G (cid:48) ). We call the number of 2-edges of B incident on a vertex,the of it. For any two vertices u and v , the connected component of B \ u containing v is denoted by ST ( u, v ). Note that ST ( u, v ) is a subtree of B . The closest (breaking ties arbitrarily)tree vertex to v in ST ( u, v ) in ˜ B is denoted by CT ( u, v ). Note that at least one tree vertex exists in ST ( u, v ) because all leaves of B are tree vertices by Corollary 3. Also note that if v is a tree vertex,then CT ( u, v ) = v . Coloring Rule 3
For each tree vertex x T with -edge degree at least (see Figure 5 for an illustration).Let q be the -edge degree of x T . Let w , w , w , . . . , w q − be the other endpoints of the 2-edges incidenton x T . For i ∈ [0 , q − , let x T i := CT ( x T , w i ) and let c i := s ( T i ) . For each i ∈ [0 , q − , color the edge ( x T w i ) with c (( i +2) mod q ) and the edge ( x T w i ) with c (( i +3) mod q ) . The following lemma follows from the way in which we have colored the edges incident on x T inColoring Rule 3. Lemma 9.
For each tree vertex x T on which Coloring Rule 3 has been applied as above, for all dis-tinct i, j ∈ [0 , q − , there is a rainbow path from w i to w j in G that uses only the colors from ( { c , c , . . . , c q − } \ { c i , c j } ) ∪ c ( T ) . Moreover, for any i ∈ [ q − and some u ∈ V ( T ) , there is a rainbowpath in G from u to w i that uses only colors from ( { c , c , . . . , c q − } \ { c i } ) ∪ c ( T ) .Proof. Let u i and v i be the endpoints in T of ( x T w i ) and ( x T w i ) respectively, for each i ∈ { , , . . . , q − } .First, we prove that there is a rainbow path from w i to w j with the required colors as claimed by theemma. Suppose for the sake of contradiction that there was no such path. Consider the followingthree paths between w i and w j : P := w i u i T u i u j u j w j , P (cid:48) := w i v i T v i v j v j w j , and P (cid:48)(cid:48) := w i v i T v i u j u j w j .By our assumption, each of these paths, is either not a rainbow path, or uses a color that is notin ( { c , c , . . . , c q − } \ { c i , c j } ) ∪ c ( T ). Also, from Coloring rules 1 and 3, we know that the only col-ors that are not in ( { c , c , . . . , c q − } \ { c i , c j } ) ∪ c ( T ) that any of these three paths can use are c i and c j . Thus, each of P, P (cid:48) and P (cid:48)(cid:48) is either not a rainbow path or uses c i or c j . However, we knowthat the paths T u i u j , T v i v j , and T v i u j are all rainbow paths due to Coloring Rule 1, and moreoverthe colors used by them are disjoint from { c , . . . , c q − } . For the path P , this means that either c ( w i u i ) = c ( u j w j ) or { c ( w i u i ) , c ( u j w j ) } ∩ { c i , c j } (cid:54) = ∅ . That is, either c ( i +2) mod q = c ( j +2) mod q or (cid:8) c ( i +2) mod q , c ( j +2) mod q (cid:9) ∩{ c i , c j } (cid:54) = ∅ . That is, either i = j or { ( i + 2) mod q, ( j + 2) mod q }∩{ i, j } (cid:54) = ∅ .But we know that ( i + 2) mod q (cid:54) = i and that ( j + 2) mod q (cid:54) = j . Therefore, either ( i + 2) mod q = j or( j + 2) mod q = i . Without loss of generality assume that ( i + 2) mod q = j .By using the same reasoning as above for path P (cid:48) , we derive that either ( i + 3) mod q = j or( j + 3) mod q = i . Since we already have that ( i + 2) mod q = j , it should be the latter case, i.e,( j + 3) mod q = i .Now consider the third path P (cid:48)(cid:48) . We have that either c ( w i v i ) = c ( u j w j ) or { c ( w i v i ) , c ( u j w j ) } ∩{ c i , c j } (cid:54) = ∅ . That is, either c ( i +3) mod q = c ( j +2) mod q or (cid:8) c ( i +3) mod q , c ( j +2) mod q (cid:9) ∩ { c i , c j } (cid:54) = ∅ . Thatis, either ( i + 3) mod q = ( j + 2) mod q or { ( i + 3) mod q, ( j + 2) mod q } ∩ { i, j } (cid:54) = ∅ . Substituting that( i + 3) mod q = ((( i + 2) mod q ) + 1) mod q = ( j + 1) mod q and that i = ( j + 3) mod q , we getthat either ( j + 1) mod q = ( j + 2) mod q or { ( j + 1) mod q, ( j + 2) mod q } ∩ { ( j + 3) mod q, j } (cid:54) = ∅ .Since j, ( j + 1) mod q, ( j + 2) mod q, and ( j + 3) mod q are distinct for q ≥
4, we have a contradiction.Next, we prove the second part of the lemma, i.e., we prove that there is a rainbow path from u to w i with the colors claimed by the lemma. Suppose for the sake of contradiction that there was no suchpath. Consider the path P (cid:48)(cid:48)(cid:48) := w i u i T u i u . We know that the path T u i u uses only colors from c ( T ) and israinbow, and that the edge w i u i is colored c ( i +2) mod q . Also, c ( i +2) mod q (cid:54) = c i as ( i + 2) mod q (cid:54) = i . Thus P is a rainbow path and uses only the colors in ( { c , c , . . . , c q − } \ { c i } ) ∪ c ( T ). (cid:117)(cid:116) Path Rule 3
For each x T on which Coloring Rule 3 has been applied as above and for each a, b ∈ V ( G ) \ L S such that Q ab contains x T (we say that the path rule is being applied on the pair ( x T , P ab )) ,do the following. Case 1:
There are two 2-edges incident on x T in Q ab . T u v u v u v u v w w w w T T T T c c c c c c c c Fig. 5: Illustration of Coloring Rule 3 applied on a tree vertex x T with 2-edge degree 4. Here, c i = s ( T i ). et w i and w j be the neighbors of x T in Q ab . Add to P ab the rainbow path from w i to w j as given byLemma 9. Case 2:
There is one -edge and one -edge incident on x T in Q ab .Let x T w i be the 2-edge. Let u be the endpoint in T of the representative of the -edge. There is arainbow path from w i to u as given by Lemma 9. Add this path to Q ab . (Note that the representative ofthe -edge has been already added to P ab during Path Rule 2). Case 3: x T is an endpoint of Q ab and the only edge incident on x T in Q ab is a -edge.Let w i be the neighbor of x T in Q ab . We know one of a or b is in T . From this vertex ( a or b whicheveris in T ) to w i , there is a rainbow path as given by Lemma 9. Add this path to P ab . The following lemma follows from Lemma 9 and Path Rule 3.
Lemma 10.
Suppose for some a, b ∈ V ( G ) \ L S and for some tree T (cid:48) ∈ T , P ab contains an edge e thatwas colored with s ( T (cid:48) ) during the application of Coloring Rule 3 on some tree vertex x T . Then, T (cid:48) (cid:54) = T and Q ab does not intersect ST ( x T , x T (cid:48) ) .Proof. Since s ( T (cid:48) ) was used during the application of Coloring Rule 3 on x T , the vertex x T (cid:48) should havebeen taken as x T i (in Coloring Rule 3) for some i and s ( T (cid:48) ) was taken as c i (in Coloring Rule 3). Since T i (cid:54) = T , it is clear that T (cid:48) (cid:54) = T . Suppose Q ab intersects ST ( x T , x T (cid:48) ) for the sake of contradiction. That is, Q ab intersects ST ( x T , x T i ). Then the color c i was not used in Path Rule 3 according to Lemma 9. Thatmeans e was not colored with c i , which is a contradiction. (cid:117)(cid:116) Lemma 11.
Invariant 1 is not violated during Path Rule 3.Proof.
Suppose Invariant 1 is violated during the application of Path Rule 3 on the pair ( x T , P ab ). Thenthere exist edges e and e (cid:48) in P ab having the same color after the application of the path rule. We canassume without loss of generality that e was added during the application of Path Rule 3 on ( x T , P ab ).That means e was colored during the application of Coloring Rule 3 on x T . Then either e ∈ E ( T ) or h ( e ) = w i x T for some i ∈ [0 , q − c ( T ) has been used only in one edge in G , wehave that h ( e ) = w i x T for some i ∈ [0 , q −
1] and hence c ( e ) = s ( T j ) for some j ∈ [0 , q − \ i . Also Q ab does not intersect ST ( x T , x T j ) by Lemma 10. Since the application of Path Rule 3 on ( x T , P ab ) addeda rainbow path to P ab , the edge e (cid:48) was not added during this application. Since each color in c ( F ) hasbeen used for only one edge in G so far, we know that e (cid:48) was not added during Path Rule 1. Hence, thefollowing two cases are exhaustive and in both cases we derive a contradiction. Case 1: e (cid:48) was added during the application of Path Rule 3 on ( x T (cid:48) , P ab ) for some tree T (cid:48) (cid:54) = T .Since P ab contains e (cid:48) , we have that Q ab contains h ( e (cid:48) ). Since e (cid:48) was added during the applicationof Path Rule 3 on ( x T (cid:48) , P ab ), either e (cid:48) ∈ E ( T (cid:48) ) or h ( e (cid:48) ) is incident on x T (cid:48) . In either case, x T (cid:48) is in Q ab . Since Q ab does not intersect ST ( x T , x T j ), we have that x T (cid:48) is not in ST ( x T , x T j ). This implies that dist ˜ B ( x T (cid:48) , x T ) < dist ˜ B ( x T (cid:48) , x T j ) But then during the application of Coloring Rule 3 on x T (cid:48) , the color s ( T j ) would never be used as x T j (cid:54) = CT ( x T (cid:48) , v ) for any vertex v . Thus, the color of e (cid:48) is not s ( T j ). Butwe know that c ( e (cid:48) ) = c ( e ) = s ( T j ), a contradiction. Case 2: e (cid:48) was added during the application of Path Rule 2 on P ab .This means e (cid:48) is the representative of a 1-edge and was colored during Coloring Rule 2. Since e (cid:48) iscolored with s ( T j ), we have that h ( e (cid:48) ) should either be the outgoing edge of x T j or the outgoing edge ofthe parent of x T j , from Coloring Rule 2. This implies that h ( e (cid:48) ) is in ST ( x T , x T j ), as the parent of x T j isa non-tree vertex. But then Q ab does not contain h ( e (cid:48) ) as Q ab does not intersect ST ( x T , x T j ). Thus P ab does not contain e (cid:48) , which is a contradiction. (cid:117)(cid:116) oloring Rule 4 For each tree vertex x T with 2-edge degree exactly (see Figure 6), let w , w , and w be the other endpoints of the three 2-edges incident on x T . Further, for i ∈ { , , } , let x T i = CT ( x T , w i ) ,let u i and v i be the foots of x T w i in T , let P i := T u i v i , and let c i := s ( T i ) . Case 1:
There exists an edge uv in T such that the cut ( V , V ) induced by uv in T is such that for all i ∈ { , , } , | V ∩ { u i , v i } | = 1 and | V ∩ { u i , v i } | = 1 . (For an illustration, see Figure 7).Without loss of generality, let u i and v i be the foots of x T w i in V and V respectively for each i ∈ { , , } . Let c be the color of uv . Color u w with c , v w with c , u w with c , v w with c , u w with c , and v w with c , as shown in Figure 7. Case 2:
There exist distinct edges e , e , e such that e i ∈ E ( P i ) for each i ∈ { , , } . (For an illustra-tion, see Figure 8 (a)).Color both the representatives of x T w i with the color of e i for each i ∈ { , , } . Case 3:
Case 1 and 2 do not apply.Because Case 1 and 2 do not apply, there exist i, j ∈ { , , } such that E ( P i ) ∩ E ( P j ) = ∅ , becauseotherwise E ( P ) ∩ E ( P ) ∩ E ( P ) (cid:54) = ∅ using the Helly property of trees and then any edge in this inter-section qualifies as uv of Case 1. So, without loss of generality assume that E ( P ) ∩ E ( P ) = ∅ . Also,note that E ( P ) ⊆ E ( P ) ∪ E ( P ) because otherwise Case 2 applies. So, without loss of generality assumethat E ( P ) ∩ E ( P ) (cid:54) = ∅ . But then E ( P ) ∩ E ( P ) = E ( P ) and P consists of a single edge so that Case 2does not apply. Let this edge be e . Note that e = u v . Furthermore, at least one of the end-vertices of P and P coincide so that Case 2 does not apply. Thus, assume without loss of generality that u = u .Let e be any edge in P . Without loss of generality assume that v is the closer vertex among u and v to path P in T . The two possible scenarios in this case are shown in Figure 8 (b) and (c). Color w u and w v with c ( e ) , w u and w v with c ( e ) , w u with c ( e ) and w v with c ( e ) . The following lemma follows from the way in which we have colored the edges incident on x T inColoring Rule 4. Lemma 12.
For each tree vertex x T on which Rule 4 has been applied as above, for distinct i, j ∈{ , , } , there is a rainbow path from w i to w j in G that uses only the colors from ( { c , c , c }\{ c i , c j } ) ∪ c ( T ) . Also, for any i ∈ { , , } , and any z ∈ V ( T ) , there is a rainbow path from z to w i , that uses onlythe colors from ( { c , c , c } \ { c i } ) ∪ c ( T ) . We use the following Helly property of trees: if T , T , . . . , T k are subtrees of a tree T that pairwise intersect each otheron at least one edge, then there is an edge of T that is common to all of T , T , . . . , T k . T u v u v u v w w w T T T Fig. 6: A scenario in which Coloring Rule 4 is applicable on x T . V T u u u u v v v v w w w T T T c cc c c c c Fig. 7: Case 1 of Coloring Rule 4. T e P e P e P w w w c ( e ) c ( e ) c ( e ) c ( e ) c ( e ) c ( e ) (a) T u v e P u v w w w e c ( e ) c ( e ) c ( e ) c ( e ) c ( e ) c ( e ) (b) T u v v w w w c ( e ) c ( e ) e c ( e ) c ( e ) e c ( e ) c ( e ) (c) Fig. 8: Cases 2 and 3 of Coloring Rule 4. (a)
Case 2. Note that P , P , and P are not necessarilydisjoint. (b) Case 3, scenario 1. Note that u = u and v = v . (c) Case 3, scenario 2. Note that u = u , v = u and v = v . Proof.
We demonstrate the required paths in each of the three cases of Coloring Rule 4.
Case 1:
Between w and w , there is the rainbow path w u T u u u w that uses only the colors in c ( T ) ∪ { c } . Between w and w , there is the rainbow path w v T v v v w that uses only the colors in c ( T ) ∪ { c } . Between w and w , there is the rainbow path w v T v v v w that uses only the colors in c ( T ) ∪ { c } .Now consider any vertex z ∈ V ( T ). Suppose z ∈ V . Between z and w , there is the rainbow path T zu u w that uses only the colors in c ( T ) ∪ { c } . Between z and w , there is the rainbow path T zv v w that uses only the colors in c ( T ) ∪ { c } . Between z and w , there is the rainbow path T zu u w thatuses only the colors in c ( T ).Now, suppose z ∈ V . Between z and w , there is the rainbow path T zv v w that uses only thecolors in c ( T ) ∪ { c } . Between z and w , there is the rainbow path T zv v w that uses only the colors in c ( T ) ∪ { c } . Between z and w , there is the rainbow path T zv v w that uses only the colors in c ( T ). Case 2:
First we show the path between w and w . By Observation 1, either T u u or T u v does notcontain the edge e . If T u u does not contain e , then the path w u T u u u w is a rainbow path anduses only the colors in c ( T ); otherwise (i.e., if T u v does not contain e ) then the path w u T u v v w s a rainbow path and uses only the colors in c ( T ). The required paths between w and w , and between w and w can be shown in a similar way.Now for any vertex z in T , we show the required path between z and w . By Observation 1, either T zu or T zv does not contain the edge e . If T zu does not contain e , then the path T zu u w is arainbow path and uses only the colors in c ( T ); otherwise (i.e., if T zv does not contain e ) then the path T zv v w is a rainbow path and uses only the colors in c ( T ). The required paths between w and z , andbetween w and z can be shown in a similar way. Case 3:
First we show the required path between w and w . By Observation 1, either T v u or T v v does not contain the edge e . Observe that both T v u and T v v does not contain the edge e as v iscloser than u to P , as mentioned in the Coloring Rule. Hence, if T v u does not contain e , then thepath w v T v u u w is a rainbow path that uses only the colors in { c ( e ) , c ( e ) } ∪ c ( T ); and otherwise(i.e., if T v v does not contain e ), the path w v T v v v w is a rainbow path that uses only the colorsin { c ( e ) , c ( e ) } ∪ c ( T ).Since u = u , there is the path w u w between w and w that uses only the colors in { c ( e ) , c ( e ) } .Next, we show the required path between w and w . By Observation 1, either T v u or T v v does notcontain the edge e . Let v (cid:48) be the vertex in { u , v } such that T v v (cid:48) does not contain edge e . We showthat the path w v T v v (cid:48) v (cid:48) w is the required path between w and w . We know w v is colored c ( e ) and w v (cid:48) is colored c ( e ). So, it is sufficient to show that c ( e ) and c ( e ) does not appear in T v v (cid:48) . For this,it is sufficient to prove that e and e is not in T v v (cid:48) . Since we picked v (cid:48) such that T v v (cid:48) does not contain e , it only remains to prove that e is not in T v v (cid:48) . Suppose for the sake of contradiction that e is in T v v (cid:48) . That means both v and u are in T v v (cid:48) . We know that v is closer than u to P , as mentionedin the Coloring Rule. Hence, v is closer than u to v (cid:48) in T . This also implies that v is closer than u to v (cid:48) in T v v (cid:48) . Then u is closer than v to v in T v v (cid:48) and hence also in T . But then P contains edgesthat are not in both P and P , a contradiction.Now consider any vertex z ∈ V ( T ). For each i ∈ { , } , let v (cid:48) i be the closer vertex among u i , v i to z .and let P i be the path T zv (cid:48) i v (cid:48) i w i . We show that P i is the required path from z to w i for i ∈ { , } . Thepath from z to v (cid:48) does not contain e . Also, the edge w v (cid:48) is colored with c ( e ). Hence P is a rainbowpath from z to w that uses only colors in c ( T ). Now consider path P . First consider the case when v (cid:48) = u = u . Then e is not in T zv (cid:48) , because otherwise either P contains edges that are not in P ∪ P or u is closer than v to P . Since u w is colored c ( e ), the path P satisfies the requirements. Nowconsider the case when v (cid:48) = v . Then e is clearly not in T zv (cid:48) . Since v w is colored c ( e ), the path P satisfies the requirements.Now we show the required path from z to w . By Observation 1, either T zv or T zu does not containthe edge e . Let v (cid:48) be the vertex in { u , v } such that T zv (cid:48) does not contain edge e . Then the path T zv (cid:48) v (cid:48) w is the required path between z and w , as v (cid:48) w is colored c ( e ). (cid:117)(cid:116) Path Rule 4
For each x T on which Coloring Rule 4 has been applied as above and for each P ab suchthat Q ab contains x T ( we say that the rule is being applied on the pair ( x T , P ab )) , do the following. Case 1: x T has two 2-edges incident in Q ab .Let w i and w j be the neighbors of x T in Q ab . Add to P ab the rainbow path from w i to w j as given byLemma 12. Case 2: x T has exactly one 2-edge and exactly one 1-edge incident in Q ab .Let x T w i be the 2-edge and let z be the endpoint in T of the -edge. Add to P ab the rainbow path from w i to z as given by Lemma 12. Case 3: x T is an endpoint of Q ab and has one 2-edge incident in Q ab .Let w i be the neighbor of x T in Q ab . We know one of a or b is in T . From this vertex ( a or b ,whichever is in T ) to w i , there is a rainbow path as given by Lemma 12. Add this path to P ab . T u T u T T v c c c c c (a) u T u T u T T v c c c c c c (b) u T u T T T v c c c c c c (c) Fig. 9: Three examples of Coloring Rule 5. Here c i = s ( T i ). The edges that were colored before theapplication of the rule are drawn as densely dotted lines.The following lemma follows from Lemma 12 and Path Rule 4. The proof is similar to that of Lemma 10and is omitted. Lemma 13.
Suppose for some a, b ∈ V ( G ) \ L S and for some tree T (cid:48) ∈ T , P ab contains an edge e thatwas colored with s ( T (cid:48) ) during the application of Coloring Rule 4 on some tree vertex x T . Then, T (cid:48) (cid:54) = T and Q ab does not intersect ST ( x T , x T (cid:48) ) . Lemma 14.
Invariant 1 is not violated during Path Rule 4.Proof.
Suppose for the sake of contradiction that Invariant 1 is violated during the application of PathRule 4 on the pair ( x T , P ab ) as above. Then there exist edges e and e (cid:48) in P ab having the same color. Wecan assume without loss of generality that e was colored during the application of Coloring Rule 4 on x T . This means e ∈ E (cid:48) := E ( T ) ∪ R , where R is defined as the set of representatives of w x T , w x T , and w x T . Since the application of Path Rule 4 on ( x T , P ab ) added a rainbow path to P ab , the edge e (cid:48) wasnot added during this application and hence e (cid:48) / ∈ E (cid:48) . Each color in c ( T ) have been used only in E (cid:48) sofar. That means c ( e ) = c ( e (cid:48) ) / ∈ c ( T ). Hence e ∈ E (cid:48) \ E ( T ) = R . Without loss of generality assume that e is a representative of w x T . Now, c ( e ) = s ( T j ) where j ∈ { , } . Without loss of generality assume that c ( e ) = s ( T ). This also means c ( e (cid:48) ) = s ( T ). That means e (cid:48) was colored during Coloring Rules 2, 3 or 4.Hence the following two cases are exhaustive and in each case we prove a contradiction. Case 1: e (cid:48) was colored during the application of Coloring Rules 3 or 4 on x T (cid:48) , for some tree T (cid:48) (cid:54) = T .Since P ab contains e (cid:48) , we have that Q ab contains h ( e (cid:48) ). Since e (cid:48) was colored during the application ofColoring Rules 3 or 4 on x T (cid:48) , either e (cid:48) ∈ E ( T (cid:48) ) or h ( e (cid:48) ) is incident on x T (cid:48) , and hence x T (cid:48) is in Q ab . Since Q ab does not intersect ST ( x T , x T ) by Lemmas 10 and 13, we have that x T (cid:48) is not in ST ( x T , x T ). Then dist ˜ B ( x T (cid:48) , x T ) < dist ˜ B ( x T (cid:48) , x T ). But then during the application of Coloring Rule 3 or 4 on x T (cid:48) , thecolor s ( T ) would never be used as x T (cid:54) = CT ( x T (cid:48) , v ) for any vertex v . Thus, the color of e (cid:48) is not s ( T ).But we know that c ( e (cid:48) ) = c ( e ) = s ( T ), a contradiction. Case 2: e (cid:48) was colored during the application of Coloring Rule 2.This means e (cid:48) is the representative of a 1-edge. Since e (cid:48) is colored with s ( T ), we have that h ( e (cid:48) )should either be the outgoing edge of x T or the outgoing edge of the parent of x T , from ColoringRule 2. This implies that h ( e (cid:48) ) is in ST ( x T , x T ), as the parent of x T is a non-tree edge. But then Q ab does not contain h ( e (cid:48) ) as Q ab does not intersect ST ( x T , x T ), by Lemmas 10 and 13. Thus P ab does notcontain e (cid:48) , which is a contradiction. (cid:117)(cid:116) oloring Rule 5 For each non-tree vertex u with degree at least in B (see Figure 9), let q be thenumber of children of u (note that q ≥ as degree of u is at least ), let u , u , . . . , u q be the children of u and let x T i be CT ( u, u i ) . Let uv be the outgoing edge from u in B . If uv is a -edge, due to ColoringRule 2, we know that there exist an i ∈ [ q ] such that u i is a tree vertex (and hence T i = f T ( u i )) , and uv is colored with s ( T i ) . Hence, if uv is a -edge, assume without loss of generality that u is a tree vertex ( and hence x T = u ) and that uv is colored with s ( T ) . – If u u is uncolored (then u u is a 2-edge due to Coloring Rule 2, implying that u is a tree vertexand hence T = f T ( u ) ), then color ( u u ) with s ( T ) and ( u u ) with s ( T ) . – For each ≤ i ≤ q , if u i u is uncolored (then u i u is a 2-edge due to Coloring Rule 2, implying that u i is a tree vertex and hence T i = f T ( u i ) ), then color both its representatives with s ( T i ) . – Let uv be the outgoing edge from u . If uv is uncolored (in which case it is a 2-edge due to ColoringRule 2) then color ( uv ) with s ( T ) and ( uv ) with s ( T ) . Path Rule 5
For each non-tree vertex u on which Coloring Rule 5 has been applied as above and foreach P ab such that Q ab contains u (we say that the rule is being applied on the pair ( u, P ab )) , executethe following two parts (in the mentioned order). Part 1– If Q ab contains edge u u and u u is colored during the application of Coloring Rule 5 on u , do thefollowing. If the other neighbor (if any) of u in Q ab is u , then add ( u u ) (which has color s ( T )) to P ab . Otherwise, add ( u u ) (which has color s ( T ) ) to P ab . – For each i ∈ [2 , q ] , if Q ab contains edge u i u and u i u is colored during the application of ColoringRule 5 on u , add ( u i u ) (which has color s ( T i ) ) to P ab . – If Q ab contains edge uv and uv is colored during the application of Coloring Rule 5 on u : if the otherneighbor (if any) of u in Q ab is u and u u is a -edge, then add ( uv ) (which has color s ( T ) ) to P ab ; otherwise add ( uv ) (which has color s ( T ) ) to P ab . Part 2–
For each tree vertex x T such that the degree of x T in h ( P ab ) became during the addition of aboveedges in Part 1, let x and y be the endpoints in T of the two edges of P ab incident on T . Add T xy to P ab . – For each tree vertex x T ∈ { h ( a ) , h ( b ) } such that the degree of x T in h ( P ab ) became during theaddition of above edges in Part 1, let x be the endpoint in T of the edge of P ab incident on T . If x T = h ( a ) , add T ax to P ab ; otherwise (i.e., if x T = h ( b ) ), add T bx to P ab . Lemma 15.
Invariant 1 is not violated during Path Rule 5.Proof.
Suppose Invariant 1 is violated during the application of Path Rule 5 on the pair ( u, P ab ) asabove. Then there exist edges e and e (cid:48) in P ab having the same color. We can assume without loss ofgenerality that e was colored during the application of Coloring Rule 5 on u . Suppose e was addedduring Part 2 of Path Rule 5. Observe that if we add a path inside a tree T in Part 2, then x T was incomplete before the application of Coloring Rule 5. By Invariant 3, this implies that the internal colorsof T were not used anywhere else so far. Thus, the color of e is unique, in particular c ( e (cid:48) ) (cid:54) = c ( e ), acontradiction. Thus, the edge e was not added during Part 2. Then e was added during Part 1 and hence c ( e ) = c ( e (cid:48) ) = s ( T i ) for some i ∈ [ q ]. Then e (cid:48) was colored during one of Coloring Rules 5, 4, 3, or 2. Case 1: e (cid:48) was colored during the Coloring Rule 5.Note that during the application of Path Rule 5 on ( u, P ab ), we have added at most two edges to P ab . And, if we have added two edges, they are of different color. Thus e (cid:48) was not added to P ab duringhe application of Path Rule 5 on ( u, P ab ) and hence was not colored during the application of ColoringRule 5 on u . So, e (cid:48) was colored during the application of Coloring Rule 5 on some non-tree vertex u (cid:48) (cid:54) = u .Notice that for any tree T ∈ T , s ( T ) is used during the application of Coloring Rule 5 only when therule is applied to an ancestor of x T in B . Hence, both u and u (cid:48) are ancestors of x T i . Without loss ofgenerality, assume that u (cid:48) is closer than u to x T i . Then, u cannot have any tree vertices as childrenbecause otherwise x T i (cid:54) = CT ( u, u i ). Then, the only edges colored during the application of ColoringRule 5 on u , are the representatives of uv . Thus h ( e ) = uv . Case 1.1 e = ( uv ) .We know that e = ( uv ) is colored with s ( T ) by Coloring Rule 5. Thus, c ( e (cid:48) ) = c ( e ) = s ( T ) and T i = T . Since the edge ( uv ) is added during application of Path Rule 5 on ( u, P ab ), the neighbors of u in Q ab are v and u , by Path Rule 5. Since u (cid:48) ∈ Q ab , we have that u (cid:48) is a descendant of u and not u in B . This implies T i = T (cid:54) = T , a contradiction. Case 1.2 e = ( uv ) .Since the edge ( uv ) is added during application of Path Rule 5 on ( u, P ab ), either u is not a neighborof u in Q ab , or uu is a 2-edge, by Path Rule 5. But uu cannot be a 2-edge as both u and u are non-treevertices. (Recall that we said all children of u are non-tree vertices in Case 1). Hence u is not a neighborof u in Q ab . Since u (cid:48) ∈ Q ab , this implies that T i (cid:54) = T , and hence c ( e ) = c ( e (cid:48) ) = s ( T i ) (cid:54) = s ( T ). But weknow that e = ( uv ) is colored with s ( T ), by Coloring Rule 5. Thus, we have a contradiction. Case 2: e (cid:48) was colored during the Coloring Rules 4 or 3.Let T (cid:48) be the tree on which e (cid:48) is incident. Then e (cid:48) was colored with s ( T i ) during the application ofColoring Rules 4 or 3 on x T (cid:48) . Then Q ab does not intersect ST ( T (cid:48) , T i ) due to Lemmas 13 and 10. Since x T i = CT ( u, u i ), there is no other tree-vertex in the path from u to x T i . Thus, u is in ST ( T (cid:48) , T i ). Hence, wehave that u is not in Q ab . We know that e is adjacent on u as every edge colored during the applicationof Coloring Rule 5 on u is incident on u . But then e / ∈ P ab as u is not in Q ab . This is a contradiction. Case 3: e (cid:48) was colored during the Coloring Rule 2.This means that e (cid:48) is a 1-edge. Case 3.1 h ( e (cid:48) ) = uv .In the case when uv is a 1-edge, we selected u during Coloring Rule 5 in such a way that c ( uv ) = s ( T ). Thus c ( e ) = c ( e (cid:48) = uv ) = s ( T ). The only edges that can be potentially colored with s ( T )during the application of Coloring Rule 5 on u are ( uv ) and ( uu ) . Since e and e (cid:48) are distinct we have e = ( u u ) . But since uv is in Q ab , we would have added ( u u ) and not ( u u ) to P ab during PathRule 5. Thus we have a contradiction. Case 3.2. h ( e (cid:48) ) (cid:54) = uv .Then e (cid:48) is on the path between x T i and u . Also, x T i is not a child of u . Then, the only possibilityfor e to have color s ( T i ) is if i = 2 and e = ( u u ) . Then Q ab contains both u and u . In that case, wewould have added ( u u ) and not ( u u ) to P ab during Path Rule 5. Hence, e (cid:54) = ( u u ) , a contradiction. (cid:117)(cid:116) Coloring Rule 6
For each incomplete tree vertex x T having 2-edge degree exactly : let e be the only2-edge incident on x T , pick an edge e in the foot-path of e , color the representatives of e with the colorof e . Path Rule 6
For each tree vertex x T on which Coloring Rule 6 has been applied as above and for each P ab such that Q ab contains h ( e ) (we say that the path rule is being applied on the pair ( x T , P ab ) ), do thefollowing. e e zw ( e ) c ( e )( e ) c ( e ) ( e ) c ( e )( e ) c ( e ) (a) Tuv e zw c ( e ) c ( e ) c ( e ) c ( e ) e (b) Fig. 10: Coloring Rule 7. (a)
Case 1 (b)
Case 2.
We pick vertex w as follows. If a ∈ V ( T ) , let w := a , and if b ∈ V ( T ) let w := b . (Note that both a and b cannot be in T as Q ab contains h ( e ) ). If a, b / ∈ V ( T ) then there is an edge e (cid:54) = e of Q ab incidenton x T . Furthermore, since e is the only 2-edge incident on x T , the edge e is a -edge. In this case, let w be the endpoint of ( e ) in T .By Observation 1, there is a path in T that excludes e , from w to one of the foots of e . Let this footbe z . Add the path in T between w and z to P ab . Also add to P ab the representative of e having z as itsendpoint in T . Lemma 16.
Invariant 1 is not violated during Path Rule 6.Proof.
Let E N be the set of new edges added to P ab during the application of Path Rule 6 to ( x T , P ab )and let E O be the set of already included edges in P ab before this application. Suppose Invariant 1 isviolated for the sake of contradiction. Then either there are two edges in E N with the same color or c ( E N ) ∩ c ( E O ) (cid:54) = ∅ . Recall that E N consists of E ( T wz ) and a representative of e , say ( e ) j . Note that c (( e ) j ) = c ( e ) by Coloring Rule 6. So, all the edges in E N are colored from c ( T ), the internal colors of T . Recall that e is not in T wz by our choice of z . Thus the edges in E N all have distinct colors. So, ithas to be the case that c ( E O ) ∩ c ( E N ) (cid:54) = ∅ . Since c ( E N ) ⊆ c ( T ), this implies that c ( E O ) ∩ c ( T ) (cid:54) = ∅ . Let d be an edge in E O with color in c ( T ). Since the representative of at least one edge of Q ab incident on x T (namely e ) was not added to P ab before the application of Path Rule 6, we have that E ( T ) ∩ E O = ∅ by Invariant 4. Thus d / ∈ E ( T ) but has color in c ( E ( T )) and d ∈ E O . By Invariant 3, this implies that x T was complete before the application of Coloring rule 6, making the rule not applicable on x T , acontradiction. (cid:117)(cid:116) Coloring Rule 7
For each tree vertex x T such that the 2-edge degree of x T is exactly and E ( T ) contains at least edges, let e and e be the 2-edges incident on x T , let w and z be the other endpointsof e and e , respectively, and let P and P be the foot-paths of e and e , respectively. Case 1: | E ( P ∪ P ) | ≥ . (See Figure 10 (a)).Pick distinct edges e and e (cid:48) from P and P respectively. If ( e ) and ( e ) are uncolored, color themwith color of e and if ( e ) and ( e ) are uncolored, color them with color of e (cid:48) . Case 2:
Case 1 does not hold. (See Figure 10 (b)).Clearly, P and P both are a single edge and they are the same edge. Let this edge be e = uv . Pickany other edge e (cid:48) in T (such an edge exists because we said that the rule is applicable only if E ( T ) contains at least two edges). Without loss of generality, assume that e (cid:48) is closer to v than u in T . If uw and vw are uncolored, color them with color of e . If uz and vz are uncolored, color them with colors of e (cid:48) and e , respectively. emma 17. Consider a tree vertex x T on which Coloring Rule 7 has been applied as above. There is arainbow path in G from w to z using only the colors in c ( T ) . Also, from any vertex x ∈ V ( T ) , there isa rainbow path to both w and z using only the colors in c ( T ) .Proof. If Case 2 of Coloring Rule 7 has been applied then this is rather easy to see as follows. The path wuz is a rainbow path from w to z . Also for the second statement, note that at least one of T xu or T xv avoids e . Then at least one of the paths T xu followed by uw or uz , or T xv followed by vw or vz , is arainbow path (it avoids e and if it contains e (cid:48) , then it is the second case and c ( e (cid:48) ) is used only once).So, it only remains to prove the lemma when Case 1 of Coloring Rule 7 is applied. Let w , w bethe foots of e and z , z be the foots of e . To prove the first statement, it is sufficient to prove thatat least one of the four paths T w z , T w z , T w z and T w z contains neither e nor e (cid:48) . Given this, it iseasy to show the necessary rainbow path from w to z : if the path T w i z j contains neither e nor e (cid:48) thenthe path ww i T w i z j z j z is the required path. So for the sake of contradiction assume that each T w i z j contains either e or e (cid:48) . Without loss of generality assume that T w z contains e . Let y be the last vertexon T w z that is in P (while going from w to z ). Now, T yz and T yw do not contain e and hence T z w = T yz ∪ T yw does not contain e . This implies that T z w contains e (cid:48) . Let y (cid:48) be the last vertex on T z w that is in P (while going from z to w ). Now, T y (cid:48) z and T w y (cid:48) contains neither e nor e (cid:48) and hence T w z = T y (cid:48) z ∪ T w y (cid:48) contains neither e nor e (cid:48) .To prove the second statement, observe that there is a rainbow path from x to either w or w notcontaining e , and a rainbow path from x to either z or z not containing e (cid:48) , due to Observation 1. (cid:117)(cid:116) Path Rule 7
For each tree vertex x T on which Coloring Rule 7 has been applied as above and for each P ab such that Q ab contains at least one of e and e (we say that the path rule is being applied on thepair ( x T , P ab )) , do the following.If Q ab contains both e and e then let y := w and y := z . If Q ab contains only e and not e then let y := w . If Q ab contains only e and not e then let y := z . If a ∈ V ( T ) , let y := a , and if b ∈ V ( T ) , let y := b . (Note that both a and b cannot be in T as Q ab contains e or e ). If a, b / ∈ V ( T ) and only one of e , e is in Q ab , then there is an edge e (cid:48)(cid:48) / ∈ { e , e } incident on x T in Q ab ; and since e and e are the only 2-edges incident on x T , the edge e (cid:48)(cid:48) is a -edge; let y be the endpoint of ( e (cid:48)(cid:48) ) in T .Add to P ab the path between y and y given by Lemma 17. Lemma 18.
Invariant 1 is not violated during Path Rule 7.Proof.
Let E N be the set of new edges added to P ab during the application of Path Rule 7 to ( x T , P ab )and let E O be the set of already included edges in P ab before this application. Suppose Invariant 1 isviolated for the sake of contradiction. Then either there are two edges in E N with the same color or c ( E N ) ∩ c ( E O ) (cid:54) = ∅ . By Lemma 17, all edges in E N are colored from c ( T ) and have distinct colors. So,it has to be the case that c ( E O ) ∩ c ( E N ) (cid:54) = ∅ . Since c ( E N ) ⊆ c ( T ), this implies that c ( E O ) ∩ c ( T ) (cid:54) = ∅ .Let d be an edge in E O with color in c ( T ). The representative of at least one edge of Q ab incident on x T was not in P ab before the application of Path Rule 7 on ( x T , P ab ), because otherwise the path ruleis not applicable on ( x T , P ab ). Then, by Invariant 4, we have that E ( T ) ∩ E O = ∅ . Thus d / ∈ E ( T ) buthas color in c ( E ( T )) and d ∈ E O . But then by Invariant 3, we have that x T was completed before theapplication of Coloring Rule 7, thereby making the rule not applicable on x T , which is a contradiction. (cid:117)(cid:116) Coloring Rule 8
For each incomplete tree vertex x T having degree at least in B : We can assumethat Coloring Rules 3, 4, 6, 7 are not applicable on x T as otherwise x T would have been completed. If x T had at least three 2-edges incident on it, then Coloring Rule 3 or 4 would have been applicable on x T . u vwy zc c c c c c (a) T u vyz c c c c c c (b) Fig. 11: Coloring Rule 8. (a)
Case 1 where c = s ( T ) and c = c ( uv ). (b) Case 2 where c = c ( uv ) and c is the color of the representative of an arbitrarily chosen 1-edge incident on x T . If it had 2-edge degree , then Coloring Rule 6 would have been applicable on x T . If it had 2-edge degree , then it would have been completed after Coloring Rule 2. Hence, we can assume that x T has 2-edgedegree exactly . Now, if | E ( T ) | ≥ , Coloring Rule 7 becomes applicable on x T . Hence, we can assumethat the tree T is just an edge. Let uv be this edge. Let the two 2-edges incident on x T be yx T and zx T . Case 1:
Both yx T and zx T are incoming to x T (see Figure 11 (a)).Then the outgoing edge of u in B is a -edge, say x T w . Assume without loss of generality that itsrepresentative is vw . Let c = s ( T ) and c be the color of uv . Note that vw is colored with c due toColoring Rule 2. If yu and yv are uncolored, color them with c and c respectively. If zu and zv areuncolored, color both of them with c . Case 2:
One of the 2-edges, say yx T is outgoing from x T (see Figure 11 (b)).Let c be the color of uv and c be the color of representative of any -edge incoming on x T . Notethat at least one such -edge exists as the degree of x T is at least . If yu and yv are uncolored, colorthem with c and c respectively. If zu and zv are uncolored, color both of them with c . Path Rule 8
For each tree vertex x T on which Coloring Rule 8 has been applied as above and for each P ab such that Q ab contains at least one of yx T and zx T (we say that the path rule is being applied onthe pair ( x T , P ab ) ), do the following: – If Q ab contains both yx T and zx T then add yu and uz to P ab . – If Q ab contains only yx T and not zx T then let y := y . If Q ab contains only zx T and not yx T thenlet y := z . If a ∈ V ( T ) , let y := a , and if b ∈ V ( T ) let y := b . (Note that both a and b cannotbe in T as Q ab contains yx T or zx T ). If a, b / ∈ V ( T ) and only one of yx T , zx T is in Q ab then thereis an edge e (cid:48)(cid:48) / ∈ { yx T , zx T } incident on x T in Q ab . Further, since yx T and zx T are the only 2-edgesincident on x T , the edge e (cid:48)(cid:48) is a -edge. Note that ( e (cid:48)(cid:48) ) is already added to P ab in Path rule 2. Let y be the endpoint of ( e (cid:48)(cid:48) ) in T .Note that in all cases y ∈ { u, v } and y ∈ { y, z } . Hence, the edge y y exists. Add the edge y y to P ab . Lemma 19.
Invariant 1 is not violated during Path Rule 8.roof.
Suppose the invariant is violated. Then there exist edges e and e (cid:48) in P ab having the same color.We can assume without loss of generality that e was colored during the application of Coloring Rule 8on ( x T , P ab ). We added at most two edges during the application of Path Rule 8 on x T and if we addedtwo edges we have made sure they have distinct colors. Thus e (cid:48) was not added during the applicationof Path Rule 8 on ( x T , P ab ). The colors that are possible for e are c , c and c according to ColoringRule 8. Case 1: c ( e ) = c ( e (cid:48) ) = c .Recall c = c ( uv ). If e (cid:48) = uv , then by Invariant 4, the representatives of all the edges of Q ab incidenton x T are in P ab even before the application of Path Rule 8 on ( x T , P ab ). Then Path Rule 8 is notapplicable on ( x T , P ab ). Thus e (cid:48) / ∈ E ( T ) but c ( e (cid:48) ) ∈ c ( E ( T )). Then by Invariant 3, x T was completedbefore the application of Coloring Rule 8, making the rule not applicable on x T . Thus, such an e (cid:48) doesnot exist. Case 2: c ( e ) = c ( e (cid:48) ) = c = s ( T ).This means e = yu and that Case 1 of Coloring Rule 8 (see Figure 11 (a)) was applied on x T . Theonly coloring rules so far that use surplus colors are Coloring Rules 8, 5, 4, 3, and 2. Case 2.1 e (cid:48) was colored during Coloring Rule 2.Note that this means e (cid:48) is a 1-edge and the only way e (cid:48) can have color s ( T ) is if e (cid:48) = vw . But, inPath Rule 8, we add yu = e to P ab only when vw is not in Q ab . Thus we have a contradiction. Case 2.2 e (cid:48) was colored during Coloring Rules 4 or 3.Let T (cid:48) be the tree on which e (cid:48) is incident. Since e (cid:48) was colored with s ( T ) during Coloring Rules 4or 3, we know that Q ab does not intersect ST ( x T (cid:48) , x T ) due to Lemmas 13 and 10. Then Q ab does notcontain x T and hence P ab does not contain e , which is a contradiction. Case 2.3 e (cid:48) was colored during Coloring Rule 5.Then h ( e (cid:48) ) is a 2-edge in the path from x T to root of B . Since e (cid:48) is in Q ab , this means that x T w isin Q ab . But then by Path Rule 5, we would have added yv instead of yu = e to P ab , a contradiction. Case 2.4 e (cid:48) was colored during Coloring Rule 8.The only application of Coloring Rule 8 that uses s ( T ) is the application on x T . But since e (cid:48) was notcolored during this application, we have a contradiction. Case 3: c ( e ) = c ( e (cid:48) ) = c .This means e = uy and that Case 2 of Coloring Rule 8 was applied on x T . Let x be the neighborof x T such that xx T is the 1-edge incident on x T whose representative is colored with c . By ColoringRule 2, there exist a tree T (cid:48) that is a descendant of x such that s ( T (cid:48) ) = c . The only coloring rules sofar that use surplus colors are Coloring Rules 8, 5, 4, 3, and 2. Case 3.1 e (cid:48) was colored during Coloring Rule 2.This means e (cid:48) is a 1-edge. Since xx T is the only 1-edge with color s ( T (cid:48) ) by Lemma 8, we have that e (cid:48) = xx T . Hence, xx T is in Q ab . But if xx T is in Q ab , we would have added vy and not uy in Path Rule 8.This is a contradiction to e = uy . Case 3.2 e (cid:48) was colored during Coloring Rules 4 or 3.Let T (cid:48)(cid:48) be such that e (cid:48) is adjacent on x T (cid:48)(cid:48) . Since e (cid:48) was colored with s ( T (cid:48) ) during Coloring Rules 4or 3, we have that Q ab does not intersect ST ( x T (cid:48)(cid:48) , x T (cid:48) ) due to Lemmas 13 and 10. Since P ab contains e that is incident on x T , we have that Q ab contains x T . This implies that x T / ∈ ST ( x T (cid:48)(cid:48) , x T (cid:48) ) implying that x T (cid:48)(cid:48) is on the path between x T and x T (cid:48) . But then s ( T (cid:48)(cid:48) ) and not s ( T (cid:48) ) would have been used to color xx T , a contradiction. Case 3.3 e (cid:48) was colored during Coloring Rule 5 or 8.ince e (cid:48) is colored with s ( T (cid:48) ), by Coloring Rule 5 and 8 this implies e (cid:48) is in ST ( x T , x T (cid:48) ) = ST ( x T , x ),implying that Q ab contains x . But then we would have added vy and not uy = e to P ab according toPath Rule 8, a contradiction. (cid:117)(cid:116) The following Lemma follows from the previous coloring rules.
Lemma 20.
Consider an edge e in B that remains uncolored after the application of Coloring Rules 1through 8. Let x T and v be the endpoints of e (Note that due to Coloring Rule 2, e is a -edge, andhence one of its endpoints is a tree-vertex). Then, both x T and v have degree exactly in B , both edgesincident on x T are 2-edges, and T consists of a single edge.Proof. Suppose u ∈ { v, x T } had degree not equal to 2 in B . First, suppose the degree was greater than2. Then Coloring Rule 8 or 5 would have been applicable on u , and hence u would have been completed.Therefore, u has degree 1 in B . By Corollary 3, every leaf of B is a tree vertex. Hence, u is a treevertex and u = x T . But then Coloring Rule 6 would have been applicable on x T , and x T would havebeen completed. Thus, e is already colored, which is a contradiction. Hence, x T and v have degree 2 in B .Now, suppose x T has only one 2-edge incident in B . Then, Coloring Rule 6 would have been appliedon x T and x T would have been completed. Thus, both edges incident on x T in B are 2-edges. If T contained at least two edges, Coloring Rule 7 would have been applied on x T and x T would have beencompleted. Hence, T contains only one edge. (cid:117)(cid:116) Coloring Rule 9
For each tree vertex x T with exactly one uncolored 2-edge e incident on it: note thatit follows by Lemma 20 that the tree T comprises of a single edge e (cid:48) . Let e = vx T and e (cid:48) := u u . Color ( e ) = vu and ( e ) = vu with the color of e (cid:48) . Path Rule 9
For each tree vertex x T on which Coloring Rule 9 has been applied as above and for each P ab such that Q ab contains e (we say that the path rule is being applied on the pair ( x T , P ab ) ), do thefollowing:First we pick vertex w ∈ V ( T ) = { u , u } as follows: if a ∈ V ( T ) , let w := a ; if b ∈ V ( T ) let w := b ;(note that both a and b cannot be in T as Q ab contains e ); if a, b / ∈ V ( T ) then there is an edge e (cid:54) = e of Q ab incident on x T ; furthermore, since e is the only uncolored edge incident on x T , a representativeof the edge e is already in P ab ; let w be the endpoint in T of this representative of e .Add vw to P ab . Lemma 21.
Invariant 1 is not violated during Path Rule 9.Proof.
The edge added to P ab during the application of Path Rule 9 to ( x T , P ab ) has color c ( e (cid:48) ) ∈ c ( T ).If the invariant is violated, then there was an edge e (cid:48)(cid:48) in P ab already with color c ( e (cid:48) ). By Invariant 4 e (cid:48) was not already in P ab as the edge e incident on x T is in Q ab and the representative of e was not addedto P ab before. Thus e (cid:48)(cid:48) (cid:54) = e (cid:48) but c ( e (cid:48)(cid:48) ) = c ( e (cid:48) ). Since x T was incomplete before the application of currentcoloring rule, by Invariant 3, none of the colors in c ( T ) were used before anywhere outside of T . So, suchan e (cid:48)(cid:48) does not exist, a contradiction. (cid:117)(cid:116) Lemma 22.
Consider a 2-edge e incident on tree vertex x T that remains uncolored after the applicationof Rules 1 to 9. Then, x T has degree exactly in B , T contains only one edge, and the other edge incidenton x T is an uncolored 2-edge.Proof. By Lemma 20 it follows that x T has degree exactly 2 in B , T contains only one edge, and theother edge incident on x T is a 2-edge. If this other 2-edge is colored, then Coloring Rule 9 would havebeen applied on x T and x T would have been completed. (cid:117)(cid:116) u u v v T w e ( e ) s ( T )( e ) s ( T )( e ) c ( e )( e ) c ( e ) Fig. 12: Coloring Rule 10
Coloring Rule 10
For each incomplete tree vertex x T whose parent’s outgoing edge is a 2-edge: (SeeFigure 12 for an Illustration). Let v be the parent of x T . From Lemma 22, it follows that x T has degreeexactly in B , has one incoming and one outgoing 2-edge incident on it, both the 2-edges are uncolored,and the tree T is just a single edge. Let e and e respectively be the outgoing and incoming 2-edges of x T . Let e be the only edge in T . Let v be the other end point of e . Let u be the endpoint of ( e ) and ( e ) in T . Let u be the endpoint of ( e ) and ( e ) in T . From Lemma 20, we know that v and v have degree exactly . Let v x T (cid:48) be the outgoing -edge from v and let wv be the incoming edge on v in B .Color ( e ) and ( e ) with the color of e , and color ( e ) and ( e ) with s ( T ) . Path Rule 10
For each tree vertex x T on which Coloring Rule 10 has been applied as above and foreach P ab such that Q ab contains e or e (we say that the path rule is being applied on the pair ( x T , P ab )) ,do the following. – If Q ab contains both e and e , add v u and u v to P ab . – If Q ab contains exactly one edge among e and e , then either a or b is in V ( T ) . Also both of themcannot be in V ( T ) . Let z be the one among a or b that is in V ( T ) . If Q ab contains e , add v z to P ab ; otherwise, i.e., if Q ab contains e , add v z to P ab . Lemma 23.
Invariant 1 is not violated during Path Rule 10.Proof.
Suppose for the sake of contradiction that the invariant is violated. Then there exist distinctedges d and d in P ab having the same color. We can assume without loss of generality that d wascolored during the application of Coloring Rule 10 on x T . We added at most two edges during theapplication of Path Rule 10 on x T , and in the cases where we added two edges, the two edges havedistinct colors. Thus, d was not added during the application of Path Rule 10 on x T and hence wasnot colored during the application of Coloring Rule 10 on x T .The colors that are possible for d are s ( T ) and c ( e ). Case 1: c ( d ) = c ( d ) = c ( e ).This is not possible since the color of e has not been used to color any other edges so far by Invariant 3,and e is not in P ab by Invariant 4. Case 2: c ( d ) = c ( d ) = s ( T ).This means h ( d ) = v x T . The only coloring rules so far that use the surplus colors of trees areColoring Rules 2, 3, 4, 5, 8, and 10. Hence, d was colored with s ( T ) during one of them. Case 2.1 d was colored during Coloring Rule 2.his means that d is a 1-edge. According to Coloring Rule 2, the only 1-edge that can be coloredwith s ( T ) is either the outgoing edge of x T or the outgoing edge of the parent of x T . However, both ofthem are 2-edges and hence we have a contradiction. Case 2.2 d was colored during Coloring Rules 4 or 3.Let T (cid:48)(cid:48) be such that d is adjacent on x T (cid:48)(cid:48) . Then, by Lemmas 13 and 10, we know that Q ab does notintersect ST ( x T (cid:48)(cid:48) , x T ), in particular Q ab does not contain x T . Since h ( d ) = v x T , this implies P ab doesnot contain d , which is a contradiction. Case 2.3 d was colored during application of Coloring Rule 5.From Coloring Rule 5, this implies that d was colored during application of Coloring Rule 5 on someancestor v (cid:48) of x T such that there are no other tree vertices in the path from x T to v (cid:48) . Then, the onlypossibility for v (cid:48) is v as the parent of v is a tree vertex. However, we know that v has degree 2 in B ,and hence Coloring Rule 5 could not have been applied on v . Thus, we have a contradiction. Case 2.4 d was colored during application of Coloring Rule 8.Since d is colored with s ( T ) during Coloring Rule 8, Case 1 of the rule (see Coloring Rule 8) wasapplied on x T and hence the outgoing edge from x T is a 1-edge. However, this is a 2-edge and hence wehave a contradiction. Case 2.5 d was colored during Coloring Rule 10.Since d was not colored during the application of Coloring Rule 10 on x T , we have that d wascolored during the application of Coloring Rule 10 on some x T (cid:48)(cid:48) (cid:54) = x T . But then d is not colored with s ( T ), a contradiction. (cid:117)(cid:116) Coloring Rule 11
For each incomplete tree vertex x T : from Lemma 22, it follows that x T has degreeexactly in B , has one incoming and one outgoing 2-edge incident on it, both the 2-edges are uncolored,and the tree T is just a single edge. Let e and e respectively be the outgoing and incoming 2-edges of x T . Let v be the other end point of e and v be the other end point of e . Let e = u u be the onlyedge in T . Without loss of generality, u be the endpoint of ( e ) and ( e ) in T , and u be the endpointof ( e ) and ( e ) in T . From Lemma 20, we know that v and v have degree exactly . Let v y bethe outgoing edge from v and wv be the incoming edge on v in B . We have that v y is a -edgebecause otherwise Coloring Rule 10 would have been applicable on x T , and x T would have been alreadycompleted. Case 1:
There is an edge between v and v in G . (See Figure 13 (a) for an illustration).Color the representatives of e and e with c ( e ) . Color v v with c ( e ) . We say that v v is a shortcutedge . Note that shortcut edges are the only colored edges in G that are not representatives of edges in B . Case 2:
Case 1 does not apply. (See Figure 13 (b) for an illustration).We will prove in Lemma 30 that wv is a 2-edge in this case. Let T (cid:48) = f T ( w ) . Color ( e ) and ( e ) with s ( T (cid:48) ) and color ( e ) and ( e ) with color of e . Path Rule 11
For each tree vertex x T on which Coloring Rule 11 has been applied as above and foreach P ab such that Q ab contains e or e (we say that the path rule is being applied on the pair ( x T , P ab )) ,do the following. – If Q ab contains both e and e : if v v ∈ E ( G ) , add v v to P ab ; otherwise add v u and v u to P ab . – If Q ab contains exactly one edge among e and e , then either a or b is in V ( T ) . Also, both of themcannot be in V ( T ) . Let z be the one among a or b that is in V ( T ) . If Q ab contains e , add v z to P ab . If Q ab contains e , add v z to P ab . u u v v ywe ( e ) c ( e ) ( e ) c ( e )( e ) c ( e ) ( e ) c ( e ) c ( e ) (a) T u u v v y T e ( e ) s ( T ) ( e ) s ( T )( e ) c ( e ) ( e ) c ( e ) (b) Fig. 13: Coloring Rule 11. (a)
Case 1; here the edge v v is drawn as a thick dotted line to highlightthat it is not in B , and the edge wv is drawn with one solid line and one dotted line to denote that itcould be a 1-edge or a 2-edge (b) Case 2; here w = x T (cid:48) Lemma 24.
Invariant 1 is not violated during Path Rule 11.Proof.
Suppose for the sake of contradiction that the invariant is violated. Then there exist distinctedges d and d in P ab having the same color. We can assume without loss of generality that d wascolored during the application of Coloring Rule 11 on x T . We added at most two edges during theapplication of Path Rule 11 on x T , and in the cases where we added two edges, the two edges havedistinct colors. Thus d was not added during the application of Path Rule 11 on x T and hence was notcolored during Coloring Rule 11 on x T .The colors that are possible for d are c ( e ) and s ( T (cid:48) ). Case 1: c ( d ) = c ( d ) = c ( e ).This is not possible since the color of e has not been used to color any other edges so far by Invariant 3,and e is not in P ab by Invariant 4. Case 2: c ( d ) = c ( d ) = s ( T (cid:48) ).This means h ( d ) = e and that Case 2 of Coloring Rule 11 was applied on x T . The only coloringrules so far that use the surplus colors of trees are Coloring Rules 2, 3, 4, 5, 8, 10, and 11. Hence, d was colored with s ( T (cid:48) ) during one of them. Case 2.1 d was colored during Coloring Rule 2.This means d is a 1-edge and h ( d ) is either x T (cid:48) v or v x T . But since both x T (cid:48) v and v x T are2-edges (since Case 2 of Coloring Rule 11 was applied on x T ), this is not possible. Case 2.2 d was colored during Coloring Rules 4 or 3. z T (a) vz T (b) Fig. 14: An illustration of the proof of Lemma 25. The densely dotted edges denote the edges of H thatare not in B . (a) The scenario given by the precondition of the lemma, and (b) the transformation tonew skeleton B (cid:48) as described in the proof.Let T (cid:48)(cid:48) be the tree such that d is adjacent on x T (cid:48)(cid:48) . By Lemmas 13 and 10, we know that Q ab does notintersect ST ( x T (cid:48)(cid:48) , x T (cid:48) ). Then x T is not in ST ( x T (cid:48)(cid:48) , x T (cid:48) ). This implies x T (cid:48)(cid:48) is in the path from x T to x T (cid:48) .But the only vertex in the path from x T to x T (cid:48) is v , a non-tree vertex. Thus, we have a contradiction. Case 2.3 d was colored during application of Coloring Rule 5.From Coloring Rule 5, this implies that d was colored during application of Coloring Rule 5 on someancestor v (cid:48) of x T (cid:48) such that there are no other tree vertices in the path from x T (cid:48) to v (cid:48) . Then, the onlypossibility for v (cid:48) is v as the parent of v is a tree vertex. However, we know that v has degree 2 in B ,and hence Coloring Rule 5 could not have been applied on v . Thus, we have a contradiction. Case 2.4 d was colored during application of Coloring Rule 8.Since d is colored with s ( T (cid:48) ) during Coloring Rule 8, Case 1 of the rule (see Coloring Rule 8) wasapplied on x T (cid:48) and hence the outgoing edge from x T (cid:48) is a 1-edge. However, this is a 2-edge and hencewe have a contradiction. Case 2.5 d was colored during application of Coloring Rule 10.Since c ( d ) = s ( T (cid:48) ), from Coloring Rule 10 we get that d was colored during the application ofColoring Rule 10 on x T (cid:48) . In Lemma 31, we will prove that Coloring Rule 10 was not applied on x T (cid:48) .Thus, we have a contradiction. Case 2.6 d was colored during application of Coloring Rule 11.Since c ( d ) = s ( T (cid:48) ), from Coloring Rule 11, we get that d was colored during the application ofColoring Rule 11 on x T . Moreover, h ( d ) = e . Recall that we have h ( d ) = e too. Since we picked onlyone representative of e into P ab by Path Rule 11, we have that d = d . This is a contradiction to thefact that d and d are distinct. (cid:117)(cid:116) Now we proceed towards proving Lemmas 30 and 31 that were used above. For this we need to provesome auxiliary lemmas first.
Lemma 25.
Let v be a non-tree vertex and x T be a tree-vertex that is a descendant of v in B . If vx T is a -edge in H then x T is a child of v in B .Proof. See Figure 14 for an illustration of the proof. Suppose x T is not a child of v in B . Let x T z be theoutgoing edge of x T in B . Let B (cid:48) be the skeleton obtained by deleting x T z from B and adding x T v .Going from B to B (cid:48) , the number of 2-edges is non-decreasing, the degree of v increases, the degree of z decreases, and the degree of all other vertices remains same. Since v is at a smaller level than z in both yv T (a) T yv T (b) Fig. 15: An illustration of the transformation in the proof of Lemma 26. The densely dotted edges denotethe edges of H that are not in B . (a) The scenario given by the precondition of the lemma, and (b) thetransformation to the new skeleton B (cid:48) as described in the proof. B and B (cid:48) , B (cid:48) has lexicographically higher configuration vector than B . Thus we have a contradictionto the choice of B . (cid:117)(cid:116) Lemma 26.
Let x T be a vertex on which Coloring Rule 11 is being applied. Let v be as defined inColoring Rule 11. The vertex v has no 2-edge in H to any vertex except x T .Proof. See Figure 15 for an illustration of the proof. Suppose for the sake of contradiction that v has a2-edge in H to a tree vertex x T ∈ V ( H ) \ { x T } . The edge v y is a 1-edge as otherwise Coloring Rule 10would have been applicable on x T and x T would have been completed already. Thus x T (cid:54) = y . Then theedge v x T is not in B as y and x T are the only neighbors of v in B . Since x T is a tree vertex, itis not in L S (recall that L S is the set of non-tree vertices of H ). Thus, since the edge v x T is not in B , it is not in B also (recall B = B \ L S ). Thus, v x T ∈ E ( H ) \ E ( B ). Also x T is not a descendantof v due to Lemma 25. Thus, x T ∈ ST ( v , y ). Then, by deleting the 1-edge v y from B and addingthe 2-edge v x T , we get a skeleton B (cid:48) that has a higher number of 2-edges than B and hence has alexicographically higher configuration vector. Thus we have a contradiction to the choice of B . (cid:117)(cid:116) Lemma 27.
Let x T be a vertex on which Coloring Rule 11 is being applied. Let v , w be as defined inColoring Rule 11. Then, v has no 2-edge in H to any vertex in V ( H ) \ { w, x T } .Proof. See Figure 16 for an illustration of the proof. Suppose for the sake of contradiction that v hasa 2-edge in H to a tree vertex x T ∈ V ( H ) \ { x T , w } . Then the edge v x T is not in B as the onlyneighbors of v in B are x T and w . Since x T is a tree vertex, it is not in L S (recall that L S is the set ofnon-tree vertices of H ). Thus, since the edge v x T is not in B , it is not in B also (recall B = B \ L S ).Thus, v x T ∈ E ( H ) \ E ( B ). Also x T is not a descendant of v due to Lemma 25. Clearly, then x T ∈ ST ( v , x T ). Since x T (cid:54) = x T , and the degree of x T and v in B is 2, we have that the edge v y is on the path from v to x T in B . Then, by deleting the 1-edge v y from B and adding the 2-edge v x T , we get a skeleton B (cid:48) that has a higher number of 2-edges and hence has a lexicographically higherconfiguration vector. Thus we have a contradiction to the choice of B . (cid:117)(cid:116) Lemma 28.
Let v be a non-tree vertex having degree in B such that the neighbors of v in B are atree-vertex x T and a vertex x (cid:48) , and the tree T consists of a single edge u u . If v does not have a -edgeto any tree-vertex except x T in H , then v does not have edges to any tree vertex in H except x T . yv T v w (a) T yv T v w (b) Fig. 16: An illustration of the transformation in the proof of Lemma 27. The densely dotted edges denotethe edges of H that are not in B and the edge wv is drawn with 1 solid line and 1 dotted line to denotethat it could be a 1-edge or a 2-edge. (a) The scenario given by the precondition of the lemma, and (b) the transformation to the new skeleton B (cid:48) as described in the proof. x v T u u T (a) x v T u u (b) Fig. 17: An illustration of the transformation in the proof of Lemma 28. The densely dotted edges denotethe edges of H that are not in B . (a) The scenario given by the precondition of the lemma, and (b) the transformation to the new forest F (cid:48) as described in the proof where T is removed and a new treeincluding v, u and the vertices of T are added. Proof.
See Figure 17 for an illustration. Suppose v has an edge in H to a tree vertex x T (cid:54) = x T . Note that vx T is not a 2-edge by assumption. Thus vx T is a 1-edge. We define the forest F (cid:48) as F (cid:48) := ( F \{ u } ) ∪{ v } and F (cid:48) := G [ F (cid:48) ]. We prove that F (cid:48) is a forest with fewer trees than F , which is a contradiction to thechoice of F . (Recall that out of all maximum induced forests, we picked F to be one having the fewestnumber of trees).First, we prove that F (cid:48) is indeed a forest. Suppose for the sake of contradiction that there is a cycle C in F (cid:48) . The cycle C has to contain v because otherwise C is also a cycle in F . The cycle C can intersectat most one tree in T as there are no edges across the trees. Let this tree be T . Then v should havetwo edges to T in C in order to complete the cycle. We know that v does not have 2-edges to any treein T \ { T } by assumption. Hence T = T . But, since | V ( T ) ∩ F (cid:48) | = 1, v can only have one edge in C to T . Thus, we have a contradiction. Hence, F (cid:48) is indeed a forest.Now, we show that the number of trees in F (cid:48) is smaller than that of F . Let T be the set of treesin T \ { T } that have an edge from v in G . Clearly, T ∈ T and hence |T | ≥
1. The vertex set u , v } ∪ (cid:83) T (cid:48)(cid:48) ∈T V ( T (cid:48)(cid:48) ) induces a tree in G . Hence, the number of trees in F (cid:48) is at most |T \ ( T ∪{ T } ) | + 1 ≤ |T | − |T | ≤ |T | − (cid:117)(cid:116) Lemma 29.
Let x T be a vertex on which Coloring Rule 11 is being applied. Let v , v , y, w be as definedin Coloring Rule 11.1. v has no edge in H to any tree vertex except x T (which also implies that y is a non-tree vertex),and2. if wv is a -edge, vertex v has no edge in H to any tree vertex except x T (which also implies that w is a non-tree vertex in this case).Proof. The first statement follows from Lemmas 26, and 28 and the fact that v y is a 1-edge. The secondstatement follows from Lemmas 27 and 28. (cid:117)(cid:116) Lemma 30.
Let x T be a vertex on which Coloring Rule 11 is being applied and suppose the preconditionof Case of the rule is not satisfied. Let v and w be as defined in Coloring Rule 11. Then, wv is a2-edge.Proof. Suppose for the sake of contradiction that wv is a 1-edge. Let v , u , u be also as given inColoring Rule 11 (see Figure 13). Let F (cid:48) = ( F \ { u } ∪ { v , v } ). Let F (cid:48) = G [ F (cid:48) ]. We will show that F (cid:48) is a forest. Then since | F (cid:48) | > | F | , we have that F is not a maximum induced forest, a contradiction.Suppose for the sake of contradiction that there is a cycle C in F (cid:48) . Case 1: C intersects more than two trees of T .Since there are only two vertices in F (cid:48) that are not in any tree in T , there have to be two vertices in 2different trees of T that are adjacent in C . This is a contradiction as the trees are connected componentsof F and therefore have no edges between them in G . Case 2: C intersects exactly two trees of T .Let T and T be the trees that C intersects. Since wv is a 1-edge, by Lemma 29, we have thatboth v and v are not adjacent in H to any tree vertex except x T . Hence, at least one of T and T has no edges to v and v . This means that there should be an edge in C between T and T . This is acontradiction as T and T are connected components of F and therefore have no edges between themin G . Case 3: C intersects exactly one tree of T .Let T be the tree that C intersects. By Lemma 29, we have that v and v do not have an edge toany tree vertex in B except x T . Hence, T = T . Since only one vertex of T is in F (cid:48) , v and v both canhave at most one edge to T in C . This means v and v should be adjacent in C to complete the cycle.Thus, the precondition of Case 1 of Rule 11 is satisfied, a contradiction to our assumption. (cid:117)(cid:116) Lemma 31.
Let x T be a vertex on which Coloring Rule 11 is being applied and suppose the preconditionof Case of the rule is not satisfied. Let T (cid:48) be as defined in Coloring Rule 11 (see Figure 13b). Then, x T (cid:48) is not a vertex on which Coloring Rule 10 was applied.Proof. Suppose for the sake of contradiction that Coloring Rule 10 was applied on x T (cid:48) . Then x T (cid:48) hasdegree 2 in B and T (cid:48) consists of a single edge. Let this edge be u u (see Figure 18a). Observe that therepresentatives of the outgoing edge of x T (cid:48) are u v and u v . Let F (cid:48) := ( F \ { u , u } ∪ { v , v } ) and F (cid:48) := G [ F (cid:48) ]. Note that | F (cid:48) | = | F | . We will show that F (cid:48) is a forest with fewer trees than F , therebyshowing a contradiction to the choice of F . (Recall that out of all maximum induced forests, we picked F to be one having the fewest number of trees). u u v v ye ( e ) s ( T ) ( e ) s ( T )( e ) c ( e ) ( e ) c ( e ) u u T (a) u u v v ye ( e ) s ( T ) ( e ) s ( T )( e ) c ( e ) ( e ) c ( e ) u u (b) Fig. 18: An illustration of the transformation in the proof of Lemma 31. (a)
The initial scenario beforetransformation, and (b) the transformation to the new forest F (cid:48) as described in the proof where T and T (cid:48) are removed and a new tree including u , u , v , v is added, thereby reducing the number of trees.irst, we show that F (cid:48) is indeed a forest. Suppose for the sake of contradiction that there is a cycle C in F (cid:48) . Case 1: C intersects more than two trees of T .Since there are only two vertices in F (cid:48) that are not in any tree in T , there have to be two verticesin two different trees of T that are adjacent in C . This is a contradiction as the trees are connectedcomponents of F and therefore have no edges between them in G . Case 2: C intersects exactly two trees of T .Let T and T be the trees that C intersects. Then in order to complete the cycle C , there shouldbe at least one edge from each of v and v to each of the trees T and T . This implies v has edges toeach of x T and x T in H . But, by Lemma 29, we have that v does not have an edge to any tree vertexin H except x T . Therefore, x T = x T , implying that T = T , implying that C intersects only one tree,a contradiction. Case 3: C intersects exactly one tree of T .Let T be the tree that C intersects. Since the precondition of Case 1 of Rule 11 is not satisfied, v and v are not adjacent in G . Hence, only one of them is in C . Case 3.1 v is in C .Then, v should have two edges in C to T in order to complete the cycle. This means that v hasa 2-edge to x T in H . By Lemma 29, we have that v does not have an edge in H to any tree vertexexcept x T . Hence, T = T . Since only one vertex of T is in F (cid:48) , v can have at most one edge to T in C .Thus we have a contradiction. Case 3.2 v is in C .Then, v should have two edges in C to T in order to complete the cycle. This means that v has a2-edge to x T in H . By Lemma 27, we have that v does not have an edge in H to any tree vertex in B except x T and x T (cid:48) . Hence, T ∈ { T, T (cid:48) } . However, since only one vertex of each T and T (cid:48) is in F (cid:48) , v can have at most one edge to each of T and T (cid:48) in C . Hence, v has at most one edge to T in G . Thus,we have a contradiction.Thus, we have proved that F (cid:48) is indeed a forest. Now, we prove that F (cid:48) has fewer trees than F ,which concludes the proof. Let T be the set of trees in T \ {
T, T (cid:48) } that have an edge from v or v in G . The vertex set { v , u , v , u } ∪ (cid:83) T (cid:48)(cid:48) ∈T V ( T (cid:48)(cid:48) ) induces a tree in G . Hence, the number of trees in F (cid:48) is at most |T \ ( T ∪ { T, T (cid:48) } ) | + 1 ≤ |T | − (cid:117)(cid:116) Thus we have proved the Lemmas that we used in Coloring Rule 11.By the end of Coloring Rule 11, we have colored the representatives of all edges in B . We may havealso colored some additional edges of G that are not in B , namely the shortcut edges (during ColoringRule 11). We next show that the vertices in B are now rainbow connected through these colored edges. Lemma 32.
For any pair of vertices v , v ∈ V ( G ) \ L S , P ab is a rainbow path between v and v in G and uses only colors in [ f ] .Proof. There are no more incomplete tree-vertices because Coloring Rule 11 is applicable on each in-complete tree-vertex and each tree-vertex on which the rule is applied is completed during the rule. Thismeans there are no uncolored 2-edges in B . Also, Coloring Rule 2 colors all 1-edges in B . Thus, eachedge in B , and hence their representatives in G , have been colored.Whenever an edge in B is colored by a coloring rule and if it is in Q ab , we have added exactly one ofits representatives to P ab in the proceeding path rule, except possibly Path Rule 11 where we might haveadded a shortcut edge instead. In the case when a shortcut edge is added, the shortcut edge shortcutshe two consecutive edges in Q ab whose representatives were not added to P ab and hence the path is notbroken.Also, whenever a tree T has two edges of P ab incident on it, we have added the path between theendpoints of the edges in the tree to P ab . And, whenever a tree T with a ∈ V ( T ) has one edge of P ab incident on it, we have added the path between the endpoints of the edge and a in the tree to P ab .Similarly, whenever a tree T with b ∈ V ( T ) has one edge of P ab incident on it, we have added the pathbetween the endpoints of the edge and b in the tree to P ab . If there is a tree T with a, b ∈ V ( T ) weadded the path between the endpoints of a and b in the tree to P ab during Path Rule 1. It follows that P ab is indeed a path between a and b in G . Since Invariant 1 holds, we know that P ab is a rainbow path.Since we have used only the colors from 1 to f so far, the lemma follows. (cid:117)(cid:116) So, now we only need to worry about how to rainbow connect vertices in L S between themselves andto the other vertices. For this, we give the following coloring rule. Coloring Rule 12
For each v ∈ L S , let e be the unique 2-edge incident on v which exists by Lemma 4.Color ( e ) with g = f + 1 and ( e ) with g = f + 2 . (Recall that g and g are the global surplus colors). Now, we complete the proof of the main theorem.
Proof (Proof of Theorem 1).
Consider any pair of vertices a , a ∈ V ( G ). If a ∈ L S , let e be theedge incident on a that is colored with g , and let a be the other end of e . If a / ∈ L S , let a = a . If a ∈ L S , let e be the edge incident on a that is colored with g , and let b be the other end of e . If a / ∈ L S , let b = a . We know there is a rainbow path P ab from a to b that uses only colors in [ f ] due toLemma 32. We define path P as follows. If a , a ∈ L S , then P := a aP ab ba . If a ∈ L S but a / ∈ L S ,then P := a aP ab . If a ∈ L S but a / ∈ L S , then P := P ab ba . If a , a / ∈ L S , then P := P ab . It is clearfrom the construction that P is a path between a and a . Since edge a a is colored with g = f + 1,edge ba is colored with g = f + 2, and path P ab uses only colors in [ f ], the path P is indeed a rainbowpath. (cid:117)(cid:116) We gave an upper bound of f( G ) + 2 on rc( G ), strengthening the intuition that tree-like and dominatingstructures are helpful in rainbow-connecting graphs. Our bound is tight up to an additive factor of 3 asshown by any tree. The question remains whether the bound can be improved to f ( G ) − n − Conjecture 1.
A connected graph G has rc( G ) ≤ f( G ) − Conjecture 2 ([12]).
A connected graph G has src( G ) ≤ f( G ) − Acknowledgement.
We thank Kurt Mehlhorn for funding the research visit of Erik Jan van Leeuwenand Juho Lauri to Max Planck Institute for Informatics, Saarbr¨ucken, which led to this work. eferences
1. M. Basavaraju, L. S. Chandran, D. Rajendraprasad, and A. Ramaswamy. Rainbow connection number and radius.
Graphs and Combinatorics , 30(2):275–285, 2014. 22. Y. Caro, A. Lev, Y. Roditty, Z. Tuza, and R. Yuster. On rainbow connection.
Electron. J. Combin , 15(1):R57, 2008. 23. S. Chakraborty, E. Fischer, A. Matsliah, and R. Yuster. Hardness and algorithms for rainbow connection.
Journal ofCombinatorial Optimization , 21(3):330–347, 2009. 14. L. S. Chandran, A. Das, D. Rajendraprasad, and N. M. Varma. Rainbow connection number and connected dominatingsets.
Journal of Graph Theory , 71(2):206–218, 2012. 25. G. Chartrand, G. L. Johns, K. A. McKeon, and P. Zhang. Rainbow connection in graphs.
Mathematica Bohemica ,133(1), 2008. 16. G. Chartrand and P. Zhang.
Chromatic graph theory . CRC press, 2008. 27. P. Dorbec, I. Schiermeyer, E. Sidorowicz, and ´E. Sopena. Rainbow connection in oriented graphs.
Discrete AppliedMathematics , 179:69–78, 2014. 18. J. Ekstein, P. Holub, T. Kaiser, M. Koch, S. Matos Camacho, Z. Ryj´aˇcek, and I. Schiermeyer. The rainbow connectionnumber of 2-connected graphs.
Discrete Mathematics , 313(19):1884–1892, 2013. 29. S. N. Joseph and L. C. DiPippo.
Pseudo-scheduling: A New Approach to the Broadcast Scheduling Problem , pages93–104. Springer Berlin Heidelberg, 2013. 110. N. Kamˇcev, M. Krivelevich, and B. Sudakov. Some remarks on rainbow connectivity.
Journal of Graph Theory ,83(4):372–383, 2016. 211. M. Krivelevich and R. Yuster. The rainbow connection of a graph is (at most) reciprocal to its minimum degree.
Journal of Graph Theory , 63(3):185–191, 2010. 212. J. Lauri.
Chasing the Rainbow Connection: Hardness, Algorithms, and Bounds . PhD thesis, Tampere University ofTechnology, 2016. 3513. X. Li, Y. Shi, and Y. Sun. Rainbow Connections of Graphs: A Survey.
Graphs and Combinatorics , 29(1):1–38, 2012. 214. X. Li and Y. Sun.
Rainbow connections of graphs . Springer, 2012. 215. X. Li and Y. Sun. An updated survey on rainbow connections of graphs-a dynamic survey.
Theory and Applicationsof Graphs , (1):3, 2017. 216. H. M´elot. Facet defining inequalities among graph invariants: The system GraPHedron.