A note on connected greedy edge colouring
Abstract
Following a given ordering of the edges of a graph , the greedy edge colouring procedure assigns to each edge the smallest available colour. The minimum number of colours thus involved is the chromatic index , and the maximum is the so-called Grundy chromatic index. Here, we are interested in the restricted case where the ordering of the edges builds the graph in a connected fashion. Let be the minimum number of colours involved following such an ordering. We show that it is NP-hard to determine whether . We prove that if is bipartite, and that if is subcubic.
1 Introduction
A naive way to colour the vertices of a graph is to consider them one by one and to colour each vertex with the smallest colour that does not appear on any neighbour of it. More formally, let be a graph and be a linear ordering of its vertices. The greedy colouring of following is the colouring of obtained by colouring with the smallest colour such that there is no with and , for from to . The maximum number of colours that can be used using a greedy procedure is called the Grundy number, and computing this value can be a convenient way to bound any heuristic used to colour a graph (see [2] and [7]). Finding a good ordering of the vertices can indeed seem like an easier way to find a colouring with not “too many” colours. However, if we choose a bad ordering then the difference between the number of colours involved in a greedy colouring and the chromatic number can be arbitrary large, even for trees.
On the other hand, note that there is always an ordering of the vertices of a graph such that the greedy colouring following involves the optimal number of colours, i.e. . The argument is simple: consider a -colouring of , and put first all the vertices coloured in , then all the vertices coloured , etc. The greedy colouring following this ordering might not be exactly the same as , but it will use colours in total. Nevertheless, finding such an ordering is equivalent to directly computing an optimal colouring, so this is not a helpful approach.
A more interesting approach is through connected orderings. A connected ordering is an ordering where each vertex (except the first one) has one of its neighbours as predecessor – in other words, is connected for every . Note that disconnected graphs do not admit a connected ordering: throughout this paper we only consider connected graphs. Indeed, for colouring purposes, one can simply handle each connected component independently. The minimum number of colours used by the greedy procedure when following a connected ordering is called the connected chromatic number of and is denoted . Surprisingly, the connected chromatic number behaves similarly to the chromatic number. In fact, Benevides, Campos, Dourado, Griffiths, Morris, Sampaio and Silva [1] proved that for every graph .
Edge colouring is a special case of vertex colouring which typically displays significantly meeker behaviour. Indeed, while the chromatic number can vary wildly between the best-known lower bounds and best-known upper bounds, Vizing proved in 1964 [6] that the number of colours needed to colour the edges of a graph can only be either or , where is the maximum degree of . The minimum number of colours needed to colour the edges of a graph such that any two incident edges have different colours is the chromatic index of , denoted . Colouring the edges of a graph corresponds to colouring the vertices of its so-called line graph, where the vertices are and two vertices are adjacent if the corresponding edges are incident in .
Given that edge colouring is a special case of vertex colouring, all the notions discussed earlier extend naturally. Let us denote by the connected greedy chromatic index of . The goal of this paper is to study this parameter. By considering vertex colourings of the line graph of , we obtain . In the case of vertex colouring, it is NP-hard to decide whether [1]. To the best of our knowledge it is unknown whether this extends to edge colouring, and even whether and can differ. It is however known that and can differ on claw-free graphs [3].
Our first contribution is to prove that deciding is NP-hard, even for graphs of small maximum degree satisfying .
Theorem 1.
For all , it is NP-hard to decide whether on the class of graphs with chromatic index .
Our proof also provides an example of a graph with of maximum degree 3. When is a connected graph of maximum degree 2, then is a path or a cycle and it is easy to see that .
In the vertex case, when is bipartite [1]. We show that for bipartite graphs optimal connected orderings also exist in the edge case.
Theorem 2.
If is bipartite, then .
The key argument in the proof of Vizing’s theorem is to start from a non-optimal colouring and to reconfigure it to decrease the number of colours used. The reconfiguration step used in the proof, the Kempe change, was first introduced by Kempe in his attempt to prove the four colour theorem and since has become a standard and widely used tool to study colourings as it was proven to often be a fruitful approach.
More formally, an -Kempe chain is a connected component of the subgraph induced by the edges coloured or , and a Kempe change consists of switching the colours of the edges in this component. Note that after switching the colours, the colouring is still proper. Moreover, contrary to the case of vertex colouring, when considering edge colouring, Kempe chains have a much more restrained structure as they can only be paths or even cycles.
In Theorem 2, we use Kempe changes to reconfigure a -edge colouring to a connected greedy -edge colouring. In order to do this we define the notion of ‘reachability’ which might be of independent interest. Let be the subgraph induced by the edges of colour . Reachability predicts whether we can ‘jump’ between the components of via a connected ordering that assigns the edges between the components colour ; by induction, we can find optimal connected orderings for the components of , which we combine to an optimal connected ordering for . We can get a similar reachability result for general graphs (Lemma 7), of which the following is an easy corollary.
Theorem 3.
If has maximum degree then .
However, we did not manage to push through the induction argument used in Theorem 2 to provide a full answer to the following problem, which we leave open.
Problem 1 (Question 3 in [5]).
Is it true that for each graph of maximum degree ?
Throughout this paper, we use the short-cut for the edge and write to mean . We use the notation for the set of vertices adjacent to in .
2 Proof of NP-hardness
In this section, we prove Theorem 1. We first define some auxiliary constructions.
Let be given. The -dimensional hypercube with vertex set is -regular and satisfies . Indeed, we may reserve a different colour for each ‘direction’ as in Figure 1. Pick an edge . Let be the graph with vertex set and edge set
Then . An example is given in Figure 1.
Below we consider the situation in which we attempt to extend a colouring in which one of the edges has been precoloured. We assign the lowest available colour to the edges in a connected ordering starting from an edge incident with the precoloured edge.
Lemma 4.
Let . Let be the two edges containing a vertex of degree 1.
-
•
If is a -edge colouring of , then .
-
•
If is precoloured with some colour , then there is a connected ordering of the edges of such that the greedy procedure uses colours.
Proof.
To see the first claim, suppose that we assign and different colours. One of the colour classes must then cover an odd number of vertices from (because it covers an even number of vertices in as any colour class of an edge colouring of forms a matching). Let be a vertex not covered by this colour class. Since has degree , there are edges of different colours incident to it. Hence we have used at least colours.
To see the second claim, fix any -edge colouring of with . Let be the vertex of degree . We can now always create an ordering of the edges leading to the edge colouring . Indeed, we first colour the edge incident to which needs to get colour , then the edge incident to that needs to get colour , etc, until we coloured all edges incident to . We then pick a neighbour of of degree and colour all edges incident to this one in a similar order. We continue like this until all edges have been coloured. ∎
We will extend into a gadget . Let us first explain the case . We obtain the graph from the graph by adding a new vertex adjacent to the vertices and as well as adding a new vertex adjacent to as in Figure 1. Suppose we have a connected greedy 3-edge colouring of starting from . By Lemma 4, and must get the same colour. Since and cannot get the same colour, the edges and must all receive the same colour. Since we started from , some edge from is the first edge to be coloured from . Since and have degree , this edge will not get colour . If we force the edge to have colour , and then continue in a connected greedy fashion, then this shows we cannot colour all the edges using three colours. On the other hand, if we force it to have colour or , then we can continue to colour , , the remainder of the hypercube and finally and using Lemma 4. This proves the lemma below in the case .
Lemma 5.
For any , there exists a graph of maximum degree with a special vertex of degree with the following properties.
-
•
If the edge incident with is precoloured with colour , then there is no connected greedy -edge colouring of starting from this edge.
-
•
If the edge incident with is precoloured with , then there exists a connected greedy -edge colouring of starting from this edge.
Proof.
We extend copies of to the graph . We first glue all these copies on their respective vertices labelled and . We then obtain the graph by adding a new vertex adjacent to the (merged) vertices and and a new vertex adjacent to (see Figure 2).
Let be a -edge colouring. Since , we find that there exists a copy for which , where and are the vertices in this copy adjacent to and respectively. If we start the colouring from an edge incident to , then one of the edges in is the first edge to be coloured from ; since has degree , this edge will not get colour . Combined with Lemma 4, this shows that no connected -edge colouring starting from can exist in which the edge is precoloured .
On the other hand, if gets a colour strictly smaller than , then we first may colour , then all edges incident to , and finally by Lemma 4 we can further extend the connected ordering in such a way that all copies of are -edge coloured while no edge incident with receives colour . So we have at least one colour leftover for (which will in fact need to get colour ). ∎
We are now ready to show that it is NP-hard to decide whether on the class of graphs of maximum degree , for all .
Proof of Theorem 1.
Let , and let be an -vertex -regular graph. We transform into a graph of maximum degree such that if and only if . In fact, and . This reduction proves the theorem since deciding whether is NP-hard on -regular graphs for all , as shown by Leven and Galil [4].
Let and let be the graph from Lemma 5. For each , we create a graph by merging copies of on their special vertex (see Figure 3). The graph is obtained from by connecting to via an edge for each ; for distinct vertices of , the graphs and are disjoint and have no edges between them. Note that .
Suppose first that our -regular graph can be coloured using colours. Fix a -edge colouring of . There is a connected ordering of the edges of that results in the edge colouring . Indeed, since is -regular, whenever we have ‘reached’ a vertex we can assign the edges incident to this vertex the desired colours, starting from the edge coloured , continuing with the edge coloured etc. We may then colour the edge from to with colour for all . Continuing in the various copies of , the corresponding edge gets a colour and hence by Lemma 5 there is a connected ordering in which we can edge colour these with colours. So .
Suppose now that is not -edge colourable. For contradiction, suppose there is a -edge colouring that can be obtained via a connected ordering. Since is not -edge colourable, for some . The two edges between and are then not coloured . As and are not connected to each other, we may assume that these edge are coloured before any of the edges in are coloured. Since has degree , there is then a copy of with vertex connecting to in for which has colour and this is the first edge of that is coloured; this contradicts Lemma 5. So . ∎
To obtain a graph of maximum degree 3 with , we may take five copies of the graph from Lemma 5 with and identify their vertices with the vertices on a -cycle. The resulting graph still has maximum degree 3. Any greedy connected -edge colouring has exactly one edge of colour on the -cycle; but this means three copies of have their edge coloured with colour , and for at least two this is the first edge to be coloured in . This gives a contradiction with Lemma 5. Hence .
3 Bipartite graphs
Theorem 2 is an immediate consequence of the following lemma.
Lemma 6.
Let be a connected bipartite graph with . Then for any vertex , there exists a connected ordering starting from leading to a -edge colouring of .
Proof.
We prove the lemma by induction on . If is a connected graph with , then is a single edge. Hence the lemma is true for . Suppose now that we have proven the lemma for all for some integer .
Let be a -edge colouring of and let . For distinct, we say strongly reaches in the colouring if and either or the degree of is . Each vertex strongly reaches itself. We now define reachability as the transitive closure of strong reachability: we say reaches in the colouring if there is a sequence of vertices in such that strongly reaches for all .
We first show that for every vertex , there exists a -edge colouring of such that reaches all vertices of in this colouring. Take a -edge colouring of which maximises the number of vertices that can reach. Suppose that cannot yet reach all vertices. We will strictly increase the set of vertices that can reach through a series of Kempe changes.
Let be the set of vertices that can reach in and let . Note that as reaches itself, . Since is connected, there must be an edge from some to some . By the definition of strong reachability, we find that has degree strictly smaller than and that . Hence misses a colour , that is, it has no edge incident of colour .
Suppose first that has degree . If vertex misses colour as well, then the edge forms a -component on its own and a -Kempe change switches the colour of to . This adds the vertex to the set of vertices that can reach, increasing the set of vertices can reach as desired. Hence we may assume that misses some colour but does not miss colour . Then and there is some edge incident to coloured . Since all edges between and are coloured , the -component of stays within . Hence we may perform an -Kempe change on this component without affecting the set of vertices that can reach. Now we are back in the case in which and both miss colour , which we already handled.
Suppose now that vertex has degree . Let denote the edge coloured incident to . Note that the -component of is a path (of which one endvertex is ). If it stays within , then performing an -Kempe change on recolours with colour without affecting the colours in and hence strictly enlarges the set of vertices that can reach. So we may assume that intersects a second time, say is the vertex closest to in the path . Since has an edge incident with , we find that it has degree . Hence it has some colour missing. Once we ensure is missing at , we can do an -Kempe change on the component of and strictly increase the set of vertices that can reach.
If has an edge incident with colour , then consider the -component of this edge. This has to stay within and performing a Kempe change on it will not affect the set of vertices that can reach since . The only problem is that this chain could include the vertex . Here is where we use that the graph is bipartite: as can be seen in Figure 4, this would create an odd cycle in the graph, since there is an odd number of edges in between and and an even number of edges in between and (since they have different colours missing). Hence we may perform the -switch without affecting the missing colour of , and can then perform the -switch as desired.
This shows we can always strictly increase the set of vertices that can reach. This contradicts the maximality of . Hence there exists a colouring in which can reach all vertices.
Let denote the connected components of when we remove all edges of coloured in , where . We will show that there is a connected ordering starting from that leads to a -edge colouring of which is a -edge colouring when restricted to any . Since can reach everything in , after possibly renumbering , we can find vertices
for , such that for all , can strongly reach (‘reach in one step’) and hence (since we already know by the definition of the components).
Since is a connected bipartite graph with , there exists a connected ordering starting from that -edge colours by the induction hypothesis. By the definition of the components, all edges incident to except for have now been coloured. We colour the edge next; this obtains colour . Since is a connected bipartite graph with , there exists a connected ordering starting from that -edge colours by the induction hypothesis. We extend our previous ordering by this connected ordering and continue like this until we have coloured all edges within the components. We then colour the edges between the components; since colour will always be available to them, they will all receive a colour at most . ∎
4 Subcubic graphs
Let be a graph, let be a -edge colouring of and let . We say that a vertex can -reach another vertex in if there exists a sequence of vertices of such that for all there is an edge and one of the following holds:
-
•
;
-
•
has incident edges in colours .
If the maximum degree of , then this reduces to the notion of reachability from the proof of Theorem 2. The proof of Theorem 3 follows from the lemma below which might be of independent interest.
Lemma 7.
Suppose is a graph with maximum degree and . Then has an -edge colouring such that can -reach all other vertices of in .
Proof.
In this proof, we will omit the from -reach. By Vizing’s theorem [6], has at least one -edge colouring . We choose such a colouring that maximises the size of the set of vertices that can reach in . Let be the set of vertices that cannot reach.
Suppose that . The edges between and are of colour or . Let be the neighbours of via edges coloured . Let the set of vertices adjacent to a vertex in (which a priori might overlap with ). We claim that we can obtain an edge colouring in which can reach a strictly larger set of vertices than (contradicting the maximality of ) as soon as one of the following properties holds.
-
(1)
is empty, i.e. there is no -edge between and .
-
(2)
There is an -Kempe chain with which is a path between a vertex in and a vertex in .
-
(3)
Some has a colour missing.
-
(4)
Some misses colour or .
We will prove the claim after we show that we can assume one of holds. We suppose all properties above do not hold. Since (1) fails, we know there is an edge from some to some (which has colour by definition of ). Since is not reachable, there is a colour missing at . Since (3) fails, is incident to an edge of colour . As fails, we know that there is some colour missing at . Consider a -Kempe chain starting at . Since (2) fails, it stays within . After performing the switch, there is a vertex in with no edge coloured , contradicting with (4) failing.
To prove the claim in case (1), suppose that there are no edges coloured between and . Since is connected, there exists an edge from some to some . Then . Let be the smallest colour missing at . Since has the edge incident in colour , misses some colour . We do an -Kempe change on the component of (this could be empty). Since all the edges between and are coloured , this chain stays within . After the switch both and miss the colour . We may recolour the edge with colour , and now the set of vertices that can reach has increased (since can now reach as well).
To prove the claim in case (2), suppose that some -chain for starts in and contains a vertex from . Let and such that is the closest edge between and in this chain to . As , we find . Thus must have some colour missing (since cannot be reached). The -chain starting at will stay within and switching it does not affect which vertices can reach. So we may assume that is missing at and the -component of is a path between and that only intersects in the vertex . A Kempe change on this component strictly increases the set of vertices that can reach.
We now prove the claim assuming (3). Suppose that has a colour missing. Let with (which exists by the definition of ). Let be a colour missing at . The -chain starting at stays in , and hence we may perform a switch and then recolour to in order to increase the set of vertices that can reach.
Finally, we prove the claim from (4). Suppose misses colour or . Let be the vertex is adjacent to. By (3) we are done unless only has the colour missing. If is missing at , then we recolour to colour in order to reduce to (3). So is missing at . Let with . Let and let be a missing colour at . We may perform an -Kempe change starting at to ensure that misses colour . The only vertices on the -Kempe chain containing are then and . After we switch this chain, the set of vertices that can reach has strictly increased again. ∎
We are now ready to prove that any graph of maximum degree satisfies .
Proof of Theorem 3.
Let be a graph of maximum degree 3. Pick a vertex . Let be a -edge colouring of in which can -reach all other vertices of ; this exists by the lemma above.
The proof follows the same argument as the second half of the proof of Theorem 2, now using the fact that any -component can be -edge coloured in a connected greedy fashion starting from any vertex instead of applying the induction hypothesis.
Let be the -component of . After doing a -Kempe change if needed, we can colour in a connected greedy fashion starting from . If has more components, then since can -reach all other vertices, there must be a -component and vertices and such that , and either or has incident edges in colours in . Since and are in different -components, we conclude the latter holds. Since has maximum degree , it follows that . Hence all edges incident to have been coloured apart from , which we put next in the connected ordering. After performing a -switch if needed, we -edge colour the edges of in a connected greedy fashion starting from . (Note that there might be no edges to colour in this step, as the component might consist of only .) As long as the edges of some -component have not been coloured, we can continue the connected ordering in a similar fashion. The resulting (partial) colouring has the same -components as and coloured an edge if and only if it has colour in . We finish the connected ordering by first colouring the edges coloured by and then the edges coloured by ; all these edges receive a colour at most . ∎
Acknowledgements
We are grateful to LaBRI for providing us with a great working environment during the time at which the research was conducted. The second and sixth author are thankful for the funding of the ANR Project GrR (ANR-18-CE40-0032) that made their visit possible.
References
- [1] Fabrício Benevides, Victor Campos, Mitre Dourado, Simon Griffiths, Robert Morris, Leonardo Sampaio, and Ana Silva. Connected greedy colourings. In Alberto Pardo and Alfredo Viola, editors, LATIN 2014: Theoretical Informatics, pages 433–441, Berlin, Heidelberg, 2014. Springer.
- [2] Édouard Bonnet, Florent Foucaud, Eun Jung Kim, and Florian Sikora. Complexity of Grundy coloring and its variants. Discrete Applied Mathematics, 243:99–114, 2018.
- [3] Ngoc Khang Le and Nicolas Trotignon. Connected greedy colouring in claw-free graphs. arXiv preprint arXiv:1805.01953, 2018.
- [4] D. Leven and Z. Galil. NP-completeness of finding the chromatic index of regular graphs. Journal of Algorithms, 4:35–44, 1983.
- [5] Esdras Mota, Leonardo Rocha, and Ana Silva. Connected greedy coloring of -free graphs. Discrete Applied Mathematics, 284:572–584, 2020.
- [6] Vadim G. Vizing. On an estimate of the chromatic class of a -graph. Discret Analiz, 3:25–30, 1964.
- [7] Manouchehr Zaker. Results on the Grundy chromatic number of graphs. Discrete mathematics, 306(23):3166–3173, 2006.