An Algorithm for L(2, 1)-Labeling of Trees

An L(2,1)-labeling of a graph Gis an assignment ffrom the vertex set V(G) to the set of nonnegative integers such that |f(x) i¾? f(y)| i¾? 2 if xand yare adjacent and |f(x) i¾? f(y)| i¾? 1 if xand yare at distance 2 for all xand yin V(G). A k-L(2,1)-labeling is an assignment f:V(G)i¾?{0,...,k}, and the L(2,1)-labeling problem asks the minimum k, which we denote by i¾?(G), among all possible assignments. It is known that this problem is NP-hard even for graphs of treewidth 2. Tree is one of a few classes for which the problem is polynomially solvable, but still only an $\mbox{O}(\Delta^{4.5} n)$ time algorithm for a tree Thas been known so far, where Δis the maximum degree of Tand n= |V(T)|. In this paper, we first show that an existent necessary condition for i¾?(T) = Δ+ 1 is also sufficient for a tree Twith $\Delta=\Omega(\sqrt{n})$, which leads a linear time algorithm for computing i¾?(T) under this condition. We then show that i¾?(T) can be computed in $\mbox{O}(\Delta^{1.5}n)$ time for any tree T. Combining these, we finally obtain an time algorithm, which substantially improves upon previously known results.