Graceful Labeling Algorithms and Complexity – a Survey

Graceful graphs were first studied by Rosa in 1966. The Kotzig-Ringel graceful tree conjecture states that every tree has a graceful labeling. Aldred and McKay and others have used computer programs to show that trees of order up to 35 are graceful. Bagga et al. investigated algorithms for generating all graceful labelings of certain known classes of graceful graphs, including paths, cycles, and certain other classes of unicyclic graphs. The data generated by such algorithms has led to the discovery of new properties of such graceful labelings. In this paper we present a survey of graceful graph labeling algorithms and related complexity issues.DOI : http://dx.doi.org/10.22342/jims.0.0.14.1-9


Introduction
For a graph G, we are interested in labeling the vertices and/or edges of G with nonnegative integers.More formally, a labeling of a graph G = (V, E) is a oneone mapping f : V → X, where X is a (finite) set of nonnegative integers.Such a vertex labeling f induces an edge labeling, where an edge e = uv gets the label |f (u) − f (v)|.Suppose that G has q edges.We are interested in labelings where the set of possible labels X is {0, 1, 2, ..., q} or {0, 1, 2, ..., 2q}.Rosa [23] called such a labeling a valuation.He considered four special types of valuations.
Let f be a valuation of a graph G with q edges.
Observe that the above definitions are from the strongest to weakest in the sense that every α-valuation is also a β-valuation, every β-valuation is also a σvaluation, and every σ-valuation is also a ρ-valuation.Golomb [18] introduced the term graceful labeling for a β-valuation.A graceful graph is one that has a graceful labeling.Rosa's paper [23] generated much research activity in this area and led to a large number of publications.A substantial part of this research effort has been devoted to finding new families of graceful graphs.Several variations of the concept have also been studied.We refer the reader to Gallian's ongoing survey [16] for an excellent account of research in this area.One of the foremost open problems is the Ringel-Kotzig conjecture that every tree is graceful.As noted by Gallian [16], Aldred and McKay proved, with the aid of a computer program, that all trees with at most 27 vertices are graceful.This has been extended to trees of order up to 35 [15,20].It is also known that paths, caterpillars and several other subclasses of trees are graceful.
In this paper we present a survey of graceful graph labeling algorithms and related complexity issues.In Section 2, we discuss computational efforts aimed at verifying the graceful tree conjecture.In Section 3, we look at complexity issues in graceful graphs.In Section 4, we survey recent results on generating all graceful labelings of certain families of unicyclic graphs.In Section 4, we discuss other computational and mathematical methods for determining gracefulness.Finally, we conclude in Section 5 with a summary and some open problems.

Graceful Tree Conjecture
Rosa considered the above valuations in order to investigate decompositions of graphs into trees.For the sake of completeness, we include a brief discussion here.A decomposition of a graph G = (V, E) can be considered to be a partition of the edge set E into subsets E 1 , E 2 , ..., E r .If H i is the subgraph of G induced by E i , then we also say the G decomposes into subgraphs {H i }.If the subgraphs H i are all isomorphic to a single graph (say) H then we say that G is H − decomposable and we write H|G.In 1963, Ringel [22] made the following conjecture.
Conjecture 2.1.If T is a tree with m edges, then K 2m+1 decomposes into 2m + 1 copies of T .
Theorem 2.2.If a tree T with m edges has a graceful labeling, then K 2m+1 decomposes into 2m + 1 copies of T .
In fact, Rosa proved more.A decomposition of K n by r copies of a subgraph H is called a cyclic decomposition if, when K n is drawn appropriately with its vertices on a regular polygon, the r copies of H can be obtained by rotations of an appropriate copy of H. Rosa [23] proved the following results.
Theorem 2.3.Let G be a graph with m edges.Then G has a ρvaluation if and only if K 2m+1 has a cyclic decomposition into 2m + 1 copies of G.
Theorem 2.4.Let G be a graph with m edges, and k ≥ 1 be an integer.If G has an αvaluation then K 2km+1 has a cyclic decomposition into k(2km + 1) copies of G.
Conjecture 2.1 was followed by the following stronger conjecture, which is known as the Kotzig-Ringel graceful tree conjecture.
A substantial amount of research effort has been spent towards finding a proof of this conjecture.A number of special classes of trees have been shown to be graceful.These include paths, caterpillars, lobsters with perfect matchings [21,23] and several others.Rosa [23] showed that all trees with less than 16 edges are graceful, and all trees of up to 4 leaves are graceful.
Aldred and McKay used a computer search to prove the above result.They described this search algorithm as a combination of hill climbing and tabu search.In the same paper they also showed that all trees of at most 27 vertices are harmonious ( [19]).Horton [20] used a random backtracking algorithm to show that trees of order up to 29 are graceful.To enumerate trees with a given number of vertices, the algorithm proposed by Wright et al [26] is used.Fang [15] describes a computational approach and shows that every tree of order up to 35 is graceful.
Verification of gracefulness for trees with 33, 34 or 35 vertices is accomplished with the help of a volunteer computing community, where the computational task is divided into small fragments that are carried out on heterogeneous machines.It is estimated that to verify the gracefulness on a single machine, it may take up to 7.7 years on a Core 2 Duo T7200 computer.
The following result of Erdös [18] is well-known.See [19] for a proof.
Theorem 2.7.Almost all graphs are not graceful.
However, the research on the Kotzig-Ringel graceful tree conjecture and on finding other families of graceful graphs continues.

Generating and Enumerating Graceful Labelings
We now discuss bounds on the numbers of graceful labelings for some classes of graphs.For paths, let G(n) denote the number of graceful labelings of P n .Aldred et al [7] proved the following result.
Adamaszek [5] studied graceful labelings in the context of permutations.He defined a graceful n-permutation as a permutation [σ(0), ..., σ(n For example, [0, 6, 1, 5, 2, 4, 3] is a graceful n-permutation.Thus a graceful n-permutation of the set {0, 1, ..., n − 1} can be identified with a graceful labeling of P n .Let G(n) denote the number of graceful n-permutations.According to [5], the sequence G(n) has number A006967 in Sloane's On-line Encyclopedia of Integer Sequences [24] where the first 20 terms are listed.Adamaszek generated and counted graceful n-permutations by a recursive search procedure, and improved Theorem 3.1 as follows.
Adamaszek [5] also states that the quotients G(n + 1)/G(n) tend to gather between 3 and 4.5, suggesting that the lower bound (2.7) n could be improved further.
Eshghi and Azimi [13,14] investigated mathematical programming techniques to solve a model of the graceful labeling problem.They used a branch-and-bound algorithm to solve the corresponding integer programming problem.This technique was applied to find graceful labelings of randomly generated samples of several classes of graphs.Some of their computational results for trees are summarized in the table below.The last column shows the average time to generate a graceful labeling over a sample of thirty randomly generated trees.All computations were run on a Pentium IV 2500 MHz computer with 256 MB RAM.See [13,14]  We next discuss graceful labelings of certain classes of unicyclic graphs.We first look at cycles.Rosa [23] found necessary and sufficient conditions for cycles to be graceful.
Theorem 3.3.The cycle C n is graceful if and only if n ≡ 0 or 3 (mod 4).
Since a unicyclic graph G on n vertices has n edges, it follows that if G has a graceful labeling, then exactly one of the integers from the set {0, 1, 2, • • • , n} is missing from the set of vertex labels.We denote this missing label by m.Bagga et al [8,9,10] designed algorithms for generating all graceful labelings of certain classes of unicyclic graphs.We include here a brief description of the algorithm that generates all graceful labelings of C n , with n ≡ 0 or 3 (mod 4).We observe that vertex labels 0 and n must appear on adjacent vertices in any graceful labeling of C n since this is the only way of obtaining edge label n.Our algorithm starts by labeling two adjacent vertices of C n as 0 and n.It then exhaustively checks all possible ways of generating edge labels n − 1, n − 2,... in that order.We call the edge label being generated as the "level".This leads to a tree of computations.Along each branch of this tree, a possible graceful labeling is explored.A branch which reaches level 1 yields a graceful labeling.Table 3.2 shows how such branches start out from level n.

. Table 3.2: Tree of computations
Traversal along each branch can be thought of as building a set of disjoint paths on the cycle, with the edges on the paths being those which have already been labeled.At level k, the edges on the paths have labels n, n − 1, ..., k.Depending on the vertex labels on these paths, there are three possible cases in which a new edge labeled k can be obtained.(i) Two end vertices on two existing paths are adjacent on the cycle and have absolute difference k, or (ii) a new vertex label adjacent to an end vertex of a path can be added or, (iii) two new vertex labels are added.Our algorithm systematically tries all these possibilities.If none of the cases is possible along a branch, that branch of computation dies.For more details of the algortihm and a proof of correctness, see [8,9,10].The algorithm is shown to be correct in the sense that every graceful labeling of C n is obtained precisely once.Table 3.3 shows the results for appropriat e values of n ≤ 24.The last row labeled "Total" shows the total number of graceful labelings for each corresponding value of n in the first row.The other rows show the number of graceful labelings for the corresponding missing label m in the left.Blank cells denote zeros.Several properties of graceful labelings of cycles can be gleaned from Table 3.2.We mention two of these below.For proofs, see [9,10].Some of these results have been generalized to some other classes of unicyclic graphs.See [8,9,10] for more details.Truszczyński [25] conjectured in 1984 that all unicyclic graphs, except cycles C n with n ≡ 1(mod 4) or n ≡ 2(mod 4), are graceful.Doma [12] studied unicyclic graphs in which the cycle length is 3 through 9, and showed that all unicyclic graphs on up to nine edges (except C 5 , C 6 and ,C 9 ) are graceful.Barrientos [11] studied graceful labelings of a special class of unicyclic graphs.He defined a hairy cycle to be a unicyclic graph in which the deletion of any edge in the cycle results in a caterpillar.Barrientos [11] showed that all hairy cycles are graceful.

Complexity and Graph Embeddings
Acharya et al [2,4] proved several results about graceful graph embeddings.Definition 4.1.Let G be a graph with graceful labeling f and let r = m − n + 1 be the cycle rank of G. Then the labeled graph G + K r where the vertices of K r are assigned the labels of the set {0, 1, • • • , m} − {f (v)|v ∈ V }, is called the full augmentation of G and is denoted by G f .Theorem 4.2.[2] If G is a graceful graph with graceful labeling f , then the graph H = G f + K s is also graceful for any s ≥ 1.
Proof.We assign to the vertices of K s labels m + i(m + 1) for 1 ≤ i ≤ s.It can be easily checked that this gives a graceful labeling of H. Definition 4.3.Let G be a graph without isolated vertices.The index of gracefulness of G, denoted by θ(G), is the smallest positive integer k for which it is possible to label the vertices of G with distinct elements from the set {0, 1, 2, . . ., k} in such a way that distinct edges receive distinct labels.
Such vertex labelings always exist [1,3].In fact, for any graph G of order n and size q and with no isolated vertices, it is well known that θ(G) ∼ O(n 2 ) (cf.P. Erdös in [16]) and G is graceful if and only if θ(G) = q.Thus θ(G) is a measure of how close G is to being graceful.Given a labeling f : V (G) → {0, 1, 2, . . ., θ(G)}, such that the edges of G receive distinct labels, it is easily seen that of G must be θ(G), but it is not known whether an edge of G must receive the label θ(G).Proof.Let f : V → {0, 1, 2, . . ., k} be a labeling of G such that the induced function g f : E(G) → N is also injective, where k = θ(G).Since k = θ(G), it follows that there exist vertices u, v ∈ V such that f (v) = 0 and f (u) = k.Now, let {i 1 , i 2 , . . ., i r } be the set of missing edge labels.We assume, without loss of generality, that i 1 , i 2 , . . ., i s are not vertex labels and i s+1 , . . ., i r are vertex labels.For each i j , 1 ≤ i ≤ s, we add a vertex v j , join v j and v by an edge v j v and define f (v j ) = i j , so that g f (v j v) = i j .Hence i j , 1 ≤ j ≤ s, are edge labels.Now we add new vertices v j , for each j with s + 1 ≤ j ≤ r, join each v j to u and v and define f (v j ) = k + i j .Then g f (vv j ) = k + i j and g f (uv j ) = i j .We observe that at this stage i 1 , i 2 , . . ., i s are edge labels and none of the new missing edge labels are vertex labels.For each of these new missing edge lab els t, we add a vertex v t , join v t and v by an edge and define f (v t ) = t.The resulting graph H is graceful and G is an induced subgraph of H.
Corollary 4.5.The problem of deciding whether the chromatic number χ is less than or equal to k, where k ≥ 3 is N P -complete, even for graceful graphs.
Proof.Let G be a graph with χ(G) ≥ 3. Let H be the graceful graph constructed in Theorem 4.4, which contains G as an induced subgraph.Since all the vertices of V (H) − V (G) are adjacent to either u or v and is not adjacent to any other vertex of G, we have χ(H) = χ(G).
Since the problem of deciding whether the chromatic number χ is less than or equal to k, where k ≥ 3 is N P -complete, ( [17], page 190) it follows that the problem of deciding whether the chromatic number χ is less than or equal to k, where k ≥ 3 is NP-complete even for graceful graphs.
Acharya et al [4] also proved the following complexity results.These follow from the discussions above.Theorem 4.6.[4] The problem of deciding whether the domination number (total domination number) is less than or equal to k is N P -complete even when restricted to graceful graphs.Theorem 4.7.[4] The problem of deciding whether the clique number ω(G) is greater than or equal to k is N P -complete even when restricted to graceful graphs.

Conclusion
In this paper we have described algorithmic results and complexity issues related to graceful labeling problems.Efforts at proving the Ringel-Kotzig graceful tree conjecture have led to the discovery of several new classes of graceful trees.Generation and enumeration of graceful labelings is a relatively recent area of research and much remains to be done.Open problems in this area include the determination of better bounds for the number of graceful labelings of paths and cycles.It would also be of interest to investigate the index of gracefulness of several classes of graphs.Another interesting problem for further investigation is to find graph theoretic decision problems which remain NP-complete when restricted to the family of graceful graphs.Of course one can look at such problems for graphs which admit other types of labelings as well.

Theorem 3 .
4. ⌈ n 4 ⌉ ≤ m ≤ ⌊ 3n 4 ⌋.Theorem 3.5.Let n = 4t.For the missing label m = t, the number of graceful labelings of C n is equal to the number of graceful labelings of C n−1 .

Theorem 4 . 4 . [ 2 ]
Any graph G can be embedded as an induced subgraph of a graceful graph.

Table 3 .
1: Computation time for trees (30 samples of each order)

Table 3 .
2: Numbers of graceful labelings of C n for n ≤ 24