Next Article in Journal
Verifying the Firoozbakht, Nicholson, and Farhadian Conjectures up to the 81st Maximal Prime Gap
Previous Article in Journal
On the Solution of an Imprecisely Defined Nonlinear Time-Fractional Dynamical Model of Marriage
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Use the K-Neighborhood Subgraphs to Compute Canonical Labelings of Graphs

1
Beijing Key Laboratory of Big Data Technology for Food Safety, Beijing Technology and Business University, No. 11, Fu Cheng Road, Beijing 100048, China
2
State Key Laboratory of Networking and Switching Technology, Beijing University of Posts and Telecommunications, No 10, Xitucheng Road, Haidian District, Beijing 100876, China
*
Author to whom correspondence should be addressed.
Mathematics 2019, 7(8), 690; https://doi.org/10.3390/math7080690
Submission received: 5 July 2019 / Revised: 22 July 2019 / Accepted: 27 July 2019 / Published: 1 August 2019

Abstract

:
This paper puts forward an innovative theory and method to calculate the canonical labelings of graphs that are distinct to N a u t y ’s. It shows the correlation between the canonical labeling of a graph and the canonical labeling of its complement graph. It regularly examines the link between computing the canonical labeling of a graph and the canonical labeling of its o p e n k- n e i g h b o r h o o d s u b g r a p h . It defines d i f f u s i o n d e g r e e s e q u e n c e s and e n t i r e d i f f u s i o n d e g r e e s e q u e n c e . For each node of a graph G, it designs a characteristic m _ N e a r e s t N o d e to improve the precision for calculating canonical labeling. Two theorems established here display how to compute the first nodes of M a x Q ( G ) . Another theorem presents how to determine the second nodes of M a x Q ( G ) . When computing C m a x ( G ) , if M a x Q ( G ) already holds the first i nodes u 1 , u 2 , , u i , Diffusion and Nearest Node theorems provide skill on how to pick the succeeding node of M a x Q ( G ) . Further, it also establishes two theorems to determine the C m a x ( G ) of disconnected graphs. Four algorithms implemented here demonstrate how to compute M a x Q ( G ) of a graph. From the results of the software experiment, the accuracy of our algorithms is preliminarily confirmed. Our method can be employed to mine the frequent subgraph. We also conjecture that if there is a node v S ( G ) meeting conditions C m a x ( G v ) C m a x ( G w ) for each w S ( G ) w v , then u 1 = v for M a x Q ( G ) .

1. Introduction

This paper is the close companion to Reference [1], in which a novel theory and method are presented for calculating the canonical labelings of digraphs. The center subgraph C e n ( G ) [2] can also be used to determine the first vertex u 1 added into M a x Q ( G ) of undirected graphs.
This article concentrates on the construction of a universal system and a way of calculating the c a n o n i c a l l a b e l i n g C m a x ( G ) of undirected graphs [3,4,5], which is also called an o p t i m u m c o d e [6], a c a n o n i c a l c o d e [7] or a canonical form [8] and is the single string corresponding one-to-one to a graph such that two graphs are isomorphic if and only if both have the accurate same canonical labelings. Currently, the calculation of the c a n o n i c a l l a b e l i n g as the graph isomorphism problem is an unsolved challenge in computational complexity theory such that no polynomial-time algorithm appears for calculating the c a n o n i c a l l a b e l i n g of an undirected graph. The study of canonical labeling has contributed to the studies of problems in many fields, including quantum chemistry [9], biochemistry [10,11] and so on.
Many exponential algorithms have emerged to deal with the problem. However, different researchers like to define different canonical labeling. Given a graph of n vertices, Kuramochi and Karypis build the canonical labeling by concatenating the columns of the upper-triangular part of its adjacency matrix [12,13]. Huan et al. concatenate the lower triangular elements (including the diagonal elements) of its adjacency matrix to create its canonical labeling [14]. Kashani et al. determine the canonical labeling by concatenating the rows of its adjacency matrix to form an n 2 binary number [15,16]. Each of these canonical labelings correspondings one-to-one to a lexicographically smallest graph whose adjacency matrix is seen as a linear string, which is lexicographically smallest. Nevertheless, the computation of the lexicographically least graph is N P -hard [8,17].
Throughout the paper, the c a n o n i c a l l a b e l i n g C m a x ( G ) of a graph G is the lexicographically largest string constructed by concatenating the rows of the upper triangular portion of the adjacency matrix associated with G (see Definition 5). The computational complexity that determines the c a n o n i c a l l a b e l i n g C m a x ( G ) of G is also N P -hard.
Babai and Luks used a general group-theoretic method to calculate canonical labeling [8]. Nevertheless, combinatorial approaches have operated well in numerous particular situations. For stochastic graphs, Babai et al. generate canonical labeling with high possibility [8,18]. Arvind et al. introduce two similar logspace algorithms for partial 2- and 3-Trees [17,19].
Currently, N a u t y is the most prevalent and pragmatic means for determining the automorphism group and the c a n o n i c a l l a b e l i n g s of graphs [3,20,21,22]. It appears to have shifted the industry norm for determining the c a n o n i c a l l a b e l i n g also the automorphism group. For calculating the c a n o n i c a l l a b e l i n g and automorphism group, N a u t y and Yan and Han [23] use the depth-first search to traverse the latent intermediary vertices in the search tree. The vertices of the search tree produced by N a u t y are equitable ordered partitions of vertices in G. N a u t y iteratively refines partitioning vertices until places the vertices that have the exact equivalent features into an automorphism orbit. As the partition refinement becomes finer and finer, it automatically makes the c a n o n i c a l l a b e l i n g . Nonetheless, N a u t y also needs exponential time to calculate the canonical labeling for a given Miyazaki graph [24]. Tener and Deo earned advances for processing the problem [25].
Besides N a u t y , T r a c e s [4], B l i s s [5,26] and Conauto [27] are all state-of-the-art tools for graphs isomorphism testing. Based on the individualization of nodes, backtracking and partition refinement, B l i s s [5,26] is powerful canonical labeling means for dealing with large and sparse graphs. Katebi et al. combine S a u c y with B l i s s and show that it is faster for computing the automorphism group of a graph with S a u c y and then calculating its canonical labeling with B l i s s than for alone calculating its canonical labeling with B l i s s [28]. To fix the vulnerability of N a u t y , T r a c e s uses the policy of breadth-first search to decide the automorphism group and the canonical labeling [4]. C o n a u t o also utilizes the fundamental individualization/refinement method and is quite quick for random graphs and several classes of hard graphs.
For the advancement of performance, current algorithms usually employ backtracking and orbit partitioning way to circumvent frequently visiting the same nodes and contrive to decrease the accessed nodes in the search tree. For the canonical labeling issue, McKay et al. present a full examination of the problem [22,23].
N a u t y governed the area for several decades. Therefore, in-depth research for canonical labeling has been limited to the theoretical skeleton of N a u t y . This implies that people are only like to support the study trajectory of n a u t y to extend and build further research.
Since there are several different definitions of canonical labeling, there is no uniform standard such that each researcher works on oneself standard. Besides the lack of a unified standard, the research on the connection between the distinct canonical labeling is also quite lacking. It is a hard task that one wants to confirm the accuracy of canonical labeling achieved by executing an algorithm. Up to now, the criterion by which one can decide which definition is better does not appear.
In this paper, the definition of c a n o n i c a l l a b e l i n g is completely distinct that of n a u t y . Unless by chance, the canonical labeling produced by N a u t y will be not a c a n o n i c a l l a b e l i n g according to the definition presented by the paper. It is sometimes difficult to confirm the accuracy of the canonical labeling achieved by executing N a u t y according to the criterion of N a u t y . Since the insides of many graphs contain a large number of automorphisms, the calculation of canonical labeling becomes extremely arduous in certain situations.
A graph invariant I ( G ) is called complete if the equality of the invariants I ( G ) and I ( H ) implies the isomorphism of the graphs G and H. However, even polynomial-valued invariants such as the chromatic polynomial are not usually complete. A path graph is a graph consisting of exactly its maximal path. For example, the path graph with 4 vertices and the claw graph K 1 , 3 both have the same chromatic polynomial.
Many algorithms also use the identical definition of c a n o n i c a l l a b e l i n g as adopted in the paper. However, their main goal is not to consider how to calculate c a n o n i c a l l a b e l i n g but for other purposes such as mining the frequent subgraphs. Therefore, these algorithms can only run for some limited graph classes. Until now, based on current knowledge and Definition 5 present in this paper, a universal algorithm for calculating the c a n o n i c a l l a b e l i n g s of graphs does not appear.
Jianqiang Hao et al. also provide Propositions 5–6, Lemmas 1–3 and Theorems 10–13 in Reference [2] by which one can compute the proper vertices added into M a x Q ( G ) . However, they do not give any proof. In this article, we prove Theorems 3–6 that are one-to-one corresponding to Theorems 10–13 in Reference [2]. We also present the reasons for Lemmas 8–9, which are one-to-one corresponding to Lemmas 2–3 in Reference [2].
In the rest of this paper, Section 2 presents some fundamental vocabulary and preparatory knowledge. Section 3 represents the results followed by some analysis. Section 4 gives our algorithms for calculating the c a n o n i c a l l a b e l i n g . Section 5 demonstrates the implementation of our algorithms and evaluates our way through many examples. Finally, Section 6 remarks on our conclusions and future work.

2. Preliminaries

This paper only handles limited undirected graphs with neither loops nor multiple edges. A graph consists of a set of nodes and a collection of edges. For a graph G = ( V ( G ) , E ( G ) ) , assume that V ( G ) and E ( G ) represent the set of vertices of G and the collection of edges of G. Any an edge ( u , v ) E ( G ) joins two vertices u G and v G . For this article to be self-contained, the relevant concepts and definitions are given below.
Definition 1.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices. A vertex-induced subdigraph on V 1 V ( G ) of G is a subgraph with the vertices set V 1 together with any side whose endpoints are both in V 1 , expressed by G [ V 1 ] .
Definition 2.
Given two undirected graphs G = ( V ( G ) , E ( G ) ) and H = ( V ( H ) , E ( H ) ) of n vertices. If there is a bijection f : V ( G ) V ( H ) such that ( u , v ) E ( G ) if and only if ( f ( u ) , f ( v ) ) E ( H ) . We call f an isomorphic projection of G H . Furthermore, we state that the graph G and H are isomorphic, signified by G H . An isomorphic map f of G onto itself is declared to be an automorphism of G.
Let X = ( x 1 , x 2 , , x i , x m ) in R m and Y = ( y 1 , y 2 , , y j , ⋯ y n ) in R n be two vectors, the issue emerges as to how to determine which one is larger. When comparing two vectors, the following rules must be satisfied.
Definition 3.
Given two vectors X = ( x 0 , x 1 , , x i , x m ) and Y = ( y 0 , y 1 , , y i , y n ) in N (the collection of natural numbers) satisfying m 0 and n 0 . Then, the lexicographic order of the two vectors is defined as follows:
1. 
X = Y , if m = n and x i = y i for all 0 i m .
2. 
X < Y if and only if either of the following is true.
(a) 
k , 0 k min ( m , n ) , x i = y i for i < k , x k < y k .
(b) 
x i = y i for 0 i m and m < n .
Definition 4.
Given two vectors Z 1 = ( X 0 , X 1 , , X i , X m ) and Z 2 = ( Y 0 , Y 1 , , Y j , Y n ) satisfying m 0 and n 0 , where each X i , Y j , i = 0 , 1 , , m , j = 0 , 1 , , n denotes a vector in N (the collection of natural numbers). Then, the lexicographic order of the two vectors is defined as follows:
1. 
Z 1 = Z 2 , if m = n and X i = Y i for all 0 i m .
2. 
Z 1 < Z 2 if and only if either of the following is true.
(a) 
k , 0 k min ( m , n ) , X i = Y i for i < k , x k < y k .
(b) 
X i = Y i for 0 i m and m < n .
Definition 5.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices with adjacency matrix A ( G ) = ( a i , j ) n × n . To concatenate the rows of the upper triangular part of A ( G ) in the following order a 1 , 2 , a 1 , 3 , ⋯, a 1 , n , a 2 , 3 , a 2 , 4 , ⋯, a 2 , n , ⋯, a i , i + 1 , a i , i + 2 , ⋯, a i , n , ⋯, a n 1 , n makes a corresponding binary number a 1 , 2 a 1 , 3 a 1 , n a 2 , 3 a 2 , 4 a 2 , n a i , i + 1 a i , i + 2 a i , n a n 1 , n , which is a l a b e l i n g of G, signified by C ( G ) (see (1)).
A ( G ) = 0 a 1 , 2 a 1 , 3 a 1 , n a 1 , 2 0 a 2 , 3 a 2 , n a 1 , i a 2 , i a i , i 1 0 a i , i + 1 a i , n a n 1 , n a 1 , n a 2 , n a 3 , n a n 1 , n 0
The first row of the upper triangular portion of A ( G ) is the l a b e l i n g s l i c e 1 of C ( G ) , signified by C 1 ( G ) . Likewise, the second row of the upper triangular portion is the l a b e l i n g s l i c e 2 of C ( G ) , signified by C 2 ( G ) . ⋯. The ( n 1 ) th row of the upper triangular portion is the l a b e l i n g s l i c e n 1 of C ( G ) , signified by C n 1 ( G ) . It is true that C ( G ) = C 1 ( G ) C 2 ( G ) C n 1 ( G ) .
A permutation π of the nodes of G is an order of the n nodes without repeating. The number of shifts of the nodes of G is n ! . Further, each distinct permutation π of the n nodes of V ( G ) determines a single adjacency matrix. Therefore, given a permutation π , one can get a l a b e l i n g C ( G ) corresponding to π by Definition 5. The collection of all l a b e l i n g of G is represented by L ( G ) .
For every C 1 ( G ) , C 2 ( G ) L ( G ) , Suppose that C 1 ( G ) = i 1 i 2 i m , C 2 ( G ) = j 1 j 2 j n with i 1 , i 2 , , i m , j 1 , j 2 , , j n = 0 or 1. Given X = ( i 1 , i 2 , , i m ) and Y = ( j 1 , j 2 , , j n ) . By Definition 3, if X > Y , then we set C 1 ( G ) > C 2 ( G ) . Otherwise, if X < Y , then we set C 1 ( G ) < C 2 ( G ) . Otherwise, if X = Y , then we set C 1 ( G ) = C 2 ( G ) .
Definitely, ( L ( G ) , ) is a well-ordered set, where ≤ signifies the less-than-or-equal-to binary relationship on the collection L ( G ) stated as above. By the well-ordering theorem, it follows that L ( G ) has a minimum and maximum element, signifies by C m i n ( G ) and C m a x ( G ) and called m i n i m u m c a n o n i c a l l a b e l i n g of G and m a x i m u m c a n o n i c a l l a b e l i n g of G respectively. We also call m a x i m u m c a n o n i c a l l a b e l i n g c a n o n i c a l l a b e l i n g of G.
The two shifts of the n nodes of G associated with C m i n ( G ) and C m a x ( G ) are the m i n i m u m a n d m a x i m u m n o d e s e q u e n c e , signifies by M i n Q ( G ) and M a x Q ( G ) . Furthermore, the two adjacency matrices of G associated with C m i n ( G ) and C m a x ( G ) are the m i n i m u m a n d m a x i m u m c a n o n i c a l l a b e l i n g m a t r i x , signifies by A m i n ( G ) and A m a x ( G ) .
C 1 ( G ) , C 2 ( G ) , , C n 1 ( G ) corresponding to A m i n ( G ) are m i n i m u m c a n o n i c a l l a b e l i n g s l i c e 1 , 2 , , n 1 of canonical labeling C ( G ) , signified by C m i n 1 ( G ) , C m i n 2 ( G ) , , C m i n n 1 ( G ) , respectively. Conversely, C 1 ( G ) , C 2 ( G ) , ⋯, C n 1 ( G ) corresponding to A m a x ( G ) are m a x i m u m c a n o n i c a l l a b e l i n g s l i c e 1 , 2 , , n 1 of canonical labeling C ( G ) , signified by C m a x 1 ( G ) , C m a x 2 ( G ) , , C m a x n 1 ( G ) , respectively.
Based on the above definitions, the following equations are established.
C m i n ( G ) = C m i n 1 ( G ) C m i n 2 ( G ) C m i n n 1 ( G )
C m a x ( G ) = C m a x 1 ( G ) C m a x 2 ( G ) C m a x n 1 ( G )
Theorem 1.
Given two undirected graphs G = ( V ( G ) , E ( G ) ) and H = ( V ( H ) , E ( H ) ) of n vertices with adjacency matrices A ( G ) and A ( H ) respectively. Then G H if and only if C m i n ( G ) = C m i n ( H ) or C m a x ( G ) = C m a x ( H ) .
Lemma 1.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices whose complement graph is G ¯ = ( V ( G ¯ ) , E ( G ¯ ) ) . Then C ( G ) = C ( G ¯ ) ¯ and C ( G ¯ ) = C ( G ) ¯ hold.
Proof. 
The adjacency matrices of G and G ¯ meet the following condition.
A ( G ) + A ( G ¯ ) = J = 0 1 1 1 0 1 1 0 1 1 1 1 1 0 .
where J is an n × n matrix of zeros and ones whose main diagonal entries are 0 and all other entries are 1. By the complement graph G ¯ and A ( G ) = J A ( G ¯ ) , it can be seen that C ( G ) = C ( G ¯ ) ¯ . Furthermore, by A ( G ¯ ) = J A ( G ) , it follows that C ( G ¯ ) = C ( G ) ¯ for the complement graph G ¯ of G. □
Theorem 2.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices whose complement graph is G ¯ = ( V ( G ¯ ) , E ( G ¯ ) ) . It follows that
C m i n ( G ) = C m a x ( G ¯ ) ¯
C m a x ( G ) = C m i n ( G ¯ ) ¯
C m i n ( G ¯ ) = C m a x ( G ) ¯
C m a x ( G ¯ ) = C m i n ( G ) ¯
Proof. 
By Lemma 1, it holds that C ( G ) = C ( G ¯ ) ¯ . Definitely, the k-bit of C ( G ¯ ) is 0 if and only if the k-bit of C ( G ) is 1. Therefore, one can make the c a n o n i c a l l a b e l i n g C m a x ( G ) of G by executing a complement operation on C m i n ( G ¯ ) . Likewise, by Lemma 1, the identity C ( G ¯ ) = C ( G ) ¯ holds. Definitely, the k-bit of C ( G ) is 0 if and only if the k-bit of C ( G ¯ ) is 1. Hence, one can make the c a n o n i c a l l a b e l i n g C m a x ( G ¯ ) of G ¯ by executing a complement operation on C m i n ( G ) .
Since C ( K n ) is a constant binary number, one must maximize C ( G ¯ ) to minimize C ( G ) . On the opposite, one must minimize C ( G ¯ ) to maximize C ( G ) . Likewise, one must maximize C ( G ) to minimize C ( G ¯ ) . Contrariwise, one must minimize C ( G ) to maximize C ( G ¯ ) . From the above examination, the following results hold.
C m i n ( G ) = C m a x ( G ¯ ) ¯ . C m a x ( G ) = C m i n ( G ¯ ) ¯ . C m i n ( G ¯ ) = C m a x ( G ) ¯ . C m a x ( G ¯ ) = C m i n ( G ) ¯ .
 □
By Theorem 2, it can be seen that if one has computed the C m a x ( G ¯ ) , one can simply make C m i n ( G ) . Moreover, the computation means of C m a x ( G ¯ ) and C m a x ( G ) are precisely the same.
Theorem 2 shows the mutual relations between C m a x ( G ) and C m i n ( G ) . Because of the existence of the relations, the paper only concentrates on the construction of effective ways to determine C m a x ( G ) . The T o p M o s t g r a p h of G is a graph whose l a b e l i n g C ( G ) is lexicographically largest.
We signify by d G ( u ) the degree of a node u in G, by d ( G ) = ( d G ( u 1 ) , d G ( u 2 ) , , d G ( u n ) ) the d e g r e e s e q u e n c e of G, by d G ( V 1 ) = ( d G ( v 1 ) , d G ( v 2 ) , , d G ( v m ) ) the degree series of a subset V 1 V ( G ) with v i V 1 , i = 1 , 2 , , m and by d G ( H ) = ( d H ( w 1 ) , d H ( w 2 ) , , d H ( w s ) ) the d e g r e e s e q u e n c e of a subgraph H G with w j V ( H ) , j = 1 , 2 , , t and drop the symbol G when no vagueness can occur. We signify by δ ( G ) the minimum degree and by Δ ( G ) the maximum degree of all vertices of a graph G. Throughout this article, suppose S ( G ) = { u | u V ( G ) d ( u ) = Δ ( G ) } . In the following text, when simultaneously involving two graphs, we always assume that their degree sequences are the same except specified.
For each u V ( G ) , the quantity of vertices with degree d G ( u ) is the d e g r e e m u l t i p l i c i t y of u, signified by d m G ( u ) . Unless otherwise specified, throughout this article, the degree sequence is decreasing. The distance d ( u , v ) between any two nodes u and v is the number of edges on the shortest path from u to v.
For every u V ( G ) , an edge connecting two adjacent vertices of u is a c h o r d e d g e of u and an edge connecting u and its an adjacent vertex is an i n c i d e n t e d g e of u. Given a set S of vertices in G, let C E ( S ) signify the s e t o f c h o r d e d g e s of all nodes in S and I E ( S ) signify the s e t o f i n c i d e n t e d g e s of all vertices in S. Such as in the graph G shown in Figure 1, the edge ( 3 , 8 ) is a c h o r d e d g e of the vertex 7 and each of the edges ( 3 , 7 ) , ( 7 , 8 ) and ( 10 , 7 ) are its i n c i d e n t e d g e s . C E ( { 7 } ) = { ( 3 , 8 ) } and I E ( { 7 } ) = { ( 3 , 7 ) , ( 7 , 8 ) , ( 10 , 7 ) } .
Definition 6.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices. The open neighborhood subgraph of a node u in G is a subgraph of G, signified by N ( u ) = ( V ( N ( u ) ) , E ( N ( u ) ) ) where V ( N ( u ) ) is the set of all nodes adjacent to u ( u V ( N ( u ) ) ) and E ( N ( u ) ) is the collection of all edges, each of which connects two vertices of V ( N ( u ) ) .
The o p e n k- n e i g h b o r h o o d s u b g r a p h of u with k 2 is a subgraph, signified by N k ( u ) = ( V ( N k ( u ) ) , E ( N k ( u ) ) ) with V ( N k ( u ) ) = { v d ( u , v ) k v u v V ( G ) } , E ( N k ( u ) ) = { ( v , w ) v , w V ( N k ( u ) ) , ( v , w ) C E ( V ( N k 1 ( u ) ) ) I E ( V ( N k 1 ( u ) ) ) } .
Definition 7.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices. The open neighborhood subgraph of a vertices set Q V ( G ) is a subgraph of G, signified by N ( Q ) = ( V ( N ( Q ) ) , E ( N ( Q ) ) ) where V ( N ( Q ) ) is the set of all nodes each of which is adjacent to at least one node in Q with Q V ( N ( Q ) ) = and E ( N ( Q ) ) is the collection of all edges each of which joins two vertices of V ( N ( Q ) ) .
The o p e n k- n e i g h b o r h o o d s u b g r a p h of Q with k 2 is a subgraph, signified by N k ( Q ) = ( V ( N k ( Q ) ) , E ( N k ( Q ) ) ) with V ( N k ( Q ) ) = { v v Q v V ( G ) u Q d ( v , u ) k } , E ( N k ( Q ) ) = { ( v , w ) v , w V ( N k ( Q ) ) , ( v , w ) C E ( V ( N k 1 ( Q ) ) ) I E ( V ( N k 1 ( Q ) ) ) } .
Remark 1.
For some graphs, there may be some edges whose two end vertices lie in V ( N k ( u ) ) but do not belong to N k ( u ) by Definition 6. For example, consider the graph G given in Figure 1. Although the vertex 6 and 11 belong to V ( N 3 ( 7 ) ) , ( 6 , 11 ) E ( N 3 ( 7 ) ) . In addition, the vertex 14 and 15 belong to V ( N 4 ( 7 ) ) . However, ( 14 , 15 ) E ( N 4 ( 7 ) ) .
Definition 8.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices. For each u V ( G ) , the open kth neighborhood subgraph of u with k 0 is a subgraph, signified by T k ( u ) = ( V ( T k ( u ) ) , E ( T k ( u ) ) ) with V ( T k ( u ) ) = { v d ( u , v ) = k v u v V ( G ) } , E ( T k ( u ) ) = { ( v , w ) v , w V ( T k ( u ) ) ( v , w ) C E ( V ( T k ( u ) ) ) } . For k = 0 , let V ( T 0 ( u ) ) = { u } and E ( T 0 ( u ) ) = .
Definition 9.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices. Assume that H G and u V ( H ) . We signify by N H k ( u ) the   o p e n k- n e i g h b o r h o o d s u b g r a p h of u in H and by T H k ( u ) the   o p e n   k t h n e i g h b o r h o o d   s u b g r a p h of u in H. For k = 1 , we drop the superscript 1 for clarity and write N H ( u ) = N H 1 ( u ) and T H ( u ) = T H 1 ( u ) , instead.
Definition 10.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected connected graph of n vertices. For each u V ( G ) , there is a positive integer k meeting conditions N k 1 ( u ) G u and N k ( u ) = G u . The value of k is defined as the   d i f f u s i o n   r a d i u s of u, signified by ρ G ( u ) and we drop the symbol G when no vagueness can occur.
By Definition 10, it is explicit that N ρ ( u ) ( u ) = G u for each u in G. For notational convenience, we sometimes use G u as a shorthand for N ρ ( u ) ( u ) .
Here, we discuss the connection between the o p e n k- n e i g h b o r h o o d s u b g r a p h N k ( u ) and d ( u ) with u V ( N k ( u ) ) (see Figure 2). We present some basic properties of the o p e n k- n e i g h b o r h o o d s u b g r a p h N k ( u ) by the following Lemma 2.
Lemma 2.
Let N 1 ( u ) , N 2 ( u ) , ⋯, N k ( u ) , ⋯, N ρ ( u ) ( u ) be the 1 , 2 , , k , , ρ ( u ) -neighborhood subgraph of a vertex u in a graph G. If there exists a node v V ( N 1 ( u ) ) , then
d N 2 ( u ) ( v ) = d N 3 ( u ) ( v ) = = d N k ( u ) ( v ) = = d N ρ ( u ) ( u ) ( v ) = d G ( v ) 1 .
Likewise, if there exists a node v V ( N k ( u ) ) v V ( N k + 1 ( u ) ) with k 1 , then
d N k + 2 ( u ) ( v ) = d N k + 3 ( u ) ( v ) = = d N ρ ( u ) ( u ) ( v ) = d G ( v ) .
Proof. 
(8) and (9) follow directly from Definition 10 (see Figure 2). □
By Lemma 2, it is clear that for every v V ( N k + 1 ( u ) ) , satisfies v V ( N k ( u ) ) or v V ( N k ( u ) ) . According to whether v belongs to V ( N k ( u ) ) or not, V ( N k + 1 ( u ) ) can be partitioned into two disjoint sets V k + 1 1 ( u ) = { v v V ( N k ( u ) ) v V ( N k + 1 ( u ) ) } and V k + 1 2 ( u ) = { w w V ( N k ( u ) ) w V ( N k + 1 ( u ) ) } . Observe that V k + 1 1 ( u ) = V ( N k ( u ) ) and V k + 1 2 ( u ) = V ( N ( V k 2 ( u ) ) ) hold by Definitions 6 and 7 (see Figure 1). Therefore V ( N k + 1 ( u ) ) = V k + 1 1 ( u ) V k + 1 2 ( u ) = V ( N k ( u ) ) V ( N ( V k 2 ( u ) ) ) . V k + 1 1 ( u ) and V k + 1 2 ( u ) are the d e g r e e s t a b l e v e r t i c e s s e t and d e g r e e u n s t a b l e v e r t i c e s s e t of N k + 1 ( u ) referred to as the s t a b l e v e r t i c e s s e t and u n s t a b l e v e r t i c e s s e t . Correspondingly, a vertex v V k + 1 1 ( u ) is a d e g r e e s t a b l e v e r t e x referred to as a s t a b l e v e r t e x and a vertex w V k + 1 2 ( u ) is a d e g r e e u n s t a b l e v e r t e x referred to as an u n s t a b l e v e r t e x .
Further note that E ( N k + 1 ( u ) ) = E ( N k ( u ) ) E k + 1 with E k + 1 = C E ( N ( V k 2 ( u ) ) ) I E ( N ( V k 2 ( u ) ) ) . Therefore, E ( N k + 1 ( u ) ) = E ( N k ( u ) ) C E ( N ( V k 2 ( u ) ) ) I E ( N ( V k 2 ( u ) ) ) . The following Lemma 3 sums up the above discussion.
Lemma 3.
Suppose N k + 1 ( u ) = ( V ( N k + 1 ( u ) ) , E ( N k + 1 ( u ) ) ) is the   o p e n ( k + 1 ) - n e i g h b o r h o o d s u b g r a p h of vertex u in a graph G. Then there exist two disjoint sets, the s t a b l e v e r t i c e s s e t V k + 1 1 ( u ) and the u n s t a b l e v e r t i c e s s e t V k + 1 2 ( u ) , meeting conditions
V ( N k + 1 ( u ) ) = V k + 1 1 ( u ) V k + 1 2 ( u ) = V ( N k ( u ) ) V ( N ( V k 2 ( u ) ) ) ,
with V k + 1 1 ( u ) = V ( N k ( u ) ) , V k + 1 2 ( u ) = V ( N ( V k 2 ( u ) ) ) . Further, it follows that
E ( N k + 1 ( u ) ) = E ( N k ( u ) ) C E ( N ( V k 2 ( u ) ) ) I E ( N ( V k 2 ( u ) ) ) .
Let V ( N 0 ( u ) ) = and V 0 2 ( u ) = u , then V 1 1 ( u ) = and V 1 2 ( u ) = V ( N 1 ( u ) ) hold for the neighborhood subgraph.
For the ρ ( u ) -neighborhood subgraph, V ρ ( u ) + 1 1 ( u ) = V ( N ρ ( u ) + 1 ( u ) ) = V ( N ρ ( u ) ) holds with V ρ ( u ) + 1 2 ( u ) = .
By Lemma 3, it can be seen that the calculation of the o p e n ( k + 1 ) - n e i g h b o r h o o d s u b g r a p h can be simplified by means of the o p e n k- n e i g h b o r h o o d s u b g r a p h for every node v in G.
Definition 11.
Assume that G = ( V ( G ) , E ( G ) ) is an undirected graph and u is a vertex in G whose o p e n k- n e i g h b o r h o o d s u b g r a p h is N k ( u ) with k = 1 , 2 , . A vertex in N ( u ) is a o n e   d i f f u s i o n   r a d i u s   n o d e of u. For k > 1 , a node v in N k ( u ) meeting condition v N k 1 ( u ) is a  k   d i f f u s i o n   r a d i u s   n o d e of u.
Each vertex v in G is attached a property m _ N e a r e s t N o d e whose function is explained in Section 3.1.2.
Definition 12.
Assume that G = ( V ( G ) , E ( G ) ) is an undirected graph and u is a node in G whose o p e n k- n e i g h b o r h o o d s u b g r a p h is N k ( u ) with k = 1 , 2 , . Suppose H is a connected component of N k ( u ) with k 1 . Suppose that V m V ( H ) with m = 0 , 1 , 2 , , t , where V 0 is in ascending order of attribute m _ N e a r e s t N o d e with
v > m _ N e a r e s t N o d e 1 for every v V 0 and V 1 , V 2 , , V t contain the 1 , 2 , , k d i f f u s i o n r a d i u s n o d e s of u respectively, meeting conditions V 0 V 1 V t = V ( H ) and V i V j = for i j , i , j = 0 , 1 , , t .
Let d σ ( H ) = ( d N k ( u ) ( V 0 ) , ⋯, d N k ( u ) ( V i ) , ⋯, d N k ( u ) ( V t ) ) be defined as the   d i f f u s i o n   d e g r e e   s e q u e n c e of H where d N k ( u ) ( V i ) with i = 0 , 1 , , t are the degree sequences in non-increasing order induced by all nodes in V i respectively.
Definition 13.
Assume that G = ( V ( G ) , E ( G ) ) is an undirected graph and u is a node in G whose o p e n k- n e i g h b o r h o o d s u b g r a p h k is N k ( u ) with k = 1 , 2 , . Assume that N k ( u ) has p connected components H 1 , H 2 , ⋯, H p with d i f f u s i o n d e g r e e s e q u e n c e s d σ ( H 1 ) , d σ ( H 2 ) , ⋯, d σ ( H p ) respectively, meeting conditions d σ ( H 1 ) d σ ( H 2 ) d σ ( H p ) .
We define d G σ [ N k ( u ) ] = ( d σ ( H 1 ) , d σ ( H 2 ) , ⋯, d σ ( H p ) ) to be the   e n t i r e   d i f f u s i o n   d e g r e e   s e q u e n c e of N k ( u ) about u in G and drop the symbol G when no vagueness can occur.
We define d G m a x [ N k ( u ) ] = d σ ( H 1 ) to be the   m a x i m u m   d i f f u s i o n   d e g r e e   s e q u e n c e of N k ( u ) about u in G and drop the symbol G when no vagueness can occur.
Remark 2.
To define d i f f u s i o n d e g r e e s e q u e n c e s d σ ( H ) = ( d N k ( u ) ( V 0 ) , d N k ( u ) ( V 1 ) , ⋯, d N k ( u ) ( V t ) ) and e n t i r e d i f f u s i o n d e g r e e s e q u e n c e d G σ [ N k ( u ) ] = ( d σ ( H 1 ) , d σ ( H 2 ) , ⋯, d σ ( H p ) ) , we pay a great deal of efforts into software testing and theoretical studies. We used more than 20 different kinds of degree sequences in the software experiments and compared the results of distinct degree sequences. Built on the preceding works, it is not difficult to find that performance of the two degree sequences specified by Definitions 12 and 13 is optimal. With the adoption of the two definitions, the accuracy of our algorithm significantly enhances.
Given a graph G, the e n t i r e d i f f u s i o n d e g r e e s e q u e n c e d G σ [ N k ( u ) ] = ( d σ ( H 1 ) , d σ ( H 2 ) , ⋯, d σ ( H p ) ) can be used in the literature of finance for the jump-diffusion models [29,30].
Definition 14.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices. For each u , v V ( G ) with u v and, let N 1 ( u ) , N 2 ( u ) , ⋯, N ρ ( u ) ( u ) be the 1, 2, ⋯, ρ ( u ) neighborhood subgraph of u with e n t i r e d i f f u s i o n d e g r e e s e q u e n c e s d σ [ N 1 ( u ) ] , d σ [ N 2 ( u ) ] , ⋯, d σ [ N ρ ( u ) ( u ) ] , respectively. Let N 1 ( v ) , N 2 ( v ) , ⋯, N ρ ( v ) ( v ) be the 1, 2, ⋯, ρ ( v ) neighborhood subgraph of v with e n t i r e d i f f u s i o n d e g r e e s e q u e n c e s d σ [ N 1 ( v ) ] , d σ [ N 2 ( v ) ] , ⋯, d σ [ N ρ ( v ) ( v ) ] , respectively. Let Z 1 = ( d σ [ N 1 ( u ) ] , d σ [ N 2 ( u ) ] , ⋯, d σ [ N ρ ( u ) ( u ) ] ) and Z 2 = ( d σ [ N 1 ( v ) ] , d σ [ N 2 ( v ) ] , ⋯, d σ [ N ρ ( v ) ( v ) ] ) . If Z 1 > Z 2 , we call u v concerning G. Otherwise, if Z 1 < Z 2 , we call u v concerning G. Otherwise, if Z 1 = Z 2 , we call u v concerning G and ignore the sign G when no vagueness can occur. Signify u v or u v by u v and u v or u v by u v .
Observe that ≻, ≺, ≍, ⪰ are all binary relations on the collection of vertices V ( G ) . By Definition 14, for each u , v V ( G ) with u v , one of the following assertions is true: (1) u v . (2) u v . (3) u v .
It can be noted that ( V ( G ) , ) is a well-ordered set, where ⪰ signifies the binary relation u v on the set V ( G ) . By the well-ordering theorem, it holds that there is a maximum and minimum element in V ( G ) , signified by G m a x and G m i n respectively with G m a x V ( G ) and G m i n V ( G ) . The superscript ⪰ can be ignored if no vagueness can occur. The following Lemmas 4–6 immediately hold from Definition 14.
Lemma 4.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices. For each u , v V ( G ) with u v , if the sign ⪰ signifies the binary relation u v on the collection V ( G ) , then, all of the vertices in G build a sole linkage L on G: v 1 v 2 v i v n with v i V ( G ) , i = 1 , 2 , , n .
Lemma 5.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices. Suppose S ( G ) = { u | u V ( G ) d ( u ) = Δ ( G ) = s } . For each u , v S ( G ) with u v , if the sign ⪰ signifies the binary relation u v on the set S ( G ) , then, all of the vertices in S ( G ) build a sole linkage L on G: v 1 v 2 v i v s with v i S ( G ) , i = 1 , 2 , , s .
Lemma 6.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices. For each u V ( G ) , Let N k ( u ) be the o p e n k- n e i g h b o r h o o d s u b g r a p h of u in G. Suppose S ( N k ( u ) ) = { v | v V ( N k ( u ) ) d ( v ) = Δ ( N k ( u ) ) = t } .
For each v , w S ( N k ( u ) ) with v w , if the sign ⪰ signifies the binary relation v w on the collection S ( N k ( u ) ) , then, all of the vertices in S ( N k ( u ) ) build a single linkage L on N k ( u ) : v 1 v 2 v i v t with v i S ( N k ( u ) ) , i = 1 , 2 , , t .
By Definitions 3, 4 and 14, the outcomes in the following Propositions 1 and 2 are uncomplicated.
Proposition 1.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices. For each u , v V ( G ) with u v , let N 1 ( u ) , N 2 ( u ) , ⋯, N ρ ( u ) ( u ) be the 1, 2, ⋯, ρ ( u ) neighborhood subgraph of u with e n t i r e d i f f u s i o n d e g r e e s e q u e n c e s d σ [ N 1 ( u ) ] , d σ [ N 2 ( u ) ] , ⋯, d σ [ N ρ ( u ) ( u ) ] , respectively. Let N 1 ( v ) , N 2 ( v ) , ⋯, N ρ ( v ) ( v ) be the 1, 2, ⋯, ρ ( v ) neighborhood subgraph of v with e n t i r e d i f f u s i o n d e g r e e s e q u e n c e s d σ [ N 1 ( v ) ] , d σ [ N 2 ( v ) ] , ⋯, d σ [ N ρ ( v ) ( v ) ] , respectively. Let Z 1 = ( d σ [ N 1 ( u ) ] , d σ [ N 2 ( u ) ] , ⋯, d σ [ N ρ ( u ) ( u ) ] ) = ( X 1 , Y 1 ) with X 1 = ( d σ [ N 1 ( u ) ] , d σ [ N 2 ( u ) ] , ⋯, d σ [ N k ( u ) ] ) and Y 1 = ( d σ [ N k + 1 ( u ) ] , d σ [ N k + 2 ( u ) ] , ⋯, d σ [ N ρ ( u ) ( u ) ] ) . Let Z 2 = ( d σ [ N 1 ( v ) ] , d σ [ N 2 ( v ) ] , ⋯, d σ [ N ρ ( v ) ( v ) ] ) = ( X 2 , Y 2 ) with X 2 = ( d σ [ N 1 ( v ) ] , d σ [ N 2 ( v ) ] , ⋯, d σ [ N k ( v ) ] ) and Y 2 = ( d σ [ N k + 1 ( v ) ] , d σ [ N k + 2 ( v ) ] , ⋯, d σ [ N ρ ( v ) ( v ) ] ) . If X 1 = X 2 , then Y 1 > Y 2 leads to Z 1 > Z 2 . Otherwise, Y 1 < Y 2 leads to Z 1 < Z 2 . Otherwise, Y 1 = Y 2 leads to Z 1 = Z 2 . Accordingly, it follows that if X 1 = X 2 , then Y 1 > Y 2 leads to u v . Otherwise, Y 1 < Y 2 leads to u v . Otherwise, Y 1 = Y 2 leads to u v .
Proposition 2.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices. For each u , v V ( G ) with u v , let N 1 ( u ) , N 2 ( u ) , ⋯, N ρ ( u ) ( u ) be the 1, 2, ⋯, ρ ( u ) neighborhood subgraph of u with e n t i r e d i f f u s i o n d e g r e e s e q u e n c e s d σ [ N 1 ( u ) ] , d σ [ N 2 ( u ) ] , ⋯, d σ [ N ρ ( u ) ( u ) ] , respectively. Let N 1 ( v ) , N 2 ( v ) , ⋯, N ρ ( v ) ( v ) be the 1, 2, ⋯, ρ ( v ) neighborhood subgraph of v with e n t i r e d i f f u s i o n d e g r e e s e q u e n c e s d σ [ N 1 ( v ) ] , d σ [ N 2 ( v ) ] , ⋯, d σ [ N ρ ( v ) ( v ) ] , respectively. If d σ [ N 1 ( u ) ] = d σ [ N 1 ( v ) ] , d σ [ N 2 ( u ) ] = d σ [ N 2 ( v ) ] , ⋯, d σ [ N k 1 ( u ) ] = d σ [ N k 1 ( v ) ] , d σ [ N k ( u ) ] > d σ [ T k ( v ) ] , then u v concerning G (see Definition 14).

3. Results and Discussion

Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices. In the section, we will examine how to determine the c a n o n i c a l l a b e l i n g C m a x ( G ) of the graph G. The permutations of G associated with C m a x ( G ) are the M a x Q ( G ) . Without loss of generality, let M a x Q ( G ) = ( u 1 , u 2 , , u i , , u n ) . Throughout the article, all algorithms presented use an adjacency list to save the graph G.

3.1. Calculate C m a x ( G ) for a Connected Graph

In this subsection, we consider how to determine the c a n o n i c a l l a b e l i n g C m a x ( G ) of a connected graph. What method should one take to calculate the c a n o n i c a l l a b e l i n g C m a x ( G ) ? From the relationship between C m a x ( G ) and A m a x ( G ) , a way for computing C m a x ( G ) must first get the permutation M a x Q ( G ) associated with the adjacency matrix A m a x ( G ) .

3.1.1. Calculate the First Node u 1 of M a x Q ( G )

In this sub-subsection, we study how to calculate the first vertex u 1 of M a x Q ( G ) . Jianqiang Hao et al. employ the C e n ( G ) to determine the first node u 1 of M a x Q ( G ) for simple nonregular graphs [2]. This means that this method is invalid for regular graphs. Suppose that G is a connected graph with order n > 1 . It can be seen that one must let a 1 , 2 = 1 maximize C ( G ) (see (1)). a 1 , 2 = 1 can always be taken because G is connected with order n > 1 . Besides, to get C m a x ( G ) , one must choose u 1 from S ( G ) . Only by so doing, can there be more “1” s in the high bits of C ( G ) such that guarantees maximum C ( G ) . Otherwise, C ( G ) cannot attain the maximum value. From the previous analysis, the following Proposition 3 and Lemma 7 hold.
Proposition 3.
Assume that G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices and S ( G ) = { u | u V ( G ) d ( u ) = Δ ( G ) }. Then the choice of u 1 of M a x Q ( G ) is from S ( G ) for getting C m a x ( G ) .
Lemma 7.
Assume that G = ( V ( G ) , E ( G ) ) be an undirected graph of n vertices and S ( G ) = { u | u V ( G ) d ( u ) = Δ ( G ) }. If | S ( G ) | = 1 with v S ( G ) . Then u 1 = v for M a x Q ( G ) .
For | S ( G ) | > 1 , the following Theorem 3 holds.
Theorem 3.
Assume that G = ( V ( G ) , E ( G ) ) is an undirected connected graph of n vertices and S ( G ) = { u | u V ( G ) d ( u ) = Δ ( G ) = s } with | S ( G ) | > 1 . Let v S ( G ) with v 1 V ( N ( v ) ) and d N ( v ) ( v 1 ) = Δ ( N ( v ) ) . For every w S ( G ) w v with w 1 V ( N ( w ) ) and d N ( w ) ( w 1 ) = Δ ( N ( w ) ) , if condition d N ( v ) ( v 1 ) > d N ( w ) ( w 1 ) holds, then u 1 = v for M a x Q ( G ) .
Proof. 
From (1), it follows that C m a x 1 ( G ) = a 1 , 2 a 1 , 3 a 1 , n and C m a x 2 ( G ) = a 2 , 3 a 2 , 4 a 2 , n . Since ( G ) = s , it can be shown that a 1 , 2 = a 1 , 3 = = a 1 , s + 1 = 1 for C m a x 1 ( G ) .
By the conditions of Theorem 3, it is clearly that d N ( v ) ( v 1 ) = ( N ( v ) ) and d N ( w ) ( w 1 ) = ( N ( w ) ) . For clarity, let us suppose that r = d N ( v ) ( v 1 ) , t = d N ( w ) ( w 1 ) .
If conditions r = d N ( v ) ( v 1 ) > t = d N ( w ) ( w 1 ) are satisfied for every w S ( G ) w v and make the u 1 = w , then at most C m a x 2 ( G ) = a 2 , 3 a 2 , 4 a 2 , n with a 2 , 3 = a 2 , 4 = = a 2 , t + 2 = 1 and a 2 , t + 3 = a 2 , t + 4 = = a 2 , s + 1 = 0 (see (1). Otherwise, if let the u 1 = v , then C m a x 2 ( G ) = a 2 , 3 a 2 , 4 a 2 , n with a 2 , 3 = a 2 , 4 = = a 2 , r + 2 = 1 and a 2 , r + 3 = a 2 , r + 4 = = a 2 , r + 1 = 0 (see (1)).
Because r > t , Theorem 3 follows by contrasting the above two outcomes of C m a x 2 ( G ) got. □
Theorem 4.
Assume that G = ( V ( G ) , E ( G ) ) is an undirected connected graph of n vertices and S ( G ) = { u | u V ( G ) d ( u ) = Δ ( G ) = s } with | S ( G ) | > 1 . Let v S ( G ) with v 1 V ( N ( v ) ) and d N ( v ) ( v 1 ) = Δ ( N ( v ) ) . For each w S ( G ) w v with w 1 V ( N ( w ) ) and d N ( w ) ( w 1 ) = Δ ( N ( w ) ) , if conditions d N ( v ) ( v 1 ) = d N ( w ) ( w 1 ) and d G ( v 1 ) > d G ( w 1 ) hold, then u 1 = v for M a x Q ( G ) .
Proof. 
From (1), it follows that C m a x 1 ( G ) = a 1 , 2 a 1 , 3 a 1 , n and C m a x 2 ( G ) = a 2 , 3 a 2 , 4 a 2 , n . Since ( G ) = s , it can be shown that a 1 , 2 = a 1 , 3 = = a 1 , s + 1 = 1 for C m a x 1 ( G ) .
By the conditions of Theorem 4, it is clear that d N ( v ) ( v 1 ) = d N ( w ) ( w 1 ) = ( N ( v ) ) . For clarity, let us suppose that t = d N ( v ) ( v 1 ) = d N ( w ) ( w 1 ) and l = d G ( v 1 ) > m = d G ( w 1 ) .
If conditions d G ( v 1 ) > d G ( w 1 ) are satisfied for every w S ( G ) w v and make the u 1 = w , then at most C m a x 2 ( G ) = a 2 , 3 a 2 , 4 a 2 , n with a 2 , 3 = a 2 , 4 = = a 2 , t + 2 = 1 , a 2 , t + 3 = a 2 , t + 4 = = a 2 , s + 1 = 0 , a 2 , s + 2 = a 2 , s + 3 = = a 2 , s + m t = 1 , a 2 , s + m t + 1 = a 2 , s + m t + 2 = = a 2 , n = 0 (see (1)). Otherwise, if let the u 1 = v , then C m a x 2 ( G ) = a 2 , 3 a 2 , 4 a 2 , n with a 2 , 3 = a 2 , 4 = = a 2 , t + 2 = 1 , a 2 , t + 3 = a 2 , t + 4 = = a 2 , s + 1 = 0 , a 2 , s + 2 = a 2 , s + 3 = = a 2 , s + l t = 1 , a 2 , s + l t + 1 = a 2 , s + l t + 2 = = a 2 , n = 0 (see (1)).
Because l > m , then the binary number a 2 , s + 2 a 2 , s + 3 a 2 , s + l t > the binary number a 2 , s + 2 a 2 , s + 3 a 2 , s + m t . Hence, Theorem 4 is established. □
Conjecture 1.
Assume that G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices and S ( G ) = { u | u V ( G ) d ( u ) = Δ ( G ) = s } with | S ( G ) | > 1 . If there is a node v S ( G ) meeting conditions C m a x ( G v ) C m a x ( G w ) for each w S ( G ) w v , then u 1 = v for M a x Q ( G ) .

3.1.2. Calculate the Intermediate Nodes of M a x Q ( G )

If our algorithm has calculated the first vertex u 1 of M a x Q ( G ) , how it determines the subsequent vertices for computing C m a x ( G ) ? Observe that a side of G corresponds to 1 bit of the upper triangular part of the adjacency matrix A ( G ) . To maximize C ( G ) by maximizing C 2 ( G ) , one must make u 2 belong to N ( u 1 ) such that makes a 1 , 2 = 1 (see (1)). Otherwise, if u 2 N ( u 1 ) , then a 1 , 2 = 0 (see (1)) and C ( G ) C m a x ( G ) . The subsequent Proposition 4 captures the essence of the previous discussion.
Proposition 4.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices. Given the first vertex u 1 of M a x Q ( G ) , then the choice of u 2 is from N ( u 1 ) for getting C m a x ( G ) .
Lemma 8.
Suppose G = ( V ( G ) , E ( G ) ) is an undirected graph of n vertices. Given the first vertex u 1 of M a x Q ( G ) , if there is a single vertex v S ( N ( u 1 ) ) = { u | u V ( N ( u 1 ) ) d ( u ) = Δ ( N ( u 1 ) ) }, then u 2 = v for M a x Q ( G ) .
Proof. 
By Proposition 4, it can be seen that the choice of u 2 is from N ( u 1 ) for obtaining C m a x ( G ) . By the condition of Lemma 8, we have that v is the only node of S ( N ( u 1 ) . Therefore Lemma 8 holds. □
Theorem 5.
Assume that G = ( V ( G ) , E ( G ) ) be an undirected connected graph of n vertices and S ( G ) = { u | u V ( G ) d ( u ) = Δ ( G ) = s } . For calculating C m a x ( G ) , if M a x Q ( G ) already includes the first vertex u 1 = v with V ( N ( v ) ) = { v 1 , v 2 , , v s } meeting condition d N ( v ) ( v 1 ) = Δ ( N ( v ) ) and one of the following conditions is satisfied, then u 2 = v 1 for M a x Q ( G ) .
1. 
d N ( v ) ( v 1 ) > d N ( v ) ( v i ) for i = 2 , , s .
2. 
d G ( v 1 ) > d G ( v i ) hold for d N ( v ) ( v 1 ) = d N ( v ) ( v i ) with i { 2 , , t } .
Proof. 
(1). To maximize C ( G ) by maximizing C 2 ( G ) (see (1)), it follows that u 2 must satisfy condition d N ( v ) ( u 2 ) = Δ ( N ( v ) ) . By d N ( v ) ( v 1 ) = Δ ( N ( v ) ) and the condition (1) of Theorem 5, d N ( v ) ( v 1 ) = Δ ( N ( v ) ) > d N ( v ) ( v i ) hold for i = 2 , , s . Assume that d N ( v ) ( v 1 ) = t . If u 2 = v 1 , it can be seen that a 2 , 3 = 1 , a 2 , 4 = 1 , , a 2 , t + 2 = 1 by properly arranging nodes v 2 , v 3 , , v s of V ( N ( v ) ) (see (1)). Otherwise, if u 2 = v i with i { 2 , , s } , regardless of how the nodes in N ( v ) are arranged such that there exists at least one 0 among the t elements a 2 , 3 , a 2 , 4 , , a 2 , t + 2 since d N ( v ) ( v i ) < d N ( v ) ( v 1 ) = t for i = 2 , , s (see (1)). Hence, the result (1) of Theorem 5 follows. (2). To maximize C ( G ) by maximizing C 2 ( G ) (see (1)), it follows that u 2 must satisfy condition d N ( v ) ( u 2 ) = Δ ( N ( v ) ) . By d N ( v ) ( v 1 ) = Δ ( N ( v ) ) and the condition (2) of Theorem 5, we have that if u 2 = v 1 , then C 2 ( G ) is the largest canonical labeling s l i c e 2. Otherwise, if u 2 = v i with i { 2 , , s } , regardless of how the nodes in N ( v ) are arranged such that the corresponding C 2 ( G ) is not largest (see (1)). Hence, the result (2) of Theorem 5 follows. □
Our algorithm uses an adjacency list to store a graph G. To facilitate the calculation of the o p e n k- n e i g h b o r h o o d s u b g r a p h of a node v in G, it in advance saves all the adjacent nodes, c h o r d e d g e s and i n c i d e n t e d g e s of v into an array, respectively. Moreover v contains three stand alone pointer to point to the start position of each array.
If our algorithm has calculated the first i nodes u 1 , u 2 , , u i of M a x Q ( G ) , how does it decide the following nodes u i + 1 , u i + 2 , , u n for computing C m a x ( G ) ? From the previous discussion for getting u 2 , it can be noted that the choices of the subsequent nodes u i + 1 , u i + 2 , , u n of M a x Q ( G ) are from N ( S ) with S = { u 1 , u 2 , , u i } .
Each vertex v of G is attached a characteristic m _ N e a r e s t N o d e . Once the ith vertex u i is added into M a x Q ( G ) , it records the index data i of u i in the property field m _ N e a r e s t N o d e of every vertex v j N ( u i ) = { v 1 , v 2 , ⋯, v t } with j = 1 , 2 , , t . If v j > m _ N e a r e s t N o d e = + , then let v j > m _ N e a r e s t N o d e = i for every v j N ( u i ) with j = 1 , 2 , , t .
Lemma 9.
Assume that G = ( V ( G ) , E ( G ) ) is an undirected connected graph of n vertices and S ( G ) = { u | u V ( G ) d ( u ) = Δ ( G ) = s } with | S ( G ) | > 1 . If u 1 = v S ( G ) with neighborhood subgraph N ( v ) , V ( N ( v ) ) = { v 1 , v 2 , ⋯, v s } , then u 2 , u 3 , ⋯, u s , u s + 1 { v 1 , v 2 , ⋯, v s } .
Proof. 
From (1) and the condition ( G ) = s , it follows that C m a x 1 ( G ) = a 1 , 2 a 1 , 3 a 1 , n with a 1 , 2 = a 1 , 3 = = a 1 , s + 1 = 1 and a 1 , s + 2 = a 1 , s + 3 = = a 1 , n = 0 for obtaining C m a x ( G ) . To ensure a 1 , 2 = a 1 , 3 = = a 1 , s + 1 = 1 to maximize C 1 ( G ) (see (1)), it follows that u 2 , u 3 , ⋯, u s , u s + 1 { v 1 , v 2 , ⋯, v s } . □
Definition 15.
Assume that A = ( a i , j ) n × n and B = ( b i , j ) n × n are two matrices with a i , j , b i , j = 0 , 1 for i , j = 1 , 2 , , n . Then, the lexicographic order of the two matrix is defined as follows:
1. 
A = B , if a i , j = b i , j for all 1 i , j n .
2. 
A < B , if i , j , 1 i , j n meeting conditions a k , l = b k , l for all k i , l j and a i , j + 1 < b i , j + 1 with j < n or a i + 1 , 1 < b i + 1 , 1 with i < n , j = n .
Suppose X is a matrix. If there exists at least one positive entry and the remaining entries are 0, we say X > 0 . Otherwise, if all entries of X are 0, we say X = 0 .
Theorem 6 
(Diffusion Theorem). Suppose G = ( V ( G ) , E ( G ) ) is an undirected connected graph of n vertices. If M a x Q ( G ) already includes the first m nodes u 1 , u 2 , , u m for calculating C m a x ( G ) , then the following two results follow.
1. 
the selection of the ( m + 1 ) th vertex for computing C m a x ( G ) is from the open neighborhood subgraph N ( Q ) of the vertices set Q = { u 1 , u 2 , , u m } .
2. 
the vertex-induced subgraph of the first m nodes is connected.
Proof. 
(1). We prove by contradiction. If u m + 1 V ( N ( Q ) ) , without loss of generality let us assume that π 1 = { u 1 , u 2 , , u m , v 1 , u m + 2 , , v 2 , , u n } is a permutation of V ( G ) , meeting conditions v 1 = u m + 1 V ( N ( Q ) ) , v 2 = u i V ( N ( Q ) ) with m + 2 i n .
Further, assume that if condition u m + 1 V ( N ( Q ) ) is satisfied, the C ( G ) associated with π 1 is the largest. Assume that the vertex v 2 = u i V ( N ( Q ) ) is the vertex whose index i in π 1 is the smallest index in π 1 than the indexes of any other vertices belonging to V ( N ( Q ) ) in π 1 . This indicates that no vertex belonging to V ( N ( Q ) ) is between u m + 2 and u i 1 of π 1 such that for each node v { u m + 2 , u m + 3 , , u i 1 } , v V ( N ( Q ) ) is met.
Let A 1 ( G ) be the matrix associated with the arrangement π 1 . Let W 1 , W 2 , W 3 and W 4 be the block submatrices of A 1 ( G ) including the first m rows and the ( m + 1 ) th column, the ( m + 2 ) th to ( i 1 ) th columns, the ith column and the ( i + 1 ) th to nth columns, respectively.
Since v 1 V ( N ( Q ) ) , then W 1 = 0 is satisfied. Alike the above consequence acquired, for each vertex v { u m + 2 , u m + 3 , , u i 1 } , v V ( N ( Q ) ) is true such that W 2 = 0 . Clearly W 3 > 0 for v 2 V ( N ( Q ) ) .
By merely swapping v 1 and v 2 of π 1 , one can obtain another permutation π 2 = { u 1 , u 2 , , u m , v 2 , u m + 2 , , v 1 , , u n } with v 1 V ( N ( Q ) ) , v 2 V ( N ( Q ) ) .
Alike A 1 ( G ) , let A 2 ( G ) be the matrix associated with the permutation π 2 . Let Y 1 , Y 2 , Y 3 and Y 4 be the block submatrices of A 2 ( G ) containing the first m rows and the ( m + 1 ) th column, the ( m + 2 ) th to ( i 1 ) th columns, the ith column and the ( i + 1 ) th to nth columns, respectively.
Definitely, Y 1 > 0 follows for v 2 V ( N ( Q ) ) . For each node v { u m + 2 , u m + 3 , , u i 1 } , as v V ( N ( Q ) ) is true, then Y 2 = 0 . Since v 1 V ( N ( Q ) ) , then Y 3 = 0 holds.
Observe that W 4 = Y 4 since W 4 and Y 4 are both the m × ( n i ) block submatrices associated with the same vertices sequence u i + 1 , u i + 2 , , u n .
It follows from the results discussed above that W 1 = W 2 = 0 , W 3 > 0 and Y 1 > 0 , Y 2 = Y 3 = 0 .
Hence, the new C ( G ) defined by A 2 ( G ) is larger than the C ( G ) defined by A 1 ( G ) such that makes a contradiction with the former hypothesis that u m + 1 N ( Q ) . This contradiction proves that conclusion (1) is correct.
(2). Conclusion (1) immediately leads to the result. □
Theorem 7 
(Nearest Node Theorem). Suppose G = ( V ( G ) , E ( G ) ) is an undirected connected graph of n vertices. If M a x Q ( G ) already includes the first m nodes u 1 , u 2 , , u m for calculating C m a x ( G ) . Assume vertices set Q = { u 1 , u 2 , , u m } .
If there exists a vertex v V ( N ( Q ) ) , for every w V ( N ( Q ) ) w v , meeting conditions v > m _ N e a r e s t N o d e < w > m _ N e a r e s t N o d e , then the ( m + 1 ) t h node in M a x Q ( G ) is v.
Proof. 
By Diffusion Theorem 6, we know that the ( m + 1 ) th vertex in M a x Q ( G ) is from N ( Q ) . We prove by contradiction. If the ( m + 1 ) th vertex in M a x Q ( G ) is w V ( N ( Q ) ) w v , satisfying condition v > m _ N e a r e s t N o d e < w > m _ N e a r e s t N o d e .
Let V 1 = V ( G ) Q v and V 2 = V ( G ) Q w . Without loss of generality, let us assume that π 1 = { u 1 , u 2 , , u m , v , u m + 2 1 , , u n 1 } is a permutation of V ( G ) corresponding to v with u m + 2 1 V 1 , , u n 1 V 1 . Let us assume that π 2 = { u 1 , u 2 , , u m , w , u m + 2 2 , , u n 2 } is a permutation of V ( G ) corresponding to w with u m + 2 2 V 2 , , u n 2 V 2 .
This means that the C ( G ) corresponding to π 1 is less than the C ( G ) corresponding to π 2 .
Let i = v > m _ N e a r e s t N o d e , then v V ( N ( u 1 ) ) , v V ( N ( u 2 ) ) , , v V ( N ( u i 1 ) , v V ( N ( u i ) ) .
By v > m _ N e a r e s t N o d e < w > m _ N e a r e s t N o d e , there are w V ( N ( u 1 ) ) , w V ( N ( u 2 ) ) , ⋯, w V ( N ( u i 1 ) ) , w V ( N ( u i ) ) .
Let A 1 ( G ) be the matrix associated with the permutation π 1 . Let W 1 and W 2 be the block submatrices of A 1 ( G ) defined by the first i row and the ( m + 1 ) th column and the ( m + 2 ) th to nth columns, respectively.
Let A 2 ( G ) be the matrix associated with the permutation π 2 . Let Y 1 and Y 2 be the block submatrices of A 2 ( G ) defined by the first i row and the ( m + 1 ) th column and the ( m + 2 ) th to nth columns, respectively.
Since v V ( N ( u i ) ) , then W 1 > 0 holds. Clearly Y 1 = 0 holds due to w V ( N ( u i ) ) . Therefore, W 1 > Y 1 . Again let T = { u 1 , u 2 , , u i 1 } .
For π 1 , x V 1 = V ( G ) Q v , there must be x V ( N ( T ) ) . Then v > m _ N e a r e s t N o d e < x > m _ N e a r e s t N o d e . Therefore W 2 = 0 .
For π 2 , x V 2 = V ( G ) Q w , there must be x V ( N ( T ) ) x = v .
If x V ( N ( T ) ) ) , then v > m _ N e a r e s t N o d e < x > m _ N e a r e s t N o d e . The elements of the column vector corresponding to x in Y 2 are all 0.
Otherwise, if x = v , the elements of the column vector corresponding to x in Y 2 are not all 0.
Thus, for π 2 , the matrix Y 2 is such a matrix with only one column vector whose elements are not all 0 and the remaining column vectors are zero.
Hence, no matter how u m + 2 1 , , u n 1 ; u m + 2 2 , , u n 2 is taken, it can be seen that W 2 = 0 , Y 2 0 .
Let W = W 1 W 2 be a new matrix by combining W 1 and W 2 .
Let Y = Y 1 Y 2 be a new matrix by combining Y 1 and Y 2 .
From the previous analysis, it follows that W = W 1 W 2 = W 1 O where O = 0 is i × ( n m 1 ) block submatrix.
Further, it follows that Y = Y 1 Y 2 = O Y 2 where O = 0 is a column vector of i rows. The block submatrix Y 2 is such a matrix whose only one column vector, denoted by Z, is not 0 and whose remaining column vectors are all 0. It can be seen that Z = W 1 .
By the comparison of the matrix W and Y, it holds that W > Y .
Hence, the C ( G ) defined by A 1 ( G ) is larger than the C ( G ) defined by A 2 ( G ) . This contradicts the previous hypothesis that the C ( G ) corresponding to π 1 is less than the C ( G ) corresponding to π 2 . Therefore, the conclusion of Theorem 7 holds. □
Suppose G = ( V ( G ) , E ( G ) ) is an undirected connected graph of n vertices. For calculating C m a x ( G ) , assume that M a x Q ( G ) already includes the first m nodes u 1 , u 2 , , u m . Let Q = { u 1 , u 2 , , u m } with open neighborhood subgraph N ( Q ) (see Definition 7). Let R = V ( G ) Q with vertex-induced subgraph G [ R ] .

3.2. Calculate C m a x ( G ) for a Disconnected Graph

Suppose G = ( V ( G ) , E ( G ) ) is a disconnected undirected graph of n vertices with p connected components G 1 , G 2 , ⋯, G p . In this subsection, we consider how to determine the c a n o n i c a l l a b e l i n g C m a x ( G ) of G.
If Δ ( G 1 ) > Δ ( G 2 ) > > Δ ( G p ) , how does our algorithm proceed to determine the c a n o n i c a l l a b e l i n g C m a x ( G ) of G? It can be seen that to get C m a x ( G ) one had to order all nodes of every connected component G i with i { 1 , 2 , , p } together when building the adjacency matrix A ( G ) . The outcome also holds from the proving of Diffusion Theorem 6.
First, we examine the characteristics of the adjacency matrix A ( G ) . When building the adjacency matrix A ( G ) , we order all nodes of every connected component G i with i { 1 , 2 , , p } together. Observe that the adjacency matrix A ( G ) is a symmetric block matrix, every block of which is associated with a connected component. Next, we examine the link between C ( G ) and A ( G ) . Besides, we present how to determine the C m a x ( G 1 ) associated with the adjacency matrix A ( G ) .
Lemma 10.
Suppose G = ( V ( G ) , E ( G ) ) is a disconnected undirected graph that have two disjoint connected components G 1 = ( V ( G 1 ) , E ( G 1 ) ) and G 2 = ( V ( G 2 ) , E ( G 2 ) ) with k and l vertices respectively. Assume that
C m a x ( G 1 ) = C m a x 1 ( G 1 ) C m a x 2 ( G 1 ) C m a x k 1 ( G 1 ) , C m a x ( G 2 ) = C m a x 1 ( G 2 ) C m a x 2 ( G 2 ) C m a x l 1 ( G 2 ) .
If Δ ( G 1 ) > Δ ( G 2 ) , then C m a x ( G ) meets the following equation:
C m a x ( G ) = C m a x 1 ( G ) C m a x 2 ( G ) C m a x k 1 ( G ) C m a x k ( G ) C m a x k + 2 ( G ) C m a x k + l 1 ( G ) ,
where
C m a x 1 ( G ) = C m a x 1 ( G 1 ) 00 0 l , C m a x 2 ( G ) = C m a x 2 ( G 1 ) 00 0 l C m a x k 1 ( G ) = C m a x k 1 ( G 1 ) 00 0 l , C m a x k ( G ) = 00 0 l , C m a x k + 1 ( G ) = C m a x 1 ( G 2 ) , C m a x k + 2 ( G ) = C m a x 2 ( G 2 ) , , C m a x k + l 1 ( G ) = C m a x l 1 ( G 2 ) .
Proof. 
If Δ ( G 1 ) > Δ ( G 2 ) is satisfied, then Δ ( G ) = Δ ( G 1 ) . By Proposition 3, it can be seen that to get C m a x ( G ) , one must pick the node with the maximum degree from G 1 as the first node u 1 of M a x Q ( G ) .
By Proposition 4, it follows that the second vertex u 2 of M a x Q ( G ) must be from N ( u 1 ) . By Diffusion Theorem 6, the following k 2 nodes of M a x Q ( G ) must be picked from G 1 . Furthermore, by Diffusion Theorem 6, the next l nodes of M a x Q ( G ) must be chosen from G 2 . Thoughtfully considering (1), it is not hard to discover that (12) follows. □
Observe that to guarantee the maximization of C m a x ( G ) , one has to add l 0 after C m a x 1 ( G 1 ) , C m a x 2 ( G 1 ) , ⋯, C m a x k 1 ( G 1 ) respectively, so that make C m a x k ( G ) be equal l 0.
Theorem 8.
Suppose G = ( V ( G ) , E ( G ) ) is a disconnected undirected graph of n vertices with p connected components G 1 , G 2 , ⋯, G p satisfying | V ( G 1 ) | = n 1 , | V ( G 2 ) | = n 2 , ⋯, | V ( G p ) | = n p . If C m a x ( G 1 ) > C m a x ( G 2 ) > > C m a x ( G p ) , then C m a x ( G ) meets the following equation:
C m a x ( G ) = C m a x 1 ( G 1 ) 0 0 n n 1 C m a x n 1 1 ( G 1 ) 0 0 n n 1 0 0 n n 1 C m a x 1 ( G 2 ) 0 0 n n 1 n 2 C m a x n 2 1 ( G 2 ) 0 0 n n 1 n 2 0 0 n n 1 n 2 C m a x 1 ( G p 1 ) 0 0 n p C m a x n p 1 1 ( G p 1 ) 0 0 n p 0 0 n p C m a x 1 ( G p ) C m a x n p 1 ( G p ) .
Proof. 
We prove (13) by induction on the number p of branches. By the previous definition, it follows that C m a x ( G ) = C m a x 1 ( G ) C m a x 2 ( G ) C m a x n 1 ( G ) for p = 1 . Hence, (13) in Theorem 8 follows for p = 1 . By Lemma 10, (13) is correct for p = 2 .
By induction, assume that (13) is true for p = k . In the following, let us prove that Equation (13) is also correct for p = k + 1 . We can now think of the front k branch graphs as graph H. Therefore, (13) is also true for graph H.
C m a x ( H ) = C m a x 1 ( G 1 ) 0 0 n n k + 1 n 1 C m a x n 1 1 ( G 1 ) 0 0 n n k + 1 n 1 0 0 n n k + 1 n 1 C m a x 1 ( G 2 ) 0 0 n n k + 1 n 1 n 2 C m a x n 2 1 ( G 2 ) 0 0 n n k + 1 n 1 n 2 0 0 n n k + 1 n 1 n 2 C m a x 1 ( G k 1 ) 0 0 n k C m a x n k 1 1 ( G k 1 ) 0 0 n k 0 0 n k C m a x 1 ( G k ) C m a x 2 ( G k ) C m a x n k 1 ( G k ) ,
where
C m a x 1 ( H ) = C m a x 1 ( G 1 ) 0 0 n n k + 1 n 1 , C m a x n 1 1 ( H ) = C m a x n 1 1 ( G 1 ) 0 0 n n k + 1 n 1 , C m a x n 1 ( H ) = 0 0 n n k + 1 n 1 , C m a x n 1 + 1 ( H ) = C m a x 1 ( G 2 ) 0 0 n n k + 1 n 1 n 2 ,
C m a x n 1 + n 2 1 ( H ) = C m a x n 2 1 ( G 2 ) 0 0 n n k + 1 n 1 n 2 , C m a x n 1 + n 2 ( H ) = 0 0 n n k + 1 n 1 n 2 , C m a x n n k + 1 n k n k 1 + 1 ( H ) = C m a x 1 ( G k 1 ) 0 0 n k , C m a x n n k + 1 n k 1 ( H ) = C m a x n k 1 1 ( G k 1 ) 0 0 n k , C m a x n n k + 1 n k ( H ) = 0 0 n k , C m a x n n k + 1 n k + 1 ( H ) = C m a x 1 ( G k ) , C m a x n n k + 1 n k + 2 ( H ) = C m a x 2 ( G k ) , C m a x n n k + 1 1 ( H ) = C m a x n k 1 ( G k ) .
By Lemma 10, we have
C m a x ( G ) = C m a x 1 ( H ) 0 0 n k + 1 C m a x 2 ( H ) 0 0 n k + 1 C m a x n n k + 1 1 ( H ) 0 0 n k + 1 0 0 n k + 1 C m a x 1 ( G k + 1 ) C m a x 2 ( G k + 1 ) C m a x n k + 1 1 ( G k + 1 ) .
By (14), substituting C m a x 1 ( H ) to C m a x n n k + 1 1 ( H ) into (15), we obtain
C m a x ( G ) = C m a x 1 ( G 1 ) 0 0 n n k + 1 n 1 0 0 n k + 1 C m a x 2 ( G 1 ) 0 0 n n k + 1 n 1 0 0 n k + 1 C m a x n k 1 ( G k ) 0 0 n k + 1 0 0 n k + 1 C m a x 1 ( G k + 1 ) C m a x 2 ( G k + 1 ) C m a x n k + 1 1 ( G k + 1 ) .
Thus, we have
C m a x ( G ) = C m a x 1 ( G 1 ) 0 0 n n 1 C m a x n 1 1 ( G 1 ) 0 0 n n 1 0 0 n n 1 C m a x 1 ( G 2 ) 0 0 n n 1 n 2 C m a x n 2 1 ( G 2 ) 0 0 n n 1 n 2 0 0 n n 1 n 2 C m a x 1 ( G k ) 0 0 n k + 1 C m a x n k 1 ( G k ) 0 0 n k + 1 0 0 n k + 1 C m a x 1 ( G k + 1 ) C m a x n k + 1 1 ( G k + 1 ) .
Therefore, Equation (13) is correct for p = k + 1 . □
By Theorem 8, it can be observed that for getting C m a x ( G ) , one has to first calculate C m a x ( G i ) of every branch for i = 1 , 2 , , p , respectively. Besides, one must substitute C m a x ( G i ) into (13) sequentially to obtain C m a x ( G ) of a disconnected undirected G.
If the above conditions are not met, how does one determine C m a x ( G ) of a disconnected undirected G? Based on an examination of the previous outcomes, the following Theorem 9 that is more useful than Lemma 10 is established.
Theorem 9.
Suppose G = ( V ( G ) , E ( G ) ) is a disconnected undirected graph that have two disjoint connected components G 1 = ( V ( G 1 ) , E ( G 1 ) ) and G 2 = ( V ( G 2 ) , E ( G 2 ) ) with k and l vertices respectively. Let S ( G 1 ) = { u | u V ( G 1 ) d ( u ) = Δ ( G 1 ) } and S ( G 2 ) = { u | u V ( G 2 ) d ( u ) = Δ ( G 2 ) } meeting condition Δ ( N ( u ) ) > Δ ( N ( v ) ) for u S 1 and v S 2 . Assume that
C m a x ( G 1 ) = C m a x 1 ( G 1 ) C m a x 2 ( G 1 ) C m a x k 1 ( G 1 ) ,
C m a x ( G 2 ) = C m a x 1 ( G 2 ) C m a x 2 ( G 2 ) C m a x l 1 ( G 2 ) ,
If Δ ( G 1 ) = Δ ( G 2 ) , then C m a x ( G ) satisfies the following equation:
C m a x ( G ) = C m a x 1 ( G ) C m a x 2 ( G ) C m a x k 1 ( G ) C m a x k ( G ) C m a x k + 2 ( G ) C m a x k + l 1 ( G ) ,
where
C m a x 1 ( G ) = C m a x 1 ( G 1 ) 00 0 l , C m a x 2 ( G ) = C m a x 2 ( G 1 ) 00 0 l C m a x k 1 ( G ) = C m a x k 1 ( G 1 ) 00 0 l , C m a x k ( G ) = 00 0 l , C m a x k + 1 ( G ) = C m a x 1 ( G 2 ) , C m a x k + 2 ( G ) = C m a x 2 ( G 2 ) , , C m a x k + l 1 ( G ) = C m a x l 1 ( G 2 ) .
Proof. 
By the condition of Theorem 9, it follows that for u S ( G 1 ) and v S ( G 2 ) inequality Δ ( N ( u ) ) > Δ ( N ( v ) ) holds. By Theorem 3, one has to pick the first node u 1 of M a x Q ( G ) from G 1 so that get C m a x ( G ) .
By Diffusion Theorem 6, one must choose u 2 , u 3 , , u k into M a x Q ( G ) from G 1 to get C m a x ( G ) . Besides, by Diffusion Theorem 6, one has to pick the following l nodes into M a x Q ( G ) from G 2 . By (18) and (19), it can be seen that (21) is correct.
C m a x ( G ) = C m a x 1 ( G ) C m a x 2 ( G ) C m a x k 1 ( G ) C m a x k ( G ) C m a x k + 2 ( G ) C m a x k + l 1 ( G ) ,
where
C m a x 1 ( G ) = C m a x 1 ( G 1 ) 00 0 l , C m a x 2 ( G ) = C m a x 2 ( G 1 ) 00 0 l , , C m a x k 1 ( G ) = C m a x k 1 ( G 1 ) 00 0 l , C m a x k ( G ) = 00 0 l , C m a x k + 1 ( G ) = C m a x 1 ( G 2 ) , C m a x k + 2 ( G ) = C m a x 2 ( G 2 ) , , C m a x k + l 1 ( G ) = C m a x l 1 ( G 2 ) .
It can be observed that to guarantee the maximization of C m a x ( G ) , one has to add l 0 after C m a x 1 ( G 1 ) , C m a x 2 ( G 1 ) , ⋯, C m a x k 1 ( G 1 ) respectively and make C m a x k ( G ) be equal l 0. □

4. Our Algorithms for Calculating the Canonical Labeling

In the Section, based on the outcomes of the previous sections, we offer our algorithms for calculating c a n o n i c a l l a b e l i n g s of graphs. We describe the main steps required for calculating the c a n o n i c a l l a b e l i n g C m a x ( G ) of G. When our algorithm has computed the vertex u 1 of M a x Q ( G ) , then, it builds the neighborhood subgraph N ( u 1 ) of the vertex u 1 (see Figure 3a and Figure 4a), from which it chooses a few nodes into M a x Q ( G ) . For the convenience of description, we name this process P r o c e d u r e 1. Then once more, it constructs the neighborhood subgraph N ( S 2 ) of the vertices set S 2 = { u 1 , u 2 } (see Figure 3b and Figure 4b), from which it chooses a few nodes into M a x Q ( G ) . We name this process P r o c e d u r e 2. ⋯. Then once more, it constructs the neighborhood subgraph N ( S r ) of the vertices set S r = { u 1 , u 2 , , u r } (see Figure 3c and Figure 4c), from which it chooses a few nodes into M a x Q ( G ) . We name this process P r o c e d u r e r. ⋯. This process lasts until it places all nodes in G into M a x Q ( G ) (see Figure 3d and Figure 4d).
For P r o c e d u r e 1, after computing N ( S 1 ) , by Lemma 4, our algorithm orders all vertices of N ( S 1 ) into a sole linkage L 1 (observe Algorithm 1). For clarify, make V 1 = V ( N ( S 1 ) ) . If there are two vertices v i , v j L 1 meeting condition v i v j concerning N ( S 1 ) , then it proceeds to decide whether v i v j or v i v j concerning G. If v i v j , it repositions v i in front of the v j in L 1 . Otherwise, it repositions v i in back of the v j in L 1 .
For every P r o c e d u r e r, r = 2 , 3 , , when computing N ( S r ) , our algorithm successively calculates V 2 = V ( N ( S r 1 ) N ( u r ) ) (see Figure 5d), V 3 = V ( N ( S r 1 ) N ( u r ) ) (see Figure 5e), V 4 = V ( N ( u r ) N ( S r 1 ) ) (see Figure 5f) and the degree sequences d N ( S r ) ( V 1 ) , d N ( S r ) ( V 3 ) , d N ( S r ) ( V 4 ) in decreasing order respectively, where S r 1 = { u 1 , u 2 , , u r 1 } . It can be shown that V 2 V 3 V 4 = V ( N ( S r ) ) and V i V j = for i j , i , j = 2 , 3 , 4 . By Lemma 4, it orders all vertices of V i into a sole linkage L i (observe Algorithm 1) for the neighborhood subgraph N ( S r ) with i = 2 , 3 , 4 , respectively.
Next, our algorithm successively executes the following processing paces for the vertices of L i with i = 2 , 3 , 4 :
  • Beginning from the front of L 2 , it, in turn, decides whether every vertex u L 2 meets the d e g r e e m u l t i p l i c i t y condition d m N ( S r ) ( u ) = 1 . If the number of nodes meeting condition d m N ( S r ) ( u ) = 1 is less than 2 in L 2 , it places u into M a x Q ( G ) . If there are two vertices v i , v j L 2 meeting condition v i v j concerning N ( S r ) , then it proceeds to decide whether v i v j or v i v j concerning G. If v i v j , it repositions the v i in front of the v j in L 2 (observe Algorithm 1). Otherwise, it repositions the v i in back of the v j in L 2 (view Algorithm 1).
  • Excluding the vertices added into M a x Q ( G ) , it utilizes a queue Q to save the middle vertices of M a x Q ( G ) . After executing Step 1, it consecutively decides whether or not each node u L 2 is in Q. If u is in Q and the number of vertices added into M a x Q ( G ) is less than 2 in the previous process, it inserts u on the tail of M a x Q ( G ) and concurrently deletes u from the head of Q. Otherwise, it places u on the back of Q.
  • For L 3 , if the number of nodes of L 2 , added into M a x Q ( G ) , is 0 and the number of nodes meeting condition d m N ( S r ) ( u ) = 1 with u L 3 is less than 2, it inserts u on the back of M a x Q ( G ) . The remaining procedure steps are the same as for L 2 .
  • For L 4 , if the number of nodes of L 2 and L 3 , added into M a x Q ( G ) , is 0 and the number of nodes meeting the condition d m N ( S r ) ( u ) = 1 with u L 4 is less than 2, it places u on the back of M a x Q ( G ) . The remaining procedure steps are the same as for L 2 .
Algorithm 1: Order all vertices of V i into a sole linkage L i for a neighborhood subgraph N ( S r ) with i = 1 , 2 , 3 , 4 , respectively where V 1 = V ( N ( S 1 ) .
Mathematics 07 00690 i001
Algorithm 2: Contrast the e n t i r e d i f f u s i o n d e g r e e s e q u e n c e s d H σ [ N 1 ( v ) ] , d H σ [ N 2 ( v ) ] , ⋯, d H σ [ N ρ ( v ) ( v ) ] and d H σ [ N 1 ( w ) ] , d H σ [ N 2 ( w ) ] , ⋯, d H σ [ N ρ ( w ) ( w ) ] of two vertices v and w in H.
Mathematics 07 00690 i002
Algorithm 3: Contrast two d i f f u s i o n d e g r e e s e q u e n c e s d σ ( H k ) and d σ ( J k ) of two vertices v and w in H.
Mathematics 07 00690 i003
Algorithm 4: Contrast d 1 and d 2 .
Mathematics 07 00690 i004
Our algorithm utilizes an array M a x Q to save the vertices of M a x Q ( G ) and an array Q to store the vertices to be added to M a x Q ( G ) briefly. Our algorithm has been optimized by Lemmas 2 and 3.
The results of experiments show that our method is a new approach by which one can precisely determine T o p M o s t graphs (defined in Section 2) for many classes of graphs, including trees, grid graphs, wheel graphs, hypercube graphs, king graphs, triangular graphs and so on. Figure 6, Figure 7, Figure 8, Figure 9, Figure 10, Figure 11, Figure 12, Figure 13, Figure 14, Figure 15, Figure 16, Figure 17, Figure 18, Figure 19, Figure 20, Figure 21, Figure 22 and Figure 23 given by our software display the accuracy of our software for computing T o p M o s t graphs of these graph classes aforesaid.

5. Software Implementation

Utilizing the theory specified in the previous sections, we made a kit of software means called GraphLabel to calculate c a n o n i c a l l a b e l i n g s of graphs. Our experimental conditions included an Intel(R) Core(TM)2 Quad CPU Q6600 @2.40 GHz with 4.00 GB of RAM. The operating system was Microsoft Windows 8.1 Professional Edition. The graphics card was an NVIDIA GeForce 9800 GT. The display resolution was 1024 × 768 × 32 bits (RGB). The internal hard drive was 500 GB. The programming environment was Microsoft Visual C++ 2012.
The software utilized object-oriented technique to construct many related classes, including C N o d e , C N o d e N e i g h b o r , C E d g e , C E d g e N e i g h b o r , C G r a p h and so on. A complete explanation of the software functions is beyond the range of this paper. We will fully describe it in the other articles. All figures displayed in this article were created by employing our software system.
We chose a graph collection to check the correctness of our algorithms. We used our own software program to generate a large number of graphs randomly as the test cases, including Figure 7c,d, Figure 8, Figure 9 and Figure 10c. Besides, for enhancing the depth and breadth of experimentation, we also adopted many test cases from the online library [31] and library of benchmarks [32], including Figure 6, Figure 7a, Figure 10a,b, Figure 11, Figure 12, Figure 13, Figure 14, Figure 15, Figure 16, Figure 17, Figure 18, Figure 19, Figure 20, Figure 21, Figure 22 and Figure 23.
We applied our algorithms to as many classes of graphs as potential. These graphs presented here are only a small portion of the check graphs since the length of the paper is restricted. For comparing entirely, we offer both the initial and the resulting graph.

6. Summary and Future Work

In short, we get the following results: by Theorems 2–9, the paper has built a comparatively entire theoretical frame for computing the c a n o n i c a l l a b e l i n g s and T o p M o s t graphs of graphs. Algorithms 1–4 are unique and can correctly determine T o p M o s t graphs for many classes of graphs, including trees, grid graphs, wheel graphs, hypercube graphs, king graphs, triangular graphs and so on (see Figure 6, Figure 7, Figure 8, Figure 9, Figure 10, Figure 11, Figure 12, Figure 13, Figure 14, Figure 15, Figure 16, Figure 17, Figure 18, Figure 19, Figure 20, Figure 21, Figure 22 and Figure 23). Algorithms 1–4 are also valid for detached undirected graphs. For every vertex in a graph G, the definition of the property m _ N e a r e s t N o d e enhances the accuracy of computing c a n o n i c a l l a b e l i n g . By software evaluating, the accuracy of our algorithms is elementarily established. Our approach can be employed to excavate the frequent subgraph. Additionally, it proposes Conjecture 1.
Nevertheless, there are still many aspects we need to progress, including verifying the conjectures suggested by us, improving our software platform and employing more test cases to check our program. Specifically, we need to reinforce our algorithms so that they can determine the c a n o n i c a l l a b e l i n g s for more classes of graphs.
Currently, we are considering how to stretch our method to dig the frequent subgraphs and determine the c a n o n i c a l l a b e l i n g s of weighted graphs. We will present further research in other papers.

Author Contributions

Conceptualization, J.H., Y.G., J.S. and L.T.; Methodology, J.H.; Software, J.H.; Validation, J.H., Y.G., J.S. and L.T.; Writing—original draft, J.H.; and Writing—review and editing, J.H.

Funding

The work described in this paper was supported by the National Natural Science Foundation of China (grant numbers 61702020); Beijing Natural Science Foundation (grant numbers 4172013); and Beijing Natural Science Foundation-Haidian Primitive Innovation Joint Fund (grant numbers L182007).

Acknowledgments

We would also like to thank all anonymous reviewers for their inspiring and constructive comments which helped to improve the presentation of the manuscript.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Hao, J.; Gong, Y.; Wang, Y.; Tan, L.; Sun, J. Using k-Mix-Neighborhood Subdigraphs to Compute Canonical Labelings of Digraphs. Entropy 2017, 19, 79. [Google Scholar] [CrossRef]
  2. Hao, J.; Gong, Y.; Tan, L.; Duan, D. Apply Partition Tree to Compute Canonical Labelings of Graphs. Int. J. Grid Distrib. Comput. 2016, 9, 241–264. [Google Scholar]
  3. McKay, B. Computing Automorphisms and Canonical Labellings of Graphs Combinatorial Mathematics; Lecture Notes in Mathematics; Springer: Berlin/Heidelberg, Germany, 1978; Volume 686, pp. 223–232. [Google Scholar]
  4. Piperno, A. Search space contraction in canonical labeling of graphs. arxiv 2008, arXiv:0804.4881. [Google Scholar]
  5. Junttila, T.; Kaski, P. Engineering an Efficient Canonical Labeling Tool for Large and Sparse Graphs. In Proceedings of the Ninth Workshop on Algorithm Engineering and Experiments and the Fourth Workshop on Analytic Algorithmics and Combinatorics, New Orleans, LA, USA, 6 January 2007; Siam: Philadelphia, PA, USA, 2007; pp. 135–149. [Google Scholar] [Green Version]
  6. Shah, Y.J.; Davida, G.I.; McCarthy, M.K. Optimum Featurs and Graph Isomorphism. IEEE Trans. Syst. Man Cybern. 1974, SMC-4, 313–319. [Google Scholar] [CrossRef]
  7. Ivanciuc, O. Canonical Numbering and Constitutional Symmetry. In Handbook of Chemoinformatics; Wiley-VCH Verlag GmbH: Weinheim, Germany, 2008; pp. 139–160. [Google Scholar]
  8. Babai, L.; Luks, E.M. Canonical Labeling of Graphs. In Proceedings of the Fifteenth Annual ACM Symposium on Theory of Computing, Boston, MA, USA, 25–27 April 1983; ACM: New York, NY, USA, 1983; pp. 171–183. [Google Scholar] [CrossRef]
  9. Jantschi, L.; Bolboaca, S.D. Conformational study of C-24 cyclic polyyne clusters. Int. J. Quantum Chem. 2018, 118, e25614. [Google Scholar] [CrossRef]
  10. Joiţa, D.M.; Jäntschi, L. Extending the Characteristic Polynomial for Characterization of C20 Fullerene Congeners. Mathematics 2017, 5, 84. [Google Scholar] [CrossRef]
  11. Bolboaca, S.; Jantschi, L. How good can the characteristic polynomial be for correlations? Int. J. Mol. Sci. 2007, 8, 335–345. [Google Scholar] [CrossRef]
  12. Kuramochi, M.; Karypis, G. Finding Frequent Patterns in a Large Sparse Graph*. Data Min. Knowl. Discov. 2005, 11, 243–271. [Google Scholar] [CrossRef]
  13. Kuramochi, M.; Karypis, G. An efficient algorithm for discovering frequent subgraphs. IEEE Trans. Knowl. Data Eng. 2004, 16, 1038–1051. [Google Scholar] [CrossRef]
  14. Huan, J.; Wang, W.; Prins, J. Efficient mining of frequent subgraphs in the presence of isomorphism. In Proceedings of the Third IEEE International Conference on Data Mining, Melbourne, FL, USA, 22 November 2003; pp. 549–552. [Google Scholar]
  15. Kashani, Z.; Ahrabian, H.; Elahi, E.; Nowzari-Dalini, A.; Ansari, E.; Asadi, S.; Mohammadi, S.; Schreiber, F.; Masoudi-Nejad, A. Kavosh: A new algorithm for finding network motifs. BMC Bioinform. 2009, 10, 318. [Google Scholar] [CrossRef] [PubMed]
  16. He, P.R.; Zhang, W.J.; Li, Q. Some further development on the eigensystem approach for graph isomorphism detection. J. Frankl. Inst.-Eng. Appl. Math. 2005, 342, 657–673. [Google Scholar] [CrossRef]
  17. Arvind, V.; Das, B.; Köbler, J. A Logspace Algorithm for Partial 2-Tree Canonization. In Computer Science-Theory and Applications; Springer: Berlin/Heidelberg, Germany, 2008; Volume 5010, pp. 40–51. [Google Scholar] [CrossRef]
  18. Babai, L.; Kucera, L. Canonical labelling of graphs in linear average time. In Proceedings of the 20th Annual Symposium on Foundations of Computer Science, San Juan, Puerto Rico, 29–31 October 1979; pp. 39–46. [Google Scholar] [CrossRef]
  19. Arnborg, S.; Proskurowski, A. Canonical Representations of Partial 2- and 3-Trees. In Proceedings of the 2nd Scandinavian Workshop on Algorithm Theory, Bergen, Norway, 11–14 July 1990; Lecture Notes in Computer Science 477. Springer: Berlin, Germany, 1990; pp. 197–214. [Google Scholar]
  20. McKay, B. Practical Graph Isomorphism; Department of Computer Science, Vanderbilt University: Nashville, TN, USA, 1981. [Google Scholar]
  21. McKay, B.D. Isomorph-Free Exhaustive Generation. J. Algorithms 1998, 26, 306–324. [Google Scholar] [CrossRef] [Green Version]
  22. Practical graph isomorphism, {II}. J. Symb. Comput. 2014, 60, 94–112. [CrossRef]
  23. Yan, X.; Han, J. gSpan: Graph-based substructure pattern mining. In Proceedings of the 2002 IEEE International Conference on Data Mining, ICDM 2003, Maebashi City, Japan, 9–12 December 2002; pp. 721–724. [Google Scholar] [CrossRef]
  24. Miyazaki, T. The Complexity of McKay’s Canonical Labeling Algorithm; Citeseer: University Park, PA, USA, 1997. [Google Scholar]
  25. Tener, G.; Deo, N. Efficient isomorphism of miyazaki graphs. Algorithms 2008, 5, 7. [Google Scholar]
  26. Junttila, T.; Kaski, P. Conflict Propagation and Component Recursion for Canonical Labeling Theory and Practice of Algorithms in (Computer) Systems; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2011; Volume 6595, pp. 151–162. [Google Scholar]
  27. López-Presa, J.L.; Anta, A.F.; Chiroque, L.N. Conauto-2.0: Fast Isomorphism Testing and Automorphism Group Computation. arXiv 2011, arXiv:1108.1060. [Google Scholar]
  28. Katebi, H.; Sakallah, K.; Markov, I. Graph Symmetry Detection and Canonical Labeling: Differences and Synergies. arXiv 2012, arXiv:1208.6271. [Google Scholar]
  29. Habtemicael, S.; SenGupta, I. Pricing variance and volatility swaps for Barndorff-Nielsen and Shephard process driven financial markets. Int. J. Financ. Eng. 2016, 3, 1650027. [Google Scholar] [CrossRef]
  30. Mariani, M.C.; SenGupta, I.; Bezdek, P. Numerical solutions for option pricing models including transaction costs and stochastic volatility. Acta Appl. Math. 2012, 118, 203–220. [Google Scholar] [CrossRef]
  31. Weisstein, E.W. Simple Graphs–from Wolfram MathWorld; Wolfram Research: Champaign, IL, USA, 2015. [Google Scholar]
  32. ALENEX 2007 Submission: Source Code, Benchmark Instances, and Summary Results. Available online: http://www.tcs.hut.fi/Software/benchmarks/ALENEX-2007/ (accessed on 30 June 2018).
Figure 1. The 1, 2, 3, 4-neighborhood subgraph of vertex 7 in a graph G. (a) The 1-neighbor subgraph; (b) The 2-neighbor subgraph; (c) The 3-neighbor subgraph; (d) The 4-neighbor subgraph.
Figure 1. The 1, 2, 3, 4-neighborhood subgraph of vertex 7 in a graph G. (a) The 1-neighbor subgraph; (b) The 2-neighbor subgraph; (c) The 3-neighbor subgraph; (d) The 4-neighbor subgraph.
Mathematics 07 00690 g001
Figure 2. The 1, 2, 3-neighborhood subgraph of vertex 15 in the 6 × 6 grid graph G 6 , 6 . (a) The 6 × 6 grid graph G 6 , 6 ; (b) The 1-neighbor subgraph of 15; (c) The 2-neighbor subgraph of 15; (d) The 3-neighbor subgraph of 15.
Figure 2. The 1, 2, 3-neighborhood subgraph of vertex 15 in the 6 × 6 grid graph G 6 , 6 . (a) The 6 × 6 grid graph G 6 , 6 ; (b) The 1-neighbor subgraph of 15; (c) The 2-neighbor subgraph of 15; (d) The 3-neighbor subgraph of 15.
Mathematics 07 00690 g002
Figure 3. The 1-neighborhood subgraphs for the different nodes sets of a wheel graph G. (a) A wheel graph G and the 1-neighborhood subgraph N ( 1 ) of the node 1; (b) The 1-neighborhood subgraph N ( S 1 ) of the nodes set S 1 = { 1 , 2 } ; (c) The 1-neighborhood subgraph N ( S 2 ) of the nodes set S 2 = { 1 , 2 , 6 } ; (d) The 1-neighborhood subgraph N ( S 3 ) of the nodes set S 3 = { 1 , 2 , 6 , 30 } .
Figure 3. The 1-neighborhood subgraphs for the different nodes sets of a wheel graph G. (a) A wheel graph G and the 1-neighborhood subgraph N ( 1 ) of the node 1; (b) The 1-neighborhood subgraph N ( S 1 ) of the nodes set S 1 = { 1 , 2 } ; (c) The 1-neighborhood subgraph N ( S 2 ) of the nodes set S 2 = { 1 , 2 , 6 } ; (d) The 1-neighborhood subgraph N ( S 3 ) of the nodes set S 3 = { 1 , 2 , 6 , 30 } .
Mathematics 07 00690 g003
Figure 4. The 1-neighborhood subgraphs for the different nodes sets of the 7 × 7 grid graph G 7 , 7 . (a) A graph G and the 1-neighborhood subgraph N ( 25 ) of the node 25; (b) The 1-neighborhood subgraph of the nodes set S 1 = { 24 , 25 } ; (c) The 1-neighborhood subgraph of the nodes set S 2 = { 24 , 25 , 18 } ; (d) The 1-neighborhood subgraph of the nodes set S 3 = { 24 , 25 , 18 , 32 } .
Figure 4. The 1-neighborhood subgraphs for the different nodes sets of the 7 × 7 grid graph G 7 , 7 . (a) A graph G and the 1-neighborhood subgraph N ( 25 ) of the node 25; (b) The 1-neighborhood subgraph of the nodes set S 1 = { 24 , 25 } ; (c) The 1-neighborhood subgraph of the nodes set S 2 = { 24 , 25 , 18 } ; (d) The 1-neighborhood subgraph of the nodes set S 3 = { 24 , 25 , 18 , 32 } .
Mathematics 07 00690 g004
Figure 5. A wheel graph G, the 1-neighborhood subgraphs N ( 1 ) and N ( 2 ) and the three related vertices sets produced by the boolean operations of N ( 1 ) and N ( 2 ) . (a) A wheel graph G; (b) The neighborhood subgraph N ( 1 ) ; (c) The neighborhood subgraph N ( 2 ) ; (d) V ( N ( 1 ) ) V ( N ( 2 ) ) = { 6 , 30 } ; (e) V ( N ( 1 ) ) V ( N ( 2 ) ) = { 10 , 14 , 18 , 22 , 26 } ; (f) V ( N ( 2 ) ) V ( N ( 1 ) ) = { 3 } .
Figure 5. A wheel graph G, the 1-neighborhood subgraphs N ( 1 ) and N ( 2 ) and the three related vertices sets produced by the boolean operations of N ( 1 ) and N ( 2 ) . (a) A wheel graph G; (b) The neighborhood subgraph N ( 1 ) ; (c) The neighborhood subgraph N ( 2 ) ; (d) V ( N ( 1 ) ) V ( N ( 2 ) ) = { 6 , 30 } ; (e) V ( N ( 1 ) ) V ( N ( 2 ) ) = { 10 , 14 , 18 , 22 , 26 } ; (f) V ( N ( 2 ) ) V ( N ( 1 ) ) = { 3 } .
Mathematics 07 00690 g005
Figure 6. The T o p M o s t graphs of two graphs, including a wheel graph G and the graph G u with u = 1 V ( G ) . (a) A wheel graph G with 33 nodes and 64 edges; (b) The T o p M o s t graph of G; (c) The graph G u of 32 vertices and 56 edges; (d) The T o p M o s t graph of G u .
Figure 6. The T o p M o s t graphs of two graphs, including a wheel graph G and the graph G u with u = 1 V ( G ) . (a) A wheel graph G with 33 nodes and 64 edges; (b) The T o p M o s t graph of G; (c) The graph G u of 32 vertices and 56 edges; (d) The T o p M o s t graph of G u .
Mathematics 07 00690 g006
Figure 7. The T o p M o s t graphs of three graphs, including the 10 × 10 grid graph G 10 , 10 , G 10 , 10 u , G 10 , 10 u v w with u = 73 , v = 88 , w = 97 V ( G 10 , 10 ) . (a) A 10 × 10 grid graph G 10 , 10 of 100 vertices and 180 edges; (b) The T o p M o s t graph of G 10 , 10 ; (c) The T o p M o s t graph of G 10 , 10 u ; (d) The T o p M o s t graph of G 10 , 10 u v w .
Figure 7. The T o p M o s t graphs of three graphs, including the 10 × 10 grid graph G 10 , 10 , G 10 , 10 u , G 10 , 10 u v w with u = 73 , v = 88 , w = 97 V ( G 10 , 10 ) . (a) A 10 × 10 grid graph G 10 , 10 of 100 vertices and 180 edges; (b) The T o p M o s t graph of G 10 , 10 ; (c) The T o p M o s t graph of G 10 , 10 u ; (d) The T o p M o s t graph of G 10 , 10 u v w .
Mathematics 07 00690 g007
Figure 8. The T o p M o s t graphs of two trees T 1 and T 2 . (a) A tree T 1 of 39 vertices and 38 edges; (b) The T o p M o s t graph of T 1 ; (c) A tree T 2 of 42 vertices and 41 edges; (d) The T o p M o s t graph of T 2 .
Figure 8. The T o p M o s t graphs of two trees T 1 and T 2 . (a) A tree T 1 of 39 vertices and 38 edges; (b) The T o p M o s t graph of T 1 ; (c) A tree T 2 of 42 vertices and 41 edges; (d) The T o p M o s t graph of T 2 .
Mathematics 07 00690 g008
Figure 9. The T o p M o s t graphs of three graphs G 1 , G 2 and G 3 . (a) A graph G 1 of 22 vertices and 37 edges; (b) A graph G 2 of 53 vertices and 80 edges; (c) A graph G 3 of 49 vertices and 78 edges; (d) The T o p M o s t graph of G 1 ; (e) The T o p M o s t graph of G 2 ; (f) The T o p M o s t graph of G 3 .
Figure 9. The T o p M o s t graphs of three graphs G 1 , G 2 and G 3 . (a) A graph G 1 of 22 vertices and 37 edges; (b) A graph G 2 of 53 vertices and 80 edges; (c) A graph G 3 of 49 vertices and 78 edges; (d) The T o p M o s t graph of G 1 ; (e) The T o p M o s t graph of G 2 ; (f) The T o p M o s t graph of G 3 .
Mathematics 07 00690 g009
Figure 10. The T o p M o s t graphs of three graphs G 3 , 3 , 3 , G 4 , 4 , 4 and G 4 . (a) The 3 × 3 × 3 grid graph G 3 , 3 , 3 of 27 vertices and 54 edges; (b) The 4 × 4 × 4 grid graph G 4 , 4 , 4 of 64 vertices and 144 edges; (c) A graph G 4 of 77 vertices and 196 edges; (d) The T o p M o s t graph of G 3 , 3 , 3 ; (e) The T o p M o s t graph of G 4 , 4 , 4 ; (f) The T o p M o s t graph of G 4 .
Figure 10. The T o p M o s t graphs of three graphs G 3 , 3 , 3 , G 4 , 4 , 4 and G 4 . (a) The 3 × 3 × 3 grid graph G 3 , 3 , 3 of 27 vertices and 54 edges; (b) The 4 × 4 × 4 grid graph G 4 , 4 , 4 of 64 vertices and 144 edges; (c) A graph G 4 of 77 vertices and 196 edges; (d) The T o p M o s t graph of G 3 , 3 , 3 ; (e) The T o p M o s t graph of G 4 , 4 , 4 ; (f) The T o p M o s t graph of G 4 .
Mathematics 07 00690 g010
Figure 11. The T o p M o s t graphs of three graphs G 5 , G 6 and G 7 . (a) The 10 × 10 king graph G 5 of 100 vertices and 342 edges; (b) The musical graph G 6 of 24 vertices and 60 edges; (c) The Barnette-Bosák-Lederberg graph G 7 of 38 vertices and 57 edges; (d) The T o p M o s t graph of G 5 ; (e) The T o p M o s t graph of G 6 ; (f) The T o p M o s t graph of G 7 .
Figure 11. The T o p M o s t graphs of three graphs G 5 , G 6 and G 7 . (a) The 10 × 10 king graph G 5 of 100 vertices and 342 edges; (b) The musical graph G 6 of 24 vertices and 60 edges; (c) The Barnette-Bosák-Lederberg graph G 7 of 38 vertices and 57 edges; (d) The T o p M o s t graph of G 5 ; (e) The T o p M o s t graph of G 6 ; (f) The T o p M o s t graph of G 7 .
Mathematics 07 00690 g011
Figure 12. The T o p M o s t graphs of three regular graphs G 8 , G 9 and G 10 . (a) The 4-hypercube graph G 8 of 16 vertices and 32 edges; (b) The triangular graph G 9 of 10 vertices and 30 edges; (c) The Clebsch graph G 10 of 16 vertices and 40 edges; (d) The T o p M o s t graph of G 8 ; (e) The T o p M o s t graph of G 9 ; (f) The T o p M o s t graph of G 10 .
Figure 12. The T o p M o s t graphs of three regular graphs G 8 , G 9 and G 10 . (a) The 4-hypercube graph G 8 of 16 vertices and 32 edges; (b) The triangular graph G 9 of 10 vertices and 30 edges; (c) The Clebsch graph G 10 of 16 vertices and 40 edges; (d) The T o p M o s t graph of G 8 ; (e) The T o p M o s t graph of G 9 ; (f) The T o p M o s t graph of G 10 .
Mathematics 07 00690 g012
Figure 13. The T o p M o s t graphs of three unconnected graphs G 11 , G 12 and G 13 . (a) A disconnected graph G 11 with 12 nodes and 12 edges; (b) A disconnected graph G 12 that has four connected components and a total of 100 vertices and 160 edges; (c) A disconnected graph G 13 that has four connected components and a total of 100 vertices and 131 edges; (d) The T o p M o s t graph of G 11 ; (e) The T o p M o s t graph of G 12 ; (f) The T o p M o s t graph of G 13 .
Figure 13. The T o p M o s t graphs of three unconnected graphs G 11 , G 12 and G 13 . (a) A disconnected graph G 11 with 12 nodes and 12 edges; (b) A disconnected graph G 12 that has four connected components and a total of 100 vertices and 160 edges; (c) A disconnected graph G 13 that has four connected components and a total of 100 vertices and 131 edges; (d) The T o p M o s t graph of G 11 ; (e) The T o p M o s t graph of G 12 ; (f) The T o p M o s t graph of G 13 .
Mathematics 07 00690 g013
Figure 14. The T o p M o s t graphs of three graphs G 14 , G 15 and G 16 . (a) A Hamiltonian Graph G 14 of 20 vertices and 30 edges; (b) The 6-Andrásfai graph G 15 of 17 vertices and 51 edges; (c) The 7-antiprism graph G 16 of 14 vertices and 28 edges; (d) The T o p M o s t graph of G 14 ; (e) The T o p M o s t graph of G 15 ; (f) The T o p M o s t graph of G 16 .
Figure 14. The T o p M o s t graphs of three graphs G 14 , G 15 and G 16 . (a) A Hamiltonian Graph G 14 of 20 vertices and 30 edges; (b) The 6-Andrásfai graph G 15 of 17 vertices and 51 edges; (c) The 7-antiprism graph G 16 of 14 vertices and 28 edges; (d) The T o p M o s t graph of G 14 ; (e) The T o p M o s t graph of G 15 ; (f) The T o p M o s t graph of G 16 .
Mathematics 07 00690 g014
Figure 15. The T o p M o s t graphs of three graphs K ( 5 , 5 ) , G 17 and G 18 . (a) The complete bipartite graph K ( 5 , 5 ) of 10 vertices and 25 edges; (b) The 12-crossed prism graph G 17 of 24 vertices and 36 edges; (c) The 6th order cube-connected cycle graph G 18 of 24 nodes and 36 edges; (d) The T o p M o s t graph of K ( 5 , 5 ) ; (e) The T o p M o s t graph of G 17 ; (f) The T o p M o s t graph of G 18 .
Figure 15. The T o p M o s t graphs of three graphs K ( 5 , 5 ) , G 17 and G 18 . (a) The complete bipartite graph K ( 5 , 5 ) of 10 vertices and 25 edges; (b) The 12-crossed prism graph G 17 of 24 vertices and 36 edges; (c) The 6th order cube-connected cycle graph G 18 of 24 nodes and 36 edges; (d) The T o p M o s t graph of K ( 5 , 5 ) ; (e) The T o p M o s t graph of G 17 ; (f) The T o p M o s t graph of G 18 .
Mathematics 07 00690 g015
Figure 16. The T o p M o s t graphs of three graphs G 19 , G 20 and G 21 . (a) The Icosidodecahedral Graph G 19 with 30 nodes and 60 edges; (b) The truncated octahedron graph G 20 with 24 nodes and 36 edges; (c) The great rhombicuboctahedron graph G 21 of 48 nodes and 72 edges; (d) The T o p M o s t graph of G 19 ; (e) The T o p M o s t graph of G 20 ; (f) The T o p M o s t graph of G 21 .
Figure 16. The T o p M o s t graphs of three graphs G 19 , G 20 and G 21 . (a) The Icosidodecahedral Graph G 19 with 30 nodes and 60 edges; (b) The truncated octahedron graph G 20 with 24 nodes and 36 edges; (c) The great rhombicuboctahedron graph G 21 of 48 nodes and 72 edges; (d) The T o p M o s t graph of G 19 ; (e) The T o p M o s t graph of G 20 ; (f) The T o p M o s t graph of G 21 .
Mathematics 07 00690 g016
Figure 17. The T o p M o s t graphs of three graphs G 22 , G 23 and G 24 . (a) The coxeter graph G 22 of 28 vertices and 42 edges; (b) The Nauru graph G 23 with 24 nodes and 36 edges; (c) The Dyck graph G 24 of 32 nodes and 48 edges; (d) The T o p M o s t graph of G 22 ; (e) The T o p M o s t graph of G 23 ; (f) The T o p M o s t graph of G 24 .
Figure 17. The T o p M o s t graphs of three graphs G 22 , G 23 and G 24 . (a) The coxeter graph G 22 of 28 vertices and 42 edges; (b) The Nauru graph G 23 with 24 nodes and 36 edges; (c) The Dyck graph G 24 of 32 nodes and 48 edges; (d) The T o p M o s t graph of G 22 ; (e) The T o p M o s t graph of G 23 ; (f) The T o p M o s t graph of G 24 .
Mathematics 07 00690 g017
Figure 18. The T o p M o s t graphs of three graphs G 25 , G 26 and G 27 . (a) The Errera graph G 25 of 17 vertices and 45 edges; (b) The Folkman graph G 26 with 20 nodes and 40 edges; (c) A fullerene graph G 27 of 24 nodes and 36 edges; (d) The T o p M o s t graph of G 25 ; (e) The T o p M o s t graph of G 26 ; (f) The T o p M o s t graph of G 27 .
Figure 18. The T o p M o s t graphs of three graphs G 25 , G 26 and G 27 . (a) The Errera graph G 25 of 17 vertices and 45 edges; (b) The Folkman graph G 26 with 20 nodes and 40 edges; (c) A fullerene graph G 27 of 24 nodes and 36 edges; (d) The T o p M o s t graph of G 25 ; (e) The T o p M o s t graph of G 26 ; (f) The T o p M o s t graph of G 27 .
Mathematics 07 00690 g018
Figure 19. The T o p M o s t graphs of three graphs G 28 , G 29 and G 30 . (a) A generalized quadrangle graph G 28 with 15 nodes and 45 edges; (b) A pentagonal icositetrahedral graph G 29 with 38 nodes and 60 edges; (c) A Shrikhande graph G 30 of 16 nodes and 48 edges; (d) The T o p M o s t graph of G 28 ; (e) The T o p M o s t graph of G 29 ; (f) The T o p M o s t graph of G 30 .
Figure 19. The T o p M o s t graphs of three graphs G 28 , G 29 and G 30 . (a) A generalized quadrangle graph G 28 with 15 nodes and 45 edges; (b) A pentagonal icositetrahedral graph G 29 with 38 nodes and 60 edges; (c) A Shrikhande graph G 30 of 16 nodes and 48 edges; (d) The T o p M o s t graph of G 28 ; (e) The T o p M o s t graph of G 29 ; (f) The T o p M o s t graph of G 30 .
Mathematics 07 00690 g019
Figure 20. The T o p M o s t graphs of three graphs G 31 , G 32 and G 33 . (a) The Wiener-Araya graph G 31 of 42 vertices and 67 edges; (b) The Zamfirescu graph G 32 with 48 nodes and 76 edges; (c) The Faulkner-Younger graph G 33 of 42 nodes and 62 edges; (d) The T o p M o s t graph of G 31 ; (e) The T o p M o s t graph of G 32 ; (f) The T o p M o s t graph of G 33 .
Figure 20. The T o p M o s t graphs of three graphs G 31 , G 32 and G 33 . (a) The Wiener-Araya graph G 31 of 42 vertices and 67 edges; (b) The Zamfirescu graph G 32 with 48 nodes and 76 edges; (c) The Faulkner-Younger graph G 33 of 42 nodes and 62 edges; (d) The T o p M o s t graph of G 31 ; (e) The T o p M o s t graph of G 32 ; (f) The T o p M o s t graph of G 33 .
Mathematics 07 00690 g020
Figure 21. The T o p M o s t graphs of three graphs G 34 , G 35 and G 36 . (a) A triangle-replaced graph G 34 with 30 nodes and 45 edges; (b) The 4-dimensional Keller graph G 35 of 16 vertices and 46 edges; (c) The 6 × 6 knight graph G 36 of 36 nodes and 80 edges; (d) The T o p M o s t graph of G 34 ; (e) The T o p M o s t graph of G 35 ; (f) The T o p M o s t graph of G 36 .
Figure 21. The T o p M o s t graphs of three graphs G 34 , G 35 and G 36 . (a) A triangle-replaced graph G 34 with 30 nodes and 45 edges; (b) The 4-dimensional Keller graph G 35 of 16 vertices and 46 edges; (c) The 6 × 6 knight graph G 36 of 36 nodes and 80 edges; (d) The T o p M o s t graph of G 34 ; (e) The T o p M o s t graph of G 35 ; (f) The T o p M o s t graph of G 36 .
Mathematics 07 00690 g021
Figure 22. The T o p M o s t graphs of three graphs G 37 , G 38 and G 39 . (a) The Folkman graph G 37 of 20 vertices and 40 edges; (b) The 24-cell graph G 38 with 24 nodes and 96 edges; (c) The Thomassen graph G 39 of 34 nodes and 52 edges; (d) The T o p M o s t graph of G 37 ; (e) The T o p M o s t graph of G 38 ; (f) The T o p M o s t graph of G 39 .
Figure 22. The T o p M o s t graphs of three graphs G 37 , G 38 and G 39 . (a) The Folkman graph G 37 of 20 vertices and 40 edges; (b) The 24-cell graph G 38 with 24 nodes and 96 edges; (c) The Thomassen graph G 39 of 34 nodes and 52 edges; (d) The T o p M o s t graph of G 37 ; (e) The T o p M o s t graph of G 38 ; (f) The T o p M o s t graph of G 39 .
Mathematics 07 00690 g022
Figure 23. The T o p M o s t graphs of three graphs G 40 , G 41 and G 42 . (a) The projective plane graph G 40 of 26 vertices and 52 edges; (b) The Miyazaki graph G 41 with 40 nodes and 60 edges; (c) The Cubic Hypohamiltonian graph G 42 of 44 vertices and 75 edges; (d) The T o p M o s t graph of G 40 ; (e) The T o p M o s t graph of G 41 ; (f) The T o p M o s t graph of G 42 .
Figure 23. The T o p M o s t graphs of three graphs G 40 , G 41 and G 42 . (a) The projective plane graph G 40 of 26 vertices and 52 edges; (b) The Miyazaki graph G 41 with 40 nodes and 60 edges; (c) The Cubic Hypohamiltonian graph G 42 of 44 vertices and 75 edges; (d) The T o p M o s t graph of G 40 ; (e) The T o p M o s t graph of G 41 ; (f) The T o p M o s t graph of G 42 .
Mathematics 07 00690 g023

Share and Cite

MDPI and ACS Style

Hao, J.; Gong, Y.; Sun, J.; Tan, L. Use the K-Neighborhood Subgraphs to Compute Canonical Labelings of Graphs. Mathematics 2019, 7, 690. https://doi.org/10.3390/math7080690

AMA Style

Hao J, Gong Y, Sun J, Tan L. Use the K-Neighborhood Subgraphs to Compute Canonical Labelings of Graphs. Mathematics. 2019; 7(8):690. https://doi.org/10.3390/math7080690

Chicago/Turabian Style

Hao, Jianqiang, Yunzhan Gong, Jianzhi Sun, and Li Tan. 2019. "Use the K-Neighborhood Subgraphs to Compute Canonical Labelings of Graphs" Mathematics 7, no. 8: 690. https://doi.org/10.3390/math7080690

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop