2.4 ***Graphs and matrices : A little peek***

We shall now give a brief hint about utility of matrices and linear algebra in answering graph-theoretic questions.

Definition 2.36 (Adjacency matrix.).

Let G be a graph on n vertices. For simplicity, assume V=[n]. The adjacency matrix A:=A⁢(G):=(A⁢(i,j))1≤i,j≤n of a simple finite graph is defined as follows : A⁢(i,j)=𝟏⁢[i∼j]. The definition can be appropriately extended for multi-graphs.

A is a symmetric matrix and hence has real eigenvalues. Define length of a walk/path P as the number of edges in the path P. We denote it by l⁢(P).

Lemma 2.37.

Let G be a graph on n vertices and A be its adjaceny matrix. Then Al⁢(i,j) is the number of walks of length l from i to j.

Proof.

By definition, Al⁢(i,j)=∑i1,…,il−1A⁢(i,i1)⁢A⁢(i1,i2)⁢…⁢A⁢(il−1,j) and since A is a 0−1 valued matrix, we get that A⁢(i,i1)⁢A⁢(i1,i2)⁢…⁢A⁢(il−1,j)∈{0,1}. The proof is complete by noting that A⁢(i,i1)⁢A⁢(i1,i2)⁢…⁢A⁢(il−1,j)=1 if i∼i1∼i2⁢…⁢il−1∼j i.e., i⁢i1⁢…⁢il−1⁢j is a walk of length l. ∎

Exercise(A) 2.38.

Let λ1,…,λn be the eigenvalues of A. Show that the number of closed walks of length l in G is ∑i=1nλil. Here, we count the walk v1,…,vl−1,v1 and v2,…,vl−1,v1,v2 as distinct walks.

Exercise(A) 2.39.

Count the number of closed walks of length l in the complete graph Kn.

The distance between two vertices is defined as d⁢(u,v)=inf{l⁢(P):P is a path from u to v}. We set d⁢(u,u)=0 and d⁢(u,v)=∞ if there is no path from u to v. One can show that d defines a metric on a connected graph (see Section 2.5).

Lemma 2.40.

Let G be a connected graph on vertex set [n]. If d⁢(i,j)=m, then I,A,…,Am are linearly independent.

Proof.

Assume i≠j. Since there is no path from i to j of length less than m, Ak⁢(i,j)=0 for all k<m (show this claim) and Am⁢(i,j)>0. Thus, if I,A,…,Am are linearly dependent with coefficients c0,…,cm, then by the above observation and positivity of entries of Ak for all k, we have that cm=0 i.e.,I,A,…,Am−1 are linearly dependent. Since d⁢(i,j)=m, there exists j′ such that d⁢(i,j′)=m−1 (show this claim). Now applying the above argument recursively, we get that c0=c1=…=cm=0. ∎

Define diam⁡(G)=max⁡{d⁢(u,v):u,v∈V}.

Corollary 2.41.

Let G be a connected graph with k distinct eigenvalues. Then k>diam⁡(G).

Proof.

Let d=diam⁡(G). Recall that the minimal polynomial of a matrix A is the monic polynomial Q of least degree such that Q⁢(A)=0. By Lemma 2.40, we have that deg⁡(Q)>d. The proof is complete by observing that the number of distinct eigenvalues of A is deg⁡(Q) as A is symmetric. ∎

Exercise* 2.42.

How would you define A for multi-graphs or weighted graphs ? Which of the above results hold in such cases ?