Springer Nature is making SARS-CoV-2 and COVID-19 research free. View research | View latest news | Sign up for updates

The edge-labeling and vertex-colors of K n

  • 2606 Accesses


A labeling of the edges of a graph is called vertex-coloring if the labeled degrees of the vertices yield a proper coloring of the graph. In this paper, we show that such a labeling is possible from the label set 1,2,3 for the complete graph K n , n ≥ 3.


All graphs in this note are simple and finite. For notation is not defined here, we refer the reader to[1].

For somekN, let f:E(G)→{1,2,…,k} be an integer labeling of the edges of a graph G = (V(G),E(G)) where V(G) = {v1,…,v n ,}. This labeling is called vertex-coloring if the labeled degrees S i := v j N ( v i ) f( v i v j ) for all integer 1 ≤ in of the vertices yield a proper vertex-coloring of the graph; ( i.e. the color of vertex v i is S i ). It is easy to see that for every graph which does not have a component isomorphic to K2, there exists such a labeling for some positive integer k.

In 2002, Karonski et. al.[2] conjectured that such a labeling with. k = 3 is possible for all such graphs (k = 2 is not sufficient as seen for instance in complete graphs and cycles of length not divisible by 4). At first constant bound of k = 30 was proved by Addario-Berry et. al.[3], which was later improved to k = 16 in 2008 by Addario-Berry et. al.[4], to k = 13 by Wang and Yu[5], and to k = 6 by Kalkowski, et. al.[6], Also, Kalkowski et. al. introduced the best bound for k = 5 in[7].

In this paper, we will show an algorithm for the complete graph K n labeling that improves the bound to k=3 that it is final value for k in the all graphs which are simple and finite.

The following theorem is the main result of this paper.

Theorem 1

Let n be a positive integer. Then for the complete graph K n , there is a labeling f:E(G)→{1,2,3}, such that the induced vertex weights S i := v j N ( v i ) f( v i v j ) properly color V(G), where 1 ≤ in.

The algorithm

It is trivial that the run of the algorithms in a regular graph specially in the complete graphs is harder than any other graphs, because these graphs have one case. In the following lemma, we will give an algorithm for the complete graph K n .

Lemma 1

There exists an edge-labeling with numbers 1, 2 and 3 for the complete graph K n such that the sum of the labels in all vertices is different.


These following algorithms calculates the minimum sum that there exist for all vertices of the complete graph K n . Indeed, this lower bound is for the regular graphs, which is the harder case and here we have only one case. We will prove that the lower bound of S n in the complete graph K n is S n n−1. □

Algorithm for K n : For n = 1,2, there is no such edge-labeling. For K3, we label the edge v1v2, v2v3 and v1v3 with 3,2 and 1, respectively, see Figure1. So, Suppose that n ≥ 4. Let V(K n ) = {1,…,n}. Note that every vertex of K n is adjacent with other n−1 vertices. Now label every edge with 1. Then, for 1 ≤ in, S i = n − 1.

Figure 1

1-2-3-edge labeling for graph K 3 and K 4 by the algorithm on K n .

Now for each v i , 2 ≤ in − 1, set k = i − 1. We add k times 1unit to some edges as following. Start with v i v n . If the label of edge v i v n < 3 then add one unit, otherwise, add one unit to next desired edge, i.e. that if the label of edge v i vn−1 < 3 then add one unit, otherwise, add one unit to next edge. After k stages, if the label of edge v i vi + 1 < 3, add one unit, otherwise, if S i Si−1 then there is no problem in the process and continue. But if S i = Si−1,set the label of edge v i vi−2 with 3 and continue.

With this algorithm for computing of S2, we have k = 1. The process start from v2v n . One can see that v2v n = 2 and v2v1 = v2v3 =⋯= v2vn−1 = 1. Then, S2 = n−2 + 2 = n.

With this algorithm for computing of S3, we have k = 2. The process start from v3v n and before process the label v3v n = 1 less than 3 and can add one unit. Now v3v n = 2. By doing again this process v3v n = 3. Finally v3v n = 3 and v3v1 = v3v2=⋯=v3vn−1 = 1, then S3= n−2 + 3 = n + 1.

With this algorithm for computing of S4, we have k = 3. The process start from v4v n and before process the label of v4v n = 1, with 2 time process v4v n = 3. Therefor, need to add one unit to it’s edges to finish process. We can continue adding with next edge that is v4vn−1. By doing this work v4v n = 3, v4vn−1 = 2 and v4v1= v4v2=⋯=v4vn−2 = 1, then S4 = n−3 + 3 + 2 = n + 2.

This algorithm must be do until, i = n −1 and the algorithm will be finished, and do not need to process for i = n, because this unit set in last units, with v1v n = 1, v2v n = 2 and v3v n =v4v n =⋯=vn−1v n = 3 and S n = 3(n−3) + 1 + 2 = 3n−6.

Finally, we obtain S1,S2,…,S n . Therefore, all edges of the complete graph K n labeled with 1,2 and 3 and having the desired property. In fact for the graph K n we find n series with finite sequences of numbers 1,2 and 3. In other words, for every i,1 ≤ in set S i := j = 1 n f( v i v j ) such that f(v i v i ) = 0 and f(v i v j )∈{1,2,3} for ij.

Then S1 = n−1 and S n = 3n−6 are the minimum and maximum labeled degrees of K n , respectively. Now the proof of Theorem 1 is complete.

Now one can ask that:

Question 1. Is there any such algorithm for arbitrary graph G?

In the rest of this paper we put the code of the algorithm of K n , such that with run of its we get the result of each complete graph K n .

The code is :set 1 all labels of edge

calcudeAllSum∖∖computing all S i

for(i = 1;i < Vertex.Size()−1;i + + )

{⋯Vertex vi = Vertex.elementAt(i);

Vector<Edge> e = getAllEdgesOfThisVertex(vi);

k = 0;

for(j = e.Size()−1;ji and k < i;j−−)

⋯∖∖startfrom v i v n


⋯⋯for(;k < i;k + + )



⋯⋯⋯∖∖if added one unit retuen true else return false






if(k < i)





⋯⋯⋯Edge e=GetEdgeOFVertex(vi,Vertex.elementAt(i−1))

⋯⋯⋯∖∖Find edge of v i and vi−1.






  1. 1.

    Kalkowski M, Kalkowski: A note on the 1,2-conjecture. submitted for publication.

  2. 2.

    Karonskiy M, Luczak T, Thomason A: Edge weights and vertex colours. Comb. Theory (Ser. B) J 2004, 91: 151–157. 10.1016/j.jctb.2003.12.001

  3. 3.

    Addario-Berry L, Dalal K, McDiarmid C, A Reed B, Thomason A: Vertex-colouring edge-wheitings. Combinatorical J 2007, 27: 1–12. 10.1007/s00493-007-0041-6

  4. 4.

    Addario-Berry L, Dalal K, Reed BA: Degree constrained subgraphs. Discrete Appl. Mathematics J 2008, 156: 1168–1174. 10.1016/j.dam.2007.05.059

  5. 5.

    Wang T, Yu Q: On vertex-coloring 13-edge-weighting. Front. Math. China 2008, 3: 1–7.

  6. 6.

    Kalkowski M, Karonski M, Pfender F: Vertax-Coloring Edge-Weithings With Integer Weights At Most 6. Publisher online 2003, 101–119.

  7. 7.

    Kalkowski M, Karonski M, Pfender F: Vertex-coloring edge-weightings: Towardsthe1–2-3-conjecture. Comb. Theory Ser. B J 2010, 100: 347–349. 10.1016/j.jctb.2009.06.002

Download references

Author information

Correspondence to Mohammad hadi Alaeiyan.

Additional information

Competing interests

The author did not provide this information.

Authors’ original submitted files for images

Below are the links to the authors’ original submitted files for images.

Authors’ original file for figure 1

Authors’ original file for figure 2

Rights and permissions

Open Access This article is distributed under the terms of the Creative Commons Attribution 2.0 International License (https://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Reprints and Permissions

About this article

Cite this article

Alaeiyan, M.h. The edge-labeling and vertex-colors of K n . Math Sci 6, 45 (2012). https://doi.org/10.1186/2251-7456-6-45

Download citation


  • Edge-labeling
  • Vertex-coloring
  • Complete graph
  • 05C15
  • 05C78