A Computational Approach to the Graceful Tree Conjecture

Graceful tree conjecture is a well-known open problem in graph theory. Here we present a computational approach to this conjecture. An algorithm for finding graceful labelling for trees is proposed. With this algorithm, we show that every tree with a…

Authors: Wenjie Fang

A computational approac h to the graceful tree conjecture W enjie F ang Octob er 23, 2018 Abstract Graceful tree conjecture is a w ell-know n op en problem in graph the- ory . Here w e present a computational approach to this conjecture. An algorithm for finding graceful lab elling for trees is prop osed. With this algorithm, w e sho w that every tree with at most 35 vertices allo ws a grace- ful lab elling, hence we verif y that the graceful tree conjecture is correct for trees with at most 35 vertic es. 1 In tro duction Graceful lab elling was first in tro duced by Rosa in [4] under the name ” β - v aluatio n”. A graceful lab elling of an undirected g raph G = ( V , E ) is an bijection f : V → { 0 , 1 , . . . , C ard ( V ) − 1 } such that the function induced g : E → { 1 , 2 , . . . , C ard ( E ) } , { a, b } 7→ | f ( a ) − f ( b ) | is an injection. In this context, we call g its induced lab elling. A gra ph which admits a gr a ceful labelling is said to b e graceful. After the int ro duction of this notion of gracefulness, the follo wing conjecture was prop osed by Ringel and K ¨ otzig. Conjecture 1. (Graceful T ree Conjecture) Every tr e e is gr ac eful. It is shown in [4] that this conjecture implies the Ringel’s conjecture : Conjecture 2. (Ringe l’s Conjecture) F or a l l n , for a c ert ain tr e e T with n e dges, the c omplete gr aph K 2 n +1 c an b e de c omp ose d into n tr e es, al l isomorphic to T. According to [2], curren t appr oach to the grace ful tree c onjecture is mo s tly to prov e gracefulness of a certain s pecial kind o f trees . Computational approach to verify the conjecture is quite rare. Howev er, a s the g r aceful tr ee conjecture may be inco rrect, efforts for finding a co n terexample are also v aluable. F urthermore , such verification may pr o vide interesting obse rv ation on gra c eful lab eling of trees. The ma jo r result in this direction is fr om Aldred and McKay [1]. In their article they verified that every tree with at most 27 vertices is gra cful. They used a s to chastic lo cal search alg orithm to acco mplish this result. Another result is fr om Horton [3]. In his mas ter disserta tion, he claimed a verification of gracefulness for trees with at mos t 29 vertices. This result w as obtained with a randomized back-trac king a lgorithm. 1 Inspired b y these results, her e w e pr esen t a nother computational approach. Using a hybrid a lgorithm for finding grac eful lab eling for trees, we obtain the following result. Theorem 1. Every t r e e with at most 35 vertic es is gr ac eful. It is achieved b y applying a hybrid alg orithm to every tree with at most 3 5 vertices to find a gra ceful lab eling for each o f them. 2 Algorithm T o enumerate a ll tr e es with a ce r tain num ber of vertices, w e use the a lgorithm prop osed in [5 ], which provides a co nstan t time g eneration of fr ee trees. F ur- thermore, we also adopt its r epresentation of trees by level sequences. In this representation, a free tr e e is ro oted in its c en ter if it is a central tr ee, in one of its bicen ters if it is otherwis e bicentral. Therefor e, every tree can b e treated as a r oo ted tre e . In this context, a labe lling to vertices can b e viewed as a per m utation o f { 0 , 1 , . . . , C ard ( V ) − 1 } . The num ber of vertices is an impo rtant factor for p erformance of algo r ithms. W e note n = C ar d ( V ) the num ber of vertices. As we deal with tr ees in this article, w e know that the num b er of edges is n − 1 . The h ybrid algorithm consists of t wo parts, a back-trac king deterministic search a nd a hill-climbing tabu sear c h combined with some idea from simulated annealing. 2.1 Deterministic B ac k-tr ac king Searc h The ba c k-tracking sear c h is inspir ed by the master diss ertation of Hor ton [3]. In this dissertation, Hor ton prop osed a randomized back-tracking search for graceful la belling. With his metho d, he verified that every tree with a t mos t 29 vertices is graceful. Inspir ed by this metho d, we prop osed a deter ministic version of his a lgorithm w ith some significant optimization. Our deterministic s earch trie s to construc t a gra c eful labelling f with f ( r ) = 0 for r the r oo t. This is done by assigning v alues to vertices one by one. At each recursive call, it tries to make sure that a new v alue k app ears in the induced lab elling g . The v alue k decreases as we go deep er in the decision tr ee, from n − 1 to 1. This mec hanism a ssures co rrectness o f this algorithm. T o a ssure that a new v a lue k a ppear s in the r ange o f g , it finds a not- yet-assigned vertex v connected to another v ertex v ′ that is already a ssigned a lab el f ( v ′ ), then tr ies to assig n to v a not-yet-assigned la bel f ( v ) s uc h that | f ( v ′ ) − f ( v ) | = k . Ther e may be several poss ibilities, o r none. If this attempt fails, it tra c ks back, r estores its status a nd pursues another p ossiblity if there exists one. As the decisio n tree can gr o w ex ponentially in size when n incr eases, w e manually add a thresho ld on the num ber of ba c ktracks. This prevents searching for a very lo ng time. This thresho ld is tuned with resp ect to the p erfor ma nce of the probabilistic s earch described. It is empirica lly fixed to ( n − 19) ∗ 110 00 − 1000 in this verification. F or a new, impr o ved version of proba bilis tic se a rch, it is empirically fixed to ( n − 18) ∗ 10 00. Here is a pseudo-co de o f the deterministic bac k-tracking search. 2 Algorithm 1 Back-tracking Search Require: A new v alue k not y et a ppear e d in the induced la belling g Ensure: Return a bo olean indicating whether the search is sucessful F unction Search( k ) if k = 0 then return true { This indicates that ev ery vertice is prop erly lab e le d. } if iterations exceed threshold then return false for ev ery vertex v without lab el, with its parent v ′ lab eled do if lab el f ( v ′ ) + k v a lid and not y et us ed then f ( v ) ← f ( v ′ ) + k , upda te table s if Sear c h( k − 1) then return true Restore tables, una ssign v if lab el f ( v ′ ) − k v a lid and not y et us ed then f ( v ) ← f ( v ′ ) − k , upda te table s if Sear c h( k − 1) then return true Restore tables, una ssign v return false F or efficiency , this algor ithm main tains a table of alr eady assigned lab els a nd a linked list o f vertices not yet assig ned but c o nnected to a vertice alrea dy with a label. Another optimization is also use d in the maintenance of this linked list. It is obvious that, if a vertex ha s tw o children that ar e isomor phic, i.e. they induce isomorphic subtr e es, we c an p erm ute lab els of thes e subtrees . Using this symmetry , we can eliminate redondant isomorphic vertices by a precomputatio n. This tric k is from [3]. F or c ho osing vertex to lab el, there ar e t w o na tur al w ays, all relying on the representation of level se quences. Each item in the r epresentation re pr esen ts a vertex. One wa y is to c ho ose fr om left to rig h t, another fro m r igh t to left. Their p erformance is different. Right-to-left str a tegy is more efficient, pro bably bec ause it reduce the problem’s size by assigning trivial lab els to leaves attached to the ro ot. T o initialize, we simply initialize e very table, as sign lab el 0 to the r oo t, then start to do back-tracking. Though efficient, this back-trac king sea r c h misses a lot of po ten tial solutions, due to the choice to lab el the ro ot 0. F or a mor e thorough sea rc h, a nother algorithm is neede d. 2.2 Probabilistic Search This probalilistic sear c h is inspir ed by Aldred, McKay[1]. They prop osed a searching metho d for graceful lab eling which is a combin ation of tabu search and hill-climbing. With that metho d, they verified that every tree with a t most 27 vertices is gr aceful. O ur pro babilistic sea r c h is a hill-climbing tabu search combined with some idea s from simulated annea ling . This a pproach lies in the field of combinatorial optimization, whos e go al 3 is to find an e x trem um of a c e rtain ev aluation function in a discre te doma in. In a n attempt to solve a dec ision problem, like determining whether a tree is graceful, by combinatorial optimization, it is a common pr actice to prop ose a ev alua tio n function whose minimum reaches a certain v alue if and only if the answer to the c o rresp onding decision problem is po sitiv e. Therefore, by finding the minim um of this particular ev aluation function, we can determine the answer of the dec ision pro blem. F or determining whether a tree is g r aceful, it is natural to sear c h for potential graceful labe lling , which c a n b e view ed a s p ermutations. In verifications ment ioned in this article, the following ev aluation function is used. It is always p ositive, a nd only reaches 0 when f is a graceful labelling. E v al ( f ) = X i ∈{ 1 ,...,n − 1 }\ I m ( g ) i, where I m ( g ) = { | f ( x ) − f ( y ) |   { x, y } ∈ E } How ev er, w e discovered the following ev aluation function which is more ef- ficient . E v al ′ ( f ) = X i ∈{ 1 ,...,n − 1 }\ I m ( g ) i, where I m ( g ) = { | f ( x ) − f ( y ) |   { x, y } ∈ E } E v al ′ ( f ) = 0 if and only if the function induced g is injective, which is equiv alent to the gr acefulness of the current tre e with f its gra ceful lab elling. F urthermo re, E v al ( f ) is alwa ys p ositive. This ev a luation function also stresses differences b etw een v alues in the do main { 1 , . . . , n − 1 } . F o r k ∈ { 1 , . . . , n − 1 } , there are k combinations of { f ( x ) , f ( y ) } that hav e a difference | f ( x ) − f ( y ) | = n − k . As a r esult, pe na lties o n lack of large difference should b e more severe than small difference, as there are fewer co m binaisons for large difference. Our ev alua tio n function reflects exactly this fact. Here is a pseudo-co de of our proba bilis tic search. W e consider here a po ten- tial graceful la b eling as a p ermutation of { 0 , . . . , n − 1 } . By minimizing E v al , we ca n efficiently explor e lab ellings tha t are likely to be gr a ceful. W e use hill-climbing (or in this cas e , hill-descending) to tr y to minimize E v al . A t ea ch iteration, the a lgorithm tries a n um b e r of random mo difications a nd picks the one with b est ev a luation. This n um be r is fixed emprically to 2 n . It is known that hill-climbing metho d can be tra pped in a lo cal minimum. In or de r to av oid this pr oblem, we use a tabu sea r c h. The algo r ithm keeps track of a num ber of previous modifica tions and forbids such mo dification unless the result is a graceful la beling. Therefore, the alg o rithm alwa ys go forth to search for new solutio ns . W e fix the num be r of forbidden previous modifica tions to ⌊ n/ 3 ⌋ . This v alue is determined e mpirically . Also pr o pose d to so lv e the loc al minimum problem, the algor ithm accepts, with a ce r tain probability determined empirica lly , mo difications that worsen the solution. This b ehavior is in tended to emulate sim ulated annealing, which can escap e lo cal minim um with a proba bilit y determined b y its “temp erature ” . 4 Algorithm 2 Probabilistic search using metaheuristics Require: A labeling f b eing a p ermutation Ensure: Return a graceful lab eling if one exists, lo op o ther wise v ← E v al ( f ) where E v al is an ev aluation function while v 6 = 0 do Randomly c hoo se 2 n pairs of vertices for all pair o f vertices x, y chosen do Swap f ( x ) , f ( y ) Calculate E v al for the modified lab eling Restore status Cho ose the pair x, y that minimize E v al v ′ ← E v al ( f ′ ) where f ′ is obtained by s w apping f ( x ) , f ( y ) in f if f ( x ) , f ( y ) was no t swapp ed in previous ⌊ n/ 3 ⌋ iterations then if v > v ′ then Swap f ( x ) , f ( y ), update v b y v ← v ′ else With a pr obabilit y p , swap f ( x ) , f ( y ), upda te v else if v = 0 then Swap f ( x ) , f ( y ), update v Update the table storing pr evious sw aps return f T o initialize, w e pr o vide to the algorithm an identit y p ermut ation. In prac- tice, as the algorithm do not gua rantee termina tio n, a threshold is enforced on the n um ber of iterations. T r ees that make this algo r ithm reaches threshold are recorded and examined afterwards. This algorithm do es not g ua rantee to pro duce a gr aceful lab eling. Theore t- ically , it can go into a n infinity lo op. But in practice, this has nev er happ ened. F urthermo re, meta-heur istics employ ed in this algor ithm generally hav e go o d chances to av oid lo oping and escaping fro m lo cal minimum. W e are optimistic that this a lg orithm will even tually return a g raceful lab eling if there exists o ne, though it is not prov ed. 2.3 Hybrid algorithm Combining this t wo algor ithm, we obtain a hybrid algor ithm for finding a gr a ce- ful labeling for a tr ee. There is t wo stages in the h ybrid a lgorithm. In the first stage it applies the deterministic back-tracking search. If it fails to find a graceful lab eling, it turns to the seco nd stage, where it p erforms the probabilistic search. The reason o f this strateg y is as following. The deterministic back-trac king outp e rforms the pr o babilistic sea r c h in most ca ses, but in some cases it will take an enor mous a moun t of time. The probabilistic sea rch is not fast compar ing to the deterministic one, but its runt ime v aries in a muc h more mo derated wa y . Therefore, it is na tural to use the deterministic search with a cutoff of runtime, then patc h unfinished ca ses with the probabilistic s e a rch. Exp eriment al results show that this h ybrid approa c h outp erforms b oth the deterministic and the proba bilistic sear c h algor ithm. 5 3 Results and observ ations By a pplying the hybrid algor ithm to every tree with a t most 35 v ertices, we verify that every such tree is g raceful. Below sho ws v a rious statistics on this hybrid algo rithm. Runtime da ta are collected on an Intel Cor e 2 Duo T7 200. n trees backtrac king remainder ratio time(s) avg(ms) 20 82306 5 82300 2 63 7.6 5 e-5 11 0.0134 21 21445 05 21444 61 44 2 .0 5e-5 32 0.014 9 22 56237 56 56235 88 168 2.99 e -5 106 0.0188 23 14828 074 14827 895 179 1.21e- 5 325 0.0219 24 39299 897 39298 893 1004 2.5 5 e-5 1041 0.0265 25 10463 6890 10463 5672 1218 1 .1 6e-5 3098 0.0296 26 27979 3450 27978 7959 5491 1 .9 6e-5 9800 0.0350 27 75106 5460 75105 6670 8790 1 .1 7e-5 29450 0.0392 28 20234 43032 20234 10238 32794 1.62 e - 5 92218 0.0456 29 54695 66585 54695 04091 62494 1.14 e - 5 27984 5 0.0512 30 14830 871802 14 8306720 30 19977 2 1.35e-5 864 5 80 0.058 3 31 * 32 * 33 30062 886248 0 30062 5 170528 36919 52 1.23e-5 * * 34 82377 963172 1 82376 8 359223 11272 498 1.37e - 5 * * 35 22 6 236634 3746 22623 331403 05 33203 441 1.47e - 5 * * The second co lumn indicates the total n um ber of trees with n vertices. The third column indicates the num ber of trees proved to b e gra ceful with the ba c k- tracking sear c h. The four th column is the n um b er o f trees proved to b e gr aceful by the pro babilistic sear c h. The fifth column indicates the prop ortion of trees failing to b e prov ed g r aceful in the back-trac king sear c h stage. The sixth column indicates the calculation time needed in seco nd. The seven th indica tes a v erage calculation time for each tree in millisecond. V erifica tion of gracefulness for trees with 3 1 or 32 vertices is done with an o lder version of our algor ithm. As pa rameters differ, data a re omitted for consistency . V erification of gr acefulness for trees with 33 , 34 or 3 5 vertices is a c- complished with the help of a Chines e communit y of volun teer computing. The whole ta s k is divided into small fragments and done on heterogeneo us machines. Therefore, no accurate timing c a n b e pr ovided. This volunteer computing effo r t is org anized with a website now located at http:/ /www.ele ves.ens.fr/home/wfang/gtv/index_en.html . Given the statistic, we can see that the back-tracking algorithm is extremely efficient. It ca n find a g raceful lab eling for nearly every tree (more than 99 . 99%) in a sho rt time (at most 0 . 1 ms for each tree). Though encourag ing, this may only b e a n illusion o f limited da ta, as it lacks supp ort of sufficient data for larg e n . On the other hand, it se ems that this efficiency can b e extrap olated for a few points further. Regarding ca lculation time, b y r egression, we ca n show the relations b elow. ( T fo r total calcula tio n time in seco nd, T avg for calculation time for each tree in second) T ≈ O (3 . 09 n ) , T avg ≈ O (1 . 16 n ) 6 By extrap olation, verification of gra cefulness for trees with 35 v ertices should take 7 . 7 years on a core of Core 2 Duo T72 00. W e should note that this relation is only v alid for current tests. The v alidity of extrap olation is not guaranteed. Though runtime se ems to grow e x ponentially with the num ber o f v ertices, the time to find a graceful lab eling for o ne tree increa ses rather slowly . Hence it is rea sonable that the p erformance would stay to be go od for s mall v alues of n , which ma k e this h ybrid algor ithm seems suitable fo r further v erification of the graceful tree c o njecture. 4 Ac kno wledgemen t Thanks to volun teers from T eam China, without who m this verification is im- po ssible. Thanks for their do nation of computationa l p ower, their suppo rt and their en th usiasm. References [1] REL Aldred and B.D. McKay . Gra ceful and ha rmonious lab ellings of trees. Bul l. Inst. Combin. Appl , 2 3:69–72 , 19 98. [2] J.A. Gallian. A dynamic s urv ey o f g raph lab eling. The Ele ctr onic journal of c ombinatorics , 5 :1–148, 2 0 05. [3] M. Horton. Graceful T rees: Statistics and Algorithms. 20 03. [4] A. Rosa . On certain v aluations of the vertices of a g r aph. New Y ork: Gor don and Br e ach , pages 349–355 , 1966 . [5] R.A. W right, B. Richmond, A. Odly zk o, and B.D. McKay . Constant time generation of fr ee trees . S IAM Journal on Computing , 15 :540, 1986 . 7

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment