Abstract
This paper presents a novel theory and method to calculate the canonical labelings of digraphs whose definition is entirely different from the traditional definition of Nauty. It indicates the mutual relationships that exist between the canonical labeling of a digraph and the canonical labeling of its complement graph. It systematically examines the link between computing the canonical labeling of a digraph and the k-neighborhood and k-mix-neighborhood subdigraphs. To facilitate the presentation, it introduces several concepts including mix diffusion outdegree sequence and entire mix diffusion outdegree sequences. For each node in a digraph G, it assigns an attribute m_NearestNode to enhance the accuracy of calculating canonical labeling. The four theorems proved here demonstrate how to determine the first nodes added into . Further, the other two theorems stated below deal with identifying the second nodes added into . When computing , if already contains the first i vertices , Diffusion Theorem provides a guideline on how to choose the subsequent node of . Besides, the Mix Diffusion Theorem shows that the selection of the th vertex of for computing is from the open mix-neighborhood subdigraph of the nodes set . It also offers two theorems to calculate the of the disconnected digraphs. The four algorithms implemented in it illustrate how to calculate of a digraph. Through software testing, the correctness of our algorithms is preliminarily verified. Our method can be utilized to mine the frequent subdigraph. We also guess that if there exists a vertex satisfying conditions for each , then for .
1. Introduction
A canonical labeling [1,2,3] of a graph, also called a canonical form [4], a canonical code [5], or an optimum code [6], is a unique string corresponding to the graph and is lexicographically smallest or largest according to the different definitions used in the studies. Two digraphs are isomorphic if and only if they have the same canonical labelings. Until now, the computation of the canonical labeling as the digraph isomorphism problem remains an unsolved problem in computational complexity theory in the sense that no polynomial-time algorithm exists for calculating the canonical labeling of a digraph. Therefore, the computation of the canonical labeling is NP-hard [4,7].
Numerous methods have emerged to calculate the canonical labelings of undirected graphs. However, different methods use distinct definitions of the canonical labeling. Given a graph with n vertices, Huan et al. concatenates the lower triangular entries (including the diagonal entries) of its adjacency matrix to produce its canonical labeling [8]. Kuramochi and Karypis construct the canonical labeling by concatenating the columns of the upper-triangular portion of its adjacency matrix [9,10]. To create the canonical labeling, He et al. concatenate the rows of its adjacency matrix to form a binary number [11,12].
Babai and Luks pioneered the establishment of a general group-theoretic approach to compute canonical labeling [4]. However, combinatorial methods have worked well in various special cases. For random graphs, Babai et al. produce a canonical labeling with high probability [4,13]. Arvind et al. propose two corresponding logspace algorithms for partial 2- and 3-Trees [7,14].
Jianqiang Hao establishes a new theoretical framework to compute the canonical labeling of undirected graphs by defining a set of concepts useful for classifying graphs [15].
Currently, Nauty [1,16,17,18] is the most popular and practical tools for considering the automorphism group and the canonical label of a graph or digraph. On isomorphism testing, Nauty is more efficient than Ullmann [19]. It has almost become the industry standard used to calculate the canonical label, as well as the automorphism group. For computing the canonical labeling and automorphism group, Nauty and [20] use the depth-first search to traverse the potential intermediate nodes in the search tree. The nodes of the search tree generated by Nauty are equitable ordered partitions of nodes in G. Nauty iteratively refines partitioning nodes until places the nodes that have the same properties into an automorphism orbit. As the partition refinement becomes finer and smaller, it automatically creates the canonical label. Nauty also requires exponential time to compute the canonical labeling for a given Miyazaki graph [21]. Tener and Deo [22] made improvements for dealing with the problem.
Besides Nauty, Bliss [3,23], Traces [2], and Conauto [24] are also state-of-the-art tools for graphs isomorphism testing. Based on backtracking, individualization of vertices, and partition refinement, Bliss [3,23] is an efficient canonical labeling tool for handling large and sparse graphs. Katebi et al. [25] can find the symmetry while calculating the canonical labeling. To fix the glitch of Nauty, Traces [2] uses the strategy of breadth-first search to find the automorphism group and the canonical labeling. Conauto also uses the basic individualization/refinement technique and is very fast for random graphs and several families of hard graphs.
For the improvement of performance, existing algorithms commonly utilize backtracking and orbit partitioning technique to avoid repeatedly visiting the same vertices, as well as manage to reduce the accessed nodes in the search tree. McKay and Piperno provides a comprehensive discussion of the issue [18].
Nauty dominated the field for several decades. As a result, an in-depth study for the canonical labeling has been confined to the theoretical framework of Nauty. This means that people just follow the research trajectory of nauty to extend and establish further study. When the graph under consideration contains a large number of automorphisms, it is difficult to verify the correctness of the canonical labeling obtained by performing Nauty according to the standard of Nauty.
Although many algorithms have emerged to calculate the canonical labelings of undirected graphs, to our best knowledge no algorithm other than Nauty exists for computing the canonical labelings of digraphs.
Throughout the paper, the canonical labeling of a digraph is the lexicographically largest code obtained by concatenating the rows of the associated adjacency matrix (see Definition 7). Our definition of canonical labeling is entirely different from that of Nauty.
Although a few algorithms also give the same definition of the canonical labeling as described in Definition 7, their primary purpose is not to study how to construct a canonical labeling of a digraph, but for other intentions such as to mine the frequent subdigraphs. As a result, they can only work for some restricted undirected graph classes. Jianqiang Hao utilizes the to calculate the first node added into of simple undirected graphs [15]. Based on current knowledge and Definition 7, a general algorithm for computing the canonical labelings of digraphs is not available.
This paper focuses on the development of general theory and methods to calculate the canonical labeling of digraphs. In the rest of this paper, Section 2 establishes some basic terminology and preliminary information. Section 3 describes the results accompanied by some discussion. Section 4 presents our algorithms for computing the canonical labeling of digraphs. Section 5 displays the implementation of our algorithms and evaluates our approach through many examples. Finally, Section 6 comments on our results and future work.
2. Preliminaries
In this section, we provide a brief review of the fundamental information used throughout the paper. A more comprehensive presentation can be found in most standard textbooks [26,27]. A directed graph (or digraph) , consists of a nonempty set of vertices (or nodes) and a set of directed edges (or arcs). A directed edge associated with the ordered pair is said to start at u and end at v. We also say that the vertex u is its tail and the vertex v is its head. Throughout the paper, we denote by . For the edge , the vertex v is said to be adjacent from the vertex u, the vertex u is said to be adjacent to the vertex v, and the edge is said to be incident from the vertex u and incident to the vertex v. The directed distance from vertex u to vertex v in G is the length of the shortest directed path from u to v [28], if any; otherwise .
This paper deals with only finite simple digraphs, which have no loops and no multiple edges. For each , let , , , and denote the outindegree, outdegree, indegree, and degree of u respectively, and omit the subscript G when no ambiguity can arise. Denote by , , , and the maximum degree, the maximum outindegree, the maximum outdegree, and the maximum indegree of all vertices of a graph G, respectively.
Denote by , , ⋯, the degree sequence of G, by , , ⋯, the degree sequence of a subset with , , and by , , ⋯, the degree sequence of a subdigraph with , , and omit the subscript G when no ambiguity can arise.
In addition, denote by , , ⋯, the outdegree sequence of G, by , , ⋯, the outdegree sequence of a subset with , , and by , , ⋯, the outdegree sequence of a subdigraph with , , and omit the subscript G when no ambiguity can arise.
Similarly, denote by , , ⋯, the indegree sequence of G, by , , ⋯, the indegree sequence of a subset with , , and by , , ⋯, the indegree sequence of a subdigraph with , , and omit the subscript G when no ambiguity can arise.
Throughout this paper, unless otherwise specified, any given degree sequence is non-increasing. Throughout this paper, let , , , and where .
Definition 1.
Let , be a simple digraph with n nodes. The vertex-induced subdigraph on of G is the subdigraph with the nodes set together with any directed edge whose endpoints are both in , denoted by .
Definition 2.
Let , and , be two digraphs with n nodes. If there exists a bijection such that if and only if . We say f is an isomorphic map of . Furthermore, we say that the graph G and H are isomorphic, denoted by . An isomorphic map f of G onto itself is said to be an automorphism of G.
Definition 3.
Let , be a simple digraph with n nodes , , ⋯, . The adjacency matrix of G is a -square matrix such that if there is an edge and otherwise.
The adjacency matrix for a digraph G does not have to be symmetric, because there may not be an edge , when there is an edge from . In addition, for every since G has no loops.
Given two vectors , in and , , ⋯, in , the question arises as to how to decide which one is greater. The following conventions apply when comparing two vectors.
Definition 4.
Let , and be two vectors in N (the collection of natural numbers) with and , respectively. Then, defined the lexicographic order for the two vectors as follows:
- 1.
- , if and for all .
- 2.
- if and only if either of the following is true.
- (a)
- for , .
- (b)
- for and .
Definition 5.
Let , and be two vectors with and respectively, with each , being a vector in N (the collection of natural numbers). Then, defined the lexicographic order for the two vectors as follows:
- 1.
- , if and for all .
- 2.
- if and only if either of the following is true.
- (a)
- for , .
- (b)
- for and .
Definition 6.
Let and be two matrices with , for . Then, defined the lexicographic order for the two matrix as follows:
- 1.
- , if for all .
- 2.
- , if satisfying conditions for all , , and with or with .
Given a matrix X, if there is at least one positive element and the remaining elements are 0, we call . Otherwise, if all elements of X are 0, we call .
Definition 7.
Let , be a simple digraph with n nodes whose adjacency matrix is (see (1)). To concatenate the rows of according to the following order , , ⋯, , , , ⋯, , ⋯,, , ⋯, , ⋯, , , ⋯, forms a corresponding binary number ⋯⋯, which is called a labeling of G, denoted by .
The first row of is the labeling piece 1 of , denoted by . Similarly, the second row is the labeling piece 2 of , denoted by . ⋯. The nth row is the labeling piece n of , denoted by . It is clear that .
A permutation π of the vertices of G is an arrangement of the n vertices without repetition. The number of permutations of the vertices of G is . Clearly each distinct permutation π of the n vertices of defines a different adjacency matrix. Given a permutation π, one can obtain a labeling corresponding to π by Definition 7. Denote by the collection of all labelings of G.
For every , , assume that , with , or 1. Let and . By Definition 4, if , then we call . Otherwise, if , then we call . Otherwise, if , then we call .
It is clear that , is a well-ordered set, where ⩽ denotes the less-than-or-equal-to binary relation on the set expressed as above. By the well-ordering theorem, it follows that has a minimum and maximum element, denoted by and respectively.
The two permutations of the n vertices of G corresponding to and are the minimum and maximum node sequence, denoted by and , respectively. Likewise, the two adjacency matrices of G corresponding to and are the minimum and maximum canonical label matrix, denoted by and , individually.
corresponding to are minimum canonical label piece , ⋯, n of canonical labeling , denoted by , , ⋯, , respectively. Likewise, , , ⋯, corresponding to are maximum canonical label piece of canonical labeling , denoted by , , ⋯, , respectively.
Based on the above definitions, the following equations hold.
Theorem 1.
Let , and , be two digraphs with n nodes. Their adjacency matrices are and respectively. if and only if =.
Definition 8.
Let , be a simple digraph with n nodes. The complement of G is a digraph satisfying the following condition: for all , if and only if .
Lemma 1.
Let , be a simple digraph with n nodes. , is the complement digraph of G. We have and .
Proof.
The adjacency matrices of G and satisfy the condition
J is a matrix of zeros and ones whose main diagonal elements are 0, and all other elements are 1. By and the complement graph , we have . Similarly, by , we have for the complement graph of a graph G. ☐
Theorem 2.
Let , be a simple digraph with n nodes. , is the complement graph of G. We have
Proof.
By Lemma 1, it follows that . Clearly if the k-bit of is 0, the k-bit of is 1, and vice versa. Therefore, one can easily get the by performing a complement operation on . Similarly, by Lemma 1, the equality holds. Clearly if the k-bit of is 0, the k-bit of is 1, and vice versa. Accordingly, one can obtain the of by performing a complement operation on .
Because is a constant binary number, to minimize one must maximize . On the contrary, to maximize , one must maximize . Similarly, to minimize one must maximize . Contrarily to maximize , one must minimize . From the above analysis, the following equations hold.
☐
By Theorem 2, it can be observed that if one has calculated the , one can easily get . Moreover, the calculation methods of and are same.
The paper focuses on the development of efficient methods to calculate . A MaxEm digraph is a digraph with the greatest that corresponds to a permutation of the vertices.
For every , the number of nodes with outdegree is the outdegree multiplicity of u, denoted by . In addition, unless otherwise specified, throughout this paper, the outdegree sequence is non-increasing.
Definition 9.
Let , be a simple digraph with n nodes. The open neighborhood, in-neighborhood, out-neighborhood, outin-neighborhood, and mix-neighborhood subdigraphs of a vertex u in G are subdigraphs of G defined as
where
The open k-neighborhood, k-in-neighborhood, k-out-neighborhood, k-outin-neighborhood, and k-mix-neighborhood subdigraphs of u with k ⩾ 2 are subdigraphs of G defined as
where
Definition 10.
Let , be a simple digraph with n nodes. The close neighborhood, in-neighborhood, out-neighborhood, outin-neighborhood, and mix-neighborhood subdigraphs of a vertex u in G are subdigraphs of G defined as
where
The close k-neighborhood, k-in-neighborhood, k-out-neighborhood, k-outin-neighborhood, and k-mix-neighborhood subdigraphs of u with k ⩾ 2 are subdigraphs of G defined as
where
Definition 11.
Let , be a simple digraph with n nodes. The open neighborhood, in-neighborhood, out-neighborhood, outin-neighborhood, and mix-neighborhood subdigraphs of a nodes set are subdigraphs of G defined as
where
The open k-neighborhood, k-in-neighborhood, k-out-neighborhood, k-outin-neighborhood, and k-mix-neighborhood subdigraphs of Q with k ⩾ 2 are subdigraphs of G defined as
where
Definition 12.
Let , be a simple digraph with n nodes. The close neighborhood, in-neighborhood, out-neighborhood, outin-neighborhood, and mix-neighborhood subdigraphs of a nodes set are subdigraphs of G defined as
where
The close k-neighborhood, k-in-neighborhood, k-out-neighborhood, k-outin-neighborhood, and k-mix-neighborhood subdigraphs of Q with k ⩾ 2 are subdigraphs of G defined as
where
In the following section, unless otherwise specified, each k-neighborhood, k-in-neighborhood, k-out-neighborhood, k-outin-neighborhood, and k-mix-neighborhood subdigraphs are closed.
A digraph is connected if its underlying graph is connected. For , we omit the subscript 1 and let , , , and .
Definition 13.
Let , be a simple digraph with n nodes. Suppose that and . We denote by the open k-neighborhood subdigraph of u in H, by the close k − neighborhood subdigraph of u in H, by the open k-mix-neighborhood subdigraph of u in H, and by the close k-mix-neighborhood subdigraph of u in H.
For , we omit the superscript 1 and let , , , and .
Definition 14.
Let , be a simple connected digraph with n nodes. For every , there exists a positive integer k satisfying conditions and . The value of k is called the diffusion radius of u denoted by of u denoted by , and the subscript G can be omitted when no ambiguity can arise.
By Definition 14, it is clear that for every u in G.
Definition 15.
Let , be a simple connected digraph with n nodes. For every , there exists a positive integer k satisfying conditions and . The value of k is called the mix diffusion radius of u denoted by of u denoted by , and the subscript G can be omitted when no ambiguity can arise.
Definition 16.
Let , be a simple digraph and u be a node in G whose close k neighborhood subdigraph is with . A node in is a one diffusion node of u. For , a node v in satisfying condition is a k diffusion node of u.
Definition 17.
Let , be a simple digraph and u be a node in G whose close k-mix-neighborhood subdigraph is with . A node in is a one mix diffusion node of u. For , a node v in satisfying condition is a k mix diffusion node of u.
Every node v in G is assigned an attribute m_NearestNode whose function, described in Section 3.1.2.
Definition 18.
Let , be a simple digraph and u be a node in G whose close k neighborhood subdigraph is with . Assume that H is a connected component of with . Assume that with , where is in ascending order of attribute with for every , and , contain the diffusion nodes of u respectively, satisfying conditions and for .
We define , ⋯, , ⋯, to be the diffusion outdegree sequence of H where with are the outdegree sequences in descending order induced by all vertices in respectively.
Definition 19.
Let , be a simple digraph and u be a node in G whose close k-mix-neighborhood subdigraph is with . Assume that H is a connected component of with . Assume that with , where is in ascending order of attribute with for every , and , contain the mix diffusion nodes of u respectively, satisfying conditions and for .
We define , ⋯, , ⋯, to be the mix diffusion outdegree sequence of H where with are the outdegree sequences in descending order induced by all vertices in respectively.
Definition 20.
Let , be a simple digraph and u be a node in G whose close k neighborhood subdigraph is with . Assume that has p connected components , , ⋯, with diffusion outdegree sequences , , ⋯, respectively, satisfying conditions .
Define , , ⋯, to be the entire mix diffusion outdegree sequence of pertaining to u in G, and omit the subscript G when no ambiguity can arise.
Definition 21.
Let , be a simple digraph and u be a node in G whose close k-mix neighborhood subdigraph is with . Assume that has p connected components , , ⋯, with mix diffusion outdegree sequences , , ⋯, respectively, satisfying conditions .
Define , , ⋯, to be the entire mix diffusion outdegree sequence of pertaining to u in G, and omit the subscript G when no ambiguity can arise.
Definition 22.
Let , be a simple digraph with n nodes. For every with and , let , , ⋯, be the close 1, 2, ⋯, mix-neighborhood subdigraph of u with entire mix diffusion outdegree sequences , , ⋯, , respectively. Let , , ⋯, be the 1, 2, ⋯, mix-neighborhood subdigraph of v with entire mix diffusion outdegree sequences , , ⋯, , respectively. Let , , ⋯, and , , ⋯, . If , we write with respect to G. Otherwise, if , we write with respect to G. Otherwise, if , we write with respect to G, and omit the symbol G when no ambiguity can arise. Denote or by and or by .
It is clear that ≻, ≺, ≍, ≽ define a binary relation on the set of nodes . By Definition 22, for every with , one of the following statements is true: (1) . (2) . (3) .
It can be shown that , is a well-ordered set, where ≽ denotes the binary relation on the set . By the well-ordering theorem, it follows that there exists a maximum and minimum element in , denoted by and respectively with and . The symbol ≽ can be omitted if no confusion arises. The following Lemmas 2–4 immediately follow from Definition 22.
Lemma 2.
Let , be a simple digraph with n nodes. For every with , if the symbol ≽ denotes the binary relation on the set , then, all of the nodes in G form a single chain L on G: with , , .
Lemma 3.
Let , be a simple digraph with n nodes. Let . For every with , if the symbol ≽ denotes the binary relation on the set , then, all of the nodes in form a single chain L on G: with .
Lemma 4.
Let , be a simple digraph with n nodes. For every , suppose that is the close k mix-neighborhood subdigraph of u in G. Let .
For every with , if the symbol ≽ denotes the binary relation on the set , then, all of the nodes in form a single chain L on : with .
The conclusions in the following Propositions 1 and 2 are obvious by Definitions 4, 5, and 22.
Proposition 1.
Let , be a simple digraph with n nodes. For every with and , let , , ⋯, be the close 1, 2, ⋯, mix-neighborhood subdigraph of u with entire mix diffusion outdegree sequences , , ⋯, , respectively. Let , , ⋯, be the close 1, 2, ⋯, mix-neighborhood subdigraph of v with entire mix diffusion outdegree sequences , , ⋯, , respectively. Let , , ⋯, with , , ⋯, and , , ⋯, . Let , , ⋯, with , , ⋯, and , , ⋯, . If , then leads to . Otherwise, leads to . Otherwise, leads to . Accordingly, it follows that if , then leads to . Otherwise, leads to . Otherwise, leads to .
Proposition 2.
Let , be a simple digraph with n nodes. For every with and , let , , ⋯, be the close 1, 2, ⋯, mix-neighborhood subdigraph of u with entire mix diffusion outdegree sequences , , ⋯, , respectively. Let , , ⋯, be the close 1, 2, ⋯, mix-neighborhood subdigraph of v with entire mix diff usion outdegree sequences , , ⋯, , respectively. If , , ⋯, , , then with respect to G (see Definition 22).
3. Results and Discussion
Let , be a simple digraph with n nodes. In the section, we will study how to compute the maximum element of the digraph G. Without loss of generality, let . Throughout the paper, our algorithms mentioned use an adjacency list to store the digraph G.
3.1. Compute of the Digraph G
In this subsection, we examine how to compute the maximum element of a digraph G. What approach should one take to calculate the maximum element ? From the connection between and , any method for calculating must first obtain the permutation corresponding to the adjacency matrix .
3.1.1. Compute the First Node Added into
In this sub-subsection, we examine how to compute the first vertex of . Here, assume that G is a connected digraph of order . Note that to maximize one must let (see (1)). can always be achieved since G is connected with order . Furthermore, to obtain , one must select from . Only by so doing, there can be more “1”s in the high bits of such that ensures maximum . Otherwise, cannot reach the maximum value. From preceding discussion, we get the following result.
Proposition 3.
Let , be a simple digraph with n nodes. Let . Then the selection of of is from for obtaining .
Proof.
Let us assume that . By (1), it follows that ⋯. Since , it can be shown that , , ⋯, for . Therefore, the conclusion of Proposition 3 holds. ☐
Proposition 4.
Let , be a simple digraph with n nodes. Let . If with , then for .
Proof.
By Proposition 3, it immediately follows that the selection of of is from for obtaining . Since , therefore, for . ☐
Lemma 5.
Let , be a simple digraph with n nodes. Let with . Let be the set of all vertices satisfying . Then, for .
Proof.
By Proposition 3, clearly is true. Since G is a simple digraph with n nodes, then ⋯ with and with (see (1)). Since , it follows that and for .
If , one can assert that . As a result, holds by the condition of Lemma 5. Therefore, with and .
Otherwise, if , then holds by the condition of Lemma 5. Therefore, with and .
By comparing the above two results obtained for , we have that holds for . ☐
Theorem 3.
Let , be a simple digraph with n nodes. Let with . Assume that have the open outin-neighborhood subdigraph with (see Definition 9). Suppose that there exists a node satisfying condition where .
For each with , suppose that there exists a node satisfying condition where . If condition is satisfied, then for .
Proof.
Since G is a simple digraph with n nodes, it follows that ⋯ with and with (see (1)). Since , it follows that for .
By the conditions of Theorem 3, clearly and . For simplicity, let us assume that , .
If conditions hold for each and let the , then at most with , , , and since there exists a node satisfying condition where .
Otherwise, if let the , then with , , , and since there exists a node satisfying condition where .
Since , Theorem 3 holds by comparing the above two results of obtained. ☐
Theorem 4.
Let , be a simple digraph with n nodes. Let with . Assume that have the open outin-neighborhood subdigraph with (see Definition 9). Suppose that there exists a node satisfying condition where .
For each with , suppose that there exists a node satisfying condition where . If conditions and hold, then for .
Proof.
Since G is a simple digraph with n nodes, it follows that ⋯ with and with (see (1)). Since , one can assert that and for .
By the conditions of Theorem 4, clearly . For simplicity, let us assume that and .
If conditions hold for each and let the , then at most with , , , , =, and = since the node satisfying condition where (see (1)).
On the contrary, if let the , then with , , , , =, = since the node satisfying condition where (see (1)).
Since , then the binary number ⋯ the binary number ⋯. Therefore, Theorem 4 holds. ☐
Theorem 5.
Let , be a simple digraph with n nodes. Let with . Suppose that holds for every . Let and satisfying condition where . Let and satisfying condition where . If condition holds, then for .
Proof.
Since G is a simple digraph with n nodes, it follows that ⋯ with and with (see (1)). Since , it follows that for .
By the conditions of Theorem 5, clearly and . For simplicity, let us assume that , .
If conditions hold for each and let the , then at most with , , , and since holds and satisfies condition where .
Conversely, if let the , then with , , , and since holds and satisfies condition where .
Since , Theorem 5 holds by comparing the above two results of obtained. ☐
Theorem 6.
Let , be a simple digraph with n nodes. Let with . Suppose that holds for every . Let and satisfying condition where . Let and satisfying condition where . If conditions and hold, then for .
Proof.
Since G is a simple digraph with n nodes, it follows that ⋯ with and with (see (1)). Since , one can assert that and for .
By the conditions of Theorem 6, clearly . For simplicity, let us assume that and .
If conditions hold for each and let the , then at most with , , , , , and = since holds and satisfies condition where (see (1)).
Conversely, if let the , then with , , , , =, = since holds and satisfies condition where (see (1)).
Since , then the binary number ⋯ the binary number ⋯. Therefore, Theorem 6 holds. ☐
Conjecture 1.
Let , be a simple digraph with n nodes. Let with . If there exists a vertex satisfying conditions for each , then for .
3.1.2. Calculate the Intermediate Vertices Added into
When our algorithm has computed the first node of , how would it determine the subsequent nodes for calculating ? Note that a directed edge of G corresponds to 1 bit of the adjacency matrix . To maximize by maximizing , one must let belong to the mix-neighborhood subdigraph so that makes (see (1)). Otherwise, if , then (see (1)) and . The following Lemma 6 summarizes the above results.
Lemma 6.
Let , be a simple digraph with n nodes. Let . Assume that is the first node of obtained for computing . By (12) of Definition 9, if condition holds, then for computing the second node of so that obtaining . Further, if with , then .
Proof.
We now prove the first statement of Lemma 6 by contradiction. Assume by contradiction that . By Definition 9 and the condition that is the first node of , it follows that for obtaining . By the condition , clearly ⋯ with , , ⋯, , , ⋯, since G is a simple digraph, and ⋯. It can be seen that if , then there are consistent with the requirement of and for (see (1)).
If , by (10) of Definition 9 then for , leading to a contradiction with the constraint satisfied by . Otherwise, if , by (11) of Definition 9 then for and for , resulting in a contradiction with the result obtained for . Therefore, the assumption that does not hold. The second claim of Lemma 7 immediately follows from the previous result. ☐
Lemma 7.
Let , be a simple digraph with n nodes. Let . Assume that is the first node of obtained for computing . By Definition 9, if conditions hold, then for computing the second node of so that getting .
Proof.
Since is the first node of and G is a simple digraph, by then ⋯ with , (see (1)). By the conditions , it follows that for . Therefore, for due to holds. ☐
Lemma 8.
Let , be a simple digraph with n nodes. Let . Assume that is the first node of obtained for computing . By Definition 9, if conditions hold, then for computing the second node of so that getting .
Proof.
Since is the first node of , G is a simple digraph, and , then ⋯ with , (see (1)). If , clearly for . If , it follows that for , which is a contradiction with previous result derived for . Therefore, if , then . ☐
Theorem 7.
Let , be a simple digraph with n nodes. Let . By Definition 9, let be the mix-neighborhood subdigraph of v. For computing , suppose that already contains the first node with , . If one of the following conditions holds, then for .
- 1.
- for .
- 2.
- hold for with .
Proof.
(1) By Lemma 6, it follows that if condition holds, then for . By the conditions of Theorem 7, there is ⋯ with , , (see (1)).
Note that ⋯ with since and G is a simple digraph. For simplicity, let us assume that . If , it can be seen that , by properly arranging the nodes of (see (1)). Otherwise, if with , no matter how the vertices in H are ordered such that there is, at least, one 0 among the r entries , since for (see (1)). Therefore, the conclusion (1) of Theorem 7 holds.
(2) Observe that ⋯ with since and G is a simple digraph. For simplicity, let us assume that , , , and with . Without loss of generality assume with and . If , one can let , , by properly ordering the nodes of since (see (1)). Since hold for with , it follows that . Further, one can let , , by properly sorting the nodes of since (see (1)). Otherwise, if , no matter how the vertices of are ordered such that there is, at least, one 0 among the k entries , since (see (1)). Therefore, the conclusion (2) of Theorem 7 holds. ☐
Theorem 8.
Let , be a simple digraph with n nodes. Let . For computing , suppose that already contains the first node satisfying conditions with , (see Definition 9). If one of the following conditions holds, then for .
- 1.
- for .
- 2.
- hold for with .
Proof.
By Lemma 8, it follows that if conditions hold, then for . By the conditions of Theorem 8, there is with , (see (1)). Note that with since and G is a simple digraph.
(1) For simplicity, let us assume that . If , it can be seen that , by properly arranging the nodes of (see (1)). Conversely, if with , no matter how the vertices in are ordered such that there is, at least, one 0 among the r entries , since for (see (1)). Therefore, the conclusion (1) of Theorem 7 holds.
(2) For convenience, let us assume that , , , and with . Without loss of generality assume with and .
If , one can let , , by properly ordering the nodes of since (see (1)). Since hold for with , it follows that . Further, one can let , , , by properly sorting the nodes of since (see (1)).
Conversely, if , no matter how the vertices of are ordered such that there is, at least, one 0 among the k entries , since (see (1)). Therefore, the conclusion (2) of Theorem 8 holds. ☐
When our algorithm has computed the first i vertices , of , how does it determine the subsequent nodes , for calculating ? Similar to the above discussion for obtaining , it can be shown that the selections of the successor vertices , of are from with .
Our algorithm assigns each node in G an attribute called . Once the ith node has been added into , it writes the index information i of into the attribute domain of each node , , ⋯, with . If , then let for each with .
Lemma 9.
Let , be a simple digraph with n nodes. Let . When computing , if already contains the first node whose open mix-neighborhood subdigraph is (see Definition 9), then , , ⋯, , .
Proof.
Since the condition holds, it can be asserted that by Definition 9. Because G is a simple digraph with n nodes, it follows that ⋯ with , , for obtaining (see (1)). To ensure to maximize (see (1)), the assertion , , ⋯, , is true. ☐
Theorem 9 (Diffusion Theorem of Digraphs).
Let , be a simple connected digraph with n nodes. For computing , suppose that already contains the first m vertices . Let whose open neighborhood subdigraph is (see Definition 11). If , then the following two conclusions hold.
- 1.
- By Definition 11, the selection of the th vertex of for computing is from the open neighborhood subdigraph of the nodes set Q.
- 2.
- the vertex-induced subdigraph of the first m vertices is connected.
Proof.
(1) We prove by contradiction. If , without loss of generality let us assume that , , is a permutation of , satisfying conditions with .
Further, we may assume that if condition holds, the corresponding to is the greatest. Assume that the node is the node whose index i in is the smallest index in than the indexes of other nodes belonging to in . This means that no node belonging to is between and of such that for every node , follows ( see Definition 11).
Let be the matrix corresponding to the permutation . Let , , , and be the block submatrices of containing the first m rows and the th column, the th to th columns, the ith column, and the th to nth columns, respectively.
Since , then holds. From the above result, for every node , , holds such that . For , if , then . Otherwise, if , then . Therefore, .
Similarly, let , , , and be the block submatrices of formed by the first m columns and the th row, the th to th rows, the ith row, and the th to nth rows, respectively.
Since , then holds. For every node , since holds, then . For , if , then by Definition 11. Otherwise, if , then . Therefore, .
By merely swapping and of , one can obtain another permutation , , , with .
Similar to , let be the matrix corresponding to the permutation . Let , , , and be the block submatrices of containing the first m rows and the th column, the th to th columns, the ith column, and the th to nth columns, respectively.
For , if , then . Otherwise, if , then . Therefore, . For every node , , since holds, then . Since , then holds.
Simila, Let , , , and be the block submatrices of formed by the first m columns and the th rows, the th to th rows, the ith row, and the th to nth rows, respectively.
For , if , then by Definition 11. Otherwise, if , then . Therefore, . For every node , since holds, then . Since , then holds.
By Definition 10, observe that since and are both the block submatrices defined by the same nodes sequence , and since and are both the block submatrices corresponding to the same nodes sequence .
Furthermore, by Definition 10 note that since and are both the block submatrices generated by the same nodes sequence , and since and are both the block submatrices corresponding to the same nodes sequence .
By Definition 10, it follows from the results discussed above that , , , , , , , .
Therefore, the new derived from is greater than the stemmed from such that brings a contradiction with the previous assumption that . This contradiction shows the statement (1) holds.
(2) The result immediately follows from the conclusion (1). ☐
Theorem 10 (Mix Diffusion Theorem of Digraphs).
Let , be a simple connected digraph with n nodes. For computing , suppose that already contains the first m vertices . Let whose open mix-neighborhood subdigraph is . If , then the following two conclusions hold.
- 1.
- By Definition 11, the selection of the th vertex of for computing is from the open mix-neighborhood subdigraph of the nodes set Q.
- 2.
- the vertex-induced subdigraph of the first m vertices is connected.
Proof.
(1) We prove by contradiction. If , without loss of generality let us assume that , , is a permutation of , satisfying conditions with .
Further, we may assume that if condition holds, the corresponding to is the greatest. Assume that the node is the node whose index i in is the smallest index in than the indexes of other nodes belonging to in . This means that no node belonging to is between and of such that for every node , follows ( see Definition 11).
Let be the matrix corresponding to the permutation . Let , , , and be the block submatrices of containing the first m rows and the th column, the th to th columns, the ith column, and the th to nth columns, respectively.
Since , then . If , then by Definition 11. Otherwise, if , then . Therefore, for . From the above result, for every node , , holds such that . If , then by Definition 11. Otherwise, if , then . Therefore, . Since , then .
By merely swapping and of , one can obtain another permutation , , , with .
Similar to , let be the matrix corresponding to the permutation . Let , , , and be the block submatrices of containing the first m rows and the th column, the th to th columns, the ith column, and the th to nth columns, respectively.
Clearly holds for . For every node , , since holds, then . If , then by Definition 11. Otherwise, if , then . Therefore, . Since , then . If , then by Definition 11. Otherwise, if , then . Therefore, .
By Definition 10, observe that since and are both the block submatrices corresponding to the same nodes sequence .
Furthermore, by Definition 10 note that since and are both the block submatrices corresponding to the same nodes sequence , and since and are both the block submatrices corresponding to the same nodes sequence .
It follows from the results discussed above that , , , .
Therefore, the new derived from is greater than the stemmed from such that brings a contradiction with the previous assumption that . This contradiction shows the statement (1) holds.
(2) The result immediately follows from the conclusion (1). ☐
Corollary 1.
Let , be a simple connected digraph with n nodes. Let . For computing , suppose that already contains the first m vertices . By Definition 11, if satisfies conditions , then .
Proof.
By Neighborhood Diffusion Theorem 9, we have that . By Mix Diffusion Theorem 10, it follows that . Since conditions hold, the result of Corollary 1 is true. ☐
Corollary 2.
Let , be a simple connected digraph with n nodes. For computing , suppose that already contains the first m vertices . If has open neighborhood subdigraph satisfying conditions . If , then .
Proof.
It follows from Mix Diffusion Theorem 10. ☐
3.2. Compute for a Disconnected Digraph
Let , be a simple disconnected digraph with n nodes and p connected components. Suppose that the p connected components are , , ⋯, . In this subsection, we study how to compute the maximum element of G.
If , how does our algorithm work to compute the maximum element of G? Observe that to obtain one had to arrange all vertices of each connected component with together when constructing the adjacency matrix . The result also follows from the proof of Diffusion Theorem of Digraphs 9.
First, we analyze the features of the adjacency matrix . When constructing the adjacency matrix , we arrange all vertices of each connected component with together. As a result, the adjacency matrix is a block matrix, each block of which corresponds to a connected component. Next, we study the relationship between and . Furthermore, we show how to solve the of the adjacency matrix .
Lemma 10.
Let , be a simple disconnected digraph that have two disjoint connected components , and , with k and l nodes respectively. Suppose that
If , then satisfies the following equality:
where
Proof.
If holds, then . By Proposition 3, it follows that to obtain , one must choose the vertex with the maximum outdegree from as the first vertex of .
By Diffusion Theorem of Digraphs 9, the subsequent vertices added into must be taken from . Similarly, by Proposition 3, it follows that to obtain , one must choose the th vertex from with the maximum outdegree as the th vertex of . By Diffusion Theorem of Digraphs 9, the next vertices added into must be from . Carefully examining (1), it is not difficult to find that (49) holds. ☐
Note that to ensure the maximization of , one must add l 0 after , , ⋯, respectively so that let be equal l 0.
Theorem 11.
Let , be a simple disconnected digraph with n nodes and p connected components. Suppose that the p connected components are , , ⋯, with , , ⋯, . If , then satisfies the following equality:
Proof.
We prove (50) by induction on the number p of branches. By the preceding definition, we have for . Thus, (50) in Theorem 11 holds for . By Lemma 10, (50) holds for .
By induction, suppose that (50) holds for . In the following, we prove that the equality (50) also holds for . We can now treat the front k branch digraphs as the digraph H. Therefore, (50) also holds for the digraph H.
where
By Lemma 10, we have
By (51), substituting to into (52), we obtain
Thus, we have
Thus, the equality (50) holds for . ☐
By Theorem 11, it can be seen that one must first calculate of each branch for for obtaining , respectively. Furthermore, one substitutes into (50) sequentially to obtain of a simple disconnected digraph G.
If the above conditions are not satisfied, how does one calculate of a disconnected undirected G? Based on an analysis of the preceding results, establish the following Theorem 12 that is more general than Lemma 10.
Theorem 12.
Let , be a simple disconnected digraph that have two disjoint connected components , and , with k and l nodes respectively. Let and satisfying condition . Suppose that
If there exists a node satisfying condition for , then satisfies the following equality:
where
Proof.
By the condition of Theorem 12, since holds.
If there exists a node satisfying condition for , by Theorem 3, one must choose the first vertex added into from so that obtain .
By Diffusion Theorem of Digraphs 9, one must select into from to obtain . In addition, one must choose the subsequent l nodes into from . By (55) and (56), it follows that (58) holds.
where
Note that to ensure the maximization of , l 0 must be added after , , ⋯, respectively and let be equal l 0. ☐
4. Our Algorithms for Computing the Canonical Labelings of Digraphs
In the section, based on the results of the previous sections, we present our algorithms for computing canonical labelings of digraphs. We display the major steps required for calculating the maximum element of G. When our algorithm has calculated the node of , then, it constructs the close mix-neighborhood subdigraph of the set (see Figure 1a), from which it picks a few vertices into . For clarity of presentation, we call this process 1. Then again, it builds the close mix-neighborhood subdigraph of the nodes set (see Figure 1b), from which it picks a few vertices into . We call this process 2. ⋯. Then again, it builds the close mix-neighborhood subdigraph of the nodes set (see Figure 1c,d), from which it picks a few vertices into . We call this process PROGRESS r⋯. This process continues until it puts all vertices in G into (see Figure 1e,f).
Figure 1.
Each close mix-neighborhood subdigraph of different nodes sets of an 8 × 8 grid digraph consists of pink and green nodes and edges. (a) The close mix-neighborhood subdigraph ; (b) ; (c) ; (d) ; (e) ; (f) .
For 1, after calculating , by Lemma 2, our algorithm arranges all nodes of into a single chain (see Algorithm 1). For simplify, let . If there are two nodes satisfying condition with respect to , then it continues to determine whether or with respect to G. If , it rearranges in front of the in . Otherwise, it rearranges in back of the in .
For each r, , when calculating , our algorithm continues to calculate the close in-neighborhood subdigraph and let if condition holds for some r.
For each r, , after calculating , our algorithm in turn computes (see Figure 2d), (see Figure 2e), (see Figure 2f), and the outdegree sequences , , in decreasing order respectively, where , . It can be shown that and for . By Lemma 2, it arranges all nodes of into a single chain (see Algorithm 1) with , respectively.
Figure 2.
A wheel graph G, two open mix-neighborhood subdigraphs and , and the three relevant nodes sets generated by the boolean operations of and . (a) A wheel digraph G; (b) The open mix-neighborhood subdigraph ; (c) The open mix-neighborhood subdigraph ; (d) ; (e) ; (f) .
| Algorithm 1: Arrange all nodes of into a single chain for a close mix-neighborhood subdigraph with , respectively where , , , and . |
![]() |
| Algorithm 2: Compare the entire mix diffusion outdegree sequences , , ⋯, and , , ⋯, of two nodes v and w in H. |
![]() |
| Algorithm 3: Compare two mix diffusion outdegree sequences and of two nodes v and w in H. |
![]() |
| Algorithm 4: Compare and . |
![]() |
Next, our algorithm sequentially performs the following steps for the nodes of with :
- Starting from the head of , our algorithm successively determines whether each node satisfies the outdegree multiplicity condition . If the number of vertices satisfying condition is less than 2 in , it puts u into . If there are two nodes satisfying condition with respect to , then it continues to determine whether or with respect to G. If , it rearranges the in front of the in (see Algorithm 1). Otherwise, it rearranges the in back of the in (see Algorithm 1).
- Except the nodes added into , it uses a queue Q to store the intermediate nodes to be added to . After performing Step 1, it sequentially determines whether or not each node is in Q. If u is in Q and the number of nodes added into is less than 2 in the preceding procedures, it puts u into and simultaneously deletes u from Q. Otherwise, it inputs u into Q.
- For , if the number of vertices of added into is 0 and the number of vertices satisfying condition with is less than 2, it puts u into . The remaining processing steps are the same as for .
- For , if the number of vertices of and added into is 0 and the number of vertices satisfying the condition with is less than 2, it puts u into . The remaining processing steps are the same as for .
Our algorithm uses an array to store the nodes of and an array Q to keep the nodes to be added to temporarily.
Experiments demonstrate that our approach is a novel way by which one can accurately calculate MaxEm digraphs (defined in Section 2) for many types of digraphs. Figure 3, Figure 4, Figure 5, 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 and Figure 21 produced by our software show the correctness of our software for calculating MaxEm digraphs of these digraph classes aforementioned.
Figure 3.
The MaxEm digraphs of three digraphs , , and . (a) The grid digraph with 27 nodes and 54 directed edges; (b) The MaxEm digraph of ; (c) The grid digraph with 64 nodes and 144 directed edges; (d) The MaxEm digraph of ; (e) A digraph with 77 nodes and 196 directed edges; (f) The MaxEm digraph of .
Figure 4.
The MaxEm digraphs of three digraphs , , and . (a) A king digraph with 100 vertices and 342 directed edges ; (b) The MaxEm digraph of ; (c) A grid digraph with 144 nodes and 264 edges; (d) The MaxEm digraph of ; (e) A wheel digraph with 51 nodes and 100 directed edges; (f) The MaxEm digraph of .
Figure 5.
The MaxEm digraphs of , , and . (a) A digraph with 50 nodes and 90 directed edges; (b) The MaxEm digraph of ; (c) A directed tree with 39 nodes and 38 directed edges; (d) The MaxEm digraph of ; (e) A directed tree with 42 nodes and 41 directed edges; (f) The MaxEm digraph of .
Figure 6.
The MaxEm digraphs of three digraphs , , and . (a) A digraph with 22 nodes and 37 directed edges; (b) The MaxEm digraph of ; (c) A digraph with 53 nodes and 80 directed edges; (d) The MaxEm digraph of ; (e) A graph with 49 nodes and 78 directed edges; (f) The MaxEm digraph of .
Figure 7.
The MaxEm digraphs of three digraphs , , and . (a) The Doyle digraph with 27 nodes and 54 directed edges; (b) The MaxEm digraph of ; (c) The Clebsch digraph with 16 nodes and 40 directed edges; (d) The MaxEm digraph of ; (e) The 4-hypercube digraph with 16 nodes and 32 directed edges; (f) The MaxEm digraph of .
Figure 8.
The MaxEm digraphs of three digraphs , , and . (a) The coxeter digraph with 28 nodes and 42 directed edges; (b) The MaxEm digraph of ; (c) The Dyck digraph with 32 vertices and 48 directed edges; (d) The MaxEm digraph of ; (e) A Shrikhande digraph with 16 vertices and 48 directed edges; (f) The MaxEm digraph of .
Figure 9.
The MaxEm digraphs of three digraphs , , and . (a) The 6th order cube-connected cycle digraph with 24 vertices and 36 directed edges; (b) The MaxEm digraph of ; (c) A triangle-replaced digraph with 30 nodes and 45 directed edges; (d) The MaxEm digraph of ; (e) The Thomassen digraph with 34 vertices and 52 directed edges; (f) The MaxEm digraph of .
Figure 10.
The MaxEm digraphs of three digraphs , , and . (a) The musical digraph with 24 nodes and 60 directed edges; (b) The MaxEm digraph of ; (c) The 12-crossed prism digraph with 24 nodes and 36 directed edges; (d) The MaxEm digraph of ; (e) The Icosidodecahedral digraph with 30 nodes and 60 directed edges; (f) The MaxEm digraph of .
Figure 11.
The MaxEm digraphs of three digraphs , , and . (a) The 7-antiprism digraph with 14 vertices and 28 edges; (b) The MaxEm digraph of ; (c) A fullerene digraph with 24 vertices and 36 directed edges; (d) The MaxEm digraph of ; (e) The great rhombicuboctahedron digraph with 48 vertices and 72 directed edges; (f) The MaxEm digraph of .
Figure 12.
The MaxEm digraphs of three digraphs , , and . (a) A Hamiltonian digraph with 20 nodes and 30 directed edges; (b) The MaxEm digraph of ; (c) The Folkman digraph with 20 nodes and 40 directed edges; (d) The MaxEm digraph of ; (e) The snark digraph with 20 vertices and 30 directed edges; (f) The MaxEm digraph of .
Figure 13.
The MaxEm digraphs of three digraphs , , and . (a) The complete bipartite digraph with 10 nodes and 25 directed edges; (b) The MaxEm digraph of ; (c) The triangular digraph with 10 nodes and 30 directed edges; (d) The MaxEm digraph of ; (e) A generalized quadrangle digraph with 15 nodes and 45 directed edges; (f) The MaxEm digraph of .
Figure 14.
The MaxEm digraphs of three digraphs , , and . (a) The 6-Andrásfai digraph with 17 nodes and 51 directed edges; (b) The MaxEm digraph of ; (c) The 4-dimensional Keller digraph with 16 nodes and 46 directed edges; (d) The MaxEm digraph of ; (e) The knight digraph with 36 vertices and 80 directed edges; (f) The MaxEm digraph of .
Figure 15.
The MaxEm digraphs of three digraphs , , and . (a) The Loupekine snarks digraph with 22 nodes and 33 directed edges; (b) The MaxEm digraph of ; (c) The Errera digraph with 17 nodes and 45 directed edges; (d) The MaxEm digraph of ; (e) The Sierpinski sieve digraph with 42 nodes and 72 directed edges; (f) The MaxEm digraph of .
Figure 16.
The MaxEm digraphs of three digraphs , , and . (a) The Grinberg digraph with 44 nodes and 67 directed edges; (b) The MaxEm digraph of ; (c) A digraph with 38 nodes and 57 directed edges; (d) The MaxEm digraph of ; (e) The Grinberg digraph with 42 vertices and 63 directed edges; (f) The MaxEm digraph of .
Figure 17.
The MaxEm digraphs of three digraphs , , and . (a) A pentagonal icositetrahedral digraph with 38 nodes and 60 directed edges; (b) The MaxEm digraph of ; (c) The Faulkner-Younger digraph with 42 vertices and 62 directed edges; (d) The MaxEm digraph of ; (e) The Faulkner-Younger digraph with 44 nodes and 65 directed edges; (f) The MaxEm digraph of .
Figure 18.
The MaxEm digraphs of three digraphs , , and . (a) The Celmins Swart snarks digraph with 26 vertices and 39 directed edges; (b) The MaxEm digraph of ; (c) The truncated octahedron digraph with 24 nodes and 36 directed edges; (d) The MaxEm digraph of ; (e) The Nauru digraph with 24 nodes and 36 directed edges; (f) The MaxEm digraph of .
Figure 19.
The MaxEm digraphs of three digraphs , , and . (a) The Wiener-Araya digraph with 42 nodes and 67 directed edges; (b) The MaxEm digraph of ; (c) The Zamfirescu digraph with 48 nodes and 76 directed edges; (d) The MaxEm digraph of ; (e) The Folkman digraph with 20 nodes and 40 directed edges; (f) The MaxEm digraph of .
Figure 20.
The MaxEm digraphs of three digraphs , , and . (a) The 24-cell digraph with 24 nodes and 94 directed edges; (b) The MaxEm digraph of ; (c) A disconnected graph with 12 nodes and 12 directed edges; (d) The MaxEm digraph of ; (e) A disconnected digraph that has four connected components and a total of 100 nodes and 160 directed edges; (f) The MaxEm> digraph of .
Figure 21.
The MaxEm digraphs of three digraphs , , and . (a) The projective plane digraph with 26 nodes and 52 directed edges; (b) The MaxEm digraph of ; (c) The Miyazaki digraph with 40 nodes and 60 directed edges; (d) The MaxEm digraph of ; (e) The Cubic Hypohamiltonian digraph with 44 nodes and 75 directed edges; (f) The MaxEm digraph of .
5. Software Implementation
Applying the principles described in the preceding sections, we have developed a set of software tools called GraphLabel 1.0 for computing canonical labelings of Digraphs. Our development environment includes an Intel(R) Core(TM)2 Quad CPU Q6600 @2.40GHz with 4.00 GB of RAM. The operating system is Microsoft Windows 8.1 Professional Edition. The graphics card is an NVIDIA GeForce 9800 GT. The display resolution is 1024 × 768 × 32 bits (RGB). The internal hard drive is 500 GB. The programming environment is the Microsoft Visual C++ 2012.
The software adopts object-oriented technology to design several relevant classes including the classes CNode, CNodeNeighbor, CEdge, CEdgeNeighbor, CGraph, and so on. A detailed description of the software functions is outside the scope of this article. We will explain it in another paper. All the figures presented in this paper are produced by using our software system.
We selected a digraph set to test the accuracy of our algorithms. Using our own software platform, we randomly produced a large number of digraphs as the test cases, including Figure 3e, Figure 5c,e and Figure 6. To increase the breadth and depth of our testing, we also select many test cases from the library of benchmarks [29] and online library [30] includings Figure 3a,c, Figure 4, Figure 5a and 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 and Figure 21.
We apply our algorithms to as many types of digraphs as possible. These digraphs shown in the article are just a small part of tested digraphs due to the limited length of the article. Each digraph displayed in the paper includes both the original digraph and the resulting digraph to compare entirely.
6. Conclusions and Future Work
In summary, we obtain the following conclusions: By Theorems 2–12, the paper has established a relatively complete theoretical system for calculating the MaxEm digraphs of digraphs. Algorithms 1–4 are novel and can accurately calculate MaxEm digraphs for many types of digraphs (see Figure 3, Figure 4, Figure 5, 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 and Figure 21). Algorithms 1–4 are also available for simple disconnected digraphs. For each node in a digraph G, the introduction of the attribute m_NearestNode improves the accuracy of calculating canonical labeling. Through software testing, the correctness of our algorithms is preliminarily verified. Our method can be utilized to mine the frequent subdigraph. Besides, it offers Conjecture 1.
Of course, there are still many places we need to improve, including to prove the conjectures proposed by us, enhance our software system, and use more test cases to test our procedures. In particular, we need to strengthen our algorithms so that it can calculate the canonical labeling for more types of digraphs. In future studies, we will extend our approach to mine the frequent subdigraphs and calculate the canonical labelings of weighted graphs and digraphs.
Acknowledgments
The work described in this paper was supported by Key Project of the National Natural Science Foundation of China (No. 91318301), National Natural Science Foundation of China (No. 61202080), China Postdoctoral Science Foundation (No. 2015M581032).
Author Contributions
Jianqiang Hao and Yunzhan Gong wrote the paper; Jianqiang Hao, Yawen Wang, Li Tan and Jianzhi Sun developed the software; All authors conceived and designed the experiments; Jianqiang Hao, Li Tan, and Jianzhi Sun performed the experiments; Jianqiang Hao, Yawen Wang, and Li Tan analyzed the data. All authors have read and approved the final manuscript.
Conflicts of Interest
The authors declare no conflict of interest.
References
- McKay, B. Computing automorphisms and canonical labellings of graphs. In Combinatorial Mathematics; Lecture Notes in Mathematics; Springer: Berlin/Heidelberg, Germany, 1978; Volume 686, pp. 223–232. [Google Scholar]
- Piperno, A. Search space contraction in canonical labeling of graphs. arXiv 2008. [Google Scholar]
- 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]
- Babai, L.; Luks, E.M. Canonical Labeling of Graphs. In Proceedings of the Fifteenth Annual ACM Symposium on Theory of Computing; ACM: New York, NY, USA, 1983; pp. 171–183. [Google Scholar]
- Ivanciuc, O. Canonical Numbering and Constitutional Symmetry. In Handbook of Chemoinformatics; Wiley-VCH Verlag GmbH: Weinheim, Germany, 2008; pp. 139–160. [Google Scholar]
- Shah, Y.J.; Davida, G.I.; McCarthy, M.K. Optimum Featurs and Graph Isomorphism. IEEE Trans. Syst. Man Cybern. 1974, 3, 313–319. [Google Scholar]
- 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]
- Huan, J.; Wang, W.; Prins, J. Efficient Mining of Frequent Subgraphs in the Presence of Isomorphism; IEEE Computer Society: Washington, DC, USA, 2003; pp. 549–552. [Google Scholar]
- Kuramochi, M.; Karypis, G. Finding Frequent Patterns in a Large Sparse Graph. Data Min. Knowl. Discov. 2005, 11, 243–271. [Google Scholar]
- Kuramochi, M.; Karypis, G. An efficient algorithm for discovering frequent subgraphs. IEEE Trans. Knowl. Data Eng. 2004, 16, 1038–1051. [Google Scholar]
- 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]
- 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]
- 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.
- Arnborg, S.; Proskurowski, A. Canonical Representations of Partial 2- and 3-Trees. In Proceedings of the 2nd Scandinavian Workshop on Algorithm Theory; Springer: Berlin/Heidelberg, Germany, 1990; Volume 477, pp. 197–214. [Google Scholar]
- 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–263. [Google Scholar]
- McKay, B.D. Practical Graph Isomorphism. Congr. Numer. 1981, 30, 45–87. [Google Scholar]
- McKay, B.D. Isomorph-Free Exhaustive Generation. J. Algorithms 1998, 26, 306–324. [Google Scholar]
- McKay, B.D.; Piperno, A. Practical graph isomorphism, II. J. Symb. Comput. 2014, 60, 94–112. [Google Scholar]
- Ullmann, J.R. An Algorithm for Subgraph Isomorphism. J. ACM 1976, 23, 31–42. [Google Scholar]
- 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.
- Miyazaki, T. The complexity of McKay’s canonical labeling algorithm. In Groups and Computation II; American Mathematical Society: Providence, RI, USA, 1997; Volume 28, pp. 239–256. [Google Scholar]
- Tener, G.; Deo, N. Efficient isomorphism of miyazaki graphs. Algorithms 2008, 5, 7. [Google Scholar]
- Junttila, T.; Kaski, P. Conflict Propagation and Component Recursion for Canonical Labeling. In 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]
- López-Presa, J.L.; Anta, A.F.; Chiroque, L.N. Conauto-2.0: Fast Isomorphism Testing and Automorphism Group Computation. arXiv 2011. [Google Scholar]
- Katebi, H.; Sakallah, K.; Markov, I. Graph Symmetry Detection and Canonical Labeling: Differences and Synergies. In Proceedings Turing-100; EPIC: Manchester, UK, 2012; Volume 10, pp. 181–195. [Google Scholar]
- Bang-Jensen, J.; Gutin, G.Z. Digraphs: Theory, Algorithms and Applications, 2nd ed.; Springer: Berlin/Heidelberg, Germany, 2008. [Google Scholar]
- Bollobás, B. Modern Graph Theory; Springer: Berlin/Heidelberg, Germany, 2013; Volume 184. [Google Scholar]
- Chartrand, G.; Tian, S. Distance in digraphs. Comput. Math. Appl. 1997, 34, 15–23. [Google Scholar]
- ALENEX 2007 Submission: Source Code, Benchmark Instances, and Summary Results. Available online: http://www.tcs.hut.fi/Software/benchmarks/ALENEX-2007/ (accessed on 17 February 2017).
- Weisstein, E.W. Simple Directed Graph. From MathWorld—A Wolfram Web Resource. Available online: http://mathworld.wolfram.com/SimpleDirectedGraph.html (accessed on 18 February 2017).
© 2017 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license ( http://creativecommons.org/licenses/by/4.0/).



