Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
.
Proof: First we show that ( )
r
G H
( ) ( )
r r
G H + . Let
1
f and
2
f be optimal
node ranking labeling of G and H
respectively. Let ( ) { }
1 2
, , ,
n
V u u u
G
= and
( ) { }
1 2
, , ,
m
V H v v v = ,
( ) ( )
V G H V G =
{ , i j
v which is the i-th copy of the j-th vertex of
H , } 1 , 1 i n j m . Define f as
( ) ( ) ( )
1 i i r
f u f u
H
= + for ( )
i
u V G and
( ) ( ) , 2 i j j
v v f f = for ( )
, i j i
v V H , then f is a
node ranking labeling of H G with maximum
rank ( ) ( )
r r
G H + , which implies
( ) ( ) ( )
r r r
G H G H + .
Next we show that ( ) ( ) ( )
r r r
G H G H + .
Suppose to the contrary, that
( ) ( ) ( )
r r r
G H G H < + . Let g be an
optimal node ranking of G H .
Case1: 1 , 1 i n j m , ( ) ( ) , i j i
v g u g > .
Then ( ) ( )
i r
g u H > , ( )
i
u V G . Define a
labeling ' g of G as '( ) ( ) ( )
i i r
g u g u H = ,
then ' g is a node ranking labeling of G with
maximum rank ( ) ( ) ( )
r r r
G H G H
<
,
which is a contradiction.
Case2: ( ) ( ) , i i j
g u g v < , for some 1 , i n
1 j m . Consider a labeling h of G H ,
which exchange the label of
i
u with the
minimum label of
, i j
v for those
, i j
v having
label greater than
i
u . That is, if y is the
minimum label of ( )
i
V H such that ( )
i
g u y < ,
then for all vertices
, i j
v with
,
( )
i j
g v y = , let
( ) ( )
, i j i
h v g u = , ( )
i
h u y = , and ( ) ( ) h x g x =
otherwise. Repeat the same process on h until
( ) ( )
, i i j
h u h v > for all 1 ,1 i n j m . Note
that for each exchange, since it starts from the
smallest label, the order of the ranks are not
changed in graph
i
H , and for ( ) ( )
i k
h u h u = we
must have some j that
( ) ( )
, i j k
g v g u = , since g is
a node ranking labeling of graph H G , there
must be a w on
i k
u u path with
( ) ( ) ( )
i k
h w h u h u > = , which implies h is a node
ranking labeling of H G . Since the
maximum label of h is the same as the maximum
label of g , which lead us back to case 1 and
produce a contradiction.
Let
, n m
S be the graph which contains a n-cycle
and each cycle vertex has m hairs. Since the
graph has the shape of sun, we named it as sun
graph. Figure 2 shows an example of graph
5, 2
S .
Figure 2: An example of graph
5, 2
S .
Since the sun graph
, n m
S may be viewed as
n m
C K , following corollary comes directly from
Theorem 1 by knowing that
2
( ) log 1
r n
C n = + (
(
(from [1]) and
( )
1
r m
K = .
The 26th Workshop on Combi natori al Mathemati cs and Computati on Theory
109
Corollary 1: Let
, n m
S be the sun graph of
order ( 1) n m+ . Then the node ranking number
, 2
( ) log 2
r n m
S n = + (
(
.
3 Offline Results for Mesh Graphs
In this section, we proposed an off-line ranking
algorithm for mesh graphs
n n
P P . The
algorithm produced a node ranking labeling of
n n
P P for odd n and 15 n , for even n and
18 n . Figure 3 shows an example of the graph
6 6
P P .
Figure 3: An example of graph
6 6
P P .
Algorithm Offline_Ranking_Mesh
Input : , 15 n n if n is odd and 18 n if n is
even. Each vertex is denoted as
, i j
v for
1 , i j n .
Output : An off-line rank assignment of
n n
P P .
Method:
[ ][ ] array y x holds the label of vertex
, y x
v
If ( n is odd ) Then
Step1: If x y even + = Then [ ][ ] 1 array y x = .
Step2: For 1 x = to 2 n (
(
do
Dividing the graph by x y n + = .
For 2 x n = (
(
to n do
Dividing the graph by 2 x y n + = + .
Step3: For 2 x = to 2 n (
do
Dividing the graph by 1 x y = .
For 2 1 x n = + (
(
to 1 n do
Dividing the graph by 1 y x = .
// The graph is then divided into four isomorphic
subgraphs
1 2 3 4
, , , as shown in Figure 4.
Figure 4: An example of graphs
1 2 3 4
, , , .
Step4: In the
1
graph, 2 1 i n = (
; call Alpha
( i ); use the label for corresponding vertices in
2
to
4
.
// i means the number of nodes on the edge of
subgraph
1
.
Else If ( n is even and 0 mod 4 n ) Then
Step1: If x y even + = Then [ ][ ] 1 array y x = .
Step2: For 4 3 x n = + to 2 4 n + do
Dividing the graph by 2 5 x y n + = + .
For 4 3 x n = + to 2 1 n + do
Dividing the graph by 1 x y = .
For 2 x n = to 2 1 n + do
Dividing the graph by 1 x y n + = + .
For 2 x n = to 3 4 2 n do
Dividing the graph by 1 y x = .
For 2 3 x n = to 3 4 2 n do
Dividing the graph by
0
3 2 3 x y n u + = = .
// The graph is divided into two isomorphic
subgraphs
1 2
, as shown in Figure 5.
Figure 5: An example of graphs
1 2
, .
Step3: In the
1
graph, Dividing the graph by
1
2 5 x y n u + = + = . (Repeat the same processes
for the corresponding vertices in
2
.)
// The graph is divided into two subgraphs
1 2
, as
shown in Figure 6.
Figure 6: An example of graphs
1 2
, .
Step4: Dividing
1
and
2
by 1 x y = .and
0
2 1 y x n v = = respectively.
// The
1
graph is divided into two subgraphs
1 2
, and the
2
graph is divided into two
subgraphs
1 2
, as shown in Figure 7.
Figure 7: An example of graphs
1 2 1 2
, , , .
Step5: In the
1
graph, 4 i n = ; call Alpha ( i );
In the
2
graph, ( ) 3 12 8 j n = (
; call
Alpha ( j );
In
1
and
2
, there are lines of vertices
denoted as
1 2
, , ,
l
e e e , such that
The 26th Workshop on Combi natori al Mathemati cs and Computati on Theory
110
( )
1 0 1
2 , 1 2 1 x y u c c u u + = + where
( ) 3 4 4 3 12 8 l n n = (
. Let 2 j l = (
.
Dividing
1
and
2
by
j
e and
1 j
e
+
respectively.
Let
2
u x y = + for the vertices
, y x
v on line
j
e and
3
u x y = + for the vertices
, y x
v on line
1 j
e
+
.
// The
1
graph is divided into two subgraphs
11 12
, and the
2
graph is divided into two
subgraphs
21 22
, as shown in Figure 8.
Figure 8: An example of graphs
11 12 21 22
, , , .
Step6: In
11
, Dividing the graph by
1
2 2 2 1 y x n n v = + = (
.
// Graph
11
is divided into two subgraphs
11 11
,
as shown in Figure 9.
In
12
, Dividing the graph by
( )
2
2 2 4 16 1 y x n n v = + + = (
(
.
// Graph
12
is divided into two subgraphs
12 12
,
as shown in Figure 9.
In
21
, ( )
3 1
2 1 p u u = ; ( )
0
1 2 q v = ;
call Beta ( , p q );
In
22
, ( )
0 3
2 1 p u u = ; ( )
0
3 2 q v = ;
call Beta ( , p q );
Figure 9: An example of graphs
11 11 12 12
, , , .
Step7: In
11
, ( )
0 1
2 2 i u v = ; call Alpha ( i );
In
11
, let ( )
2 1
2 1 p u u = ;
( )
1 0
2 1 q v v = ; call Beta ( , p q );
In
12
, ( )
0 2
2 2 i u u = ; call Alpha ( i );
In
12
, let ( )
0 2
2 1 p u u = ;
( )
2 0
2 1 q v v = ; call Beta ( , p q );
Else // n is even and 0 mod 4 n .
Step1: If x y even + = Then [ ][ ] 1 array y x = .
Step2: For 4 3 x n = + (
to 2 3 n + do
Dividing the graph by 2 4 x y n + = + .
For 4 3 x n = + (
to 2 1 n + do
Dividing the graph by 1 x y = .
For 2 x n = to 2 1 n + do
Dividing the graph by 1 x y n + = + .
For 2 x n = to 3 4 n (
do
Dividing the graph by 1 y x = .
For 2 2 x n = to 3 4 n (
do
Dividing the graph by
0
3 2 2 x y n u + = = .
// The graph is divided into two isomorphic
subgraphs
1 2
, which is the same as in Figure 5.
Step3: In the
1
graph, Dividing the graph by
( )
1
2 2 2 8 x y n n u + = + = (
(
. (Repeat the same
processes for the corresponding vertices in
2
.)
// The graph is divided into two subgraphs
1 2
, as
shown in Figure 6.
Step4: Dividing
1
and
2
by 1 x y = and
0
2 y x n v = = respectively.
// The graph
1
is divided into two subgraphs
1 2
, and the graph
2
is divided into two
subgraphs
1 2
, as shown in Figure 7.
Step5: In
1
, 4 i n = ; call Alpha ( i );
In
2
,
( ) 3 4 1 2 i n ( = (
; call Alpha ( i );
In
1
and
2
, there are lines of vertices
1 2
, , ,
l
e e e such that
1
2 x y u c + = + , where
( )
0 1
1 2 1 c u u , ( ) ( ) 2 8 2 4 3 l n n = + + + (
(
.
Let 2 j l = (
, dividing
1
and
2
by
and
1 j
e
+
respectively.
Let
2
u x y = + for the vertices
, y x
v on line
j
e and
3
u x y = + for the vertices
, y x
v on line
1 j
e
+
.
// Graphs
1
and
2
are divided into subgraphs
11 12
, and
21 22
, respectively, as shown in
Figure 8.
Step6: Dividing the graph
11
by
( )
1
2 2 2 8 2 y x n n v = + + = (
(
.
// Graph
11
is divided into two subgraphs
11 11
,
as shown in Figure 9.
Dividing graph
12
by
( )
2
2 2 2 16 y x n n v = + + = (
(
.
// Graph
12
is divided into two subgraphs
12 12
,
as shown in Figure 9.
In graph
21
, let ( )
3 1
2 1 p u u = ;
( )
0
1 2 q v = ; call Beta ( , p q );
In graph
22
, let ( )
0 3
2 1 p u u = ;
( )
0
3 2 q v = ; call Beta ( , p q );
Step7: In graph
11
, let ( )
0 1
2 2 i u v = ; call
Alpha ( i );
In graph
11
, let ( )
2 1
2 1 p u u = ;
( )
1 0
2 1 q v v = ; call Beta ( , p q );
In
12
, let ( )
0 2
2 2 i u u = ; call Alpha ( i );
In graph
12
, let ( )
0 2
2 1 p u u = ;
( )
2 0
2 1 q v v = ; call Beta ( , p q );
End of Algorithm Offline_Ranking_Mesh_Graph
Procedure Alpha ( int i )
If ( ) 3 i Then {
3 p i = (
; 1 q i p = ;
The 26th Workshop on Combi natori al Mathemati cs and Computati on Theory
111
// p means the number of nodes of the
dividing line P.
1 1
p p p = + ;
Dividing the graph by
1
: 2 2 1 I y x p c = + .
Dividing the graph by
1
: 2 2 1 P x y p c + = + + .
// The graph
1
is divided into three
subgraphs
11, 12, 13
as shown in Figure 10.
Figure 10: Subgraphs
11, 12, 13
.
In graph
11
, call Alpha ( p );
If ( ) ( ) ( ) ( 11 r r p
P p + and
( ) ( ) ( ) 11
2 1
r r p
P and
( ) ( )) 11 r p
P Then {
In the
12
graph, dividing the
graph by
0
: 4 a x y n + = .
2 q q = ;
}
Else If ( ) ( ) ( ) ( 11 r r p
P p + and
( ) ( ) ( ) 11
2 1
r r p
P > and ( ) ( )) 11 r p
P
Then {
Dividing graph
12
by
0
: 6 a x y n + = .
3 q q = ;
}
Else {
Dividing graph
12
by
0
: 8 a x y n + = .
4 q q = ;
}
// The graph
12
is divided into two
subgraphs
1 2
, as shown in Figure 11.
Figure 11: An example of graphs
1 2
, .
In
1
, call Beta ( , p q );
1 i i p = ; c + + ;
In
2
, call Beta ( , p q );
In
13
, call Alpha ( i );
Return ( )
1 r
; // ranking of
1
}
Else If ( ) 2 i = Then Rank the vertices individually
with 2, 3, 4.
Else Rank the vertex with 2. // 1 i =
End of Procedure Alpha
Procedure Beta ( int p , int q )
If ( ) 3 q Then {
In
1
, there are dividing lines :
1 2
, , ,
q
a a a
as shown in Figure 12.
Figure 12: An example of dividing lines
1 2
, , ,
q
a a a .
If q is odd Then {
Dividing the graph by
2 q
a
( (
.
// The dividing line divides the graph into
two the same graphs.
2 q q = (
;
}
If q is even Then {
Dividing the graph by
q 2+1
a .
2 q q = ;
}
}
Else If ( ) 2 q = Then call Gamma ( p );
Else Rank by optimal ranking as path // 1 q =
call Beta ( , p q );
End of Procedure Beta
Procedure Gamma ( int p )
If ( ) 3 p Then {
// graph
1
is divided into two subgraphs:
1 2
,
by
1
a .
In
1
, there are dividing lines:
1 2
, , ,
p
b b b .
Figure 13 shows
1 2
, and
1 2
, , ,
p
b b b .
Figure 13: Graphs
1 2
, and
1 2
, , ,
p
b b b .
If p is odd Then {
Dividing the graph by
p 2
b
(
(
.
// The graph is divided into two identical
subgraphs.
2 p p = (
;
}
If p is even Then {
The 26th Workshop on Combi natori al Mathemati cs and Computati on Theory
112
Dividing the graph by
2 1 p
b
+
.
2 p p = ;
}
}
Else If ( ) 2 p = Then Rank the nodes using 2 to 5.
Else Rank the nodes individually with 2 and 3.
call Gamma ( p );
End of Procedure Gamma
Theorem 2: The labeling given by Algorithm
Offline_Ranking_Mesh is a node ranking labeling of
n n
P P for odd n and 15 n , for even n and
18 n .
Proof: In the algorithm, we always assign greater
rank for the dividing vertices, and on every path
between two nodes of the same rank there is at least
one dividing line, so the labels given by the
algorithm must follow the node ranking condition for
n n
P P .
Theorem 3: The maximum rank given by Algorithm
Offline_Ranking_Mesh for odd n and 15 n is
( ) ( ) ( ) 2 1 6 1 6 8 1 12 n n n n n + + + + + + ( ( ( (
( (
10 x + ; and for even n, 0 mod 4 n and 20 n
is ( ) ( ) {
4 2 8 1 max 3 4 2 8 , n n n n n + + + + ( (
(
} 2 4 8 5 n n + (
(
; and for even n 0 mod 4 n and
18 n is ( ) 4 2 8 1 n n n + + ( (
( (
( ) { ( ) max 3 4 2 8 , 2 4 3 12 n n n n + + + + ( ( ( (
( (
( ) ( ) } 3 12 8 3 24 9 n n x + + + + ( (
(
, where
0 if 0, 2
2 if 4
4 if 6, 8
5 if 10
y
y
x
y
y
=
=
=
for ( ) ( )
3 12 3 12 y n n = + (
.
Theorem 3 gave us an upper bound for the node
ranking number of a mesh
n n
P P for 17 n .
For 16 n , Table 1 shows the node ranking number
of
n n
P P which is obtained by a brute force
computer testing, and is denoted by the formula that
represents the relation between n and ( )
r n n
P P .
Table 1: ( )
r n n
P P for 16 n .
n ( )
r n n
P P
1 7 n 2 1 n
8 10 n 2n
11 2 1 n +
12 2n
13 2 2 n +
14 2 1 n +
15 2 3 n +
16 2 2 n +
4 Online Results
In this section, we proposed an on-line ranking
algorithm for sun graphs
, n m n m
S C K = , and
analyze both time and space complexities of our
algorithm. Notice that there are ( 1) n m+
vertices in
, n m
S . Let
1
v to
( 1) n m
v
+
represent
the order of the coming vertices.
Algorithm Online_Ranking_Sun_Graph
We use structure array Sun[] to record the
information of each node, and use value_record[]
as the counter of the index values appearance.
Input:
n: the number of vertices on the cycle of
, n m
S .
m: the number of vertices on the hairs of
, n m
S .
i
v for 1 ( 1) i n m + the vertices together with
the adjacent vertices
j
v for 1 j i < .
Output:
An online node ranking labeling of
, n m
S .
Method:
For 1 i = to ( ) 1 m n + do {
If
i
v has no adjacent vertices, ( ) 2
i
rank v =
Else if
i
v has only one neighbor
j
v for
j i < and
j
v has two neighbors with
degree >1 then ( ) 1
i
rank v =
Else {
1. Set the occurrence record to zero except rank 1
(which is set to 2)
2. Applying online tree algorithm given in [5] to
loop through each adjacent path, go as long as
possible, to find the max value j that has
occurred at least twice
3. Find minimum available rank k that is greater
than j
4. Set ( )
i
rank v k =
}
}
End of Algorithm Online_Ranking_Sun_Graph
Theorem 4: Algorithm Online_Ranking_Sun has
( )
( )
3
O mn time complexity and ( ) O mn space
complexity.
Proof:
First we analyze the time complexity of the
algorithm. Since a Sun graph with ( ) 1 m n + vertices
has exactly ( ) 1 m n + edges, each time when insert a
new node
i
v , the looping for finding max j used
online tree algorithm which takes
2
( ) O i times , so
after ( ) 1 m n + vertices inserted, the whole process
will be at most ( ) ( )
2
2 2
1 2
1
n
m
+ + +
+
( ) ( )
3
O
mn
= times. For the space complexity, we
use structure array with ( ) 1 m n + elements to store
the node plus one array to record the rank occurrence,
the total space complexity then is
( ) ( ) ( ) O mn O mn O mn + = .
The 26th Workshop on Combi natori al Mathemati cs and Computati on Theory
113
Theorem 5: For a sun graph
, n m
S with 7 n is
( )
*
2 , 2
log 2 log 6
r n m
n S n m + + ( (
( (
.
Proof:
Since the online node ranking number is at least as
much as the offline node ranking number, we know
that
( )
*
2 ,
log 2
r n m
n S + (
(
. Let
, n m
S be the
graph which contains a n-cycle for 1
i
v i n and
each cycle vertex has m hairs denoted as
,
for 1 ,1
i j
u i n j m . If we use adversary
analysis, for the best we can do, saving rank 1 for the
vertices which are known as hair, assume that the
vertices of
, n m
S are coming as follows:
1 2 3 4
, , , v v v v coming in first, so they get labels
2,3,2,4.
For 3 3 i n , all
, i j
u for 1 j m
comes before
2 i
v
+
.
Then comes
2,
for 1
n j
u j m
and
,
for 1, 2, 1 and 1
i j
u i n j m = .
At last,
n
v then
,
for 1
n j
u j m .
In this coming order, before
n
v comes in, no vertex
can be recognized as end vertex, hence online tree
algorithm worked for this case which is the worst
case and our algorithm guarantee the maximum rank
is no more than
2
log 6 n m + (
(
, hence we have
( )
*
, 2
log 6
r n m
S n m + (
(
, which complete the proof.
5 Conclusion
There are several papers discussed the node
ranking problem. In this paper, we presented
off-line node ranking number for the corona graphs
and gave labeling algorithm for mesh. We also
gave on-line algorithm for sun graphs. Both time
and space complexities of our algorithms are
analyzed.
References
[1] E. Bruoth and M. Hornak, On-line ranking
number for cycles and paths, Discussiones
Mathematicae, Graph Theory 19, pp.
175-197, 1999.
[2] J.S. Deogun, T. Kloks, D. Kratsch, and H.
Muller, On vertex ranking for permutation
and other graphs, Lecture Notes in
Computer Science 775, pp. 747-758, 1994.
[3] A. V. Iyer, Optimal node ranking of trees,
Information Processing Letters 28, pp.
225-229, 1988.
[4] Md. A. Kashem, X. Zhou, T. Nishizeki,
Algorithm for generalized vertex-rankings
of partial k-trees, Theoretical Computer
Science 240, pp. 407-427, 2000.
[5] M. Katchalski, W. McCuaig, and S. Seager,
Ordered colorings, Discrete Mathematics
142, pp. 141-154, 1995.
[6] Y.-L. Lai and Y.-M. Chen, An Improves
On-line Node Ranking Algorithm of Trees,
Proceedings of the 23
rd
Workshop on
Combinatorial Mathematics and
Computation Theory, pp. 345-348, April
19-20, 2006.
[7] Y.-L. Lai and Y.-M. Chen, On Node
Ranking of Graphs under Strong
Orientation, Proceedings of the 24
th
Workshop on Combinatorial Mathematics
and Computation Theory, April 27-28, 2007.
[8] Y.-L. Lai and Y.-M. Chen, On Node
Ranking of Complete r-partite Graph,
Journal of Combinatorial Mathematics and
Combinatorial Computing 67, 2008.
[9] C. Lee and J. S. Juan, Parallel Algorithm for
On-Line Ranking in Trees, Proc. Of the 22
nd
Workshop on Combinatorial Mathematics
and Computational Theory, May 20-21, pp.
151-156, 2005.
[10] C. Lee and J. S. Juan, Jun. 2005, On-Line
Ranking Algorithms for Trees, Proc. of Int.
Conf. on Foundations of Computer Science,
Monte Carlo Resort, Las Vegas, Nevada,
USA,. June 27-30, pp. 46-51, 2005.
[11] C.E. Leiserson, Area-efficient graph layouts
(for VLSI), Proceedings of the 21st Annual
IEEE Symposium on Foundations of
Computer Science, pp. 270-281, 1980.
[12] A. A. Schaffer, Optimal node ranking of
trees in linear time, Information Processing
Letters 33, pp. 91-96, 1989.
[13] G. Semanisin and R. Sotak, Kosice, A note
on on-line ranking number of graphs,
Czechoslovak Mathematical Journal 56, pp.
591-599, 2006.
[14] A. Sen, On a graph partition problem with
application to VLSI layout, Information
Processing Letters 43, pp. 87-94, 1992.
[15] P. de la Torre, R. Greenlaw, A. A. Schffer,
Optimal edge ranking of trees in polynomial
time, Algorithmca 13, pp. 592-618, 1995.
The 26th Workshop on Combi natori al Mathemati cs and Computati on Theory
114