Complexity of greedy edgecolouring
 Frédéric Havet^{1},
 A. Karolinna Maia^{2}Email author and
 MinLi Yu^{3}
https://doi.org/10.1186/s131730150036x
© Havet et al. 2015
Received: 5 February 2014
Accepted: 15 September 2015
Published: 9 November 2015
Abstract
The Grundy index of a graph G =(V, E) is the greatest number of colours that the greedy edgecolouring algorithm can use on G. We prove that the problem of determining the Grundy index of a graph G=(V, E) is NPhard for general graphs. We also show that this problem is polynomialtime solvable for caterpillars. More specifically, we prove that the Grundy index of a caterpillar is Δ(G) or Δ(G)+1 and present a polynomialtime algorithm to determine it exactly.
Background
All the graphs considered in this paper are without loops but may have multiple edges.
A (proper) kcolouring of a graph G =(V, E) is a surjective mapping c:V→{1,2,…,k} such that c(u)≠c(v) for any edge u v∈E. The chromatic number is χ(G)=min{ k∣G admits a kcolouring}. On the algorithmic point of view, finding the chromatic number of a graph is a hard problem. For all k≥3, it is NPcomplete to decide whether a graph admits a kcolouring (see [2]). Furthermore, it is NPhard to approximate the chromatic number within \(V(G)^{\varepsilon _{0}}\phantom {\dot {i}\!}\) for some positive constant ε _{0}, as shown by Lund and Yannakakis [5].
Hence, lots of heuristics have been developed to colour a graph. The most basic and widespread because it works online is the greedy algorithm. Given a vertex ordering σ=v _{1}<⋯<v _{ n } of V(G), this algorithm colours the vertices in the order v _{1},…,v _{ n }, assigning to v _{ i } the smallest positive integer not used on its lowerindexed neighbours. A colouring resulting of the greedy algorithm is called a greedy colouring. The Grundy number Γ(G) is the largest k such that G has a greedy kcolouring. Easily, χ(G)≤Γ(G)≤Δ(G)+1.
Zaker [6] showed that for any fixed k, one can decide in polynomial time whether a given graph has Grundy number at most k. However, determining the Grundy number of a graph is NPhard [6], and given a graph G, it is even NPcomplete to decide whether Γ(G)=Δ(G)+1 as shown by Havet and Sampaio [3]. In addition, Asté et al. [1] showed that for any constant c≥1, it is NPcomplete to decide whether Γ(G)≤c·χ(G).
Graph colouring of many graph classes has also been studied. One of the classes is the one of line graphs. The line graph of a graph G, denoted L(G), is the graph whose vertices are the edges of G, with e f∈E(L(G)) whenever e and f share an endvertex. Colouring line graphs corresponds to edgecolouring. A kedgecolouring of a graph G is a surjective mapping ϕ:E(G)→{1,…,k} such that if two edges e and f are adjacent (i.e. share an endvertex), then ϕ(e)≠ϕ(f). A kedgecolouring may also be seen as a partition of the edge set of G into k disjoint matchings M _{ i }={e∣ϕ(e)=i}, 1≤i≤k. By edgecolouring, we mean either the mapping ϕ or the partition.
The chromatic index χ ^{′}(G) of a graph G is the least k such that G admits a kedgecolouring. It is easy to see that χ ^{′}(G)=χ(L(G)). Obviously, Δ(G)≤χ ^{′}(G) and Shannon’s and Vizing’s theorems state that \(\chi '(G)\leq \max \{\frac {3}{2}\Delta (G) ; \Delta (G)+\mu (G)\}\), where μ(G) is the maximum number of edges between two vertices of G. Holyer [4] showed that for any k≥3, it is NPcomplete to decide if a kregular graph has chromatic index k.
Edge colouring naturally arises in modelling some channel assignment problems in wireless network. From such a network, one can construct the communication graph whose vertices are the nodes of the network, and two vertices are connected by an edge whenever they communicate. In order to avoid interferences between the different signals arriving at a node, we need to assign distinct frequencies to the communications at each node. This corresponds to finding an edgecolouring of the communication graph.
Usually, the communications begin at different dates, and we need to assign the frequencies online. Usually, the frequencies are assigned greedily according to the following the greedy algorithm for edgecolouring, which corresponds to the greedy algorithm to colour a line graph. Given a graph G =(V, E) and an edge ordering θ=e _{1}<⋯<e _{ n }, assign to e _{ i } the least positive integer that was not already assigned to lowerindexed edges adjacent to it. An edgecolouring obtained by this process is called a greedy edgecolouring, and it has the following property:For every j < i, every edge e in M _{ i } is adjacent to an edge in M _{ j }. (P)Note that an edgecolouring satisfying (P) is a greedy edgecolouring relative to any edge ordering in which the edges of M _{ i } precede those of M _{ j } when i<j.
The Grundy index Γ ^{′}(G) of a graph G is the largest number of colours of a greedy edgecolouring of G. Notice that Γ ^{′}(G)=Γ(L(G)). By definition, χ ^{′}(G)≤Γ ^{′}(G). Furthermore, as an edge is adjacent to at most 2Δ(G)−2 other edges (Δ(G)−1 at each endvertex), colouring the edges greedily uses at most 2Δ(G)−1 colours. So Δ(G)≤Γ ^{′}(G)≤2Δ(G)−1. There are graphs for which the Grundy index equals the maximum degree, stars for example. On the opposite, for any Δ, there is a tree with maximum degree Δ and Grundy index 2Δ−1. Indeed, consider the trees \(B^{\prime }_{k}\) defined recursively as follows: \(B^{\prime }_{1} = P_{2}\), \(B^{\prime }_{2} = P_{3}\) and the root of P _{2} is one of its vertex and the root of P _{3} is one of its leaves; \(B^{\prime }_{k}\) is obtained from the disjoint union of \(B^{\prime }_{k1}\) and \(B^{\prime }_{k2}\) by adding an edge between their roots, and the root of \(B^{\prime }_{k}\) is the root of \(B^{\prime }_{k2}\). An easy induction shows that for every positive k, Δ(B2k′)=Δ(B2k+1′)=k+1 and that the root of \(B^{\prime }_{2k}\) has degree k and the root of \(B^{\prime }_{2k+1}\) has degree k+1. Now, Γ ^{′}(B k′)=k for every k, because one can show easily by induction the following stronger statement.
Proposition 1.
For every positive integer k, there is a greedy kedgecolouring of \(B^{\prime }_{k}\) such that the colours assigned to the edges incident to the root are all the odd numbers up to k, if k is odd, and all the even numbers up to k if k is even.
In this paper, we study the complexity of finding the Grundy index of a graph. We prove that it is NPhard by showing that the following problem is coNPcomplete. MINIMUM GREEDY EDGECOLOURING Instance: A graph G. Question: Γ ^{′}(G)=Δ(G)?
The proof, to be detailed in the Section ‘CoNPcompleteness results’, is a reduction from 3EDGECOLOURABILITY OF CUBIC GRAPHS which was proved to be NPcomplete by Holyer [4]. We recall that a cubic graph is a 3regular graph. The reduction also proves that it is coNPcomplete to decide if Γ ^{′}(G)=χ ^{′}(G). 3EDGECOLOURABILITY OF CUBIC GRAPHS Instance: A cubic graph G. Question: Is G 3edge colourable?
We then extend the result to a more general problem. f GREEDY EDGECOLOURING Instance: A graph G. Question: Γ ^{′}(G)≤f(Δ(G))?
We show that for any function f such that k≤f(k)≤2k−2, the problem f GREEDY EDGECOLOURING is coNPComplete.
Since determining the Grundy index is NPhard, a natural question to ask is for which class of graphs it can be done in polynomial time. Obviously, it is the case for the class of graphs with maximum degree k. Indeed, the Grundy index of a graph G in this class is at most 2k−1, and for every 1≤i≤2k−1, one can check in polynomial time whether Γ ^{′}(G)≤j. So we must look at classes for which the maximum degree is not bounded. In the Section ‘Greedy edgecolouring of caterpillars’, we consider caterpillars which are trees such that the deletion of all leaves results in a path, called backbone. We show that if T is a caterpillar then Γ ^{′}(T)≤Δ(T)+1 and then give a lineartime algorithm to compute the Grundy index of a caterpillar. In view of this result, a natural question is the following:
Problem 2.
Can we compute in polynomial time the Grundy index of a given tree?
CoNPcompleteness results
The aim of this section is to prove that f GREEDY EDGECOLOURING is coNPcomplete for every function f such that k≤f(k)≤2k−2 for all k.
For the sake of clarity, we first show that MINIMUM GREEDY EDGECOLOURING is coNPcomplete.
MINIMUM GREEDY EDGECOLOURING is clearly in coNP, because a greedy edgecolouring of a graph G with at least Δ(G)+1 colours is a certificate that Γ ^{′}(G)>Δ(G). We show that it is coNPcomplete.
Theorem 3.
MINIMUM GREEDY EDGECOLOURING is coNPComplete.
We now prove the coNPcompleteness by reduction from 3EDGECOLOURABILITY OF CUBIC GRAPHS.
In G, d(v)=n+3, while the degree of all other vertices is at most 4. Thus, Δ(G)=d(v)=n+3 because n≥4 has H is cubic. Moreover, every edge of G is adjacent to at most n+3 edges so Γ ^{′}(G)≤n+4=Δ(G)+1. Hence, the Grundy index of G is either Δ(G) or Δ(G)+1. The coNPcompleteness of MINIMUM GREEDY EDGECOLOURING follows directly from the following claim.
Claim 3.1.
χ ^{′}(H)=3 if and only if Γ ^{′}(G)=Δ(G)+1.
Proof.
(⇒) Suppose that there exists a 3edgecolouring ϕ of H. Let us extend ϕ into a greedy edgecolouring of G with Δ(G)+1=n+4 colours. Set ϕ(a v)=1, ϕ(b v)=2, ϕ(c v)=3, and for all 1≤i≤n, ϕ(u _{ i } w _{ i })=4 and ϕ(u _{ i } v)=i+4. Notice that every vertex w _{ i } is incident to an edge of H of each colour in {1,2,3} since H is cubic. Then, it is straightforward to check that ϕ is a greedy (n+4)edgecolouring of G.
(⇐) Suppose that there is a greedy (n+4)edgecolouring of G. Some edge is coloured n+4. But such an edge has to be adjacent to at least n+3 edges and thus to be one of the v u _{ i }, say v u _{ n }. The edge v u _{ n } is adjacent to exactly n+3 edges. So by Property (P), all edges adjacent to v u _{ n } receive distinct colours in {1,…,n+3}.
Let us first prove by induction on 1≤j≤n that the edge e _{ j } adjacent to v u _{ n } labelled n+5−j is one of the v u _{ i }, the result holding for j=1. Suppose now that j≥2. The edge e _{ j } must have degree at least n+5−j since it is adjacent to v u _{ n } and one edge of each colour in {1,…,n+4−j} by Property (P). Hence, e _{ j } must be incident to v since u _{ n } w _{ n } is adjacent to four edges. Then e _{ j } must have degree at least n+3 since it is adjacent to the j−1 edges e _{ l } for 1≤l<j and one edge of each colour in {1,…,n+4−j}. Hence, e _{ j } is one of the v u _{ i }.
Hence, without loss of generality, we may assume that ϕ(v u _{ i })=i+4 for all 1≤i≤n. The edge v u _{ i } is adjacent to an edgecoloured 4. This edge must be u _{ i } w _{ i } since the edges av, bv and cv are adjacent to at most two edges coloured in {1,2,3}. Thus, ϕ(u _{ i } w _{ i })=4 for all 1≤i≤n.
Now every edge u _{ i } w _{ i } is adjacent to three edges, one of each colour in {1,2,3}. Since ϕ(v u _{ i })≥5, these three edges must be the three edges adjacent to w _{ i } in H. Thus, all the edges of H are coloured in {1,2,3}. Hence, the restriction of ϕ to H is a 3edgecolouring.
Remark 4.
Observe that the graph G has chromatic index Δ(G). Indeed, colour the edges adjacent to v with the colours 1,…,Δ(G) and then extend greedily this colouring to the other edges. Since all the remaining edges are adjacent to at most four edges, they will all get a colour less than or equal to 5. Since Δ(G)≥5, we obtain a Δ(G)edgecolouring. Hence, the above reduction shows that it is coNPcomplete to decide whether Γ ^{′}(G)=χ ^{′}(G).
Theorem 3 may be generalized as follows.
Theorem 5.
Let f be a function such that k≤f(k)≤2k−2 for all \(k\in \mathbb {N}\). f GREEDY EDGECOLOURING is coNPComplete.
Proof.
f GREEDY EDGECOLOURING is clearly in coNP, because a greedy edgecolouring of a graph G with more than f(Δ(G)) colours is a certificate that Γ ^{′}(G)>f(Δ(G)).
We now prove the coNPcompleteness by reduction from 3EDGECOLOU RABILITY OF CUBIC GRAPHS.
Observe that Δ(G ^{′})=n+3 and the vertices of degree n+3 are v, t _{1},…,t _{ p } and u _{ n } when p=n+1. Moreover, every edge is adjacent to at most n+3+p, so Γ ^{′}(G)≤n+3+p+1=f(Δ(G ^{′})+1. The coNPcompleteness of f GREEDY EDGECOLOURING follows directly from the following claim.
Claim 5.1.
χ ^{′}(H) = 3 if and only if Γ ^{′}(G ^{′})=f(Δ(G ^{′}))+1.
(⇒) Suppose that there exists a 3edgecolouring ϕ of H. Let us extend ϕ into a greedy edgecolouring of G ^{′} with f(Δ(G ^{′}))+1=n+p+4 colours. We first extend it into a greedy (n+4)colouring of G as we did in the proof of Theorem 3. In particular, we have ϕ(u _{ n } w _{ n })=4 and ϕ(u _{ n } v)=n+4. For all 1≤i≤p and all 1≤j≤n−1, we set ϕ(t _{ i } a _{ i })=1, ϕ(t _{ i } b _{ i })=2, ϕ(t _{ i } c _{ i })=3, ϕ(t _{ i, j } a _{ i, j })=1, ϕ(t _{ i, j } b _{ i, j })=2, ϕ(t _{ i, j } c _{ i, j })=3, ϕ(t _{ i, j } s _{ i, j })=j+3, and ϕ(t _{ i } u _{ n })=n+4+i. Then it is straightforward to check that ϕ is a greedy (n+p+4)edgecolouring of G ^{′}.
(⇐) Suppose that G ^{′} admits a greedy (n+p+4)edgecolouring ϕ. For all 1≤i≤p, there is an edge e _{ i } coloured n+4+i. This edge must have to be adjacent to at least n+3+i edges by Property (P). So all the e _{ i } must be in F={v u _{ n }}∪{u _{ n } t _{ i }∣1≤i≤p}. Now, the edge e _{ p } is adjacent to an edge e _{0} coloured n+4. This edge is adjacent to at least n+4 edges: one of each colour in {1,…,n+3} and e _{ p }. Hence, e _{0} also has to be in F. Since F=p+1, all the edges in F are coloured with distinct labels in {n+4,…,n+p+4}.
Now applying the same reasoning as in the proof of Theorem 3, we derive that the restriction to ϕ to H is a 3edgecolouring.
Greedy edgecolouring of caterpillars
In this section, we show a polynomialtime algorithm solving GREEDY EDGECOLOURING for caterpillars. A caterpillar is a tree such that the deletion of all leaves results in a path, called backbone. A star is a trivial caterpillar.
We first show that the Grundy index of a caterpillar T is at most Δ(T)+1, and so it is either Δ(T) or Δ(T)+1. Then we give a polynomialtime algorithm that computes the Grundy index of a caterpillar.
Grundy index of a caterpillar
Lemma 6.
Let T be a caterpillar and v a vertex in its backbone such that d(v)≥3. In every greedy edgecolouring of T, the colours 1,…,d(v)−2 appear on the edges incident to v.
Proof.
By the contrapositive. Let c be an edgecolouring of T. Suppose that a colour α∈{1,…,d(v)−2} is not assigned to any edge incident to v. Then, since all the edges incident to v have different colours, at least three colours strictly greater than d(v)−2 appear on three edges incidents to v. One of these colours, say β, must appear on an edge e incident with a leaf. But e is uniquely adjacent to edges incident to v. So e is adjacent to no edgecoloured α. Since α≤d(v)−2<β, the edgecolouring c is not greedy.
Lemma 7.
Let c be a greedy edgecolouring of a caterpillar T and v an interior vertex in the backbone of T. If two edges e _{1} and e _{2} incident to v receive colours greater than d(v)−1, then e _{1} and e _{2} are two edges of the backbone and the edges incident to v and leaves are coloured 1,…,d(v)−2.
Proof.
Suppose by way of contradiction that one of these two edges, say e _{1}, is incident to a leaf. Then e _{1} is adjacent to d(v)−1 other edges, and one of them, namely e _{2}, is assigned a colour greater than d(v)−1. Thus, e _{1} is adjacent to at most d(v)−2 edges whose colour is less or equal to d(v)−1. So, there is a colour α in {1,…,d(v)−1} such that no edge adjacent to e _{1} is coloured α. This contradicts the fact that c is greedy. Hence, e _{1} and e _{2} are edges of the backbone.
Now by Lemma 6, there must be edges incident to v of each colour in {1,…,d(v)−2}. So the d(v)−2 edges distinct form e _{1} and e _{2}, which are the edges linking v and leaves are coloured must be coloured in {1,…,d(v)−2}.
Now by Lemma 6, there must be edges incident to v of each colour in {1,…,d(v)−2}. So the d(v)−2 edges distinct form e _{1} and e _{2}, which are the edges linking v and leaves are coloured must be coloured in {1,…,d(v)−2}.
Now by Lemma 6, there must be edges incident to v of each colour in {1,…,d(v)−2}. So the d(v)−2 edges distinct form e _{1} and e _{2}, which are the edges linking v and leaves are coloured must be coloured in {1,…,d(v)−2}.
Theorem 8.
If T is a caterpillar, then Γ ^{′}(T)≤Δ(T)+1.
Proof.
Set Δ(T)=Δ. Suppose by way of contradiction that it is possible to greedily colour T with Δ+2 colours. Let e be an edgecoloured Δ+2. It must be adjacent to at least Δ+1 edges, one of each colour 1,…,Δ+1. Thus, the edge e is in the backbone. According to Lemma 7, the edges e _{1} and e _{2} adjacent to e with colours Δ and Δ+1 are in the backbone. Furthermore, all the edges adjacent to e which are neither e _{1} nor e _{2} are coloured in {1,…,Δ−2}. Hence, e is adjacent to no edgecoloured Δ−1, a contradiction.
Finding the Grundy index of a caterpillar
Theorem 8 implies that the Grundy index of a caterpillar T is either Δ(T) or Δ(T)+1. Hence, determining the Grundy index of a caterpillar is equivalent to solve MINIMUM GREEDY EDGECOLOURING for it. The aim of this subsection is to prove that it can be done in a linear time.
Theorem 9.
Determining the Grundy index of a caterpillar T can be done in O(V(T)).
In order to prove this theorem, we first give some definitions and lemmas. Let T be a caterpillar with backbone P=(v _{1},v _{2},…,v _{ n }), v _{1}≠v _{ n }. The first edge of P is v _{1} v _{2}. For any edge e=v _{ i } v _{ i+1}∈P, removing e from T gives two caterpillars \(T^{}_{e}\) and \(T^{+}_{e}\), the first one containing v _{ i } and the second one containing v _{ i+1}. For convenience, the backbone of \(T^{}_{e}\) is P ^{−}(e)=(v _{ i },v _{ i−1},…,v _{1}) and the backbone of \(T^{+}_{e}\) is \(P^{+}_{e}=(v_{i}, v_{i+1}, \dots, v_{n})\). Hence, the first edge of \(T^{}_{e}\) is (v _{ i },v _{ i−1}) and the first edge of T ^{+}(e) are (v _{ i+1},v _{ i+2}). However, if the degree of v _{ i } is 2 in T, (v _{ i },v _{ i−1}) is not an edge in the backbone, the case in which we say that the first edge is null. The same happens if the degree of v _{ i+1} is 2 or if \(T^{}_{e}\) or T ^{+}(e) are stars.
Lemma 10.

one endvertex of e has degree Δ, and

one of the two caterpillars \(T^{}_{e}\) and \(T^{+}_{e}\) has a greedy edgecolouring such that the first edge of its backbone is coloured Δ and the other has a greedy edgecolouring such that its first edge of its backbone is coloured Δ−1. If the value of the first edge of \(T^{}_{e}\) (similarly for \(T^{+}_{e}\)) is null, its first vertex is required to have degree Δ in the early case (edgecoloured Δ) and Δ−1 in the later.
Proof.
Assume that T has a greedy (Δ+1)edgecolouring. Let e be an edgecoloured Δ+1. By Lemma 7, e is in the backbone and incident to a vertex of degree Δ, proving (1). Moreover, the edge e is adjacent to an edge e _{1} coloured Δ and another one e _{2} labelled Δ−1. The greedy edgecolourings induced on \(T^{}_{e}\) and \(T^{+}_{e}\) satisfy (2). Suppose, w.l.o.g, \(T^{}_{e}\) contains e _{1}. If the first edge of \(T^{}_{e}\) is not null, then it is easy to see it is e _{1}, since by Lemma 7, e _{1} must also be in the backbone of T. If the first edge of \(T^{}_{e}\) is null than d(v _{ i })=2 and the only way e _{1}=v _{ i } v _{ i−1} be coloured Δ is if d(v _{ i−1}), the first vertex of \(T^{}_{e}\), has degree Δ. The analysis for \(T^{+}_{e}\) contains e _{2} is analogue, observing that in this case, \(T^{+}_{e}\) can be a star.
Conversely, assume that there is an edge e∈E(P) satisfying (1) and (2). Let ϕ ^{−} and ϕ ^{+} be the greedy edgecolourings of \(T^{}_{e}\) and \(T^{+}_{e}\), respectively as in (2). Let ϕ be the edgecolouring of T defined by ϕ(e)=Δ+1, ϕ(f)=ϕ ^{−}(f) for all \(f\in T^{}_{e}\) and ϕ(f)=ϕ ^{+}(f) for all \(f\in T^{+}_{e}\). We claim that ϕ is a greedy edgecolouring. Clearly, since ϕ ^{−} and ϕ ^{+} are greedy, it suffices to prove that e is adjacent to an edge of every colour i in {1,…,Δ}. Since ϕ ^{+} and ϕ ^{−} satisfy (2), then e is adjacent to an edgelabelled Δ and an edgelabelled Δ−1. Now, e is incident to a vertex v of degree Δ. This vertex is incident to e and an edge f with a colour greater than Δ−2 in the greedy edgecolouring of T _{ f } in \(\{T^{+}_{e}, T^{}_{e}\}\). So, the Δ−2 edges incident to v which are not e nor f have all one colour in 1,…,Δ−2. Hence, e is adjacent to an edge of every colourin {1,…,Δ}.
Lemma 11.

d(u)≥k or d(v)≥k

d(u)=k−1 and \(T^{+}_{e}\) admits a greedy edgecolouring such that the first edge of \(P^{+}_{e}\) is coloured k−1.
Proof.
Let e=u v with u the first vertex of P. Assume first that T has a greedy edgecolouring such that e is coloured k and that e is incident to no vertex of degree k. Then the edges incident to u must be coloured by 1,…,d(u)−1 and the edges incident to u and a leaf are coloured by 1,…d(v)−2. Hence, the edge adjacent to e and coloured k−1 must be the first edge of \(P^{+}_{e}\) is coloured k−1 by Property (P). So the edge adjacent to e and coloured k−2 must be incident to u, and thus d(u)−1≥k−2, that is d(u)≥k−1.
Assume now that (1) holds. Let x be a vertex in {u,v} with degree at least k. One can colour all the edges incident to x with 1,…,d(v) such that e is coloured k and then extend this edgecolouring greedily to obtain the desired greedy edgecolouring of T.
Finally, assume that (2) holds. Let ϕ be a greedy edgecolouring of \(T^{+}_{e}\) such that the first edge of \(P^{+}_{e}\) is coloured k−1. One can extend it by assigning k to e, 1,…,k−2 to the k−2 edges incident to u and leaves and 1,…,d(v)−2 to the edges incident to v. It is routine to check that this a a greedy edgecolouring of T.
Proof of Theorem 9.
Theorem 8 and Lemma 10 imply that Algorithm 1 return the Grundy index of T provided that we have a subroutine FirstEdge(T, P, k) that returns ‘yes’ if a caterpillar T with backbone P admits a greedy edgecolouring such that the first edge of P is coloured k.
Such a subroutine FirstEdge may be obtained by Algorithm 2 according to Lemma 11.
Let us now examine the complexity of Algorithm 1. Let us first observe that FirstEdge(T, P, k) makes a constant number of operations before calling FirstEdge(T−u, P−u, k−1). Hence, an easy induction show that it makes O(k) operations in total.
Algorithm 1 first computes (line 1) the degrees of all the v _{ i }, which can be done in time O(V(T)) and then takes the maximum of all these values which can also be done in time O(V(T)).
In a second phase (line 2 to 8), for each edge e∈P which is incident to a vertex of degree Δ, Algorithm 1 makes at most four calls of FirstEdge with last parameter Δ−1 or Δ. Hence, for each e∈P it makes O(Δ) operations, according to the execution time of Algorithm 2. Let S be the set of vertices of degree Δ. The number of edges of P incident to a vertex of degree Δ is at most 2S. But every vertex in S is adjacent to at least Δ−2 leaves. Hence, V(T)≥S+(Δ−2)S, so S≤V(T)/(Δ−1). Hence, in this second phase, the algorithm makes at most \(O\left (2\times \frac {V(T)}{\Delta 1} \Delta \right) = O(V(T))\) operations.
Thus, in total, Algorithm 2 makes O(V(T)) operations.
Declarations
Acknowledgements
This study is partly supported by CAPES/Brazil, Fortaleza, Brazil.
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
Authors’ Affiliations
References
 Asté M, Havet F, LinharesSales C (2010) Grundy number and products of graphs. Discret Math 310(9): 1482–1490.View ArticleMATHGoogle Scholar
 Garey MR, Johnson DS (1979) Computers and intractability. A guide to the theory of NPcompleteness. A Series of Books in the Mathematical Sciences, San Francisco, California.Google Scholar
 Havet F, Sampaio L (2010) On the Grundy number of a graph In: Proceedings of the International Symposium on Parameterized and Exact Computation(IPEC), Lecture Notes on Computer science, 6478.. Springer, Berlin Heidelberg.Google Scholar
 Holyer I (1981) The NPcompleteness of edgecoloring. SIAM J Comput 2: 225–231.View ArticleGoogle Scholar
 Lund C, Yannakakis M (1994) On the hardness of approximating minimization problems. J. Assoc. Comput. Mach. 41(5): 960–981.MathSciNetView ArticleMATHGoogle Scholar
 Zaker M (2006) Results on the Grundy chromatic number of graphs. Discrete Math 306(23): 3166–3173.MathSciNetView ArticleMATHGoogle Scholar