A Linear Time Algorithm for L(2,1)-Labeling of Trees

  • Toru Hasunuma
  • Toshimasa Ishii
  • Hirotaka Ono
  • Yushi Uno
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5757)


An L(2,1)-labeling of a graph G is an assignment f from the vertex set V(G) to the set of nonnegative integers such that |f(x) − f(y)| ≥ 2 if x and y are adjacent and |f(x) − f(y)| ≥ 1 if x and y are at distance 2, for all x and y in V(G). A k-L(2,1)-labeling is an L(2,1)-labeling f:V(G)→{0,...,k}, and the L(2,1)-labeling problem asks the minimum k, which we denote by λ(G), among all possible assignments. It is known that this problem is NP-hard even for graphs of treewidth 2, and tree is one of very few classes for which the problem is polynomially solvable. The running time of the best known algorithm for trees had been O4.5 n) for more than a decade, and an O( min {n 1.751.5 n})-time algorithm has appeared recently, where Δ is the maximum degree of T and n = |V(T)|, however, it has been open if it is solvable in linear time. In this paper, we finally settle this problem for L(2,1)-labeling of trees by establishing a linear time algorithm.


Time Algorithm Polynomial Time Algorithm Linear Time Algorithm Input Tree Label Problem 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Bodlaender, H.L., Kloks, T., Tan, R.B., van Leeuwen, J.: Approximations for λ-coloring of graphs. The Computer Journal 47, 193–204 (2004)CrossRefzbMATHGoogle Scholar
  2. 2.
    Calamoneri, T.: The L(h,k)-labelling problem: A survey and annotated bibliography. The Computer Journal 49, 585–608 (2006), (January 13, 2009)CrossRefGoogle Scholar
  3. 3.
    Chang, G.J., Ke, W.-T., Kuo, D., Liu, D.D.-F., Yeh, R.K.: On L(d,1)-labeling of graphs. Discr. Math. 220, 57–66 (2000)CrossRefzbMATHGoogle Scholar
  4. 4.
    Chang, G.J., Kuo, D.: The L(2,1)-labeling problem on graphs. SIAM J. Discr. Math. 9, 309–316 (1996)CrossRefzbMATHGoogle Scholar
  5. 5.
    Fiala, J., Golovach, P.A., Kratochvíl, J.: Distance constrained labelings of graphs of bounded treewidth. In: Caires, L., Italiano, G.F., Monteiro, L., Palamidessi, C., Yung, M. (eds.) ICALP 2005. LNCS, vol. 3580, pp. 360–372. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  6. 6.
    Fiala, J., Golovach, P.A., Kratochvíl, J.: Distance constrained labelings of trees. In: Agrawal, M., Du, D.-Z., Duan, Z., Li, A. (eds.) TAMC 2008. LNCS, vol. 4978, pp. 125–135. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  7. 7.
    Fiala, J., Golovach, P.A., Kratochvíl, J.: Computational complexity of the distance constrained labeling problem for trees (Extended abstract). In: Aceto, L., Damgård, I., Goldberg, L.A., Halldórsson, M.M., Ingólfsdóttir, A., Walukiewicz, I. (eds.) ICALP 2008, Part I. LNCS, vol. 5125, pp. 294–305. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  8. 8.
    Fiala, J., Kloks, T., Kratochvíl, J.: Fixed-parameter complexity of λ-labelings. Discr. Appl. Math. 113, 59–72 (2001)MathSciNetCrossRefzbMATHGoogle Scholar
  9. 9.
    Goldberg, A.V., Rao, S.: Beyond the flow decomposition barrier. J. ACM 45, 783–797 (1998)MathSciNetCrossRefzbMATHGoogle Scholar
  10. 10.
    Griggs, J.R., Yeh, R.K.: Labelling graphs with a condition at distance 2. SIAM J. Disc. Math. 5, 586–595 (1992)MathSciNetCrossRefzbMATHGoogle Scholar
  11. 11.
    Hasunuma, T., Ishii, T., Ono, H., Uno, Y.: An O(n 1.75) algorithm for L(2,1)-labeling of trees. In: Gudmundsson, J. (ed.) SWAT 2008. LNCS, vol. 5124, pp. 185–197. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  12. 12.
    Hasunuma, T., Ishii, T., Ono, H., Uno, Y.: A linear time algorithm for L(2,1)-labeling of trees. CoRR abs/0810.0906 (2008)Google Scholar
  13. 13.
    Havet, F., Reed, B., Sereni, J.-S.: L(2,1)-labelling of graphs. In: Proc. 19th SIAM-SODA, pp. 621–630 (2008)Google Scholar
  14. 14.
    Hopcroft, J.E., Karp, R.M.: An n5/2 algorithm for maximum matchings in bipartite graphs. SIAM J. Comput. 2, 225–231 (1973)MathSciNetCrossRefzbMATHGoogle Scholar
  15. 15.
    Kratochvíl, J., Kratsch, D., Liedloff, M.: Exact algorithms for L(2,1)-labeling of graphs. In: Kučera, L., Kučera, A. (eds.) MFCS 2007. LNCS, vol. 4708, pp. 513–524. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  16. 16.
    Wang, W.-F.: The L(2,1)-labelling of trees. Discr. Appl. Math. 154, 598–603 (2006)MathSciNetCrossRefzbMATHGoogle Scholar
  17. 17.
    Yeh, R.K.: A survey on labeling graphs with a condition at distance two. Discr. Math. 306, 1217–1231 (2006)MathSciNetCrossRefzbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2009

Authors and Affiliations

  • Toru Hasunuma
    • 1
  • Toshimasa Ishii
    • 2
  • Hirotaka Ono
    • 3
  • Yushi Uno
    • 4
  1. 1.Department of Mathematical and Natural SciencesThe University of TokushimaTokushimaJapan
  2. 2.Department of Information and Management ScienceOtaru University of CommerceOtaruJapan
  3. 3.Department of Computer Science and Communication EngineeringKyushu UniversityFukuokaJapan
  4. 4.Department of Mathematics and Information Sciences, Graduate School of ScienceOsaka Prefecture UniversitySakaiJapan

Personalised recommendations