SlideShare a Scribd company logo
1 of 10
Download to read offline
Arithmetical properties of tree generation codes and algorithm to
generate all tree codes for a given number of edges
K. Balasubramaniana
, N. Chandramowliswaranb
, N. Ramachandranb
,
S. Arunc
, Pawan Kumarc
a
Department of Statistics , Indian Statistical Institute, New Delhi, India.
b
Department of Mathematics, Sri Chandrasekharendra Saraswathi Viswa Maha Vidyalaya,
Kanchipuram-631 561, India.
c
Department of Computer Science & Engineering, Sri Chandrasekharendra Saraswathi Viswa Maha
Vidyalaya, Kanchipuram, Kanchipuram-631 561, India.
Abstract:
Graceful Code is a way to represent graceful graph in terms of sequence of
non-negative integers. Given a graceful graph G on “q” edges, we can generate its
graceful code in the form of (a1, a2, a3, …, aq-1, aq) to represent the graph. Similarly, we
can easily draw the graph from the given graceful code.
In this paper, we present an algorithm to generate all possible tree codes on a
given number of edges (say q=30). Moreover, we also present the arithmetic properties of
tree generating codes and an algorithm to check whether the code of a given graceful
graph represents a tree or not. This algorithm uses prüfer code techniques on graceful
codes to perform tree checking. The prüfer technique of removing the lowest labeled leaf
easily determines the code to be a tree or not.
Keywords: Graceful graphs, Graceful codes, α-valuable codes.
Introduction:
Definition 1:
A Graceful labeling of a simple graph G with “q” edges is an injection “f ” from the
vertices of G to the set {0,1, 2, 3, …, q} such that the induced function g: E→{1, 2, …,q}
g (e) = | f(u) - f(v) | for every edge e ={u, v}, is a bijective function
A graph, which has a graceful labeling, is called a Graceful graph.
This labeling was originally introduced in 1967 by Rosa who has also showed that the
existence of a graceful labeling of a given graph G with “q” edges is a sufficient
condition for the existence of a cyclic decomposition of a complete graph of order
“2q+1” into sub-graphs isomorphic to G. [See Ref]. The famous Graceful Tree
Conjecture says that all trees have a graceful labeling.
Code of a Graceful Graph:
Let G be any graceful graph on “q” edges then (a1, a2, a3, … , aq-1, aq) is called a graceful
code of G, if 0 ≤ ai ≤ q-i, 1 ≤ i ≤ q. Here ai is the lower end vertex of the edge label “i”.
It is important to note that aq is always zero.
Example:
Code= (4, 3, 1, 2, 1, 0)
Figure 1 shows a graceful graph on 6 edges.
The code of this graceful graph is = (4, 3, 1, 2, 1, 0), where
a1= 4= lower end vertex of the edge label “1”.
a2= 3= lower end vertex of the edge label “2”.
a3= 1= lower end vertex of the edge label “3”.
a4= 2= lower end vertex of the edge label “4”.
a5= 1= lower end vertex of the edge label “5”.
a6= 0= lower end vertex of the edge label “6”.
For every graceful graph G we can write its corresponding graceful code. Conversely, for
every given graceful code we can draw the corresponding graceful graph as follows.
Join edges: {(a1, 1+a1), (a2, 2+a2), …, (aq-1, q-1+aq-1), (aq, q+aq)}
Definition 2:
α-valuable Code:
Let G be a graceful graph on “q” edges. Then the code (a1, a2, a3,…, aq) is called
α-valuable code of G if
a1 ≥ ai ; for all i
Max {ai | 0 ≤ i ≤ q} < Min {i + ai | 0 ≤ i ≤ q}
Here a1 is called the separator or critical value of the α-valuable code.
Proposition 1
(a1, a2, a3, …, aq) represents an α-valuable code if and only if
0 ≤ (a1 – aq - i + 1 / q – i) ≤ 1
for all i, 1 ≤ i ≤ q-1
Equivalently, (a1, a2, a3, ..., aq-1, aq) represents an α-valuable code if and only if
(a1 – aq, a1 – aq-1, …, a1 – a3, a1 – a2, 0) represents a code of a graceful graph.
Proposition 2
Define G(q)= { ( a1, a2, …, aq) |0 ≤ ai ≤ q-i }
Let X, Y є G(q), such that,
X= (a1, a2, a3, …, aq-1, aq)
Y= (b1, b2, b3, …, bq-1, bq)
Define X+Y= ( a1+b1 (mod q), a2+b2 (mod q-1), …, aq-1+ bq-1(mod 2), 0 )
Then < G (q), + > = zq + zq-1 + … + z2 + <0>
This sum is a direct sum of cyclic groups of orders q, q-1, …, 2, 1 respectively.
Arithmetic properties of Tree Generation codes
Theorem 1:
Let X= (a1, a2, …, aq) be a given α-valuable tree code on “q” edges.
Let p ≤ q - a1. Then,
(σ( a1+1), σ(a1+2), …, σ(a1+p), X) always represent a tree code on “q+p” edges for any
σ Є Sp= Symmetric group on “p” symbols.
Corollary 1:
Consider the following caterpillar,
N+1
(N
α
1
, (N-1)
α
2, …, 1
α
N, 0
α
N+1). Let “p” be any +ve integer ≤ (∑αi) – N.
i=1
Then (σ (N+1), σ (N+2), …, σ (N+p), N
α
1
, (N-1)
α
2, …, 1
α
N, 0
α
N+1) always represent a
N+1
tree code on “ (∑αi) + p ” edges for any σ Є Sp= Symmetric group on “p” symbols.
i=1
Corollary 2:
(σ (1), σ (2), …, σ (q), 0
q
) always represent a tree code on “2q” edges for
any σ Є Sp= Symmetric group on “p” symbols.
Corollary 3
For any positive integer "q",
(2q, 2q-1, …, q+1, q + σ( q), q-1 + σ(q-1), …, 2 + σ(2), 1 + σ(1), σ(1), σ(2), …, σ(q), 0q
)
always represent a α-valuable tree code on “4q” edges
Theorem 2:
Let X= (a1, a2, …, aq) be a given α-valuable tree code on “q” edges, such
that q - a1= odd integer. Then for any m ≥ 2,
((a1+1, a1+2, …, q)m
, X) always represent a tree code on “m(q-a1)+ q” edges.
Corollary 1:
For any odd +ve integer q and m ≥ 2, ((q+1, q+2, …, 2q)m
, qq+1
, q-1,q-2, …,2,1, 0q
)
represent a tree code on “(m+3)q” edges.
Theorem 3:
Suppose X= (a1, a2, …, aq) be a given α-valuable tree code on “q” edges.
Assume q-a1= even integer. Then for any +ve integer m ≥ 2,
((a1+1, a1+2, …, q, a1)m-1
, a1+1, a1+2, …, q-1, q, X) represent a tree code on
“(m+1)q- a1m + m-1” edges.
Theorem 4:
Suppose X= (a1, a2, …, aq) be a given α-valuable tree code on “q” edges
such that
i. q is odd.
ii. a1 is even.
Then,
(1+a1, σ (a1+3), 1+a1, σ (a1+5), 1+a1, …, 1+a1, σ (q), 1+a1, X) represent a tree code on
“2q - a1” edges.
Here σ is any permutation on “(q-a1-1)/ 2” symbols= {a1+3, a1+5, …, q}.
Here 1+a1 is repeated “(q-a1+1)/2” times.
Theorem 5:
Suppose X= (a1, a2, …, aq) be a given α-valuable tree code on “q” edges.
Assume,
1) 3│q and 3│a1.
2) a1 ≤ 2.q/ 3.
3) q ≥ 6. Then,
(a1+q-2, a1+q-5, …, 4+a1, 1+a1, a1+q-3, a1+q-4 a1+q-6, a1+q-7,…, a1+3, a1+2, X)
always represent a tree code on “2q-2” edges.
Theorem 6:
Suppose X= (a1, a2, …, aq) be a given α-valuable tree code on “q” edges,
such that,
1) q= even.
2) a1= even.
3) a1 ≤ q/ 2 and q ≥ 4. Then,
(a1+q-1, a1+q-3, …, 3+a1, 1+a1, a1+q-2, a1+q-4, …, a1+4, a1+2, X) always represent a
tree code on “2q-1” edges.
Theorem 7:
(1
n
, n+2, …, n+r+1, 1
n
, 0
2n+r
) represent a tree code on “4n+2r” edges
for any +ve integer n, r.
Theorem 8:
(1, 3, 4, …, n+2, 1, 0
n+2
) always represent a tree code on “2n+4” edges.
(1, σ (3), σ (4), …, σ (n+2), 1, 0
n+2
) always represent a tree code on “2n+4” edges for
any σ Є Sn= Symmetric group on n symbols.
Theorem 9:
9.1. (1, 2, …, 2n, 2n+1, 1, 2, …, 2n, 0
4n+1
) represent a tree code on “8n+2”
edges for any n ≥ 1.
9.2. (1, 3, 1, 5, 1, 7, 1, …, 1, 2q+1, 1, 0
2q+1
) represent a tree code on “4q+2”
edges.
9.3. (1, σ (3), 1, …, 1, σ (2q+1), 1, 0
2q+1
) represent a tree code on “4q+2” edges
for any σ Є Sq = group of permutations on q= {3, 5, …, 2q+1} symbols.
Theorem
N+1
10:
Suppose (∑αi) – N = odd +ve integer, then for any +ve integer
i=1
m
N+1 N+1
≥ 2,
((N+1, N+2, …, (∑αi) – 1, ∑αi )
m
, N
α
1
, (N-1)
α
2, …, 1
α
N, 0
α
N+1) always
i=1 i=1
N+1 N+1
represent a tree code on “m[(∑αi) – N ] + ∑αi ” edges.
i=1 i=1
Theorem 11: N+1
Suppose (∑αi) – N = even +ve integer, then for any +ve integer
i=1
m ≥ 2,
N+1 N+1 N+1 N+1
((N+1, N+2, …, (∑αi) – 1, ∑αi , N)m-1
,N+1, N+2, …, (∑αi) – 1, ∑αi,
i=1 i=1 i=1 i=1
N
α
1
, (N-1)
α
2, …, 1
α
N, 0
α
N+1)
N+1
represent a tree code on “(m+1) (∑αi) – Nm+m-1” edges.
i=1
Theorem - 12
Suppose (a1, a2, …, aq-1, aq) represent a code of a graceful tree on “q” edges. Then
X = (aq+q, aq-1+q-1, …, 2+a2, 1+a1, x, a1, a2, a3……, aq-1, aq), [0≤x≤q] represent a
α–valuable tree code on “2q + 1” edges.
Define U(X)
= ( q + 1 + (aq , aq -1 , …, a2, a1) , x + q + 1 , q + 1 + (a1 + 1 , a2 + 2, …, aq + q ) )
U(X)R
q= ( q + 1 + (aq + q, aq-1 + q – 1, …, a2 + 2 , a1 + 1) , x + q+ 1,
q + 1 + (a1, a2, …, aq-1, aq ) ) )
Then
(U(X)R
+ (k – 2)q , q U(X)R
+ (k – 3)q , …, U(X)R
+ q , U(X)R
, X ) always
represent a α–valuable tree code on “2kq + k” edges (k ≥ 3) +== +
==========---ppp0000000iiiii ===[[[[
Theorem - 13
Let X1 = (q, a2
(1)
, a3
(1)
, …, a2q
(1)
, a2q+1
(1)
)
X2 = (q, a2
(2)
, a3
(2)
, …, a2q
(2)
, a2q+1
(2)
)
… = …………………………………...
Xi = (q, a2
(i)
, a3
(i)
, …, a2q
(i)
, a2q+1
(i)
)
… = …………………………………..
Xk = (q, a2
(k)
, a3
(k)
, …, a2q
(k)
, a2q+1
(k)
)
Represent “k” α–valuable tree codes on “2q+1” edges of trees T1 , T2, …, Ti, …, Tk
respectively ( k ≥ 3)
Define U(Xi) = ( q + 1, 2 + a2
(i)
, 3 + a3
(i)
, …, 2q + a2q
(i)
, 2q + 1 + a2q+1
(i)
)
U(Xi)R
= ( 2q + 1 + a2q+1
(i)
, 2q + a2q
(i)
, …, 3 + a3
(i)
, 2 + a2
(i)
, q + 1 )
For 1 ≤ i ≤ k
Then
( U(X1)R
+ (k – 2 )q , U(X2)R
+ (k – 3)q , …, U(Xk-2)R
+ q , U(Xk-1)R
, Xk )
represent α–valuable tree code of a tree “T” on “2kq + k” edges such that
E(T) = E(T1) U E(T2) U … U E(Tk)
Also
( U(X1)R
+ (k – 2 )q , U(X2)R
+ (k – 3)q , …, U(Xk-2)R
+ q , U(Xk-1)R
, 0, Xk )
represent a α–valuable tree code of a tree “S” on “2kq + k+ 1” edges.
Theorem - 14
Suppose (a1, a2, …, aq-1, aq) represent a α-valuable tree code of a graceful tree on
“q” edges. Then X = (aq+q, aq-1+q-1,…,2+a2, 1+a1, a1, a2, a3……, aq-1, aq),
represent a α–valuable tree code on “2q” edges.
Define Y = ( 2q – 1 , 2q – 2 , …, q + 1 , q, q – 1 , q – 2, …, 1, 0 ) – X
= ( q – 1 , q – 1 – aq-1 , …, q – 1 – a2, q – 1 – a1 , q – 1 – a1 , q – 2 – a2 ,
…, 1 – aq-1, 0 )
U(Y) = ( q, q + 1 - aq-1, …, 2q – 2 – a2, 2q – 1 – a1 , 2q – a1, 2q – a2, …,
2q – aq-1, 2q )
U(Y)R
= ( 2q, 2q – aq-1 , …, 2q – a2, 2q – a1, 2q – 1 – a1 , 2q – 2 – a2 , …,
q + 1 – aq-1 , q )
Then (U(Y)R
+ (k – 2)q , q U(Y)R
+ (k – 3)q , …, U(Y)R
+ q , U(Y)R
, Y ) always
represent a α–valuable tree code on “2kq ” edges (k ≥ 3) .+=
=
Algorithm (Tree Check):
1. q← no. of edges in the graph.
2. q1← q
3. for i← 0 to q-1
4. // Get the code of graph
// Store it in a[0…. q-1]
5. for i← 0 to q-1
6. if (a[i] < 0 or a[i]> q-i-1)
7. // not a graceful code
8. exit
9. for i←1 to q
10. do b[i-1] = i+a [i-1]
11. // upper code stored in array b[]
12. for key←0 to q1
13. element ← 0
14. j← 0
15. while (j<q)
16. if (key= a[j] or key= b[j])
17. element← element +1
18. j← j+1
19. else
20. j← j+1
21. if (element=0)
22. code does not represent tree
23. exit
24. key← 0
26. while (key <=q1)
27. element← 0
28. j← 0
29. while (j<q)
30. if (key=a[j] or key=b[j])
31. element← element +1
32. j← j+1
33. else
34. j← j+1
35. key← key+1
36. if (element=1)
37. SEARCH (key-1)
38. if (z<2*q1)
39. code does not represent tree
SEARCH (temp):
1. for n←0 to q-1
2. if (a[n]= temp or b[n]= temp)
3. TREEVERT (n)
4. VERDELETE (n, q)
5. key← 0
TREEVERT (d)
1. tree [z]←a[d]
2. z← z+1
3. tree [z]←b[d]
4. z← z+1
5. if (z=2*q1)
6. // code represents a tree
VERDELETE (n, k)
1. for x← n to k-2
2. a[x]← a[x+1]
3. b[x]← b[x+1]
4. k← k-1
5. q← k
Reference:
1. T. H. Cormen, C. E. Leiserson, R. L. Rivest, C. Stein, Introduction to
Algorithms, MIT Press, Cambridge, 2001.
2. Pawan Kumar, Graceful Graph: Code Operator, Software Project Thesis, Dept.
of Computer Science& Engineering, SCSVMV, Kanchipuram, India,2005.
3. A. Rosa, “On certain valuations of the vertices of a graph”,Theory of Graphs,
Proc. Sympos. Rome, 1996, Dunod, Paris, 1967, pp.349-355.
4. A. Rosa, Labeling snakes, Ars Combinatoria 3 (1977), 67-74.
5. C. Huang, A. Kotzig, and A. Rosa “Further results on Tree Labelings”, Utilitas
Mathematica, Vol. 21C (1982), pp 31-48.

More Related Content

What's hot

S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...
S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...
S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...Steven Duplij (Stepan Douplii)
 
Open GL 04 linealgos
Open GL 04 linealgosOpen GL 04 linealgos
Open GL 04 linealgosRoziq Bahtiar
 
Different kind of distance and Statistical Distance
Different kind of distance and Statistical DistanceDifferent kind of distance and Statistical Distance
Different kind of distance and Statistical DistanceKhulna University
 
Rosser's theorem
Rosser's theoremRosser's theorem
Rosser's theoremWathna
 
ゲーム理論BASIC 第42回 -仁に関する定理の証明3-
ゲーム理論BASIC 第42回 -仁に関する定理の証明3-ゲーム理論BASIC 第42回 -仁に関する定理の証明3-
ゲーム理論BASIC 第42回 -仁に関する定理の証明3-ssusere0a682
 
A Study on Intuitionistic Multi-Anti Fuzzy Subgroups
A Study on Intuitionistic Multi-Anti Fuzzy Subgroups A Study on Intuitionistic Multi-Anti Fuzzy Subgroups
A Study on Intuitionistic Multi-Anti Fuzzy Subgroups mathsjournal
 
Assignment of class 12 (chapters 2 to 9)
Assignment of class 12 (chapters 2 to 9)Assignment of class 12 (chapters 2 to 9)
Assignment of class 12 (chapters 2 to 9)KarunaGupta1982
 
capstone magic squares
capstone magic squarescapstone magic squares
capstone magic squaresCara Colotti
 
The Estimation for the Eigenvalue of Quaternion Doubly Stochastic Matrices us...
The Estimation for the Eigenvalue of Quaternion Doubly Stochastic Matrices us...The Estimation for the Eigenvalue of Quaternion Doubly Stochastic Matrices us...
The Estimation for the Eigenvalue of Quaternion Doubly Stochastic Matrices us...ijtsrd
 
ゲーム理論BASIC 第42回 -仁に関する定理の証明2-
ゲーム理論BASIC 第42回 -仁に関する定理の証明2-ゲーム理論BASIC 第42回 -仁に関する定理の証明2-
ゲーム理論BASIC 第42回 -仁に関する定理の証明2-ssusere0a682
 
Efficient Analysis of high-dimensional data in tensor formats
Efficient Analysis of high-dimensional data in tensor formatsEfficient Analysis of high-dimensional data in tensor formats
Efficient Analysis of high-dimensional data in tensor formatsAlexander Litvinenko
 
IIT JAM PHYSICS - PH 2022 Question Paper | Sourav Sir's Classes
IIT JAM PHYSICS - PH 2022 Question Paper | Sourav Sir's ClassesIIT JAM PHYSICS - PH 2022 Question Paper | Sourav Sir's Classes
IIT JAM PHYSICS - PH 2022 Question Paper | Sourav Sir's ClassesSOURAV DAS
 
IIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's Classes
IIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's ClassesIIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's Classes
IIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's ClassesSOURAV DAS
 
Fuzzy join prime semi l ideals
Fuzzy join prime semi l idealsFuzzy join prime semi l ideals
Fuzzy join prime semi l idealsAlexander Decker
 
11.fuzzy join prime semi l ideals
11.fuzzy join prime semi l ideals11.fuzzy join prime semi l ideals
11.fuzzy join prime semi l idealsAlexander Decker
 

What's hot (20)

S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...
S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...
S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...
 
Open GL 04 linealgos
Open GL 04 linealgosOpen GL 04 linealgos
Open GL 04 linealgos
 
Different kind of distance and Statistical Distance
Different kind of distance and Statistical DistanceDifferent kind of distance and Statistical Distance
Different kind of distance and Statistical Distance
 
Rosser's theorem
Rosser's theoremRosser's theorem
Rosser's theorem
 
ゲーム理論BASIC 第42回 -仁に関する定理の証明3-
ゲーム理論BASIC 第42回 -仁に関する定理の証明3-ゲーム理論BASIC 第42回 -仁に関する定理の証明3-
ゲーム理論BASIC 第42回 -仁に関する定理の証明3-
 
A Study on Intuitionistic Multi-Anti Fuzzy Subgroups
A Study on Intuitionistic Multi-Anti Fuzzy Subgroups A Study on Intuitionistic Multi-Anti Fuzzy Subgroups
A Study on Intuitionistic Multi-Anti Fuzzy Subgroups
 
Assignment of class 12 (chapters 2 to 9)
Assignment of class 12 (chapters 2 to 9)Assignment of class 12 (chapters 2 to 9)
Assignment of class 12 (chapters 2 to 9)
 
Unit II B - Game Theory
Unit II B - Game TheoryUnit II B - Game Theory
Unit II B - Game Theory
 
capstone magic squares
capstone magic squarescapstone magic squares
capstone magic squares
 
The Estimation for the Eigenvalue of Quaternion Doubly Stochastic Matrices us...
The Estimation for the Eigenvalue of Quaternion Doubly Stochastic Matrices us...The Estimation for the Eigenvalue of Quaternion Doubly Stochastic Matrices us...
The Estimation for the Eigenvalue of Quaternion Doubly Stochastic Matrices us...
 
ゲーム理論BASIC 第42回 -仁に関する定理の証明2-
ゲーム理論BASIC 第42回 -仁に関する定理の証明2-ゲーム理論BASIC 第42回 -仁に関する定理の証明2-
ゲーム理論BASIC 第42回 -仁に関する定理の証明2-
 
Eigenvalues
EigenvaluesEigenvalues
Eigenvalues
 
HERMITE SERIES
HERMITE SERIESHERMITE SERIES
HERMITE SERIES
 
On Uq(sl2)-actions on the quantum plane
On Uq(sl2)-actions on the quantum planeOn Uq(sl2)-actions on the quantum plane
On Uq(sl2)-actions on the quantum plane
 
Efficient Analysis of high-dimensional data in tensor formats
Efficient Analysis of high-dimensional data in tensor formatsEfficient Analysis of high-dimensional data in tensor formats
Efficient Analysis of high-dimensional data in tensor formats
 
IIT JAM PHYSICS - PH 2022 Question Paper | Sourav Sir's Classes
IIT JAM PHYSICS - PH 2022 Question Paper | Sourav Sir's ClassesIIT JAM PHYSICS - PH 2022 Question Paper | Sourav Sir's Classes
IIT JAM PHYSICS - PH 2022 Question Paper | Sourav Sir's Classes
 
IIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's Classes
IIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's ClassesIIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's Classes
IIT JAM Mathematical Statistics - MS 2022 | Sourav Sir's Classes
 
Split block domination in graphs
Split block domination in graphsSplit block domination in graphs
Split block domination in graphs
 
Fuzzy join prime semi l ideals
Fuzzy join prime semi l idealsFuzzy join prime semi l ideals
Fuzzy join prime semi l ideals
 
11.fuzzy join prime semi l ideals
11.fuzzy join prime semi l ideals11.fuzzy join prime semi l ideals
11.fuzzy join prime semi l ideals
 

Viewers also liked (15)

Stringry
StringryStringry
Stringry
 
M.tech.quiz (1)
M.tech.quiz (1)M.tech.quiz (1)
M.tech.quiz (1)
 
Passman
PassmanPassman
Passman
 
Nelson Rolihlahla Mandela
Nelson Rolihlahla MandelaNelson Rolihlahla Mandela
Nelson Rolihlahla Mandela
 
Presentation
PresentationPresentation
Presentation
 
balakrishnan2004
balakrishnan2004balakrishnan2004
balakrishnan2004
 
The Evolution of Big Data at Spotify
The Evolution of Big Data at SpotifyThe Evolution of Big Data at Spotify
The Evolution of Big Data at Spotify
 
How Apache Drives Music Recommendations At Spotify
How Apache Drives Music Recommendations At SpotifyHow Apache Drives Music Recommendations At Spotify
How Apache Drives Music Recommendations At Spotify
 
PETERSON BERGE
PETERSON BERGEPETERSON BERGE
PETERSON BERGE
 
DDDDDDDDDDDDDDDDDD
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
DDDDDDDDDDDDDDDDDD
 
CCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCC
 
11
1111
11
 
15
1515
15
 
Final Report-1-(1)
Final Report-1-(1)Final Report-1-(1)
Final Report-1-(1)
 
Aina_final
Aina_finalAina_final
Aina_final
 

Similar to tree-gen-algo

Estimating structured vector autoregressive models
Estimating structured vector autoregressive modelsEstimating structured vector autoregressive models
Estimating structured vector autoregressive modelsAkira Tanimoto
 
Class XII Mathematics long assignment
Class XII Mathematics long assignmentClass XII Mathematics long assignment
Class XII Mathematics long assignmentnitishguptamaps
 
Csr2011 june15 11_00_sima
Csr2011 june15 11_00_simaCsr2011 june15 11_00_sima
Csr2011 june15 11_00_simaCSR2011
 
Inmo 2010 problems and solutions
Inmo 2010 problems and solutionsInmo 2010 problems and solutions
Inmo 2010 problems and solutionsaskiitians
 
Aieee maths-quick review
Aieee maths-quick reviewAieee maths-quick review
Aieee maths-quick reviewSharath Kumar
 
Solution of Differential Equations in Power Series by Employing Frobenius Method
Solution of Differential Equations in Power Series by Employing Frobenius MethodSolution of Differential Equations in Power Series by Employing Frobenius Method
Solution of Differential Equations in Power Series by Employing Frobenius MethodDr. Mehar Chand
 
Multivriada ppt ms
Multivriada   ppt msMultivriada   ppt ms
Multivriada ppt msFaeco Bot
 
The Probability that a Matrix of Integers Is Diagonalizable
The Probability that a Matrix of Integers Is DiagonalizableThe Probability that a Matrix of Integers Is Diagonalizable
The Probability that a Matrix of Integers Is DiagonalizableJay Liew
 

Similar to tree-gen-algo (20)

graceful Trees through Graceful codes (1)
graceful Trees through Graceful codes (1)graceful Trees through Graceful codes (1)
graceful Trees through Graceful codes (1)
 
graceful Trees through Graceful codes (1)
graceful Trees through Graceful codes (1)graceful Trees through Graceful codes (1)
graceful Trees through Graceful codes (1)
 
Estimating structured vector autoregressive models
Estimating structured vector autoregressive modelsEstimating structured vector autoregressive models
Estimating structured vector autoregressive models
 
Ch07 6
Ch07 6Ch07 6
Ch07 6
 
Final
Final Final
Final
 
Class XII Mathematics long assignment
Class XII Mathematics long assignmentClass XII Mathematics long assignment
Class XII Mathematics long assignment
 
Dfa
DfaDfa
Dfa
 
Csr2011 june15 11_00_sima
Csr2011 june15 11_00_simaCsr2011 june15 11_00_sima
Csr2011 june15 11_00_sima
 
Inmo 2010 problems and solutions
Inmo 2010 problems and solutionsInmo 2010 problems and solutions
Inmo 2010 problems and solutions
 
kactl.pdf
kactl.pdfkactl.pdf
kactl.pdf
 
Aieee maths-quick review
Aieee maths-quick reviewAieee maths-quick review
Aieee maths-quick review
 
eigenvalue
eigenvalueeigenvalue
eigenvalue
 
Solution of Differential Equations in Power Series by Employing Frobenius Method
Solution of Differential Equations in Power Series by Employing Frobenius MethodSolution of Differential Equations in Power Series by Employing Frobenius Method
Solution of Differential Equations in Power Series by Employing Frobenius Method
 
Maths05
Maths05Maths05
Maths05
 
Multivriada ppt ms
Multivriada   ppt msMultivriada   ppt ms
Multivriada ppt ms
 
The Probability that a Matrix of Integers Is Diagonalizable
The Probability that a Matrix of Integers Is DiagonalizableThe Probability that a Matrix of Integers Is Diagonalizable
The Probability that a Matrix of Integers Is Diagonalizable
 
Lecture5
Lecture5Lecture5
Lecture5
 
Algebra
AlgebraAlgebra
Algebra
 
SSA slides
SSA slidesSSA slides
SSA slides
 
Maieee04
Maieee04Maieee04
Maieee04
 

More from Chandramowliswaran NARAYANASWAMY (17)

number theory chandramowliswaran theorem
number theory chandramowliswaran theoremnumber theory chandramowliswaran theorem
number theory chandramowliswaran theorem
 
invited-seminar-libre(1)
invited-seminar-libre(1)invited-seminar-libre(1)
invited-seminar-libre(1)
 
testimonial_iit_3_(3)
testimonial_iit_3_(3)testimonial_iit_3_(3)
testimonial_iit_3_(3)
 
recom
recomrecom
recom
 
higman
higmanhigman
higman
 
April2012ART_01(1)
April2012ART_01(1)April2012ART_01(1)
April2012ART_01(1)
 
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
 
FDP SumCourse Schedule July 2009 (1)
FDP SumCourse Schedule July  2009 (1)FDP SumCourse Schedule July  2009 (1)
FDP SumCourse Schedule July 2009 (1)
 
kyoto-seminar
kyoto-seminarkyoto-seminar
kyoto-seminar
 
japan-invite
japan-invitejapan-invite
japan-invite
 
R.S.A Encryption
R.S.A EncryptionR.S.A Encryption
R.S.A Encryption
 
scsvmv-testimonial
scsvmv-testimonialscsvmv-testimonial
scsvmv-testimonial
 
feedback_IIM_Indore
feedback_IIM_Indorefeedback_IIM_Indore
feedback_IIM_Indore
 
testimonial-iit_1 (4)
testimonial-iit_1 (4)testimonial-iit_1 (4)
testimonial-iit_1 (4)
 
29-SrinivasanMuralikrishnaChandramowliswaran
29-SrinivasanMuralikrishnaChandramowliswaran29-SrinivasanMuralikrishnaChandramowliswaran
29-SrinivasanMuralikrishnaChandramowliswaran
 
21642583%2E2014%2E985803
21642583%2E2014%2E98580321642583%2E2014%2E985803
21642583%2E2014%2E985803
 
Development of Cognitive tools for advanced Mathematics learnng based on soft...
Development of Cognitive tools for advanced Mathematics learnng based on soft...Development of Cognitive tools for advanced Mathematics learnng based on soft...
Development of Cognitive tools for advanced Mathematics learnng based on soft...
 

tree-gen-algo

  • 1. Arithmetical properties of tree generation codes and algorithm to generate all tree codes for a given number of edges K. Balasubramaniana , N. Chandramowliswaranb , N. Ramachandranb , S. Arunc , Pawan Kumarc a Department of Statistics , Indian Statistical Institute, New Delhi, India. b Department of Mathematics, Sri Chandrasekharendra Saraswathi Viswa Maha Vidyalaya, Kanchipuram-631 561, India. c Department of Computer Science & Engineering, Sri Chandrasekharendra Saraswathi Viswa Maha Vidyalaya, Kanchipuram, Kanchipuram-631 561, India. Abstract: Graceful Code is a way to represent graceful graph in terms of sequence of non-negative integers. Given a graceful graph G on “q” edges, we can generate its graceful code in the form of (a1, a2, a3, …, aq-1, aq) to represent the graph. Similarly, we can easily draw the graph from the given graceful code. In this paper, we present an algorithm to generate all possible tree codes on a given number of edges (say q=30). Moreover, we also present the arithmetic properties of tree generating codes and an algorithm to check whether the code of a given graceful graph represents a tree or not. This algorithm uses prüfer code techniques on graceful codes to perform tree checking. The prüfer technique of removing the lowest labeled leaf easily determines the code to be a tree or not. Keywords: Graceful graphs, Graceful codes, α-valuable codes. Introduction: Definition 1: A Graceful labeling of a simple graph G with “q” edges is an injection “f ” from the vertices of G to the set {0,1, 2, 3, …, q} such that the induced function g: E→{1, 2, …,q} g (e) = | f(u) - f(v) | for every edge e ={u, v}, is a bijective function A graph, which has a graceful labeling, is called a Graceful graph. This labeling was originally introduced in 1967 by Rosa who has also showed that the existence of a graceful labeling of a given graph G with “q” edges is a sufficient condition for the existence of a cyclic decomposition of a complete graph of order “2q+1” into sub-graphs isomorphic to G. [See Ref]. The famous Graceful Tree Conjecture says that all trees have a graceful labeling.
  • 2. Code of a Graceful Graph: Let G be any graceful graph on “q” edges then (a1, a2, a3, … , aq-1, aq) is called a graceful code of G, if 0 ≤ ai ≤ q-i, 1 ≤ i ≤ q. Here ai is the lower end vertex of the edge label “i”. It is important to note that aq is always zero. Example: Code= (4, 3, 1, 2, 1, 0) Figure 1 shows a graceful graph on 6 edges. The code of this graceful graph is = (4, 3, 1, 2, 1, 0), where a1= 4= lower end vertex of the edge label “1”. a2= 3= lower end vertex of the edge label “2”. a3= 1= lower end vertex of the edge label “3”. a4= 2= lower end vertex of the edge label “4”. a5= 1= lower end vertex of the edge label “5”. a6= 0= lower end vertex of the edge label “6”. For every graceful graph G we can write its corresponding graceful code. Conversely, for every given graceful code we can draw the corresponding graceful graph as follows. Join edges: {(a1, 1+a1), (a2, 2+a2), …, (aq-1, q-1+aq-1), (aq, q+aq)} Definition 2: α-valuable Code: Let G be a graceful graph on “q” edges. Then the code (a1, a2, a3,…, aq) is called α-valuable code of G if a1 ≥ ai ; for all i Max {ai | 0 ≤ i ≤ q} < Min {i + ai | 0 ≤ i ≤ q} Here a1 is called the separator or critical value of the α-valuable code.
  • 3. Proposition 1 (a1, a2, a3, …, aq) represents an α-valuable code if and only if 0 ≤ (a1 – aq - i + 1 / q – i) ≤ 1 for all i, 1 ≤ i ≤ q-1 Equivalently, (a1, a2, a3, ..., aq-1, aq) represents an α-valuable code if and only if (a1 – aq, a1 – aq-1, …, a1 – a3, a1 – a2, 0) represents a code of a graceful graph. Proposition 2 Define G(q)= { ( a1, a2, …, aq) |0 ≤ ai ≤ q-i } Let X, Y є G(q), such that, X= (a1, a2, a3, …, aq-1, aq) Y= (b1, b2, b3, …, bq-1, bq) Define X+Y= ( a1+b1 (mod q), a2+b2 (mod q-1), …, aq-1+ bq-1(mod 2), 0 ) Then < G (q), + > = zq + zq-1 + … + z2 + <0> This sum is a direct sum of cyclic groups of orders q, q-1, …, 2, 1 respectively. Arithmetic properties of Tree Generation codes Theorem 1: Let X= (a1, a2, …, aq) be a given α-valuable tree code on “q” edges. Let p ≤ q - a1. Then, (σ( a1+1), σ(a1+2), …, σ(a1+p), X) always represent a tree code on “q+p” edges for any σ Є Sp= Symmetric group on “p” symbols. Corollary 1: Consider the following caterpillar, N+1 (N α 1 , (N-1) α 2, …, 1 α N, 0 α N+1). Let “p” be any +ve integer ≤ (∑αi) – N. i=1 Then (σ (N+1), σ (N+2), …, σ (N+p), N α 1 , (N-1) α 2, …, 1 α N, 0 α N+1) always represent a N+1 tree code on “ (∑αi) + p ” edges for any σ Є Sp= Symmetric group on “p” symbols. i=1
  • 4. Corollary 2: (σ (1), σ (2), …, σ (q), 0 q ) always represent a tree code on “2q” edges for any σ Є Sp= Symmetric group on “p” symbols. Corollary 3 For any positive integer "q", (2q, 2q-1, …, q+1, q + σ( q), q-1 + σ(q-1), …, 2 + σ(2), 1 + σ(1), σ(1), σ(2), …, σ(q), 0q ) always represent a α-valuable tree code on “4q” edges Theorem 2: Let X= (a1, a2, …, aq) be a given α-valuable tree code on “q” edges, such that q - a1= odd integer. Then for any m ≥ 2, ((a1+1, a1+2, …, q)m , X) always represent a tree code on “m(q-a1)+ q” edges. Corollary 1: For any odd +ve integer q and m ≥ 2, ((q+1, q+2, …, 2q)m , qq+1 , q-1,q-2, …,2,1, 0q ) represent a tree code on “(m+3)q” edges. Theorem 3: Suppose X= (a1, a2, …, aq) be a given α-valuable tree code on “q” edges. Assume q-a1= even integer. Then for any +ve integer m ≥ 2, ((a1+1, a1+2, …, q, a1)m-1 , a1+1, a1+2, …, q-1, q, X) represent a tree code on “(m+1)q- a1m + m-1” edges. Theorem 4: Suppose X= (a1, a2, …, aq) be a given α-valuable tree code on “q” edges such that i. q is odd. ii. a1 is even. Then, (1+a1, σ (a1+3), 1+a1, σ (a1+5), 1+a1, …, 1+a1, σ (q), 1+a1, X) represent a tree code on “2q - a1” edges. Here σ is any permutation on “(q-a1-1)/ 2” symbols= {a1+3, a1+5, …, q}. Here 1+a1 is repeated “(q-a1+1)/2” times.
  • 5. Theorem 5: Suppose X= (a1, a2, …, aq) be a given α-valuable tree code on “q” edges. Assume, 1) 3│q and 3│a1. 2) a1 ≤ 2.q/ 3. 3) q ≥ 6. Then, (a1+q-2, a1+q-5, …, 4+a1, 1+a1, a1+q-3, a1+q-4 a1+q-6, a1+q-7,…, a1+3, a1+2, X) always represent a tree code on “2q-2” edges. Theorem 6: Suppose X= (a1, a2, …, aq) be a given α-valuable tree code on “q” edges, such that, 1) q= even. 2) a1= even. 3) a1 ≤ q/ 2 and q ≥ 4. Then, (a1+q-1, a1+q-3, …, 3+a1, 1+a1, a1+q-2, a1+q-4, …, a1+4, a1+2, X) always represent a tree code on “2q-1” edges. Theorem 7: (1 n , n+2, …, n+r+1, 1 n , 0 2n+r ) represent a tree code on “4n+2r” edges for any +ve integer n, r. Theorem 8: (1, 3, 4, …, n+2, 1, 0 n+2 ) always represent a tree code on “2n+4” edges. (1, σ (3), σ (4), …, σ (n+2), 1, 0 n+2 ) always represent a tree code on “2n+4” edges for any σ Є Sn= Symmetric group on n symbols. Theorem 9: 9.1. (1, 2, …, 2n, 2n+1, 1, 2, …, 2n, 0 4n+1 ) represent a tree code on “8n+2” edges for any n ≥ 1. 9.2. (1, 3, 1, 5, 1, 7, 1, …, 1, 2q+1, 1, 0 2q+1 ) represent a tree code on “4q+2” edges. 9.3. (1, σ (3), 1, …, 1, σ (2q+1), 1, 0 2q+1 ) represent a tree code on “4q+2” edges for any σ Є Sq = group of permutations on q= {3, 5, …, 2q+1} symbols.
  • 6. Theorem N+1 10: Suppose (∑αi) – N = odd +ve integer, then for any +ve integer i=1 m N+1 N+1 ≥ 2, ((N+1, N+2, …, (∑αi) – 1, ∑αi ) m , N α 1 , (N-1) α 2, …, 1 α N, 0 α N+1) always i=1 i=1 N+1 N+1 represent a tree code on “m[(∑αi) – N ] + ∑αi ” edges. i=1 i=1 Theorem 11: N+1 Suppose (∑αi) – N = even +ve integer, then for any +ve integer i=1 m ≥ 2, N+1 N+1 N+1 N+1 ((N+1, N+2, …, (∑αi) – 1, ∑αi , N)m-1 ,N+1, N+2, …, (∑αi) – 1, ∑αi, i=1 i=1 i=1 i=1 N α 1 , (N-1) α 2, …, 1 α N, 0 α N+1) N+1 represent a tree code on “(m+1) (∑αi) – Nm+m-1” edges. i=1 Theorem - 12 Suppose (a1, a2, …, aq-1, aq) represent a code of a graceful tree on “q” edges. Then X = (aq+q, aq-1+q-1, …, 2+a2, 1+a1, x, a1, a2, a3……, aq-1, aq), [0≤x≤q] represent a α–valuable tree code on “2q + 1” edges. Define U(X) = ( q + 1 + (aq , aq -1 , …, a2, a1) , x + q + 1 , q + 1 + (a1 + 1 , a2 + 2, …, aq + q ) ) U(X)R q= ( q + 1 + (aq + q, aq-1 + q – 1, …, a2 + 2 , a1 + 1) , x + q+ 1, q + 1 + (a1, a2, …, aq-1, aq ) ) ) Then (U(X)R + (k – 2)q , q U(X)R + (k – 3)q , …, U(X)R + q , U(X)R , X ) always represent a α–valuable tree code on “2kq + k” edges (k ≥ 3) +== + ==========---ppp0000000iiiii ===[[[[
  • 7. Theorem - 13 Let X1 = (q, a2 (1) , a3 (1) , …, a2q (1) , a2q+1 (1) ) X2 = (q, a2 (2) , a3 (2) , …, a2q (2) , a2q+1 (2) ) … = …………………………………... Xi = (q, a2 (i) , a3 (i) , …, a2q (i) , a2q+1 (i) ) … = ………………………………….. Xk = (q, a2 (k) , a3 (k) , …, a2q (k) , a2q+1 (k) ) Represent “k” α–valuable tree codes on “2q+1” edges of trees T1 , T2, …, Ti, …, Tk respectively ( k ≥ 3) Define U(Xi) = ( q + 1, 2 + a2 (i) , 3 + a3 (i) , …, 2q + a2q (i) , 2q + 1 + a2q+1 (i) ) U(Xi)R = ( 2q + 1 + a2q+1 (i) , 2q + a2q (i) , …, 3 + a3 (i) , 2 + a2 (i) , q + 1 ) For 1 ≤ i ≤ k Then ( U(X1)R + (k – 2 )q , U(X2)R + (k – 3)q , …, U(Xk-2)R + q , U(Xk-1)R , Xk ) represent α–valuable tree code of a tree “T” on “2kq + k” edges such that E(T) = E(T1) U E(T2) U … U E(Tk) Also ( U(X1)R + (k – 2 )q , U(X2)R + (k – 3)q , …, U(Xk-2)R + q , U(Xk-1)R , 0, Xk ) represent a α–valuable tree code of a tree “S” on “2kq + k+ 1” edges. Theorem - 14 Suppose (a1, a2, …, aq-1, aq) represent a α-valuable tree code of a graceful tree on “q” edges. Then X = (aq+q, aq-1+q-1,…,2+a2, 1+a1, a1, a2, a3……, aq-1, aq), represent a α–valuable tree code on “2q” edges. Define Y = ( 2q – 1 , 2q – 2 , …, q + 1 , q, q – 1 , q – 2, …, 1, 0 ) – X = ( q – 1 , q – 1 – aq-1 , …, q – 1 – a2, q – 1 – a1 , q – 1 – a1 , q – 2 – a2 , …, 1 – aq-1, 0 ) U(Y) = ( q, q + 1 - aq-1, …, 2q – 2 – a2, 2q – 1 – a1 , 2q – a1, 2q – a2, …, 2q – aq-1, 2q ) U(Y)R = ( 2q, 2q – aq-1 , …, 2q – a2, 2q – a1, 2q – 1 – a1 , 2q – 2 – a2 , …, q + 1 – aq-1 , q ) Then (U(Y)R + (k – 2)q , q U(Y)R + (k – 3)q , …, U(Y)R + q , U(Y)R , Y ) always represent a α–valuable tree code on “2kq ” edges (k ≥ 3) .+= =
  • 8. Algorithm (Tree Check): 1. q← no. of edges in the graph. 2. q1← q 3. for i← 0 to q-1 4. // Get the code of graph // Store it in a[0…. q-1] 5. for i← 0 to q-1 6. if (a[i] < 0 or a[i]> q-i-1) 7. // not a graceful code 8. exit 9. for i←1 to q 10. do b[i-1] = i+a [i-1] 11. // upper code stored in array b[] 12. for key←0 to q1 13. element ← 0 14. j← 0 15. while (j<q) 16. if (key= a[j] or key= b[j]) 17. element← element +1 18. j← j+1 19. else 20. j← j+1 21. if (element=0) 22. code does not represent tree 23. exit 24. key← 0 26. while (key <=q1) 27. element← 0 28. j← 0 29. while (j<q) 30. if (key=a[j] or key=b[j]) 31. element← element +1 32. j← j+1 33. else 34. j← j+1 35. key← key+1 36. if (element=1) 37. SEARCH (key-1) 38. if (z<2*q1) 39. code does not represent tree
  • 9. SEARCH (temp): 1. for n←0 to q-1 2. if (a[n]= temp or b[n]= temp) 3. TREEVERT (n) 4. VERDELETE (n, q) 5. key← 0 TREEVERT (d) 1. tree [z]←a[d] 2. z← z+1 3. tree [z]←b[d] 4. z← z+1 5. if (z=2*q1) 6. // code represents a tree VERDELETE (n, k) 1. for x← n to k-2 2. a[x]← a[x+1] 3. b[x]← b[x+1] 4. k← k-1 5. q← k
  • 10. Reference: 1. T. H. Cormen, C. E. Leiserson, R. L. Rivest, C. Stein, Introduction to Algorithms, MIT Press, Cambridge, 2001. 2. Pawan Kumar, Graceful Graph: Code Operator, Software Project Thesis, Dept. of Computer Science& Engineering, SCSVMV, Kanchipuram, India,2005. 3. A. Rosa, “On certain valuations of the vertices of a graph”,Theory of Graphs, Proc. Sympos. Rome, 1996, Dunod, Paris, 1967, pp.349-355. 4. A. Rosa, Labeling snakes, Ars Combinatoria 3 (1977), 67-74. 5. C. Huang, A. Kotzig, and A. Rosa “Further results on Tree Labelings”, Utilitas Mathematica, Vol. 21C (1982), pp 31-48.