Group irregularity strength of connected graphs

We investigate the group irregularity strength (sg(G)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$s_g(G)$$\end{document}) of graphs, that is, we find the minimum value of s\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$s$$\end{document} such that for any Abelian group G\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathcal G $$\end{document} of order s\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$s$$\end{document}, there exists a function f:E(G)→G\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$f:E(G)\rightarrow \mathcal G $$\end{document} such that the sums of edge labels at every vertex are distinct. We prove that for any connected graph G\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$G$$\end{document} of order at least 3\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$3$$\end{document}, sg(G)=n\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$s_g(G)=n$$\end{document} if n≠4k+2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n\ne 4k+2$$\end{document} and sg(G)≤n+1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$s_g(G)\le n+1$$\end{document} otherwise, except the case of an infinite family of stars. We also prove that the presented labelling algorithm is linear with respect to the order of the graph.


Introduction
It is a known fact that in any simple graph G there are at least two vertices of the same degree.The situation changes if we consider multigraphs.Each multiple edge may be represented with some integer label and the (weighted) degree of any vertex x is then calculated as the sum of labels over all edges incident to x.The maximum label s is called the strength of the labelling.
The labelling itself is called irregular if the weighted degrees of all the vertices are distinct.The smallest value of s that allows some irregular labelling is called irregularity strength of G and denoted by s(G).
On the other hand, numerous authors studied various labelling problems when elements of finite Abelian groups were used instead of integers to label either vertices or edges of graph.We give only few examples here.Graham and Sloane in [11] studied harmonious graphs, i.e., graphs for which there exists an injection f : V (G) → Z q that assigns to every edge (x, y) ∈ E(G) unique sum f (x) + f (y) modulo q.Beals et al. (see [4]) considered the concept of harmoniousness with respect to arbitrary Abelian groups.Żak in [19] generalized the problem and introduced new parameter, harmonious order of G, the smallest number t such that injection f : V (G) → Z t (or surjection if t < V (G)) produces distinct edge sums.Hovey in [12] considers the so-called A − cordial labellings, where for a given Abelian group A and a graph G one wants to obtain such a vertex labelling that the classes of vertices labelled with one label are (almost) equinumerous and so are the classes of edges with the same sums.Cavenagh et al. ( [5]) consider edgemagic total labellings with finite Abelian groups, i.e., the labelings of vertices and edges resulting in equal edge sums.Froncek in [9] defined the notion of group distance magic graphs, i.e., the graphs allowing the bijective labelling of vertices with elements of an Abelian group resulting in constant sums of neighbour labels.Stanley in [17] studied the vertex-magic labellings of edges with the elements of an Abelian group A, i.e., labellings, where the resulting weighted degrees are constant.Kaplan et al. in [14] considered vertex-antimagic edge labellings, i.e., the bijections f : E(G) → A, where A is a cyclic group, resulting in distinct weighted degrees of vertices.
The problem considered in this paper arises as the complement of the research conducted so far.Assume we are given an arbitrary graph G of order n with no components isomorphic to K 1 or K 2 .Assume G is an Abelian group of order m ≥ n with the operation denoted by + and neutral element 0. For convenience we will write ka to denote a + a + • • • + a (where element a appears k times), −a to denote the inverse of a and we will use a − b instead of a + (−b).Moreover, the notation a∈S a will be used as a short form for a 1 + a 2 + a 3 + . . ., where a 1 , a 2 , a 3 , . . .are all the elements of the set S.
We define edge labelling f : E(G) → G leading us to the weighted degrees defined as the sums: We call f G-irregular if all the weighted degrees are distinct.The group irregularity strength of G, denoted s g (G), is the smallest integer s such that for every Abelian group G of order s there exists G-irregular labelling f of G.The main result of our paper is the following theorem, determining the value of s g (G) for every connected graph G of order n ≥ 3.
Theorem 1.1.Let G be arbitrary connected graph of order n ≥ 3. Then We also show that the following theorem is true.
Theorem 1.2.Let G be arbitrary connected graph of order n ≥ 3.Then, for every k > s g (G) and every finite Abelian group G of order k, G admits a G-irregular labelling, except for the cases when: ) q for some q such that 3 q = n + 1 q for some q such that 2 q = n + 2.
2 Proof of Theorem 1.1 In order to distinguish n vertices in the graph we need at least n distinct elements of G.However, n elements are not always enough, as shows the following lemma.
Proof.Let G be an Abelian group of order n = 2(1 + 2k).The fundamental theorem of finite abelian groups states that the finite abelian group G can be expressed as the direct sum of cyclic subgroups of prime-power order.This implies that and p i > 2 for i = 1, . . ., m are not necessarily distinct primes.This implies that one can write a ∈ G as a = (a 0 , a 1 , . . ., a m ).Notice that in the group G we have 1 + 2k elements with the first coordinate 0 and 1 + 2k with the first coordinate 1.Let now w(G) = v∈V (G) w(v) = a∈G a. Observe that w(G) is a vector with the first coordinate 1 (since we are summing in Z 2 ).
On the other hand w(G) = v∈V (G) ( ev f (e)), so each label f (e) for any e ∈ E(G) appears in the sum twice.Therefore w(G) is a vector with the first coordinate 0 (since we are summing in Z 2 ), contradiction.
We continue with the following lemma, determining the group irregularity strength of stars.Lemma 2.2.Let K 1,n−1 be a star with n − 1 pendant vertices and n ≥ 3. Then Proof.If n is odd then we put all the elements of G other than 0 on the pendant edges and obtain this way distinct weighted degrees (same as edge labels) on the leafs and weighted degree 0 in the central vertex.
If n = 4k for some k ≥ 1, then we distinguish two cases, depending on the number of involutions.If there is only one involution, then it is guaranteed that there exists a subgroup of G isomorphic with Z 4 : {0, a, 2a, 3a} (2a is the only involution here).In such a situation we label the edges with all the elements of G except 3a, assigning this way the same values to the weighted degrees of all the pendant vertices.It is straightforward to check that the weighted degree of central vertex is 3a.If there are at least two involutions, then the sum of all the elements of G is 0 (see e.g.[7], Lemma 8).We put on the edges all the elements of G but 0 and thus obtain distinct weighted degrees of pendant vertices not equal to 0 and weighted degree 0 of the central vertex.
If n = 4k + 2 for some natural k ≥ 1, the order of G must be at least 4k + 3 by Lemma 2.1.Assume that |G| = 4k + 3, then there is no involution in G.If there is an element a in G of order more than 3, then we assign to three edges labels a, −2a and 0 and we put 2k − 1 pairs {a j , −a j }, where a j ∈ {0, a, −a, 2a, −2a}, on the remaining edges, obtaining this way the G-irregular labelling.
If all the elements of G have order 3, then n = 3 q − 1 and Assume we are able to label K 1,n−1 with n + 1 labels from G. In such a situation we would have to use n − 1 distinct elements of G on the edges, which would leave us two distinct elements, say a 1 and a 2 .The weighted degree of the central vertex would be −(a 1 + a 2 ).This number should be distinct from all other degrees, so one of the equalities −(a 1 + a 2 ) = a 1 or −(a 1 + a 2 ) = a 2 should be satisfied.In both cases it follows that a 1 = a 2 , contradiction.Thus we have to use the group G of order at least n + 2 in order to obtain G-irregular labelling.Observe that n + 2 can not be equal to 2 p for any natural number p (this follows from the Mihǎilescu Theorem, also known as the Catalan Conjecture, see [15]).Thus in any group of order n + 2 there are two distinct elements a 1 and a 2 such that a 1 + a 2 = 0.If there is more than one involution in G, then we label the edges with all the elements of G but 0, a 1 and a 2 and obtain this way the sum 0 at the central vertex, distinct from all the other weighted degrees.If there is exactly one involution i in G, then G has a subgroup G 1 isomorphic with Z 4 : G 1 = {0, a, 2a = i, 3a}.Thus we can put 0, a and 2a on three of the edges of the star.The remaining 4k elements of G form 2k distinct pairs {a j , −a j } such that a j ∈ G 1 , so we can put 2k − 1 of them on the remaining edges.Finally the central vertex obtains the weight 3a and all the vertex weights are distinct.Now we are going to determine the value of s g (K 1,n−1 ) for arbitrary tree T not being a star.Lemma 2.3.Let T be arbitrary tree on n ≥ 3 vertices not being a star.Then Proof.Assume we coloured properly the vertices of T with two colours, obtaining colour classes V 1 and V 2 .Given any two vertices x 1 and x 2 , there exists unique path P (x 1 , x 2 ) that joins them.If x 1 and x 2 belong to the same colour class, then the path consists of odd number of vertices and even number of edges (we will call such a path odd path).If x 1 and x 2 belong to distinct colour classes, then the path consists of even number of vertices and odd number of edges (we will call such a path even path).
We start with 0 on all the edges of T .Then, in every step, we will add some labels to all the edges of chosen path P (x 1 , x 2 ).To be more specific, we will add some label a to all the edges having odd position on the path (starting from x 1 ) and −a to all the edges having even position.We will denote such situation by φ(x 1 , x 2 ) = a.Observe that if P (x 1 , x 2 ) is odd, then putting φ(x 1 , x 2 ) = a increases the weighted degree of x 1 by a and the weighted degree of x 2 by −a.If P (x 1 , x 2 ) is even, then the weighted degrees of x 1 and x 2 increase by a.In both cases the weighted degrees of the remaining vertices stay unchanged.
Let us start with the case when n = 2k + 1 for some integer k ≥ 1.Let G be an arbitrary Abelian group of order n.As G does not have any elements of order 2, we can choose k elements a 1 , a 2 , . . ., a k ∈ G such that a i ∈ {a j , −a j } for i = j and a i = 0 for 1 ≤ i ≤ k.One of the colour classes of V (T ), say V 1 , has odd number of vertices and V 2 even.We join the vertices of V 2 in pairs, then do the same with all the vertices in V 1 but one, say x 0 .We obtained this way exactly k monochromatic pairs (x j,1 , x j,2 ).Now we put φ(x j,1 , x j,2 ) = a j , for 1 ≤ j ≤ k.This way we obtain the G-irregular weighting: w(x 0 ) = 0, w(x j,1 ) = a j for 1 ≤ j ≤ k, w(x j,2 ) = −a j for 1 ≤ j ≤ k.
If n = 4k for some integer k ≥ 1, then we distinguish two cases.If there is only one involution in G, then there exists a subgroup {0, a, 2a, 3a} of G, where 2a is the only element of order 2 in G.In such a case we choose two vertices x 1 , x 2 from one of the color classes and one vertex x 0 from the other one.We put φ(x 0 , x 1 ) = a and φ(x 0 , x 2 ) = 2a, obtaining this way w(x 1 ) = a, w(x 2 ) = 2a and w(x 0 ) = 3a.The number of the remaining vertices in one of the color classes is now odd and in the second one even.Thus we can proceed as in the case of n odd, using the remaining labels {a j , −a j } such that a j ∈ {a, 2a, 3a} and obtaining this way G-irregular labelling of T .If there are more involutions a 1 , a 2 , . . ., a r , then their number r is odd and their sum equals 0 (see e.g.[7], Lemma 8).If r ≤ n/2, then we choose one vertex x 0 from the colour class with less vertices (say V p ) and r vertices x 1 , x 2 , . . ., x r from V 3−p and we put φ(x 0 , x j ) = a j for j = 1, . . ., r.This way we obtain w(x 0 ) = 0 and w(x j ) = a j for j = 1, . . ., r.If the numbers of vertices in V 1 and V 2 are both even, we continue like in the case of n odd (this time we do not obtain w(x) = 0 for any new vertex).If both numbers are odd, we choose one vertex x r+1 from V p and any element a r+1 ∈ {0, a 1 , . . ., a r }.By putting φ(x 0 , x r+1 ) = a r+1 we obtain finally w(x 0 ) = a r+1 and w(x r+1 ) = −a r+1 .Now the number of remaining vertices in V p is even and in V 3−p odd.As we finally did not assign weighted degree 0 to any vertex, we can proceed as in the case of n odd.Last case to analyse here is when and all the elements of G but 0 have order 2. In such case we chose any vertex x 0 of T and put φ(x 0 , x j ) = a j for j = 1, . . ., n − 1 for distinct elements a j = 0.This way we obtain w(x j ) = a j = 0 for j = 1, . . ., n − 1 and w(x 0 ) = 0.
If n = 4k + 2, then we will use the group of order n + 1.We have to distinguish two cases.If both colour classes of T are even, then we proceed as in the case when n is odd (the difference is that there is no vertex x 0 with w(x 0 ) = 0).If both colour classes are odd, we have to start with reducing their sizes in such a way that they both become even.
If there is an element of G of order greater than 3, say a, then we select three arbitrary vertices x 1 , x 2 , x 3 from one colour class and any vertex x 0 from the other one and we put φ(x 1 , x 0 ) = a, φ(x 2 , x 0 ) = −2a, φ(x 3 , x 0 ) = 0.This way we obtain the following weighted degrees: w(x 0 ) = −a, w(x 1 ) = a, w(x 2 ) = −2a, w(x 3 ) = 0.As we can easily see, these degrees are distinct and we still have k − 2 pairs of elements {a j , −a j } to label the remaining vertices as in the previous cases.
If all the elements of G have order 3, then n ≥ 26 (in fact, we need only n ≥ 10).We choose a, b, c As T is not star, we can choose five vertices x 1 , x 2 , x 3 , x 4 , x 5 from one colour class and three y 1 , y 2 , y 3 from another one.Now we put φ( and we still have 2k−3 pairs {a j , −a j } to distinguish remaining even numbers of vertices in both colour classes.
The main result of our paper follows easily from the above lemmas.If G is a star, then we use lemma 2.2.Otherwise we choose any spanning tree of G not being a star, and use lemmas 2.3 and 2.1, labelling all the remaining edges with 0.

Proof of Theorem 1.2
Before we prove Theorem 1.2, we need the following technical lemma that was proved in [3].

Lemma 3.1 ([3]). Let G be an Abelian group with involutions set
In the next step we are going to show the construction of desired labelling for stars.Lemma 3.2.Let K 1,n−1 be a star with n − 1 pendant vertices and n ≥ 3. Then K 1,n−1 admits G-irregular labelling for any finite Abelian group G of order k > s g (K 1,n−1 ) except the cases when for some q such that 3 q = n + 1 and G ∼ = Z 2 × Z 2 × . . .× Z 2 = (Z 2 ) q for some q such that 2 q = n + 2.
Proof.We can write k = 2 p (2m + 1) for some natural numbers p and m.
Suppose first that there exists at most one involution i ∈ G or 2m ≥ n−1.If n is odd then we put n−1 2 pairs {a j , −a j } (a j = 0) on the pendant edges and obtain this way distinct weighted degrees (same as edge labels) on the leafs and the weighted degree 0 in the central vertex.
If n is even and there is an element a ∈ G of order more than 3, then we assign to three edges labels a, −2a and 0 and we put n−4 2 pairs {a j , −a j }, where a j ∈ {0, a, −a, 2a, −2a}, on the remaining edges, obtaining this way the G-irregular labelling of G (such number of pairs exist, as k > n).
If n is even and all the elements of G have order less than 4 and there exists the involution i ∈ G then k ≥ n + 2 (as k is even) and we assign to three edges labels a, i and 0 and we put n−4 2 pairs {a j , −a j }, where a j ∈ {0, a, −a, i, a + i, −a + i}, on the remaining edges, obtaining this way the G-irregular labelling.
Finally, if all the elements of G have order 3, then k = 3 r for some r and = n and n ≡ 0 (mod 4) by Theorem 1.1.Assume that we are able to label K 1,n−1 with n + 1 labels from G. In such a situation we would have to use n − 1 distinct elements of G on the edges, which would leave us two distinct elements, say a 1 and a 2 .The weighted degree of the central vertex would be −(a 1 + a 2 ).This number should be distinct from all other degrees, so one of the equalities −(a 1 + a 2 ) = a 1 or −(a 1 + a 2 ) = a 2 should be satisfied.In both cases it follows that a 1 = a 2 , contradiction.Thus we have to use the group G of order at least n + 2 in order to obtain G-irregular labelling.Observe that n + 2 can not be equal to 2 p for any natural number p (this follows from the Mihǎilescu Theorem, also known as the Catalan Conjecture, see [15]).Thus in any group of order n + 2 there are two distinct elements a 1 and a 2 such that a 1 + a 2 = 0. We label the edges with all the elements of G but 0, a 1 and a 2 and obtain this way the sum 0 at the central vertex, distinct from all the other weighted degrees.Thus we can assume that n + 3 ≤ k and we assign to three edges labels a, b = 2a and 2a + 2b and we put n−4 2 pairs {a j , −a j }, where a j ∈ {0, a, 2a, b, 2b, a + b, 2a + 2b}, on the remaining edges, obtaining this way the G-irregular labelling.
Suppose now that there exist t > 1 involutions i 1 , . . ., i t in G. Recall that t = 2 q − 1 for some 1 < q ≤ p and t j=1 i t = 0 (see e.g.[7], Lemma 8).Let I ⋆ denote the set of all the involutions and let I = I ⋆ ∪ {0}.
If t ≤ n, then in the case n being even (odd) we put i j on j = 1, . . ., t (respectively j = 1, . . ., t − 1) on t (respectively t − 1) edges and (n − t − 1)/2 ((n − t)/2, respectively) distinct pairs {x l , −x l } on the remaining edges.We obtain this way distinct weighted degrees (same as edge labels) on the leafs and the weighted degree 0 (i t , respectively) in the central vertex.
Assume now that t = n+1, therefore n is even.If there exists an element a ∈ G such that 2a = 0, then we assign to two edges labels a, −a.Using Lemma 3.1, we can choose n − 2 = 2 q − 4 elements i j 1 , i j 2 , . . ., i We put the elements i j 1 , i j 2 , . . ., i j n−3 on the remaining edges, obtaining this way the G-irregular labelling.If there is no such element a ∈ G, then Let us consider now the case t ≥ n + 2. We have that 2 < n < 2 p − 2, thus using Lemma 3.1 we can choose n elements i j 1 , i j 2 , . . ., i jn ∈ I such that n l=1 i j l = 0.
We put the elements i j 1 , i j 2 , . . ., i j n−1 on the edges obtaining this way distinct weighted degrees (same as edge labels) for the leafs and the weighted degree i n for the central vertex.
Lemma 3.3.Let T be arbitrary tree on n ≥ 4 vertices not being a star.Then T admits G-irregular labelling for any abelian group G of order k > s g (T ) except the case when G ∼ = Z 2 × Z 2 × . . .× Z 2 = (Z 2 ) q for some q such that 2 q = n + 2.
Proof.We can write k = 2 p (2m + 1) for some natural numbers p and m.
Suppose first that there exists exactly one involution i ∈ G or 2m ≥ n − 1.If now n is odd or both colour classes of T are even, then since we have at least ⌊ n 2 ⌋ pairs {a i , −a i } such that 2a i = 0, we join the vertices of V 1 in pairs (except possibly one vertex if |V 1 | is odd), then do the same with all the vertices in V 2 .We obtain this way exactly ⌊ n 2 ⌋ monochromatic pairs (x j,1 , x j,2 ) plus possibly one additional vertex, say x 0 .Now we put φ(x j,1 , x j,2 ) = a j , for 1 ≤ j ≤ ⌊ n 2 ⌋.This way we obtain the G-irregular weighting, as w(x j,1 ) = a j = −w(x j,2 ) for 1 ≤ j ≤ k and if n is odd, then w(x 0 ) = 0.
Consider now the case when both color classes are odd.
If there is an element a ∈ G of order greater than 3 or there exists involution i ∈ G (thus k ≥ n + 2), then we select three arbitrary vertices x 1 , x 2 , x 3 from one colour class and any vertex x 0 from the other one.In the first situation we put φ(x 1 , x 0 ) = a, φ(x 2 , x 0 ) = −2a, φ(x 3 , x 0 ) = 0.This way we obtain the following weighted degrees: w(x 0 ) = −a, w(x 1 ) = a, w(x 2 ) = −2a, w(x 3 ) = 0.In the second situation we choose some a ∈ {0, i} and we put φ(x 1 , x 0 ) = i, φ(x 2 , x 0 ) = a, φ(x 3 , x 0 ) = 0.This way we obtain the following weighted degrees: w(x 0 ) = a + i, w(x 1 ) = i, w(x 2 ) = a, w(x 3 ) = 0.As we can easily see, these degrees are distinct and since n is even and k ≥ n+1 (k ≥ n+2, respectively) we still have at least n−4 2 pairs of elements {a j , −a j } to label the remaining vertices as in the previous cases.
Suppose now that there exist t > 1 involutions in G. Recall that t = 2 q −1 for some 1 < q ≤ p.If t ≤ n, then we choose t vertices x 1 , x 2 , . . ., x t ∈ V 1 ∪V 2 in such a way, that at least one of the numbers of remaining vertices in V 1 and V 2 is even.We put φ(x 1 , x j ) = i j for j = 2, . . ., t obtaining w(x j ) = i j for j = 1, . . ., t.Since the numbers of remaining vertices in at least one of the colour classes V 1 and V 2 are even, we construct ⌊ n−t 2 ⌋ monochromatic pairs and use the pairs {x l , −x l } to label them.If there is some unpaired vertex, then its weighted degree is 0, so the obtained labelling is G-irregular.
Assume now that t = n + 1.If there exists an element a ∈ G such that 2a = 0, then we choose two vertices x n−1 , x n from one colour class and we put φ( We put φ(x 1 , x l ) = i j l for l = 2, . . ., n − 2. This way we obtain w(x l ) = i j l for l = 1, . . ., n − 2. If there does is no such element a ∈ G, then As in the proof of Lemma 3.2 let us assume that we distinguished all vertices and we did not use labels On the other hand each label f (e) for any e ∈ E(G) appears in the sum twice.Therefore v∈V (G) w(v) = 0.This contradiction shows that it is impossible to find desired labelling in such a case.
Let us consider now the case t ≥ n + 2. We have 2 < n < 2 q − 2, thus using Lemma 3.1 we can choose n elements i j 1 , i j 2 , . . ., i jn such that n−1 l=1 i j l = 0. We put φ(x 1 , x l ) = i j l for l = 2, . . ., n.This way we obtain w(x l ) = i j l for l = 1, . . ., n.
Theorem 1.2 follows easily from the above lemmas.If G is a star, then we use Lemma 3.2.Otherwise we choose any spanning tree of G not being a star, and use Lemma 3.3 labelling all the remaining edges with 0. Observe that in the latter case same argument as in the proof of Lemma 3.3 shows that for every graph G it is impossible to find G-irregular labelling of G if G ∼ = (Z 2 ) q for some q such that 2 q = n + 2.

Computational Complexity Issues
In Section 2, the group irregularity strength s g (G) of an arbitrary connected graph G was determined.It seems natural to ask about the computational complexity of the corresponding problem, where we assume that the group G is given in the most compact form that follows from the fundamental theorem of Abelian groups.

Irregular Labeling.
Instance: A connected graph G, an Abelian group G of order |G|, given as the list of (orders of) cyclic subgroups G 1 , . . ., G k of prime-power order such that G ∼ = G 1 × . . .× G k .Task: Find a G-irregular labelling of G or answer that it is impossible.
The proofs in Section 2 and Section 3 are constructive and lead to efficient algorithms for the Irregular Labeling problem.
In order to construct an irregular labeling whose existence is proved in Section 2, we first construct, in time The rest of the construction of the irregular labeling reduces to solving constantly many instances of the following problem: Given a tree T = (V, E) and a non-empty set A ⊆ V of even cardinality, partition the elements of A into pairs, say {a 1 , a 2 }, . . ., {a 2r−1 , a 2r }, and construct the corresponding paths P (a 1 , a 2 ), . . ., P (a 2r−1 , a 2r ) joining them.The problem is clearly solvable in polynomial time.However, if the set A is large (as is the case for the subproblems one needs to solve in order to construct an irregular labeling), the total length of the paths P (a 1 , a 2 ), . . ., P (a 2r−1 , a 2r ) can be of the order Ω(|V | 2 ).Can one do better?In particular, can the Irregular Labeling problem be solved in linear time?We will show in this section that this is indeed the case.With this goal in mind, we introduce the following optimization problem: Shortest Path Collection.Instance: A tree T = (V, E) and a non-empty set A ⊆ V of even cardinality.

Task:
Find a partition of the elements of A into pairs, say {{a 1 , a 2 }, . . ., {a 2r−1 , a 2r }} such that the value of Here, the distance dist T (•, •) is the usual graph-theoretic distance between vertices, that is, the number of edges on a shortest path connecting the two vertices.The Shortest Path Collection problem can be solved in polynomial time not only for trees but also for general graphs.In fact, it can be solved in time O(|V ||E| + r 4 ) where |A| = 2r, by first computing in time O(|V ||E|) all pairwise vertex distances (this can be done using breadthfirst search), and then solving an instance of the minimum weight perfect matching problem in a complete graph with vertex set A and edge weights given by w(xy) = dist T (x, y) for all pairs of distinct vertices x, y ∈ A (this can be done, e.g., using the algorithm by Edmonds [8]).As we show below, the problem can be solved in linear time for trees.Proposition 4.1.There exists a linear time algorithm for the Shortest Path Collection problem.Moreover, an optimal collection P of shortest paths, each connecting one pair of vertices from the partition of A, can be constructed in linear time.
Proof.Let (T, A) be an instance to the Shortest Path Collection problem.The problem can be solved using a greedy algorithm, traversing the given tree T = (V, E) bottom up and constructing optimal paths along the way.The algorithm outputs a pair (A, P), where A is a partition of the elements of A into pairs {a 1 , a 2 }, . . ., {a 2r−1 , a 2r }, and P is the collection of corresponding paths in T connecting the paired vertices.Traversing the tree bottom up, the algorithm updates two collections P and Q of paths in T such that: (1) every path from P has exactly two endpoints in A (in particular, P does not contain any trivial, one-vertex paths), (2) every path from Q has exactly one endpoint in A (in particular, Q can contain several trivial paths), (3) no path from Q has a vertex in common with another path in P ∪ Q, and (4) every two paths in P are edge disjoint, and have at most one vertex in common.
The set Q contains all paths that will be eventually extended to a path in the final solution P.Moreover, for each path Q ∈ Q, its endpoints are denoted by a(Q), b(Q) in such a way that a(Q At every step of the algorithm, a vertex, say v i , of T is visited.Paths of Q that have a child of v i as one of their endpoints are greedily paired and merged, using vertex v i , to form paths in P. At the end of this pairing procedure, one path from Q that has a child of v i as one of its endpoints could be left unpaired, in which case we extend it by the edge connecting one of its endpoints to v i .If v i belongs to A, this extended path is moved from Q to P. On the other hand, if all paths have been paired, then we check whether v i belongs to A and if this is the case, we add to Q the trivial one-vertex path consisting of v i . Every time a path, say P , is added to the set P, the set A is augmented with the pair containing the two endpoints of P .Moreover, the algorithm keeps at every vertex a Boolean variable q(v) such that q(v) = 1 if and only if v is an endpoint of a path in Q immediately after v is visited by the algorithm.
A pseudocode of the algorithm is given below (Algorithm 1).In the description of the algorithm, we denote by P 1 + P 2 the path obtained as the union of two edge-disjoint paths P 1 and P 2 meeting at a vertex.Similarly, P 1 + P 2 + P 3 denotes the union of three paths (P 1 + P 2 ) + P 3 .
To establish the correctness of the algorithm, we will show that the obtained solution attains a lower bound on the optimal value.For every vertex v of tree T rooted at a fixed vertex r, let k(v) denote the number of subtrees T i of T rooted at the children of v such that |A∩V (T i )| is odd.Then, for every feasible solution A ′ to the problem, the corresponding collection P ′ of shortest paths contains at least k(v) edges connecting v to its children.In particular, this implies that the optimal value of r i=1 dist T (a 2i−1 , a i ) is at least v∈V (T ) k(v).Now let us verify that the value of r i=1 dist T (a 2i−1 , a i ) attained by the solution A given by Algorithm 1 is equal to v∈V (T ) k(v).For every i = 1, . . ., n, let P i and Q i denote the collections of paths P and Q after i iterations of the for loop in line 3 (that is, immediately after vertex v i has been visited).Properties (1)-(4) described above (with P i and Q i in place of P and Q, respectively) can be proved by induction on i.Moreover, for every 1 ≤ i < j ≤ n, it holds that P i ⊆ P j , every path in Q i is a subpath of some path in P j ∪ Q j , and P n = P, where P is the final solution output by the algorithm.Since the paths in P are edge-disjoint, the obtained value of r i=1 dist T (a 2i−1 , a i ) is equal to the total number of edges that appear in paths in P. Induction on i can be used to show that: Algorithm 1: Solving the Shortest Path Collection problem in trees Input: A tree T = (V, E) and a non-empty set A ⊆ V with |A| even.Output: A pair (A, P), where A is a partition of the elements of A into pairs {a 1 , a 2 }, . . ., {a 2r−1 , a 2r }, minimizing r i=1 dist T (a 2i−1 , a i ), and P is the collection of corresponding shortest paths.
1 Fix a root r ∈ V , and let v 1 , . . ., vn = r be the vertices of T listed in reverse order with respect to the time they are visited by a breadth-first traversal from r.    groups, G can be represented with the minimum-length list of the orders of cyclic groups (e.g.(2,6) instead of (2, 2, 3), as Z 6 ∼ = Z 2 × Z 3 ), and it would not change the method of the division of G.It can also be represented as the list of generators with the relations of the form n j g j = 0 (in the above example: G = [g 1 , g 2 |2g 1 = 6g 2 = 0]) but in such a case the list of multipliers n j is equivalent to the list of orders of cyclic groups.Of course, in all those cases the complexity of division remains O(|G|).

Final Remarks
As we solved the problem for all connected graphs, next step would be to find the solution for arbitrary graphs.
Problem 5.1.Determine group irregularity strength s g (G) for disconnected graph G with no component of order less than 3.
Theorem 1.2 characterises all the pairs (G, G), |G| > s g (G), such that there exists an irregular-G-labeling of given connected graph G of order at least 3. Thus the following generalisation arises.Problem 5.2.Characterise all the pairs (G, G), |G| > s g (G), such that there exists an irregular-G-labeling of given graph G with no components of order less than 3.
In the proof of Theorem 1.1 we often use the fact that we are allowed to use 0 on edges.Thus next natural problem is the following.Problem 5.3.Let G be a simple graph with no components of order less than 3.For any Abelian group G, let G * = G \ {0}.Determine non-zero group irregularity strength (s * g (G)) of G, i.e., the smallest value of s such that taking any Abelian group G of order s, there exists a function f : E(G) → G * such that the sums of edge labels in every vertex are distinct.
All the elements of G can be obtained as some combination of not necessarily all of its elements, in particular of its generators.The question is, how many elements of G we have to use in order to obtain G-irregular labelling.Problem 5.4.Assume that for given simple graph G with no components of order less than 3 there exists G-irregular labelling for every group G of order s.What is the minimum number k = k(G, s) such that for every group G of order s there is a subset S ⊆ G, |S| ≤ k such that there exists a G-irregular labelling f : E(G) → S? So far we considered only finite Abelian groups.So, next question seems to be natural, as some generalization of the problem of the ordinary irregularity strength.
Problem 5.5.Let G be a simple graph with no component of order less than 3. Determine the smallest value of k such that for any infinite Abelian group G there exists a subset S ⊆ G, S ≤ k such that there exists a G-irregular labelling f : E(G) → S.
and k = 2 p = n + 2. Let us assume that we managed to distinguish all the vertices and we did not use labels a, b ∈ G (a = b).Thus v∈V (G) w(v) = g∈G g − a − b = −a − b = 0. On the other hand each label f (e) for any e ∈ E(G) appears in the sum twice.Therefore v∈V (G) w(v) = 0.The contradiction shows that it is impossible to find desired labelling if G ∼ = Z 2 × Z 2 × . . .× Z 2 and 2 p = n + 2.

17
Add the pair {a(Q), v i } to A.

18 else 19
Add the path Q are at the root 26 Let C be the set of children of vn = r, and let R = {v ∈ C : q(v) = 1}.27Fixan ordering u 1 , . . ., u k of the elements of R.28 for j = 1, . . ., ⌊k/2⌋ do 29 Let Q and Q ′ be the paths in Q with b(Q) = u 2j−1 and b(Q ′ ) = u 2j .30 Add the path Q + (u 2j−1 , r, u 2j ) + Q ′ to P. 31 Add the pair {a(Q), a(Q ′ )} to A. 32 Remove Q and Q ′ from Q. 33 if k is odd then // it must be the case that r ∈ A 34 Let Q ∈ Q be the path in Q with b(Q) = u k .35Add the path Q + (u k , r) to P.36Add the pair {a(Q), r} to A.37Remove Q from Q.38 return (A, P)