Pattern Vectors from the Ihara Zeta Function Peng Ren Richard C. Wilson and Edwin R. Hancock Department of Computer Science, The University of York, York, YO10 5DD, UK {pengren, wilson, erh}@cs.york.ac.uk Abstract This paper shows how to construct pattern vectors from the Ihara zeta function for the purposes of characterizing graph structures. To avoid the risk of sampling the meaningless infinities at the poles of the Ihara zeta function, we take use of the coefficients of the polynomial of the reciprocal zeta function. The proposed pattern vector is proved to be permutation invariant to the node order of the associated graph. Its components can be computed from a characteristic polynomial derived from the original graph. We apply the proposed scheme to graph clustering.
1. Introduction Graph-based methods have played an important role in computer vision and pattern recognition. Although graphs have the powerful capability to represent relational patterns, they are not as easily manipulated as pattern vectors. This is because there is no canonical ordering of the nodes of a graph. For this reason, much research has been devoted to the node correspondence problem and pattern matching. Instead of the computationally expensive process of searching for the node correspondences, one alternative method is to characterize graphs using pattern vectors that are permutation invariants. Luo, Wilson and Hancock showed how to use the Laplacian spectrum as a permutation invariant to cluster graphs[9]. In subsequent work, the same authors showed how to extract a rich family of permutation invariants from a graph by applying symmetric polynomials to the elements of the spectral matrix[12]. Developing this work, Bai and Hancock explored how to compute permutation invariants from the Rosenberg zeta function[1]. However, these methods show the common shortcoming of failing to distinguish cospectral graphs. Work in combinatorial mathematics has shown that the Ihara zeta function is more effective in distinguishing the cospectral graphs
978-1-4244-2175-6/08/$25.00 ©2008 IEEE
than the above mentioned methods[10], [11]. Thus the Ihara zeta function appears to be a promising tool to characterize graphs in a permutation invariant manner. The Ihara zeta function was first detailed in [6] and [7]. Hashimoto subsequently deduced explicit factorizations for bi-regular bipartite graphs[5]. Bass has generalized Hashimoto’s factorization to all finite graphs[2]. Recently, Storm have further developed and defined the Ihara zeta function on hypergraphs[11]. Although the properties of the Ihara zeta function have been widely investigated, it has rarely been explored as a means of characterizing graphs in a permutation invariant manner. However, to be rendered tractable for real world problems the issue of how to avoid sampling the infinities at poles and how to generate stable feature vectors from the Ihara zeta function must be addressed. The aim of this paper is to address these two issues.
2. The Ihara Zeta Function The Ihara zeta function of a graph can be denoted in the form of a rational function[2]: χ(G) −1 det I − uA + u2 Q ZG (u) = 1 − u2
(1)
Here, χ(G)is the Euler Number of the graph, which is defined as the difference between the vertex number |V (G)| and the edge number |E(G)| of the graph, i.e. χ(G) = |V (G)| − |E(G)|, and A is the adjacency matrix of the graph. The degree matrix D can be generated by placing the column sums as the diagonal elements, while setting the off-diagonal elements zeros. Finally, Q is the difference of the degree matrix D and the identity matrix I, i.e. Q = D − I.
3. Permutation Invariant The topology of a graph is invariant under permutations of the node labels. However, the adjacency matrix and the Laplacian matrix of isomorphic graphs might
vary due to the different node orders between the individual graphs. Suppose A and Ap are the adjacency matrices associated with isomorphic graphs G(V, E) and GP (V, E) respectively. Let P be the permutation matrix representing the changes in node order between G(V, E) and GP (V, E). The permutation relationship between the two adjacency matrices is Ap = PAPT . The Ihara zeta function of Gp can be denoted as: χ(G) −1 det I − uAp + u2 Qp ZGp (u) = 1 − u2 χ(G) −1 = 1 − u2 det I − uPAPT + u2 PQPT (2)
reciprocal of the Ihara zeta function can be rewritten as: −1 ZG (u) = det(I − uT) 1 I−T = (u)2m det u 2m 2m−1 1 1 = u2m [c0 + c1 + ··· u u 1 + c2m ] + c2m−1 u
= c0 + c1 u + · · · + c2m−1 u2m−1 + c2m u2m (5)
From (5), the coefficients of the reciprocal of the Ihara zeta function can be derived from the coefficients of the characteristic polynomial of the matrix T. The calculation of the above coefficients can be converted to a T T −1summation of a series of determinants[3]: T 2 χ(G) 2 det PIP − uPAP + u PQP ZGp (u) = 1 − u −1 2 χ(G) b1,1 b1,2 · · · b1,2m = 1−u det P I − uA + u2 Q PT b2,1 χ(G) −1 b2,2 · · · b2,2m ck = (6) = 1 − u2 det I − uA + u2 Q ··· ··· ··· · · · 2m (2m−k) b2m,1 b2m,2 · · · b2m,2m = ZG (u) (3) A permutation matrix is an orthogonal matrix. Hence, (2) can be rewritten as:
The Ihara zeta functions of G and Gp appearing in (2) and (3) have the same form and this proves that it is invariant to permutation of node order. As a result, the equivalent representations of the Ihara zeta function, such as its derivatives or the coefficients of the polynomial of its reciprocal, are also invariant to node order permutation.
4. Polynomial Expression For md2 graphs, i.e. the graphs with vertex degree at least 2, it is clear-cut that (1) can be rewritten in the form of the reciprocal of a polynomial. However, it is difficult to compute the coefficients of the reciprocal of the Ihara zeta function from (1) in a uniform way, except by resorting to software for symbolic calculation. To efficiently compute these coefficients, it is more convenient to transform the form of the Ihara zeta function in (1) into a concise expression. The Ihara zeta function can also be written in the form of determinant expression[8] ZG (u) =
1 det(I − uT)
(4)
where T is the Perron-Frobenius Operator on the oriented line graph of the original graph, and is an 2m × 2m square matrix with dimensionality m the number of the edges of the original graph. According to (4), the
2m determinants in the sum. The There are in total 2m−k relevant matrix in each determinant is created by replacing (2m − k) of the 2m diagonal elements of the matrix T with -1 and the remaining elements in those corresponding rows and columns with 0.
5. Pattern Vectors To establish pattern vectors from the Ihara zeta function for the purposes of machine learning, it is natural to consider taking function samples as the elements. Although the function values at most of the sampling points will perform well in distinguishing graphs, there is the possibility of sampling at poles giving rise to meaningless infinities. Hence, the pattern vectors consisting of function samples are potentially unstable representations of graphs, since the distribution of poles is unknown beforehand. On the other hand, the coefficients of the reciprocal of the Ihara zeta function do not give rise to infinities. These coefficients are essentially descriptors of graph structures. As long as G is a simple graph, a) the coefficients c3 , c4 , and c5 are respectively the negative of twice the number of triangles, squares, and pentagons in G, b) c6 is the negative of twice the number of hexagons in G plus 4 times the number of pairs of edge disjoint triangles plus twice the number of pairs of triangles with a common edge, and c) c7 is the negative of twice the number of heptagons in G plus 4 times the number of
edge disjoint pairs of one triangle and one square plus twice the number of pairs of one triangle and one square that share a common edge[10]. The highest order coefficient is associated with the degree d(vi ), which is the number of edges incident to vertex vi :
(d(vi ) − 1) (7) c2m = (−1)χ(G) vi ∈V
The set of coefficients can play the role of pattern vectors for clustering, not only because of their immunity to the distribution of the poles, but also due to their ability to characterize the graph structures.
6. Experiment 6.1. Synthetic Graphs The Ihara zeta function is superior to the Laplacian spectrum in distinguishing md2 graphs, as we can take the cospectral synthetic graphs in [4] as an example. Figure 1(a) shows two graphs that are not isomorphic, but which share a common Laplacian spectrum, and are hence cospectral. The real-valued poles associated with their Ihara zeta functions are shown in Table1, and this indicates that the Ihara zeta functions are distinct. Additionally, the two Ihara zeta functions have a number of different imaginary poles. There are many instances of non-isomorphic md2 graphs sharing the same adjacency matrix spectrum or the same Laplacian spectrum yet having different Ihara zeta functions. However, there are no known examples of md2 graphs with the same Ihara zeta function but different operator spectra.
6.2. Visual Clustering We apply the proposed pattern vector to two graph datasets used previously in the work of Bai and Hancock. One set of graphs are extracted from images of three objects in COIL database (Figure 1(b)) and the other group are extracted from house images in the CMU, MOVI and chalet sequences (Figure 1(c)) separately. We first extract feature points by using Harris detector. Then we establish Delaunay graphs based on these feature points as nodes. We compute the coefficients of the reciprocal of the Ihara zeta function using (6) and (7), generating the feature vector in the form of vG = [c3 c4 c5 c6 c7 ln(|c2m |)] . The last component of the feature vector is manipulated in a logarithmic way for the purpose of avoiding the high order oscillations. Finally, we perform PCA on the features vectors to embed them into a 3-dimensional space. Figure 2(a) illustrates the coefficient c3 and c4 of the three objects in the
COIL database. The three dot lines represent the coefficient c3 of the three objects separately, while the three bold lines c4 of the three objects. The corresponding coefficients of different objects are well separated thus indicating that the objects are well clustered. Figure 2(c) and 2(d) indicates the clustering results of the three objects in COIL database and the three kinds of houses in house sequences by using the proposed pattern vector respectively, in which we can see the objects belonging to different categories are well separated into different clusters. Table 2 indicates the Rand indices of different methods by using feature vectors generated from (a) to (g), which are the Laplacian spectrum from the second smallest eigenvalue to the seventh, the Rosenberg zeta function sampling at from 1 to 6 with the interval 1, vG , the Ihara zeta function sampling at from 0.001 to 0.006 with the interval 0.001, the Ihara zeta function sampling at from 0.01 to 0.06 with the interval 0.01, the Ihara zeta function sampling at from 0.11 to 0.16 with the interval 0.01 and the Ihara zeta function sampling at from 0.1 to 0.6 with interval 0.1, for clustering. The clusters are located by using K-means method. In Table 2 we can see the proposed method outperforms the Rosenberg zeta function while it is comparative with the Laplacian spectrum method. However, as analyzed in the preceding subsection, when cospectral graphs exist, the proposed method will be more effective in distinguishing graphs than the Laplacian spectrum. The last three columns in Table 2 indicate the performance of pattern vectors composed of the Ihara zeta function sample values. We can see that if the samples are appropriately chosen, these pattern vectors can perform as well as the pattern vectors composed of the coefficients, but once the function has not been properly sampled, their performance of clustering deteriorates. This phenomenon can be explained by the diverse distribution of relevant poles. If the function value happens to be sampled at poles or near poles, it will approach infinity and thus rarely represents anything meaningful. The polynomial coefficients of the reciprocal of the Ihara zeta function, however, are fixed with the function generated from the associated graph. These coefficients are thus irrelevant to the variation of function samples. Therefore, the risk of sampling at poles can be avoided by using pattern vectors composed of the coefficients. Figure 2(b) indicates the experimental results of Rand Indices at different numbers of coefficients taken as feature components. In this experiment the best clustering performance can be achieved when using [c3 c4 ] as the feature vector. This is because despite the additional information provided by the rest of the coefficients besides c3 and c4 , their structural significance is essentially related to the amount of the triangles and squares
in the graph, which can be fully represented by c3 and c4 . The coefficients besides c3 and c4 of a simple graph thus provide some redundant information to some degree. (a) Synthetic Graphs
7. Conclusion In this paper, we address some issue on developing and analyzing pattern vectors from the Ihara zeta function. We take the coefficients of the reciprocal of the Ihara zeta function as components of pattern vectors. The proposed scheme is superior to the Laplacian spectrum in the cospectral situation while is more stable than the pattern vectors composed of the Ihara zeta function samples in clustering graphs.
(b) COIL Datasets
References
(c) House Sequences
Figure 1. Datasets for Experiments 0
1.1
−100
1
−200
0.9
−300 0.8
Rand Index
−400
−500
0.7
0.6
−600 0.5 −700
−900
−1000
0.4
c3 of Object 1 c3 of Object 2 c3 of Object 3 c4 of Object 1 c4 of Object 2 c4 of Object 3
−800
0
10
20
30 40 50 Number of Views of One Object
60
70
0.3 COIL House 0.2
80
0
1
2
(a)
6
7
(b)
COIL Datasets
House Sequences
0
−200 Object 1 Object 2 Object 3
−200
Object 1 Object 2 Object 3
−300 Third Eigenvector
Third Eigenvector
3 4 5 Number of Coefficients Used in Pattern Vectors
−400
−600
−400 −500 −600 −700
−800 4000
−800 4000 2000
6 0
5
2000
4
4 −2000
Second Eigenvector
0
(c)
x 10 First Eigenvector
3
0
5
2 −4000
Second Eigenvector
2 −2000
1 0
5
x 10
First Eigenvector
(d)
Figure 2. Performances of Clustering
Table 1. Real-valued Poles Graph Real-valued Poles Left One 1 , 0.6165 Right One 1 , 0.6512
Table 2. Rand Indices (a) (b) (c) (d) (e) (f) (g) House 0.82 0.71 0.83 0.73 0.73 0.83 0.40 COlL 0.99 0.84 0.98 0.79 0.79 0.80 0.66
[1] X. Bai and E. R. Hancock. Recent results on heat kernel embedding of graphs. Proceedings of 5th Graph-Based Representations in Pattern Recognition, 3434:373–382, 2005. [2] H. Bass. The ihara-selberg zeta function of a tree lattice. International Journal of Mathematics, 6(3):717– 797, 1992. [3] B. P. Brooks. The coefficients of the characteristic polynomial in terms of the eigenvalues and the elements of an n×n matrix. Applied Mathematics letters, 19(6):511–515, 2006. [4] W. H. Haemers and E. Spence. Enumeration of cospectral graphs. European Journal of Combinatorics, 25(2):199–211, 2004. [5] K. Hashimoto. Zeta functions of finite graphs and representations of p-adic groups. Advanced Study of Pure Mathematics, 15:211–280, 1989. [6] Y. Ihara. Discrete subgroups of pl(2, kϕ ). Proceeding Symposium of Pure Mathematics, pages 272–278, 1965. [7] Y. Ihara. On discrete subgroups of the two by two projective linear group over p-adic fields. Journal of Mathematics Society Japan, 18:219–235, 1966. [8] M. Kotani and T. Sunada. Zeta functions of finite graphs. Journal of Mathematics University of Tokyo, 7(1):7–25, 2000. [9] B. Luo, R. C. Wilson, and E. Hancock. Spectral embedding of graphs. Pattern Recognition, 36(10):2213– 2223, 2003. [10] G. Scott and C. K. Storm. The coefficients of the ihara zeta function. Involve - A Journal of Mathematics, 1(2):217–233, 2008. [11] C. K. Storm. The zeta function of a hypergraph. Electronic Journal of Combinatorics, 13(1), 2006. [12] R. Wilson, B. Luo, and E.R.Hancock. Pattern vectors from algebraic graph theory. IEEE Transactions on Pattern Analysis and Machine Intelligence, 27(7):1112– 1124, 2005.