boolean matrices - shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfthe...

47
Chapter 5 BOOLEAN MATRICES Every natural matrix can be represented by a boolean matrix, as mentioned in the previous chapter. This chapter is more or less an extension of the chapter on natural matrices. We will study boolean matrices in relation to the graph they represent. As in the preceding chapter, the structural properties of graphs will be determined from the algebraic properties of the associated matrices. We deal with the different properties of graphs, first defining the property in terms of the graph and then as that of the adjacency matrix of the graph. First the boolean matrices associated with a graph are defined. It will be seen that at some points have deviated from the rules of boolean arithmetic. But this is an exception and hence will be explicitly mentioned wherever used. 5.1 Terms and Definitions In this section we define the terms usp-d in this chapter. Examples are given for new terms and for those whose definitions differ from the convention. A zero

Upload: others

Post on 16-Mar-2020

21 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

Chapter 5

BOOLEAN MATRICES

Every natural matrix can be represented by a boolean matrix, as mentioned in the

previous chapter. This chapter is more or less an extension of the chapter on natural

matrices. We will study boolean matrices in relation to the graph they represent.

As in the preceding chapter, the structural properties of graphs will be determined

from the algebraic properties of the associated matrices. We deal with the different

properties of graphs, first defining the property in terms of the graph and then as

that of the adjacency matrix of the graph. First the boolean matrices associated

with a graph are defined.

It will be seen that at some points have deviated from the rules of boolean

arithmetic. But this is an exception and hence will be explicitly mentioned wherever

used.

5.1 Terms and Definitions

In this section we define the terms usp-d in this chapter. Examples are given

for new terms and for those whose definitions differ from the convention. A zero

Page 2: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 94

. matrix is denoted by Z. We do not mention its order explicitly since it will normally

be clear from the context.

• The positive closure of a matrix A of order n x n is

n

A+ =A+A2 +···+A11 = LAk k=l

• The transitive closure of a matrix A of order n x n is n

At = I + A + A 2 + ... + An = LA k

k=O

The ·transitive closure of the adjacency matrix of a graph holds special signifi­

cance and will be discussed in detail later.

• We define the difference C = A - B of two boolean matrices as,

c[i,j] = a[i,j]· b[i,j]

Note that A - B is same as the Hadamard product [17] of A and B, i.e.,

C = A* B.

Mainly three kinds of matrices are associated with graphs. The adjacency

matrix A is the same as defined in the previous chapter, except that every nonzero

element in A is replaced by 1. Hence A matrix contains only 0 and 1 as its elements.

The incidence matrix B = [b ij ] is an n x q matrix such that

if edge j is incident on node i

=0 otherwise.

Note that B is a boolean matrix. For digraphs we consider two incidence I;natrices,

P = [Pij] and Q = [qij], each of order n x q such that,

Pij = 1 if edge j is incident out of node i

=0 otherwise.

Page 3: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 95

and, if edge j is incident into node i

=0 otherwise.

Conventionally, the incidence matrix B of digraphs is defined as

bij = 1 if edge j 'is incident out of node i

= -1 if edge j is incident into node i

= 0 otherwise.

Note that B = P - Q, where '-' is the ordinary subtraction. It is easy to see that

a graph with loops cannot be represented by the B matrix but P and Q matrices

can together do so. Henceforth B matrix will be used to denote the incidence

matrix of an undirected graph, and P, Q matrices will represent the incidences in

a digraph. We define now, the reachability matrix which is a variation of the path

matrix defined earlier.

• The reachability matrix D = [dij ] of a graph is defined such that,

=0

if there is a path from node i to node j

otherwise.

Recall that the path matrix (I - SA)-I of the adjacency matrix A of a graph

gives out the paths of length k between various nodes as the coefficient matrix of sk.

Since the reachability matrix gives the presence of a path between nodes and not its

length or number, it can be obtained as follows. Compute (I - sA) -1 considering A

as a 0-1 natural matrix and write the boolean matrix corresponding to it to obtain

the reachability matrix.

Earlier, a path was d~pned as a sequence of distinct edges in which vertices are

also distinct. We now relax the definition of path so that vertices can be repeated.

• The effective path length I of a path between two nodes VI and V2 is the

number of dir~ct edges in it excluding the circuits. The effective path

length of a path (Xl, X2,"', Xk) is denoted by (Xl, X2,"', Xk )/.

Page 4: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 96

Obviously, the effective path length of a loop is O. Consider the graph given in

Fig. 5.1.

2

6 • • 3 1 4 5

Fig. 5.1

In the path (1,2,3,1,4,5) between nodes 1 and 5, there are only two direct

edges (1,4) and (4,5), hence (1,2,3,1,4,5)1 = 2. In short, we shrink all circuits to

single nodes and then co~nt the number of edges.

5.2 Properties of Graphs

A graph can be thought of as a binary relation 3? between the vertices of the

graph. An edge (a, b) of the graph represents aRb. Similarly A[i,j] = 1 represents

i3?j. We can then falk about the following properties of graphs and explain them in

terms of matrices of the graph. As in the chapter, the term graph means a directed

graph unless mentioned otherwise.

5.2.1 Reflexivity, Symmetry, and Transitivity

• A graph is reflexive if there is a loop at every node i.e., (x, x) for all x E V.

In terms of the adjacency matrix A, a graph is reflexive if all the diagonal

entries of its adj~cency matrix are positive, i.e., A + I = A. This is the same as

saying A * I = I .

• A graph is irreflexive if there is no loop in it, i.e., no (x, x) for all x E V.

This means all the diagonal entries of the adjacency matrix are zero. Thus,

Page 5: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 97

A- I = A and A * I = Z.

• A graph is symmetric if for every edge (x, y) there exists the symmetric

edge (y, x).

In terms of the adjacency matrix, a graph is symmetric if A C AT. It follows

that A = AT.

• A graph is asymmetric if,

( x, y):::} no (y, x) for all x, y E V.

For an asymmetric graph, A * AT = Z. Note that loops are not allowed in an

asymmetric graph, hence all diagonal entries of A are zero.

• A graph is antisymmetric if,

(x, y) and (y, x) :::} (x = y) for all x, y E V.

This definition allows loops in an antisymmetric graph and, A * A T ~ I which

is the same as, A * AT + I = I. For example consider the graph given in Fig. 5.2

and its adjacency matrix.

~----3l------1' 2

3

Fig. 5.2

A=(~ ~~) a a a

Page 6: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 98

A * AT = (~ ~ ~) 000

c (1 0 0) 010 001

• An anti symmetric graph which has loops at every node we define as a

nonsymmetric graph, i.e.,

(x,y) and (y,x) ¢:} (x = y)

For a nonsymmetric graph, A * AT = I. Note that antisymmetric and non­

symmetric graphs become asymmetric after the removal of loops.

• A complete graph is one in which there is an edge between any pair of

nodes, i.e, atleast one of (x, y) or (y, x) is present for all .1:, y.

Hence, A + AT = Z. It is obvious that loops are compulsory in a complete

graph.

• We define an edge (x, y) to be a transitive edge if,

for distinct XI,X2,···,Xk.

2

a b

d ~--------~--------~ 3 c

Fig. 5.3

For example in the graph of Fig. 5.3, (1,1,2) :::} (1,2) but (1,2) is not a transitive

edge, where as, (1,2,3) :::} (1,3) so (1,3) is a transitive edge.

To check for the presence of a transitive edge in a graph consider its C matrix

Page 7: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 99

having boolean literals as its elements. The graph contains a transitive edge if

and only if for atleast one nonzero element C[i,j] there exists some k such that

C[i,j] i. Ck[i,j], k = 2,3,···,n. This means that there is an indirect path of

length k not containing the direct edge (i,j), which thus becomes a transitive edge.

For the graph in Fig. 5.3,

Note that C [1, 3] i. C 2 [1,3] since there is a path ab from node 1 to 3 not containing

the direct edge c. Thus the graph contains a transitive edge c .

• The transitivity property in a graph requires that,

for all Xi in V.

This implies, A2 ~ A and also (I+A)Z = I+A. Consider the graph in Fig. 5.4.

a 1 "=:::-----~----.".. 2

d b

4.,:;....-----E----~3 c

Fig. 5.4

1 1 1) 011 001 000

Page 8: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 100

CO 1

D A2= o 0 0 ~A o 0 0

o 0 0

G 1 1

i) I+A= 1 1 0 1 0 0

G 1 1

D (I+A)2 = 1 1

=I+A 0 1 0 0

Thus the graph in Fig. 5.4 satisfies the transitivity property .

• A graph is said to be transitive if it satisfies the transitivity property and

there is atleast one transitive edge in it.

For a transitive graph the following should be satisfied:

o The transitivity condition, A 2 ~ A, and

o for atleast one C[i,j] =I- 0 there exists a k such that C[i,j] ct Ck[i,j],

k = 2,3,···, n.

The graph in Fig. 5.4 satisfies the transitivity property. Now to check for the

presence of a transitive edge we write the C matrix.

(0 a I d)

C= 0 0 b e o 0 0 c o 0 o· 0

(

0 0 ab ae + IC) C 2 = 0 0 0 bc

o 0 0 0 o 0 0 0

In the above matrices, C[l, 3] ct C 2 [1,3] hence C[l, 3] = I is a transitive edge. Thus

the graph in Fig. 5.4 is a transitive graph. Incidentally, d and e are also transitive

edges. Now consider the graph in Fig. 5.5.

Page 9: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 101

a 0_1 ___ -:>~b ---_e 2

Fig. 5.5

Hence A 2 = A and transitivity condition is satisfied. Now,

Since e[l,l] C e 2 [1,1] and e[1,2] C e 2 [1,2], there is no transitive edge in the

graph. Hence the graph is not transitive.

• We define a graph to be intransitive if,

{(X,Xl,"',Xk,Y)1 and (x,y)::} (l = I)}

where I is the effective path length of the path (x, Xl, ... , x k, y).

This is the same as saying that the path (x, Xl,'" ,Xk, y) between x and y

consists of only one direct edge (x, y). Loops are excluded since the effective path

length of (x, x) is 0 and [( x, X)I and (x, x) ::} I = 1] does not hold good. To determine

the intransitivity of a graph by its adjacency matrix, we use its e matrix. A graph

is intransitive if,

{ (e[i, i] = 0 for all i ) and (e[i,j] =/:. O::} e[i,j] C ek[i,j], k = 2,3"", n - 1) }

The second condition makes it clear that the direct edge A[i, j] must be in­

cluded in the indirect path between nodes i and j. Hence -no transitive edges should

be present in the graph. Two examples are given below.

Page 10: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 102

b a 2

1 3

e e

4

Fig. 5.6

c= (~ 0 0

D 0 b ~ 0 0 0

C'= e 0 0

l) be 0

ea 0 eb 0 0 0

C' = C~a 0 0

b~e ) 0 beb ebe 0 0 0

The nonzero elements in A and the corresponding elements in higher compounds

have been underlined. It can be seen that for nonzero C[i,j], C[i,j] c Ck[i,j], k = 2,3. Hence this is an intransitive graph. Now consider the graph given in Fig. 5.7.

b a 2

1 3

e

d

Fig. 5.7

Page 11: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 103

(

0 0 C 2 = . bd 0

ca 0

Note that C[2, 1] ct C2[2, 1] and C[3, 1] ct C2[3, 1]. Hence this graph is not intran­

sitive. Note that the path (3,2,1) = ca between nodes 3 and 1 does not include the

direct edge (3,1) = d in it. Here d is a transitive edge.

• We define a graph as antitransitive if,

It is obvious that by allowing the path length to be 0 on the right hand side

of the above implication, loops are also included in an anti transitive graph. The C

matrix of an antitransitive grai)h must satisfy the check for intransitivity after the

diagonal elements have been made zero. This is the same as saying that C) = C * I is intransitive. Note that the graph in Fig. 5.5 is an antitransitive graph.

• An anti transitive graph which has loops at every node we define as a

nontransitive graph, i.e.,

{ [(X,Xl,"',Xk,Y)1 and (x,y) => 1= 0 or 1] and [(x,x) for all x] }

The first condition allows for an antitransitive graph and the second forces

loops. The C matrix ofa nontransitive graph must satisfy the check for intransitiv­

ity after the diagonal elements have been made zero. That is, C 1 as defined above

is intransitive.

5.2.2 Cyclic Graphs

• A graph is cyclic if atleast one cycle of length 2 or more is present.

Let Al = A * f, then a graph is cyclic if,

Page 12: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 104

which means that not all diagonal entries of Ai, A~, .. " Ail are zero. This ensures

the presence of atleast one cycle of length 2 or more. Consider the graph in Fig. 5.S,

1

Fig. 5.S

G 1

D A= 0 0

G 1

D A1 = 0 0

G 0

D Ai= 1 0

0 1

D A+ - 1 1-

0

G 0

D Ai*I= 1 =/=Z 0

Hence this graph is cyclic.

• A graph is acyclic if,

{ (x, Xl, ••• , X k , y) :::} no (y, x) }

This is the same as saying, A + * I = Z .. No cycles of any length (not even

loops) are allowed.

• A graph is anticyclic if,

Page 13: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 105

{ (X,XI,'" ,Xk,Y)::::} (X = xl = ... = Xk = y) }

After the removal of loops, the graph becomes acyclic, i.e., Al is acyclic. Loops

are the only cycles allowed.

• A graph is noncyclic if,

{ (X,XI' .,. ,XbY) {:} (x = Xl = '" = Xk = y) }

In a noncyclic graph, loops are compulsory. We have a graph with forced loops

and no other cycles of any length. Note that in the definitions of acyclic, anticyclic

and noncyclic graphs, if Xl = X2 = .. , = Xk = 0 we obtain the definitions of

asymmetric, antisymmetric and nonsymmetric graphs, respectively.

5.2.3 Meeting, Joint, and Lattice

• We define a graph as a meeting if for every pair of nodes a and b there is

a node c such that,

(a, c)(b, c)( a, x )(b, x) ::::} (c, x)

This is equivalent to saying that a graph is a meeting when the transitive

closure of its adjacency matrix is closed under the bitwise anding of rows.

1

4

Fig. 5.9

2

Page 14: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 106

For the graph given in Fig. 5.9,

G 0 1

D A= 0 1 0 0 0 0

(~ 0 0

D A2= 0 0 0 0 0 0

The 3rd and 4th powers of A are zero, hence the transitive closure is,

A'=I+A+A2

= G ~ ~ D It can be verified that At is indeed closed under bitwise anding of rows. Hence the

graph in Fig. 5.9 is a meeting. Now consider the graph in Fig. 5.10.

1 2

4

Fig. 5.10

(0 0' 1 1)

A= 00 1 1 o 0 0 0 o 000

A 2 =A3 =A4 =O

(

1 0 1 1) At = 0 1 1 1

o 0 1 0 000 1

Page 15: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 107

Check that the bitwise anding of rows 1 and 2 produces the row (0 0 1 1)

which is not present in At. Hence the given graph is not a meeting. Note that the

deletion of edge (3,4) from the graph in Fig. 5.9 produced the graph in Fig. 5.10

and removed its meeting property.

• We define a graph as a joint if for every pair of nodes a and b there is a

node c such that,

(c, a)(c, b)(x, a)(x, b) =} (x, c)

This is same as saying that a graph is a joint when the transitive closure of its

adjacency matrix is closed under the bitwise anding of column8.

1

2 3

Fig. 5.11

For the graph given in Fig. 5.11,

A= (~ 1 1

D 0 0 0 0 1 1

A'= 0 1 1

D 1 0 0 1 1 1

It can be verified that At is closed under bitwise anding of columns. Hence the

graph in Fig. 5.11 is a joint. Now consider the graph in Fig. 5.12.

Page 16: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 108

1

2 3

Fig. 5.12

A= G 1 1

D 0 1 1

D 0 0 A'= 1 0 0 0 0 1 1 1 1 1

Check that the bitwise anding of columns 2 aild 3 produces ( 1 0 0 l)T

which is not present in At. Hence the given graph is not a joint.

• The transitive closure of a graph which is a joint and a meeting gives out

a lattice [5,10].

It is obvious that the transitive closure of the adjacency matrix of such a graph

is closed under bitwise anding of rows as well as columns. Consider the graph in

Fig. 5.13.

1

2 3

4

Fig. 5.13

Page 17: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES

The adjacency matrix and its transitive closure is,

A'= G

At= G

1 o o o

0 0 0 0

1 1 0 0

0

D 0 0 0

1

1) 0 1 0

109

It can be checked easily that A t is closed under bitwise anding of rows and columns.

5.3 Dominating and Independent Sets

We have considered the matchings and coverings in a graph in the chapter

on natural matrices. Here, the dominating and independent set of nodes will be

discussed.

5.3.1 Dominating Sets

• A dominating set in an undirected graph G is such that every vertex in G

is either in the dominating set or adjacent to one or more vertices in the

set. A minimal dominating set is one from which no vertex can be removed

without destroying its dominance property. The domination number of a

graph is the cardinality of the smallest minimal dominating set.

For the undirected graph given in Fig. 5.14 AD and ED are examples of some

dominating sets.

Page 18: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 110

A

(/.

B

b c d

c D E

Fig. 5.14

We gIve below an algorithm to find all the minimal dominating sets usmg

boolean arithmetic.

Algorithm 4.1 :

o 'For each node x write the boolean sum of labels of all nodes adjacent to

x, including x.

o Take the boolean product of the above sums.

o When the above function is written as a sum of products, each term gives

a minimal dominating set.

For the graph in Fig. 5.14 the boolean function is,

f = (A + B)(B + A + D)(C + D)(D + B + C + E)(E + D)

= (A + B)(C + D)(E + D)

= AD + BD + ACE +BCE

It can be verified that each of these is a minimal dominating set and that these are

the only ones in the graph. Here, domination number = 2.

Extending this property to digraphs, we define the following two sets.

• A master dominating set in a digraph G is such that every vertex in G

is either in the set or has an incoming edge from one or more vertices in

it. A slave dominating set in a digraph G is such that every vertex in G

either belongs to the set or has an outgoing edge into one or more vertices

in it. A set which is both master and slave is a ministe.r dominating set.

Page 19: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 111

A

a

H

b d c

C D E

Fig. 5.15

For the graph given in Fig. 5.15, ACD is a master dominating set and BeE

is a slave set.

The algorithm for dominating sets in undirected graphs can also be used to

compute ·master and slave sets with the following modification. For master sets

include only those nodes y in the boolean sum for node x such that (y, x) is an edge

in the digraph. For slave sets those nodes yare included such that (x, y) is an edge.

For the digraph in Fig. 5.15 the boolean function for the master set is,

For the slave set it is,

f = A(B + A + D)C(D + C)(E + D)

= AC(E + D)

=ACD+ACE

f = (A + B)B(C + D)(D + B + E)E

= B(C + D)E

=BCE+BDE

Hence ACD and ACE are the master sets and, BCE and BDE are slave sets

in the graph of Fig. 5.15.

5.3.2 Independent Sets

• An independent set of nodes in an undirected graph is a set in which no

two vertices are adjacent. A maximal independent set is one to which no

Page 20: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 112

other vertex can be added without destroying its independence property.

Independence number is the number of nodes in the maximal independent

set of largest size.

For example, for the graph given in Fig. 5.14 ACE is an independent set. We

give below an algorithm to find all the maximal independent sets using boolean

arithmetic.

Algorithm 4.2 :

o For every edge write the boolean sum of labels of nodes on which it IS

incident.

o Take the boolean product of the above sums.

o . Express the above product as a sum of products.

o Consider every product term as a set and find its complement with respect

to the node set of the graph. These sets give the independent sets.

For the graph in Fig. 5.14 the boolean function is,

f = (A + B)(B + D)(C + D)(D + E)

= BD + AD + BCE

l' =ACE+BCE+AD Verify that ACE, BCE, and AD are the only maximal independent sets in the

graph.

5.4 Minors of Incid.ence Matrices

In this section physical significance of determinants (or permanents) of subma­

trices in the incidence matrices of the,graph is given.

* A square submatrix in P has a nonzero determinant (or permanent) if the

corresponding subgraph is a divergence.

It is obvious that a minor will be nonzero if every row and column has exactly

one '1', or in short, when the submatrix can be transformed by row and column

Page 21: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 113

permutations into a unit matrix. Nonzero minors of order n give divergences with

no sinks. IppTI gives the number of divergences with no sinks. Minors obtained

by deleting rows i), i 2 , "', im of P matrix give divergences with nodes i), i2 , "',

im as sinks. Similarly minor in ppT obtained by deleting rows and columlls iI, i2,

.. " im gives the number of divergences with nodes i), i2 , .. " im as sinks. Consider

the graph given in Fig. 5.16.

c 3 e 1"t---~----<t---~-~2

a

1

p= 2

3

4

4

Fig. 5.16

a b c

0 0 1

0 1 0

0 0 0

1 0 0

b

d e

0 0

0 0

0 1

1 0

The minor (1·2·3, b·c·e) is nonzero and corresponds to the divergence with node 4

as sink, given in Fig. 5.17.

c

4

Fig. 5.17

e

Page 22: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 114

1 0 0 0

IPpTI = 0 1 0 0

=2 0 0 1 0 0 0 0 2

Hence there are 2 divergences with no sink, given in Fig. 5.18.

3 1--~--'---~-----J'2

c e

b

4

Fig. 5.18

c 3 e 1 ~--7--+------::>--~ 2

a b

4

Note that these are also, the out coverings of the graph. Since the out degree of every

node is 1, every node has an outgoing edge in the set of edges of the divergence,

hence it is an outcov,ering. The cofactor of element (1,1) is 2, hence there are 2

divergences with node 1 as sink, as shown in Fig. 5.19.

1 • 3 ..------::>--~2

e 1

3 ------::>---., 2 e

d b a

4 4

Fig. 5.19

* A square submatrix in Q has a nonzero determinant (or permanent) if the

corresponding subgraph is a convergence.

The argument here is similar to that for minors in P matrix and divergences

in the graph. Minors of order n give convergences with no sources. IQQTI gives

Page 23: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 115

the number of convergences with no sources. Minors obtained by deleting rows i l ,

i 2 , ••• , im of Q matrix gives convergences with nodes i], i 2 , •.. , im as sources.

Similarly determinant of minor in QQT obtained by deleting rows and columns i],

i2 , ... , i nt gives tIle Iltlll11)er of COllvergellces \vi tIl llocles i 1, i'2, "., i'H (is SOllrces.

For the graph in Fig. 5.16,

a b c d e

1 1 0 0 0 0

Q= 2 0 0 0 0 1

3 0 0 1 1 0

4 0 1 0 0 0

QQT = (~ 0 0

D 1 0 0 2 0 0

IQQTI = 2

There are two convergences with no sources, shown in Fig. 5.20.

1 3 e 3 1 --~---+---'=>--~ 2

c e t----~--__ 2

b

4 4

Fig. 5.20

Convergences with no source give incoverings in the graph. It is obvious now

why the permanent of A matrix gives tIle spanning circuits in the graph, as given

in chapter 3. Note that A = PQT and permanent of A,is the sum of products of

major permanents of P and QT. Major permanents in P give divergences with no

Page 24: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 116

sinks and those in QT give convergences with no sources. Hence permanent of A

gives spanning circuits.

5.5 Compounds of Adjacency and Incidence

Matrices

Recall the definition of row and column compounds given in the chapter on

real matrices, section 2.2.1. The binary operator used for the row and column

compounds here in this chapter will be boolean or denoted by +, and boolean and

denoted by •. In this section, the row and column compounds of adjacency and

incidence matrices will be used to compute the cover and independent sets of a

graph. First some definitions are given .

• The positive content of a column compound is the boolean sum of those

product headings whose columns have all 1 'so The positive content of a

row compound is the boolean sum of those product headings whose rows

have all 1 'so

• The negative content of a column (or row) compound is the boolean sum

of those product headings whose columns (or rows) have all O's.

The theorems for finding out covers and independent sets in a graph from the

compounds of adjacency and incidence matrices are now given.

Theorem 1: Dominating sets in an undirected graph are given by the

boolean sum of the positive contents of A~k+), k = 2,3,· .. , r ¥ 1.

Corollary : The domination number of the graph is the smallest k for which the

positive content of A~k+) is nonzero.

A nonzero element in A~k+) corresponding to row llode i and coluIllll heading

Page 25: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 117

(ith· .. j k) implies that atleast one node in the set {jl, h, ... ,j k} is adjacent to node

i. Hence a positive column means the nodes in the set are adjacent to all nodes

i = 1,· .. ,n. Such product headings are obviously dominating sets of the graph. In

taking the boolean sum of the positive contents we merge the large sets into their

subsets. This gives the minimal dominating sets. Also, computing compounds upto

r ~ 1 tit compound is sufficient since the size of a minimal dominating set cannot

exceed r ~ 1 in a connected graph of n nodes.

Any set containing a dominating set will dominate the graph but will not

give a minimal dominating set, hence in computing A~k+) we can ignore those

product headings for which allY subset in A~[k-l1+) or any lower compounds is a

dominating set. After doing so the positive contents of compounds will give only

minimal dominating sets. Also note that since A matrix for an undirected graph

is a symmetric matrix, we can compute dominating sets using the row compounds

also. For the graph in Fig. 5.13,

A B C D E

A 1 1 0 0 0

B 1 1 0 1 0

A= C 0 0 1 1 0

D 0 1 1 1 1

E 0 0 0 1 1

AB AC AD AE BC BD BE CD CE DE

A 1 1 1 1 1 1 1 0 0 0

B 1 1 1 1 1 1 1 1 0 1 A (2+) =

c C 0 1 1 0 1 1 0 1 1 1

D 1 1 1 1 1 1 1 1 1 1

E 0 0 1 1 0 1 1 1 1 1

Positive content of A~2+) = AD + ED. These are minimal dominating sets in the

graph. It is obvious that any set containing either of these sets will be a dominating

Page 26: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 118

set, but not minimal. Hence in A~3+) only column headings ABC, ABE, ACE,

BC E and CD E need to be checked for the dominance property.

ABC ABE ACE BeE CDE

A 1 1 1 1 0

B 1 1 1 1 1 A (3+) =

c C 1 0 1 1 1

D 1 1 1 1 1

E 0 1 1 1 1

Positive content of A~3+) = ACE + BCE. Hence the set {AD, BD, ACE, BCE}

gives all the minimal dominating sets in the graph. Note that these are the same

sets as computed by Algorithm 4.1.

Theorem 2: Master dominating sets in a digraph are obtained by the

boolean sum of positive contents of A~k+), k = 2,3,···, f¥l. Slave domi­

nating sets are obtained by the boolean sum of positive contents of A~k+),

k=2,3,···,f¥l

It is obvious that a nonzero row of row heading (i 1 i 2 ···id in A~k+) implies

that there are edges from atleast one node in the set {i 1, i2, ... , i k} to all the other

nodes, and hence it is a master dominating set. By a similar argument the column

heading of a nonzero column in A~k+) corresponds to a slave dominating set. For

the graph in Fig. 5.14,

A. B C D E

A 1 1 0 0 0

B 0 1 0 0 0

A= C 0 0 1 1 0

D 0 1 0 1 1

E 0 0 0 0 1

Page 27: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 119

A B C D E

AB 1 1 a a a AC 1 1 1 1 a AD 1 1 a 1 1

AE 1 1 a a 1

A(H) = BC a 1 1 .1 a r

BD a 1 a 1 1

BE a 1 a a 1

CD a 1 1 1 1

CE a a 1 1 1

DE a 1 a 1 1

A B C D E

ABC 1 1 1 1 a ABD 1 1 a 1 1

ABE 1 1 0 a 1

ACD 1 1 1 1 1

A(H) = ACE 1 1 1 1 1 r

ADE 1 1 a 1 1

BCD a 1 1 1 1

BCE a 1 1 1 1

BDE a 1 1 1 1

CDE a 1 1 1 1

Master dominating sets of the graph are AC D and ACE.

Page 28: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 120

AB AC AD AE BC BD BE CD CE DE

A 1 1 1 1 1 1 1 0 0 0

13 1 0 0 0 1 1 1 0 0 0 A (2+) =

c C 0 1 1 0 1 1 0 1 1 1

D 1 0 1 1 1 1 1 1 1 1

E 0 0 0 1 0 0 1 0 1 1

ABC ABD ABE ACD ACE ADE BCD BCE BDE CDE

A 1 1 1 1 1 1 1 1 1 0

13 1 1 1 0 0 0 1 1 1 0 A(3+) =

c C 1 1 0 1 1 1 1 1 1 1

D 1 1 1 1 1 1 1 1 1 1

E 0 0 1 0 1 1 0 1 1 1

Slave dominating sets of the graph are BeE and BDE.

Theorem 3: Independent sets in an undirected graph are given by the

boolean sum of the negative content of B~2.), and those node sets of size

k, k = 3,4 ... , r I 1 who do not have any subsets which are not included in

the negative content of B~2.).

Consider the row compound, B~2.). An element corresI>onding to I'OW heading

(il i2) and column j is nonzero when the edge j is incident on nodes i1 and i2.

This means the node set {it, i2} is not independent. Thus a row of zeroes in B~2.)

means that the nodes are not linked by any edge, hence are independent. Hence

the negative content of B~2.) gives independent sets.

Consider now the higher compounds. Note that all rows of B~3.), B~4.), ... will

have only zeroes. This is obvious because any column in B has exactly two nonzero

elements. But all product l1eadings ill t11ese compounds are not independent sets,

Page 29: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 121

since those product headings whose subsets are not independent sets cannot be

independent themselves. Hence those node sets of size 3 or more up to r ¥ 1, who

have no subsets which are not independent are to be included in the boolean SUlll

for independent sets. To get maximal independent sets, merge smaller sets into

larger ones.

For the graph in Fig. 5.13,

a b c d

A 1 0 0 0

B 1 1 0 0

B= C 0 0 1 0

D 0 1 1 1

E 0 0 0 1

a b c d

AB 1 0 0 0

AC 0 0 0 0

AD 0 0 0 0

AE 0 0 0 0

B(2o) = BC 0 0 0 0 r

BD 0 1 0 0

BE 0 0 0 0

CD 0 0 1 0

CE 0 0 0 0

DE 0 0 0 1

Note that in B~2o) AB, BD, CD, and DE are not independent sets and all sets in

B~3.) containing any of these will also not be independent so only the sets ACE

and Be;: E need to be included in the boolean sum. Maximal independent sets

= AC+AD+AE+BC+BE+CE+ACE+BCE = AD+ACE+BCE.

TJ/- !i31/

Page 30: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 122

Independence number = 3. Note that these were the maximal independent sets

obtained by Algorithm 4.2. o Coverings have been discussed in the previous chapter. Here we give theorems

to find coverings using the boolean incidence matrices.

Theorem 4: Coverings in an undirected graph are given by the boolean

sum of the positive contents of B~k+), k = r~ 1,· .. , (n - 1).

Corollary: The covering number of the graph is the smallest k for which the positive

content of B~k+) is nonzero.

It is obvious that only those columns in the column compound, whose product

headings ·are covering sets in the undirected graph, will have all l's. In taking the

boolean sum of the positive contents we merge the large sets into their subsets.

Also, computing compounds from r ¥ 1 th compound is sufficient since the size of a

minimal covering cannot be less than r ~ 1 in a connected graph of n nodes. Any

set containing a covering will cover the graph but will not give a minimal covering,

hence in computing B~k+) we can ignore those product headings for which any

subset in B~[k-1]+) or any lower compounds is a covering. The positive contents

then directly give minimal coverings. Consider the graph in Fig. 5.21,

f

1,-::-------------3lt2

b d

3.-=:------------...4 e Fig. 5.21

Page 31: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 123

abc d e f 1110001

B= 2 1 0 1 1 0 1

3011010

4000110

Minimal coverings = ac+bd+ef +acd+bce+cdf. Covering number = 2. Recall that

the same graph was considered in sect"ion 4.4 and the minimal coverings obtained

were same as above.

Theorem 5: Outcoverings in a digraph are obtained by the positive con­

tent by p~n+) and incoverings by the positive content of Q~n+).

For the graph in Fig. 5.22,

Page 32: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES

f

1 a

b c

3 e Fig. 5.22

abc d e f

1100000

p=2 a a a 1 01

3 011000

4 000010

abcdef

1010001

2101000 Q=

3 000010

4 000100

124

2

d

4

The compounds p~4+) and Q~4+) are of order 15 x 4. But for typesetting

convenience sake we have written these matrices in the transposed form.

The out coverings abde + abef + acde + acef in p~4+), and the incoverings

abde + adef + be de + cdef in Q~4+) have been shown underlined. Note that the

same outcoverings and incoverings were obtained in section 4.4.

Page 33: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 125

1 2 3 4 1 2 3 4

abed 1 1 1 0 abed 1 1 0 1

abee 1 0 1 1 abee 1 1 1 0

abef 1 1 1 0 abef 1 1 1 0

abde 1 1 1 1 abde 1 1 1 1

abdf 1 1 1 0 abdf 1 1 0 1

abef 1 1 1 1 abef 1 1 1 0

aede 1 1 1 1 aede 0 1 1 1

(p~4+)f = aedf 1 1 1 0 (Q~4+)f = aedf 1 1 0 1

aeef 1 1 1 1 acef 1 1 1 0

adef 1 1 0 1 adef 1 1 1 1

bede 0 1 1 1 bede 1 1 1 1

bedf 0 1 1 0 bedf 1 1 1 0

beef 0 1 1 1 beef 1 1 0 1

bdef 0 1 1 1 bdef 1 0 1 1

edef 0 1 1 1 edef 1 1 1 1

D

The problem of finding matchings in a graph and theorems relating the com-

pounds of adjacency matrix to matchings has been discussed in the chapter on

natural matrices. We now give a theorem connecting the compound of incidence

matrix of a graph to the matchings in it.

Theorem 6: Matchings in a graph are given by the boolean sum of neg-

ative content of B~2.), and those edge sets of size k, k = 3,4,· .. , r¥l who

do not have any subsets which are not included in the negative content of

B~2.) .

The argument here is identical to that for independent sets except that here

Page 34: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 126

column compounds are considered. The maximal matchings are obtained by merg­

ing.smaller subsets in the boolean SUIll into their supersets. Consider the graph in

Fig. 5.23.

1 a

l' b

2 2'

3 3'

Fig. 5.23

a b e d

1 1 1 0 0

2 0 0 0 1

B= 3 0 0 1 0

l' 1 0 1 0

2' 0 1 0 0

3' 0 0 0 1

ab ae ad be bd ed

1 1 0 0 0 0 0

2 0 0 0 0 0 0

B(2.) = 3 0 0 0 0 0 0 c

l' 0 1 0 0 0 0

2' 0 0 0 0 0 0

3' 0 0 0 0 0 0

Note that only bed need to be included in the boolean sum. Maximal matchings

= ad + be + bd + ed + bed = bed. The presence of a maximal matching of size 3

(number of nodes in Vd indicates that the bigraph has a complete matching.

Page 35: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 127

5.6 Strongly ~onnected Graphs

We have begun the discussion about strongly connected graphs in the chapter

on nonnegative matrices. This section completes it by giving a detailed account of

the nature of the adjacency matrix of a strongly connected graph, its behaviour,

partitioning of an ordinary graph into strongly connected components, etc ..

• A graph is said to be strongly connected if there is a path between any

two nodes.

The adjacency matrix of a strongly connected graph is an irreducible matrix.

Given below is a result on irreducible matrices which relates directly to the corre­

sponding strongly connected graph.

* The path matrix (I - sA)-1 corresponding to an irreducible matrix A is

positive.

Recall that,

All diagonal elements of (I - sA)-1 are positive due to the unit matrix on the right

hand side. Let a~J) denote the (i, j)th element of A k, then all other elements dij of

(I - SA)-l are of the form,

d 2 (2) 3 (3) iJ' = saiJ' + sa·· + sa·· + ... IJ IJ

and a~J> > 0 for some value of k. Thus dij > 0 for all i,j.

Note that the reachability matrix is nothing but the boolean matrix corre­

sponding to the path matrix. The above statement is equivalent to saying that

the reachability matrix of a strongly connected graph is a positive matrix, which is

obvious since there is a path between any two nodes.

o

Page 36: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 128

The adjacency matrix of a strongly connected graph can be written in the

Frobenius form, 0 Al2 0 0 0 0 0 An 0 0

0 0 0 0 Ah-I,1t Altl 0 0 0 0

where the zero blocks along the main diagonal are square. For example, consider

the graph in Fig. 5.24.

2 5----E---.---~---3

II

6 --~----___E:______-.... 4 1

Fig. 5.24

1 2 3 4 5 6 1 2 3 5 4 6

1 0 1 0 0 0 0 1 0 1 0 0 0 0

2 0 0 1 0 1 0 2 0 0 1 1 0 0

A= 3 0 0 0 1 0 0

A= 3 0 0 0 0 1 0

or, 4 1 0 0 0 0 0 5 0 0 0 0 0 1

5 0 0 0 0 0 1 4 1 0 0 0 0 0

6 1 0 0 0 0 0 6 1 0 0 0 0 0

Here,

Al2 = (1 ) A23 = (1 1 )

A34 = (~ ~) A41 = (~) Thus, the index h of imprimitivity, or simply, index of A)s 4. There are two cycles

of length 4 in the graph, hence the g.c.d. of length of all cycles is also 4, equal to

Page 37: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 129

h. Note that all nodes of the graph can be placed on a cycle of length of length h

because the length of all other cycles are multiples of h. For the graph in Fig. 5.24,

we can place the nodes as in Fig. 5.25.

Fig. 5.25

It is obvious that since the diagonal blocks of A are zero, there is no inter­

connection amongst the nodes in a block. Hence a strongly connected graph can

be partitioned into a h-partite graph, and its node set V can be split into disjoint

subsets VI, V2 , ... , Vh such that the union of all the subsets gives V. The strongly

connected graph of Fig. 5.24 has been split into a 4-partite graph of Fig. 5.26.

where the node sets are Vi = {1}, V2 = {2}, V3 = {3, 5}, and V4 = {4, 6}.

2 1 --:;..-..;:

3 4

5

Fig. 5.26

6

1

Page 38: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 130

The first node set has been drawn again in the end to prevent the figure from

being cluttered. Note that every node has a nonzero out degree and indegree. This

ensures that every node is on a cycle of length 11, or a multiple of it. Now consider

the bipartite graph of Fig 4.27.

2 1---:;.--~ 1

3 _--:;.--___e''" 3 4

5 6

Fig. 5.27

This also represents the strongly <;:onnected graph of Fig. 5.24. We can state

the following result.

* Every strongly connected graph having the adjacency matrix with index

h can be drawn as a k-partite graph ,where k divides h.

Recall from the chapter on nonnegative matrices the result that an irreducible

matrix of index h can be represented in the super diagonal block form with k blocks

if k divides h. This statement and the one made above are in direct correspondence

with each other.

o Any graph G can be partitioned into strongly connected components G 1 , G2 ,

.. " Gk as is shown in Fig. 5.28.

Page 39: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 131

Fig.5.2?

If every strongly connected component be shrunk into a single node, the re­

sulting gI;aph is asymmetric, hence the reduction of a partial order. Note that the

graph cannot be symmetric since the presence of symmetric edges between any two

components would merge them into one component. To partition a graph in such

a fashion, define a matrix D' such that,

D'[i, j] = D[i, j]andDT[i,.i]

where D is the reachability matrix of the graph. Now examine the matrix D'. The

nodes corresponding to columns having nonzero elements in a row all belong to the

same partition as the row node. Row nodes having identical rows belong to the

same partition. Consider the graph in Fig. 5.29 to illustrate the above method.

~---30---"'" 2

------7--- 3

Fig. 5.29

Page 40: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES

1 234

1 a 1 a 1

A=2 a a 1 a 3 a a a a 4 1 a 1 a

-1 1 (I - sA) = 2 1- s

Hence the reachability matrix is,

1 2 3 4

1 1 1 1 1

D= 2 a 1 1 a 3 a a 1 ()

4 1 1 1 1

1 234

1 1 a a 1

DT = 2 1 1 a 1

3 1 1 1 1

4 1 a a 1

123 4

1 1 a a 1

Df = 2 a 1 a a 3 a a 1 0

4 1 0 0 1

132

The partition of the above graph is {I, 4}, {2} and {3}. It is obvious that the

subgraph formed of nodes 1 and 4 is indeed a strongly connected component.

Page 41: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 133

5.7 Intrinsic Polynomial

Recall from the chapter on real matrices that if a square matrix A is a product

of two matrices P and Q, and if M is the modal matrix of A then the columns of

the product matrix QM are eigenvectors of QP. It was also seen that the Honzero

eigenvalues of QP are same as those of A, implying that their intrinsic values are

the same.

When the matrix A is the adjacency matrix of a graph, and P, QT its incidence

matrices then A = PQ. Also notice that the structure of P and Q of having a single

'1' in every column of P and every row of Q, forces QP to be a 0-1 matrix. Thus

even for graphs with parallel edges, the intrinsic values can be obtained from the

intrinsic polynomial of a 0-1 matrix.

We illustrate the above by two examples. Consider the graph in Fig. 5.30.

a

c 2

• b

Fig. 5.30

A=(~ ~)

1 2 a b c

~) a 0 1

P= Ie 0 Q= b 1 0

2 0 1 c 1 0

Verify that A = PQ.

QP = (~ ~)

Page 42: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 134

Here the product QP is the same as A matrix so the intrinsic values of both will

of course be same. Consider the same example with the following modification as

given in Fig. 5.31.

d 2

c

Fig. 5.31

1 2

a b c d a a 1

p= 1 C 1 a ~) Q= b a 1

2 a a 1 c 1 a d 1 a

I _ sA = (1- s -s -~s)

Hence,

II - sAl = a =* 1 - s - 2s2 = a

The intrinsic values are, /1 = ~, /2 = -1. Hence

The eigenvectors associated with the two values are,

and

Page 43: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 135

Hence,

M = (2 1) 1 -1 (

1 -1) QM = ; ~1

2 1

Now the product QP is,

QP= C 0 1

D 0 1 1 0 1 0

Us 0 -05 0

1- o5QP = 1 -05 o ) -,5 1 -~

-05 -05 0 1-05

II - o5QPI = 0 :::} 1 - $ - 2S2 = 0

Since the intrinsic equation for A and QP is same, so are the intrinsic values. On

substituting the values of /1 and /2 for .5 in (I - sQP)x = 0, we get the following·

eigenvectors.

and

Note that these are the columns of QM, which is thus the modal matrix of QP.

Thus the intrinsic values of a natural matrix can be obtained as the intrinsic

values of a 0-1 matrix QP such that A = PQ. Note that the nonzero coefficients

of sk in the intrinsic polynomial of a 0-1 adjacency matrix indicate the presence of

an excess circuit of length k. This can be seen from the adjacency matrix of the

graph in Fig. 5.30 which is the boolean adjacency matrix for the graph in Fig. 5.31.

The exact number of excess circuits can be obtained from the intrinsic polynomial

of the natural adjacency matrix, or the boolean product matrix QP.

Nonzero coefficients in the circuit polynomial of the boolean adjacency matrix

similarly indicate the presence of a positive or negative circuit of a given length,

not its exact number, which can be obtained from the natural adjacency matrix.

Page 44: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 136

5.8 Transitive Closure

In this section the transitive closure and reachability matrix of boo lean III at rices

will be discussed in greater detail. In many cases, when the number of nodes in it

graph is not very large, the reachability matrix can be obtained by examining all

the paths in the graph. For example, consider the graph in Fig. 5.32.

3

Fig. 5.32

A= G ~ ~) Since the graph is obviously strongly connected the reachability matrix is,

Now consider the transitive closure of the above graph,

0 1 n A2= 1 0

0 1

D A 3 = 1 1

(: 1

D At=I+A+A2+A3= 1 1

Page 45: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 137

Hence, the transitive closure of a boolean matrix is nothing but the reachability

matrix since we place an edge between any two nodes having an indirect path

between them. The transitive closure of a full matrix i.e. Z, is the full matrix itself

since no more elements can be added to it. Consider more examples. For the graph

in Fig. 5.10,

G 0 1

D A= 0 1 0 0 0 0

G 0 -s -S) I-.<;A = 1 -.<; -8 0 1 0 0 0 1

(~ 0 8

D (I - 8A)-1 1 8 0 1 0 0

Hence,

G 0 1

D D= 1 1 0 1 0 0

which is the same as transitive closure At computed earlier.

To find the transitive closure of matrices with boolean literals we follow a

slightly different method. Recall from the chapter on natural matrices that,

where e is the adjacency matrix of a graph with boolean literals as elements. It is

obvious that even if 8 is not attached to all the labels of edges, still the matrix will

behave in a similar fashion. Hence,

(I - e)-l = 1 + e + e 2 + ... + en + A n +l + ...

Hence we compute (I - e)-l and truncate each element which is a nonterminating

power series upto terms of degree n. This is illustrated by the following example.

Page 46: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES

Now,

2

a

1 b

Fig. 5.33

c2

= (! c' = (+

c

a+ aba 1 + ab

o

1- C = (~b ~a ~C)

3

c + abe) be 1

2:;:o(ab)k a2:;:o(ab)k e2:;:o(ab)k

(I - C)-l = b 2:;:o(ab)k 2:;:o(ab)k be 2:;:o(ab)k

o o 1

Truncating each of the above series upto length 3 we get,

(

1 + ab a( 1 + ab) (I - C)-l = b(l + ab) 1 + ab

o 0

e(l + ab)) be 1

which is same as the transitive closure computed above.

138

o It would appear that there is no difference between matrices wi th boolean

literals as their elements and those having regular expressions as elements, because

Page 47: BOOLEAN MATRICES - Shodhgangashodhganga.inflibnet.ac.in/bitstream/10603/16635/11/11_chapter 5.pdfThe ·transitive closure of the adjacency matrix of a graph holds special signifi cance

BOOLEAN MATRICES 139

they behave in a very similar fashion. The anding of boolean literals is same as

concatenation of regular expressions, as will be seen in the next chapter which

deals with matrices with regular expressions as their elements, as also the boolean

addition is same as the or operations on regular expressions.

It is important to note that in the case of boolean matrices we are not bothered

about the order in which the literals are written. It should be noted that elements

in (1 - C)-l matrix give out paths of all lengths between any pair of nodes, and

this is exactly what we obtain from the closure matrix of a regular matrix. But

computing (1 - C)-l involves just matrix inversion with which we have long since

been familiar, whereas computing the closure matrix of a regular matrix is not that

straight forward. What makes the difference is that the paths in transitive closure

matrix are not listed out in proper order. This is not so for matrices with regular

expressions, as will be seen in the next chapter.