0% found this document useful (0 votes)
1K views

Matrixrepmat

The document discusses different matrix representations of graphs: 1. The incidence matrix represents the connections between vertices and edges with 1s and 0s. It can be used to fully represent a graph. 2. Submatrices of the incidence matrix correspond to subgraphs, with nonsingular (n-1)x(n-1) submatrices representing spanning trees. 3. The circuit matrix represents the edges contained in different circuits of the graph with 1s and 0s.

Uploaded by

smusala7970
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Matrixrepmat

The document discusses different matrix representations of graphs: 1. The incidence matrix represents the connections between vertices and edges with 1s and 0s. It can be used to fully represent a graph. 2. Submatrices of the incidence matrix correspond to subgraphs, with nonsingular (n-1)x(n-1) submatrices representing spanning trees. 3. The circuit matrix represents the edges contained in different circuits of the graph with 1s and 0s.

Uploaded by

smusala7970
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

MATRIX REPRESENTATION OF GRAPHS

Although a pictorial representatIon of a graph IS very convenient for a



visual study, other representations are better for computer processing. A matrix is a convenient and useful way of representing a graph to a computer.

Matnces lend themselves easIly to mechamcal mampulatIons. BesIdes, many known results of matrix algebra can be readily applied to study the structural

properties of graphs from an algebraic point of view. In many applications of graph theory, such as in electrical network analysis and operations re-

search, matrices also turn out to be the natural way of expressing the problem.

In this chapter we shall consider two most frequently used matrix repre-

sentations of a graph. Also a correspondence between some graph-theoretic properties and matrix properties will be established. In view of the close tie between matrices and vector spaces, this chapter should, in fact, be looked

upon as a continuation of Chapter 6. A rudimentary knowledge of matrix

algebra is assumed.

7-1. INCIDENCE MATRIX

Let G be a graph with n vertices, e edges, and no self loops. Define an n

by e matrix A = [au], whose n rows correspond to the n vertices and the e

columns correspond to the e edges, as follows:

The matrix element

0,

if jth edge e j is incident on ith vertex Vi' and otherwise.

137

138

MATRIX REPRESENTATION OF GRAPHS

CHAP. 7

V3\
\ n ~V6
\ /J
\ to / u
, L <, V4
j ~ ('
-. d

(a)

r-r- -
" " " " 1 f\ f\
VI v v v . v ~ ~
~ 0 0 0 0 1 1 1 1

v3 U U U U U U U I
v4 1 1 1 0 1 0 0 0
v. 0 0 1 1 0 0 1 0
v6 1 1 0 0 0 0 0 0
'-- - (b)

Fig. 7-1 Graph and its incidence matrix.

Such a matrix A is called the vertex-edge incidence matrix, or simply incidence matrix. Matrix A for a graph G is sometimes also written as A(G). A graph

and its incidence matrix are shown in Fig. 7-1.

The incidence matrix contains only two elements, 0 and 1. Such a matrix

is called a binary matrix or a (0, I)-matrix. Let us stipulate that these two

elements are from Galois field modulo 2.t Given any geometric representa-

tion of a graph without self-loops, we can readily write its incidence matrix.

tAlthough matrices are customarily deftned over a commutative ring with identity,

which need not be a fteld (such as the ring of integers), we have deftned matrix A over a field, GF(2), in keeping with our definition of the vector space Wa in Chapter 6.

SEC. 7-1

INCIDENCE MATRIX

139

On the other hand, if we are given an incidence matrix A(G), we can construct its geometric graph G without ambiguity. The incidence matrix and the

geometric graph contain the same informationl-they are simply two alternative ways of representing the same (abstract) graph.

The following observations about the incidence matrix A can readily be

made:

1. Since every edge is incident on exactly two vertices, each column of A has exactly two l's.

2. The number of 1 's in each row equals the degree of the corresponding

3. A row with all O's, therefore, represents an isolated vertex.

4. Parallel edges in a graph produce identical columns in its incidence

matrix, for example, columns 1 and 2 in Fig. 7-1.

5. If a graph G is disconnected and consists of two components g I and

s-. the Incidence matrix ACG) of graph G can be written In a block-

diagonal form as

(7-1)

where A(g I) and A(g 2) are the incidence matrices of components g 1 and g2' This observation results from the fact that no edge in g 1 is

incident on vertices of g2' and vice versa. Obviously, this remark is also true for a disconnected graph with any number of components.

6. Permutation of any two rows or columns in an incidence matrix simply corresponds to relabeling the vertices and edges of the same graph.

This observation leads us to Theorem 7-1.

THEOREM 7-1

Two graphs G1 and G2 are isomorphic if and only if their incidence matrices

A(G1) and A(G2) differ only by permutations of rows and columns.

Rank tf'tht: Incidence .Matrtx: Each row in an incidence matrix A(G) may

be regarded as a vector over GF(2) in the vector space of graph C. Let the

[Just as in any two alternative methods of representation, some properties are more evident in one representation than in the other. For example, the fact that the gt aph is

planar is obvious in Fig. 7-1 (a), whereas it is not at all obvious from the matrix in Fig. 7-1(b).

140

MATRIX REPRESENTATION OF GRAPHS

CHAP. 7

vector in the first row be called AI' in the second row A2, and so on. Thus

r-' -
Al
11
."
A(G) = , (7-2)
A
L n- Since there are exactly two I's in every column of A, the sum of all these vectors is 0 (this being a modulo 2 sum of the corresponding entries). Thus

vectors AI, A2, ••• , An are not linearly independent. Therefore, the rank of A is less than n; that is, rank A < n - I.

Now consider the sum of any m of these n vectors (m < n - I). If the graph is connected, A(G) cannot be partitioned, as in Eq. (7-1), such that

A(g I) is with m lOWS and A(g2) with n . m lOWS. III otheI words, no m by m

submatrix of A(G) can be found, for m < n - I, such that the modulo 2 sum

of those m rows is equal to zero

Since there are only two constants 0 and I in this field, the additions of all

vectors taken m at a time for m = I, 2, ... , n - I exhausts all possIble Imear

combinations of n - 1 row vectors. Thus we have just shown that no linear combination of Nt row vectors of A (for m < 11 I) can be equal to zero.

Therefore, the rank of A(G) must be at least n - 1.

Since the rank of A(G) is no more than n - 1 and is no less than n - 1, it

must be exactly equal to n - 1. Hence Theorem 7-2.

THEOREM 7-2

If A(G) is an incidence matrix of a connected graph G with n vertices, the rank

of A(G) is n - l.

The aI gument leadiIIg to TheOI em 7-2 can be extended to pI ave that the

rank of A(G) is n - k, if G is a disconnected graph with n vertices and k com-

ponents (Problem 7-3) This is the reason why the number n - k has been

called the rank of a graph with k components.

It we remove anyone row from the incidence matnx of a connected

graph, the remaining (n - 1) bye submatrix is of rank n - 1 (Theorem 7-2). In other words, the remaining 11 I row vectors are linearly independent.

Thus we need only n - 1 rows of an incidence matrix to specify the corresponding graph completely. for n - I rows contain the same amount of

information as the entire matrix. (This is obvious, since given n - I rows we can easily reconstitute the missing row, because each column in the matrix

has exactly two l 's.)

SEC. 7-2

SUB MATRICES OF A(G)

141

Such an (n - l ) by e submatrix Af of A is called a reduced incidence matrix. The vertex corresponding to the deleted row in Af is called the ref

erence vertex. Clearly, any vertex of a connected graph can be made the reference vertex.

Since a tree is a connected graph \vith n vertices and n 1 edges, its

reduced incidence matrix is a square matrix of order and rank n - l . In other

words,

The reduced incidence matrix of a tree is nonsingular.

A graph with n vertices and n - ] edges that is not a tree is disconnected.

The rank of the incidence matrix of such a graph will be less than n 1.

Therefore, the tn - I) by (n - I) reduced incidence matrix of such a graph

will not be nonsingular. I n other words, the reduced incidence matrix of a

graph is nonsingular if and only if the graph is a tree.

7 2. SUBMATRICES OF l\(G)

Let g be a subgraph of a graph G, and let A(g) and A(G) be the incidence

matrices of g and G, respectively. Clearly, A(g) is a submatrix of A(G) (possibly with rows or columns permuted). In fact, there is a one-to-one corre-

spondence between each n by k submatnx of A(G) and a subgraph of G wIth kedges, k being any positive integer less than e and n being the number of

Submatrices of A(e) corresponding to special types of subgraphs, such as circuits, spanning trees, or cut-sets in e, will undoubtedly exhibit special

properties. Theorem 7-3 gives one such property.

THEOREM 7-3

Let ACG) be an Incidence matrix of a connected graph G with n vertices. An

(n - I) by (n - 1) submatrix of A(G) is nonsingular if and only if the n - 1 edges corresponding to the n - 1 columns of this matrix constitute a spanning tree

Proof: Every square submatrix of order n - 1 in A(G) is the reduced incidence matrix of the same subgraph in G with n - 1 edges, and vice versa. From the remarks following Theorem 7 2, it is clear that a square submatrix of A(G) is

nonsingular if and only if the corresponding subgraph is a tree. The tree in this case is a spanning tree, because it contains n - 1 edges of the n-vertex graph.

Thus the theorem. •

142

MATRIX REPRESENTATION OF GRAPHS

CHAP. 7

7-3. CIRCUIT MATRIX

Let the number of different circuits in a graph G be q and the number of

edges In G be e. Then a circuit matrix B - [bi .J of G IS a q bye, (0, I )-matnx

defined as follows:

b., = I, -0,

if ith circuit includes jth edge, and otherwise.

To emphasize the fact that B is a circuit matrix of graph G, the circuit matrix

may also be written as B(G).

The graph in Fig. 7-1(a) has four different circuits, {a, b}, {c, e, g}, {d,/, g}, and fe, d,f, e}. Therefore, its circuit matrix is a 4 by 8, (0, I)-matrix as

shown:

abcde]gh

1 -1 1 () () () () () ()-
, , , ~ ~ ~ ~ ~ ~
2 0 0 I 0 I 0 1 0 (7-3)
B(G) =
" v v V 1 V 1 1 V
4 _0 0 I I I I 0 0
- The following observations can be made about a circuit matrix B(G) of

1. A column of all zeros corresponds to a noncircuit edge (i.e., an edge

that does not belong to any circUIt).

2. Each row of B(G) is a circuit vector.

3. Unlike the incidence matrix, a circuit matrix is capable of representing

a self-loop-the corresponding row will have a single I.

4. The number of I's in a row is equal to the number of edges in the

correspondmg CircUIt.

5. If graph G is separable (or disconnected) and consists of two blocks

(or components) g, and g2' the circuit matrix 8(G) can be written m

a block-diagonal form as

where B(g,) and B(g2) are the circuit matrices of g, and g2' This ob-

SEC. 7-3

CIRCUIT MATRIX

143

servation results from the fact that circuits in g, have no edges belonging to g2' and vice versa (Problem 4 14).

6. Permutation of any two rows or columns in a circuit matrix simply

corresponds to relabeling the circuits and edges.

7. Two graphs G, and G 2 will have the same circuit matrix if and only if

G, and G2 are 2-isomorphic (Theorem 4-15). In other words, (unlike an incidence matrix) the circuit matrix does not specify a graph completely. It only specifies the gl aph withilI 2-iso1l101 phism. For instance;

it can be easily verified that the two graphs in Figs. 4-11 (a) and (d) have the same circuit matrix, yet the graphs are not isomorphic

An important theorem relating the incidence matrix and the circuit matrix

of a self-loop-free graph G is

THEOREM 7-4

Let B and A be, respectively, the circuit matrix and the incidence matrix (of a

self-loop-free graph) whose columns are arranged using the same order of edges. Then every ro'tv of B is orthogonal to every row A; that is,

A·BT = B·AT = 0

(mod 2),

(7-4)

where superscript T denotes the transposed matrix.

Proof: Consider a vertex v and a circuit r in the graph G. Either v is in r or

it is not. If v is not in r, there is no edge in the circuit r that is incident on v. On the other hand, if v is in r, the number of those edges in the circuit T that are incident on v is exactly two.

With this remark in mind, consider the ith row in A and the jth row in B.

Since the edges are arranged in the same order, the nonzero entries in the corre-

sponding positions occur only if the particular edge is incident on the ith vertex and is also in thejth circuit.

If the ith vertex is not in the jth circuit, there is no such nonzero entry, and

the dot product of the two rows is zero. If the ith vertex is in the jth circuit, there

will be exactly two I's In the sum of the products of individual entnes. Since

1 + 1 = 0 (mod 2), the dot product of the two arbitrary rows-one from A and the other from B-is zero Hence the theorem.

As an example, let us multiply the incidence matrix and transposed circuit

of the graph in Fig. 7-1 (a), after making sure that the edges are in the same order in both.

144

MATRIX REPRESENTATION OF GRAPHS

CHAP. 7

-1 0 0 0-
u u U J U J U U 1 U U U
0 0 0 0 1 1 1 1 0 1 0 1
0 0 0 0 0 0 0 1 0 0 I I
A·~' = .
1 1 1 0 1 0 0 0 0 1 0 1
0 0 1 1 0 0 I 0 0 0 1 1
1 I 0 0 0 0 0 0 0 1 1 0
~O 0 0 0_ -0 0 0 0-
0 0 0 0
o 0 0 0
- (mod 2).
-
0 0 0 0
{\ {\ {\ {\
v v v v
0 0 0 0 7-4. FUNDAMENTAL CIRCUIT MATRIX

AND RANK OF B

A set of fundamental circuits (or baSIC circuits) with respect to any spanning tree in a connected graph, as discussed in Chapters 3 and 6, are the only independent circuits in a graph. The rest of the circuits can be obtained as

ring sums (i.e., linear combinations) of these circuits. Thus, in a circuit matrix, if we retain only those rows that correspond to a set of fundamental circuits

and remove all other rows, we would not lose any information. The remaining rows can be reconstituted from the rows corresponding to the set of fun-

damental circuits. For example, in the circuit matrix in Eq. (7-3), the fourth rOVl is simply the mod 2 sum of the second and third rows.

A subrnatrix (of a circuit matrix) in which all rows correspond to a set of

fundamental circuits is called a fundamental circuit matrix B f. A graph and

its fundamental circuit matrix with respect to a spanning tree (indicated by

heavy lines) are shown in Fig. 7-2.

As In matrices A and B, permutations of rows (and/or of columns) do not

affect Bf. If n is the number of vertices and e the number of edges in a connected graph, then B f is an (e 17 + I) by e matrix, because the number of

fundamental circuits is e - n + I, each fundamental circuit being produced by one chord

Let us arrange the columns in Bf such that all the e - n + I chords correspond to the first e - n + I columns. Furthermore, let us rearrange

the rows such that the first row corresponds to the fundamental circuit made

SEC. 7-4

FUNDAMENTAL CIRCUIT MATRIX AND RANK OF B

145

(a)

()

e3 e6 e[ e4 eS
0 0 0
1 () () J ()
I
{\ 1 : {\ (\ 1
I ~
b) J

{\

1

'-

.

Fig. 7-2 Graph and its fundamental circuit matrix (with respect to the spanning tree shown in heavy lines).

by the chord in the first column, the second row to the fundamental circuit made by the second, and so on. This indeed is how the fundamental circuit

matrix is arranged in Fig. 7-2(b).

A matrix Bf thu~ arranged can be written a~

(7-5)

where I p is an identity matrix of order f.l = e - n + 1, and B, is the remaining J.l by (n - 1) submatrix, corresponding to the branches of the spanning

tree.

From Eg. (1-5) It IS clear that the

fa n k of B,. = U = e - n +

) ,

Since Bf is a submatrix of the circuit matrix B, the

rank of B > e

n + l.

In fact, we can prove Theorem 7-5.

THEOREM 7-5

If B is a circuit matrix of a connected graph G with e edges and n vertices,

rank of B = e - n + 1.

146

MATRIX REPRESENTATION OF GRAPHS

CHAP. 7

Proof; If A is an incidence matrix of G, from Eq. (7-4) we have

A. 8T -- 0 (mod 7)

Therefore, according to Sylvester's theorem (Appendix B),

rank of A + rank of B < e;

that is,

rank of B < e - rank of A.

Since

rank of A = n - 1

we have

rank of B < e - n -I- 1.

But

rank of B > e - n + 1.

Therefore, we must have

rank of B - e - n -1= 1 •

All Altell1ative P,OtT! Theorem 7-5 can also be proved by considering the

circuit subspace Wr in the vector space WG of a graph, as discussed in Chapter 6.

Every row in circuit matrix B is a vector in Wr, and since the rank of any

matrix is equal to the number of linearly independent rows (or columns) in the

matrix, we have.

rank of matrix B = number of linearly independent rows in B;

but the number of lInearly mdependent rows In B < number of linearly Independent vectors in Wr, and the number of linearly independent vectors in Wr = dimension of Wr - f.l Therefore, rank of B < e - n + 1 Since we already showed that

rank of B > e - n + 1, Theorem 7-5 follows. •

Note that in talking of spanning trees of a graph G it is necessary to assume that G is connected. In the case of a disconnected graph, we would have

to consider a spanning forest and fundamental circuits with respect to this

forest. It is not difficult to show (considering component by component) that

if G is a disconnected graph with k components, e edges, and n vertices,

rank of B - f.l - e - n + k

7-5. APPLICATION TO A SVVITCHING NETVVORK

Suppose you are given a box that contains a switching network consisting

of eight switches a, b, c, d, e.f, g, and h. The switches can be turned on or off from outside. You are asked to determine how the switches are connected

inside the box, without opening the box, of course.

One way to find the answer is to connect a lamp at the available terminals

SEC. 7-5

APPLICATION TO A SWITCHING NETWORK

147

n h Switch k
rz-. r:»; r:»; .Jr_
~~~ - _ v -----
d e f (q) Lamp
~ ~
(.) ~.) ~.) ~
~ II
.'e\ - Iii
<::» <;:» Battery Fig. 7-3 Black box with a switching network.

in series with a battery and an additional switch k, as shown in Fig. 7-3. And then find out which of the various combinations light up the lamp.

In this experiment, suppose you discover that the combinations that turn on the lamp are eight:

(a, b,f, h, k), (a, b, g, k), (a, e,f, g, k), (a, e, h, k),

(b, c, e, h, k), tctf; h, k), (c, g, k), (d, k).

ssums« ConsIder the sWItchIng network as a graph whose edges repre-

sent switches. We can assume that the graph is connected, and has no selfloop. Since a lit lamp implies the formation of a circuit, '"ve can regard the

preceding list as a partial list of circuits in the corresponding graph. With this list we form a circuit matrix:

abc d e f g h k

I 1 I U U U I U I 1
2 1 1 0 0 0 0 1 0 1
3 1 0 0 0 1 1 1 0 1
n '+ 1 U U U 1 U U 1 1
u 5
0 1 1 0 1 0 0 1 1
6 0 0 1 0 0 1 0 1 1
7 0 0 1 0 0 0 1 0 1
Q fI () fI 1 () fI () fI 1
- ~ ~ Next, to simplify the matI ix, we should remove the obviously redundant

circuits. Observe that the following ring sums of circuits give rise to other

(a, b, g, k) 8j (c,f, h, k) 8j (c, g, k) = (a, b,f, h, k), (a, b, g, k) CB (a, e, h, k) CB (e, g, k) (b, e, e, h, k),

(a, e, h, k) 8j (c,f, h, k) 8j (c, g, k) = (a, e,f, g, k).

148

MATRIX REPRESENTATION OF GRAPHS

CHAP. 7

Therefore, we can delete the first, third, and fifth rows from matrix B, without any loss of information. Remaining is a 5 by 9 matrix B 1 :

abc d e f g h k

'1 1 {\ {\ {\ {\ 1 {\ 1-
J J V V V V J V J
1 0 0 0 1 0 0 1 1
B - 0 0 1 0 0 1 0 1 1
1-
f\ f\ 1 f\ n f\ 1 f\ 1
~ ~ . ~ ~ ~ . ~ .
0 0 0 1 0 0 0 0 1 Our next goal is to bring matrix B 1 to the form of Eq. (7-5). For this we interchange columns to get B2:

b e f g d a c h k

I 0 0 I 0 I o 0 I
{"\ 1 {"\ {"\ {"\ {"\ 1 1
V 1 V V V 1 V 1 1
B2 = 0 0 1 0 0 0 1 1 I
u u U 1 U U 1 U 1
_0 0 0 0 1 0 0 0 1_ Adding the fourth row in B2 to the first, we get B3•

b e f g d: a c h k

We note that there are no redundant circuits in matrix Bj, and B3 is a

fundamental circuit matrix of the required graph. Since the rank of B3 is

five, and the network was assumed to be connected, we have the followmg

information about the graph:

number of edges e = 9,

nullity Ji 5,

rank r = 4,

number of vertices n = 5.

SEC. 7-5

APPLICATION TO A SWITCHING NETWORK

149

Constructing a graph from its incidence matrix is simple, but constructing a graph from its fundamental circuit matrix is difficult. We shall, therefore,

construct an incidence matrix from B 3.

Since the rows in the incidence matrix are orthogonal to those in B J-

according to Eq. (7 4) we must first look for a 4 by 9 matrix: M, 'Nhose rows

are linearly independent and are orthogonal to those of B 3.

Since,

an orthogonal matrix to B 3 is

because in mod 2 arithmetic

- I, [i.e., in GF(2) the additive inverse of

1 is 1].

us

M=

b e

d a c h k

Clearly, the rank of M is four, and it is easy to check that

Before M can be regarded as a reduced incidence matrix, it must have at

most two Ps in each column. This can be achieved by adding (mod 2) the

third row to the fourth in M, which gives us M'.

b e f g d a c h k

11 1 0 0 0 1 0 0 0
"", 1 0 1 1 0 0 1 0 0
VI 0 1 1 0 0 0 0 1 0
0 0 0 1 1 0 0 1 1 Matrix M' is the reduced incidence matrix. The incidence matrix A can

be obtained by adding a fifth row to M' such that there are exactly two 1 's

150

MATRIX REPRESENTATION OF GRAPHS

CHAP. 7

in every column; that is,

{' e J

d a c h k

From the incidence matrix A we can readily construct the graph and hence

the corresponding switching network, as shown in Fig. 7-4.

a

5

<, / -,
~ ~ \
"'-/
(' A a 1\
/; g"'- /
L -, V
II J

4

Inside Black Box

/" /'

/'

External switch

/' (] -, k
// .»: -. .»:
I ~ ,/ \
I \ "...--...
/ \ (dll',,"n
! o, ~c \ -,
-
I X ,d I
I e \ I
\ .4/ -, J
\ )1 =, /
\ /
\ II' ./ ). ill
- ~ / II

/' /' /'

Ba t tery

Fig. 7-4 Graph and the corresponding switching network.

SEC. 7-6

CUT-SET MATRIX

151

7-6. CUT-SET MATRIX

Analogous to a circuit matrix, we can define a cut-set matrix C = [c;J in

which the rows correspond to the cut-sets and the columns to the edges of the

graph, as follows:

ci} = I, 0,

if ith cut-set contains jth edge, and otherwise.

For example, a graph and its cut-set matrix are shown in Fig. 7-5.

The following remarks may be made about a cut-set matrix C(G) of a graph G.

I. As in the case of the incidence matrix, a permutation of rows or

columns in a cut set matrix corresponds simply to a renaming of the

cut-sets and edges, respectively.

2. Each row in C(G) is a cut set vector.

3 A column with all D's corresponds to an edge forming a self-loop

4. Parallel edges produce identical columns in the cut-set matrix (e.g., first two columns in Fig. 7-5).

5. In a nonseparable graph, every set of edges incident on a vertex is a cut-set (Problem 4-8). Therefore, every row of incidence matrix A(G)

is included as a row in the cut-set matrix C(G). In other words, for a nonseparable graph G, C(G) contains A(G). For a separable graph, the

incidence matrix of each block is contained in the cut-set matrix. For example, the incidence matrix of the block [ c, d, e,f, g} in Fig. 7-5 is

the 4 by 5 submatnx of C left after deletmg rows a, b, and h and columns] 2 5 and 8

, , ,

6. In view of observation 5,

rank of CeC) > rank of A(C).

Hence, for a connected graph of n vertices,

lank of C(G) > n

l.

(7-6)

7. Since the number of edges common to a cut-set and a circuit is always

even, every row in C is orthogonal to every row in B, provided the edges in both Band C are arranged in the same order. In other words,

B· CT = C· BT = 0

(mod 2).

(7-7)

152

MATRIX REPRESENT A nON OF GRAPHS

CHAP. 7

/ I

I

----- __ - 2

-
1 0 0 0 0 0 0 0 I
2 1 I 0 0 0 0 0 0
j U U I U I 0 0 0
4 0 0 0 0 I 1 I 0
c=
5 0 0 I 0 0 1 I 0

6 0 0 0 I 0 I 0 0
7 (\ (\ 1 1 (\ (\ 1 (\
0 "- "- ~ ~ rv
0 v v V 1 1 V v
'- - Fig. 7-5 Graph and its cut-set matrix.

On applying Sylvester's theorem to Eq. (7-7),

rank of B + rank of C < e,

and since for a connected graph

rank of B = e - n + I,

rank of C < n 1.

(7-8)

SEC. 7-7

RELATIONSHIPS AMONG Af, Bf, AND C,

153

Combining Eqs. (7-6) and (7-8),

IankofC n 1.

Thus we have the folloWIng Important theorem for a connected graph G.

THEOREM 7-6

The rank of cut-set matrix C(G) is equal to the rank of the incidence matrix ACG), which equals the rank of graph G

As in the case of the circuit matrix, the cut-set matrix generally has many

redundant (or lInearly dependent) rows. Therefore, It is convenient to define a fundamental cut-set matrix, Cf, as follows:

A fundamental cut set matrix Cf (of a connected graph G vt'ith e edges

and n vertices) is an (n - 1) by e submatrix of C such that the rows corre-

spond to the set of fundamental cut-sets with respect to some spanning tree.

As in the case of a fundamental circuit matrix, a fundamental cut-set matrix Cf can also be partitioned into two submatrices, one of which is an

identity matrix In-1 of order n - I. That is,

(7-9)

where the last n 1 COIUlIIlIS for ming the idelltity matI ix correspond to the

n - 1 branches of the spanning tree, and the first e - n + 1 columns forming C, correspond to the chords

A connected graph and a fundamental cut-set matrix with respect to a spanning tree (shown in heavy lines) are given in Fig. 7-6.

Again note that in talking of cut-set matrices we have confined ourselves to connected graphs only. This treatment can be generalized to include dis-

connected graphs by considering one component at a time.

7-7. RELATIONSHIPS AMONG Af, Bf, AND c,

In this section we shall explore the relationships among the reduced Incidence matrix Ai' the fundamental circuit matrix Bf, and the fundamental

cut set matrix Cf of a connected graph.

It has been shown that

a, = [I,,! B(], C, - [Cc ! In I]'

(7-5) (7-9)

where subscript t denotes the submatrix corresponding to the branches of a

spanning tree, and subscript c denotes the submatrix corresponding to the chords.

Let the spanning tree Tin Eqs. (7-5) and (7-9) be the same, and let the

154

MATRIX REPRESENTATION OF GRAPHS

CHAP. 7

c

- I
I V v ! I V V V v
I
0 1 0 i 0 1 0 0 0
I
Cf - 0 0 1 I 0 0 1 0 0 = ICc: 151
I
I
0 1 1 I 0 0 0 1 0
I
I
0 0 0 I 0 0 0 0 1
L.... I - Fig, 7-6 Spanning tree in a graph and the corresponding fundamental cut set matrix.

order of the edges in both equations be the same. Furthermore, in the reduced

incidence matrix AI-of size (n - I) bye-let the edges (i.e., the columns) be arranged in the same order as in BI and C/. Partition AI into two sub

rna rices:

(7-10)

where A, consists of the n - I columns corresponding to the branches of the

spanning tree T, and Ac is the remaining submatrix corresponding to the

e - n + 1 chords.

Since the columns in AI and Blare arranged in the same order, from Eq. (7-4) we have (in mod 2 arithmetic)

That is,

[Ae! AJ·[-~r ] = 0,

Ae + At' Bi O.

(7-11)

and

SEC. 7-7

RELATIONSHIPS AMONG Af, Bf, AND C,

155

Since At is nonsingular, its inverse At-I exists. Premultiplying both sides of Eq. (7 II) by A; I, we get

(7-12)

Since in mod 2 arithmetic - 1 = I,

(7-13)

Similarly, since the columns in Bf and C, are arranged in the same order, according to Eq. (7-4), we have (in mod 2 arithmetic)

That is,

(7-14)

T

= A-I·A

t c'

from (7-13).

For example, let us look at the following three matrices for the graph used

in Figs. 7-1, 7-5, and 7-6. Using fa, e.], g, hJ as the spanning tree, and drop-

ping the sixth row from matrix A in Fig. 7-1 to get Af, we have

'0 0 1 0 0 1 0 0-
v v v V I I I I
Af = 0 0 0 0 0 0 0 1 = [Ac! At]'
1 I 0 1 1 0 0 0
A 1 A A A 1 A
_v 1 1 V V V 1 v_ be d:a e f g h

bed a e f

h

156

MATRIX REPRESENTATION OF GRAPHS

CHAP. 7

Bf = C, is immediate. It can also be readily verified that

This leads to three conclusions:

1. Given A or Af, 'He can readily construct Bf and CJ, starting from an

arbitrary spanning tree and its subgraph At in Ar.

2. Given either B r or Cr, \ve can construct the other. Thus since B r de

termines a graph within 2-isomorphism, so does Cr.

3. Given either Br or Cr, Af in general cannot be determined completely.

7-8. PATH MATRIX

Another (0, I) matrix often convenient to use in communication and

transportation networks is the path matrix. A path matrix is defined for a

specific pair of vertices in a graph, say (x, v), and is written as P(x, v). The

rows in P(x, y) correspond to different paths between vertices x and y, and the columns correspond to the edges in C. That is, the path matrix for (x, y)

vertices is P(x, y) = [pol, where

Pij = I, = 0,

if jth edge lies in ith path, and otherwise.

As an illustration, consider all paths between vertices V3 and v4 in Fig. 7- I (a).

There are three different paths; [h, e}, [h, g, c}, and [h,j, a, c}. Let us number them I, 2, and 3, respectively. Then we get the 3 by 8 path matrix P(V3' v4):

abc d e f g h

Some of the observations one can make at once about a path matrix

P(x, y) of a graph G are

I. A column of all O's corresponds to an edge that does not lie in any path between x and y.

2. A column of all I's corresponds to an edge that lies in every path between x and y.

3. There is no row with all O's.

4. The ring sum of any two ro\vs in P(x, y) corresponds to a circuit or an

edge-disjoint union of circuits.

SEC. 7-9

ADJACENCY MATRIX

157

THEOREM 7-7

If the edges of a connected graph are arranged in the same order for the columns

of the incidence matrix A and the path matrix P(x, y), then the product (mod 2)

A· PT(X, y) = M,

where the matrix M has 1 's in two rows x and Y, and the rest of the n - 2 rows

are all O's.

Proof: The proof is left as an exercise for the reader (Problem 7 14).

As an example, multiply the incidence matrix in Fig. 7- I to the transposed

P(V3' v4), just discussed.

'-0 0 0-
0 0 0 1 0 1 0 0 0 0 0
1"\ 1"\ 1"\ 1"\ 1 1 1 1"\ 1 1
V V V V I 1 I I V 1 I
A· PT(V" Vol.) = 0 0 0 0 0 0 0 I 0 0 I
1 1 1 U 1 U U U 1 U U
0 0 1 1 0 0 1 0 0 0 I
1 I 0 0 0 0 o 0 0 I 0
- -
1 I 1 2 3

VI '-0 0 0-
V2 0 0 0
V3 I I I / .'"
- VIlUU c],
V4 I I I
1) 000
J
V6 0 0 0 Other properties of the path matrix, such as the rank, are left for the reader to investigate on his own. It should be noted that a path matrix con

tains less information about the graph in general than any of the matrices A B or C does.

7-9. ADJACENCY MATRIX

As an alternative to the incidence matrix, it is sometimes more convenient

to represent a graph by its adjacency matrix or connection matrix. The adjacency matrix of a graph G with n vertices and no parallel edges is an n by n

symmetric binary matrix X - [xu] defined over the ring of integers such that

Xii = I,

J

= 0,

if there is an edge between ith and jth vertices, and

if there is no edge between them.

158

MATRIX REPRESENTATION OF GRAPHS

CHAP. 7

v

v

v

v

v

IJ. c- 0 I 0 0 1 1 -
,
v2 I 0 0 I I 0
X= v3 0 0 0 I 0 0
v4 U I I U I I
Vs I I 0 I 0 0
v" I 0 0 I 0 0
~ - Fig. 7-7 Simple graph and its adjacency matrix.

A simple graph and its adjacency matrix are shown in Fig. 7-7.

Observations that can be made immediately about the adjacency matrix

X of a graph G are

I. The entries along the principal diagonal of X are all D's if and only if

the graph has no self-loops. A self-loop at the ith vertex corresponds to Xii = I.

2. The definition of adjacency matrix makes no provision for parallel edges. This is why the adjacency matrix X was defined for graphs

without parallel edges. t

[Some authors (see Busacker and Saaty [1-2], page 109, for example) define xi] as

equal to the number of edges incident on both vertices i and i. and thus take into account parallel edges.

SEC. 7-9

ADJACENCY MATRIX

159

3. If the graph has no self-loops (and no parallel edges, of course), the degree of a vertex equals the number of 1 '5 in the corresponding row

or column of X.

4. Permutations of rov;s and of the corresponding columns imply reorder

ing the vertices. It must be noted, however, that the rows and columns must be arranged in the same order. Thus, it two rows are interchanged

in X, the corresponding columns must also be interchanged. Hence two graphs G, and G 2 with no parallel edges are isomorphic if and only if

their adjacency matrices X(G, ) and X(G J are related:

where R is a permutation matrix.

5. A graph G IS disconnected and IS 10 two components e, and s, If and only if its adjacency matrix X(C) can be partitioned as

where X(g,) is the a djacency matrix of the component g, and X(g2) is

that of the component g 2'

This partitioning clearly implies that there exists no edge joining

any vertex in subgraph g, to any vertex in subgraph g2'

6. Given any square, symmetric, binary matrix Q of order n, one can

always construct a graph G of n vertices (and no parallel edges) such that Q is the adjacency matrix of G.

Powers of x: Let us multiply by itself the 6 by 6 adjacency matrix of the simple graph in Fig. 7-7. The result, another 6 by 6 symmetric matrix X2, is

shown below (note that this is ordinary matrix multiplication in the ring of ilItegel s and not mod 2 multiplicatiorr):

-3 1 0 3 1 0-
1 '1 1 1 ") ")
. ~ . . - -
0 1 1 0 1 1
J\"' ~
_, 1 V '+ 1 V
1 ? 1 1 ':\ ?
_0 2 1 0 2 2_ The value of an off-diagonal entry in X2, that is, ijth entry (i *' j) in X2, = number of 1 's in the dot product of ith row and jth column (or jth

row 0

= number of positions in which both ith andjth rows of X have 1 's. number of vertices that are adjacent to both ith and jth vertices.

= number of different paths of length two between ith andjth vertices.

160

MATRIX REPRESENT A nON OF GRAPHS

CHAP. 7

Similarly, the ith diagonal entry in X2 is the number of I's in the ith row (or column) of matrix X. Thus the value of each diagonal entry in X2 equals

the degree of the corresponding vertex, if the graph has no self-loops.

Since a matrix commutes with matrices that are its own power,

And since the product of two square symmetric matrices that commute is also a symmetric matrix, X3 is a symmetric matrix. (Again note that this is

an ordinary product and not mod 2.)

The matrix X3 for the graph of Fig. 7-7 is

r-2 7 3 2 7 6-
7 4 1 R ~ 2
V1 3 I 0 4 I 0
A. " 0 A " 0 '7
.. u .. u
7 5 1 8 4 2

_0 L U I L u_ Let us now consider the iith entry of X3.

ij'th entry of X 3 = dot product of ith row X 2 and jth column (or row) of

X.

n

- L jkth entry of X2• kjth entry of X.

k=1

n

E number of all different edge sequencest of three

k=1

edges from ith to jth vertex via kth vertex.

= number of dlHerent edge sequences of three edges between jth and jth vertices

For example, consider how the 1,5th entry on X3 for the graph of Fig. 7-7 is formed. It is given by the dot product

row 1 of X2. row 5 of X = (3, 1,0, 3, 1,0)· (I, I, 0, 1,0, 0)

3 I J I 0 I 3 I 0 I 0 7.

These seven different edge sequences of three edges between VI and Vs are

tAn edge sequence is a sequence of edges in which each edge (except, of course, the

first and the last) has one vertex in common with the edge preceding it and one vertex in common with the edge following it. A path, a circuit, and a walk are all special examples

of an edge sequence. An edge may appear more than once 111 an edge sequence.

SEC. 7-9

ADJACENCY MATRIX

161

Clearly this list includes all the paths of length three between v I and vs, that is, [e6, e7, esl and reI' e4, es}·

It is left as an exercise for the reader to show (Problem 7-19) that the uth entry in X3 equals twice the number of different circuits of length three (i.e.,

triangles) in the graph passing through the corresponding vertex Vi.

The general result that includes the properties of X, X2, and X3 discussed

so far is expressed in Theorem 7-8.

THEOREM 7-8

Let X be the adjacency matrix of a simple graph G. Then the ijth entry in Xr is the number of different edge sequences of 1 edges between vel tices I'i and v l:

Proof: The theorem holds for r = I, and it has been proved for r =-~ 2 and 3 also.

It can be proved for any positive integer r, by induction.

In other words, assume that it holds for r 1, and then evaluate the ijth entry

iII X, with the help of the lelatiOlI

Xr--=Xr-I·X

as was done for X3.

The rest of the proof is left as an exercise (Problem 7-17).

COROLLARY A

III a connected gl aph, the distalIce between two vel tices Vi and V j (fOl j ¥ j)

is k, if and only if k is the smallest integer for which the i,jth entry in xk is nonzero.

This is a useful result in determining the distances between different pairs

of vertices.

COROLLARY B

If X IS the adjacency rnatrix of a graph G with n vertices, and

y -_ X + X 2 + X 3 + ... + Xn- I ,

(in the ring of integers),

then G is disconnected if and only if there exists at least one entry in matrix Y

t at IS zero.

Relationship Between A(G) and X(6). Recall that if a gIaph G has no

self-loops, its incidence matrix A(G) contains all the information about G. Likewise, if C has no parallel edges, its adjacency matrix X(C) contains all the

information about G. Therefore, if a graph G has neither self-loops nor parallel edges (i.e., G is a simple graph), both A(G) and X(G) contain the entire in-

formation. Thus it is natural to expect that either matrix can be obtained directly from the other, in the case of a simple graph. This relationship is

given in Problem 7-23.

162

MATRIX REPRESENTATION OF GRAPHS

CHAP. 7

SUMMARY

The theory of matrices has been brought to bear upon the theory of

graphs. The use of matrices in studying graphs has been amply demonstrated

in this chapter.

We have seen that there are several matrices which can be associated with

graphs. Two of these, the incidence matrix A and the adjacency matrix X, describe a simple graph completely, that is, up to isomorphism. Two others,

the circuit matrix B and the cut-set matrix C, display some important features of the graph and describe the graph only within 2-isomorphism. The path

matrix P(x, y) contains even less InformatIOn than B or C does.

To see further into the structure of the graph, we investigated these matrices, pulled out submatrices Af, Bf, Cf• IJL, In- P Bp Be> Cp and Ce, and

studied them and their interrelationships.

The properties brought out in this chapter do not by any means exhaust

the list. Many interesting and useful results are contained in the problems

of this chapter.

The converse problem of finding a graph to represent a given matrix has been touched upon lightly in Section 7 5. The problem of realizability, that is,

what conditions must a given matrix B satisfy so that a graph can be found whose circuit matrix is B, is very useful and interesting. We shall encounter

this problem of realizability again in Chapter 12.

REFERENCES

Some knowledge of elementary matrix algebra was assumed in this chapter. For those not familiar with matrices, dozens of good books are available. Out of these we have listed two, [7-1] alld [7-3]. Two somewhat special results; the Billet Cauchy theOlelll alld

Sylvester's law of nullity, are explained and proved in Appendices A and B, respectively.

Most textbooks referred to earlier have some portion devoted to matnces aSSOCiated

with graphs. Particularly recommended readings are Chapter 13 of Harary [1-5], Chapter 4 of Seshu and Reed [1-13], and Chapter 5 of Busacker and Saaty [1-2]. Gould's paper [6-4]

referred to in the last chapter is also relevant to this chapter. A survey paper by Harary

[7-2] proves some of the results given in this chapter.

7-1 AITKEN, A C, "Determinants and Matrices," 9th ed , Oliver & Boyd Ltd, Edin-

,

7-2. HARARY, F., "Graphs and Matrices," SIAM Rev., Vol. 9, No. I, Jan., 1967,83-90. 7-3. HOHN, F. E., Elemelltmy Mattix Algeb,a, The Macmillan Cornpany; New YOlk,

1958.

PROBLEMS

7-1. Write the incidence matrices for the labeled simple graphs shown in Figs. 1-12 and 4-1(b). Put the incidence matrix of the graph of Fig. 4-I(b) in the block-diagonal

form of £q. (I-I).

CHAP. 7

PROBLEMS

163

7-2. Consider the graph in Fig. 4-3. With respect to the spanning tree [b, c, e, h, k}, write matrices Ar, Br, and Cr in the forms of Eqs. (7-10), (7-5), and (7-9), respec-

tively. Verify by actual computation Eqs. (7-13) and (7-15).

7-3. Show that for a simple disconnected graph of k components, n vertices, and e edges

the ranks of matrices A, B, alld C are It k; e II + k; and /I k; respectively:

7-4. Label the edges of the graph in Fig. 4-8, and write down its circuit matrix B.

Verify observations 1-5 made in Section 7-3 about the properties of matrix B.

7-5. Draw two nonisomorphic, connected, simple, and nonseparable graphs G I and G2, with as small a number of edges as you can; such that the circuit matrices B(GI) B(G2). (Hint. GJ and G2 are 2-isomorphic, and must be 2-connected.)

7-6. A black box containing a switching network of seven switches-I, 2, 3,4,5,6, and 7-was subjected to the experiment shown in Fig. 7-3. The lamp was lit when each

of the following combinations of switches was turned on, in addition to the external switch k, of course: (1, 4, 5), (1,4, 6, 7), (2, 5, 7), (2, 6), (3, 5), and (3, 6, 7). Show the switching network configuration

7-7. In Section 7-5 a graph was obtained corresponding to a given fundamental circuit matrix. Similarly, sketch a procedur e for obtaining a graph if its fundamental cut-set

matrix c; is given. Can you get two different (nonisomorphlc) graphs for the same C i? I f yes, how are these different graphs related?

7-8. Show that you can determine a graph within 2-isomorphism if you were given the

set of all spanning trees. (Hint: From the set of all spanning trees every cut-set can be determined, using Theorem 4-2. And the set of all cut-sets determines a

graph within 2 isomorphism.)

7-9. If the following is the list of all spanning trees of a graph G, determine G.

fa, c, d, e}, [a, c, d,/}' [b, c, d, e}, [b, c, d,/}, fa, c, e,/}' [b, c, e,/}, fa, d, e,/}, [b, d, e,/}'

fa, b, d, e}, [a, b, d,/}, (a, b, e'/}.

7-10. Express the relationship of dualism between two planar, simple graphs in terms of appropriate matrices.

7-11. Characterize simple, self-dual graphs in terms of their circuit and cut-set matrices.

7-13. Write down the path matrix P(VI. 1'6) for the graph in Fig 4-3 Verify observations

I 4 in Section 7 8 and Theorem 7 7.

7-14. Prove Theorem 7-7.

7-15. Characterize Ai, B r. C r. and X matrices of the complete graph of n vertices.

7-16. After having labeled the graph in Fig. 4-8 (as required in Problem 7-4), write its adjacency matrix X. How does the fact that the graph is separable reflect in X?

Characterize the adjacency matrix X of a separable graph, in general. 7-17. Complete the proof of Theorem 7-8.

7-18. The diameter of a connected graph is defined (Chapter 3) as the largest distance between two vertices in the graph. Given the adjacency matrix X, how will you determine the diameter of the corresponding graph? (Hint: Consider a sum of the

powers of X.)

7-19. Show that each diagonal entry in X3 equals twice the number of triangles passing

through the correspondlOg vertex.

164

MATRIX REPRESENTATION OF GRAPHS

CHAP. 7

7-20. Prove that the number of spanning trees in a connected graph equals the value of

where Af is the reduced incidence matrix of the graph, and the arithmetic operations are carried out in the real field and not mod 2.

7-21. Similar to the circuit or cut-set matrix, define a spannmg-tree matrix for a connected graph, and observe some of its properties.

7-22. Let C be the cut-set matrix of a nonseparable graph G, and let C(x, y) be the submatrix of C, containing only those rows of C that represent cut-sets with respect to vertices x and y. Show that C(x, y) contains a fundamental cut-set matrix Cf of

G.

7-23. For a labeled graph G of n vertices, define an n by n diagonal matrix D (called the

degree matrix of G) such that the /th diagonal entry In D equals the degree of the ith vertex in G. Define another matrix E, obtained from the incidence matrix A of G by arbitrarily replacing one of the two 1 's in every column by a -1. Show

that if G is a simple, connected graph the following holds (the computations are in the ring of integers and not mod 2)'

(b) All cofactors of the matrix D - X are equal.

(c) Each cofactor of D X equals the number of spanning trees in G, where X is

as usual the adjacency matrix of G.

7-24. Use the result obtained in Problem 7-23(c) to prove Cayley's formula (Theorem

3-10).

7-25. Let x and y be a pair of vertices in a simple nonseparable graph G, and P(x, y) be the corresponding path matrix of G. Prove that every circuit in G is obtained

as a mod 2 sum of two rows of P(x, y). From this result, prove that a path matrix in a simple, nonseparable graph determines the graph within 2-isomorphism. [Hmt: Every circuit r in G falls in one of three categories: (1) r passes through

both x and y; (2) r passes through neither x nor y; or (3) r passes through either x or y. Consider all three cases, and use Theorem 4-11.]

7-26. Prove that for a connected, self-loop-free graph G, subspaces Wr and Ws are orthogonal complements of Wa over GF(2) if and only if the number of spanning

trees In e ne a new eye matnx

using the identity CfS} - SfC} - 0, and the Binet Cauchy theorem (see Appendix

A). Show that det(MMT) 1 (mod 2) if and only if G has an odd number of

spanning trees.]

You might also like