Skip to main content
Log in

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

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

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 O(Δ 4.5 n) for more than a decade, and an O(min{n 1.75,Δ 1.5 n})-time algorithm has appeared recently, where Δ and n are the maximum degree and the number of vertices of an input tree, however, it has been open if it is solvable in linear time. In this paper, we finally settle this problem by establishing a linear time algorithm for L(2,1)-labeling of trees. Furthermore, we show that it can be extended to a linear time algorithm for L(p,1)-labeling with a constant p.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Algorithm 1
Algorithm 2
Algorithm 3
Fig. 1
Fig. 2
Algorithm 4
Fig. 3

Similar content being viewed by others

References

  1. Bodlaender, H.L., Kloks, T., Tan, R.B., van Leeuwen, J.: Approximations for λ-coloring of graphs. Comput. J. 47, 193–204 (2004)

    Article  MATH  Google Scholar 

  2. Calamoneri, T.: The L(h,k)-labelling problem: an updated survey and annotated bibliography. Comput. J. 54(8), 1344–1371 (2011). (http://www.dsi.uniroma1.it/~calamo/PDF-FILES/survey.pdf, ver. March, 2011.)

    Article  Google Scholar 

  3. Chang, G.J., Kuo, D.: The L(2,1)-labeling problem on graphs. SIAM J. Discrete Math. 9, 309–316 (1996)

    Article  MathSciNet  MATH  Google Scholar 

  4. Chang, G.J., Ke, W.-T., Kuo, D., Liu, D.D.-F., Yeh, R.K.: On L(d,1)-labeling of graphs. Discrete Math. 220, 57–66 (2000)

    Article  MathSciNet  MATH  Google Scholar 

  5. Fiala, J., Kloks, T., Kratochvíl, J.: Fixed-parameter complexity of λ-labelings. Discrete Appl. Math. 113, 59–72 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  6. Fiala, J., Golovach, P.A., Kratochvíl, J.: Distance constrained labelings of graphs of bounded treewidth. In: Proc. 32th ICALP, pp. 360–372 (2005)

    Google Scholar 

  7. Fiala, J., Golovach, P.A., Kratochvíl, J.: Distance constrained labelings of trees. In: Proc. 5th TAMC, pp. 125–135 (2008)

    Google Scholar 

  8. Fiala, J., Golovach, P.A., Kratochvíl, J.: Computational complexity of the distance constrained labeling problem for trees. In: Proc. 35th ICALP, Part I, pp. 294–305 (2008)

    Google Scholar 

  9. Goldberg, A.V., Rao, S.: Beyond the flow decomposition barrier. J. ACM 45, 783–797 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  10. Griggs, J.R., Yeh, R.K.: Labelling graphs with a condition at distance 2. SIAM J. Discrete Math. 5, 586–595 (1992)

    Article  MathSciNet  MATH  Google Scholar 

  11. Hasunuma, T., Ishii, T., Ono, H., Uno, Y.: An O(n 1.75) algorithm for L(2,1)-labeling of trees. Theor. Comput. Sci. 410, 3702–3710 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  12. Hasunuma, T., Ishii, T., Ono, H., Uno, Y.: A linear time algorithm for L(2,1)-labeling of trees. In: Proc. 17th ESA, pp. 35–46 (2009)

    Google Scholar 

  13. Havet, F., Reed, B., Sereni, J.-S.: Griggs and Yeh’s conjecture and L(p,1)-labelings. SIAM J. Discrete Math. 26, 145–168 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  14. Hopcroft, J.E., Karp, R.M.: An n 5/2 algorithm for maximum matchings in bipartite graphs. SIAM J. Comput. 2, 225–231 (1973)

    Article  MathSciNet  MATH  Google Scholar 

  15. Kratochvíl, J., Kratsch, D., Liedloff, M.: Exact algorithms for L(2,1)-labeling of graphs. In: Proc. 32nd MFCS, pp. 513–524 (2007)

    Google Scholar 

  16. Wang, W.-F.: The L(2,1)-labelling of trees. Discrete Appl. Math. 154, 598–603 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  17. Yeh, R.K.: A survey on labeling graphs with a condition at distance two. Discrete Math. 306, 1217–1231 (2006)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Acknowledgements

The authors would like to thank an anonymous referee for his/her helpful comments.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Hirotaka Ono.

Additional information

A part of this article was presented in Proceedings of the Algorithms—ESA 2009, 17th Annual European Symposium, Copenhagen, Denmark, September 7–9, 2009, Lecture Notes in Computer Science, vol. 5757, pp. 35–46, Springer, Berlin 2009 [12]. This work is partially supported by KAKENHI 20700002, 21680001, 23500022 and 24700001 and by the Kayamori Foundation of Informational Science Advancement.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Hasunuma, T., Ishii, T., Ono, H. et al. A Linear Time Algorithm for L(2,1)-Labeling of Trees. Algorithmica 66, 654–681 (2013). https://doi.org/10.1007/s00453-012-9657-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-012-9657-z

Keywords

Navigation