A Note on Alternating Cycles in Edge-coloured Graphs Anders Yeo Department of Mathematics and Computer Science Odense University, Denmark March 19, 1996 Abstract Grossman and Haggkvist gave a characterisation of two-edge-coloured graphs, which have an alternating cycle (i.e. a cycle in which no two consecutive edges have the same colour). We extend their characterisation to edge-coloured graphs, with any number of colours. That is we show that if there is no alternating cycle in an edge-coloured graph, G, then it contains a vertex z, such that there is no connected component of G? z, which is joined to z with edges of dierent colors. Our extension implies a polynomial algorithm, for deciding if an edge-coloured graph contains an alternating cycle (see also [1]). 1 Introduction In [3] Grossman and Haggkvist proved that if G is a graph, whose edges are coloured either red or blue, and there is no cycle in G, whose edges are alternately red and blue, then the following holds. Either there is a vertex which is incident only with edges of the same colour, or there is a seperating vertex, z, such that there is no connected component of G?z, which is joined to z with both red and blue edges. Bang-Jensen and Gutin (personal communication) asked if Grossman and Haggkvist's result could be extended to edge-coloured graphs in general where 1
there is no constraint on the number of colours allowed in the graph. In this note, we give an armative answer to this question. That is we show that if there is no alternating cycle in an edge-coloured graph, G, then it contains a vertex z, such that there is no connected component of G? z, which is joined to z with edges of dierent colors. We note that Grossman and Haggkvist's proof can not be used to obtain the desired extension. Our proof is therefore quite dierent from theirs, even though the proofs are comparable in length. Using our extension, Bang-Jensen and Gutin [1], describe a polynomial algorithm, for deciding if an edge-coloured graph contains an alternating cycle. We include this algorithm here, for the sake of completeness. 2 Terminology We shall assume that the reader is familiar with the standard terminology on graphs and refer the reader to [2]. A graph G = (V (G); E(G)) is determined by its set of vertices, V (G), and its set of edges, E(G). By a cycle (path) we mean a simple cycle (path, respectively). If P = p 1 p 2 : : : p l is a path, then P [p i ; p j ] denotes the subpath p i p i+1 : : : p j. If P = p 1 p 2 : : : p l then we shall call P a (p 1 ; p l )-path, and dene the path P rev as p l p l?1 : : : p 1. An edge-coloured graph is a graph, which has a 'colour' assigned to each edge. Typically we shall denote the colour of an edge xy, by c(xy). An alternating cycle (path) is a cycle (path), such that no two consecutive edges have the same colour. If P = p 1 p 2 : : : p l, with l 2, is an alternating path in an edge-coloured graph G, then we shall use the following notation: c end (P ) = c(p l?1 p l ) and c start (P ) = c(p 1 p 2 ). Furthermore for distinct vertices x and y in G, let c end (x; y) = fc end (P ) : P is an alternating (x; y)-pathg and c start (x; y) = fc start (P ) : P is an alternating (x; y)-pathg. 3 Main Result Theorem 3.1 If G is an edge-coloured graph, with no alternating cycle, then there is a vertex z 2 V (G), such that there is no connected component of G? z, which is joined to z with edges of dierent colors. 2
Proof: Let G be an edge-coloured graph, with no alternating cycle. Let p 1 2 V (G) be arbitrary. We now dene the following: S = fp 1 g [ fs 2 V (G)? fp 1 g : jc end (p 1 ; s)j = 1g; P = p 1 p 2 : : : p l (l 1) is an alternating path of maximum length, such that p l 2 S ; T c = ft 2 V (G)? fp l g : c 2 c start (p l ; t)g: If l = 1 then let C be the set of all colours in G, and if l 2 then let C be the set of all colours in G except c end (P ). We will now prove the theorem in three steps. (i) V (P ) \ V (T c ) = ;, for all c 2 C. If l = 1 then this statement is trivially true, so assume that l 2 and that the statement is false, which implies that there is an alternating (p l ; p i )-path, R = p l r 1 r 2 : : : r m?1 r m p i (m 0), with c start (R) = c, i 2 f1; 2; : : : ; l?1g and V (R)\V (P ) = fp i ; p l g. Clearly c(p i p i+1 ) = c end (R), since otherwise we would obtain the alternating cycle, p i p i+1 :::p l r 1 r 2 :: ::r m?1 r m p i. This implies that Q = p 1 p 2 : : : p i r m r m?1 : : : r 1 p l, is an alternating (p 1 ; p l )-path, with c end (Q) = c start (R) = c 6= c end (P ). We have thus shown that fc end (Q); c end (P )g c end (p 1 ; p l ), which implies that jc end (p 1 ; p l )j 2. Therefore p l 62 S, which is a contradiction against the denition of P. (ii) If xy 2 E(G), x 2 T c, y 62 T c and c 2 C, then y = p l and c(xy) = c. Claim (a): There is an alternating (p l ; x)-path, R, with c end (R) 6= c(xy). By the denition of T c there is an alternating (p l ; x)-path, Q, with c start (Q) = c. If c end (Q) 6= c(xy) we are done, so assume that c end (Q) = c(xy). By (i), P Q is a (simple) alternating (p 1 ; x)-path, which is longer than P. This implies that x 62 S. Since P Q is an alternating (p 1 ; x)-path we obtain that jc end (p 1 ; x)j 1 and since x 62 S, we must furthermore have jc end (p 1 ; x)j 2. This implies that there is an alternating (p 1 ; x)-path, L, with c end (L) 6= c(xy). Let w 2 V (L) \ V (P [ Q)? x be chosen, such that V (L[w; x]) \ V (P Q) = fw; xg. 3
Suppose that w 2 V (P )?p l. Then Q[p l ; x]l rev [x; w] is an alternating (p l ; w)-path, whose rst edge has color c. This implies that w 2 T c, which is a contradiction against (i). Hence w 2 V (Q), and c start (Q[w; x]) = c start (L[w; x]), since otherwise Q[w; x]l rev [x; w] is an alternating cycle. This implies that R = Q[p l ; w]l[w; x] is an alternating (p l ; x)-path with c end (R) 6= c(xy). By claim (a) there is an alternating (p l ; x)-path, R, with c end (R) 6= c(xy). If y 6= p l then Ry is an alternating (p l ; y)-path, with c start (Ry) = c, which is a contradiction against y 62 T c. This implies that y = p l. If c(xy) 6= c, then we obtain the alternating cycle Ry, which is also a contradiction. This shows that y = p l and c(xy) = c. (iii) There is no connected component of G? p l, which is connected to p l in G, with edges of dierent colours. Assume that the statement is false, and let p l x and p l y be two distinct edges in G, such that x and y belong to the same connected component of G? p l and c(p l x) 6= c(p l y). Assume w.l.o.g. that c(p l x) 2 C (otherwise exchange x and y). There is a path (not necessarily alternating) R = r 1 r 2 : : : r m (m 2) between x = r 1 and y = r m, in G? p l. If y 2 T c(pl x), then since p l 62 T c(pl x), (ii) implies that c(p l y) = c(p l x), which is a contradiction. Therefore y 62 T c(pl x), which together with x 2 T c(pl x), implies that there exists an i (1 i m? 1), such that r i 2 T c(pl x) \ V (R) and r i+1 62 T c(pl x) \ V (R). This is however a contradiction against (ii), since r i r i+1 2 E(G) but p l 6= r i+1. This completes the proof. 2. In [1] it is illustrated how Theorem 3.1 can be used to check whether an edge-coloured graph contains an alternating cycle. We shall here repeat their approch. Let G be an edge-coloured graph. If there is a vertex x 2 V (G), such that no connected componenet of G? x is connected to x by edges of dierent colours, then clearly x can not lie in any alternating cycle of G. Therefore we may delete any such vertex x. Continuing this process we either get the graph with a single vertex, or we get a graph, which by Theorem 3.1, contains an alternating cycle. 4
We can furthermore decide whether an edge-coloured graph has an alternating cycle, and nd one if it exists, using Theorem 3.8 in [1]. A slight modication of the proof of Theorem 3.8 in [1], implies a polynomial algorithm for deciding whether an edge-coloured graph has an alternating cycle through a given vertex in an edge-coloured graph. However the problem of deciding whether there is an alternating cycle through two given vertices in an edge-colourd graph is NP-complete (see [1]). 4 Acknowledgments I would like to thank Jrgen Bang-Jensen and Gregory Gutin for many helpful remarks. References [1] J. Bang-Jensen and G. Gutin, Alternating Cycles and Paths in Edge- Coloured Multigraphs, Preprint nr. 26, 1995, Odense University. [2] J.A. Bondy and U.S.R. Murty, Graph Theory with Applications, MacMillan Press, 1976. [3] J. W. Grossman and R. Haggkvist Alternating cycles in Edge- Partitioned Graphs, Journal of Combinatorial Theory, Series B 34, 77-81 (1983). 5