You are on page 1of 493

...

...\"'-)

...)))

GRAPH

THEORY)

with

Applications

to

Engineering

and

Computer

Science)

NARSINGH

DEO)

Computer
Washington

Science Department
State

University)

PRENTICE-HALL,

INC.)
N.J.)))

ENGLEWOOD CLIFFS,

Library of Congress
NARSINGH

Cataloging

in Publication Data to engineering and

DEO, Graph theory with applications computer science.) Includes bibliographies. 1. Graph theory. I. Title. TA338.G7D46 511'.5 ISBN 0-13-363473-6)

73-7566

cg 1974 by

Prentice-Hall,

Inc., Englewood Cliffs,

N. J.)

reserved. No part of this book may be rights reproduced in any form, by mimeograph or any other without permission in writing from the publisher.)
All

means,

10 9 8

7)

Printed

in the

United

States

of America)

PRENTICE-HALL PRENTICE-HALL PRENTICE-HALL PRENTICE-HALL PRENTICE-HALL

INTERNATIONAL, INC., London OF AUSTRALIA, PTY. LTD., Sydney OF CANADA, LTD., Toronto OF INDIA OF JAPAN, PRIVATE LIMITED, New INC.,
Tokyo)))

Delhi

To

the
who that

memory
did of

of my
not

father,
his eldest

live to

witnessing

realize his greatest ambitionson matriculate.)))

CONTENTS)

PREFACE)

xv)

1)

INTRODUCTION)

1)

1-1
1-2

What

is a and

Application
Finite Incidence

1-3

1-4
1-5

G rap h ? 1 3 of Graphs Infinite Graphs


and

6
and Null

Degree

1-6

Brief

Isolated Vertex, Pendant Vertex, of Graph Theory History


11

10

Graph

Summary

References

11

Problems

12)

2)

PATHS
2-1 2-2

AND

CIRCUITS)

14)

Isonlorphism

14

Subgraphs
A

16
With

2-3

Puzzle

Multicolored Cubes
and Circuits
Disconnected

17
and Components
21)))

2-4

Walks,

Paths, Gtaphs Euler

19
Graphs,

2-6
2-7

2-5 Connected Graphs,


Euler

23

Operations On Graphs

26
28
Circuits Problem

2-8

More on

Graphs

2-9
2-10)

Hamiltonian Paths and The Traveling Salesman 35 Summary


References

30 34

35
36)

Problems

IX)

CONTENTS)

3)

TREES

AND

FUNDAMENTAL

CIRCUITS)

39)

3-1

Trees
Some Pendant Distance

39
Properties Vertices

3-2
3-3 3-4
3-5
3-6

3-7
3-8 3-9
3-10

Rooted On Counting Trees


Spanning Fundamental Finding

of Trees 41 in a Tree 43 in a Tree and Centers 48 and Trees Binary

45

52
55 57

Trees Circuits All

Spanning
a 64

Spanning Trees in
Summary

Trees of a Graph Weighted Graph

58

61

References

64

Problems

65)

4)

CUT-SETS AND
4- t

CUT-VERTICES)

68)

Cut-Sets

68 69 of a Cut-Set in a Graph 71 Ci rcuits and Cut-Sets 75 and Separability 79


80

4-2 4-3
4-4

SomeProperties
All

Cut-Sets

Fundamental Connectivity

73

4-5
4-6

Network Flows
I-Isomorphism

4-7
4-8

2-Isomorphism
Summary

82
85

References

86

Problems

86)

5)

PLANAR
5-1 5-2

AND

DUAL

GRAPHS)

88) 88

Combinatorial Vs. GeometricGraphs Planar Graphs 90


Kuratowski's

5-3
5-4
5-5

Two

Graphs

90
Planar

Different Representations of a 99 of Planarity Detection

Graph

93

5-6
5-7 5-8 5-9

GeometricDual

102

J 04 Combinatorial Dual More on Criteria of Planarity Thickness and Crossings Summary

107

108

109

References

110
110)))

Problems

CONTENTS

XI)

6)

VECTOR

SPACES

OF
One

A GRAPH)

112)

6-1 6-2 6-3

Sets with Sets with

6-4
6-5

6-6
6-7 6-8 6-9

112 Operation 116 Operations Modular Arithmetic and Galois Fields 118 Vectors and Vector Spaces 120 Vector with a Graph 121 Space Associated Basis Vectors of a Graph 123 Circuit and Cut-Set Subspaces 125 ] 29 and Spaces Vectors Orthogonal and Join of Wand Ws Intersection 13]
Two
Summary ]

34

References

135
135)

Problems

7)

MATRIX

REPRESENTATION
Incidence

OF GRAPHS)
] 37 141

137)

7-]
7-2 7-3

Matrix

Submatrices of A(G) 142 Circuit Matrix


Fundamental

7-4
7-5

Circuit

Matrix
Switching

and Rank of
Network

B
]46

144

An

Application

to a
among ] 56 162

7-6

Cut-Set Matrix
Relationships Path

]51
Af, Bf, and

7-7 7-8
7-9

Cf

]53

Matrix

Adjacency Matrix
Summary

157

References

162
162)

Problems

8)

COLORING,

COVERING,
Number
Partitioning Polynomial

AND PARTITIONING)
165
]

165)))

8-1
8-2 8-3 8-4

Chromatic

Chromatic Chromatic Matchings


Coverings

69

174

177
182

8-5
8-6

The Four
Summary

Color Problem
190

186

References
Problems

190
192)

XII

CONTENTS)

9)

DIRECTED

GRAPHS)

194)

9-1

9-2
9-3 9-4
9-5
9-6

What Is a Directed Graph? 194 Some of Digraphs 197 Types and Binary Relations 198 Digraphs DirectedPaths and Connectedness 201
Euler

Trees
Matrices

with

Digraphs Directed Circuits A, B,

203

9-7

Fundamental

9-8
9-9 9-10

206 Edges in Digraphs


Digraphs

212
213 220

and C of

9-11

Adjacency Matrix of a Digraph Paired Comparisons and Tournaments Acyclic Digraphs and Decyclization 233 Summary

227 230

References Problems

234
234)

10)

ENUMERATION

OF

GRAPHS) 238 240


241

238)

10-1
] 0-2

Types Counting Counting

of Enumeration Labeled

10-3
] 0-4

Trees Trees Unlabeled

250 P6lya's Counting Theorem 10-5 Graph Enumeration With P6lya's Theorem
Summary

260

264

References

264
265)

Problems
GRAPH

THEORETIC

ALGORITHMS

AND

11)

COMPUTER PROGRAMS)

268)

11-1
11-2

Algorithms

269

of a Graph 270 Representation ] 1-3 The Output 273 ] ] -4 274 Some Basic Algorithms 1: Connectedness and Components 274 Algorithm 277 Tree Algorithm 2: A Spanning 280 Algorithm 3: A Set of Fundamental Circuits 284 4: Cut-Vertices and Separability Algorithm 287 Algorithm 5: Directed Circuits 290 11-5 Shortest-Path Algorithms to 6: Shortest Path from a Specified Vertex Algorithnl 292 Another Specified Vertex Path between All Pairs of Vertices 7: Shortest Algorithm 11-6 Depth-First 301 Search on a Graph 304 8: Planarity Algorithm Testing

Input:

Computer

297

11-7

Algorithm

9:

Isomorphism

310)))

CONTENTS

XIII)

1-8

Other

11-9 Performance 11-1 0 Graph-Theoretic


Summary

Graph-Theoretic

Algorithms

312
314

of Graph-Theoretic Computer 317

Algorithms 316 Languages

References

318

Problems
Appendix

321
of Programs
323)

12)

GRAPHS

IN

SWITCHING

AND CODING

THEORY)

328)

12-]

Contact Networks
Analysis Synthesis Sequential Unit Graphs Summary

329 330 334


342

12-2 12-3 12-4


12-5

of Contact of

Networks Contact Networks


Networks

Switching

Cube

and Its

12-6

Graph
Theory

in Coding 354
354)

348 351

References

ELECTRICAL

NETWORK THEORY)
Is an

ANALYSIS
356)

13)

BY

GRAPH
What

13-1

] 3-2

13-3 13-4
13-5

13-6

357 Electrical Network? 358 Current and Voltage Laws 359 LoopCurrents and Node Voltages with Independent Sources: Nodal Analysis RLCNetworks Sources: Loop Analysis RLC Networks with Independent 373 General Linear, Fixed Networks Lumped,
Kirchhoff's Summary

362

371

379

References

381
381)

Problems

14)

GRAPH

THEORY
Transport

IN

OPERATIONS

RESEARCH)

384)

14-1
14-2

Networks
Max-Flow

384
Min-Cut

Extensions of

Theorem 395

390

Cost Flows 14-3 Minimal 14-4 The Multicommodity 14-5 Further Applications

393
Flow

14-6 14-7
14-8

More Activity

on

Flow
Networks

396 397 Problems


in Project Planning Network
400

Analysis of an
Further

14-9

Activity on Comments 414


414)))

402

14-]0Graphs
Summary

in Game

Activity Networks 409 Theory

408

References

xiv

CONTENTS)

15)

SURVEY

OF OTHER APPLICATIONS)
Graphs Markov

416)

15-1 Signal-Flow
15-2 Graphs
in

416 Processes

15-3

Graphs Graphs

15-4
15-5

in Computer in Chemistry

424 Programnling
449
454)

439

Miscellaneous Applications

Appendix

BINET-CAUCHY

THEOREM)

458)

Appendix

NULLITY
SYLVESTER'S

OF A MATRIX
LAW)

AND 460)

INDEX)

463)))

PREFACE)

decades have witnessed an upsurge and activity of interest and mathematicians particularly among applied engineers. Clear evidence of this is to be found in an in the growth unprecedented number of papersand books being published in the field. ]n 1957 there was und exactly one book on the subject (namely, Konig's Theorie der Endlichen Unendlichen are over two dozen there Now, sixteen years later, Graphen). textbooks on graph theory, and almost an equal number of proceedings of
The

last two theory,

in

graph

various

seminars

and

conferences.
strength

Each book
the

has its own

and

points

axe

(or

the pen) the author

has to
of

grind. I have
This

of emphasis,
emphasized

depending on
the

com-

putational

and algorithmic
conviction

aspects
that

graphs.

emphasis

arises from the

graph theory is applied to solving it in electrical network any practical (be layout, problem analysis, in circuit in data structures, in operations or in social sciences), it almost research, leads to large graphs-graphs that to analyze are virtually always impossible without the aid of the computer. An finds that those real-life often engineer that can be modeled on by into graphs small enough to be worked problems hand are also small enough to be solved other than graph theory. by means from (In this respect graph theory is different algebra, elementary college

experienceand

whenever

calculus, or complex variables.) In fact, one of the reasons for the recent growth

the
of

interest

digital computer high-speed in graph theory.

is

student of applied graph theory must learn to enlist I have emphasized large computer for handling graphs, constructive theorems, algorithms and their efficiencies.In proving proofs have been given existence proofs. Chapter over nonconstructive preference of II, the largest in the book, is devoted entirely to computational aspects and samples of several algorithms graph theory, including graph-theoretic this) tested computer for solving problems on graphs. I believe programs

Convinced that
help

the

of a digital

xv)))

XVI

PREFACE)

approach

has not

been used in

any

of the

The material covered is appearing for the to spoil the


book rigor

II and in many in Chapter first time in any textbook.

earlier books on graph theory. sections from other chapters


this

Yet the applied and


and contains

algorithmic aspectof
mathematical

book

has not
graph

elegance of graph

enough
as of

material
much

for a

course in

been allowed theory. Indeed,the


theory.

\"pure\"

The
and

book has been made

self-contained is appropriate
in

as was possible.

The level
first-year

presentation

for advanced undergraduate


requiring
I

graduate
organized
introductory

students
so

all
first

disciplines
half

graph theory.
through

The
as

book is

that

the
material

(Chapters

9) serves

essential and

graph theory. This portion requires some no specialbackground, elementary concepts from set theory except amount of mathematical matuand matrix algebra and, of course, a certain with the theory the illustrations of applications are interwoven rity. Although the examples selected are short and mostly of the nature even in this portion, of puzzles and games.This is done so that a student in almost any field can
on

read and
The

and different second half of the book is more advanced, chapters to nontrivial, require different backgrounds as they deal with applications in in different fields. Keeping this mind, real-world, problems complex ] 5 have been made independent of each other. One 10 through Chapters the earlier couldstudy a later chapter without going through ones, provided have been covered. the first nine chapters Since there is more material here than what can be covered in a onethat the contents be tailored the to suit semester course, it is suggested

grasp the

first

half.

requirements

of the students
Science:

in

different
] I

disciplines,
-9, I I,

for example:

I.

2.
5.

Electrical Engineering: Chapters


Computer

Chapters

-9,

I], 12, and and 12, parts of


and

13.

10and

5.

Research: Chapters 1-9, and II, 14,and 3. Operations 4. Applied Mathematics: ChaptersI-II and parts of

parts

of 15.

15.

Introductory

\"pure\"

graph

theory:

Chapters

1-10.

In fact, the book grew out of a number of such courses and lecture-series the the at Jet author State given Propulsion Laboratory, California by of Technology at Los Angeles, the Indian Institute at Kanpur, University

and the

University

of

Illinois

at Urbana-Champaign.)

ACKNOWLEDGMENTS) It is a
individuals

pleasureto acknowledge
and

the

help

I have

received from

different

institutions.

I am

Rubin,

a dear

friend and former


a former

Mr. Mateti

K. particularly indebted to Mr. David at the Jet colleague Propulsion Laboratory;

Prabhaker,

graduate

student

of mine at the

Indian)))

PREFACE

XVII)

Institute University

of

of

Technology, Kanpur; and Professor Illinois at Urbana-Champaign for

Jurg Nievergelt of
having

the

read

the

entire

manuscript
the book.

and made

numerous suggestions for


students

improvements

throughout

Other friends, colleagues, and


and

who

read parts

made

helpful of the

suggestions

Jet Propulsion Laboratory, Professor Nandlal Jhunjhunwala State University at Los Angeles, Dr. George of Texas Shuraym Mr. Jean A. DeBeule of Xerox Data Mr. Nicholas Instruments, Systems, Karpov of Bell & Howell, Professor C. L. Liu of the University of Illinois at K. G. Ramakrishnan, Urbana-Champaign, Messrs.M. S. Krishnamoorthy, and S. K. Basu of the Indian and Professors C. R. M uthukrishnan Institute of Technology at Kanpur. I am also grateful to the late Professor of Stanford George E. Forsythe of this project. for his encouragement at the very outset University this book was received from the Jet Propulsion Support in writing at Kanpur, and the Comof Technology Laboratory, the Indian Institute of the University of Illinois at Urbana-Champaign. puter ScienceDepartment
Perlman

are: Professor Harry

of the manuscript Lass and Mr. Marvin

of California

Just as one does not


is not a and her

thank

himself,

public band,

Hindu custom. For the coauthorship is tacitly


without

wife

gratitude expressing is considered a


assumed Kiran's

in

any

to one's wife in part of the husbook her husband

writes. There is little doubt that have been possible.)

help

this book would not

NARSINGH

DEO)

Kanpur)))

1)

INTRODUCTION)

1-1.

WHAT

IS

A GRAPH?)

A lineart graph elements are

(or simply

a graph)

==

(V,

E) consists

of a
reI'

V == {VI' V2 ' . . .} called

vertices,
that

called edges, such


of vertices.
The

and another each edge e k

set E ==
is identified

set of objects
whose

e 2 , . . .},

with an

unorder-

V j associated with edge ek are called is by means common representation of a graph the vertices are represented as points and each edge of a diagram, in which to as a line segment joining its end vertices. Often this diagram itselfis referred in Fig. as the graph. The object shown 1-1, for instance, is a graph. a this definition that Observe permits an edge to be associatedwith the same vertex as both its end ververtex pair (Vi' VJ. Such an edge having The word loop, however, has a is called a self-loop (or simply a loop. tices Vj )

ed pair (Vi'
the end

The verticesVi'

vertices of eke

most

different

meaning

in electrical

self-loop

to avoid

confusion). Edge e I

network theory; we shall therefore use the in Fig. 1-1 is a self-loop.Also note

term that)

VI) e))

V2)

V s) es)

Fig.
V)) e6) V4)

1-1

Graph

with

five

vertices

and

seven edges.)
as redundant in our discussions, is no such thing as a nonlinear
1)))

tThe
we
always

adjective

\"'linear\"

is dropped

because
graph.)

by

a graph

mean

a linear

graph. There

2)

INTRODUCTION)

CHAP.

1)

the
vertices,

definition
for

allows
example,
has

more

than

one

edges e 4
neither

and

edge associated e s in Fig. 1-1. Such

with

edgesare referred

a given pair
to

of
as

parallel
graph.

edges. A graph that


In some
most

self-loops

nor parallel

edges is called a simple

graph-theory
engineering

literature, a graph

graph, but in and self-loops


loops

and/or

parallel

be allowed; this edges.

to be only a simple it is necessary that parallel edges applications selfis why our definition includes graphs with use the term general graph to Some authors
is defined

emphasize that parallel edges and self-loops are allowed. whether It should also be noted that, in drawing a graph, it is immaterial is important is the the lines are drawn or curved, long or short: what straight incidence betweenthe edges and vertices. For example, the two graphs drawn between edges and because incidence in Figs. I-2(a) and (b) are the same, verticesis the same in both cases.)

2) 4) 2) 4)

3)

3)

(a))

(b))

Fig.

1-2

Same graph

drawn

differently.)

In a

diagram of
that

point

] -3. having

Such
no

a crossing to emphasize

a graph, sometimes two edges may seem to intersect at a vertex, for example, edges e and f in Fig. in different of as be should planes and thus being thought edges two of the one break authors common edges at such point. (Some
does

not represent

this

fact.))

a)

d)

h)

Fig.I-3
c) point.)))

Edges e and

have

no common

SEC.

1-2)

APPLICATIONS

OF GRAPHS)

3)

A graph

is also

calleda linear
is also

complex,

a I-complex,

or a
a line,

one-dimensional
O-cell, or an
an element,
terms

complex.A vertex Other O-simplex. I-cell, an are, and


graph,

vertex,

referred to as a node, ajunction, terms used for an edge are a branch, I n this book we shall aI-simplex. and edge.)

a point,

generally use the

1-2.

APPLICATIONS

OF

GRAPHS)
wide of range simplicity, graph theory has a very in physical, social, and biological sciences, in

Because

of
in

its

inherent

applications
linguistics,
almost

engineering,

among

other areas. A graph can be used to represent involving discrete objects and a relationship them. The following are four examples from among hundreds of such
and
any

physical

in numerous situation

applications.
The Konigsberg bridge problem is perhaps in graph theory. It was a long-standing problem until solved by Leonhard Euler (1707-1783) in 1736, by means of a graph. Euler wrote the first paper ever in graph and thus became the originatheory tor of graphs as well as of the rest of topology. The problem is of the theory depicted in Fig. 1-4.
Kiinigsberg

Bridge

Problem:

the

best-known

example

Two islands,C and D, formed by the Pregel River in Konigsberg (then the capital of East Prussia but now renamed and in West Soviet Kaliningrad to the banks A and and B with seven Russia) were connected to each other in Fig. 1-4. The problem was to start at any of the four land bridges, as shown areas of the city, A, B, C, or D, walk over each of the seven bridges exactly and return to the starting across the river, once, point (without swimming of course).
this situation Euler by means of a graph, as shown represented 1-5. The vertices represent the land areas and the edges represent the As we shall see in Chapter a solution for this 2, Euler proved that
exist.) in

Fig.

bridges.

problem

does not

A)

B)

Fig.

1-4

Konigsberg bridge problem.)))

4)

INTRODUCTION)

CHAP.

1)

A)

c)

D)

Fig.
B)

1-5

Graph of

Konigsberg

bridge

problem.) as the
and

The
figures

Konigsberg
without

(Problems 2-1 and 2-2).We one time or another.


Utilities

bridge problem is the same lifting the pen from the paper
all

problem of
retracing
such

drawing

without
with

have

been confronted

a line at problems

Problem:

There

are three
the

to be connected to each of

three

utilities-water

houses (Fig. 1-6)H., H2 , and H 3, each (W), gas (G), and elec-)

Fig. 1-6
tricity
without

Three-uti]ities problem.)
possible

(E)-by
any

means
crossovers

of conduits. Is it of the conduits?

to

make

such connections

conduits

how this problem can be represented by a graph-the the and utility centers are are shown as edges while houses supply ] -7 cannot be drawn vertices. As we shall see in Chapter 5, the graph in Fig. in the plane without edges crossing over. Thus the answer to the problem is

Figure 1-7shows

no.

ElectricalNetwork
input

Problems:

Properties

(such

as transfer
of the

function

and

impedance)

of an electrical network

are functions
forming

only

two factors: such

1. The nature and value of the elements resistors, inductors, transistors, and so
2. The
way

network,

as

forth.

these
network.)))

elements

are connected

together,

that

is,

the

topology

of the

SEC.

1-2)

APPLICATIONS

OF GRAPHS)

5)

Fig.

1-7

Graph of

three-utilities

problem.)

Since tions

there are only a few different in networks are chiefly due to the

types of
variations

electrical elements, the variain topology. Thus electrical

network and synthesis are mainly the study of network In analysis topology. the topological study of electrical 1 and factor 2 is separated from networks, is studied will be clearer in independently. The advantage of this approach to electrical 13, a chapter devoted solely to applying Chapter theory graph

networks.

The topology
a graph

of

a network

is studied
the
electrical

by

means

of an

branches work

electrical network (which consist of


nature

junctions
elements)

of its graph. ]n drawing are represented by vertices, and are represented by edges,

regardless of the
and
its

graph

size of the electrical are shown in Fig. 1-8.)


and

elements. An

electrical

net-

b)

b)

a)

a)

c)

e)

e)

Fig.

1-8

Electrical network

and

its graph.)))

6)

INTRODUCTION)

CHAP.

1)

Seating at

Problem:

Nine

a round

table. They

members of a new decide to sit such that

club every

meet

member

each day for lunch has different

last? How arrangement neighbors at each lunch. many days can this This situation can be represented a graph with nine vertices such that by vertices vertex a member, and an edgejoining two each represents represents the relationship of sitting next to each other. Figure] -9 shows two possible)

9) \\ \\ \\ \\ \\ \\ ---'\\\"\"\"

--

-----r-\\-I I I I I \\

/
I I

J( \\ J---r\\ / \\\\ I I \\ / ........ I \" I \\ / \\ I f\"....... / \\ \\ I \\ -,........... \\ / / I I \\ ................ Y I....... I ....... / \\ I / \\ ......., II ,/'\" ........ / \\./ ./ ........,( ....... / /./\\ / \037....... \\

--

-----

.J-\\ / \\/

/.//

\037./) 5)

Fig.
table.)

1-9

Arrangements

at a dinner

seating

arrangements-these

are

2 3

4 5

6 7 89

(solid

lines),

and

3 5

27

968 1 (dashedlines).It canbe shown there are only two more arrangements 1 795 and 8 3 624 1. In general it can of such possible arrangements is)
n-

considerations that by graph-theoretic I 2 4 6I 5 7 3 9 8 are possible. They the number be shown that for n people

2
and

if n is

odd,

n-2
2)

if n is

even.
of the

The

reader

has probably
are

noticed
and
stage

that

three

four examples
was

of apdone

plications above
four chapters.)

puzzles

not engineering
follow,

problems. This

to avoid introducing

at

this

theory. More substantive

background will applications

material

not pertinent to graph particularly in the last

1-3.

FINITE

AND

INFINITE definition
in

GRAPHS) of a graph neither the vertex set V nor the edge of the theory and almost all applications these)))

Although in our set E need be finite,

most

SEC. 1-4)

INCIDENCE

AND DEGREE)

7)

sets

are finite.

A graph
called

with

a finite

number

ber of edgesis graphs in Figs. Portions of two

a finite

graph;

of vertices as well as a finite numotherwise, it is an infinite graph. The


all

I-I,
infinite

1-2, 1-5,
graphs

1-7, and 1-8are


are shown
in

examples

of finite

graphs.

Fig.

1-10.)

Fig. 1-10

Portions

of two

infinite graphs.)
the

In

this

book

we shall

confine ourselvesto
term

study

of finite

graphs, and
graph.)

unless otherwisestated the

\"graph\"

will always

mean a

finite

1-4.

INCIDENCE

AND DEGREE)
Vi

is an end vertex of some edge ej' Vi and e j are said to be to) each other. In Fig. I-I, for example, edges e 2, e 6 , and e 7 are incident with vertex v 4 \" Two nonparallel edges are said to be adjacent if they are incident on a common vertex. For e 2 and e 7 in Fig. I-I example, are adjacent. Similarly, if they are the end two vertices are said to be adjacent verticesof the same edge. I n Fig. I-I, V 4 and V 5 are adjacent, but v 1 and v 4 are

When a vertex
with

incident

(on or

not.

The number of edgesincident is called the degree, d(vJ, of

on

a vertex Vi. I n

Vi'

with

self-loops

counted
exam

twice,
=) d( V 1)

vertex

Fig. I-I ,

for

pIe,

e1)
VI) e)) V s) es) V2)

Fig.
V)) e6) V4)

1-1

A graph

with

five vertices

and

seven edges.)))

8)

INTRODUCTION)

CHAP.

1)

d(v 3 )
times

== 4, and d(v s) == 1. The degree of a vertex is some2) as its valency. a graph G with Let us now consider e edges and n vertices VI' V 2 , . . . , Vn ' Since each edge contributes two degrees, the sum of the degrees of all vertices in G is twice the number of edgesin G. That is,)
n

== d(v ) == 3, 4 d(v also referred to

L i= Taking

1)

d(v i )

== 2e.

(1-1))

Fig.
d(v
==

1-1 as an
l)

example, once more,)


+
d(v 4)

+ d(v 2 ) + d(v 3) 4 + 3

+ =

d(v s) twice the

3 +

+ 3 + 1 ==
shall

14

number of edges.)
result.)

we From Eq. (1-1)

derive

the following interesting

THEOREM The

I - I)

number

of vertices

of odd degree

in

a graph

is

always

even.)

Proof: quantity
taken

with odd and even degreesseparately, If we consider the vertices in the left side of Eq. (1-1) can be expressed as the sum of two sums, of even and odd degrees, respectively, as follows:) over vertices
n

the

each

i= I

\037

d(Vi)

==

even

\037

d(vj)

\037 odd)

d(Vk).

(1-2))

the left-hand side in Eq. (1-2) is even, and side is even (being a sum of even numbers), right-hand also be even:)
Since
\037 odd)

the

first

expression

the second

on the expression must


(1-3))

d(Vk)

==

an

even

number.
terms

Because
be

even

in Eq. (1-3) each d(Vk) is odd, the total number to make the sum an even number. Hence the
in

of

in the sum
.) a regular I -7 is a

must

theorem.

A graph

which

(or simply of degree three.)


1-5.

a regular).

all vertices The graph

are of equal degree is of three utilities shown

called

in Fig.

graph regular

ISOLATED
AND

NULL

VERTEX, GRAPH)

PENDANT

VERTEX,

words, Fig.

no A vertex having isolated vertices


I

incident

edge

is called an
vertex

isolated vertex.
Vertices
of degree
V4

In and

other
V 7 in
called)))

-I I,

for

with zero are vertices example, are isolated vertices. A

degree.

one is

SEC.

1-5)

ISOLATED

VERTEX,

PENDANT

VERTEX,

AND NULL GRAPH)

9)

e V4)

VI)

V6)

Fig.

1-11

Graph containing isolated vertices,


vertex.)

and seriesedges,

pendant

v 3 in Fig. I-II is a pendant vertex. if their common vertex is of degree on v 1 are in series. In the definition G = (V, E), it is possible for the edge set E to of a graph In other be Such a graph, without is called a null graph. empty. any edges, words, every vertex in a null graph is an isolated vertex. A null graph of six be empty, 1-12. Although the edge set E may the) in Fig. vertices is shown a pendant vertex or an end vertex . Vertex adjacent edges are said to be in series In Fig. I-II, two. the two edges incident
Two

.V I)

e V2)

eV:J)

e V4)

eus)

eU6)

Fig.

1-12

Null graph of
otherwise,

six

vertices.)

vertex

set

must

not

\037e empty;

there

is no
t)

graph. In other

words,

by definition,
tSome the

a graph must have at

least one vertex.

the case in authors (see, for example, [2-9],p. 1, or [] 5-58], p. 17) do allow vertex set V is also empty. This they call the null graph, and they call a graph E = 0 and V*-0 is of no conwith a vertex graph. For our purposes this distinction For out of different definitions of the a lively discussion on paradoxes arising sequence. null graph, see pp. 40-41 in Theory of Graphs: a Basis for Network by L. M. Theory,
which Maxwell

and

M. B.

Reed (Pergamon

Press,

N. Y.

1971).)))

10)

INTRODUCTION)

CHAP.

1)

1-6.

A BRIEF As

HISTORY OF

GRAPH

THEORY)

in

which

years nothing more was done in the field. In 1847, G. R. Kirchhoff (1824-1887) in electrical networks their applications
discovered trees (1821- 1895) saturated hydrocarbons CnH About the time of Kirchhoff

mentioned before, graph theory was born in 1736 with Euler's paper he solved the Konigsberg bridge problem [1-4].t For the next 100
developed

the theory
years

of trees for

[I -6].
trying

Ten

later,

while
2n+ 2 [I

he was -3].
and

to

enumerate

A. Cayley the isomers of


in

Cayley,

two other

milestones
states

graph

theory

were

laid. One was the


for

four-color conjecture,
any atlas

which

that
that

four
the

colors are sufficient

coloring

(a map on a plane) such

countries with common boundaries have different colors. It is believed that A. F. Mobius the four-color (1790-1868) first presented of his in one in lectures 1840. 10 About A. De Morgan problem years later, discussed this with his in fellow mathematicians Lon(1806- 1871) problem don. De Morgan's letter is the first authenticated to the four-color reference well known after Cayleypublished it in 1879 became problem. The problem in the first volume of the Proceedings of the Royal Society. To this Geographic the four-color is the far most famous unsolved day, conjecture by problem in it has an stimulated enormous in the field alTIount of research theory; graph
[1-1

I].

The other

milestone is due to SirW.


a puzzle

R. for

Hamilton 25 guineas

(1805-1865).

In the
manufacturer

year

1859he invented
in

and sold

it

to a

game

consisted of a wooden,regular dodecahedron (a polyeach a face corners, being regular pentagon and three edges meeting at each were marked corner; see Fig. 2-21).The corners with the names of 20 important cities: NewY London, ork, Delhi, Paris, and so on. The object in the a was to find route along the edges of the puzzle 20 of the each cities once dodecahedron, passing through exactly [1-12]. the solution of is this to obtain (as we Although easy specific problem see in Chapter 2), to date no one has found shall a necessary and sufficient in an condition for the existence of such a route (called Hamiltonian circuit) arbitrary graph. This fertile was followed of relative by half a century period inactivity. Then a resurgenceof interest in graphs started during 1920s. One of the the the work of other mathepioneers in this period was D. Konig. He organized
Dublin.

The puzzle
12 faces

hedron

with

and 20

maticians and
published

his

own

and

wrote the

first

book

on

the subject,

which

was

in 1936

[1-7].

The past 30 years has been a periodof intense activity in graph theoryboth pure and applied. A great deal of research has been done and is being)
tBracketed

numbers

refer

to references

at the end of

chapters.)))

CHAP.

1)

REFERENCES)

11)

done
a
in

dozen
the

have bet;n published in this area. Thousands of papers the books written during past decade. Among the field are Claude Berge, Oystein Ore (recently deceased),
Harary.)

and more than current leaders


Paul

Erdos,

William Tutte, and Frank

SUMMARY)

of graph theory have been introduced, basic concepts An attempt has also been have been obtained. results elementary made to show that graphs can be used to represent almost any problem concern is not with the involving discrete arrangements of objects,where
In this

chapter some

and some

internal

properties

of these

objects

but

with

the

relationships

among them.)

REFERENCES)
Busacker recommended. Reed [1-13] is specially suited for [1-9] are good general texts, but are somewhat of the subject. It is compact book [1-5] contains an excellent treatment advanced. Harary's student of graph and is written for an advanced and clear, but it contains no applications one should read [I -8], a welltheory to the rest of topology graph theory. For relating of topology. The entertaining of written book book on important aspects elementary and games to which Rouse Ball [1-12] contains a variety of puzzles have been applied. graphs 1-1. BERGE, C., The Theory of Graphs and Its Applications, John Wiley & Sons, Inc., New des 1962. English translation of the original book in French: Theorie York,
As

and Saaty [1-2]is

text on graph an elementary theory, a good intermediate-level electrical engineers. Berge [I-I] and Ore

Ore's

book [1-10] is
and

book.

Seshu

graphes

1-2.
1-3. 1-4.
1-5.

et ses applications, Dunod Editeur, Paris, 1958. Finite R. G., and T. L. SAATY, Graphs and Networks: An Introduction New York, 1965. with Applications, McGraw-Hill BookCompany, Forms Called Trees,\" Phil. Mag., Vol. CAYLEY, A., \"On the Theory of Analytical 13,1857,172-176. Academimae EULER, L., \"Solutio Problematis ad Geometriam Situs Pertinantis,\" Vol. 8, 1736, 128-140.English translation Petropolitanae (St. Petersburg Academy), in Sci. Am., July 1953, 66-70. HARARY, F., Graph Theory, Addison-Wesley Publishing Inc., Reading, Conlpany,
BUSACKER,

1-6.

Mass., 1969.

KIRCHHOFF, Untersuchungen

G.,

\"Uber
der

Linearen
CT-5,

die Auflosung der Verteilung


March

Gleichungen,

auf

welche

man bei der


wird,\"

Galvanisher

Strome
translation,

gefiihrt

Poggendorf

Ann. Physik, Vol. 72,

1847,497-508. English

IRE

Trans.

1-7.
1-8.

Circuit Theory, Vol.


KONIG, New

1958, 4-7.

D., York,

LIETZMANN,

New York, R. Oldenbourg K. G., Munich, 1955. 1-9. American Mathematical ORE, 0., Theoryof Graphs, Society, Providence, R. I., 1962. 1-10.ORE, 0., Graphs and Their Uses, Random House, Inc., New York, 1963. 1-11. ORE, 0., The Four Color Problem, Academic Press, Inc., New York, 1967.)))

und unendlichen Theorie der endlichen Graphen, Leipzig, 1936;Chelsea, 1950. Visual Topology, American Elsevier Publishing W., Inc., Company, 1965.English translation of the German book Anschauliche Topologie,

12)

INTRODUCTION)

CHAP. 1)

1-12.

1-13.

and Essays, London and New York, BALL, W., Mathematical Recreations New York, 1962. 1892; and The Macmillan Company, S., and M. B. REED, Linear Graphs and Electrical Networks, Addison-Wesley SESHU, 1961.) Mass., Publishing Company, Inc., Reading, ROUSE

PROBLEMS)

1-1. 1-2.

Draw Draw

all simple

houses

1-3. 1-4.
1-5.

Name sented Draw

graphs of one, two, three, and four vertices. problems of (a) two houses and three utilities; (b) four graphs representing and telephone. and four utilities, say, water, gas, electricity, 10 situations problems, etc.) that can be repre(games, activities, real-life the vertices and the edges denote. by means of graphs. Explain what circuit. the graph of the Wheatstone bridge
the

Draw graphs of

following

(d) N203. (Hint:


edges.)

Represent

chemical compounds: (a) CH4,(b) C2H6, (c) C6H6, them by between atoms by vertices and chemical bonds

1-6.

1-7.

Join these Draw a graph with 64 vertices representing the squares of a chessboard. You will vertices appropriately by edges, each representing a move of the knight. see that in this graph every vertex is of degree two, three, four, six, or eight. How many vertices are of each type? such in Fig. 1-13, represent this maze by means of a graph Given a maze as shown a corridor or a dead end (as numbered). An edge reprethat a vertex denotes either mazes that sents a possible (This is one of numerous path between two vertices. were drawn or built by the Hindus, Greeks, Romans, Arabs, etc.)) Vikings,

4 7 8 13
14

12

1 1

21

22

Destina tion

18 17

19 20
15 ]6

10
9)

Fig.

1-13

maze.)))

CHAP.

1)

PROBLEMS)

13)

1-8.

B, and C of capacities8, 5, C are empty. Divide the liquid in in Let a, b, and c be the amounts of liquid equal quantities. [Hint: We have a -I- b + c = 8 at all times. Since at least one A, B, and C, respectively. of the vessels is always empty or full, at least one of the following equations must be satisfied: will fir:1 that a = 0, a = 8; b = 0, b = 5; c = 0, c You always with these there are 16 possible states in this process. constraints (situations) this problem Each vertex 'Stands for a Represent by means of a 16-vertex graph. state and each edge for a permissible of states between its two end vertices. change Now when you look at this graph it will be clear to you how to go from state (8, 0, 0) to state (4, 4, 0).] This is the classical decanting problem.
Decanting 3

problem.

and

gallons, A into two

respectively.

You are given three A is filled, while

vesselsA,
Band

= 3.

1-9.
1-10.

Convince

yourself

that an

infinite

number of edges and infinite number of isolated vertices.


with a finite
that

graph an

with a finite number of edges(Le., a graph infinite number of vertices) must have an

Show

an

infinite

graph
and

with

finite number of vertices pair 1-11.

of

vertices

(or one vertex number of parallel edges. Convince yourself that the maximum
is n

a finite number an infinite number in case of parallel

of vertices a (Le., a graph with of edges)will have at least one by an infinite self-loops) joined
vertex

n vertices

- ].

degree of

any

in a simple

graph

with

1-12. Show
n(n

that

- 1)/2.)))

the maximum

number of edges in

a simple

graph

with

n vertices

is

2)

PATHS

AND

CIRCUITS)

This

chapter

serves
in

two
graph
mainly

purposes.

The

first

is

to

introduce

additional

concepts and terms


and

Euler

graphs,
the

deal
which

degree

of vertices,

is a

be related to

more

global
is

with examples how illustrate to solve actual The celebrated problems using theory. graph Konigsberg bridge problem, which was in Chapter I, will be solved. The solution of the seating introduced also introduced in Chapter I, will be obtained arrangement problem, by means of Hamiltonian circuits.A third which involves problem, stacking four multicolored cubes,will also be solved. These three unrelated problems
to
will

The secondpurpose

theory. concepts, such as paths, circuits, with the nature of connectivity in graphs. The local property of each vertex, will be shown to of the graph. properties

These

demonstrate

the

problem-solving
convince

power of graph
using

theory. The
the di fficulty

reader of

attempt an approach

to solve
will

these problemswithout
quickly

graphs;

may such

him of the

value of graph

theory.)

2-1.

ISOMORPHISM)

In geometry two
gruent)

figures

are

thought

of as
in

equivalent (and called conof

if

they

have

identical behavior
G and
in

behavior
of

terms

geometric

properties.

Likewise, two graphs are thought


they

have

identical
Two

as equivalent (and terms of graph-theoretic

there is a one-to-onecorrespondence between their vertices and between their edges such that the incidence In is other words, preserved. relationship V in that is e incident on and then the vertices G; edge correspondsuppose VI 2 e' in G' must be incident on the vertices V'I and to) v\037that ing edge correspond
14)))

precisely:

graphs

G' are

said to be isomorphic

called isomorphic) if properties. More


(to

each

other)

if

SEC. 2-1)

ISOMORPHISM)

15)

Vs) a)

V4) e) e2)

V3)

e 6)

b) d) VI) es) (b)) V2)

(a))

Fig. and V 2 , respectively.

2-1

Isomorphic graphs.)

Vt

For example,
G, b,

one can

verify

that

the

Fig.

2-1

are isomorphic.
I,

follows: The vertices The edges respectively. e6 , respectively.


Except
graphs

the as The correspondence between c, d, and e correspond to Vt, V 2 , V 3 , V 4 , and v s' to e t , e 2 , e 3, e 4, e s, and 2, 3, 4, 5, and 6 correspond

two graphs is two graphs

in

for the labels


the

are
given

ter I, a

2-2 shows two

of their vertices and edges, isomorphic (i.e., names) in ChapAs indicated same graph, perhaps drawn differently. For can be in different drawn example, Fig. ways. graph many different ways of drawing the same graph.)

Fig.

2-2

Isomorphic graphs.)
whether

are isomorphic. For instance,


isomorphic,
but

It is not always an easy task


just

to determine
the

or not

two given graphs


Fig.

three

graphs
and

shown

in

2-3

are

all

by looking

at them you
redrawing

cannot tell

that.

It is

left as an

exercisefor

the the

reader three

edges,that
It isomorphic
I.

graphs

to show, by in Fig.
by

labeling

the vertices
2-3).
that

and
two

2-3 are isomorphic (seeProblem


the

is immediately apparent graphs must have)


The

definition

of isomorphism

same number
same equal

of vertices.
of edges. of vertices
with

2. The
3.
An

number number

a given

degree.)))

16)

PATHS AND

CIRCUITS)

CHAP.

2)

(a)

(b)

(c)
graphs.

Fig. 2-3

Isomorphic

I
y)

(a))

(b))

Fig.

2-4

Two graphs

that

are

not isomorphic.)

no means sufficient. For instance, the two 2-4 all three are not isomorconditions, they yet graphs satisfy in the and not can be shown That are (b) isomorphic Figs. 2-4(a) phic. graphs as follows: If the graph in Fig. 2-4(a) were to be isomorphicto the one in (b), vertices of degree vertex x must to y, because there are no other correspond in to three. Now in (b) there is only one pendant vertex, a', adjacent y, while to x. there are two u and v, adjacent (a) pendant vertices, is a simple and efficient criterion for detection of isomorphism Finding in unsolved still actively pursued and is an important problem graph theory. I n Chapter II we shall discuss various proposed and their algorithms proof means a for detection of automatic by grams isomorphism computer.

However, these
shown

conditions are by

in Fig.

For
2-2.

now,

we

move

to a

different

topic.)

SUBGRAPHS)

A graph g is said to be a subgraph G if all the vertices and all of a graph the edges of g are in G, and each edge of g has the same end vertices in g as in G. For instance, the graph in Fig. 2-5(b) is a subgraph of the one in Fig. when a subgraph, the original graph must))) 2-5(a). (Obviously, considering

SEC. 2-3)

A PUZZLE WITH

MULTICOLORED

CUBES)

17)

5)

4)

6) 3)

(a))

(b))

Fig.

2-5

Graph (a) and


two
subgraph
thought

one

of its

subgraphs (b).)

not be
theory.

altered by

identifying
of

distinct

vertices.) The

concept

A subgraph

can be

another graph. The a subgraph of G.\"


The

symbol

from

new edges or vertices, or by adding to the concept of subset in set a part of) of as being contained in (or set theory, g c G, is used in stating \"g is is akin

following

observations

can be
subgraph.

made

immediately:)

1.

Every

graph

is

its

own

2. A

subgraph of a subgraph of G is a subgraph of G.


single single

3.

vertex edge

in a in G,

graph G is a subgraph of G. together


with

4. A
G.)

its

end

vertices,

is also

a subgraph of
a graph

Edge-Disjoint

Subgraphs:

Two (or
Figs.

if gl are said to be edgedisjoint For example, the two graphs in


graphs

more) subgraphs gl and


do not have
and
any

g2 of

and g2

edges

in common.

2-7(a)

(b) are
vertices

edge-disjoint subbe vertex dispossibly

of

not have graphs


that

although graph in Fig. 2-6. Note that in common, they may have edge any do not even have vertices in common

the

edge-disjoint graphs do in common. Sub-

are

said to

joint.

(Obviously,

graphs

that

have

no vertices

in

common

cannot

have edges in

common.))
WITH

2-3.
problem

PUZZLE

MULTICOLORED

CUBES)
illustrate,
a problem

Now we shall take


can

brief

pause

to

be solved

by using

graphs. Two stepsare involved


of graph

with an example, how


here:

First,
Second,)))

the physical

problem is converted into

theory.

18)

PATHS AND

CIRCUITS)

CHAP.

2)

the

graph-theory

lem,

solved. problem is then a well-known puzzle available in

Let
toy

us consider the
stores

following

probInstant

(under
every

the name

Insanity).

Problem:
ly

colored

blue,

We are given four green, red, or

cubes. The sixfaces of white. Is it possible to


such

stack

cube are variousthe cubes one on

top

the
factory,

of another four sides


because

to form

a column
have to

that

of

this

column?

(Clearly,
try

no color appears twice on any of a trial-and-error method is unsatis(=

we may

all

41,472

3 x

24 x

24

24)

poss-

ibilities.)

Solution: Step 1 : Draw a graph with for each color (Fig.2-6).Pick a cube

four

vertices
it

and call

cube

B, G, R, and W-one 1; then represent its)

R R

B
R

Cu be

1)

Cu be 2

G
W)

R 2)

R Cub)

R
4)

e3
G

G
B)

B 4

G
R)

W)

Cube

Fig. 2-6 colors.)

Four cubes

unfolded

and

the graph

representing

their

appropriate

three drawn between the vertices with edges, words, if a blue face in cube 1 has a white face opposite to it, draw an edge between vertices Band W in the graph. Do the same for the remaining two pairs of faces in cube l. Put label I on all three cube from I. A self-loop with the edge labeled I at vertex R, edges resulting for instance, would result if cube 1 had a pair of opposite faces both colored)))

three

pairs

of opposite
colors.

faces by

In other

SEC. 2-4)

WALKS,

PATHS,

AND CIRCUITS)

19)

red.
graph

Repeat
until

the procedure
we have

for the other three


with

cubes

one

by one
A

on the same
particular

a graph

four

vertices

and
in

of four

of each vertex is the total number of faces with the corresponding color. For the cubes of Fig. 2-6,we have five blue faces, six green, seven red, and six
w h i te. Consider

colored cubes and their Step 2: Consider the graph

12 edges.
Fig.

set

graph
resulting

are shown
from

2-6.

this

representation.

The degree

the desired column of four cubes, A subgraph (with four will represent these edges) faces-four south and four north. Each of the four edges in this eight facing no color occurs 2, 3, and 4. Moreover, subgraph will have a different label-I, twice on either the north side or south side of the column if and only if every vertex in this subgraph is of degree two.

two opposite
and

vertical sides of

say facing north

south.

Exactly

the

same

argument

applies to the

other two

sides,

east

and west,

of the column.
cubes can be arranged (to form a column such that no color once on any side) if and only if there exist two edge-disjoint subgraphs, each with four edges, each of the edges labeled differently, such that each vertex is of degree and two. For the set of cubes shown in Fig. in Fig. 2-7.) 2-6, this condition is satisfied, and the two subgraphs are shown
Thus

the

four

appearsmore

than

3) B) B) R)

2)

W) W) 2)

G)

(a) North-South Fig.

Subgraph)

(b)
subgraphs

East-West
in

Subgraph)

2-7

Two edge-disjoint

of

the graph

Fig.

2-6.)

2-4.

WALKS, PATHS, AND


A walk

CIRCUITS)

is defined
and

as a

finite

alternating
that

sequence
each

beginning

ending

with vertices, such


following

of vertices and edges, the edge is incident with

vertices
more

than

preceding once

and
in

it.

No

edge appears

(is coveredor traversed)


appear

a walk. instance,

A vertex,

however,

may

more

than

once.
with)))

In Fig.

2-8(a),for

VI a V2 b V 3 C V 3 d V4 e V 2 [v s is

a walk shown

20)

PATHS AND

CIRCUITS)

CHAP.

2)

VI)

VI)

c)

a)

V2)

V2)

V4)

h)

Vs)

V4)

Vs)

(a) An

Open

Walk)

(b) A Pa th

of

Length

Thre\037)

Fig.

2-8

walk

and

path.)

heavy vertices of

lines. and

A walk is

edges constituting

also referred to as an a given walk

edge

in a

train or a chain. The set of graph G is clearlya subgraph

G. and ends are called its terminal vertices. vertices of the walk shown in Fig. 2-8(a). begin and end at the same vertex. Such a walk is vertices are that is not closed (i.e., the terminal
[Fig.

Vertices with which a walk begins Vertices V t and V s are the terminal

It is possible for
called

a walk

to

walk. A walk distinct) is called an open walk


a closed An open walk
in

2-8(a)].
once

(or a simple

path a

or an
V2 b

whereas VI
a path

appears more than elementary path). In Fig. 2-8, VI V 3 C V 3 d V4 e V 2 f V s is not a


which

no vertex

is called

a path

a V 2 b V 3 dV

4 is

a path,
words,

path.

In

other

does not intersect itself. The number of edges in a path is called the an edge which is not a selfthat length of a path. It immediately follows,then, loop is a path of length one. It should also be noted that a self-loop can be included in a walk but not in a path (Fig. 2-8). The terminal of a path are of degree vertices one,and the rest of the vertices (calledintermediate are of degree two. This degree, of course, vertices) is counted to the edges included in the path and not the only with respect entire graph in which the path may be contained. A closed walk in which no vertex (except the initial and the final vertex) more than once is called a circuit. That is, a circuit is a closed, oon-) appears

\"\"'--)

\037)

o)
Three

Fig.

2-9

different

circuits.)))

SEC. 2-5)

CONNECTED

GRAPHS,

DISCONNECTED GRAPHS, AND

COMPONENTS)

21)

In Fig. 2-8(a), v 2 b v 3 d V 4 e V 2 is, for example, are shown in Fig. 2-9. Clearly, every vertex if the circuit is a subgraph of another is of degree two; again, graph, count degreescontributed by the edges in the circuit only.
intersecting

walk.

a circuit.
in

Three

different

circuits

a circuit

one must

circuit

is also

called a

cycle,elementary

cycle,

circular

In
be

electrical confused

a engineering with self-loop.


in this

circuit is sometimes (Every self-loop is section are

referred to as a loop-not to
circuit,

path,

and polygon.
every circuit The arrows
and

but

not 2-10.

is a

self-loop.)
The

definitions the

summarized in

Fig.

are

in

direction
may

You
cuit are

have simple,

very

of increasing restriction. that although the concepts of observed the formal definition becomes involved.)

a path

a cir-

Subgraph

of

G)

Any

collection

of edges

in

G)

Walk

in

G)

of edges of G)

A non-edge-retracing

sequence

A non-Inter\037ecting open walk In C)

Path

C'i

rcui t
G)

in

G)

in
circuits

closed

A non-intersecting walk in G)

Fig.

2-10

Walks, paths,

and

as

subgraphs.)

2-5.

CONNECTED

GRAPHS,
AND

DISCONNECTED

GRAPHS,

COMPONENTS)

if

we

the Intuitively, can reach any

A graph is connected is obvious. 'dness concept of connect, vertex from any other vertex by traveling along the edges.

More formally:
if there between is at least one path G is said to be connected every in the graph in G is For G. disconnected. vertices of instance, Otherwise, pair A null 2-11 in disconnected. the one is is but connected, Fig. Fig. 2-8(a) is disconnected (Fig. 1-12). vertex of more than one graph conIt is easy to see that a disconnected graph consists of two or more a is called of theseconnected nected Each component. The subgraphs graphs. at a of looking Another 2-11 in of two consists way components. graph Fig. G. in a disconnected vertex follows: Considera is as By graph component Vi to Vi. Vertex Vi and all the not all vertices of G are joinedby paths definition, with all the edges incident on vertices of G that have paths to Vi' together A graph
them,

form

a component.

Obviously, a component itself

is a graph.)))

22)

PATHS AND

CIRCUITS)

CHAP.

2)

Fig.

2-11 A disconnected two components.)

graph

with

THEOREM2-1)
A two

graph nonempty,

G is

disconnected
disjoint
in

if

and
VI

only
and

if its

vertex set
that
in

subsets
subset

V 2 such

V can be partitioned into there exists no edge in G

whose

one end vertex is


Suppose

VI and
partitioning

the other
exists.

subset

V 2 .)

Proof:

that such a
that

Consider

a and
a and
be

h of

G, such

h;

otherwise,

there

the other in let G be a disconnected graph. Considera Conversely, are joined be the set of all vertices that by paths to a. SinceG is disconnected, will form a (nonempty) all vertices of G. The remaining vertices VI does not include set V 2 . No vertex in VI is joined to any in V2 by an edge. Hence the partition. .)
in VI and

VI and h E V 2 . No path can would be at leas\037 one edge whose V 2 . Hence, if a partition exists, G E

two arbitrary vertices vertices exist between one end vertex would is not connected. vertex a in G. Let VI

Two interesting THEOREM 2-2)

and useful results involving

connectedness

are:)

If a

graph

(connected be

or disconnected)

has
vertices.)

exact1Y

two

vertices

of odd

degree,

there

must

a path

joining these two


graph

Proof:.

Let G be a

with

all even
holds no and

From Theorem 1-1,which component of a disconnected graph, vertices. Therefore,in graph G, v I


are odd. and hence
THEOREM must

verticest except vertices v I and V2, which for every for every graph and therefore can have an odd number of odd graph V2 must belong to the same component,

have

a path

between them.

.)
edges or
-1

2-3

A simple

and k

components can have


Let
the

graph (i.e., a graph


number

without at most

(n

- k )(n
in

parallel

- k

self-loops)with
edges.)

n vertices

1 )/2

Proof:. be nI, n2,

of vertices
have)

each

of the

k components of a

graph

. . . , nk.

Thus we

n I -t- n 2 +

...

-1-

nk =

n,

ni >

1.)
called

tFor brevity, degree an even

a vertex
vertex.)))

with odd degree is

an odd

vertex, and

a vertex

with even

SEC. 2-6)

EULER

GRAPHS)

23)

The proof

of the

theorem

depends
k \037 nr i -=-1)

on an algebraic

inequalityt)

< n2

(k

1)(2n
ith

- k).
of G Therefore,

(2-1))

Now
number

the maximum
.is of edges

number

connectedgraph)
-1 \037 2 i-I
k

}n,.(n,.
is)

- 1).
k

of edges

in the

component 1-12.)

(See Problem
-)

(which is a simple the maximum

in G I

(n,.

)n,. =

-l
2

( i-I
2

\037

nr

n 2
1)(2n

(2-2))
-

<

2[n
1

(k

k)]

.)

2'

from (2-1))
(2-3))

--=2.(n-k)(n-k+I).
It may

be noted

that

Theorem

2-3 is

a generalization

of the
where

result

in Problem

The solution to Problem] Now we are equippedto ].) duced in Chapter


] -] 2.
2-6.

-12 is given by (2-3), handle the Konigsberg

1. bridge problem intro-

k =

EULER GRAPHS)
Chapter

As mentioned in famous paper in which


paper,

], graph theory was born he solved the Konigsberg bridge

in

1736

with

Euler's
same

problem.In the
In what

type a closed walk running through every edge of G exactly Such a walk is now called an Euler line, and a graph once? that consists of an Euler line is called an Euler graph. More formally: If some closed walk in a graph contains all the edges of the graph, then the walk is called an Euler line and the graph an Euler graph. its very a walk is always connected. Since the Euler line definition By is always contains all the edges of the graph, an Euler (which is a walk) graph isolated connected, except for any isolated vertices the graph may have. Since do not contribute anything vertices of an Euler graph, to the understanding it is hereafter assumed that Euler graphs do not have any isolated vertices and are therefore connected. we shall state and prove an important Now which will enable us theorem, to tell immediately or not a given is an Euler graph.) whether graph
problem:

Euler

posed (and then


possible

solved) a more general

of graph G is it

to find

t Proof:.

I:7-= 1 (n,.

- 1) =
(

k. Squaring

both

sides,

I - 1)

f (ni

- 1)

n2 + k 2 n 2

2nk - 2nk because(ni - 1) > 0,


n 2

or \0377= 1 (n ,2 - 2ni) + k cross nonnegative < n2 + k 2 for all i. Therefore, \0377-= 1 nr

terms =

2nk

+ k2

2n =

(k

- l)(ln

- k).

.)))

24)

PATHS AND

CIRCUITS)

CHAP.

2)

THEOREM

2-4
graph

A given connected

G is

an Euler

graph

if and

only

if

all

vertices

of G are

of even degree.)
an Euler graph. It therefore an Euler line contains this walk we observe that time the walk every meets a vertex v it goes through two \"new\" edges incident on v-with one we v and with the other \"exited.\" \"entered\" This is true not only of all intermediate vertices of the walk but also of the terminal and because we \"exited\" vertex, \"entered\" the same vertex at the beginning and end of the walk, Thus respectively. if G is an Euler graph, the degree of every vertex is even. To prove the sufficiency of the condition, assume that all vertices of G are of even degree.Now we construct a walk starting at an arbitrary vertex v and going once. We continue through the edges of G such that no edge is traced more than we can exit from tracing as far as possible. Since every vertex is of even degree, vertex we enter; the tracing cannot but v. And since v is every stop at any vertex also of even degree, we shall reach v when the tracing comes to an end. eventually If this closed walk h we just traced includes all the edges of G, G is an Euler graph. If not, we remove from G all the edges in h and obtain a subgraph h' of G formed G and h have all their of even degree, vertices by the remaining edges. Since both the of the vertices of h' are also even. h' must touch h at least degrees Moreover, at one vertex a, becauseG is connected. construct Starting from a, we can again a new walk in graph h'. Since all the vertices of h' are of even degree, this walk in h' must terminate at vertex in h' can be combined with h to form a; but this walk a new walk, which and ends at vertex v and has more edges than starts h. This we obtain a closed walk that traverses all the edges process can be repeateduntil of G. Thus G is an Euler graph. .)
G is (which
that Proof: Suppose

is a closed

walk).

In

tracing

Konigsberg Bridge

Problem: Now
find

looking
its

at the

bridges(Fig.
it

1-5),

we

that

not all
is not to lines

vertices

is not

bridges

an Euler graph. Thus it exactly once and return

the

possible starting

graph of the Konigsberg of even degree. Hence, to walk over each of the seven
are

point.)

One often encounters Euler


to

these
without

puzzles

is to
in

find

line

retracing

pictures are shown

med's scimitars and


2-12(b)

is

puzzles. The problemcommon in one continuous picture can be drawn and without lifting the pencil from the paper. Two such in Fig. 2-12(a) is called MohamFig. 2-12. The drawing believed to have come from the Arabs. The one in Fig.
in various
how

a given

course, the star of David. time!) (Equal In defining an Euler line some authors drop the requirement that the walk be closed.For example,the walk a 1 c 2 d 3 a 4 b 5 d 6 e 7 b in Fig. 2-13, which includes all the edges of the graph and does not retrace any edge, is not closed. The initial vertex is b. We shall call such an open vertex is a and the final of a graph without walk that includes (or traces or covers) all edges retracing Euler line. A (connected) graph that has any edge a unicursalline or an open
is, of
a unicursal

line

will

be

called

a unicursal

graph.)))

SEC. 2-6)

EULER

GRAPHS)

25)

(a))

(b))

Fig.

2-12

Two Euler graphs.)

e)

d)

Fig.

2-13

Unicursal graph.)

I t is clear that a unicursallinewe


if and

by shall

adding exactly

get an

only if

it

has

between the initial and final vertices of Euler line. Thus a connected graph is unicursal This two vertices of odd degree. observation can
an edge

be generalized
THEOREM

as follows:)

2-5

In a connected
subgraphs

such

that

graph G with exactly they together contain

2k odd

all edges

vertices, there exist kedge-disjoint of G and that each is a unicursal

graph.)

Proof: Let
(VI, WI),
(Z'2,

the

odd

vertices

WI, W2, . . . , Wk in any W2),...,

arbitrary
(\"-\"k,

of the given order. Add

graph k edges

G be named to G between

VI, the

'V2, . . . , V k ; vertex

pairs

form a new graph G'. Sinceevery vertex of G' is of even degree, G' consists of an Euler line p. Now if we remove from p the k edges we just added (no two of these edges are incident on the same vertex), p will each of which is a unicursalline: be split into k walks, will leave a single first removal unicursal The line; the second removal will split and each successive removal will split a unicursal that into two unicursal lines; until there are k of them. Thus the theorem. .))) line into two unicursal lines,
Wk) to

26)

PATHS AND

CIRCUITS)

CHAP.

2)

We used

shall

interrupt

our

study

of

Euler

graph-theoretic

operations.

One of
be

graphs to define some commonly these operations is required immedilater.)

ately

in the next

section; others will


GRAPHS)

needed

2-7.
As

OPERATIONS ON
is the

case
as the

with

most

mathematical

entities,

it is

convenient to consider
derive
in

a large graph
from those of
vertices define

a combination small

of small ones. Since graphs


natural

ones and are defined

to

terms

its properties of the sets of

and operations

edges,

it is
between

to

employ =

the set-theoretical
and \302\2431)

terminology to

gra phs. I n

particular:

The

union

graph G J (written edge set EJ =

of two graphs GI as G J = G 1 U

(VI'

G 2 ) whose the

E1
G4

Likewise, \302\2432.

vertex intersection GIn


G 2

G 2 = (V 2, \302\2432) is another set V J = VI U V 2 and the

G2 GI
or

is a and

graph

consisting

only

of those
U

G2 of graphs vertices and edges that are


(written

Gland
in both

G 2 . The

ring sum

of two graphs Gland


V 2 and
their

as G

EB G 2 ) is a
1

graph
G 2, are

shown in Fig. 2-14. t It is obvious from their


are

consisting of.the vertex set VI but not in both. Two graphs and
definitions
is,)

of edges

union,

that are either in G and ring sum intersection,

that

the three
G2 =

operations just
n

men-

tioned

commutative.
G 1 U

That
2

= =

G2 U G 2 ffi

G1,
G 1 0)

G 1 n

G2

G p)

G
If G 1 and

ffi

G2

G 2 are

edge

disjoint,

then G 1

G 2 is

G1

G 2 . If Gland For any graph

G2
G,)

are

vertex

disjoint,

a null then Gin


G,

graph,

and
is empty.

G1

ffi

G2 =

G2

G and)

U G

= G

n G=
null

G ffi

G =

graph.

If g

subgraph of remains after all the


as G
G
ffi

is a

G, then

is written = G g

- g, whenever - g is often called


A graph
g2 if)

edges

G ffi g is, by definition, that subgraph of G which G. G ffi g in g have been removed from Therefore, c G. Because of this complementary nature, g the complement
been

of g

in

G.

Decomposition:

G is said to have = G,
=

decomposed

into two

sub-

graphs gland
and)

gl U g2

gl n
tlf

g2

a null

graph.)
G 1 must

an edge

ei is in

two

graphs

G 1 and G 2 , its end vertices in

have the

same labels

as in G'2.)))

SEC. 2-7)

OPERATIONS

ON GRAPHS)

27)

VI)

VI

Ii)

V6)

VI

Ii)

V6)

V2

('

V1

V2

e
Vs

d
V4

V4

G1

G2

GI UG 2)

VI)

VI

Ii)

V6)

V2

('

V3

V2

.V S

V4 f)

e 1 n

e2
Fig.2-14

f' m e
vlw

2)

Union,

intersection, and

ring

sum

of two

graphs.)

In other in gt or in g2' but in both. not words, every edge of G occurseither in occur both and In Some of the vertices, however, may gt g2. decomposim edges {et' e2 , A tion, isolated vertices are disregarded. containing graph m- t . . . , em} can be decomposed in 2 I different into pairs of subways graphs

gl'

g2 (why?).
union,

Although

intersection,

and

of graphs, these definitions can finite number of graphs. Similarly,


than
lectively

be extended
a
that

for a pair ring sum have been defined in an obvious way to include any G can be decomposed into more graph are

two

subgraphs-subgraphs
include

(pairwise)

edge

disjoint

and colof

every
is a

edge in G. vertex
in

Deletion: If Vi

graph

G, then

Vi

denotes

a subgraph

G obtained by deleting G. Deletion of a vertex always (i.e., removing) Vi from (See Fig. 2-15.) If ej implies the deletion of all edges incident on that vertex. is an edge in G, then G - ej is a subgraph of G obtained by deleting e j from G. Deletion of an edge does not imply deletion of its end vertices. Therefore
G

- ej =

E8 e j .)))

28)

PATHS AND

CIRCUITS)

CHAP.

2)

-\\

e. J)

\037) e
I) G)

(G

Vi))

(G

- e j ))

Fig.

2-15

Vertex deletion

and

edge

deletion.)
or every verbut

a, b in a graph are said to be fused (merged vertices are new vertex such that identified) replaced by a single is incident on the new edge that was incident on either a or b or on both tex. Thus fusion of two vertices does not alter the number of edges, reduces the number of vertices by one. See Fig. 2-16 for an example.)

Fusion:

A pair

of vertices

if the two

it

e)

f)

2)

3) f)

4)

c) 7)

c) 7)

Fig. These

2-16

Fusion of

vertices

a and b.)

of the elementary operations on graphs. More complex been defined and are usedin graph-theory literature. For a operations see the paper by Harary and Wilcox [2-10].) survey of such operations
are

some

have

2-8.

MORE

ON

EULER

GRAPHS)
the

The following graphs.)


THEOREM

are some more results on

important

topic

of Euler

2-6

A connected
into

graph G is

an

Euler

graph

if and only

if

it can

be decomposed

circuits.)

into that is, G is a union Suppose graph G can be decomposed circuits; circuits. Since the degree of every vertex in a circuit is two, the edge-disjoint of every vertex in G is even. Hence G is an Euler degree graph.)))

Proof.

of

SEC.

2-8)

MORE ON EULER GRAPHS)

29)

two V2

let G Conversely, incident at edges


is also

be
v

an

Euler

graph. have

Consider

a vertex

VI.

There

are

1. Let

one of
must we

these edgesbe between

v 1 and

V2. Since

at least vertex

V3. Proceeding

of even degree, it in this fashion,

been traversed, thus the remaining graph

the remaining graph r from G. Continue


Arbitrarily

at least another edge, say between V2 and arrive at a vertex that has previously r from G. All vertices a circuit r. Let us remove in forming connected) must also be of even degree. From (not necessarily remove another circuit in exactly the same way as we removed this until no edges are left. Hence the theorem. process .)
eventually Graphs:
that

Traceable

an Euler graph.

Suppose

we

start

Consider the graph in from vertex a and


b)

Fig.

2-17,

which
path

is
c.)

trace the

a b

a)

d)

Fig. from

2-17
c.)

Arbitrarily

traceable

graph

Now

at c
would

we have the
only

choice of

going

to a, Euler

d, or

e. If we

took

the

first choice,
along

we
ing

trace

the circuit

a b c a, which
entire

is not

an Euler
by

line. Thus, startany


interesting Euler to

from
that

a, we
has

cannot trace the


already
must

edge

not

been traversed.
a vertex one

This raisesthe

line simply

moving

following

question:

What property

v in an
follows

line is always obtained when the single rule that whenever

one

arrives

Euler graph have such that an any walk from vertex v according at a vertex one shall select any

edge

(which has not been previously traversed)? Such a graph is called an arbitrarily traceable graph .from vertex v. For the Euler graph in Fig. 2-17 is an arbitrarily traceable from instance, graph vertex c, but not from any other vertex. The Euler graph in Fig. 2-18 is not traceable from arbitrarily any vertex; the graph in Fig. 2-19 is arbitrarily)

Fig. 2-18 traceable.)

Euler

graph;

not arbitrarily

Fig. from

2-19 all

Arbitrarily
vertices.)))

traceable

graph

30)

PATHS AND

CIRCUITS)

CHAP.

2)

traceable

from

all its

vertices. The following


just

interesting

theorem,

due to

Ore

[2-5],answers the
THEOREM2-7)
An

question

raised.)

Euler

circuit
F or

graph G is in G contains v.)

arbitrarily

traceable

from

vertex

in G if

and only

if

every

a proof

of the theorem the


PATHS

reader

is referred

to [2-5].)

2-9.

HAMILTONIAN

AND

CIRCUITS)
was

An Euler line

of a connected graph
that

characterized

being a closedwalk
Hamiltonian

traverses

traverses at which

connected graph is defined as a closedwalk that of G exactly of course the starting once, vertex, except the walk also terminates. For example, in the graph of Fig. 2-20(a))
circuit

every edge

by the property of of the graph (exactly once).A

in a

every vertex

..--)

.)

(a)

(b))

Fig. 2-20
starting

Hamiltonian circuits.)
edges

at

vertex

v, if one
each

traverses along the


exactly

shown

in heavy
shown

linescircuit.

passing
lines.
A

through

vertex

once-one
Fig.

gets a

Hamiltonian

A Hamiltonian

a Hamiltonian every vertex of G.Hence


of exactly example,
tonian condition
n

circuit for the graph in More formally: in a connected graph G is circuit


edges.

2-20(b)
be

is also
Hamiltonian

by

heavy

said to

if it
vertices

includes
consists

circuit

in a

graph of n

Obviously,

not every connected graph has a Hamiltonian circuit. For in Figs. 2-17 and 2-18 has a Hamilneither of the graphs shown This raises the question: What is a necessary and sufficient circuit. for a connected graph G to have a Hamiltonian circuit?)))

SEC. 2-9)

HAMILTONIAN

PATHS

AND

CIRCUITS)

31)

Dodecahedron)

(a)
Fig.
circuit.)

(b))

2-21

Dodecahedron

and its graph shown

with

a Hanliltonian

This Rowan

mentioned in Chapter I, Hamilton made a regular dodecahedron of wood [see Fig. 2-21 (a)], each of whose 20 corners was marked with the name of a city. The puzzle was to start from any city and find a route along the edge of the dodecahedron that passes through every city exactly once and returns to the city of origin. The of the is given in Fig. 2-21 (b), and one of many such dodecahedron graph routes Hamiltonian (a circuit) is shown by heavy lines. The resemblance between the problem of an Euler line and that of a Hamiltonian circuit is deceptive. The latter is infinitely more complex. Alone can find Hamiltonian circuits in many specific graphs, such as though in Figs. 2-20 and 2-21, there is no known those shown we can apply criterion to determine the existence of a Hamiltonian circuit in general. There are, contain Hamiltonian however, certain types of graphs that always circuits,still

problem, Hamilton

first posed in 1859, is

by

the

famous

Irish mathematician
As was

Sir

William

unsolved.

as
we

will

be

presently

shown.
anyone edge from a Hamiltonian circuit, is called a Hamiltonian path. Clearly,

Hamiltonian Path: If we remove are left with a path. This path


path path of

Hamiltonian tonian graph a

is a

vertex of graph G traverses every a of Hamiltonian circuit (which subgraph

in a

G. Since a Hamilin turn is a sub-

circuit (or path) only consider simple graphs. This is becausea Hamiltonian traverses every vertex exactly once.Henceit cannot include a self-loop or a set of parallel edges. Thus a general graph may be made simple by removing before parallel edges and self-loops looking for a Hamiltonian circuit in it. I t is left as an exercise for the reader to show that neither of the two graphs)))

has a Hamiltonian circuit also has graph), every graph that There with Hamiltonian are, however, path. many graphs have no Hamiltonian circuits (Problem 2-23). The length of a paths that in a connected graph of n vertices Hamiltonian path (if it exists) is n - I. In considering the existence of a Hamiltonian circuit (or path), we need

another

Hamiltonian

32)

PATHS AND

CIRCmTS)

CHAP.

2)

(a))

(b))

Fig. 2-22

Graphs
Hamiltonian

without

Hamiltonian circuit

circuits.) (or

shown
What

Problem 2-24.
general

in Fig.

2-22 has a
class

Hamiltonian
a Hamiltonian

path). See
circuit?

of graphs is
or

guaranteed to have
vertices
in

Complete graphs of three


Complete every

more

constitute
there

one such class.


exists
A

Graph:

A simple

graph

which graph.

an edge
graphs
complete

between
of two,
graph
is)

pair

of vertices
five

is called
vertices

complete

Complete

three, four, and

are

shown

in Fig.

2-23.

.)

.)

6)
Complete

Fig.

2-23

graphs of

two,

three,

four, or a Also

and

five

vertices.)

sometimes

also referred
every

to as a universal
vertex Problem
a

graph

is joined with
is
in n

other

a complete G is n(n - 1 )/2. See


1

through one edge, the

in

graph G

of n

vertices.

clique. Since every vertex of every vertex degree the total number of edges

1-12.
circuit
v p v 2,

It is easy
vertices.

to
two

construct

Hamiltonian
n

in a

Let

the vertices
vertices, and
of one

be

umbered

. . . , V n.
and

complete graph of n Since an edge exists


to v 2, and v 3 , and

betweenany
so on

we can start
Vn

from

v I

traverse

to
than

v n'

finally from
Hamiltonian Hamiltonian
in

to

VI. This is

a Hamiltonian circuit.

Number

more

Hamiltonian
edge-disjoint

circuits

Hamiltonian

A given graph may contain Circuits in a Graph: circuit. Of interest are all the edge-disjoint The determination of the exact number of graph. circuits (or paths) in a graph in general is also an
the

unsolved problem.However,

number

of edge-disjoint

Hamiltonian

cir-)))

SEC. 2-9)

HAMILTONIAN

PATHS

AND

CIRCmTS)

33)

cuits in a
2-8.)

complete graph

with

odd

number

of vertices is given

by

Theorem

THEOREM 2-8
In

a complete

tonian
Proof.

circuits,

if

n is

graph with an odd

n vertices
number

there are (n
>
3.)

- 1)/2edge-disjoint - 1)/2 edges, and


a

Hamil-

of edge-disjoint edges. Therefore, the number in G cannot exceed (n - 1)/2. That there are (n - 1)/2 edgeHamiltonian as follows: when n is odd, can be shown disjoint circuits, The subgraph (of a complete of n vertices) in Fig. 2-24 is a Hamiltonian graph circuit. the vertices fixed on a circle, rotate the polygonal clockwise) Keeping pattern
5)

tonian

circuit in Hamiltonian circuits

A complete graph G of G consists of n

vertices

has

n(n

Hamil-

- 2)

2)

n)

4)

n -- 3)

Fig.

2-24

Hamiltonian

circuit;

IS

odd.)

by

360/(n

- 1),2.360/(n
with

1), 3. 360/(n -

Observe common

that
all

each rotation any of


the

produces a
ones.

1),. . . ,

(n

previous

circuits,
themselves.
This

edge

disjoint

Hence the
theorem

from the one theorem. .) us to

Thus we have (n - 3)/2 new Hamiltonian in Fig. 2-24 and also edge disjoint among

Hamiltonian

circuit

3)/2. 360/(n - 1) degrees. that has no edge

in

solve the problem of the seating arrangement table, I, as follows: Chapter x a the possibility of his sitting next member vertex and a Representing by G. member y by an edge between x and y, we construct a graph to another G to any other is a comSince every member is allowed to sit next member, of nine vertices-nine being the number of peopleto be seated plete graph the is clearly a table the table. Every seating arrangement around around Hamiltonian circuit. The can sit in any order, and it will be a first day of their meeting they if Hamiltonian circuit HI. The second they are to sit such that every memday, we have Hamiltonian cirto find another ber must have different neighbors, that is,))) different set of edges from those in HI; cuit H 2 in G, with an entirely
enables

at a round

introduced

in

34)

PATHS AND

CIRCUITS)

CHAP.

2)

Theorem 2-8 the edge-disjoint Hamiltonian circuits. From in G is four; therefore, only of edge-disjoint Hamiltonian circuits exist among nine people. four such arrangements result Another on the question of existence of Hamiltonian interesting in a graph, obtained by G. A. Dirac, is:) circuits HI

and

H 2 are

number

THEOREM

2-9

A sufficient

(but
number

by

no

means is that
in

have a

Hamiltonian the

circuit

necessary) condition for the degree of every vertex


G.)

a simple

graph
at

G to
n/2,

in G

be

least

where n is
Proof:

of vertices
the

For proof

reader

is referred

to

the

original

paper

by Dirac

[2-3].)

2-10.

TRAVELING-SALESMAN

PROBLEM)

to the question stated as follows: traveling-salesman problem,


A problem

closely related
during

of Hamiltonian
A

circuits is the

salesman

is required

to

visit

number

of cities

what

order should

he travel

in trip. Given the distances between the cities, and once return so as to visit every city precisely

home, with the minimum mileage traveled? the and the roads between them cities vertices by edges, Representing by is associated a real we get a graph. In this graph, with every edge ej there number (the distance in miles, say), wee;). Such a graph is called a weighted
graph; w(eJ being In our problem,

of the cities has a road to every other city, we have a complete Hamiltonian circuits, weighted graph. This graph has numerous and we are to pickthe one that has the smallest sum of distances (or weights). of course) Hamiltonian The total number of different (not edge disjoint, circuits in a complete graph of n vertices can be shown to be (n - I) !j2. This
follows

the weight if each

of

edge

ej .

from

the

fact that
first

starting

from

choose

from the

vertex,

- 2

any
the

vertex
second,

we have
n

from

edges

to

and so
of
tonian

on. Thesebeing
circuit

independent

choices,

choices.

This number is, however, has been counted twice.


problem

we get (n possible divided by 2, because each

from

the

third,

I)!

number

Hamilsolved

Theoretically,the
by enumerating

all (n
and labor

- I)!j2Hamiltonian

of the

traveling salesman
circuits,

can always
for

be

calculating

the distance
a large
(try

traveled value of
solving

in n,

each, the

then picking the shortest involved is too great even


the

one.
for

However,

a digital

computer

it for

of arbitrary size has yet been No efficient algorithm for problems has found, although many attempts have been made. Sincethis problem have in operations research, some specific large-scale examples applications There are also available several heuristic methods))) been worked out (see [2-1]). est route.

The problem is to prescribe

the 50 state capitals in

United

States; algorithm

n =

50).
finding

a manageable

for

the

short-

CHAP.

2)

REFERENCES)

35)

of solution

that

give

a route

very close

to the

shortest

one,

but do not

guar-

antee the
SUMMARY)

shortest

(see

[2-4] for

such a

method).)

In this

chapter we discussed the


paths,

subgraph-a graph that


lines, Hamiltonian

is part

of another

graph.
tonian

Walks,

circuits,

Euler

paths, and Hamil-

in a graph G are its subgraphs with special properties. A given circuits in terms of the presence or absence and studied graph G can be characterized these of by graphs Many physical problems can be represented subgraphs. and solved by observing the relevant properties of the corresponding graphs. of walks discussed in this chapter are summarized in Fig. Various types 2-25. The arrows point in the direction of increasing restriction.)

Hamiltonian

Hamiltonian

Arbi trarily
traceable)

path)

circui t)
Fig.

2-25

Different types of

walks.)

REFERENCES)

Textbooks mended are

listed

in

Chapter

1 are

to be

read

for

this chapter

also.

Specially

recom-

1. Berge [1-1], Chapters

1, 7,

2. Busacker
3. Harary 4.

and

Saaty [1-2],
7. 2 and

11, and 17. Chapters 1,3, and 3.

6.

[1-5],Chapter Ore [1-9],Chapters

5. Ore [1-10], Chapters

1 and 2.)))

36)

PATHS AND Seshu and

CIRCmTS)

CHAP.

2)

6.

For arbitrarily

Reed [1-13], Chapter traceable graphs,


of Hamiltonian

2. one

mation on
Smith [2-6], also devoted

properties

should read Ore's graphs can be found

4 and 5 of Tutte's book [2-9] are Dirac [2-3].Chapters and Euler paths. On the traveling-salesman to paths problem there are and Nemhauser [2-1] summarize and list Bellmore many papers. In an excellent survey the Hamiltonian-path most of these papers. Deo and Hakimi [2-2] generalized problem and applied it to a wiring problem in computers. 2-1. \"The Salesnlan Problem: A BELLMORE, M., and G. L. NEMHAUSER, Traveling 538-558. Survey,\" Operations Res., Vol. 16, 1968, \"The Shortest Generalized Hamiltonian 2-2. Tree,\" Proc. DEO, N., and S. L. HAKIMI, Third Annual Allerton 1965, 879-888. Conf, University of Illinois, for Graphs,\" Quart J. Math. Theorems 2-3. Oxford, DIRAC, G. A., \"Connectivity Sere (2), Vol. 3,1952,171-174. 2-4. LIN, S., \"Computer Solution of the Traveling Salesman Problem,\" BSTJ, Vol. 44, and

infor[2-5]. Additional paper in papers by Tutte [2-8],

Ore

Tutte

[2-7], and

2-5.
2-6.

2-7.

2-8.
2-9.

Rev. Elementary Math., Regarding the Tracing of Graphs,\" Vol. 6, 1961,49-53. Vol. 67, 1960,55. Am. Math. Monthly, ORE, 0., \"Note on Hamilton Circuits,\" Paths in a Network of Degree \"On Unicursal C. A. B., and W. T. TUITE, SMITH, Am. Math. Monthly, Vol. 48,1941,233-237. Four,\" Math. W. T., \"On Hamiltonian Soc., Vol. 21, 1946, TUITE, Circuits,\" J. London
ORE,

1965, 2245-2269. 0., \"A Problem

98-101.
TUITE,
HARARY,

2-10.

W. T., Connectivity F., and G. 'N.

WILCOX,

in Graphs, University of Toronto on \"Boolean Operations

Press,

Toronto,

1966.
Scand.,

Graphs,\" Math.

Vol. 20,

1967,41-51.)

PROBLEMS)

2-1.
2-2.
2-3.

Verify

that

vertices
Show

the two graphs and edges.

in

Fig.

2-2 are

isomorphic. Label (b) and


(c) in

the

corresponding

by redrawing,

step

by

step,

that graphs 2-26(a)

Fig. 2-3 are

isomorphic

to (a).

Show that

the

two graphs

in

Figs.

and (b) are

isomorphic.)

(a))

(b))

Fig.

2-26)))

CHAP.

2)

PROBLEMS)

37)

2-4.

2-5.
2-6.

Construct three more examples to for isomorphism are not sufficient Prove that any two simple connected
isomorphic.

show

that conditions 1, 2, and 3 in Sec1ion 2-1 between graphs. with n vertices, all of degree two, are graphs
Why?)

Are the two

graphs

in

Fig.

2-27 isomorphic?

Fig.

2-27)

2-7.

Given the set of cubes


all four cubes into a

represented

column such
graph
with

by the graph in Fig. 2-6, is one that each side shows only

n vertices must be connected Use Theorem 2-3.) into two subgraphs gi and g2, 2-9. Prove that if a connected graph G is decomposed there must be at least one vertex common between gi and g2. 2-10. Prove that a connected graph G remains connected after removing an edge ei from G, if and only if ei is in some circuit in G.

2-8.

Prove that a - 1)(n [en

simple

it possible to stack color? Explain. if it has more than

2)]/2

edges.

(Hint:

2-11.
2-12.

Draw

a connected

graph

that

becomes

disconnected

when

any

edge

is removed

from it.
n vertices satisfying the condition of Problem 2-11 is (a) Prove that a graph with simple, and (b) has exactly n - 1 edges. from the entrance to the center of the maze in is the length of the path What Problem

2-13.
2-14.

1-7?

5 and 6 in Fig. 2-5(a). Give the length List all the different paths between vertices of each of these paths. Demon2-15. paths. Group the paths listed in Problem 2- 14 into sets of edge-disjoint a pair of vertices forms strate that the union of two edge-disjoint paths between a circuit. 2-16. In a graph G let P I and P2 be two different between two given vertices. Prove paths in G. that PI EB P2 is a circuit or a set of circuits 2-17. Let a, b, and c be three distinct vertices in a graph. There is a path between a and b and also there is a path between band c. Prove that there is a path between a and c. 2-18. If the intersection of two paths is a disconnected graph, show that the union of the two paths has at least one circuit. 2-19. You are given a IO-piece domino set whose titles have the following set of dots: (1,2); (1,3); (1,4); (1,5); (3,4); (3,5); (4,5). Discuss the (2,4); (2,5); of arranging the tiles in a connected series such that one number on a possibility title touches the same number on its neighbor. (Hint: Use a five-vertex always complete graph and see if it is an Euler graph.) 2-20. Is it possible to move a knight on a chessboard such that it completes every per-)))

(2,3);

38)

PATHS AND missible

CIRCUITS)

CHAP.

2)

less of
cursal

the

move exactly once? A in which direction

move
it

between

is made.

two squares is counted as one regard(Hint: Is the graph of Problem 1-6 uni-

?)
tournament against every other) among (when every player plays can be represented by a complete graph of n (n being an even number) to finish in the shortest Discuss how you would schedule the tournaments there

2-21.

A
n

round-robin

players vertices.

possible time.

2-22. Observethat
a graph.

can be no path

longer than

a Hamiltonian

path (if

it

exists)

in

2-23. 2-24.

that has a Hamiltonian a Hamiltonian circuit. path but does not have of the graphs in Fig. 2-22 has a Hamiltonian path (and therefore no Hamiltonian circuit). [Hint: For Fig. 2-22(a), of all the edges incident at a vertex two can be included in a Hamiltonian circuit. Count the number of edges only be excluded from Fig. that have to be excluded. You will find that 13 edges must of remaining to form a Hamiltonian circuit. 2-22(a). The number edges is insufficient For Fig. 2-22(b), first consider all vertices of degree two.] 2-25. Show that the graph of a rhombic dodecahedron (with eight vertices of degree three no and six vertices of degree four) has no Hamiltonian path (and therefore Hamiltonian circuit). 2-26. Draw a graph in which an Euler line is also a Hamiltonian circuit. What can you say about such graphs in general? 2-27. Is it possible, starting from of the chessboard, to move a any of the 64 squares such that it occupies every knight square exactly once and returns to the initial circuit in the position? If so, give one such tour. (Hint: Look for a Hamiltonian graph of Problem 1-6.) 2-28. Prove that a graph G with n vertices always has a Hamiltonian path if the sum of the of every pair of vertices degrees' Vi, V j in G satisfies the condition
Draw

a graph that

Show

neither

2-29.

d(vj) > n - 1. (Hint: First show that G is connected. Then use induction on path length in G.) Using the result of Problem 2-28, show that in a dancing ring of n children it is the children so that everyone has a friend at each side if always possible to arrange
d(v;) +
every

child enjoys friendship

with

at least

half the

children.)))

3)

TREES

AND

FUNDAMENTAL

CIRCUITS)

The of a tree is probably the most important in graph concept theory, of graphs. In the first half of this especially for those interestedin applications As usual, we shall point chapter we shall define a tree and study its properties. out some of its applications to simple situations and games, and puzzles scientific till deferring the applications to more complex problems Chapter 12. Other graph-theoretic terms related to trees will also be introduced and

discussed.
important

introduces the spanning tree-another chapter circuits, theory of graphs. The relationships among 1 trees, and so on, in a graph are explored. Unavoidably, as with Chapters and 2, this chapter also has a large number of definitions. In studying any new branch of mathematics, there is no way to avoid new terms and definitions.)
of

The secondpart
notion

the

in the

3-1.

TREES)

A tree is a connected graph without any circuits. for instance, is a tree. Treeswith one, two, three, and in Fig. 3-2. As pointed out in Chapter], a graph must so must a tree. Someauthors and therefore allow the We vertices. have an excluded such from any entity
as

The graph in Fig. 3-1, four vertices are shown

have at least one vertex, null tree, a tree without being a tree. Similarly,

we are
It

considering
is,

follows
that

graph,

our trees are also finite. graphs, the from definition that a tree has to immediately neither a nor having edges (because self-loop parallel
only

finite

be a simple
they both
is

form circuits).

Trees appearin

numerous

instances.
39)))

The genealogy

of a

family

often)

40)

TREES AND FUNDAMENTAL CIRCUITS)

CHAP.

3)))

u)

Fig.

3-1

Tree.)

.)
I)

Fig.

3-2

Trees

with

one,

two, three, and four

vertices.)

IV

Fig.

3-3

Decision tree.)

SEC. 3-2)

SOME

PROPERTIES

OF TREES)

41)

represented by means of a A river with its tributaries

tree (in

The sorting of

mail

according

are done
local office,

fact the term tree comes fromfamity tree). and subtributaries can be represented by a tree. to zip code and the sorting of punched cards

according
might

to a

tree (called
the

decisiontree
mail.
digit

or
All

sorting
the

at some zip code is read at N, N 2 , . . . , N 9 , and and the mail is divided into 10 pilesNt, No, depending on 10 the most significant is further divided into Each piles according digit. pile to the second most significant digit, and so on, till the mail is subdivided into
represent

Figure 3-3

flow of

mail

tree). arrives

vertex

N. The

most

significant

in the

105
in

possible piles, each representing a unique five-digit zip code. In many sorting problems we have only two alternatives (instead

of 10 as
a dicho-

the

preceding

example)

at each

with tree or small, tomy, such as large good in computer and two choices at each vertex occurs frequently programming We shall deal with such trees and their applications in Secswitching theory. a few simple but tion 3-5. Let us first obtain theorems on the geneimportant

intermediate vertex, representing or bad, 0 or ]. Sucha decision

ral properties of
3-2.

trees.)

SOME
3-1)

PROPERTIES OF

TREES)

THEOREM

There is

one and

only

one path

between every pair of vertices in


there

a tree,

T.

every

Since T is a connected graph, Proof: pair of vertices in T. Now suppose there are two distinct paths. The union be a tree. and T cannot .)

must exist at least one path between a and b of T that between two vertices a circuit of these two paths will contain

Conversely:)
THEOREM

3-2)

If in a

graph G

there

is one

and only one

path

between

every

pair of

vertices,

G is a

tree.)

G is of a path between Existence every pair of vertices assures that Proof. that there is in a graph (with two or more vertices) implies connected. A circuit at least one pair of vertices G, b such that there are two distinct paths between a and b. Since G has one and only between every pair of vertices, G can one path no circuit. have Therefore, G is a tree. .)
THEOREM

3-3)
with

A tree

n vertices
theorem

has
will

1 edges.)
by

Proof: The

be proved

induction

on

the number

of

vertices.)))

42)

TREES AND FUNDAMENTAL CIRCUITS)

CHAP.

3)

T)

Fig.

3-4

Tree T with

n vertices.)

is true for n = 1, 2, and 3 (see Fig. 3-2).Assume with fewer than n vertices. Let us now consider a tree T with n vertices. In T let ek be an edge with end V j. According vertices to Theorem 3-1, there is no other path between Vi and Vi and the graph, as deletion of ek from T will disconnect eke Therefore, Vj except in Fig. 3-4. Furthermore, shown T - ek consists of exactly two components, and since there were no circuits in T to begin with, each of these components is a tree. Both these than n vertices each, and trees, (1 and (2, have fewer therefore, by the induction hypothesis, each one less edge than the number of vertices in it. contains Thus T - ek consists of n - 2 edges n - 1 (and n vertices). Hence T has exactly
the

It is

easy to see that


the theorem

theorem
all

that

holds for

trees

edges. .)
THEOREM

3-4)

Any Proof:

connected

graph

with

n vertices theorem

and n
is left

- 1 edgesis a
the

tree.)

The proof

of the

to

reader

as an

exercise (Problem

3-5).)
have noticed another may important feature of a tree: its vertices connected the minimum with number of edges. A connected together be is said to if connected removal of graph minimally anyone edge from it the graph. A minimally connected graph cannot disconnects have a circuit; we could remove one of the in the circuit and still leave the otherwise, edges connected. a is Thus connected a tree. graph minimally graph Conversely,if

You

are

a connected

graph

G is not minimally

ei

in

G such
that

that G
G is

- e,. is

connected, there
Therefore,
following

must

exist

an

connected.

e; is

in

some

circuit,

edge which

implies

not a

tree. Hence the

theorem:)

THEOREM 3-5)
A

graph

is a

tree

if

and

only

if it

is

minimally

connected.)

The

significance is n

of Theorem
distinct

3-5 is obvious. Intuitively,


the

one

can

see that
segments

to interconnect n
needed

- 1.It requires

points,
no

background

minimum number of line in electrical engineering

to realize)))

SEC. 3-3)

PENDANT

VERTICES

IN A

TREE)

43)

e)

g.)

g2)

Fig.3-5

Edge e added

to

G =

gl U g2.)

n pins together, one needsat least n - 1 pieces of wire. The resulting to Theorem 3-5, is a structure, according We n vertices snowed that a connected graph with and without any cirWe cuits has n - 1 edges. can also show that a graph with n vertices which connected has no circuit and has n - 1 edges is always (i.e., it is a tree), in the following theorem.)
that

to

short

(electrically)

tree.

THEOREM 3-6)
A

graph

G with n

vertices,

1 edges,

and no

circuits

is connected.)

Proof:
which

Suppose

there

is disconnected.

exists a circuitless In that case G will

graph G with
consist

n vertices

and n

of two

or more

- 1 edges circuitless com-

ponents.
Add path cuitless,

an

Without loss of generality, let G consist of two gl and g2. components, V2 in g2 (Fig. 3-5). Since there was no edge e between a vertex v 1 in gland v 1 and V2 in G, adding e did not create a circuit. Thus G U e is a cirbetween and n edges, which is not possible, connected graph (i.e., a tree) of n vertices

because of
The

Theorem3-3. .)
of the

results

preceding
different

six theorems
but

can be summarized

by

saying
is,

that the following are five n vertices a graph G with


].

equivalent

definitions of a tree.That

is called

a tree if)

G is
G

connected and is circuitless,


and has
n

or
or

2.
4.

is connected

edges,

3. G is
There

circuitless and has n


is exactly
minimally

1 edges,

or
of

one path
connected

between every pair


graph.)

vertices

in G,

or

5. G is a

3-3.

PENDANT VERTICES
You

IN

TREE)
each

observed that several pendant vertices (a pendant


must have

of the was

vertex

trees shown in the figures has defined as a vertex of degree)))

44)

TREES AND FUNDAMENTAL CIRCUITS)

CHAP.

3)

Start)

1 1)

I I)

I I)

I I)

Fig.

3-6 Tree of 13,7,0,2,8,11,3.)

the

monotonically

increasing

sequences

in

4,

1,

we have n - 1 edges, and hence one). The reason is that in a tree of n vertices to be divided Since no vertex can be of 2(n 1)degrees among n vertices. zero we must have at least two vertices of degree one in a tree. This degree, of course makes senseonly if n > 2. More formally:)

THEOREM

3-7)
tree

In

any

(with

two or

more vertices), there

are

at least

two

pendant

vertices.)

The following problem is used in teaching Application: computer a sequence of integers, Given no two of which are the same, programming. in it. Suppose find the largest monotonicallyincreasing subsequence that the be us is it to can 4, 1, 13,7, 0, 2, 8, 11, represented sequence given by a tree in the which start the vertices individual numbers (except vertex) represent in the sequence, and the path from the start vertex to a particular v vertex the monotonically increasing subsequence in describes v. As terminating shown in Fig. 3-6, this sequence contains four longest monotonically increasAn

3;

ing

subsequences, 11). Each is of


data

that is,
length

and 11), (1,2,8, (4,7,8, 11),(1,7,8, 11),

(0,2,8,

four.

Such

a tree

used

in

representing

data

is referred

to as a

tree

by computer

programmers.)))

SEC.

3-4)

DISTANCE AND

CENTERS

IN A TREE)

45)

3-4.

DISTANCE The tree


in

AND CENTERS
3-7 has

IN

TREE)
it seems

Fig.

located more \"centrally\"

than

four vertices. Intuitively, any of the other

that

vertex b is
shaH

three vertices. We

ex-)

a)

d)

h)

Fig. 3-7

Tree.)
\"center\"

plore

this

idea

further

and see If

In

a tree

there

exists a

(or

centers).

Inherent

in the

distance before In a connected graph


Vi

concept of a center is the idea we can talk of a center.


G, of

of \"distance,\"

so we must

define

the

and

v j is

the

length

the

distance d( Vi' V j) between two of its vertices shortest path (i.e., the number of edgesin the between any two

shortest

path)

between them.
of

The definition
nected graph (not

distance

vertices is

valid

for

any

con-

necessarilya tree).In a graph that is not a tree, there are all between a pair of vertices. We have to enumerate several paths generaHy these paths and find the length of the shortest one. (There may pe several
shortest

paths.)
the

For instance, some of

paths

between
h),

(a, e),(a, c,f), (b,


paths,

c, e),

(b,f),

(b, g,
length

and

(b, g,

(a, e) and (b,f), In a tree, sincethere 3-1), the determination

each of
is exactly

two.

vertices VI and V 2 in Fig. 3-8 are i, k). There are two shortest Hence d( VI' V 2 ) = 2.
two

one path

between any

vertices

(Theorem

of distanceis much easier. For instance, in the tree of Fig.3-7,dCa, b) = I, dCa, c) = 2, d(c,b) = 1,and so on. A Metric: Before we can legitimately varicall a function f(x, y) of two
ables

a \"distance\"

between them,

this

function

must

satisfy

certain require-

ments.These are)
d)

VI)

g)

Fig.

3-8

Distance between v

and

V2 is two.)))

46)

TREES AND FUNDAMENTAL CIRCUITS)

CHAP.

3)

].

Nonnegativity:

f(x,

y) >
==

0, andf(x, y)
x).

0 if and

only

if x

= y.

2. Symmetry:
3. Triangle
A

f(x, y)

fey,

inequality: f(x, y) <


v j ) between

f(x,

z)

+ fez,

y) for

any

z.)

satisfies these three conditions is called a metric. That the two vertices of a connected graph satisfies condi2 is immediately evident. Sinced( and of the shortVi' V j) is the length v between est path vertices Vi and j ' this path cannot be longer than another a specified vertex v k . Hence d(v i , path between Vi and v j ' which goes through v j ) < d(vi , v k ) + d(v k , v j ). Therefore,)
function

that

distance tions 1

d(v i ,

THEOREM

3-8)

The

distance

between vertices of a
topic
term

connected

graph

is a metric.)
different

in a

Coming back to our original tree, let us define another


or

of relative
called

location of
a graph.

vertices

eccentricity
in

(also referred to

as

number associated

separation)

of a

vertex

The eccentricity the

V in E(v) of a vertex vertex farthest from V in G; that is,)

a graph

G is the distance from

V to

E(v)

==

max
VjEG)

d(v,

vJ.

G is called a center of G. The A vertex with minimum eccentricity in graph == of the four vertices in Fig. 3-7 are E(a) = 2, E(b) eccentricities 2, E(c) and E( d) = 2. Hencevertex tree. On the other hand, b is the center of that consider the tree in Fig. 3-9. The eccentricity of each of its six vertices is shown the same minimum next vertices to the vertex. This tree has two having this tree authors refer to such cenHence has two centers. Some eccentricity. will be no ters as bicenters,. we shall call them just centers, because there

= 1,

occasion for confusion.

The readercan easily


For example,in a is a center. In the
theorem:) THEOREM 3-9)
Every

graph
case

has many centers. that a graph, in general, verify that consists of just a circuit (a polygon), every vertex the of a tree, however, Konig [1-7] proved following

tree

has either

one or

two

centers.)

3) 3)

3)))

Fig

3-9

Eccentricities of the

vertices

of

a tree.)

6
6)

6)

4
5

4 6

(a))

.
4)

r)
3)

.
2)

.)
3)

.
4)

T')

(b))

.
2)

.
I)

.
2)

T\

(c))

.
o)

Cen

ter

(d))

Fig.

3-10

Finding a center of a
d(v,

tree.)

Proof:

The
Vi

maximum
occurs

distance, max
when
Vi

Vi),

from

a given
With

other vertex

only

is a

us start with more pendant


resulting

a tree
vertices

having

more

pendant vertex. than two vertices.


all

this

Tree T
of

V to any let observation, must have two or

vertex

(Theorem

3-7). Delete
What

the

pendant

vertices from
the

T. The
in T'?

graph deliberation

T' is still a

tree.

about

the eccentricities

vertices

removal of all pendant vertices from Tuniformly in T') by one. reduced the eccentricities of the remaining vertices (i.e., vertices centers in T'. From that T had as centers will still remain Therefore, all vertices tree T\". We continue T' we can again all pendant vertices and get another remove a vertex this is illustrated in Fig. 3-10) until there is left either process (which the two of T). is center are the centers of or an end vertices edge (whose (which T) A little
will reveal that
Thus

the

theorem.

.)
47)))

48)

TREES AND

FUNDAMENTAL

CIRCUITS)

CHAP.

3)

COROLLARY)

From
centers,

the argument used


the two

in

proving be

Theorem

3-9, we see

that

if a

tree T has

two

centers

must

adjacent.)

Application: Suppose that the communication among a is in a the in Fig. 3- I O(a), society represented by group of graph where the vertices represent the persons and an edge represents the communiis connected, we its two end vertices. Since the cation link between graph be members can reached either the know that all member, directly by any members. But it is also important to note that the other some or through afford to lose any cannot is a tree-minimally connected. The group graph
A Sociological
]

4 persons

of

the

communication
the

links.
each

The eccentricityof

est memberof group. were the criterion for leadership. group, if closenessof communication If a tree has a center (or two centers), does it have and Diameter: Radius of a is the from the center distance The Yes. a radius also? (which eccentricity in is defined the of the a tree as radius farthest to the the tree center of vertex) I in 3is The the tree three. diameter of the radius For instance, tree. O{ a) Fig. as the length of the longest path in of a tree T, on the other hand, is defined for the reader exercise is left as an T. It 3-6) to show that a radius (Problem in a tree is not necessarily half its diameter.)
be

vertex, In Fig.

E(v), represents how

close v
the

is to

3-10{a), vertex c should

the farthleader of the

3-5.

ROOTED

AND

BINARY one

TREES

A tree in which others is called a

vertex

(called the root) is


in

distinguished

from

all the

rooted tree.For instance,

Fig.

3-3 vertex N,

from where

all the mail goes out, is distinguished from the rest of the vertices. Hence N in the root of the tree, and so the tree is rooted.Similarly, can be considered In root the the of tree shown. be as considered vertex the start 3-6 may Fig. . We will a diagram of a rooted tree, the root is generally marked distinctly show the root enclosed in a small triangle. All rooted trees with four vertices the term tree meanstrees without are shown in Fig. 3- I ] . Generally, any root. called free trees (or nonrooted are sometimes for emphasis they However, them from the rooted kind.) to differentiate trees)

\037)

Fig. 3-11

Rooted trees with

four

vertices.)))

SEC. 3-5)

ROOTED

AND

BINARY

TREES)

49)

Binary
of

Trees:

A special

class of

rooted

trees,

particular

interest,

since they

are extensively used in


problems,

search methods, binary


codes.

identification

tree is defined as a tree in which and each of the remaining verticesis of degree oneor three (Fig. two, degree we are talking trees with three or more vertices.) about 3-12). (Obviously, Since the vertex of degree two is distinct from all other vertices, this vertex serves as a root. Thus tree is a rooted tree. Two of every binary properties binary trees follow directly from the definition: I. The number of vertices n in a binary tree is always odd. This is because is exactly there one vertex of even degree, and the n - I vertices remaining I-I the number of vertices of odd are of odd degrees. Since from Theorem is even, n - I is even. Hence n is odd. degrees 2. Let p be the number of pendant vertices in a binary tree T. Then n the number p - I is the number of vertices of degreethree.Therefore,
A binary

binary rooted trees, is study of computer and variable-length binary there is exactly one vertex of
called
the

of edges

in

T equals)

2[P
hence)

+ 3(n

- p

- I) +

2]

I;)

n+1 p = 2)
A nonpendant

.
vertex.

(3-1))

vertex
number

in

Eq. (3-1)
the

that

the

a tree is called an of internal vertices

internal in

It follows

from

a binary

tree is

one less than

number

level Ii
I3-vertex,
at

if Vi is

of pendant vertices. In at a distance of Ii from

binary

tree

the

root.

binary tree is shown in Fig. 4 are 2, 2, 4, and 4, respectively. and I, 2, 3, One of the most straightforward of binary applications a a test Each vertex of tree binary procedures. represents
four-level
levels

a vertex Vi is said to be at Thus the root is at level O. A 3-12. The number of vertices

trees is
with

in

search

two

possible)

Level 0)
Level
I)

Level

2)

Level

3)

Level

4)

Fig. 3-12

A 13-vertex,4-level binary

tree.)))

50)

TREES AND

FUNDAMENTAL

CIRCUITS)

CHAP.

3)

farthest from the root is as close to the root as possible. Clearly, there can be two vertices at levell, at most one vertex (the root) at level 0, at most only four verticesat level 2, and so on. Therefore,the maximum number of vertices possible in a k-Ievel binary tree is)
20

start at the root, and the outcome of the test at the root sends two vertices at the next level, where further tests are made, a specified pendant vertex (the goal of the search) termiit is often important to connates the search. For such a searchprocedure a binary number struct tree in which, for a given of vertices n, the vertex
outcomes.

We

us to one of the and so on. Reaching

2 1 + 22 +
of

... + 2k
in a
binary

>

n.)

The of

maximum the

level,
is)

lmax,

any

vertex
the

tree

is called

the

height

tree.
tree

It is easy to

see

that

minimum

possible

height of an n-vertex

binary

min

Imax == fIOg2 (n

+ 1) than

11,)

(3-2))

where

r n 1 denotes

the

smallest

integer greater
a binary

or

equal

to n.
n such have

On the other hand, to construct farthest vertex is as far as possible vertices at each level, except at the
max

tree for

given

from the root, we must 0 level. Therefore,)


==

that the two exactly

n-l
2

lmax

.)

(3-3))

For

==

11,

binary

trees

realizing both

these extremes are

shown

in

Fig.

3-13.)
Level) o)

Leve I)
o)

2)

3) 2) 4)

3)

5)

mi n I ma x = r (log2 I :2) -

11)

max

I max = I\037J
2)

(a))

(b))

Fig.3-13

Two II-vertex

binary

trees.)))

SEC. 3-5)

ROOTED

AND BINARY

TREES)

51)

of algorithms we are generally interested pendant vertices. This quantity, external (or path length) of a tree, can be defined from the root to all pendant vertices. The lengths in Fig. 3-12, for example, is) tree
In analysis
levels

of the

of all

known as path

in computing the sum as the path length the

sum

of the path
of the
binary

length

3 + 3
in

+ 4+

4 +

4=

23.)

The The

path

lengths

of trees

Figs.
length

importance is often directly

of the path
that

and (b) are 3-13(a) of a tree lies in the


of

16and 20, respectively.


fact

that this

quantity

related to the
at level
lrnax

execution time

an algorithm.

It can
21 max
n.)

be shown

- t

the type

vertices

of binary in Fig. 3-13(a) (i.e., a tree with tree for a given I) yields the minimum path length
pendant
number t-v

Weighted

Path
tree

binary

has

Length: In some applications, every with it a positive real associated

vertex
j . Given

v j of
Wt ,

W2,

. . . , W m the

problem

is to

construct a
L:
W

binary

tree

(with

m pendant

ver-

tices) that
where vertices.

minimizes) jlj,)

lj is the level of pendant Let us illustrate the

vertex

v j'

significance

and the sum is taken of this problem with

over all
a simple

pendant

exam-

ple.

machineis to identify, of tests, the coin that is put by a sequence machine. Only pennies, nickels, and can go through dimes, quarters the slot. Let us assume that the probabilities a nickel, of a coin being a penny, a dime, and a quarter are .05,.15,.5,and .30, respectively. Each test has the effectof partitioning the four types of coins into two sets and complementary coin to be in one of the two sets. Thus for four coins asserting the unknown we have 23 - I such tests. If the time taken for each test is the same, what the expected time taken by the Coke machine sequence of tests will minimize
A Coke
into the

to

identify

the

coin?

The solution

requires the construction of


three =

a binary
V t

tree with four


V4 and .3,

pendant
corre-

vertices (and
sponding
quantity

therefore
W t

internal
w 2

vertices)
W 3

weights

.05,

.15,

==

.5,

, V 2 , V 3 , and and W ==
4

such

The solution is given in L: ljw j is minimized. the expected time is 1.7 t, where t is the time taken for with Fig. 3-14(b), for which the time is 2t. expected with minimum tree structing a binary weighted path [3-6]. In this problem of a Coke machine, many interesting

Fig.

3-14(a),

that the for which


this

each test. Contrast


An length

algorithm can

conbe found in
for

variations
may

sible. For example,not all consume the same time.


Binary

possible

tests may

be available, or they
length

are posnot all


in)))

trees

with

minimum

weighted path

have

also

been used

52)

TREES AND FUNDAMENTAL CIRCUITS)

CHAP.

3)

Nickel)

Dime or
penny)

0.5)

0.15)

0.05)

0.5 0.15)

0.3)

\037 wi

I,

= 1.7

\302\267 = 2 \037 w, Ii (b))

(a))

Fig.3-14

Two binary

trees with
codes,
by

weighted

pendant

vertices.)

constructing
(A, different

B, C, . . . , Z) frequencies

variable-length binary are represented


of

where digits.

binary

the letters of the alphabet Since different letters have

occurrence
tree

(frequencies
minimum

are interpreted as
weighted path
length

weights

WI'

W 2 , . . . , W 26 ),

binary

with

corre-

sponds

to a

binary

code

of minimum

cost; see [3-6].For more


reader

on

minimum-

path

binary trees and their


.)

applications the

is referred

to [3-5] and

[3-7]
3-6.

ON

COUNTING

TREES)
Cayley isomers

In 1857, Arthur number of structural


series)

discovered of

trees while he was the

trying

to

count

the

C k H 2k + 2 . He

used a

cule.

Corresponding

sented by a vertex of one (pendant vertices).The

hydrocarbons (or paraffin connected graph to representthe C k H 2k + 2 molea carbon to their chemical valencies, atom was reprefour and a atom a vertex of degree degree hydrogen by
total

saturated

number
n

of vertices
2,)

in

such

a graph

is)

3k +

and

the

total

number of
e =
1

edges is)
of degrees) =
1.)

2(sum

1 2(4k +

2k

2)

= 3k
Since

the

number

graph is connected and the of vertices, it is a tree. Thus

number

of

edges

is one
counting

less

than

the

the problem

of

structural)))

SEC. 3-6)

ON

COUNTING

TREES)

53)

isomers
certain
The

of a
first

given

hydrocarbon

becomes

the problem
is the

of counting trees (with


of
different

qualifying

properties, Cayley question

to be sure). asked was: what

number

trees

construct with n distinct (or labeled) vertices? If n = 4, for in Fig. 3-15. The reader can satisfy himinstance, we have 16 trees, as shown trees of four vertices. (Of course, some of these self that there are no more be discussedlater.) trees are isomorphic-to A graph in which each vertex is assigned a unique name or label (i.e., no two have the same label), as in Fig. vertices 3-15, is called a labeled graph. a labeled and an unlabeled graph is very The between distinction important For instance, the four when we are counting the number of different graphs. as four different trees (even graphs in the first row in Fig. 3-15 are counted are isomorphic) though only because the vertices are labeled.If there) they
that

one can

A)

B)

A)

B)

A)

B)

A)

B)

c)

D)

c)

D)

c)

D)

c)

D)

A)

B)

A)

B)

A)

B)

A)

B)

c)

D)

c)

D)

c)

D)

c)

D)

A)

B)

A)

B)

A)

B)

A)

B)

c)

D)

c)

D)

c)

D)

c)

D)

A)

B)

A)

B)

A)

B)

A)

B)

c)

D)

c) Fig.

D)

c)
four

D)

c)

D)

3-15

All 16 trees of

labeled

vertices.)))

54)

TREES AND FUNDAMENTAL CIRCUITS)

CHAP.)

were counted

no distinction made between A, as one. A careful inspection of

B, the

C, or

D, these four

trees would

be

the number of unlabeledtrees with four two. But first we shall A, B, C, and D) is only trees.

in Fig. 3-15 will reveal that graphs vertices (no distinction made between

continue

with

counting

labeled

proved by
THEOREM

The following well-known theorem for and is therefore called Cayley,


3-10)

counting

trees

was first

stated and

Cayley's theorem.)
(n > 2) is nn-2.)

The number
Proof:
with

of labeledtrees
result was

with

n vertices

The

various

approaches
] O.)

excellent proof
in

summary of
Chapter

first stated and proved by Cayley. Many different proofs An since. (all somewhat involved) have been published ] 0 such proofs is given by Moon [3-9]. We will give one

Unlabeled

Trees:

In the
addition

3-10
two

is not enough. I n
observations

actual counting of isomersof C k H 2k + 2 , to the constraints on the degree of the

Theorem
vertices,

should be

made:)
they

carbon

are pendant, vertices hydrogen representing atoms only one way, and hence make no contribution we need not show any hydrogen vertices. Therefore,
2. Thus

1. Sincethe

go

with

to

isomerism.

the tree

each
between

representing
vertices,

a carbon atom. In
and therefore
it

representing Ck H

2k + 2 reduces this

tree

k vertices, to one with no distinction can be made

is unlabeled.)

every

two distinct 10' there are only knows, there are indeed exactly It may be noted in butanes: n-butane and isobutane. trees in the first row of Fig. 3-15are isomorphic to the

Thus

for butane,

C4 H

trees (Fig.
two

3-16). As
types of the four

organic

chemist

different that in Fig.

passing one

and the other

12are isomorphic

3-16( a);

to

Fig.

3-16(b).)

.)
(a))

.)
(b))

.)

.)

Fig.

3-16

All trees of

four

unlabeled

vertices.)))

SEC. 3-7)

SPANNING

TREES)

55)

The problem
and

of counting trees of
thoroughly

different

types

will be

taken up again

discussed

more

in Chapter

10.)

3-7.

SPANNING

TREES)

So far

we have
itself.

discussedthe
we shall
study

tree the

and tree

graph

by

Now

A given

combinasubgraphs-from e edges,2e distinct will be trees. Out of tions are possible. Obviously,someof these subgraphs in certain types of trees, called interested these trees we are particularly

its properties when as a subgraph of

it

occurs

as a
graph.

another

graph has numerous

spanning

trees-as

defined

next.
spanning

T is said to be a subgraph of G and T contains


A tree

tree

of a

connected
shown.

graph G if
the

T is

all vertices

of G. For instance,

subgraph

a in

heavy lines in Fig. 3-17 is a spanning tree of the graph Since the vertices of G are barely hanging together G. This is why a sort of skeleton of the original graph

a spanning

in a spanning tree, it is tree is some-

of G. Since spanning trees are the times referredto as a skeletonor scaffolding number of edges)trees among all trees in G, it is also (with maximum largest tree a maximal tree subgraph or maximal quite appropriate to call a spanning tree of G. It is to be noted that a spanning tree is defined only for a connected graph, because a tree is always connected, and in a disconnected graph of n vertices we cannot find a connected subgraph with n vertices. Each component (which definition is connected) of a disconnected graph, however, have a does by with k components has a spanning spanning tree. Thus a disconnected graph of k spanning trees. (A collection of trees is called a forest.) forest consisting G is simple. a spanning If G has no cirtree of a connected graph Finding it is its own spanning tree. If G has a circuit, delete an edge from the cuit, circuit. This will still leave the graph connected (Problem 2-10).If there are more circuits, repeat the operation till an edge from the last circuit is deleta circuit-free that contains all the vertices of G. ed-leaving connected, graph
Thus

we

have)

C6)

Fig.3-17

Spanning

tree.)))

56)

TREES AND FUNDAMENTAL CIRCUITS)

CHAP.

3)

THEOREM

3-11)
graph

Every connected

has

at least

one

spanning

tree.)

An edge in a spanning tree T iscalleda branch of T. An edge of in a given spanning tree Tis calleda chord.In electrical engineering

G that

is not

a chord

is

b 1 , b 2 , b 3, b 4 , b s , sometimes referredto as a lie or a link. For instance, edges and b 6 are branches of the spanning tree shown in Fig. 3-17, while edges c 1 , c 2 , c 3, c 4' CS , c 6 , c 7 , and C 8 are chords. It must be kept in mind that branches and chords are defined with respect to a given tree. An only spanning is that a branch T a be of one tree a chord 1 (in edge graph G) may spanning with to tree T . another 2 respect spanning It is sometimes convenient to consider a connected G as a union of graph T and T; that is,) two subgraphs, T U
where
graph

T =

G,)

chord

T is a spanning tree, and T is the complement of Tin G. Since the subt is the collection of chords,it is quite appropriately referred to as the set (or lie set or cOlree) of T. From the definition, and from Theorem
evident.)

3-3, the following theorem is


THEOREM

3-12)

With respect to any of its spanning edgeshas n - 1 tree branches and e


For

trees, a connected graph


n

of

n vertices

and

chords.)

the graph in Fig. 3-17 (with n -= 7, e = 14),has six tree to the spanning tree [bl' b2 , b 3, b 4 , b s , branches and eight chords with respect b 6 }. Any other spanning tree will the same numbers. yield If we have an electric nelwork with e elements (edges) and n nodes (veris minimum elements we what the number of must remove to eliminate tices), all circuits in the network? The answer is e - n -f- I. Similarly, if we have a in Fig. 3-18, and these of six walled plots of land, as shown farm consisting of how will be are full walls have to broken so that all the water, many plots water can be drained out? Here n = 10 and e =-\03715. We shall have to select)
example,

Fig. land.)))

3-18

Farn1

with

walled

plots

of

SEC. 3-8)

FUNDAMENTAL

CIRCUITS)

57)

] = 6) walls such that a spanning tree. Breaking these six walls will

a set

of six (15
and to

- 10+

the

remaining

nine constitute

drain
graph

the water
G,

out.
first thing

Rank

most
ing

likely

Nullity: mention

When someone specifies a is n, the number of vertices

the

he is

in

G. Immediately

follow-

comes

e, the

has.If k = 1, ed? Sinceevery


ber of

in a component can be no lessthan of edges the numMoreoever, the number vertices in that component minus one. Therefore, e > n - k. Apart from the constraints n - k > 0 and e - n + k > 0, these three numbers numbers in graphs. are fundamental n, e, and k are independent, and they to mention, these numbers alone are not enough to specify a graph, (Needless

number of edges in G. Then k, the number of components G G is connected. How are these three numbers of a graph relatn > k. of a graph must have at least one vertex, component

except for
From

trivial

cases.)

these three numbers


and

are
as)

derived

two

other

important

numbers

called

rank

nullity,

defined

rank
nullity)

r==n-k
== e J.l

,)

k.)

The

rank

of a

connected graph is n
of

the real

significance observedhere that)


rank

these

numbers

1, and the nullity, will be clear

e
in

Chapter

1. Although 7, it may be

of G

==

number

of branches
of

in any spanning
G,

tree (or forest)


nullity

of G
nullity

==

number

of chords

in G,
in

rank +
The
Betti

== number

of edges
to

G.)

nullity
number.)

of a graph is

also referred

as

its cyclomatic

number, or

first

3-8.

FUNDAMENTAL

CIRCUITS)

You may have noticed that if we add an edge betweenany two vertices of exists there a tree (say, in Fig. 3-1) a circuit is created. This is because already them of a tree; adding an edge between one path between any two vertices line of reasoning, this creates an additional path, and hence a circuit. Along it is not difficult to prove)
THEOREM

3-1 3

A connected graph G is a tree if and vertices in G creates exactly one circuit.)))

only

if adding

an edge

between

any

two

58)

TREES AND FUNDAMENTAL CIRCUITS)

CHAP.

3)

a connected graph G. Adding a one circuit. Such formed circuit, by exactly anyone a a to is called chord circuit. tree, afundamental adding spanning circuits does a graph have? Exactly as many as How many fundamental the number of chords, J.l (= e - n + k). How many circuits does a graph is created by adding in all? We know that one circuit chord to a have anyone tree. Supposethat we add one more chord. Will it create exactly one more if we add all the chords simultaneously to the tree? circuit? What happens Let

us now chord

consider a spanning
will

tree T in

to T

create

C 1 to it, Let us look at the tree {b1 , b 2 , b 3, b 4 , b s , b 6 } in Fig. 3-17. Adding we get a subgraph{bp b2 , b 3 , b 4 , b s , b 6 , c I}' which has one circuit (fundamenC 2 (instead of c 1)to the tal circuit), {b I' b 2 , b 3, b s , c I}. Had we addedthe chord fundamental we would have obtained a different circuit, tree, {b 2 , b 3, b s , c 2}. Now suppose that we add both chords c 1 and C 2 to the tree. The subgraph circuits we just {b1 , b 2 , b 3, b 4 , b s , b 6 , C p c 2} has not only the fundamental mentioned, but it has also a third ci.rcuit, {b p c I' c2 }, which is not a funda3-17 (enumerated there are 75 circuits in Fig. mental circuit. Although by

computer),
(together
Two

only

eight

are

fundamental

circuits, each

formed by
is a

one

chord

with the
comments
only

tree branches).
may

circuit
damental spanning

with

with tree

circuits (as well

may be funrespect to one spanning tree, but not with respect to a different of fundamental the number of the same graph. Although number of circuits) in a graph is fixed, the ciras the total
respect
given

be appropriate here. First, to a given spanning tree. A

a circuit

fundamental

circuit

fundamental cuits that become change with the spanning trees. we are not interested in all the circuits of Second, in most applications which are a graph, but only in a set of fundamental circuits, fortuitously a lot easier to track. The concept of a fundamental circuit, introduced by
Kirchhoff,

is of

enormous
which

significance
now

in

electrical

Kirchhoff showed,

every

sophomore

knows, is that

no

matter

sider only fundamental of the circuits (as we


some

circuits
shall

how many circuits a network with respect to any in Chapter rigorously prove

network analysis. What in electrical engineering we need concontains tree. The rest spanning

7) are combinations

of

fundamental

circuits.)

3-9.

FINDING

ALL

SPANNING

TREES

OF A GRAPH)

of spanning Usually, in a given connected graph there are a large number trees. One reasonable trees. In many applications we require all spanning is to start with a given spanning trees of a graph to generate way spanning tree, say tree TI (a b c d in Fig. 3-19). Add a chord, say h, to the tree T I . This forms a fundamental circuit (b c h d in Fig. 3-19). Removal of any branch, a new))) will create say c, from the fundamental circuit b c h d just formed

SEC. 3-9)

FINDING

ALL SPANNING

TREES OF A GRAPH)

59)

c)

d)

c)

d)

h) 7})

h
T))

T2)

Fig.3-19

Graph

and three of

its

spanning

trees.)

spanning addition
interchange

standard
tion

tree T2 . This generation of one spanning tree from another, through of a chord and deletion of an appropriate branch, is called a cyclic or elementary tree transformation. (Such a transformation is in the iteration for certain operation sequence solving transporta-

problems.)

In the
leted

or

above procedure, instead of deleting b and thus would have obtained

branch
two

c, we could
spanning (e,f,

have detrees or g) and


a branch

additional

a b chand
chord

a ch

d.

Moreover,

after
Tl

generating these three trees,each with


and

h in

it, we can

restart with
trees for

add a

different

chord

repeat the process of obtaining is deleted from the fundamental


for

a different
circuit
any

spanning tree each time formed. Thus we have a


graph.

procedure

generating

spanning

given

trical
ing

] 3, the topological As we shall see in Chapter elecanalysis of a linear network essentially reduces to the generation of trees in the correspondgraph.

all trees finding an efficient procedure for generating a very important problem. practical The procedure outlined above raisesmany Can we start from questions. a desired a number tree tree of cyclic and by any get spanning spanning a in we all trees of this fashion? Can given exchanges? get spanning graph How long will we have to continue exchanging edges? Out of all possible for starting? one spanning trees that we can start with, is there a preferred Let us try to answer some of these questions; others will have to wait until Chapters 7, 10, and ] 1. trees T,. and The distance between two spanning Tj of a graph G is defined This as the number of edges of G present in one tree but not in the other. in Fig. 3-19 d(T2 , T 3) = 3. as d( T,., Tj). For instance, distance may be written trees Let T,.EB Tj be the ring sum of two spanning T,. and Tj of G (as G all of is the of defined in Chapter 2, T,. EB Tj edges containing subgraph G that are either in T,. or in Tj but not in both). Let N(g) denote the number of edges in a graph g. Then, from definition,)

Therefore,

of a graph is

d(T,., T j )

2: N

(T,. EB

T j ).)))

60)

TREES AND FUNDAMENTAL CIRCUITS)

CHAP.

3)

It

is not difficult

to see that

the
in

number
going

cyclic interchanges

involved
two

from

d( T;, Tj ) is the minimum T; to Tj\" The reader

number

of

is encouraged

to prove the

following

theorems.)

THEOREM3-14)

Thedistance

between

the spanning

trees of a graph
T. 1)

is a

metric. That is, it


==

satisfies)

d ( T.\" T. 1) d(T;,
d(T;,

> - 0 and T j ) = d(Tj, T;),


Tj) <

d ( T.I'

= 0 if
T j ).)

and

onl y if T.I

T.l'

d(T;, Tk )

-t

d(Tk,

THEOREM3-15)
Starting

from
by

any

spanning
cyclic

tree of a
exchanges.)

graph

G,

we can

obtain every

spanning

tree

of G

successive

r (i.e., of r + I vertices) Since in a connected graph G of rank tree has r edges, we have the following results: The maximum between distance any two spanning trees in

a spanning
G is)

max

d(T;,

Tj)

max

N(T; of

EB T j )
G.)

< r, the
Also,
ning

rank

tree

if Jl is the nullity of G, we know that can be T; replaced to get another

no

more

than

f.-l

edges

of a

span-

tree

Tj\

Hence)
combining

max d( T;, Tj) <


the

f.-l;)

two,)

max d(T;,
where

Tj ) <
two tree To

min(f.-l,

r),) and

min(f.-l, r) is the

smaller of the

numbers To of and

f.-l

r of

the graph G.

Central Tree: For a spanning denote the maximal distance between Then To is called a central tree of
max ;
The graph.

a graph G, let max d(To, TJ i any other spanning tree of G.

G if)

d(To, T;)

<

max j)

d(T,

Tj )

for

every

tree T

of

G.)

of concept A central trees the

a central tree in a

tree is
graph

useful

in

enumerating

all trees

tral

reader should see [3-]] and


The tree graph

is, in general, not unique.


[3-4]. graph

of a For more on

given

cen-

Tree

Graph:

of a

given

G is

defined as

graph

in)))

SEC. 3-10)

SPANNING

TREES IN A WEIGHTED GRAPH)

61)

tree of G, and each edge corcorresponds to a spanning between the interchange spanning trees of G represented that startby the two end verticesof the edge. From Theorem 3-15 we know tree we can obtain all other spanning trees ing from any spanning through the tree cyclic interchanges (or elementary tree transformations). Therefore, of is connected. For additional (finite, any given graph connected) graph of tree graphs, the reader should see [3-3].) properties

which

each vertex
to

responds

a cyclic

3-10.

SPANNING

TREES

IN

WEIGHTED

GRAPH)

As discussed
minimal

earlier in
connecting
real

this

chapter,

a spanning

tree

in

graph

subgraph

all the
number

vertices of
associated

G.If graph
sum

G is

G is a a weighted

graph (i.e., if
the

there is a
spanning

with

each edge
of the

of G), then
weights of
will

weight

of a weights.

tree T.

T of

all the branches in


different

In

general,

G is defined as the different spanning

trees of G
the

have

Among all the spanning trees

of G, one with

smallest

(There may be several spanning trees with in for a of n vertices in which instance, weight; every edge graph has unit weight, all spanning trees have a weight 1 units.) A spanning of n tree with the smallest weight in a weighted spanning graph is called a shortest tree or shortest-distance spanning or minimal spanning tree. tree One possible of the shortest application Supspanning tree is as follows: that we are V to n . . . a network of roads. connect cities , V n through pose 2, vI' The cost Vi and v j is given for all pairs of cij of building a direct road between cities where roads can be built. (There may be pairs of cities between which no direct road can be built.) The problem is then to find the least expensive network that connects all n cities together. It is immediately evident that this connected network must be a tree: otherwise, we can always remove some edges and get a connected graph with smaller weight. Thus the problem of n cities with a least expensivenetwork is the problem of finding connecting a shortest tree in a n A necesconnected of vertices. spanning weighted graph is given condition for a spanning tree to be shortest sary and sufficient by)

weight
the

is of

practical significance.

smallest

THEOREM

3-16

A spanning tree
tree (of
one

T(of a given
if there

weighted

connected
spanning

G) if

and

only

exists no other
that

graph G) is a shortest tree (of G) at a

spanning

distance of

from

T whose weight The necessary


shorter

is smaller than or
the

of

T.)

we shall is obvious; otherwise, interchange. The fact that this condition is also sufficient is remarkable It can be proved as follows: and is not obvious. Let Tl be a spanning tree in G satisfying the hypothesis of the theorem (i.e., T 1 ).))) there is no spanning tree at a distance of one from is shorter than Tl which Proof: \"only if\" condition

get another tree

than

T by a cyclic

62)

TREES AND

FUNDAMENTAL

CIRCUITS)

CHAP.

3)

The

proof

ferent

will be completed by from T1 ) in G, the weight


spanning

showing of

that

TI will

if T 2 is a shortest also be equal to also

spanning
that

of

tree (difT 2 . Let T 2 be


of

a shortest
theorem

tree

in G.
will

Clearly, T2
be

must

satisfy the
than

hypothesis

the

(otherwise there
T 2 , violating

a spanning

tree shorter

T 2 at a

distance

of

the assumption that T 2 is shortest). Consider an edge e in T2 which is not in TI' Adding e to TI forms a fundamental with branches in TI' Some, but not all, of the branches in TI that form the circuit with e may also be in T 2 ; each of these branches in TI has circuit fundamental a weight smaller than or equal to that of e, becauseof the assumption on T 1. all those edges in this circuit which are not in T 2 at least one, say b j , must Amongst form some fundamental circuit e. Because of the (with respect to T2 ) containing T b than that on of cannot be less of e. Therefore minimality assumption 2 weight j bj must have the same weight tree as e. Hence the spanning T; == (T 1 Ue - bj),
obtained

one from

from

T 1 through

one cycle
with

exchange,has
T?, and
it

the

same

weight

T 1 has

one edge

more in

common

satisfies

the condition

as T1. But of Theorem

3-16.This
T l' than

a series of trees of equal weight, can be repeated, producing argument T . . . unit to T each distance closer a Tt, l' , 2' until we get T 2 itself. at a unit distance from T is shorter trees This proves that if none of the spanning T exists in the graph. .) T, no spanning tree shorter than
Algorithmfor

available Tree: There are severalmethods Spanning both hand in a tree a shortest by given graph, spanning actually finding List all is as follows: due to Kruskal One algorithm and by computer. [3-8] smallest selecta in G of order the of nondecreasing weight. Next, graph edges all remaining edges of select of G. Then for each successive (from step edge selected the circuit with that makes no smallest another previously edge G) - 1 edges have been selected, these and n until Continue edges will edges. The validity of the method tree. constitute the desired shortest spanning Shortest

for

follows from
Another

Theorem

3-16.

of does not require listing all edges in order algorithm, which selected forms if a at each or edge newly step checking weight nondecreasing vertices For Prim's algorithm, draw n isolated a circuit, is due to Prim [3-10]. of the edges of G the given weights and label them VI' V 2 , . . . , v n ' Tabulate with rein the table are symmetric the entries in an n by n table. (Note that nonthe of Set is the and the to weights empty.) diagonal diagonal, spect no direct which existent edges (correspondingto those pairs of cities between as very large. road can be built) it to its nearest neighbor (i.e., to the Start from vertex v I and connect conI of the table), say vko Now in row which has the smallest entry vertex to its closest sider v 1 and v k as one subgraph, and connect this subgraph v I and v k that has the smallest entry than other neighbor (i.e., to a vertex be Vi' Next regard the vertex new Let this I and in all entries rows k). among and continue the process V as one and vertices tree with , subgraph, Vi VI' k have been connected by n - I edges. Let us now illustrate all n vertices until a shortest of finding this method spanning tree.)))

SEC. 3-10)

SPANNING

TREES IN A WEIGHTED GRAPH)

63)

VI Vs

V2

V3

V4 1 1 ex>

Vs

V6

10

VI

10 10

16 9.5

10
ex>

17
19.5 12

v2

v6
v2

v3 v4 Vs
v6

16
11

7 7
ex>

ex>

ex>

8
8

7 9

10
17

ex>

19.5

12

9)

(a))

(b))

Fig. A connected

3-20

Shortest spanning tree

in

a weighted

graph.)

and 12 edges is shown in Fig. in Fig. 3-20(b). We start with VI and pick the smallest entry in row I, which is either (v l' v 2 ) or (v I' V s). Let us pick (vl'v s). [Had we picked (VI' v 2) we would have obtained a different tree with the same weight.]The shortest of subgraph (VI' v s) closest neighbor I is V 4' as can be seen by examining in and 5. The three reall the entries rows selected out to be (v 4 , v 6 ), maining edges following the above procedure turn v v and in that The tree-a shortest (v3 , 2 ) (v 4 , 3), resulting spanning sequence. tree-is shown in Fig. 3-20(a) in heavy lines. The weight of this tree is 41.5
3-20(a).

weighted The weight of its

graph

with

6 vertices

edges

is tabulated

units.)

tree Shortest Spanning Tree: In a shortest spanning any preceding construction, a vertex Vi can end up with - l. In some degree; practical casesan upper limit on d(vJ < n the degree of every vertex (of the resulting spanning tree) has to be imposed. in an electrical wiring For one may be required to wire instance, problem, three wires n pins (using as little wire as possible) with no more than together wrapped around any individual pin. Thus, in this particular case,) Degree-Constrained

resulting

from the that is, I <

d(vJ

<

3)

for

every

Vi.)

tree. a spanning tree is called a degree-constrained shortest spanning In general, the problem may be stated as follows: Given a weighted nected graph G, find a shortest spanning tree Tin G such that)
Such d(vJ

con-

<

k)

for

every

vertex

Vi

in

T.)

= 2, this Hamiltonian
If k

problem,

in fact,
well

reduces to the
the

problem of

finding

the
(without

shortest
the)))

path, as

as

traveling-salesman

problem

64)

TREES AND FUNDAMENTAL CIRCUITS)

CHAP.

3)

salesman
far,

no

to returning efficient method

his home of finding

at base), discussed

the

end

of Chapter

2. So

an

arbitrarily

degree-constrained

shortest

spanning tree

has been found.)

SUMMARY)

type of connected graph calleda tree. in trees form the most important topic applications, labeled Different such as and rooted of trees, unlabeled, graph theory. types and unrooted, were discussed, with their properties and applications. together interest are those trees that Of are subgraphs of a given connected special G all vertices G. trees are called trees of of Such containing spanning graph G. Finding all spanning trees of a given is of great practical importance, graph and a shortest so is the problem of finding spanning tree in a given weighted
This

chapter

dealt
wide

with

a particular

Because of

their

graph.

Other related concepts,such as centers, and of a graph, fundamental nullity cyclic interchange, distance between spanning
rank

radius,
circuits,

and diameter
branches

of a tree,

trees,

and

also introduced

chords, tree graphs, were

and

and

studied.
from

Trees,
time

will continue

to appear

to time

circuits spanning trees, and fundamental in most of the succeeding chapters.)

REFERENCES)

Every textbook
are)

on graph

theory

has a chapter

or two

on trees.

Especially recommended

1. Berge

[1-1], Chapters

12,13,and

16. 3-7, 6- I 9, 6-22,

[1-2], Sections 1-8,2-6,3-6, 3. Harary [1-5], Chapters 4, 15, and Appendix 3. 4. Ore [1-9], Chapter 4, Sections 2.4 and 6.5. 3.) 5. Ore [1-10],Chapter
2. Busacker and Saaty

and 6-31.

of trees in information The importance storage and processing can be seen in Knuth's in [3-2]. For counting trees of various and book [3-7], pages 305-422, types, see Chapter 6 in Chapter 10 of this book. An book of Riordan's given [3-11], and also see references has been minimum a binary tree with weighted path length elegant algorithm for finding 11 in [3-6]. On algorithms for generating spanning trees, see Chapter given by Huffman 10 different proofs of Cayley's in this book and the references cited there. Moon [3-9] gives 3 in Harary's book [1-5] has diagrams of all trees trees. formula for counting Appendix between trees and central trees one should with n < 10. For treatment of distance and Cottafava to Deo [3-4] and Amoia and refer [3-1]. Tree graphs were first introduced

studied

[3-3]. Kruskal's by Cummins study of shortest spanning trees.


AMOIA,

[3-8] and

Prim's

[3- 10]

papers are sources

for

the

3-1.

Trans.

of Central \"Invariance V., and G. COTTAFAVA, Properties Circuit Theory, Vol. CT-I8, No.4, July 1971,465-467.)))

Trees,\" IEEE

CHAP.

3)

PROBLEMS)

65)

3-2. 3-3.
3-4.
3-5.

and D. MICHIE (eds.) Machine Intelligence, Vol. 1,AmericaQ Elsevier Company, Inc., New York, 1967. IEEE Trans. Circuit R. L., \"Hamiltonian Circuits in Tree CUMMINS, Graphs,\" Vol. CT-13, No.1, March Theory, 1966,82-90. Vol. CT-13, No.4, Dec. DEO, N., \"A Central Tree,\" IEEE Trans. Circuit Theory,
COLLINS,

N. L.,

Publishing

439-440. 1966,

3-6.

3-7.
3-8.

3-9.

Vol. 21, No.4, Dec. 1971,514-532. D. A., \"A Method for the Construction of Minimum-Redundancy 1098-1101. Proc. I.R.E., Vol. 40, Sept.1952, Codes,\" Vol. I, Addison-Wesley PubD. E., The Art of Computer KNUTH, Programming, Inc., Reading, Mass., 1968. lishing Company, and the Traveling KRUSKAL, J. B., Jr., \"On the Shortest Spanning Subtree of Graph Proc. Am. Math. Soc., Vol. 7, 1956, 48-50. Salesman Problem,\" for Counting J. W., \"Various Proofs of Cayley's Formula MOON, Trees,\" Chapter II in A Seminar on Graph Theory, (F. Harary, ed.), Holt, Rinehart and Winston, Inc.,
HUFFMAN,
New

Hu, T. C., and A. C. TUCKER, 1049, University of Wisconsin,

\"Optimal Madison,

No. Binary Search Tree,\" MRC Report March 1970; also in SIAM J. Appl. Math.,

York, R. C., J.,

1967,70-78.
and Some Generalizations,\" Bell \"Shortest Connection Networks 36, Nov. 1957, 1389-1401. An Introduction to Combinatorial John Wiley & Sons, Inc., Analysis,

3-10.

PRIM,

3-11.

System Tech.J., Vol.


RIORDAN, New

York,

1958.)

PROBLEMS)

3-1.
3-2. 3-3. 3-4.
3-5.

3-6.
3-7. 3-8. 3-9.

I, 2, 3, 4, and 5. = 1, 2, 3, 4, and 5. Draw all trees of n for n = 1, 2, 3, 4, and 5. Draw all unlabeled It can be shown that there are only six different (nonisomorphic) trees of six vertices. in Fig. 2-4. Draw the other four. Two such trees are given Prove Theorem 3-4. the radius. a tree in which its diameter is not equal to twice Under what Show condition does this inequality hold? Elaborate.
Draw

all trees

of n labeled

vertices for n = unlabeled vertices for n rooted trees of n vertices

Cite three
by

different

situations

(games, activities, or problems) that

can

be represented

trees.

Explain.

How many isomers does pentane CsH 12 have? Hexane, C6 H 14 ? Suppose you are given eight coins and are told that seven of them are of equal the rest. You are provided than weight, and one coin is either heavier or lighter with an equal-arm balance, which three times, for comparing you may use only coins. Sketch a strategy in the form of a decision tree for identifying the nonconout whether it is heavier or lighter than the rest. coin, as well as for finding forming 3-10. Sketch all (unlabeled) binary trees with six pendant vertices. Find the path length of each. [Hint: the 1 I vertices Distribute (because 11 = 6 +- 5) alllong different levels. Observe that level 0 has exactly one vertex, level 1 has exactly two vertices; level 2 can have either two or four vertices; and so on. There are six such trees, and two of them are shown in Fig. 3-13.] 3-11. Sketch all spanning trees of the graph in Fig. 2- I.

3-12. Show

that

a path is its own spanning

tree.)))

66)

TREES AND

FUNDAMENTAL

CIRCUITS)

CHAP.

3)

3-13.

Prove that a pendant connected graph G is

3-14.
3-15. 3-16. 3-17.

edge (an edge whose one end vertex is of degree one) in a contained in every spanning tree of G. G is contained in some spanProve that any subgraph g of a connected graph ning tree of G if and only if g contains no circuit. What is the nullity of a complete graph of n vertices? Show that a Hamiltonian path is a spanning tree. Prove that any circuit in a graph G must have at least one edge in common with a chord set.
Prove Find

3-18.
3-19. 3-20.

Theorem a spanning

3-13.

in Fig.

3-17. List
the

tree at a distance of four from spanning tree {bI, b2, b3, b4, circuits with respect to this new spanning all fundamental between two spanning trees as
are given
does
all defined

b s , b 6}

tree.

Show that metric.

distance

in this

chapter is a

3-21. Can you construct a graph if you 3-22. Prove that the nullity of a graph
in

its spanning

the

middle

of an

edge, or remove a

not change when vertex of degree

trees? How? you either insert a vertex two by merging two edges

3-23.

incident on it. Prove that .any

tree of G. Is it tree of G?

given edge of a also true that any

connected graph G is a branch of some spanning arbitrary edge of G is a chord for some spanning

a method for determining the total number of spanning trees of a connected listing them. graph without actually 3-25. Prove that two colors are necessary and sufficient to paint all n vertices (n > 2) of a tree, such that no edge in the tree has both of its end vertices of the same color. fact is expressed number of a tree is two.) by the statement that the chromatic (This condi3-26. Suppose that you are given a set of n positive integers. State some necessary tions of this set so that the set can be the degrees of a tree. of all the n vertices Are these conditions sufficient also? 3-27. Let v be a vertex in a connected graph G. Prove that there exists a spanning tree T in G such that the distance of every from v is the same both in G and in T. vertex G. If edge e is in T 1 Let Tl and T2 be two spanning trees of a connected 3-28. graph but not in T2, prove that there exists another edge f in T2 but not in Tl such that subgraphs (T1 - e) U f and (T2 - f) U e are also spanning trees of G.

3-24. Suggest

3-29. Construct
of a 3-30.
In labeled

a tree

graph

(with

16 vertices,

each corresponding

to

a tree

in Fig. 3-15)

complete

graph

of four vertices.

the

covered and an

tree graph obtained in Problem 3-29, observe the following properties (dishas at least one Hamiltonian R. L. Cummins). A tree graph circuit, by in a Hamiltonian circuit. edge of a tree graph can be included arbitrary an edge
shortest

3-31.

In

weight

exists a given connec;ted weighted graph G, suppose there is smaller than that of any other in G. Prove that every
in

es

whose

spanning

tree

G must

contain es.

3-32. Let
3-33.

G be a connected weighted graph in which every edge If e/ is the edge with weight greater than that of any other tree in G will contain shortest e/. spanning

belongs to edge in G,

some circuit. show that no

Show
cannot

by

constructing

be said

of

the

second

counterexamples smallest

that in Problems 3-31 and 3-32 the same and the second largest edges, respectively.)))

CHAP. 3) 3-34.

PROBLEMS)

67)

Use the tree in


Pick an

algorithm the graph

of Kruskal, as outlined of Fig. 3-20(a).

in this

chapter, to find

a shortest

spanning

3-35.

cities in the United States and obtain the 105 intercity distances from the shortest spanning tree connecting these cities by using (a) Kruskal's method, and (b) Prim's method. Compare their relative efficiencies.)))
15 large atlas.

Find

4)

CUT-SETS

AND

CUT-VERTICES)

3 we studied the spanning tree-a special type of subgraph of In Chapter a connected graph G-which kept all the vertices of G together. In this chapthe cut-set-another ter we shall study type of subgraph of a connectedgraph in G. Properties G whose from others removal from G separates somevertices will be covered. Other related such of cut-setsand their applications topics, of graphs, will also be disas connectivity, separability, and vulnerability

cussed.)

4-1.
In

CUT-SETS)

is a set of edgest whose removal G from graph G, a cut-set G disconnected, provided removal of no proper subset of these edges in Fig. 4-1 the set of edges [a, c, d,f} is a cut-set. G. For instance, disconnects There are many other cut-sets, such as fa, b, g},fa, b, e,f}, and [d, h,f}. Edge [k}aloneis also a cut-set. The set of edges[a,c, h, d}, on the other hand, is not a cut-set, because one of its proper subsets, [a,c, h}, is a cut-set. To emphasize the fact that no proper subset of a cut-set can be a cut-set, a proper cut-set, or a some authors refer to a cut-set as a minimal cut-set, is We a cut-set also called a shall cut-set. Sometimes cocycle. simple just use the term cut-set. A cut-set \"cuts\" a graph into two. Therefore, a cut-set can also be always set of edges in a connected graph whose removal reduces defined as a minimal The rank of the graph in Fig. 4.1 (b), for in-) the rank of the graph by one.

a connected

leaves

set

a tSince in G is a

set of edges(together subgraph of G.)

with

their end

vertices) constitutcs

a subgraph,

a cut-

68)))

SEC. 4-2)

SOME

PROPERTIES

OF A CUT-SET)

69)

V3)

V3)

VI)

VI)

g)

V6)

h)

V2) I I / /) (a))

V2)

Vs)

(b))

Fig.

4-1
two.)

Removal of a

cut-set

fa, c, d,

f} from a graph

\"cuts\"

it

into is four,

stance,

one less than

that

of the

graph

in

Fig.

4.1 (a).

Another

way

of

is this: if we partition all the vertices of a connected graph number of edges exclusive subsets, a cut-set is a minimal whose removal from G destroys all paths between these two sets of vertices. set [vI' v 2, v 6 } vertex For example, in Fig. 4-1 (a) cut-set [a, c, d,f} connects of vertices may with [v 3, v 4 , v s }. (Note that one or both of these two subsets consist of just one vertex.) Since removal of any edge from a tree breaksthe tree into two parts, every edgeof a tree is a cut-set. in studying properties of communication Cut-setsare of great importance and networks. Suppose, for example, that the six vertices in transportation lines (edges). We wish Fig. 4-1(a) represent six citiesconnected by telephone need weak to find out if there are any strengthening spots in the network that by means of additional telephone lines.We look at all cut-sets of the graph, I n Fig. is the most vulnerable. and the one with the smallest number of edges v rest of the the 4-1(a), the city represented by vertex 3 can be severed from After additional of just one edge. some network study of by the destruction w e shall return to their the properties of cut-sets, applications.)
looking G into

at a cut-set two mutually

4-2. SOME PROPERTIES


set S in

OF

A CUT-SET)
a connected

Consider a spanning G. Is it possible

tree T in
for

graph
edge
from

G and an
in common
G

arbitrary

cut-

S not

to have
of the

any

answeris no. Otherwise, nect the graph. Therefore,)))

removal

cut-set S

with T? The would not discon-

70)

CUT-SETS AND

CUT-VERTICES)

CHAP.

4)

THEOREM
Every

4-1)

cut-set

in a connected
G.)

graph

G must

contain

at least

one branch

of every

spanning
Will

tree of
the

true? In other words, will any minimal set of branch one of every spanning tree bea cut-set?The edgescontaining answer is yes, by the following reasoning: In a given connected set of edges containing G, let Q be a minimal graph at least one branch of every tree G. of G Consider spanning Q, the subin that remains after the G. from the Since removing edges Q graph subgraph G - Q contains tree of G, G - Q is disconnected no spanning (one component of which Also, since Q is a minimay just consist of an isolated vertex). set of edges with mal this e from to G - Q any edge Q returned property, at least one spanning tree. Thus will create the subgraph G - Q + e will be a connected set of edges whose removal graph. Therefore, Q is a minimal G disconnects G. This, by definition, is a cut-set. Hence) from
converse
at

also be

least

THEOREM

4-2)

In a connected

of every
THEOREM

spanning

tree

graph G, any minimal of G is a cut-set.)

set of

edges

containing

at least

one branch

4-3)
an

Every circuit has

even

number S in

of edges

in

common

with

any cut-set.)
partition

a Proof: Consider

cut-set
two

the

vertices

of G into

(mutually

graph G (Fig. 4-2).Let the removal of S exclusive or disjoint) subsets VI and

V 2 . Con-

vertex sider a circuit r in G. If all the vertices in r are entirely within set VI (or V 2 ), r is zero; that is, N(S n r) = 0, an even to Sand the number of edges common number. t If, on the other hand, some vertices in r are in VI and some in V 2 , we traverse)

./

.....

S \"
\"\" ,) \\ \\) I I I /) \\ \\ \\) /)

/ ./

/' -

\037----

-) ....... ,
\"-

,
\\ \\ \\ \\ I I /

I I \\ \\ \\ \\. \"

J) ......

----

---)-

./)

/
\037 // .....)

/'

./

..........-----\"\"\ Circuit

r shown

traversed along
Fig.

in heavy lines, the direction of in

and is the arrows)

4-2

Circuit and a cut-set

G.)

t As

in

Chapter

3, N(g) stands

for

the

number

of edges

in

subgraph

g.)))

SEC. 4-3)

ALL

CUT-SETS

IN A GRAPH)

71)

and forth between the sets VI and V 2 as we traverse the circuit (see Fig. 4-2). of edges we traverse between Because of the closed nature of a circuit, the number since VI and V2 must be even.And very edge in S has one end in VI and the other in V 2 , and no other edge in G has this property (of separating sets VI and V 2 ), r is even. .) the number of edges common to Sand
back

4-3.

ALL

CUT-SETS

IN

A GRAPH) shown

In Section

4-1 it

was

how cut-sets
purpose

are used to

identify

weak

spots

cut-sets of the correspondIt must have the smallest number of edges. also have become apparent to you that even in a simple example, such as in and we must have a systematic of cut-sets, 4-1, there is a large number Fig. method of generating all relevant cut-sets. In the case of circuits, we solved a similar problem by the simple technique a set of fundamental circuits and then realizing that other circuits in of finding a graph are just combinations of two or more fundamental circuits. We shall follow a similar here. Just as a spanning tree is essential for defining strategy tree essential for a set of funa set of fundamental circuits, so is a spanning It will be beneficial cut-sets. damental for the reader to lookfor the parallelism between circuits and cut-sets.)
we list all

in a communication net. For this and find which ones ing graph,

one branch chords with respect to T. Sucha cut-set S containing exactly to T. Sometimesa with respect cut-set tree T is called a fundamental is also called a basic cut-set.In Fig. 4-3, a spanning tree) fundamental cut-set
S are

a spanning tree T of a connected Consider graph T. Since is any [b} a cut-set in T, [b} partitions all vertices the same partition at each end of b. Consider of T into two disjoint sets-one Cutof verticesin G, and the cut set S in G that corresponds to this partition. the rest b and the of set S will contain branch one of T, edges in (if any) only
Fundamental

Cut-Sets:

G. Take

branch

b in

of a

V2)

I I)

d)

V4)))

VI

V6

/ //
V3 I /

/
/

/
I

Vs

Fig.

4-3

Fundamental

cut-sets of a

graph.)

72)

CUT-SETS AND

CUT-VERTICES)

CHAP.

4)

cut-sets with respect T (in heavy lines) and all five of the fundamental to T are shown (broken lines \"cutting\" each cut-set). through tree defines a unique Just as every chord of a spanning cirfundamental tree defines a unique fundamental cut-set. It cuit, every branch of a spanning must be kept in mind that the term fundamental cut-set (like the tern1 also with tree. fundamental has meaning only to a given circuit) respect spanning can be obtained from Now we shall show how other cut-sets of a: graph a given set of cut-sets.)
THEOREM

4-4)

The disjoint

ring sum of any two union of cut-sets.)

cut-sets

in a graph is either

a third

cut-set or

an

edge-

Outline of Proof: Let SI and

S2

G. Let
V

VI

and

V 2 be

the

(unique

be two cut-sets in a and disjoint) partitioning


be

given

connected graph of the vertex set

of

G corresponding
[see

to S2. Clearly

Figs.
V t V 3

to S 1. Let V 3 and V 4 4-4(a) and (b)],)


U U

the

partitioning

corresponding

V2 = V4 =

V
V

and
and)

VI n
V 3

V2 = V4 =

0, 0.)

Now let the subset (VI n V4) u (V 2 n V 3) be called V s , and this by definition is the same as the ring sum VI EB V 3. Similarly, let the subset n V 3) u (V 2 n V4) be called V 6 , which is the same as V 2 EB V 3 . See Fig. (VI 4-4(c). The of sum of the two cut-sets S 1 EB S2 can be seen to consist only ring V in V in . there are no outside 6 Also, s to those edges edges that join vertices SI EB S2 that join vertices in V s to those in V 6 . a partitioning of V into V s and the set of edges Sl EB S2 produces Thus V 6 such that) V s n V 6 = 0.) V s U V6 = V and
Hence S I
connected EB S2

is a
of

after
union

St EB S2 is
cut-sets.

cut-set if the subgraphs containing removed from G. Otherwise,

V s and

SI

ffi

V6 each remain S2 is an edge-

disjoint

Example: of cut-sets.)

In Fig.

4-3 let

us

consider

ring sums

of the

following

three

pairs

{d, e,f}
{d, e,

EB

{J:

g, h}

= {d, e, g, h},

another another

cut-set, cut-set,

{a, b} EB {b, c,

e,f} =
=

g,

h}

ffi

{.t: g,

{a,c, e,f}, = {d, e,J: h, k} k}


{d, e,f}

{h,

k},

an edge-disjoint
II)))

union of

cut-sets.

SEC. 4-4)

FUNDAMENTAL

CIRCUITS

AND CUT-SETS)

73)

I I I (a))

I I \\

/
,

/ ./

./ \"

,.....\"\"\" ,,\"\"\"

\037......-------....

v2 nv

3)

/ /---........\" \\ I
I

/\"--

\037 \\
I

'

\\

'/ --\037

---)
...... -)

vtnv3\\
\\

::-... \"\\ \\ I I '-

--)

----)

//

v2 nV 4)

(b)

(c))

Fig. 4-4

Two cut-sets

and

their

partitionings.)

So we have a method cut-sets from a number of generating additional of with in cut-sets. we start two cut-sets cannot a Obviously, any given given is a then graph and hope to obtain all its cut-sets by this method. What minimal set of cut-sets from which we can obtain every cut-set of G by taking in Chapter 6) is the set of all fundamen(to be proved ring sums? The answer a tal cut-sets with to respect given spanning tree.)

4-4.

FUNDAMENTAL

CIRCUITS

AND
a given

CUT-SETS) connected
circuit

Consider a spanning

tree T in

graph G. Let C i
made

be

a chord

with respect to T, and let the fundamental of k branches sisting hI' b 2 , . . . , h k

by Ci

be

called
Ci ;

r, conis,

in

addition

to the

chord

that

r =

rCi'

b t, b 2, . . . , hk }

is a fundamental tree

circuit

with

respect

to T.

Every branch

of any

spanning

has a fundamental

cut-set associated with)))

74)

CUT-SETS AND

CUT-VERTICES)

CHAP.

4)

it. Let
in

SI

be

the

fundamental

cut-set associated
that is,)

with

b l'

consisting

of q chords

addition

to the

branch b I ;
C2,

SI

= {bp

cp

. . . , cq}

is a

fundamental

cut-set

with

respect

to

T.)

of Theorem 4-3, there must be an even number of edgescommon Sh and there is only one other edge in SI. Edge b I is in both rand we must have two also be in Sl. Therefore, r (which is cJ that can possibly edges b I and Ci common to S I and r. Thus the chord c; is one of the chords) C p c 2 ,..., cq . cut-sets the same argument holds for fundamental associated with Exactly in every fundamental b 2 , b 3 , . . . , and b k . Therefore, the chord C i is contained
Because to

rand

cut-set associated with


Is
(with it

branches

in r.
to

possible

for to T,

the chord C i

be in any

other fundamental

cut-set S'
bk ? there
S'),

respect

of course)

with besidesthose associated

b p b 2 , . . . and

in r answer is no. Otherwise(since of the branches none would be only one to S' and r, a contradiction edge C i common 4-3. Thus we have an important result.)
The THEOREM
With
4-5)

are

in

to

Theorem

respect

to a given spanning
every

tree T, a chordCi
cut-set

that

detennines
with

a fundamental branches

circuit r
and

occursin
other.)

fundamental

associated

the

in r

in no

As an example,

consider the

spanning

tree

[b, c,

e,

h,

k},

shown
is)

in heavy

lines,

in

Fig.

4-3.

The fundamental
L/:

circuit made by
e, h,

chord

k}.)
by the

The three fundamental


are)

cut-sets

determined

three branches e, h,

and

determined

by branch
branch

e:
h:

{d, e,f},

determined by
determined
Chord

Lt:g,h},

by branch k:)
fundamental

[.t:g,k}.)
cut-sets,

f occurs
fundamental true.)

in each
cut-set

of these three
thai

and there is
Theorem

no
is

other
also

contains

f The

converse of

4-5

THEOREM

4-6)
given

With respect to a

spanning
in

tree
every

mental cut-set S is contained in S, and in no others.))) chords

T, a branch fundamental

bi

that

determines

a fundawith

circuit

associated

the

SEC.

4-5)

CONNECTIVITY AND

SEPARABILITY)

75)

Proof:

The proof
the

consists of
S =

arguments

similar
by

to those that
a branch

led to Theorem

4-5.Let

fundamental

cut-set S determined {hi, CI, C2, .

bi

be)

. . , C p },)
by

and

let

be the

fundamental
r
1

circuit determined
=

chord

C 1 :)

{Cl, b h

b2 ,

. . . , b q }.)

Since

the number
is true

The same
On the

for the
hand,

of edges common to Sand fundamental circuits


suppose
C

r
in

must

be even,

made

other

that

b i occurs

by chords a fundamental

bi must be in r 1. C2,C3, . . . , C p. circuit r p+ 1 made


C 1, C2, . . . , C p is and

by a chord other than in r p+ 1, there is only which is not possible.

1, C2, . . . , C p. Since

one edge bi common Hence the theorem.


illustration

none of the chords to a circuit r p+ 1


.)

the

cut-set

S,

e of

Turning again for spanning tree {b,

to k}.

c, e, h,

The

the graph in Fig. 4-3, consider branch fundamental cut-set determined by e d, f}.)

is)

{e,

The

two

fundamental

circuits
determined

determined
by
by

by chords d:
f:)

d and fare) e},

chord
chord

{d, c,

determined
Branch

{f,e,h,k}.)
circuits,

e is

contained
fundamental

in both

these

fundamental

and

none

of the

remaining three

circuits

contains

branch

e.)

4-5.

CONNECTIVITY

AND

SEPARABILITY)

Each cut-set of a connected graph G consists of a cerThe number of edgesin the smallest cut-set (i.e., cutset with of edges) is defined as the edge connectivity of G. the a be defined as of connected can Equivalently, edge connectivity grapht the minimum number of edges whose removal (i.e., deletion) reducesthe rank of the graph by one. The edge connectivity of a tree, for instance, is one. The edge connectivitiesof the graphs in Figs. 4-1(a), 4-3, 4-5 are one, two,
Edge Connectivity:
number
tain

of edges. fewest number

and

three,

respectively.
graph
a pair and edge

Vertex Connectivity: On examining the removal of no even although single edge(or


t Although

in Fig. 4-5, we find that of edges) disconnects the) connectivity only for a conof and vertex connectivity

we
some

shall

talk

of edge

connectivity the

vertex

nected graph,

authors

define both

connectivity

a disconnected graph

as zero.)))

76)

CUT-SETS AND

CUT-VERTICES)

CHAP.

4)

Fig. 4-5
graph,

Separable

graph.)

the

removal
called

of the single vertex


vertex

does.t

Therefore,
as

we define
(or

another
simply

analogous term
connectivity)
Again,

connectivity.
G leaves

The vertex
the

connectivity

of a

connected graph G is defined


from

minimum

number of

vertices whose removal


the
in

graphs
that

vertex connectivity of a tree is one.The 4-3, and 4-5 are one, two, 4-1(a), Figs.
the

the remaining graph


vertex and

disconnected.\037

connectivities

one,

from

for

graphs

way we have defined it vertex that have three or more vertices


connected other

and

connectivity are not

of the Note respectively. is meaningful only


its

complete.
vertex

connectivity
equivalent

Separable Graph: A is one. All


definition

graph connected

is said graphs

if to be separable

are called

a connected graph G is saidto be separable if such that g (the complement of g in G) and g are equivalent have only one vertex in common. That these two definitions In a separable graph a vertex whoseremoval can be easilyseen(Problem 4-7). a cut-node, or an articulation the graph is called a cut-vertex, disconnects point. For example, in Fig. 4-5 the vertex v is a cut-vertex, and in Fig. 4-1 (a) vertex v 4 is a cut-vertex. in a tree every vertex I t can be shown (Problem 4-18)that with than one is a cut-vertex. Moreover:) degree greater
is that there

nonseparable.An

exists a

subgraph g in G

THEOREM A vertex vertices

4-

7)

v in a
y

connected

graph

G is a
path

cut-vertex
between

if

and
y

only
passes

if there through

exist
v.)

two

x and proof
The

in

G such that

every

x and

The

of the
in

theorem is quite easy and


of the sense

4-17).

implication the

crucial vertex

is left as an exercise (Problem theorem is very significant. It states that v is a between x and y (if G rethat any communication network)

presented a communication
t Recall

must

\"pass through\"

v.)

because vertex, when we delete in the

that removal of a vertex the removal of all implies without both the end vertices an edge does not or removean edge from a graph, the end vertices
footnote

the edges exist. On of

incident on that the other hand, the edge are still left

graph.
the

\037See

on p.

75.)))

SEC. 4-5)

CONNECTIVITY

AND SEPARABILITY)

77)

Fig.

4-6

Graph

with

8 vertices

and 16

edges.)
An by

Application:

means

where e
that

the

we are given n stations that are to be connected Suppose of e lines (telephone lines, or highways) railroads, tunnels, > n - I. What is the best way of connecting? By \"best\" we mean network should be as invulnerable to destruction of individual sta-

bridges,

tions and individual n vertices and e

lines

has n = 8, e = 16, and has vertex with the of one and edge connectivity of three. Another connectivity graph as same number of vertices and can be drawn edges (8 and 16, respectively)
in

edges that vertex connectivity. For example, the graph


shown
4-6.

as possible. In other the maximum has

words, construct

a graph

with

possible edge connectivity and

Fig. 4-5

in

Fig.

as well as the vertex coneasily be seenthat the edge connectivity this four. even after is nectivity any three stations are graph Consequently, lines or three stations can still conthe bombed, any remaining destroyed, tinue to \"communicate\" with each Thus the network of Fig. 4-6 is other. better than that of Fig. 4-5 (although both consist of the same connected
It can
of

number

of Jines-16).
is the

can

The next question is what


achieve

highest

vertex and edge connectivity we


theorems

for

a given

nand

e? The

following

constitute

the

answer.)
THEOREM

4-8

The edge connectivity the smallest degree in G. Proof:


the

of a graph
be
Vi

G cannot

exceed the
smallest
by

degree of the
degree
removing
in

vertex

with

Let vertex
of
on
\"-';.

Vi

the vertex
can

with

the

G.

Let d(Vi)

degree

Vertex
\"-'i.

be separated

from G

the d(Vi)

be edges

incident

vertex
4-9)

Hence

the theorem.

.)

THEOREM

The vertex

connectivity of
rJ, rJ,

any

graph

G can

never exceed the

edge

connectivity

of

G.)

Proof:

Let
G with

denote edges.
rJ,

the edge Let S


vertices

set S

in

connectivity of partition the vertices


VI (or
V 2)

G. Therefore,
of G

there

exists

a cutV2 .

By removing

at most

from

on

into subsets VI which the edges in S are

and

incident,)))

78)

CUT-SETS AND

CUT-VERTICES)

CHAP.

4)

we can

effect

the

removal

vertices) from
COROLLARY)

G.

Hence

of S (together the theorem. .)

with

all

other

edges incident on these

Every

cut-set

in a nonseparable

graph

with

more

than two

vertices contains

at

least

two edges.)
4-10) one

THEOREM

The and

maximum vertex connectivity e edges (e > n - 1) is the integral


Every

can achieve

with

a graph 2e/n;

G of
that

vertices

part

of the

number

is, L2e/nJ.

in G contributes two degrees. The total (2e degrees)is divided Therefore, there must be at least one vertex in G whose degree of G cannot exceed is equal to or lessthan the number 2e/ n. The vertex connectivity this in light of Theorems 4-8 and 4-9. number, one can first construct To show that this value can actually be achieved, an add the remaining e - (n/2). n-vertex regular graph of degree L2e/nJ and then L2e/nJ The completion of the proof is left as an exercise. .) edges arbitrarily.

Proof:

edge

among

n vertices.

The results

of Theorems 4-8,4-9, and


vertex

4- I 0

can be

summarized as follows:)

.. connectIvIty

< e d ge _
. .

< connectIvIty _
pOSSI bl e
.
==

..

-,
2e n)

and) .
maxImum

vertex

2e
l n

connectIvIty

.)

Thus,

for a four

graph

with vertex

8 vertices

we can
high A therefore,

achieve a
(== 2.
G is

connectivity

and 16 edges (Figs. 4-5 and 4-6), for example, therefore (and edge connectivity) as
the

as

16/8).

graph

said to

be k-connectedif
graph

vertex

connectivity

of G is

k;

a I-connected

is the same

as a separable graph.)

THEOREM

4-11)
if and G is k-connected only if every pair of vertices in G is graph more paths that do not intersect, t and at least one pair of vertices k nonintersecting paths.) exactly

A connected joined
by

k or

is joined by
THEOREM

4-12

G is k if and only if every pair of vertices in edge connectivity of a graph (Le., paths that may intersect, but have joined by k or more edge-disjoint paths is joined by exactly of vertices k edgeand at least one pair no edges in common),

The

G is

disjoint
tPaths
secting

paths.)

paths

with no common vertices, except or vertex-disjoint paths.)))

the two

terminal

vertices,

are called

noninter-

SEC. 4-6)

NETWORK

FLOWS)

79)

4-] I

The reader is referred to Chapter 5 of [1-5] for the proofs of Theorems and 4-12. Note that our definition of k-connectedness is slightly different from the one given in [1-5]. A special result of Theorem 4-11is that a
a circuit

graph
in

G is nonseparable if and (Problem 4-13).

only

if any

pair of

vertices

in

G can

be placed

The reader is encouraged to verify edge-disjoint and vertex-disjointpaths


tices

these
between

theorems
each

by enumerating
of the

all

15 pairs

of ver-

in Fig.

4-3.)

4-6.

NETWORK

FLOWS)

In a

network of
and

gas or water),
that
work

is possible
is

telephone lines, highways, is important to from one station to another


so on, it

railroads,
know

the

of pipelines maximum rate


in

oil (or of flow

in

the

network.
the

This type of
which

net-

represented
number
number,

by a weighted connected graph

the

vertices
weight,

are the stations and the

edges are lines through


of messages,
associated

which

given commodity
The

(oil, gas, water, a real positive


the graph

number of
with

cars, etc.)flows.
network

each edge
flow

line, in

that Fig.

is, the

maximum amount of flow

represents the capacity of possible per unit of time. The


consisting

stations and 31 lines.The


the

4-7, for example,


capacity

represents a
of each

of 12
in

of these

lines is also indicated

figure.

It is assumed
entering

that

at

each

intermediate

is equal
of through

to the rate
the a vertex

or generation
the
dent through flow

leaving.In

other

vertex the total rate of commodity there is no accumulation words,


along the

commodity

at any is limited only

vertex by

the way.
as

Furthermore,

capacities

on

it. In
the

other words, the vertex itselfcan handle edges. Finally, the lines are lossless.)
B)

of the edges incimuch flow as allowed

A)

M)

6)

7.5)

Fig. 4-7

Graph of a

flow

network.)))

80)

CUT-SETS

AND CUT-VERTICES)

CHAP. 4)

In such
].

a flow

problem

the questions
flow

to be answeredare)
through

What

is the
of

maximum

possible

the network
4-7?

between a
through

specifiedpair
2. How
each

vertices-say,

from
flow
flow

B to
(i.e.,
exists)?)

in

Fig.

edge
Theorem

do we achieve this when the maximum


4-13, perhaps

determine

the actual

flow

port networks, answers the


implicitly

the most important result in the theory of transThe second question is answered first question.

a constructive the statement proof of the theorem. To facilitate of the theorem, let us define a few terms. a and b in a connected graph G A cut-set with respect to a pair of vertices puts a and b into two different components (i.e., separates verticesa and b). in Fig. 4-3 cut-set [d, e,f} is a cut-set with respect to VI and V 6 . For instance, The set [./: g, h} is also a cut-set with to VI and V 6 . But the cut-set respect to VI and V 6 . The capacity of cut-set S in [./: g, h} is not a cut-set with respect a weighted connected graph G (in which the weight of each edge represents its is defined as the sum of the weights flow of all the edges in S.) capacity)
by

and proof

THEOREM

4-13)
flow

The maximum to
the

possible

between

two vertices
cut-sets

and

bin

a network

is equal

minimum

of the

capacities of all

with

respect to

and

b.

Consider any cut-set S with respect to vertices a and b in G. In the subS left after is no path between removing S from G) there (the subgraph graph a and b. Therefore, every path in G between a and b must contain at least one edge one or more of S. Thus every flow from a to b (or from b to a) must pass through edges of S. Hencethe total flow rate between these two vertices cannot exceed the capacity of S. Sincethis holds for all cut-sets with respect to a and h, the flow rate of their capacities. cannot exceed the minimum .)
Proof:
G

To show
requires
will

that

some concepts

therefore

It flow can actually be achievedis somewhat involved. later. The completeproof that are to be introduced be deferred till 14, where flow problems will be treated Chapter this
detail.)

in much

greater

4-7.

1-ISOMORPHISM)

of two or more nonseparable subgraphs. Each is called a block. use the authors (Some subgraphs with components of a disconnected term component, but to avoid confusion graph, we shall use the term block.) The graph in Fig. 4-5 has two blocks. The
A separable
largest

graph consists

of the

nonseparable

graph

in Fig.

4-8 has five

blocks

(and

three cut-vertices

a, b, and c); each

block)))

SEC. 4-7)

I-ISOMORPHISM)

81)

I / / I I I \\ \\ \\

/ ./

\"\\

'\\ \\ \\

/) \"- I) \\ \\ \"

./

.\"...-- -......)

\"-

\\ b ...-------. \\'......____---c
'\\ '\\ ,) ./) I I I

\"\"-)

./)

/)

\"\\ \\ \\ I I I / /

'-/)

Fig. 4-8

Separable graph

with

three

cut-vertices

and

five

blocks.)

. b2)

.
c()

x)

Fig.

4-9

Disconnected

graph

I-isomorphic

to Fig. 4-8.)

enclosed by a broken line. Note consists of graph just one block.


is

shown

that

nonseparable 4-9 with

connected

Visually

compare

the

disconnected
not

graph

in

Fig.

4-8. These
number

two graphs
vertices),

are certainly
but they

isomorphic
the

of

are related by

the one in Fig. have the same do not (they fact that the blocks of the
the graph
become
in

graph

Such

of isomorphic to the components are said be to More formally: graphs I-isomorphic. in Fig.

4-8 are
G1

Fig.

4-9.

Two

graphs

and

G 2 are
repeated

said

to be

I-isomorphic if they

isomor-

phic to each

other under
\"Split\"

application

of the following

operation.
disjoint

OperationI:
subgraphs.

a cut-vertex

into two

vertices to producetwo

From
isomorphic

this

definition

if and

it is apparent that two if only they are isomorphic.)

nonseparable graphs are

1-

THEOREM

4-14)

G2

If Gland G 2 are two I-isomorphic and the nullity of G 1 equals the Proof:

graphs,

the rank

of G1

equals

the rank

of
into)))

nullity of G2 .
a cut-vertex

Under

operation 1,

whenever

in a graph G is

\"split\"

82)

CUT-SETS AND

CUT-VERTICES)

CHAP.

4)

two vertices,

the
is)

number

of components

in G increases

by

one.

Therefore,

the rank

of G which

number remains

of vertices

in

- number

of components in

G)

invariant

under operation 1.)

or new edges created by operation Also, since no edgesare destroyed 1, two have the same number of edges.Two with equal rank I-isomorphic graphs graphs and with equal numbers of edges must have the same nullity, because) nullity
=-::

number

of edges

rank.

.)

What jf we join two components of Fig. 4-9 by \"gluing\" two together vertices (say vertex x to y)? We obtain the graph shown in Fig. 4-10. to the graph in Fig. 4-9. Clearly, the graph in Fig. 4-10 is I -isomorphic in Fig. 4-10 are isomorphicto the blocks Since the blocks of the graph of the Thus the three graph in Fig. 4-8, these two graphs are also I-isomorphic. to one another.) graphs in Figs. 4-8, 4-9, and 4-10 are I -isomorphic

al)

.
c()

Fig.

4-10

Graph I-isomorphic

to

Figs.

4-8 and

4-9.)

4-8. 2-ISOMORPHISM)

In Section 4-7
I -isomorphism. were

we

generalized

the concept

isomorphic
for

A graph to the

G 1 was I -isomorphic blocks of G2 . Since


nonseparable

of isomorphismby to graph G2 if the

introducing

blocks

of G 1

for block, I-isomorphism However, I

a nonseparable graph is just one is the same as isomorphism. graphs


vertex

-isomorphism
I

graphs (i.e., graphs with separable is different from isomorphism.


but
I

connectivity
that

of one),
isomorphic

Graphs

are

are also
generalized

-isomorphic,

-isomorphic
useful

isomorphism

is very

may not be isomorphic.This graphs in the study of separable graphs.)))

SEC. 4-8)

2-ISOMORPHISM)

83)

its scope for 2-connectof connectivity two), as follows: I n a 2-connected graph G let vertices x and y be a pair of verticeswhose removal G will leave the remaining graph disconnected.In other from words, G consists of a subgraph gland its complement g t such that gland g 1 have two vertices, x and y, in common. that we perform the folexactly Suppose 2 on G (after which, G no longer remains the of course, lowing operation
We can

ed graphs

generalize
graphs

this

concept

further

to broaden

(i.e.,

with vertex

original

graph).

and
X 2 X 2

the vertex x into x 1 and X 2 and the vertex y into Y 1 Operation 2: \"Split\" x 1 and Y 1 go with gland Y2 such that G is split into gland g l' Let vertices and Y2 with g 1. Now rejoin the x 1 with Y2 and g 1 by merging graphs gland with were x and y in G could have edges whose end vertices Y 1. (Clearly, g 1 or

gone with
Two

become isomorphic after undergoing operation I (in Section 4-7) or operation 2, or both operations how the two graphs in of times. For example, Fig. 4-11 shows any number 4-1 I (a) and (d) are 2-isomorphic. Note that in (a) the degree of vertex Figs. x is four, but in (d) no vertex is of degreefour. the definition are From it follows immediately that isomorphic graphs always I-isomorphic, and I-isomorphic graphs are always 2-isomorphic. and But 2-isomorphic I-isomorphic) graphs are not necessarilyI-isomorphic, graphs
if they
x)

g l' without affecting the are said to be 2-isomorphic

final

graph.)

Xl

X 2)

gI)

Y)

YI
(a))

Y2) (b))

Y1

2)

gl)

Xl

Y2)

(c))

(d))

Fig. 4-11

2-isomorphic graphs

(a) and (d).)))

84)

CUT-SETS AND

CUT-VERTICES)

CHAP.

4)

are not necessarily isomorphic.However, for graphs three or more, isomorphism, I-isomorphism, and

with connectivity are syn2-isomorphism


graphs

onymous. I t is clear

that

tion 2. Therefore,

operation 2. And not change under


rank

and equal

in

to specifya graph
a counterexample
Circuit if correspondence

under operaremain unchanged under as shown 4-7, the rank or nullity of a graph does 1. Therefore, in operation 2-isomorphic graphs are equal The fact that the rank r and nullity nullity. J.l are not enough within can easily be shown 2-isomorphism by constructing
are

no edges
the

or vertices

created

or destroyed

rank

and nullity in Section

of

a graph

(Problem 4-23).
they

Correspondence:

meet

between correspondence

ence between the circuits certain edges of G1 has

graphs Gland G2 are said to have a circuit the following condition: There is a one-to-one the edges of Gland G2 and a one-to-one correspondG 2' such that a circuit in G 1 formed of Gland by
Two

a corresponding

circuit

in

G 2 formed

by the

correhave

sponding edgesof
circuit

G 2'

and

vice versa.

lsomorphic graphs, obviously,


to

correspondence.
as a particular G undergoes

Since in a separable graph G every circuit is confined block (Problem 4-15), every in G retains its -edges circuit

operation I

(in

Section

4-7).

Hence

-isomorphic

graphs
circuit

have circuit
in

correwhen

pondence.
Similarly,

let

us consider

2, undergoes operation one of three categories:)

what happens to a as defined in this section.

a graph

it
in

A circuit

in

G will

fall

I. r is made of

edges

all in

2. r 3. r
In cases

is is

made made

of edges of edges

all in

or g l' or
g l'
and

both vertices x and


I

from both gland g l'


y.)

in that

case r must

include

and

2,

r is unaffected
that is

by

operation

original edges, except constituted a part of r, undergoing Theorem

the

path
its

between
around.\"
original

2. In case 3, r vertices x and y

still in

has g l'

the

which

\"flipped

Thus
edges.

operation
circuit
which

2 retains

Therefore,

every circuit in a graph 2-isomorphic

graphs also have


4-15,
due

correspondence. is considered

the most

important result for 2-isomor-

phic graphs,is
THEOREM

to H.

Whitney.)

4- I 5)

Two

graphs

are 2-isomorphic
\"only \"if\"

if

and

only

if they
shown

have
in

circuit

correspondence.

Proof:
the

The
paper

if\" part

theorem.

The

part has already been is more involved, and

the argument

preceding
Whitney's

the

reader

is referred to

original

[4-7].)))

CHAP.

4)

SUMMARY)

85)

As we
and

shall observe
correspondence

in

subsequent

chapters, in duality

the ideas

circuit

play important
and

roles

m of 2-isomoTphis

in

the

theory

of contact

networks, electrical networks,

of graphs.)

SUMMARY)

Our
tion

main

concern
a connected

in this

chapter was with


Which part of

answering

the to

following

quesre-

about

moved,

breaks

specifya graph

graph: the graph apart? Clearly, the in many aspects and tells a great
considerable

a connected graph, when


answer deal

this question it. Some of about

does

answer to the above question, we came acrossthe concut-vertices, connectivity,and so on. Many of the theorems cepts between these characteristics of a graph. showed relationships a cuttree (which keeps the vertices In contrast to a spanning together), there was be a bound to closereset separates the vertices. Consequently, a spanning tree and a cut-set. Someof the theorems between (and lationship describe this relationship between the problems at the end of this chapter)
the

are of properties graphs. In pursuit of


of cut-sets,

significance

both in theory and

these applications of

spanning

trees

and

cut-sets.
minimum

In terms

of the
graphs

number

of vertices

whose removal disconnects

a graph,

all

can be

classified according to

Fig. 4-12.)

All graphs)

Connected
m \0371)

Disconnected

m =

0)

Separable

m =

Nonsepara
1)

ble

\0372)

2- connected

m- connected
m\037 3)

m =

2)

(m is the
Fig.

vertex-connectivity))

4-12

Classification

of graphs

according

to

their

connectivity_)))

86)

CUT-SETS

AND

CUT-VERTICES)

CHAP.

4)

very

important

and practical result

of this

chapter

was

the max-flow

min-cut theorem

(Theorem 4-13).)

REFERENCES)
material in this chapter is based on the classic work of Hassler Whitney in the early 1930s, [4-6, 4-7]. Menger [4-5],in 1927, showed that the vertex of a graph was related to the number of vertex-disjoint paths between two connectivity vertices in a graph. Many of Menger's theorem have appeared. variations Harary [1-5], results and shows how there are 18 Chapter 5, gives an excellent survey of Mengerian different theorems the two most important-Theorems possible (of which we have given 4-I 1 and 4- 12). The max-flow a variation of Mengerian min-cut theorem-also results -was discovered independently and Elias, by Ford and Fulkerson [4-2] Feinstein, and Shannon [4-1].The best reference for network flow problems is the authoritative book and Fulkerson [4-3]. Other for this chapter are) references recommended by Ford
Most

of the

conducted

1. Berge

[1-1], Chapter
and

20.
[1-2], Chapter

2. Busacker 3. Kim and


4-1.

Saaty

7.
3.)

Chien

[4-4], Part V, Chapters 2 and


and

Vol. IT-2, Dec. 1956, 117-119. IRETrans./nform. Theory, 4-2. FORD, L. R., and D. R. FULKERSON, HMaximal Flow Through a Network,\" Can. J. Vol. 8, 1956, 399-404. Math., 4-3. FORD, L. R., and D. R. FULKERSON, Flows in Networks, Princeton University Press, Princeton, N.J., 1962. 4-4. KIM, W. H., and R. T. CHIEN, Topological Analysis and Synthesis of Communication Columbia Networks, University Press, New York, 1962. 4-5. Fund. Math., Vol. 10,1927,96-115. MENGER, K., \037'Zur allgemeinen Kurventheorie,\" 4-6. Am. J. Math., WHITNEY, H., \"Congruent Graphs and the Connectivity of Graphs,\" Vol. 54, 1932,150-168. 4-7. WHITNEY, H., \"2-Isomorphic Graphs,\" Am. J. Math., Vol. 55, 1933,245-254.)

ELIAS, P., A. a Network,\"

FEINSTEIN,

C. E.

SHANNON,

HA Note

on the

Maximal

Flow

Through

PROBLEMS)

4-1.
4-2. 4-3. 4-4.
4-5. 4-6.

Pick n By

an arbitrary spanning tree in the graph given in Fig.4-6. List all = 7) fundamental cut-sets with to this tree. respect

seven (because
in

list
List Show

the ring sum taking all other cut-sets of


all cut-sets that

of the seven the graph. with respect to the


and

fundamental vertex vertex pair

cut-sets obtained
V2, V3

Problem

4- I,

in the graph
the

in Fig.

are

the edge connectivity each equal to three.

connectivity of

graphs

in Fig.

4-1(a). 2-2

4-7. 4-8.

What is the edge connectivity of the complete graph of n vertices? Prove that in a connected graph G the conlplement of a cut-set in G does not contain a spanning tree and the complement of a spanning tree (i.e., chord set) does not a cut-set. contain Show that the two definitions of separability in Section 4-5 are equivalent. Prove that in a nonseparable graph G the set of edges incident on each vertex of G
is a
cut-set.)))

CHAP.

4)

PROBLEMS)

87)

4-9.

4-10.

4-11.

4-8 not applicable to separable graphs also? Why is the result of Problenl Explain. Prove that in a connected graph G a vertex v is a cut-vertex if and only if there exist two (or nl0re) edges x and y incident on v such that no circuit in G includes both x and y. Prove that every connected graph with three or nlore vertices has at least two vertices which are not cut-vertices.
Prove

4-12. 4-13. 4-14.

that

a nonseparable

graph

has

a nullity

J1

if and

only
vertex

if

the

graph

is a

circuit.
Show

that

placed in

sonle

a graph G is nonseparable circuit in G.

If

and

only

if

every

pair in G can
arbitrary

be

that a sinlple Show edges a circuit can


How

graph
always

is

if and only if for any two given nonseparable be found that will include these two edges.

4-15.
4-16.
4-17.

can

tifYing
What constitute

4-13 you utilize the result of Problenl every block of a large separable graph? condition necessary and sufficient a set of fundanlental cut-sets in G?

to obtain an algorithm
n

for

iden-

is a

that any

cut-sets

in Problem

4-8

Prove Theorem
that that
Show

4-7.
every

4-18. Prove
4-19.

in a tree

vertex

of degree

greater
is

a graph with n vertices and with least kll/2 edges. (A special case of this result nonseparable graph is at least two.)

vertex

cut-vertex. k must have at connectivity that the degree of every vertex in a


than

one

is a

4-20. Is every regular graph of degree d (d > 3) nonseparable? graph of degree three that is separable. 4-21. Conlplete the proof of Theorem 4-10. 4-22. In a connected graph G, let Q be a set of edgeswith of edges (a) Q has an even number (zero included)
of G.

If not,

give

a simple

regular

the following properties: in comnlon with every cut-set

subset of Q that satisfies property (a). circuit. 4-23. Construct a graph G with the following of G = 4, properties: Edge connectivity = > vertex of G and of vertex of G 5. 3, connectivity degree every 4-24. two graphs with the same rank Show (by drawing them) that and the sanle nullity need not be 2-isomorphic. 4-25. I n Fig. 4-7, between vertices A and M, pick out a completeset of
no proper

(b) There is
Prove
that

Q is a

(a)
4-26.

Edge-disjoint

paths.

(b) Vertex-disjoint

paths.
Theorems 4- I
I

From

this, that

verify

and

4-12.

tennis tournament is to be arranged among n players and the Suppose n - 1 < e < n(n - 1 )/2). number of nlatches is a fixed number e (where planned For the sake of fairness, how will you make sure that some players do not group together and isolate an individual (or a small group of players)? 4-27. Let us define a new term called edge isomorphism as follows: Two graphs Gland G2 are edge isomorphic if there is a one-to-one correspondence between the edges of Gland G 2 such that two edges are incident (at a common vertex) in G 1 if and in G 2. Discuss the properties of only if the corresponding edges are also incident an example to prove Construct that edge isomorphism. graphs edge-isomorphic not be isomorphic. may have a cut-set with 4-28. Prove that an Euler graph cannot an odd number of edges.
a singles
(Hint:

Use

Theorem

1-1.))))

5)

PLANAR

AND

DUAL GRAPHS)

In Chapters of subgraphs, such as paths, 2, 3, and 4 we studied properties in a given connected graph G. In this circuits, spanning trees, and cut-sets, we shall subject the entire graph G to the following chapter important question: Is it possible to draw G in a plane without its edges crossing over? This of planarity is of great significance a theoretical from question point of view. In addition, planarity and related concepts are useful in many other practical situations. For instance, in the design of a printed-circuit board, the electrical without must know if he can make the required connections engineer an extra layer of insulation. The solution to the puzzle of three utilities, posed in Chapter I, requires the knowledge of whether or not the corresponding in a plane. graph can be drawn But before we attempt to draw in a plane, let us examine the a graph
meaning

of \"drawing\"

a graph.)

5-1.

COMBINATORIAL

VERSUS

GEOMETRIC

GRAPHS)

As mentioned
any

in

Chapter

geometric

connotation

1, a graph of its ability


an

exists as an
of

abstract

object, be defined

devoid as)

of

being

drawn

in a
can

three-dimensional

Euclidean space.For example,

abstract
=

graph

G1

G1

(V, E,

'P),)
G,

where the set

consists

of the five V =

objects named [a, b, c, d,


88))) e},)

b,

c, d,

and e,

that

is,)

SEC. 5-1)

COMBINATORIAL

VERSUS

GEOMETRIC

GRAPHS)

89)

and

the set

E consistsof seven
7,

objects

(none

of which is

in

set

V) named

1, 2,

3, 4, 5, 6, and

that

is,)

==

[1,2,3,4,5,6,

7},)

and

the

relationship
of)

between the two sets is definedby


1

the

mapping

'P, which

consists

\037

(a, c)

2 \037 (c, d)
3

\037

(a, d)
(a,

'P == 4 -\037
5 \037

b).

(b, d)
(d,

6 -\037
7 \037
Here,

e)

(b, e))
1

the

symbol
pair

1 --\037

(a,

c) says

that object
set

from

set E

is mapped

onto the

(unordered)

(a, c)

of objects from

V.

this Now it so happens that combinatorial abstract object G 1 can also be of a geometric figure. In fact, the sketch in Fig. 2-13 is represented by means one such geometricrepresentation of this graph. Moreover, it is also true that can be represented means of such a configuration in threeby any graph

dimensional

Euclidean

space.
realize

It is important

to

that

what

is sketched of the graph

in

Fig.

2-13
not

is merely
the

one
G1

(out of infinitely
itself.

many)

representation

Gland

graph

We

placed e
representing
representation

have, for instance, twisted some of the edges or could have within the a, d, b and thereby obtained a different triangle figure is no chance of confusion, a pictorial G 1. However, when there be regarded of the graph has been and will as the graph
could
slurring

itself.

This convenient
Unlike in the make a distinction
geometric

over
theory and

is done
for little
in

and clarity. Learning graph would be extremely difficult


last
between

deliberately for the the first time without


chapter

sake

of simplicity
any

diagrams

fun. t
this

four chapters,
the of a

it

will

often

be necessary

to

abstract

(or combinatorial)

graph and a

representation

graph.)

this pOint I cannot resist quoting the following \"Descomment by Hadamard: tAt it completely of imagination, and wishes to eliminate cartes distrusts that intervention another . . freed from science.. .. More recently, rigorous treatment of... geometry. mathematician has been developed. . . by the celebrated from any appeal to intuition, of geometrical sense is eliminated. But is it the same Hilbert. Logically, every intervention the psychological not. . . . Diagrams from point of view? Certainly appear at practically every page (of Hilbert's book).\)

90)

PLANAR

AND DUAL GRAPHS)

CHAP.

5)

5-2.

PLANAR

GRAPHS)
be planar on

of G
A

A graph G is saidto which can be drawn

if there

exists some geometric


that

representation

a plane

such

no

two

of its

edges intersect.t

that cannot be drawn on a plane without a crossover between its graph edges is called nonplanar. A drawing of a geometric representation of a graph on any surface such that no edges intersect is called embedding. to declare that a graph G is Thus, non planar, we have to show that of all possible geometric of representations G none can be embedded in a plane. a geometric graph G is Equivalently, if there exists a graph isomorphic to G that is embedded in a plane. planar Otherwise, G is non planar. An embedding of a planar graph G on a plane is called a plane representation of G. For instance, consider the graph represented by Fig. 1-3. The geometric representation shown in Fig. 1-3 clearly is not embedded in a plane, because the edges e and f are intersecting. But if we redraw edgef outside the quadriwe have embedded the new lateral, leaving the other edges unchanged, in the plane, thus that the graph which is being geometric graph showing the two isomorphic represented by Fig. 1-3 is planar. As another example, diagrams in Fig. 2-2 are different geometric representations of one and the same graph. One of the diagrams is a plane representation; the other one is not. The graph, of course, is planar. On the other hand, you will not be able to draw any of the three configurations in Fig. 2-3 on a plane without edges The reason is that the graph which these three different intersecting. diagrams in Fig. 2-3 represent is nonplanar. A natural now is: How can we tell if a graph G [which be question may given by an abstract notation G = (V, E, 'P) or by one of its geometric is planar or nonplanar? To answer this let us first representations] question, discuss two specific nonplanar graphs which are of fundamental importance. These are called Kuratowski's after the Polish mathematician Kasimir graphs,

Kuratowski, who
5-3.
KURATOWSKI'S

discovered

their

unique

property.)

TWO

GRAPHS)

THEOREM 5-1)

The complete graph


Let the five Proof: Vs. A complete graph,

of five

vertices is
in the

non

planar.)

vertices as

complete

graph

be

named

VI,

V2,

V3, V4, and

is joined to
tNote

every

other

you vertex

may recall, is a by means of an

simple graph
edge. not

in which

every vertex

This

being the an

case, we

must)

that the

\"meeting\"

of edges

at a vertex is

considered

intersection.)))

SEC. 5-3)

KURATOWSKI'S TWO

GRAPHS)

91)

V2)

V2)

VI)

V3)

VI)

V3)

V5)

V4) (a))

Vs) (b))

V4)

V2)

\037)

V3)

V3)

Vs)

V4)

Vs)

V4)

(c)) V2)

(d))

VI)

V3)

Vs) (e))

V4)

Fig. have

5-1

Building up of

the

five-vertex

complete

graph.)

v I to V2 to V3 to V4 to Vs to v I-that is, a pentagon. pentagon must divide the plane of the paper into two regions, one inside and the other outside (Jordan curve theorem). Sincevertex VI is to be connected to V3 by means of an edge, this edge may be drawn inside or outside the pentagon (without the five edges drawn intersecting that we choose to draw a line from v I to V3 inside the penpreviously). Suppose tagon. See Fig. 5-1(b). outside, we end up with the same argument.)))) (If we choose

a circuit

going from
This

SeeFig. 5-1

(a).

92)
Now

PLANAR

AND DUAL GRAPHS)

CHAP.

5)

we have

neither

to draw an of these edgescan

edge
be

from
drawn

V2

to V4 and

another

one from
without pentagon.

V2

to

Vs. Since

inside the

pentagon

edge already drawn, The edge connecting crossing the edge


with

we draw V3 and

both these Vs cannot


and

edges outside the


be
drawn

over the crossing See Fig. 5-1(c). pentagon

outside

the

without

between

V2

V4. Therefore,

V3 and

1'S have to be
V4.

connected

an
Now

edge
we

have

placedinside
be embedded

inside the pentagon. See Fig. 5-1 (d). an edge between VI and yet to draw a crossover. or outside the pentagon without in a plane. See Fig. 5-1(e). .)
may

This edge cannot be Thus the graph cannot

find this proof somewhat unsatisfactory because it we shall provide you on visual intuition. Do not despair; depends with an algebraic nonvisual proof in the next section. two graphs of is the first five vertices of the A complete graph with Kuratowski. The second graph of Kuratowski is a regulart connected graph with six vertices and nine edges, shown in its two common geometric representations in Figs. 5-2{a) and (b), where it is fairly easy to see that the

Some readers

so heavily

graphs Theorem

are isomorphic.
visual

Employing

geometric

arguments
that

similar
second

5-1, it can
The

be shown
of

the

graph

to those used in of Kuratowski


left

proving

is also
exercise

nonplanar.
(Problem

proof

Theorem

5-2 is, therefore,

as

an

5-1).)

(a))

(b))

Fig. THEOREM

5-2

Kuratowski's

second graph.)

5-2

Kuratowski's

second

graph

is also

non planar.)
properties

Kuratowski.

You may have noticed several These are)

common

to the

two

graphs

of

]. Both are
tRecall

regular

graphs.)
in

that a graph

which

all vertices

are of equal

degree

is called

a regular

graph.)))

SEC. 5-4)

DIFFERENT

REPRESENTATIONS

OF A PLANAR

GRAPH)

93)

2. Both

are nonplanar.
of

3. Removal
4.

one

edge or

a vertex makes each a


is the nonplanar

planar with

graph. the

Kuratowski's number of

graph with nonplanar In the literature, second graph by

vertices, and Kuratowski's secondgraph the number of edges. Thus both smallest
graphs.)

first graph

graph

smallest

is the are

the

nonplanar simplest

Kuratowski's
K 3 . 3 -letter

first

graph

is usually

denoted

by

Ks

and

the

Kbeing

for Kuratowski.)

5-4.
In

DIFFERENT

REPRESENTATIONS

OF

PLANAR
following

GRAPH)
the of Theorem proof a planar graph in a plane

have appeared that one's on his to draw depended ability many crooked lines through This is not the case. The following devious routes. and somewhat tells us that there is important surprising result, due to Fary, no need to bend edgesin drawing a planar graph to avoid edge intersections.)

5-1,

it

may

ability

to draw

THEOREM

5-3
in

drawn

can be embedded Any simple planar graph as a straight line segment.)

a plane

such that every

edge is

is involved and does not contribute much to the understanding The interested reader is, therefore, referred to pages 74-77 in [1-2] or to the original As an illustration, the graph in Fig. 5-1(d) [5-4]. paper of Fary can be redrawn line segments to look like Fig. 5-3. In this theorem, using straight it is necessary because a self-loop or one of two paralJel for the graph to be simple edges cannot be drawn by a straight line segment. .) of

Proof: Theproof

planarity.

Region:

plane

representation
faces,

of a
meshes),

graph divides
as shown
in

the

(also called windo\"'s,

or

plane 5-4. Fig.

into regions A region is)

VI)

V3)))

Vs

Fig. 5-3 Straight-line representation the graph in Fig. 5-1(d).)

of

94)

PLANAR

AND DUAL GRAPHS)

CHAP.

5)

Plane representation Fig.5-4 bers stand for regions).)


characterized

(the num-

by the set of edges (or the set of vertices) forming its boundary. a region is not defined in a nonplanar graph or even in a planar embedded in a not For the graph plane. example, geometric graph in Fig. 1-3 does not have regions. Thus a region is a property of the specific plane of a graph and not of an abstract representation graph per see Note

that

Infinite in

Region:

The

portion
Fig.

of the plane

lying

outside

a graph

embedded
is

a plane,

such as

region 4 in

5-4, is infinite

in its

extent. Sucha region

called

the infinite, unbounded, or exterior region for that outer, particular plane Like other regions, the infinite is also characterized by representation. region a set of edges (or vertices). Clearly, the embedding of a given by changing we can change the infinite For instance, planar graph, region. Figs. 5-1(d) and 5-3 are two different embeddings of the same The finite region VI V 3 V s graph.
in Fig.

show

5-1 (d) that any

becomesthe
region

infinite

region

in Fig.
infinite

5-3. In fact, we
by proper

shall

shortly

can

be made the

region

embedding.
finite and of a sphere.

Embedding on a
infinite

Sphere:To eliminate
graph is often

the

distinction
the

between
surface

regions,

a planar

embedded in

It is accomplished by stereographic of a sphere on a plane. Put projection on the plane and call the point of contact SP (south pole). At point sphere and let the point where SP, draw a straight line perpendicular to the plane, this line the surface of the sphere be called NP (north intersects See pole).
the

Fig. 5-5.

Now, corresponding to any point p on the plane, there exists a unique where the p' on the sphere and vice versa, p' is the point at which line from point p to point NP intersects the surface of the sphere. straight Thus there is a one-to-one correspondence between the of the sphere points in the plane correand the finite points on the plane, and points at infinity spond to the point NP on the sphere. it is clear that From this construction, that can be embeddedin))) any graph
point

SEC. 5-4)

DIFFERENT

REPRESENTATIONS

OF A PLANAR

GRAPH)

95)

NP

\"-, I
I
J I

...., \"

'
\"-

t I I I I I I)

.\037)

.
SP)

p)

Fig. 5-5
a plane
embedded

Stereographic

projection.)

(i.e.,
in

drawn

on

a plane

the

surface

such that its edges do not intersect) of the sphere, and viceversa. Hence)

can alsobe

THEOREM

5-4)

A graph can
in embedded

be embeddedin

the

surface

of a

sphere if

and

only

if it

can be

a plane.)

A planar graph embedded in the surface of a sphere divides the surface is finite, the infinite on different regions. Each region on the sphere region the plane having been NP. Now onto the region containing the point mapped it is clear that the sphere we can make rotating any specified by suitably on the plane. From this we obtain) region region map onto the infinite
into

THEOREM 5-5)
A

planar

graph
by

(i.e., specified Thinking


difference

the

may be embedded in edges forming it) can

plane

such that
infinite

any

specified

region

be made the

region.)

in terms
between
when

Therefore,
we

include

the

we see that there is no real of the regions on the sphere, on the plane. the infinite region and the finite regions we talk of the regions in a plane regresentation of a graph, is no essential difference infinite region. Also, since there planar graph of a sphere

between an embeddingof a may be regarded as the surface


\"plane

on a

plane or on
large

a sphere

of infinitely

radius),
spherical

representation\"

of a

graph is often

used to include
different

(a plane the term as well as

planar embedding.

Euler'sFormula:
tations,

Since

a planar number

graph may have

plane

represen-

we may
same.

ask if
answer

the

of regions resulting
as
graph.)))

from each embedding


Euler's

is the

The

is yes.
any

Theorem 5-6, known


planar

formula,

gives

the number

of regions in

96)

PLANAR

AND DUAL GRAPHS)

CHAP.

5)

THEOREM

5-6)
planar

A connected

graph

with
the

n vertices
theorem adds

and

e edges

has e

2 regions.)

Proof:
a self-loop

It

will

suffice

to prove

for a simple

graph, because adding


graph

or a parallel

edge simply

one

region to

the

and

simultane-

all edges ously increases the value of e by one. We can also disregard (i.e., remove) in Fig. 5-4. that do not form boundaries of any region. Three such edges are shown e by one and inAddition (or removal) of any such edge increases (or decreases) n by one, e - n unaltered. creases (or decreases) keeping the quantity Since any simple planar graph can have a plane representation such that each line (Theorem that such 5-3), any planar edge is a straight graph can be drawn each region is a polygon net representing the net). Let the polygonal (a polygonal let k p be the number of p-sided regions. consist of fregions or faces, and given graph Sinceeach edge is on the boundary of exactly two regions,)

3.k3 +
where

4.k4 + 5.ks+
with

...
...

r.k

r =

2.e,)

(5-1))

k r is

the number

of polygons,
k3 +
k4

maximum

edges.
k r = f.) (5-2)) net
is)

Also,)
+
at

ks +
each

-+

The

sum of all angles subtended

vertex

in the

polygonal

2n n .)

(5-3))

the

Recalling sum

that the sum of all interior of the exterior angles is n(p


angles
defining

angles

as the
exterior

grand sum of all interior angles of the polygon


n(3

+ 2), let us compute of f - 1 finite regions


the
+

polygon is n(p - 2),and the expression in (5-3) plus the sum of the infinite region. This sum is)
of a p-sided ...
-t-

- 2). k 3

n( 4

- 2).k 4

n(r

- 2). k r

-t- 4n (5-4))

= n(2e
Equating

- 2f) + 4n.
(5-3), we get

(5-4) to

2n(e or)

f)

4n =
=

2nn,
n.)

e- f+2
the number

Therefore,

of regions is)
f

= e

2.

.)

COROLLARY

In

any

simple, connected
following

planar

graph

with f

regions,

vertices,

and

e edges

(e > 2), the

inequalities

must hold:)

e> 3

2f,
3n

(5-5)

e<

6.)

(5-6))))

SEC. 5-4)

DIFFERENT

REPRESENTATIONS

OF A PLANAR

GRAPH)

97)

Proof:
belongs

Since each
exactly

region

is

bounded

by at

least three edges and

each edge

to

two regions,)
2e >

3f

or)

e>
for f

'ff)
(5-5),)

Substituting

from Euler's

formula

in inequality

e >
or)

2(e
3n

6.

2)

e <

.) out if a graph is non planar. For of five vertices [Fig. 5-1(e)],) -

example,

Inequality (5-6) is often useful in the case of Ks, the

in

finding

complete graph
10 ,)
(5-6), 3n

n=5
Thus

,)

e =

6 =

9<

e.)

the

graph

violates
this

inequality

Incidentally, of Kuratowski's planarity


is

an

alternative
first

graph,

and hence it is not planar. and independent proof of the as promised in Section 5-3.

non-

not a

but (5-6) is only a necessary, of a graph. In other words, must although every simple planar graph satisfy (5-6), the mere satisfaction of this does not the of a graph. For example, inequality guarantee planarity Kuratowski's secondgraph, K 3,3' satisfies because) (5-6),
be

The reader must


sufficient,

warned

condition

for

that inequality the planarity

3n

- 6

e=9 ,) = 3.6 -

6=

12.)

Yet

the

graph

is non planar.
the

To prove
than

nonplanarity

the additional

fact that

no

of Kuratowski's second graph, we make in this graph can be bounded with region
this

use of
fewer

four edges.

Hence, if

graph 2e

were

planar,

we would

have)

> 4f,)

and,

substituting

for

f from
2e

Euler's formula,)
> 4(e

2),

or)

2.9 >

4(9 - 6 + 2),
a

or)

18> 20,
the graph cannot
Representation

contradiction.)

Hence
Plane

be planar.
and

Connectivity:

embedding

of each

component

In a disconnected graph the can be considered Therefore,))) independently.

98)

PLANAR

AND DUAL GRAPHS)

CHAP.

5)

is planar if and only if each that a disconnectedgraph of its comin a is (or Similarly, separable ponents I-connected) graph the planar. embedding of each block (i.e., maximal nonseparable subgraph) can be Hence a separable considered graph is planar if and only if independently. each of its blocks is planar. it

is clear

Therefore,

in questions

of embedding
planar
this

or

planarity,

one

need

consider

only
a

nonseparable graphs.

Does a

nonseparable

graph
question,

G have
we must

a unique embedding on

sphere?
embedding.

Before

answering

of a planar graph Two embeddings the embeddings can be made to coincide by suitably to the other and possibly distorting regions respect

define the meaning of unique on spheres are not distinct if


rotating (without

one sphere with letting a vertex


distinct,
plane

cross an

edge).

If of all

possible embeddings
a unique

the graph is
representation).

said to

have

embedding

on a sphereno two are on a sphere (or a unique

embedding (b) has

the same graph in Fig. 5-6. The with five edges, but embedding (a) has no region with five edges. Thus, rotating the two spheres on which (a) and (b) are embedded will not make them coincide. Hence the two embeddingsare the graph has no unique plane representation. and distinct, On the other hand, the embeddings in Figs. 5-1 (d) and 5-3, when conto coincide. that edges can be sidered on a sphere, can be made (Remember

For example,

consider two embeddingsof


a region

bounded

bent, and
due to

in

a spherical
tells

Whitney,

sphere. For
THEOREM

a proof

Theorem region.) embedding there is no infinite embeddable when a graph is uniquely the reader is referred to [5-9].) of the theorem, us exactly

5-7,
in a

5- 7
planar

The spherical embedding of every


This

3-connected

graph is
determining

unique.)

theorem

plays

a very important

role in

if a

graph

is)

e 7)

e4)

e()

e 4)

e()

e2) (a))

e 2)
(b))

Fig.

5-6

Two distinct

plane

representations

of the

same

graph.)))

SEC. 5-5)

DETECTION

OF PLANARITY)

99)

planar

or not.
all,

The theorem states


can

that in

a only

3-connected one

graph,

if it can

be

embedded at
5-5.

be embedded

way.)

DETECTIONOF PLANARITY)
How

to

problem,
must
following

and

have

tell if a given graph G \"find out by drawing some simple and efficient
steps:)

is planar or
it\"

nonplanar

is

an

important
we take

is

obviously

not a

good answer. We
goal,

criterion. Toward that

the

simplifying

Elementary

Reduction)
graph

Step J: Sincea disconnected components is planar, we need

consider
only

a separable graph
fore,

is planar

if and

is planar if each if and only of its only one component at a time. Also, if each of its blocks is planar. There-

for

the

given arbitrary

graph G,
G =

determine the
G k },)
we

set)

fGl' G2 ,..., block of

where

each

Gi

is a

nonseparable

G. Then
self-loops

have

to test

each Gi
planarity,

for

planarity.

Step 2:
remove

Since addition or

removal

of

does not

affect

all self-loops.

Step 3: parallel by

Sinceparallel
removing

edges

also

do not

affect planarity,
pair
by

eliminate

edges

in

all but

one edge

between every

of vertices. two
in

of a vertex of degree two Step 4: Elimination seriest does not affect planarity. eliminate Therefore, of steps 3 and 4 will usually Repeated application

merging

edges

in

all edges
reduce

series.

cally. For example, Fig. 5-7 graph of Fig. 5-6(b).


Let

illustrates

the

series-parallel

a graph drastireduction of the


new

the

nonseparable

connected
steps answer.)

after the

Theorem 5-8 has the


THEOREM

repeated application of
5-8
Hi is)

graph G,. be reduced to a 3 and 4. What will graph

graph

Hi

Hi look

like?

Graph
1.

A single
A

edge, or
graph

2.

complete nonseparable,

of four
simple

vertices, or
with

3. A
tIn

graph

n >

5 and

e>

7.)

and Fig.

if

this

a graph, two edges are said to be in series if they have exactly one vertex in common vertex is of degree two. Edges es and e6 (and also eland e2) are in series in

5-6.)))

100)

PLANAR AND DUAL GRAPHS)

CHAP.

5)

(e s e6))
e7)

e4)

e 4)

(e I e 2 ))

(a) Series

Reduced)

(b) Parallel

Reduced)

(e4

e7))

(c) Series

Reduced) Series-parallel
can

(d) Parallel reduction of


by the

Reduced)

Fig.

5-7

graph

in Fig.

5-6(b).)

Proof: The theorem


graphs

be proved

considering

of

six edges

or less. The proof


Hi

is left

all connected nonseparable as an exercise (Problem 5-9).)


I

In Theorem 5-8, all be checkedfurther.


From

falling

in categories

or

2 are

planar and need not


simple, vertex of

now

on, therefore,

nonseparable graphs

of at
can

least

fi ve

or more. Next, we

check

we need to investigate vertices and with to see if e < 3n -

only every

connected,

degree three
is not

6. If

this

inequality

satisfied, the graph Hi is non planar. If the inequality test the graph further and, with this, we come the most important result 5-9), perhaps (Theorem

is satisfied, of this

we have to

to Kuratowski's theorem
chapter.
series series.

Homeomorphic Graphs: Two


graph

graphs
by

are
the

said to
creation

be homeomorphic if one
(i.e., The

can

be obtained

from the other


5-8

by insertion three graphs

of verticesof degree two)


in

or

by the

of edges in merger of edges in


other,

Fig.

if and is planar planar. (This is a restatement

graph G

are homeomorphic only if every graph


of

to each
that

for

instance.

is

homeomorphic
in

A to G is

series

reduction,

step 4

this

section.))

THEOREM 5-9
A

necessary
either

and

not contain

of

sufficient condition for a graph Kuratowski's two graphs or

G to
any

be planar is
graph

that

G does

homeomorphic

to

either of

them.)))

SEC. 5-5)

DETECTION

OF PLANARITY)

101)

Fig. 5-8 Three

graphs

homeomorphic

to each

other.)

G cannot because a graph be embedded be embedded. That this condition is also sufficient is surprising, and its proof is involved. Several different proofs of the theorem have appeared since Kuratowski stated and proved it in 1930. For a complete proof of the theorem, 108the reader is referred to Harary [1-5], pages or Busacker and Saaty [1-2], pages70-73.) 112, Berge [I-I], pages 211-213, condition
in

Proof: The necessary


if G

a plane

has a

subgraph

that

is clear, cannot

Note

that

it is

not

necessary

for

a nonplanar
theorem

graph to

have

either

of the

graphs as a subgraph, as this The,nonplanar graph may have a subgraph


Kuratowski
For
graph.

is sometimes

misstated.
Kuratowski

example,

the graph
Kuratowski

in

Fig.

5-9(a)

homeomorphic to a is nonplanar, and yet

it does we

not

have either

of the

graphs

as a

subgraph. However, if

remove)

c)

c)

a)

c) (a))

a)

c) (b))

c)

a)

c) (c))

Fig.5-9

Nonplanar graph with

a subgraph

homeomorphic to K3,

3.)))

102)

PLANAR AND DUAL GRAPHS)

CHAP.

5)

edges

in Fig. we get a subgraph, as shown this (a, x) and (A, C) from graph, 5-9(b). This subgraph is homeomorphic(mergetwo series edges at vertex x) to is isomorphic to the one shown in Fig. 5-9( c). The graph of Fig.5-9( clearly the non planarity of K 3 ,3' Kuratowski's second graph, and this demonstrates

c)

the graph
The

in

Fig.

5-9(a).

example just discussed


gives

also points
an

out

(Kuratowski's theorem)
planarity

elegant

and
to

large graph
three or
planar

a graph, the theorem is difficult a simple, nonseparable more). There have been several
of (say,

5-9 Theorem that although simple-looking criterion for apply in the actual testing of a

graph of

25 vertices,

each

of degree

alternative

characterizations
a dual

of a
is

graph.

One

of these
next

characterizations, the existenceof


sections.)

graph,

the subject

of the

two

5-6.

GEOMETRIC DUAL)
Consider

in Fig. of a graph the plane representation 5-IO(a), with six us six Let F F and F or faces , , , points PI' P2' . . . , F6. place 2 3 4 Fs, regions Fl' let us in Next as shown in each the of one join these Fig. 5-IO(b). regions, P6' six points according to the following procedure:)

P6

0)

(a))

(b))

(c))

Fig. 5-10

Construction of a

dual

graph.)))

SEC.

5-6)

GEOMETRIC

DUAL)

103)

If two regions Fi and Fj are adjacent (i.e., have a common draw a edge), line joining points Pi and Pj that intersects the common between edge F,. and If once. there is than F more one common between and edge i Fj exactly Fj, draw one line between points Pi and Pj for each of the common edges.For an e lying entirely in one region, edge say F k , draw a self-loop at point Pk intersecting
By

e exactly
this

once.

we obtain a new G* [in broken lines in Fig. graph six of . . . and of edges joining these vertices, , 5-10(c)] consisting P6 Pi' P2' G* is called vertices.Such a graph a dual (or strictly a geometric speaking,
procedure

dual) of
Clearly,

G.

is a one-to-one there correspondence between the edges of graph its dual G*-one edge of G* intersecting one edge of G. Somesimple that can be made about the relationship observations between a planar graph G and

G and

its

dual

G* are)
a self-loop G series

1. An

edge

forming

in G

yields a
in

pendant

edget

in G*.

2. A pendant
3. 4. 5.

edge in
are
in in

yields in G

a self-loop

G*.

Edges that Parallel Remarks

produce parallel
edges in series
in

edges in
G*.

G*.

edges

G produce

1-4 are the result

of the

of edgesconstituting the degree of the corresponding

boundary

that the number observation of a region F,. in G is equal to the vertex Pi in G*, and vice versa.
general
in

6. Graph 7. Considering
G

G*

is also
the

embedded

the

plane

and is

therefore planar.

process

is a

dual of G*
and

a dual of G, we
8.

If n,
regions, f*,

e, f, r,

of drawing a dual G* from G, it is evident that G* instead of calling Therefore, [see Fig. 5-10(c)]. that G dual and G* are usually say graphs. denote as usual the numbers of vertices, edges, p,
of

rank, and nullity and r*, p,* are the

a connected

corresponding n* e* f*

numbers

planar graph G, and if n*, e*, in dual graph G*, then)

= = =

f,)

e ,)
n.)

Using

the

above

relationship,
r*

one can immediately


= J.l,
r.)

get)

p,* =
Uniqueness t An

of Dual
incident

Graphs: Is

a (geometric)dual
called

of

a graph

unique?

In)

edge

on a

pendant vertex is

a pendant

edge.)))

104)

PLANAR AND DUAL GRAPHS)

CHAP.

5)

* e7)

* e()

(a)

Dual of

5-

6(a))

(b) Dual of

5-6(b))

Fig.

5-11

Duals of

graphs

in Fig. 5-6.)

other
constructing

words,

a dual,

are all duals of 2l given it is reasonable


only

graph

isomorphic?
a planar

to expect that

From the method graph G will have


unique

of
a

unique
embedding

dual if and
on

if

it has

a unique plane

representation or

a sphere.
Fig.

For instance, in
embeddings,

(a) and (b).

(isomorphic) had two the duals of these isomorphic Consequently,


5-6

the same graph

distinct

graphs

are nonisomorphic, as shown in Fig. 5-11. The graphs in Fig. 5-11, however, are 2-isomorphic. is a generalization of this example.) without proof,
THEOREM

stated Theorem 5-10,

5-10

All duals

of a
G is

planar

graph
dual

G are
of
G.)

2-isomorphic;

and

every

graph

2-isomorphic

to a

dual

of

also a

With

this

qualification

in mind,
planar

it

is quite

appropriate
embedding duals

to refer to
on a

a dual

as

the dual must

of a

Sincea 3-connected
dual

planar graph.
graph

has a

unique all

also be

unique. In other

words,

of a 3-connected

sphere, its graph

are isomorphic.)

5-7.

COMBINATORIAL

DUAL)

of planar graphs in a purely we have defined and discussed duality with an equivalent us definition of The sense. following provides geometric of notions.) geometric duality independent
So far
THEOREM

5-11
sufficient

A necessary and duals of each other

condition There

for

two planar

graphs

Gland

G 2 to be
between)))

is as follows:

is a one-to-one

correspondence

SEC. 5-7)

COMBINATORIAL

DUAL)

105)

the edges
and

in

Gland

the edges

in

G 2 such

only

if the

corresponding set in
plane

G 2 forms

that a set of edgesin a cut-set.)

G 1 forms

a circuit

if

of a planar graph G. Let us also representation G* of G. Then consider circuit r in G. an arbitrary r will form some closed simple curve in the plane representation of GClearly, Thus the vertices of the plane into two areas. (Jordan Curve Theorem). dividing r G* are partitioned exclusive subsets-one into two nonempty, inside mutually the other outside. In other words, the set of edges r* in G* corresponding to and the set r in G is a cut-set in G*. (No proper subset of r* will be a cut-set in G*; that corresponding to a cut-set S* in G* there is a why?). Likewise it is apparent circuit of the unique consisting corresponding edge-set S in G such that S is a 5-11. circuit. This of Theorem proves the necessity portion To prove the sufficiency, let G be a planar and let G' be a graph for which graph there is a one-to-one correspondence of G', the cut-sets of G and circuits between and vice versa. Let G* be a dual graph of G. There is a one-to-one correspondence the circuits between of G' and cut-sets of G, and also between the cut-sets of G and circuits of G*. Therefore there is a one-to-one correspondence between the circuits of G' and G*, implying that G' and G* are 2-isomorphic (Theorem 4-15). According to Theorem be a dual of G. .) 5-10, G' must
draw

Proof: Let us considera


(geometrically)

a dual

Let G be a planar and G* be its dual. Let a be Subgraph: graph and the in G* be we a*. G, corresponding edge Suppose that delete edge a from G and then to find the dual of G was on a try edge the boundary of two regions, removal of a would merge these two regions into one. Thus the dual (G - a)* can be obtained G* by deleting the from
Dual

of a

an edge

in

- a.If

corresponding edge a*
On that

the

the

- a*. fusing the two end verticesof a* in G* the not on a In a* forms hand, edge boundary, self-loop. case G* - a* is the same as (G - a)*. Thus if a graph G has a dual G*, dual of any subgraph of G can be obtained by successive of application
and

then

other

if

a is

this proced ure.

Dual of a
that

Homeomorphic

dual. Let a be an
we

create

Let G be a planar graph G* be its and Graph: and the corresponding edge in G* be a*. Suppose an additional vertex in G by introducing a vertex of degree two
edge

in G,

in

a (i.e., a now affect the dual? It will


edge

becomes simply

two add two

reverse process of merging simply eliminate one of G*, graph G has a dual
obtained

edges in series). How will this addition an edge parallel to a* in G*. Likewise, the edges in series (step 4 in Section 5-5) will parallel
graph

the

corresponding

edges

in

G*.

Thus

if a

the

dual

of

any

homeomorphic

to G

can be

from we

graphs only. This was on the graph depended 5-11 provides us being embedded in a plane. However, now that Theorem with an equivalent abstract definition of duality the correspondence (namely, between circuits and cut-sets), which does not depend on a plane representation of a graph, we will see if the concept of duality can to))) be extended
have

So far

G* by
us

the above

procedure.
for of

been

forced upon

because

studying duality the very definition

planar

duality

106)

PLANAR AND DUAL GRAPHS)

CHAP.

5)

non find

planar graphs another graph


every answer

such that versa? The


THEOREM

a non planar also. In other words, given graph G, can we G' with one-to-one between their edges correspondence in G corresponds to a unique in G', and vice circuit cut-set to this question is no, as shown in the following important

theorem, due
5-12

to Whitney.)
if and it is planar.)
if\"

A graph has a Proof: We that a nonplanar

dual

only
the

if

Let G be a nonplanar graph. Then according to Kuratowski's theorem, G contains Ks or K3. 3 or a graph homeomorG can have a dual only of these. We have already seen that a graph phic to either if every subgraph g of G and every graph homeomorphic to g has a dual. Thus if we can show that we have proved the theorem. neither Ks nor K3.3 has a dual, This we shall prove by contradiction as follows: in K3.3 corresthe cut-sets that (a) Suppose K3.3 has a dual D. Observe that in D and vice versa (Theorem pond to circuits 5-10).Since K3.3 has no cut-set
graph

need prove just


does

\"only

part.

That

is, we have

only

to

prove

not have a dual.

consisting

of two edges, D has no circuit of two edges. That consisting is, D contains no pair of parallel edges.Sinceevery circuit in K3.3 is of length four or six, D has no cut-set with less than four edges. Therefore, the degree of every vertex in D is at least four. of every vertex is As D has no parallel edges and the degree or more. That is, at least each of degree four four, D must have at least five vertices D must have at least (5 x 4)/2 = 10 edges. This is a contradiction, because K3.3 has nine edges and so must its dual. Thus K 3. 3 cannot have a dual. Likewise, (b) Supposethat the graph Ks has a dual H. Note that Ks has (1) 10 edges, two edges, and (4) cut-sets with no pair of parallel edges, (3) no cut-set with (2) H must have (1) 10edges, (2) no vertex only four or six edges. Consequently, graph with degree less than (3) no pair of parallel edges,and (4) circuits of length three, of length six), and four and six only. Now graph H contains a hexagon (a circuit without creating a circuit of no more than three edges can be added to a hexagon edges [see Fig. 5-2(b )].Since both of these are forlength three or a pair of parallel be at least seven vertices in H. The H has 10 edges, there must bidden in Hand at least is at least three. This leads to H having vertices degree of each of these 11 edges. A contradiction. .)

This
Whitney's

proof of
proof,
yet

theorem 5-12is not the one originally given more involved. though more rigorous, is much
by

by

Whitney.

Our proof is

based on one given


There is

Parson

[5-7].

given by Whitney and Two planar graphs

combinatorial definition of duality, also [5-10]. proved equivalent to the earlier two definitions G and G* are said to be duals (or combinatorial duals) between the edges of G of each other if there is a one-to-one correspondence and G* such that if g is any subgraph of G and h is the corresponding subgraph of G*, then)
another

equivalent

rank This

of (G*

h)

== rank

of G*
in

Fig.

nullity

of

g.)

(5-7))

relationship

is shown

diagrammatically

5-12.)))

SEC.

5-8)

MORE ON CRITERIA OF PLANARITY)

107)

c) Rank of (C

c*)

*-

h)

= Rank of
Combinatorial

C*

Nullity

of g

Fig. 5-12
As 5-11 (a).

duals.)

an example,

Take the subgraph

consider the graph f e 4 , e 5' e 6' e7 }


=

in

Fig.

in Fig.

and its dual in Fig. and the corresponding 5-6(a)


5-6(a)

subgraph fe:,
rank

et, e:, erJ in Fig. 5-II(a).) of (G* - fe:, et, e:, erJ)
nullity

rank

of fef,

e\037,

ef}

2,

rank of G* = 3,
of

fe 4 , e s , e 6,

e7 }

1,)

and)

2 =
Clearly,

1.)

this

definition

is also

independent of
proving

the

geometric

connotation.

It is therefore often

preferred for

results

in purely

algebraic fashion.

in deciding whether or not two given graphs are dual the combinaHowever, to use. torial definitions are difficult The proof of equivalenceof combinatorial and geometric duals is quite reader is referred involved. The interested to the original papers of Whitney

5-12] or to Seshu and Reed [1-13], [5-10, pages combinatorial duals are one and the same,

45-50.

Since

the geometric and


them

we simply

refer to

as

the

dual, rather

than

the

geometric

or combinatorial
G is
shown

dual.
isomorphic
that

is called

graph Self-DualGraphs:If a planar a self-dual graph. It can be easily


graph

the four-vertex
graphs

to its own dual, it comhave

plete

is

self-dual

interesting
5-8.

properties

graph (Problem and pose some unsolved

5-20). Self-dual
problems.)

MORE
Theorems

ON CRITERIA

OF

PLANARITY)

5-9 (Kuratowski's us with two different provided third The classic planarity graph.
next.

theorem)
and

alternative
criterion,

and 5-12 (Whitney's theorem) ways of characterizing a planar due to MacLane [5-6], is given
in

Set of
set

of basic

Basic Circuits: A set circuits if (i) every

C of

circuits
the

a graph

circuit in

graph

is said to be a can be expressed

complete

as a rin

\037)))

108)

PLANAR

AND DUAL GRAPHS)

CHAP.

5)

or all circuits in C, and (ii) no circuit in C can be expressed as in C. The significance of complete sets of basic circuits in Chapter 6, in relation to the vector space of a graph.It may, will be clearer a set of fundamental circuits (as here that whereas be mentioned however, 3 with respect to a spanning a in Chapter constitutes defined always tree) the converse does not hold for all graphs complete set of basic circuits,
sum

of some
sum

a ring

of others

(Problem

5-15).

In a planar graph a complete set of basic circuits has an additional pronext. perty, which we will observe G the set of circuits In a plane representation of a planar, connectedgraph For the interior regions constitutes a complete set of basic circuits. forming the any circuit r in G can be expressed as the ring sum of the circuits defining in at most two of in r. Observe that contained every edge appears regions G we can find a complete basic circuits. Thus for every these planar graph in more than of these no edge two set of basic circuits such that appears can be found in and its converse basic circuits. This result (proof of which of planar graphs.) characterization well-known [5-6]) lead to another
THEOREM

5-13

(i.e.,

A graph G is planar if and only if there the nullity of all J.l of them, J.l being

exists

G) such

a complete set of basiccircuits that no edge appears in more

than

two of

these circuits.)

All three from two shortcomings. of these classic characterizationssuffer difficult to implement for a large in First, they are extremely Second, graph. case the graph is planar they do not give a plane representationof the graph. These drawbacks have prompted recent discoveries of several mapitself is based on an of planarity construction methods, where the testing a plane representation of the graph. One such method is to produce attempt Several other construction methods, some of them quite Tutte [5-9]. given by similar, have been implemented on digital [5-2, 5-8]. In most of computers these methods, the given graph is first reduced to one or more simple, non- 6. separable graphs with every vertex of degree three or moreand with e < 3n in is applied Then the construction algorithm such that either one succeeds More is nonplanar. a planar realization of the graph or the graph obtaining 11. will be said on such algorithms in Chapter but all are laborious and timeSome algorithms are better than others, consuming.The search for a simple, elegant, and practical characterizationof a planar graph is far from over.)

5-9.

THICKNESS

AND CROSSINGS)
that

Having found
is

a given

the

minimum

number

graph G is nonplanar, it is natural of planes necessary for embedding

G?

to ask, The

what least)))

CHAP.

5)

SUMMARY)

109)

is the given graph G is called the of planar subgraphs whose union the number of of G. In a printed-circuit board, for instance, is the thickness of the corresponding insulation necessary graph. layers is one. The thickness graphBy definition, then, the thickness of a planar is clearly two. The readercan show, of each of Kuratowski's by graphs of eight vertices is them, that the thickness of the complete graph sketching is three vertices the thickness of the complete graph of nine two, while are several results available on the thickness there (Problem 5-19). Although the thickness of an arbitrary of special types of graphs [1-5, 120-121], pages

number
thickness

graph

is in

general,

difficult

to

determine.

a nonplanar graph ask about Another question one might fewest number of crossings(or intersections)necessaryin order

is:

What

is the

to \"draw\"

the

graph
either

in

a plane?

The crossing
of

number of a
graphs,

planar

graph

is,
exists

by definition,
to give

zero, and of
of

Kuratowski's

it is

one. The crossing numbers

graphs have been determined.No formula

only a few the crossing number

of an

arbitrary

graph.)

SUMMARY)

Can a given graph This is clearly a geometric two different worlds,


Harary

be placed
question
purely

in a

plane

without

its

edges

crossing
that

over?
exists

about

the graph-an
and

object

in

combinatorial

purely

geometric. To quote
study. . . is

[1-5],

page

106, \"one

of the most fascinating areas of


graph

the

interplay between considering a


geometric

as

a combinatorial

object and as
only three.
3n

figure.\"

On probing simple,

bit

further,

we discovered
which

nonseparable graphs we found that Moreover, any


any Three

have

graph further,
different,

need not be investigated


equivalent,

that we needed to investigate of degree less than with the number of edgese > because such a graph is nonplanar.
no vertex
planarity

but very

and Kuratowski, Whitney, MacLane, and drawbacksdiscussed. For graphs

were
that

properties, such as thickness and number discussed.There are many unsolved problems in this field of study. Because of in such areas as automatic the current interest of complex wiring systems, and design of large-scale integrated circuits, circuits, technology of printed these geometrical of graphs are of practical importance. properties
The

those of their and significance presented are non planar, additional relevant were defined and of crossings,
characterizations,

existence of

of a

dual graph, dual graphs

in in

to

that

planarity,

is important a subject

relationship

between
the

to being a condition equivalent structural right. The underlying becomes very clear in terms of the vector
addition its

own

space of

graph,

for the next

chapter.)))

110)

PLANAR

AND DUAL GRAPHS)

CHAP.

5)

REFERENCES) in 1930, a large number of papers on Starting from Kuratowski's celebrated paper of graphs have appeared. An excellent on charplanarity survey of this work, especially acterization of planar and practical methods of embedding, is given in [5-8],which graphs also contains a bibliography of about 120 papers on the subject. Recommended readings from textbooks are Harary [1-5],Chapter 11,Seshu and Reed [1-13], Chapter 3, Ore [1-10], Busacker and Saaty [1-2], Chapter 4. Bruno, 8, Berge [1-1], Chapter 21, and Chapter an efficient computer algorithm for testing of planarity, Steiglitz, and Weinberg [5-2] give as does Shirey [5-8]. Works of Whitney MacLane [5-10, 5-1I, 5-12], [5-6], Fary [5-4], and Tutte [5-9]have already been referred to earlier. More on self-dual graphs can be found in [5-1] and [5-3]. A thorough with relevant references is to survey on thickness of graphs be found in [5-5]. For more on computer for planarity testing, see Chapter 1 I. algorithms

5-1.
5-2.

BENEDICT,

C. P.,

\"On Self-Dualism in
and

University BRUNO,

of Waterloo, J., K.
STEIGLITZ,

Waterloo, Canada 1969.


L.
WEINBERG,

Graphs

and Networks,\"
\037\037A New Vol.

Ph.D.

Dissertation,

3-Connectivity,\"

IEEE

197-206.

Trans. Circuit Theory,

CT-17,

Test Based on Planarity No.2, May 1970,

5-3.
5-4. 5-5.
5-6.

5-7.
5-8.

Annual Allerton Con! N., \"Self-Dual Graphs and Digraphs,\" Proc. Sixth on Circuit and System Theory, Oct. 1968, 832-840. F ARY, I., \"On Straight Line Representation of Planar Acta Sci. Math. Graphs,\" Szeged,Vol. 1 I, 1948, 229-233. in Recent A. M., \"A Survey of Thickness,\" HOBBS, Progress in Combinatorics 255-264. Press, Inc., New York, 1969, (W. T. Tuttle, ed.), Academic Condition for Planar Graphs,\" Fund. Math., S., \"A Combinatorial MACLANE, Vol. 28, 1937, 22-32. T. D., \"On Planar Graphs,\" Am. Math. PARSON, Monthly, Vol. 78, No.2, 1971,
DEO,

176-1

78. R. W.,

SHIREY,

Algorithms,\"

5-9.

TUTTE,

Madison, Wisc., 1969. W. T., \"How to

\"Implementation and Analysis Ph.D. Dissertation, Computer


Draw

of Efficient

Graph

Planarity

Testing

Sciences,University
Soc.,

of

Wisconsin,

5-10. WHITNEY,
34,

1963,743-768.

a Graph,\"
Planar

Proc. London Math.


Graphs,\"

Ser. 3,

Vol. 13,

5-11. 5-12.

and H., \"Non-separable 1932, 339-362. Set of Topological WHITNEY, H., \037\037A 1933,231-235.
WHITNEY,

Trans.

Am. Math. Am. J.


Math.,

Soc., Vol.
Vol.

Invariants

for Graphs,\"

55,

H.,

\037\037Planar Graphs,\"

Fund.

Math., Vol. 21,1933,73-84.)

PROBLEMS)

5-1.
5-2.

Using

geometric

arguments
simple by

that

Kuratowski's is bounded

similar to second graph is also


planar k edges,

those

used

in proving and e

Theorem 5-1, prove edges) embedded in

nonplanar.

If every
a plane

region of a

graph

(with

vertices

show
ken

that

e=
5-3. A simple
planar

- 2) \302\267
can

k-2)

graph

to which

no edge

be

added

without destroying

its)))

CHAP.

5)

PROBLEMS)

111)

planarity

(while that

keeping every

the graph region also

simple, of course) is
maximal

graph. Prove

in a
vertices

5-4.
5-5.

Prove

that

a planar
This

graph of n
will
Problem

five or (Hint:

less.

prove

that

a maximal planar is a triangle. (n > 4) has at least four vertices with degree there are no 6-connected planar graphs.
called planar

graph

Use the result of


and

5-3.)

said to be completely regular if the degrees of all vertices of G every region is bounded by the same number of edges.The graphs in Figs. 2-20(a) and 2-21(b) are completely for example. Show that there regular, are only five possible the trivial simple completely regular planar graphs, excluding Use Euler's formula.) graphs with degree < 2. Sketch them. (Hint:

A planar graph G is

are equal

5-6.

5-7. 5-8. 5-9.

that an infinite pattern formed of a regular polygon repeating itself, such as in Fig. 1-10),can consist those found in mosaics and tiled floors (seeinfinite graphs of only three types of polygons-square, triangular, and hexagonal. Redraw the graph in Fig. 5-4 such that region 2 becomes the infinite region. show that the graphs in Fig. 2-3 (known as Petersen's Using Kuratowski's theorem,
Prove graph)

are

nonplanar.

5-10. 5-11.
5-12.

By sketching all (don't panic, their number is small) simple, nonseparable graphs with n < 4 and e < 6, prove 5-8. Theorem Draw the geometric dual of the graph in Fig. 5-4. Show by actual construction that the geometric dual of the two (2-isomorphic) in Figs. 4-11(a) and (d) are isomorphic. graphs Construct an example to demonstrate that G**, the dual of a dual of a graph G, not be isomorphic to G, but is 2-isomorphic to it. may
Prove

5-13. 5-14.

that

the geometric

dual

of a

self-loop-free nonseparable
is

planar

graph if its

is also

nonseparable.
Prove

that

a self-loop-free planar

2-connected.

graph
has

2-connected

if and

only

dual is also

5-15. Give
not

5-16.

5-17.
5-18.

5-19.
5-20.

one completeset of basic circuits to any spanning tree). Show that the edges forming a spanning tree in a planar graph G correspond to in the dual G*. the edges forming a set of chords Show that a set of fundamental circuits in a planar graph G corresponds to a set of fundamental cut-sets in its dual G*. Determine the number of crossings and the thickness of the graph in Fig. 2-3. the the that thickness of Show, by sketching, eight-vertex complete graph is two, whereas that of the nine-vertex completegraph is three. Show that the complete graph of four vertices is self-dual. Give another example of a self-dual graph.)))
an example of a graph which a set of fundamental constituting

at least

circuits

(with respect

6)

VECTOR

SPACES OF

GRAPH)

Modern applications

abstract algebra is a powerful of graphs. It is essential for a


for

tool in
thorough

the

theory
understanding

as well Moreover,

as

in

the

of graphs

and a
digital

must

those

least internally) work on pictorial to represent a graph algebraically and to manipulate necessary the aid of a computer in solving cally, if one wishesto enlist
computers

wishing do not (at

to do

research in

the

field.

since

graphs, it is it algebraigraph-theory

problems.)

6-1.

SETS
Set: A

WITH

ONE

OPERATION)

the elements of the set). on the nature of the elements or the number of elements. Nor do the elementshave anything to do with each other, of a except belong to the same set. Braces are used to enclose the elements set. For instance, a set S consisting of five objects a, b, c, x, and y may be written as S = [a, b, c, x, y}. Since the order in which these elements appear is of no significance, we could have written the same set as S == [x, b, a, y, c}, for instance. The symbol E S is used to indicate that element a a is in set
objects

set is a collection of
there

(called

Note

that

is no

specification

S.

A subset S' of a set S is a collection of some of the elementsof S. If S has at least one element that is not in S', then S' is called a proper subsetof S. The set null written in it and is considered a or has no element set, 0, empty subsetof every set. The two most common combinations of sets are the union

u and intersection n,

defined

as)

112)))

SEC. 6-1)

SETS

WITH

ONE OPERATION)

113)

Sl

U S2
S2

= S3'
=

a set a set
and

containi ng containing
in
S2.)

all
only

the

elements

of S 1

and

S2'

Sl n
In

S4')

those

elements

that

are both

in

S 1

this

chapter
a set

elements within
Operation:

we shall be concerned with rather than the combination

the

combination
different

of two
sets.

of two

of combination called binary operation law of composicomposition, or internal of a set. Addition, tion) between two elements multiplication, subtraction, and are some of the familiar binary between two elements division operations in a set of numbers. To keep the binary general enough, we shall operation use the symbol * (rather than using +, -, x, \037, etc.) to denote the binary

Let us introduce
composition,

a rule

(also called binary

law of

operation.

A set with

operations
Algebras:

defined on it

is called

an algebraic

system or

just algebra.
Types Special

of

a binary on

the

* (written operation nature of the binary


called

as

Now we have a set, say S = [a, b, c, . . a * b) between the elements of S. Depending


*, set

.J,

and

operation

S can
if *

be

classified

as

one

of

below, set S is

several special types

of algebras.For instance,
a semigroup:)
and

satisfies

postulates]

and 2

1. Closure: If
2.

b are

in S,

then

a * b
and

is also
c are

in

S.
then

Associative:

If the elements

a, b,

in S,

(a

* b) * c

(b *

c).)

Semigroups great

have

many

interesting
several

detail.

In fact,
since

there are
semigroups

semigroups.But
at hand,
A

as

properties and have been studied in written on the theory of books such are not applicable to the business
thick
monoid.)

we shall move on to more specialized semigroups. that satisfies postulate 3, below, is called a semigroup
Identity

3.

element:

element
A

in

S, x * e

There exists = e* x

a unique
=
x.)

element

e in

S such

that

for

any

monoid Inverse: such

that satisfies For every

postulate 4, below, is called a group.)


S there

4.

x * x' = x' * x with respect to operation


that
A

element x in
=
*.)

exists a unique

element x'
inverse

in

e. Element

x' is called the

of x,

semigroup

group
5.

that satisfies postulate or commutative semigroup.)


Commutative:

5, below, is called an
then

abelian

semi-

If a and b

are

in

S,

a *b

= b

* a.)))

114)

VECTOR

SPACES

OF A GRAPH)

CHAP.

6)

Set

No opera

tion)

1.2)

Semigroup)

Abelian
Senligroup)

Monoid)

3)

4)

Abelian

1l1onoid)

Group)

Abelian

gro

11p)

All five po\037tl1late'l)

Fig.

6-1

Algebraic systems with


an

one

internal

operation.)

If an

abelian semigroup also has


(or

identity

element,
element).

it is

called an

abelian monoid

an abelian

an operation five is called A set S with postulates an abelian group (or a commutative group). 6-1 summarizes the definitions of these \"algebraic and systems\" Figure The arrows shows the relationships among them. point toward the direction restriction next to a line indicates the of increasing on the set S. The number

semigroup with identity * that satisfies all these

one particular postulate that converts to be mentionedhere that It ought


operation mathematical

algebraic
an

system

into

another.

algebraic

does

not satisfy even the closure and interest. observation that Another
of

system in which the binary associative rules is of little be made is that postumay two remarks,

late
show

4 cannot
all

be satisfiedbefore 3.In view


combinations
in order

these

Fig. 6-1 does

possible

of the five postulates.


integers,

are Examples: Someexamples the set of all Consider positive

now. S 1 = [I, 2, 3,

. . .}.Set

S 1 satisfies)))

SEC. 6-1)

SETS

WITH

ONE OPERATION)

115)

closure

and associative
Moreover, addition

operation +.

Slunder
latter

is

* is the ordinary addition binary operation satisfies the commutative requirement. Hence a commutative semigroup. Note that in S 1 there is no
it also added

rules if the

identity element (an


element).

element when

to any

other element

results in

the

the same set S1 == [1, 2, 3, . . .} under the division ordinary no fractions, --:-.Since S1 contains clearly S 1 does not satisfy the closure rule, and hence is not a semigroup. \302\267 is an abelian monoid, because Again, the same set Slunder multiplication it has an identity is not a group under the element, 1. The set Sl' however, because S 1 does not have the inverse of every element operation multiplication Consider operation
(because
abelian

has

no fractions).
all

The set
group

of

integers

[. . . , 6-2)

- 3, that

2, -

1,

0,

1, 2,

3, .
abelian , is

. .} is
the

an

under

the addition
verify

operation (hence an
-1, i,

additive

group).
four

fourth

The reader roots of


.

can
unity,

(Problem

which

is [1,

- i}(where

the set

consisting of
a multiplicative

i == \037)

an abelian

group under the


group)

multiplication

operation

(therefore,

abelian

Groups
any

given

graph
very

of of Subgraphs: Now \\ve shall show that sets of certain subgraphs G satisfy the preceding postulates and thus form their groups.
fundamental

These are

and

important

results

in

graph

theory.)

THEOREM 6-1)

The ring

sum

of two

circuits

in

a graph

G is either a

circuit

or

an edge-disjoint

union of circuits.)
Let r 1 Proof: no edges or vertices
graph

of

Hand,
possible

in a graph circuits G. If the two circuits have r their sum subring common, 1 E9 r 2 is a disconnected an edge-disjoint union of circuits. If, on the other G, and is obviously in common, we have the following and r 2 do have edges and/or vertices
and

r 2 be

any

two

in

situations:

Since the
v

degree of every
r
2) 1

vertex

in a graph
where)

that is a

circuit

is two,

every vertex

in subgraph

E9

r 2 has is
in

degree d(v),
r
1

d(v)

if v edges

only,

or in

formerly
1

incident
intersect

r 2 on

only;
v

or if one in both

of r

the

was

1 and

r 2;

or

d(v)

4)

if

and of

r 2 just
vertex

at

v (without

a common

edge).)
Euler of

There

is no other type and therefore consists

in r
a

E9

of either

circuit

r 2. Thus r 1 E9 r 2 is an or an edge-disjoint union

graph, circuits

(Theorem

2-6).
immediate

.)
from

It is circui
ts.)))

Theorem

6-1 that the


or

ring

sum

of

any two

disjoint unions of circuits is alsoa circuit

edge-

another

edge-disjoint

union of

116)

VECTOR

SPACES

OF A GRAPH)

CHAP.

6)

THEOREM
The

6-2)

set consisting

of all
0)

the

circuits

and
an

(including
eration
Proof:
EB.)

the

null

set

in a graph G is

abelian

the edge-disjoint unions group under the

of
ring-sum

circuits
op-

is required to prove that this set under the operation EB satisfies 1-5 in this section. That the closure postulate is satisfied has just been 6-1. Associative and commutative postulates are also clearly proved in Theorem The null graph serves as the identity element satisfied. 0, because 0 EB g = g, for any subgraph about the inverse? g of G. What A circuit union of circuits r is its own inverse, because) or an edge-disjoint
It postulates

rEBr=0.)

Hence the

theorem.

.)

THEOREM 6-3)

The set
(including

consisting

of

all the
in

the

null

set 0)

a graph

cut-sets and G is an

the

edge-disjoint

unions

of cut-sets

abelian

group

under

the
closure

ring

sum

operation.
from Proof: It is follows and commutativity Associativity

Theorem
are

4-4 that this


also
own

set satisfies the

axiom.

immediately

existence of
edge-disjoint

the

identity

element

0. Just
its

as in
inverse.

the

union

of cut-sets is

apparent. And so is the case of circuits, a cut-set or an Thus the theorem. .)

6-2.

SETS

WITH

TWO

OPERATIONS)

another Now suppose that on the elements of an abelian group we impose 6-1. The to the operation * imposedin Section binary operation 0, in addition as follows five postulates on 0 can be written (note that these are the same as in Section 6-1, but they are for a different 0):) binary operation postulates

6. Closure: If
7.

and

b are

in S,

then

a S,

0
then

b is also
(a

in

S.

Associative:
Identity

If a, b, and
There

8. 9.

element:

element
tity Inverse:

x in

S, x
(or every

0 i

element For
in

unity)

0 b) 0 c == a 0 (b 0 c). exists a unique element i in S such that for any == i i is called the iden0 x == x. This element with respect to operation O.

c are in

tulate 3

Section x

such that
x,

with

0 respect

element e of poselement (except for the identity in element X-I in S x there existsa S, 6-1) unique X-I == X-lOX == i. Element X-I is called the inverseof

to operation
If a

O.
in

10. Commutative:
And

and b

are
binary

S,

then

0 b

==

bOa.)

to relate

these two different

operations,

postulate

11 is introduced.)))

SEC. 6-2)

SETS

WITH

TWO

OPERATIONS)

117)

11.

Distributive:

The operation
is,

0
=

is

distributive

with

respect

to the

operation *; that
a
and)

for

elements
c)

a, b, and

c in
c,
a.)

S)

0 (b *
c)

0 b

* *

a c

0 0

(b *
in

a =

bOa

Just as
addition

Section

6-1,

the different
will

to

postulates

1-5,
group

render

combinations of these postulates,in different types of algebraic systems. to


*

Theseare
Ring:

An

abelian a ring.

11is

with respect

that

satisfies

postulates element

6, 7,

and

called
with

Ring

Unity:

A ring
O.

that has

a unity
satisfies

or

identity

i with respect

to the second operation


Commutative
with

Ring: A
to O.
Ring

ring

that

the commutative

postualate (10)
has

respect

Commutative

with

element (8) with


Division
isfies Ring

respect (or

Unity: to O.

A commutative

ring

that

an identity

Skew

Field or

S-Field):
respect Field): respect

ring

with

unity

that also

sat-

the

inverse

postulate

(9)

with

to O. A division to

Field (sometimes called Commutative commutative postulate (10) with eleven and therefore may postulates, considered here.) system
the

ring that satisfies Thus a field satisfies all O.


\"strongest\"

be regarded as the

algebraic

The relationship
Examples:

among

these
in

algebraic
Section

systems is summarized
6-1,
I

in

Fig.

6-2.

As mentioned
S 2 =

the set I, 2,

of all 3, . . .})

integers)

[. . . ,

- 3,

- 2, -

, 0,

ordigroup under +, the usual addition operation.Moreover, between elements of S2 also satisfies the closure, associaand and there is a unity commutative tive, distributive, I, element, postulates, in S2. Thus S2 is a commutative with unity. However, since S2 doesnot ring it does not satisfy contain fractions, 9, and hence S2 is not a field. postulate The set of all rational numbers does satisfy 9, in addition to the postulate other ten satisfied is a field numbers by S2. Therefore, the set of all rational under addition and multiplication. The set of all real numbers also forms a field under addition and multiplication. All complex numbers also form a field is an

abelian

nary

multiplication

under the usual addition and


In rest

multiplication. be
defined

this book we shall mainly of the algebraic systems are

concerned
simply

with
for

your

groups and general

fields. The
interest.)))

118)

VECTOR

SPACES

OF A GRAPH)

CHAP.

6)

Abelian

1-5)

group)

6,7.

II)

Ring)

Commutative
nng)

Ring

wi th

uni ty)

8)

9)

Commuta

tive
with

ring

Division
nng)

uni ty)

Field)

I -

I 1)

Fig.

6-2

Algebraic systems with

two

internal

operations.)

6-3.

MODULAR ARITHMETIC
GALOIS

AND

FIELDS)

Consider 0, 1, and 2.

a system
And

of numbers
ru]es for
and

that

has

only three
multiplication

numbers

in

it,

ordinary

let

the

addition and

in this

system be

is used
system
tion

the same as ordinary addition If a number q \037resulting from exceeds 3, it is to be divided


in place

addition
by

with the following multiplication exception: or multiplication operations) equals or quotient

3, the

of q. The are given in Fig.


3. Together 3 arithmetic,)

modulo

addition and multiplication 6-3, and are called addition 3 they are called modulo

is discarded, and the remainder tables for such a number


modulo

3 and

multiplicain

arithmetic.

For example,

modulo

1 + 1 Similarly,

+ 2.2

+ 1 + 2 + 1 ==
modulo

1)

(mod

3).)

we can

define any

m arithmetic

system consisting

of m)))

SEC. 6-3)

MODULAR

ARITHMETIC

AND GALOIS FIELDS)

119)

0 0
0

0
1

0
1

0
1

0
1

0
'1 ....
1)

0
1)

(a))

(b))

Fig. elements

6-3

Addition and

multiplication

tables

for arithmetic

modulo
q >
m.)

3.)

0, 1,

2, .

. .,m

and

the
r)

relationship
(mod down

for
and

any

- 1:)

q = m.p +
It
and

m)

r <
tables

is suggested
7 (Problem

that the reader


6-7).

write

arithmetic

for m =

4, 5, 6,

Finite [0, 1, 2}
identity

Fields: From the


with

tables in

Fig.

6-3,

addition

and

multiplication
addition,

0 with

respect to

modulo 3

the set it can be verified that modulo 3 is a field. There is an to and an identity 1 with respect

3 multiplication. Every element has a unique additive inverse, and a element 0 has other than inverse. every multiplicative means like in of actual those 6-3, it can be easily verfied tables, By Fig. that On modulo and 7 are fields. the other hand, the set also 2, 5, systems no 4 is and with modulo addition [0, 1,2, 3} multiplication not a field, because 4 inverse of 2 exists with to modulo respect multiplication (Problem 6-8). In fact, it turns out that every finite set)
modulo
Z
with
m

==

[0,

I, 2,

. ..,m

I})

modulo
number.

prime

m addition and multiplication is a field a field is called a Galois Such field modulo

if

and
m,

only

if m is

or GF(m).

As we shall see shortly, in representing graphs we are concerned only with field 2. It Galois modulo consists of GF(2), [0, ]} and the addition modulo 2
and

multiplication

modulo

2 operations.
with

in

Fig. 6-4. (Those

familiar
0 0
1

computer

The two arithmetic tables are given in) logic will readily recognize that
.

0 0
0

0
1

0
1

0
1)

0)

(a))

(b))

Fig.

6-4

Addition and

multiplication

tables

of

GF(2).)))

120)

VECTOR

SPACES

OF A GRAPH)

CHAP.

6)

Fig. of

6-4, Boolean

+ is the logic.))

same as \"EXCLUSIVE OR\"

and

\302\267 is the

same as

\"AND\"

6-4.

VECTORS AND
In an ordinary

VECTOR

SPACES)

two-dimensional (Euclidean)plane, a point is represented X = (x l' x 2 ). Point X can also be regarded as ordered pair of numbers a vector emanating from the origin 0 = (0, 0) to the point (x l' x 2 ). Similarly, in three-dimensional Euclidean space the triplet (7, 2. I, -3) represents a vector. instead of row notation a column notation is used, for Sometimes,
by an

example,)

;
(
The
\037)-)

three

components
Every

7, 2.1, and
point

-3

in

the

example
many

above
points)

are from the


in
the \302\2433'

field of real numbers.


three-dimensional

(of the

infinitely

ordered triplet space, corresponds to a unique of three real numbers. (of the infinitely consisting many triplets) the field of integers modulo that we are working with Now GF(2), suppose 2. Then every number in a triplet can only be either 0 or I. Thus there are only 3 as in the real many eight (2 = 8) vectors possible (instead of infinitely number system) in a three-dimensional to space if our numbers are restricted These are) GF(2).

Euclidean

(0, 0, 0),
This

(I,0,

0),

(0,

I, 0),

(0, 0,

I), (I, I, 0),

(I,

0, I),

(0, I,

I), (I, I, I).)

concept

a vector
the

of representing in k-dimensional space (0,


the field
in

7-tuple

of vectors can be extendedto representation means an For of ordered instance, k-tuple. by in a seven-dimensional a vector I, I, 0, I, 0, I,) represents

them are sometimes called scalars (to distinguish The scalars in the field GF(2) are 0 and I. A in addition to being made of k-tuples vector (from some space, up specifiedfield), must satisfy certain other conditions regardingcombinations a scalar, and the like. These can with or operation of a vector of two vectors, in the following definition.) be summarized a field

vector space over The numbers


vectors).

G F(2).

from

DEFINITION

A k-dimensional

vector space (or a

linear

vector

space) over

the

field

F, is an

object

consisting

of)

1. A field

(with

its

set of

elements S,

and

two

operations

* and

0).)))

SEC.

6-5)

VECTOR

SPACE

ASSOCIATED

WITH A

GRAPH)

121)

2. A

set W of k-tuples
binary such

(all
EB an

numbers
(called abelian

taken from
vector group

F).
of the

3.
4.

A W,

operation that W is

sum) between the elements under this operation EB.


multiplication), X = (XI, scalar

set

A binary
between another

operation D
any vector

(calledscalar

which

scalar

c in F and a vector P in W. P is called the cOX

X2, . . . , Xk) in

product

applied W produces of c and X, and is

when

given

by)

P =

= (c 0

XI,

X2, . . . , c
the

Xk).)

Furthermore,

scalar CI
CI

multiplication
X)

satisfies
X,

following:) where

0 (C20
0 (X
EB

(CI
CI

0 C2)0
0 X
X EB

CI,

C2

F,

= Y)

ClOY,

(CI *

X = CI C2) 0 = X, lOX

EB C2 0 X, where 1 is the identity respect to operation

with

in

F.)

Let specific

us now leave vector space

the general vector associated with


ASSOCIATED

space, a graph

and
G.)

concern

ourselves

with

the

6-5.

VECTOR SPACE A GRAPH)

WITH

consider the graph G in Fig. e l , e 2, e 3 , e 4 , e s . Any subset of these five


Let us

6-5 with
edges

four vertices and


any subgraph

five

edges

(i.e.,

g) of G can

be representedby
such

a 5-tuple:)

x =
that)

(Xl' X 2 ,
I

X 3 , X4,

xs))

x. I) =

if e;

is in g and
not

x.I) =
For

0
in

if e; is
Fig.

in

g.) represented

instance,

the subgraph

gI

6-5

will

be

by (1,

0, 1,0,

I).)

e l)

e()

G)

gl)

g2)

Fig.

6-5

Graph and two of

its

subgraphs.)))

122)

VECTOR

SPACES

OF A GRAPH)

CHAP.

6)

or 32 such 5-tuples possible, including the zero a null graph, t and (I, I, ], I, I), 0 == (0, 0, 0, 0, 0), which represents which is G itself. It is not difficult to see that the ring-sum operation between two subgraphs between the two 5-tuples representing to the modulo 2 addition corresponds Altogether

there

are 2 5

vector

the two subgraphs. For example, considertwo


gt ==
==

subgraphs)

[el' e 3 , e s }
[e 2 , e 3 ,

represented represented

by (I, by (0,

0, I,

g2
The

e 4})

0, I), and ], I, 1, 0).)

ring

sum)

gt
which

EB

g2

==

[el'

e 2,

e4 ,

e s })

represented

by (I,

I, 0,

I,

I),)

is clearly

modulo 2
this

addition of
example,

the

5-tuples

for gl and

g2'
observa-

Now, generalizing
tion

we can
space

make the most


W G associated

important

of this
this

chapter: There is a vector


vector

with

every graph

G, and

space

consists

of)
is,

]. Galois field modulo 2; that 2 written as + such that 0


and O. I, and

set [I,
0,

OJ

with

+ 0 == multiplication modulo 2 written


1. 1
==

I + as

addition operation == I = 0 + I, I +
that

modulo
I

== 0,

\302\267 such

O. 0 == 0 in G.

==

I. 0 ==

I. number

2. 2 e vectors

(e-tuples), where e is the


operation
sum\037)

of edges
X,

3.

An

addition vector

between

two vectors

Y in

this space,

defined

as the

X ffi

==

(x t +

Y t'

X 2

Y2' .

. . , Xe

Ye),)

being

addition
as c.X
==

modulo 2.
between a

4.

And

a scalar

multiplication
(c.x

scalar c in

Z2

and

a vector

X,

defined

...,

c.xe).)
with a graph
vector

The

reader

can

as defined above,
tIn considering Hence a null graph
\037The

does

verify that the vector space W G associated indeed satisfy all the requirements

G,

of a
no

space)

vertices are of isolated vector spaces of graphs, of four vertices is not distinguished from a null graph
EB

consequence.

of 100

vertices.

same

the vector sum much to eliminate


subgraphs will be no

has been used for the ring sum of two subgraphs, as well as for the two subgraphs. This is done as the two vectors representing the reader that a ring sum between two an extra symbol as to remind vectors. There as vector sum of the corresponding amounts to the same thing

symbol

between

occasion for

ambiguity.)))

SEC. 6-6)

BASIS

VECTORS

OF A GRAPH)

123)

(Problem
in a

6-11). Note that vector space is 0, the

the zero

identity vector.)

element

(for the vector

sum

operation)

6-6.

BASIS VECTORS OF A
Linear

GRAPH)

Dependence:

A set

of vectors
if for
C2X

Xl'

said to be linearly

independent
C 1X

scalars c l' ...

X 2 , . . . , X r (over some field F) is c2 , . . . , Cr in F the expression)


crX

l +

2 +

== 0)

holds

only if c 1

== C == 2

...

==

Cr

== O. Otherwise, set

be linearly field of real

dependent. For
numbers:)

the example,consider

the set of vectors is said of three vectors, over

to

the

Xl

=
(\037).

X2 =

X 3

=
(\037)-)

(!).

Ari

arbitrary

linear

combination of
C1

these three
0

vectors

set to

zero

gives)

3C 3

C1 + 3c 3
=

0
=
\302\267)

ctX

C2 X 2 +

C3X 3

=
(
4\0371)

+
( ;:2

4c (

\037 )

2::

( \037 )

c1

That 0, 4c 1 + is, 2c 2 == c == C == O. Thus the 2 3


==

On the real numbers):)

other

hand,

C1 + 3c 3 == 0, which C 2 == 0, and hold only if set of vectors{X l' X 2 , X 3} is linearly independent. the same field of consider another set of vectors (over

X4

Xs

=
(\037)-

X6 =

(_\037)Setting an
arbitrary

(.;)-)

linear

combination

of these
Cs +

vectors to
.5C6
2c s c 6)

zero,)

0
== 0 ,

C4X 4 +

csXs +

C6 X 6 ==

2c

+ +

- 2c4 (
gives C 4 == -C

( 0) ) necessarily
X 3})))

== .5c
the

6 == (x\"
set

where

(X, X 6}

can

be any

real number not

zero.Therefore,

set {X4,

Xs,

is linearly

dependent.

Basis Vectors:To the

of three

linearly independent

vectors{Xl'X 2 ,

124)

VECTOR

SPACES

OF A GRAPH)

CHAP.

6)

in

the

first example,

let us add

another vector)
=

(fJ)

Now

you

can

show

without
a,

much
what

difficulty

that

the

set {Xl'
zero)

X 2,

linearly dependent

of four real numbers

regardlessof
b, c,

Y is.

In other

words, you
are

can

X 3 , Y} is find a set

and d (not all


+

of which
+

such thatt)

aX
Rewriting

bX 2 +

cX

dY =

o.)

(6-1))

Eq.

(6-1),)

Y = -\037X 1
d

\037X

.\302\243..X 3

d')

Thus a
X 2,

vector Y
system)

can

be expressed
linearly

as a
independent

linear combination
vectors

of

the

vectors

Xl'
the

X 3 . Such
If every

a set
vector

of k

is called

a basis (or

coordinate

in the vector space. Moreformally: in a vector space W can be expressed

as a
vector

linear combinaspace

tion

of a

given set

of vectors,

this

set is

said to

span the

W. The

dimension of the vector space W is the minimal number of linearly independent vectors required to span W. Any set of k linearly that vectors independent W. is called a basis for the vectorspace spans W, a k-dimensionalvector space, F or example, in a k-dimensional vector the following set of k unit vectors space is a basis.This is the most commonly used basis, and is often called the
natural

or

standard

basis.) 1

0 0

,...,) o
o)

o o)

o
1)

It is clear that real numbers) Basis

any

vector

in the

can be expressed
of a solution (out of

as

k-dimensional vector a linear combination


was

space (over the field of thesek vectors.


that

of

Vectors possible d=l

Graph: In Section 6-5 it


infinitely

shown

there was

a)

tOne

many)

that satisfies

Eq. (6-1)is
24')))

a=

Y3- 2Y2

8'

b =_

Y3 (
2

)'

C=_

8YI-2Y2+Y3

SEC.6-7)
vector
graph

CIRCUIT

AND CUT-SET SUBSPACES)

125)

space
of

WG

associated

with

every graph
a set

basis

for

was a vector in this vector space W G is


G there

W G , represented

G. Corresponding to each subby an e-tuple. The natural


independent

of e
one

linearly

vectors,

each
the W G .)

representing a subgraph consisting of in Fig. 6-5, the set of the following graph
(I,

edge

five

For instance, for vectors serves as a basisfor


of G.

0, 0,

0, 0),

(0, I, 0,0, 0),


CO,

0,

I, 0,

0),

(0, 0, 0,

I, 0),
I).)

(0,0,0,0,
Any

of the possible be represented by vectors.)

32 subgraphs (including
a

as well

as the

null

graph)

can

suitable

(and

unique) linear

combination of these five

basic

6-7.

CIRCUIT
A nonempty

AND

CUT-SET

SUBSPACES)
in space.

satisfies the vectors is a


plication

subset of vectors axioms of a vector


we

a space is called a To check whether

if subspace

the

subset of

given

subset

subspace

have

only

to check

for closure under scalar multi0 and

the zero

and vector addition. Since the vector 0, the closure under scalar
scalar

scalar product of
multiplication

a vector

is

assures

of O. Closureunder
vector

the presence

multiplication

[because

the inverse

of vector X

is the

axioms commutative, and distributive also hold for every subset of vectors. and multi plication by vector addition
A

also assures the inverse of every If the associative, vector ( X]. must hold in the original space, they Thus a subset of vectors closedunder is a subs pace. scalars

I).

vector

space

is

trivially

its

own

A 0, is also a subspace.

Euclidean

the

three-dimensional
both

Euclidean
E
2

of The null space, consisting subspace. is a subs paceof plane E 2 through the origin A E line the origin is a space E3. 1 through
the

subspace of
required

and

E3. number

The dimension
to

is of a subspace

of linearly

independent vectors

span
in

the subspace.)

Subspaces
In the graph

WG)

vector space

W G

(over

G, let us
in

consider the

a vector
in graph
union

G. A

W G representing cut-set vector

field modulo 2) associated with a of vectors: A circuit vector is of edge-disjoint circuits either a circuit or a union either a cut-set or a is a vector in W G representing
the

Galois
two

following

types

of

edge-disjoint

cut-sets

in

G.)))

126)

VECTOR

SPACES

OF A GRAPH)

CHAP.

6)

We

(which
ring

that in the vector space W G the linear combination of two vectors is simply modulo 2 addition of their components) corresponds to the sum of the corresponding subgraphs in G. From Theorem 6-2, the ring
know of two

sum of

edge-disjoint

circuits (or unions of edge-disjoint is a circuit or a union circuits) circuits. Therefore, the linear combination of two circuit

vectors

is also

a circuit

vector.

Hence)

THEOREM 6-4)

The set of
Based

all

circuit

vectors

in

W G forms

a subspace

Wr .)
have

on

parallel

arguments

and on Theorem

6-3, we

an

identical

result for
THEOREM

cut-set vectors.)
6-5)

The set
Quite

of all

cut-set

vectors

in WG

forms

a subspace

Ws .)
circuit

naturally,

subspaces
respec\037ively.)

Wr and Ws

are called the

subspace

and

cut-set subspace,
Bases

of
After

W s and Wr)
having How

discovered
that

that a
one

particular set

of

vectors

constitutes

subspace, the questions


subspace?
about

asks

next are: What is the

dimension of this

many

vectors does the


W r and Ws

the

subspaces

subspace conrain? These questions are answered by the following important

results.)
THEOREM

6-6)

The with

set of

circuit any

vectors spanning

corresponding tree,

respect
Proof:

to

to the forms a basis for


in

set of
the

fundamental

circuits,

circuit

subspace

W r .)

G, with n - 1 = r c 1 to T produces a and the corresponding circuit can be included in the vector fundamental circuit, another chord T U Cl produces another basis of Wr . Adding C2 to subgraph with at least one edge that was not in the previous circuit. fundamental circuit, circuit and the Therefore, the circuit vector representing the second fundamental Thus both these circuit first circuit vector are linearly vectors can be independent. included in the basis. Adding a third chord to T U Cl \037)C2 will give another fundawith at least one edge not in either of the previous circuits. Therefore, mental circuit in the basis. Continuing with third circuit vector can also be included this this we see that all the J.l vectors obtained this way are linearly successively argument, because each representsa circuit at least one edge not containing independent, in of the ones. each corresponding these previous present any Therefore, J.l vectors, to a fundamental are linearly independent.))) circuit,
Consider a spanning

tree branches and

tree, T,
J.l

a connected

graph

1 =

chords.

Adding

a chord

SEC.6-7)
Now we have to Jl vectors.
show

CIRCUIT

AND

CUT-SET

SUBSPACES)

127)

that

every

circuit vector is a
in

linear

combination

of these

Consider an

arbitrary

circuit r
=

G, such

that)

{e., e2, chords

. . . , ei, ei+\"

. . . , em},)
and

where

edges

branches
cuits

e., e2, of T.
by the

. . . , ei

are

with respect to T,

ei+\"

ei+2, . . . ,

em

are

sum of the i fundamental cirobtained by taking the ring chords e., e2,. . . , and ei. of Theorem 6-1, subgraph or a union of edgebe a circuit Because g must r 1 E9 g must be either a r 1 \"* g. Then the subgraph circuits. Assume disjoint both r 1 and g contain the or a union of edge-disjoint circuits.But since circuit r 1 E9 g will not contain chords el, e2, . . . , ei and no other chords, the subgraph So a contradiction. with respect to T. Hencer 1 E9 g has no circuit, chord any r 1 = g. a union of edge-disjoint Thus we have shown that any circuit (and by extension circuits in G can be expressed as a ring sum of some of the fundamental circuits) must to a set of fundamental circuits with respect to T. The vectors corresponding therefore span Wr . .) subgraph formed
As

Let g be a

was

brought
in

stitutes
but

a basis

the

every

basis in

concircuits 5, every set of fundamental Wr (i.e., forms a set of basiccircuits), to a set of funthe circuit subspace need not correspond

out in Chapter
circuit

subspace

damental circuits. (SeeProblems


COROLLARY

5-15

and

6-18.))

W r is equal to the nullity of the circuit subspace Jl of the graph, of circuit vectors O) in Wr is 2JJ . (including an argument parallel to that used in proving Theorem 6-6, it can be Employing to a fundamental cut-set with shown that the r cut-set vectors,each corresponding to a spanning tree, are linearly independent. respect or a union of Also, by a parallel argument it can be proved that any cut-set the ring sum of a subset of the r by taking edge-disjoint cut-sets can be obtained thus we get a similar to a spanning tree. And cut-sets with fundamental respect for the cut-set subspace.) result
The

dimension

and

the number

THEOREM

6-7)
to the set of fundamental cut-sets, set of cut-set vectors corresponding a basis for the cut-set subspaceW s .) to any spanning tree, forms

The
with

respect

COROLLARY

The
and

dimension

the number

of the cut-set subspace of cut-set vectors(including


illustrate

Ws is equal to the O) in Ws is 2'.) results

rank

r of

the

graph,

Example: Let us now

these

with an

exanlple.)))

128)

VECTOR

SPACES

OF A GRAPH)

CHAP.

6)

For

the graph

G in

Fig.

6-5)

number

of edges,
rank,

e = 5,
r =
J.l

3,
2.)

nullity,
The
are) 1

number

of vectors

in

the

circuit

subspace,
1

2 therefore, is 2

4, and

these

0 ,

and

0 0
'----v---\"

1
1

1
1

o. 0
0

a basis
The

of

W r)

with

to the set of fundamental circuits two of these vectors correspond to either of the spanning trees in Fig. 6-5, and therefore they form a basis for Wr . (In fact, any two of the first three vectors form a basis of Wr .)
first
respect
three in

The

subgraphs, Fig.

each

corresponding

to a

nonzero vector

in

Wr,

are
the

shown
The number

6-6.
therefore

cut-set subspace W s has a dimension of three, and of vectors in W s is 2 3 = 8. These cut-set vectors are)
1 1 1

0
1

0
1 1

I
I

0
0

0
1

0
0
1 1

0
1 1

I
1

0 I
1

o.
0
0

0
0
a basis

0
1 ...

0
1

of Ws)

The

first

three

be the

respect to the tree g2


vector

cut-sets with vectors correspond to the three fundamental in Fig. 6-5. The rest of the can easily be seen to vectors basis vectors. The seven) sums of .any two or three of these

e1)

eI) Q)
Fig.

6-6

Circuits

in

graph

G of Fig.

6-5.)))

SEC. 6-8)

ORTHOGONAL

VECTORS

AND SPACES)

129)

e()

e()

e()

e()

e3)

Fig.

6-7

Cut-sets and

union

of edge-disjoint

cut-sets

in

graph

G of

Fig. 6-5.)

to subgraphs, each corresponding


Fig.

a nonzero

cut-set

vector,

are sketched

in

6-7.

In this example you may have observed that the subgraph reI' e2 , e 4 , e s } is both a circuit and a union of two edge-disjoint cut-sets. The vector (I, I, 0, I, to this occurs in both subs paces Wr I) corresponding therefore, subgraph, and Ws . Another observation there are at least you may have also made is that e r (2 - 2JJ - 2 -t-- I) nonzero vectors which are neither in W r nor in Ws . In this we must have at least 21 (= 2S - 2 3 - 2 2 + 1) such vectors. example Since is one vector common to Wr and Ws, we have in fact 22 vectors in there WG that are neither circuit vectors nor cut-set vectors. subobtained some Having insight into the circuit subspace and cut-set the relationship between these two subspaces.) space, let us now explore

6-8.

ORTHOGONAL

VECTORS

AND

SPACES)
a plane

Consider
two-dimensional

two

vectors Euclidean

(4, 2)

and

(- 3, 6) in
shown

orthogonal notion to

product 4. (- 3) a k-dimensional vector space,we have Dot Product: The dot product of two vectors
because

space

as \302\2432)'

their dot

(which is also called a in Fig. 6-8. These vectors are this + 2 - 6 = O. Generalizing
the
X

following
Y in

definitions:

and

a vector

space W

is a

scalar

quantity defined
X -Y

as)

= (x
=

l'

2' . . . , X k ) (y
X 2

l'

2, . . . , Y k )

X1-Yl +

-Y2 -t-

...

Xk-Yk.)))

130)

VECTOR

SPACES

OF A GRAPH)

CHAP.

6)

(-3,6))

(4,2))

Fig. 6-8
space

Pair

of orthogonal

vectors

in

\302\2432.)

Orthogonal

Vectors:
two

is zero;
vector
of Returning

and

subspaces

Two vectors are are said to


every

called orthogonal
in the

if their

dot product
if every

be orthogonal to each other


other.

in one is
to

orthogonal to

vector

two

vectors,

the vector space each representing


corresponding

products of the
product

associated with a graph G, the dot product 2 sum of the a subgraph of G, is the modulo in the two vectors. For example,the dot entries
g2

of the
(],

vectors representingsubgraphs gl and


0, 1,

in Fig.
1

6-5
1

is)

0, 1). (0,

1, 1, 1,0)

1. 0
+

+ O. 1

1.

O.

].0

(mod 2 sum)

=0+0+1+0+0

=1.)
in the sum of products above of nonzero entries is the number of common and 6-8 definition to Theorem follows from the edges g2. directly gl of the dot product of two vectors.)

The number

THEOREM

6-8)

The dot product of two vectors, one representing is zero if the number of edges common to g and g' is odd.) the number of common edges

a subgraph g
is even;

and

the
product

the dot

other g', is 1 if

THEOREM 6-9)
In

the

vector

space of a

graph,

the

circuit

subspace

and

the

cut-set

subspace

are orthogonal to
Proof:

each other.
to Theorem
What

According

4-3,
the

the

number

and

a cut-set

is even.

about

number

edge-disjoint circuits and a union of edge-disjoint can be shown as follows: of three edge-disjoint circuits r h Let gl be a union of two edge-disjoint cut-sets S 1 and and g2 be a union Let the number of edges common to)))

of edges common to a circuit to a union of of edges common cut-sets? That this is also even r 2, and S2 in G.

in a

graph

G,

SEC. 6-9)

INTERSECTION

AND JOIN

OF W r AND

W s)

131)

1 1

and and

be

2a,

r r

S 2 be 2b, S1 be S2 be S
1

2 and 2 3 3

2c, 2d,
2e,

r r
r

and and and

be

S2 be

2f)
between

Since there r 3, the six


empty).

is no

edge common between

S1 and S2, or
gt

r
is)

and

r 2 and
be

common edges enumerated above to of edges common Therefore, the number


sets of
2a

are all
and

distinct (some may


g2

-+ 2b

-f-

2c

-1- 2d

+ 2e
gt

2f,)

an

even

number.)

This example can be extended to and of edge-disjoint circuits dot product of a circuit vector and the in each of these subspaces is orthogonal the theorem. .)
numbers

cut-sets, a cut-set

of any finite and gz to include the union From Theorem 6-8, respectively. vector is zero. Henceevery vector to every vector in the other. Therefore,

For
circuit

instance,

the

dot

product
in

vector (I,
(0,

I, ], 0, 0)

the

of the cut-set vector (0, I, I, I, 0) and the in Section 6-7 (i.e., Fig.6-5)is) example
=

I, I,

I, 0). ( I,

I, I, 0, 0)

O.

I.
(mod

+
2).)

I.

I. 0

+ O.0

=0
OF W
r

6-9.

INTERSECTION

AND JOIN

AND

W s)

W G , it is interestW r and Ws of the vector subspaces space is the largest set of vectors that belongs to both circuit subspace W r and the cut-set subspace W s ; and what is the smallest set of vectors both Wr and Ws ? Clearly, the null or zero vector 0 is in containing W r and Ws, but both in there contained may also be some nonzero vectors the intersection Wr n W s . For example, the vector)

Given the
to

two

ing

ask

what

I I

o I
I)

for

the

graph

in Fig.
W r

the set

of vectors

6-5 is in both subspaces. n Ws always forms a

It is not
vector

difficult

to

show

that

subspace

in

W G .)))

132)

VECTOR

SPACES

OF A GRAPH)

CHAP.

6)

W r and Ws both hand, the smallest subspace containing Wr U W s , of course, but (because of the closure for a subspace) it will usually contain some additional vectors requirements in W r U Ws . For example,for the graph in Fig. 6-5 set W r U W s contains not 10 vectors of Figs. 6-6 and 6-7), while the smallest con(union subspace set W r U Ws, that the set in vectors of is, the subspace taining spanned by W r U Ws, consists of 16 vectors. (What are the remaining six subgraphs not in Figs. 6-6 and 6-7?) The included subs pace spanned by Wr U W s is called the join of W r and W s , and is written as W r V W s . The following is a well-known result from linear algebra:If X and Yare
On

the

other

must

contain

the

set union

two

subspaces in their join, dim(X


dim(X

a
V

finite-dimensional
Y),

vector

space,

then

the

dimension

of

is given

by)

V Y)

= dim X

dim

- dim(X

Y).)

Using

this

result,

we

get)

dim(W

r V

Ws)

= e-

dim(W

r n

W s ).)

Two subspaces of a vector if the complements space are said to be orthogonal are to each and the entire other, subspaces orthogonal they together span vector space.Thus we have the following interesting result.)
THEOREM

6-10)

Subspaces

Wr

and

Ws

are orthogonal

complements if
W

and

only

if)

dim(W

r n

Ws)

= 0, i.e.,

r n

Ws

o.)

a set of basis vectors W r together with a set of basis of a basis for W G if and only if Wr n W s = O. Consequently, as a ring sum of two subany g of G can be uniquely subgraph expressed a an circuit or of and the a one union circuits other cutgraphs, edge-disjoint set or an edge-disjoint union of cut-sets, if and only if)
In

other

words,

vectors of W

s form

W r

n
Fig.

Ws

O.)

These

properties In

are illustrated

in

6-9.

the case)
W

r n

Ws

=1= 0)

we

have nonzero vectors each orthogonal to situation arises from the finitenessof the field.

itself. I

This

seemingly

peculiar

n fact,

the dot

product of any)))

SEC. 6-9)

INTERSECTION

AND JOIN OF W r AND

W s)

133)

dim

U{-;

= e =
-

3
1

d i In
d i 01
a)

=n W s
Wr =

= 2

= 1) J.1

Gra

ph

G)

WI' contains

and

\302\267

(D
W s

(g)

contains

and

(l).
=
w\"nws=(g)
Wr V Ws = WG) Wr

(:).
a)

(D

(g))

Ws =)

(1),
The

(n,
uniquely

G),

(D. (g))
as)

remaining

three vectors are

expressed

=
(g)

\037

(D =
\037

G)

,and
(n

( D
=

(D
\037

(D
Fig. 6-9 vector
number

(l))
different

Graph and its


is zero if

subspaces.) if the

over GF(2)
of
1

with

itself

and

only

vector

contains an even

's.

Now,

since)

dim( Wr n
the

s ) =1= 0,)

possible

two subspaces to express

Wr and Ws are not every vector in W G as


W

orthogonal

complements.

Nor

is

it

a sum

of two vectors,

one from

W r
of)))

and the

other from

s . For

example,

in Fig.

6-5 no

linear

combination

134)

VECTOR

SPACES

OF A GRAPH)

CHAP.

6)

vectors

in

W r and Ws

will

yield

the

vector)
1

o.

o
o)

In

fact,

for Fig.

6-5 there are


V

16such
e

vectors

in W G that

are not in

Wr

W s,

because)

dim(W r
The
in (W [6-8]

W s ) ==

dim(W

r II

Ws)

==

== 4.)

reader
6-5.

Fig. s II and

Identify

like is encouraged to sketcha figure all 32 subgraphs, and place them


(W

Fig.
in

6-9, using the graph

W r ),

and

s V

W r ).

For more

on

properties

subs paces Wr , Ws, of these subspaces see

[6-1].)

SUMMARY)

or number systems were introduced, and a vector space W G over the graph G corresponds field of integers modulo 2 [i.e., GF(2)]. For a graph G with e edges the e in W G is 2 , each corredimension of W G is e, and the number of vectors sponding to a subgraph of G. an r-dimensional and unions of edge-disjoint cut-sets formed Cut-sets In
this

chapter

various

algebraic

it was

shown

that to every

Ws in W G . The number subspace each vector corresponding to a Similarly,


,u-dimensional the

of vectors

in union

subs

pace
of

W s is

naturally

r 2 ,

cut-set or a
of 2 JJ vectors.

edge-disjoint

cut-sets.

the circuits and


vector

union

edge-disjoint

circuits

W r , with Out space to any representing all fundamental circuits, with respect the in the circuit subspace. Likewise, basis spanning tree, forms a convenient r set of fundamental cut-sets, with respect to any spanning tree, provides a
set

correspond to a of many bases available,

of ,u vectors

basisin

the

cut-set

subspace.
circuit

The cut-set

subspace and

subs pace

of a graph are

orthogonal to

each other. The intersection two subspaces is not necessarily[O}; and circuit subto cut-set that be nonzero vectors common is, there may is to itself, and W these in W vectors s II r orthogonal spaces. Everyone of The set of vector the form another subspace. they (including origin 0) a vector form in W W the does not vectors union space. r s U necessarily of vectors in general, a large number W G has, It was also shown that e - 2JJ - 2 r or more) which belong neither to the cut-set + 1 vectors (2 circuit nor the to subspace. subspace
of these

On one hand, a graph provides an

elegant

and

concrete

example

of)))

CHAP.

6)

PROBLEMS)

135)

which often appear frighteningly A graph also provides an example of a vector space over a field than other those of usual real or complex numbers.On the other hand, a study of the vector spaceof a graph and the nature of different us \"what makes a graph tick.\" It gives us shows subspaces an additional mathematical and applications of graphs, in analysis footing
than

\"spaces\" of

more

three

dimensions,

mysterious

to many

nonmathematicians.

as in coding in Chapter theory (to be covered Vectors and matrices are closely related.In a graph, various matrices associated with explore
such and

12).
the

we will next chapter and tie the vector spaces

matrices

of graphs

together.)

REFERENCES)
in its barest of abstract algebra has been presented rigor. Since the classical book of van der Waerden on the subject. Of these, four are recommended (1931), many excellent texts have appeared for those wishing a more detailed and thorough For groups and fields see coverage. 3 of Miller [6-7]. For vector spaces, Chapters 2, 3, and 4 of Herstein [6-6] and Chapter 1 of Halmos and 5 of Herstein consult Chapter [6-5], Chapter 7 of Dean [6-2], Chapter [6-6]. For a study of vector spaces of graphs, 4 of Seshu and Reed [1-13], and papers Chapter in particular, for the material and Rota [6-3] are suggested; by Gould [6-4]and Goldman in Section 6-9, see Chen covered [6-1] and Williams and Maxwell [6-8]. (Note that in [6-8], union of cut-sets; cire is a circuit or an edge-disjoint seg is a cut-set or an edge-disjoint
A

small

but very
that

important

portion

essentials, and

too without much

union

6-1.
6-2.

6-3.

6-4.
6-5.

with a Graph,\" SIAM J. Appl. \"On Vector SpacesAssociated Math., Vol. 20, No.3, May 1971,526-529. R. A., Elements of Abstract John Wiley & Sons, Inc., New York, DEAN, Algebra, 1966. in Recent of Subspaces of a Vector GOLDMAN, J., G. C. ROTA,\"\"The Number Space,\" Progress in Combinatorics Press, Inc., New York, 1969. (W. T. Tutte, ed.), Academic J. Math. Phys., Vol. 37, 1958,193-214. GOULD, R., \"Graphs and Vector Spaces,\" ComVector HALMOS, P. R., \"Finite-Dimensional Spaces,\" Van Nostrand Reinhold
CHEN,

of circuits.) W. K.,

6-6.
6-7.
6-8.

pany, New
HERSTEIN,

York, 1958.
I. N.,

Topics

in Algebra,
Modern

Xerox CollegePublishing,
Abstract \"The

Lexington,

Mass.,

1964.
MILLER,

K. S.,

Elements of

Algebra,

Harper & Row,

Inc., New

York,

1958.
T. W.,

WILLIAMS,

and L. M.
New

MAXWELL,

Decomposition

Introduction of a
May

Class

of Subgraphs,\"

SIAM J.

Appl.

Math.,

of a Graph and the Vol. 20, No.3,

1971,

385-389.)

PROBLEMS)

6-1.

Show Show

that

6-2.

that

all

five

does not satisfy the associative axiom. operation of subtraction of the four fourth roots of unity that is, {1, -1, i, -i}, satisfies criteria for being an abelian multiplication group under the ordinary

the usual the set

operation.)))

136)

VECTOR

SPACES

OF A GRAPH)

CHAP. there is only


the

6)

6-3.

Given a set (x, y, z} of three with this set.


From unique

elements, show
that

that

one group
set
{O,

possible 1, 2} has modulo

6-4.
6-5.
6-6.

the

table

inverse

under

in Fig. 6-3(a), show modulo 3 addition.

each
What

about

element in under

multiplication

6-7.

3? Use the table in Fig. 6-3(b). Show that there are only two different groups possible with four elements, and that both these groups are abelian. Given a set (a, b, c, d} of four elements, construct two four by four tables for * and 0, such that the set is a field. Identify the letters playing the roles operations with respect to * and of identities 0 (Le., 0 and 1). Write down the addition and multiplication tables for each of modulo 4, 5, 6, and 7 arithmetics (similar to those in Figs. 6-3 and 6-4).

6-8. 6-9.
6-10.

(i.e., 1,2,

table in Problem 6-7, show that not every nonzero element appropriate the modulo 4 multiplication operation. 3) has a unique inverse under is an abelian ring with unity, but is not a field. Show that the modulo 6 system 0 is orthogonal to every Prove that in any vector space the null vector in vector
From

the

and

the space.

6-11.

Show

that

W G , as defined

in

Section

vector space,as stated in Section 6-4. 6-12. In vector space WG, do the vectors associated with the spanning trees of G form a vector space over G F(2)? Explain. of a circuit of length Let G be a graph 6-13. four. Depict the four subspaces consisting W r , Wr n W s , and Wr V Ws as was done in Fig. 6-9. Draw the corresWs, Have all 16 subgraphs of G been accounted for? ponding subgraphs. 6-14. Repeat Problem 6- 13 for a completegraph of four vertices. Find a basis for Ws
and

6-5, satisfies

all

four

conditions

for being a

Wr .

If a graph G is a tree (or a forest), show that the cut-set subspace Ws fills the entire vector space W G of graph G. a graph for which the circuit space contains 6-16. Characterize the vector (1, 1, . . . , 6-17. Prove that the number of distinct bases possible in a cut-set subspace is 6-15.
1,(2 r.) where r is the
that

1).

- 20 )(2
the

- 2 1 )(2

- 2 2 )...

(2 r

- 2r -

),

rank of
number

graph.

6-18.

Prove
J1,

the

of spanning
JJ 2\302\260)(2

trees in
JJ

a connected

labeled graph

with

nullity

cannot

exceed

the number
2 1 )(2 tree

(2JJ 1, J1,.
(Hint:

- 2 JJ- 1 22) . . . (2 JJ ). there is a distinct


circuits.

Associated
to

with each
the set

spanning fundamental

basis in

corresponding

of

Therefore,

there are

Wr , subspace as at least

6-19.

6-20.

trees.) spanning many distinct basesin W r as the number of different vectors Sketch a graph G that has the following (among others) in its circuit sub0,0,1), (0, 1, 1, 1, 0, I, 1,0), (0, I, 0, 0, 1, 0, 1,0), (0, 1,0, 0, 0, space: (0, I, I, 1,1, 1 , 0, 1), (1, 0, I, 0, I, I, 0, 1), (1, 0, 1, 0, 0,0, 1, 0), (1, 0, 0, I, 1, 1, I, 0), and (J, 0, 0, I, 0, 0, 0, 1). that a graph is connected and that W r n W s =I=- 0, investigate further the Given to the vectors in subspaces (a) Wr n Ws properties of the subgraphs corresponding and (b) Wr V Ws.)))

7)

MATRIX

REPRESENTATION

OF GRAPHS)

Although

pictorial

representation

of a graph is
are better

very

convenient

for

visual
matrix
Matrices

study,

known

A processing. of representing a graph to a computer. is a convenient and useful way lend themselves easily to mechanical manipulations. Besides, many to study the structural results of matrix algebra can be readily applied

other

representations

for computer

In many of graphs from an algebraic point of view. properties applications network and operations reof graph theory, such as in electrical analysis turn out to be the natural of expressing the problem. also search,matrices way I n this chapter we shall consider two most frequently used matrix representations of a graph.Also a correspondence between some graph-theoretic will be established. I n view of the close tie properties and matrix properties

between matrices and upon as a continuation


algebra

vector of

spaces, Chapter

this chapter should, in fact, be looked 6. A rudimentary knowledge of matrix

is assumed.)

7-1.

INCIDENCE

MATRIX)

Let G be a graph with n vertices, e edges, and no self-loops. = matrix A n e whose to the n vertices rows by correspond [aij]' columns correspond to the e edges, as follows:

Define an
and

the e

The matrix
aij

element)

=
=0

I,) ,)

if jth

edge e j is incident

on

ith

vertex

Vi' and

otherwise.)
137)))

138)

MATRIX

REPRESENTATION

OF GRAPHS)

CHAP.

7)

V3) V6)

V4)

c)

VI)

d)

Vs)

(a))

a 0

c 0 0 0

(!
0

VI

0 0 0

t2
V3

0
0

0 0
0

0 0

0 0 0 0 0
0)

V4

Vs

0
0

0 0 0

0 0

V6

(b))

Fig.

7-1

Graph and its incidence matrix.)

a matrix A is called the vertex-edge or simply incidence Such incidence matrix, as A(G). A graph matrix. Matrix A for a graph G is sometimes also written in Fig. 7-1. are shown and its incidence matrix 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 representawe can readily write tion of a graph without its incidence matrix.) self-loops, are customarily defined over a commutative matrices ring with identity, not be a field (such as the ring of integers), we have defined matrix A over a of the vector space WG in Chapter 6.))) field, G F(2), in keeping with our definition

t Although
need

which

SEC. 7-1)

INCIDENCE

MATRIX)

139)

On the
its

other hand, if we are given


graph

an

geometric

without the

ambiguity. same

geometric graph contain


ternative

matrix A( G), we can construct matrix and the incidence are simply two alinformationt-they
incidence The

l'he
made:)

ways
following

of representing
observations

the same
about

(abstract) graph.
matrix
A

the incidence

can

readily

be

1. Since every
A has

edge

is incident

on exactly two

vertices, each column


the

of

exactly two 1's.


of l's in

2.

The

number

each row equals the

degree of

corresponding

vertex.)

3. A row

with

all

O's, therefore,

represents an isolated
2 in

vertex.
its

4. Parallel
matrix,

in a graph produce edges for example, columns 1 and

identical columns in
Fig. 7-1.

incidence

5. If a graph G is disconnected g 2' the incidence matrix A( diagonal form as)


A(G)

and consists
G) of

graph G

of two components can be written

in

g t and a block-

=
[\037\037!\037-+-A(\037\037J')

(7-1))

where
and

A(g 1) and

g 2. This incident on

also true

for

matrices of components g 1 A(g2) are the incidence in g t is no edge observation results from the fact that vertices of g2' and vice versa. Obviously, this remark is a disconnected of components. graph with any number rows
the

6. Permutation of any two corresponds to relabeling


This

or columns
vertices

in

an

incidence

matrix

simply

and

edges of the

observation

leads

us to

Theorem 7-].)

same graph.

THEOREM

7-1)

Two

A(G1)

and

graphs Gland A(G 2) differ


the

G2
only

are

isomorphic

if and only

if

their

incidence

matrices

by permutations Matrix:

of

rows

and

columns.)

Rank of

Incidence
vector

be regarded as a
t Just
evident
planar
7-1(b).)))

over

GF(2)

Each row in an incidence in the vector space of

matrix
graph

A(G) may
G. Let the)

of representation, some properties are more alternative methods than in the other. For example, the fact that the graph is representation it is not at all obvious from the matrix in Fig. is obvious in Fig. 7-I (a), whereas
as in one

any two

in

140)

MATRIX

REPRESENTATION

OF GRAPHS)

CHAP.

7)

vector

in the

first row be

called At,

in

the

second
AI

row

A 2

, and

so on.

Thus)

A
A(

= G)

(7-2)

An)

are exactly two l's in every column of A, the sum of all these is 0 (this being a modulo 2 sum of the corresponding entries). Thus vectors Therefore, the rank of AI, A 2, . . . , An are not linearly independent. A is less than n; that is, rank A < n - 1. nz of these n vectors (m < n Now consider the sum of any I). If the
Since

there

vectors

graph is connected, A(G)


A(gt) is with
submatrix
m

cannot
with

be

partitioned,
n \037 m

as

in

Eq.

(7-1),

such

that
by

rows

of A(G) can be found, 2 sum for m < n I, such that the modulo of those m rows is equal to zero. Sincethere are only two constants 0 and I in this field, the additions of all taken m at a time for m = I, 2, . . . , n - I exhausts vectors all possible linear combinations of n - I row vectors. Thus we have just shown that no linear combination of m row vectors of A (for m < n - I) can be equal to zero. the rank of A(G) must be at least n - I. Therefore, Since the rank of A(G) is no more than n - I and is no less than n - I, it must be exactly equal to n - I. Hence Theorem 7-2.)
THEOREM

and A(g2)

rows. -

In other

words, no m

7-2)

If A(G)
of

is

A(G) is n
The

an

incidence
I.)

matrix

of a connected

graph

G with

n vertices,

the

rank

argument

rank of A( G) is n -

that leading to Theorem 7-2 can be extendedto prove with n vertices and k k, if G is a disconnectedgraph

the

ponents (Problem 7-3).This is called the rank of a graph with If we remove anyone row - I) by (n graph, the remaining
In

the

reason
the

why

the

number

- k has been

com-

k components. from

e submatrix n

matrix incidence is of rank n vectors

of a connected
I

(Theorem

7-2).

other words, the


n

remaining

row

1 rows of an incidence matrix to specifythe correthe same amount of completely, for n - I rows contain I rows n we information as the entire matrix. (This is obvious, since given can easily reconstitute the missing because each column in the matrix row, has exactly two l's.))))

Thus we need only


graph

are linearly

independent.

sponding

SEC.

7-2)

SUBMATRICES OF A(G))

141)

Such

an

(n

matrix. The vertex

- ])

by

submatrix

Af of
to the

is

called
in

corresponding

deleted row

erence vertex.
reference

Clearly,

any

vertex

of a

connected graph can be made


n of

a reduced Af is called

incidence the refthe

vertex.

Since a
reduced
words,)

tree is a connected graph with incidence matrix is a square matrix

vertices order

and

n
n

- 1 edges,its
-

and rank

1. In other

COROLLARY)

The

reduced

incidence

matrix

of a

tree is
1

nonsingular.)

A graph
The

rank

with n vertices and n of the incidence matrix


the

edges

that

is not
will

a tree is disconnected.
be

Therefore, will

(n

- I) by
if and

(n

only

of such a graph

less

than

- 1.
of

not

be nonsingular.

I n other

graph

is

nonsingular

of such I) reduced incidence matrix words, the reduced incidence matrix if the graph is a tree.)

a graph
a

7-2. SUB MATRICES


Let g
matrices
sibly

OF

A(G))

with

be a subgraph of a graph G, and let A(g) and A(G) be the incidence is a submatrix of A(G) (posof g and G, respectively.Clearly, A(g) is a one-to-one correthere rows or columns permuted). I n fact,
each

between spondence

kedges,
vertices

k being in G.

any

of A(G) less than e positive integer


n by

k submatrix

and

and

a subgraph n being the

of G with number of
such

Submatrices of A(G) corresponding to specialtypes of as circuits, spanning trees, or cut-setsin G, will undoubtedly 7-3 gives one such property.) properties. Theorem
THEOREM

subgraphs,

exhibit special

7-3)

(n

Let A(G)

be
-

an

incidence
submatrix

matrix
of

I)

by

(n

1)

edgescorresponding
in

to the

of a connected graph G with n vertices. An is nonsingular if and only if the n - 1 of this matrix constitute columns a spanning tree
A(G)

G.)

Proof:
matrix

of

the

Every square submatrix same subgraph


Theorem if and

of order
in

with

- 1 edges, and
that

- 1 in
a

A( G)

is the
vice

reduced incidence
versa.

remarks
nonsingular

following

7-2,
the

it is

clear

square
edges

submatrix
of the

only
tree,
.)))

if

corresponding

subgraph
n

is a tree.

The tree

From the of A(G) is


in

this

case is a
Thus

spanning

because

it contains

n-vertex graph.

the

theorem.

142)

MATRIX

REPRESENTATION

OF GRAPHS)

CHAP.

7)

7-3.

CIRCUIT

MATRIX)
circuits
matrix

edges
defined

Let the number of different in G be e. Then a circuit


as follows:)

in a
B =

graph G be q and the number [bij] of G is a q bye, (0, I)-matrix

of

= b.. IJ)

if ith

circuit

includes jth edge, and

==0 ,)
To

otherwise.)
B is

emphasize

the fact
as Fig.

that

a circuit matrix
different

of graph G, the
circuits,

circuit

matrix

may also be written The graph in

B(G). 7-1(a)

has four
its

{a, b}, {c,

e, g},
)-matrix

{d,f,
as

g},and
shown:)

{c,

d, f,

e}. Therefore,

circuit

matrix

is a

by

8, (0,

a
1

b
1

c d e
0
I

f g
0
0
1 ] I I

0
0
1 1

0
I 0
]

0 0
0 0 0)

B(G)

2 0 0
3

0 0

(7-3)

4
The

following

observations

can be made about

a circuit

matrix

B(G) of

a graph G:)
1.

A column
that

does

not

of all zeros corresponds to belong to any circuit).

noncircuit

edge

(i.e.,

an edge

2. 3.

Each Unlike

row of

B(G) is a circuit
matrix,

vector. a circuit

the incidence

matrix
will

a self-loop-the

corresponding

row

have

is capable a single I.
number

of representing
of

of l's in 4. The number corresponding circuit.

a row is

equal to the

edges

in the

5. If graph

is separable

(or components)
a block-diagonal

(or disconnected) and and g2, the circuit matrix gl


form as)

consists of
B(G)

two

blocks
in

can

be written

8(G) =
where

1\037\037\0371!__!

----\037-

L 0

,
g2. This

: B(g2)) l

B(g 1) and

B(g2) are the

circuit matrices

of

gland

ob-)))

SEC. 7-3)

CIRCUIT

MATRIX)

143)

servation
ing

to

g2, and

results from the fact that circuits vice versa (Problem 4-14).
of

in gl

have no

edgesbelongmatrix

6.

Permutation

any

two rows
the

or columns in
and edges.

circuit

simply

corresponds to relabeling

circuits

7. Two graphs Gland G 2 will have the same circuit matrix if and only if (Theorem Gland G2 are 2-isomorphic 4-15). In other words, (unlike an incidence does not specify a graph commatrix) the circuit matrix
pletely.

It only

specifies

the graph
that matrix,

within

2-isomorphism.
in

For 4-11 (a)

instance,

be easily verified have the same circuit


it can
An

the

two graphs yet the graphs


matrix

Figs.

and (d)

are not isomorphic.)


and

important

theorem
graph

relating
G
is)

the incidence

the circuit

matrix

of a

self-loop-free

THEOREM

7-4)
A

Let B and

be,

graph) self-loop-free

the circuit matrix respectively, columns are arranged whose

and
using

the
the
is,)

incidence matrix (of a same order of edges.

Then every

row

of B is

orthogonal to every
A.BT

row

A;

that

= B.AT

0)

(mod

2),)

(7-4))

where

superscript

T denotes

the

transposed

matrix.)

Proof:
it the

is not. other

If v is

Consider a vertex v and a circuit r in the graph G. Either v is in r or not in r, there is no edge in the circuit r that is incident on v. On in the r that are circuit hand, if v is in r, the number of those edges
consider
in the
if

on v is exactly two. With this remark in mind, Since the edges are arranged
incident
sponding and

positions

occur
circuit.

only
in

the ith row in A and the jth row in B. same order, the nonzero entries in the correthe particular on the ith vertex edge is incident

is also

in the jth
ith

If the

vertex of

is not the two

the dot
will 1 the

product

be -t- 1 = other

two exactly 0 (mod 2),


from

l's
the

in

dot

the jth circuit, there is no such nonzero entry, and rows is zero. If the ith vertex is in the jth circuit, there the sum of the products of individual Since entries. from A and of the two arbitrary rows-one product theorem.

B-is

zero. Hence the

.)

As an
of

the

graph

example, let us multiply in Fig. 7-1(a), after

the making

incidence sure

matrix and transposed that the edges are in the

circuit
same

order

in

both.)))

144

MATRIX

REPRESENTATION

OF GRAPHS

CHAP. 7
1

0 0
1

0 0
0
I

0 0
1
1

0 0
A.

BT =

0
1

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

0
1

1
0
0

0 0
0
0
1

0 1

0
1

0
1 1

1
1

0
1

0
1

0
1

0 0

0
0

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

(mod 2).

0 0 0 0 0 0 0 0)
7-4.

FUNDAMENTAL
AND

CIRCUIT
OF
B)

MATRIX

RANK

A
ning

set of
tree

in a

independent
ring

sums of these circuits. Thus, (i.e., linear combinations) 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 to the set of funfrom the rows corresponding damental circuits. For example, in the circuit matrix in Eq. (7-3), the fourth of the second and third row is simply the mod 2 sum rows. A submatrix a in all circuit which rows (of matrix) correspond to a set of B f. A graph and is called a fundamental fundamental circuits circuit matrix its fundamental circuit matrix with to a tree (indicated by respect spanning 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 - n + 1) by e matrix, because the number of fundamental circuits is e - n + I, each fundamental circuit being produced
by

fundamental circuits (or basiccircuits) with in Chapters connected graph, as discussed in a graph. The rest of the circuits circuits

respect 3 and

to any span-

6, are the

only

can be obtained as in a circuit matrix,

one

chord.

Let us
correspond

arrange the columns


to the
first

in I

Bf

such

that

all the
fundamental

+
circuit

chords

columns.

Furthermore,

let us

rearrange
made)))

the rows such that

the

first

row corresponds

to the

SEC.

7-4)

FUNDAMENTAL

CIRCUIT

MATRIX

AND RANK

OF B)

145)

e4)

es)

(a))

e2)

e3)

e6)

e()

e4)

es) o)

e7)

o)

o)

o)

o)

o)

o)

o)

o)

o)

o)

(b))

Fig.
to

7-2
the

spanning

Graph and its fundamental tree shown in heavy

circuit

matrix

(with respect

lines).)

by the chord made by the


matrix A

in the first column, the second row to the fundamental circuit second, and so on. This indeed is how the fundamental circuit in Fig. 7-2(b). is arranged B f thus arranged can be written as) matrix

Bf
where I Jl is an
J.l

[IJl! BJ,)
=

(7-5))

ing

by

(n

- I)

identity

matrix of

order J.l

submatrix,

corresponding

to the

I, and Bt is the remainbranches of the spanning

tree.
From

Eq.

(7-5)

it is

clear

that

the)

rank
Since

of Bf

Jl

1.)

Bf is

a submatrix

of the

circuit

matrix

B, the)
n

rank of B
In

> e-

I.)

fact,

we can
7-5)

prove Theorem 7-5.)

THEOREM

If B is a

circuit

matrix

of a

connected

graph G with

e edges

and n vertices,)

rankofB=e-n+l.)))

146)
Proof:

MATRIX

REPRESENTATION

OF GRAPHS)

CHAP.

7)

If A

is

an

incidence

matrix A.
BT

of G, from
=

Eq. (7-4)we

have)

(mod 2).) (Appendix


of B <

to Therefore, according

Sylvester's
rank

theorem
of

B),) e;)
A.)

-t-

rank

that

is,)

rank
Since) we

of B <

rank

of

rank

of A =

1)

have)

rank of B <
rank

ee

-f-

1.)

But

of B >

1.)

Therefore,

we

must

have) rank

of B =

-t- 1.

.)

An Alternative Proof: 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. B is a vector in W r , and since the matrix rank of any Every row in circuit of linearly independent rows matrix is equal to the number in the (or columns)
matrix,

we

have.)
matrix

rank of

B =

number

of

linearly

independent B <

rows

in B;)
independent
dimension

but
of

the

number

vectors Wr

= J.l. Therefore, rank of rank of B > e - n + 1, Theorem

in Wr , and

of linearly independent of linearly the number B <

rows

in

number of
vectors

linearly

e - n + 7-5 follows.

independent

in Wr
already

1. Since

we

showed

that

.)
graph

Note that sume that G

in talking is connected.

of spanning

trees of a

In the case

of a disconnected graph,

to consider a spanning forest and fundamental forest. It is not difficult to show (considering component by component) k components, if G is a disconnectedgraph with e edges, and n vertices,)
rank

is necessary to aswe would have circuits with to this respect


G it

that

of B

J.l

k.)

7-5.

APPLICATION you

TO A SWITCHING are given G, b, c, d,

NETWORK)

Suppose

of eight
from
One

switches

a box that e,f, g, and

contains h. The

outside. You are


box, way

asked to

determine

a switching network switches can be turned the switches are how the available

consisting
on

or off

connected
terminals)))

inside the

without

to find

opening the box, of course. the answer is to connect a lamp at

SEC.7-5)

APPLICATION

TO A SWITCHING NETWORK)

147)

Swi tch

k)

@@@ e d

f
h

Lamp)

@@@
g

@@)
Ba

II
ttery)

TI1Cbox)
Fig. 7-3
in then

Black box

with

a switching

network.)

series find

with

out

In this on the lamp

a battery and an additional switch k, as shown in Fig. 7-3. And which of the various combinations light the lamp. up the combinations that turn experiment, you discover that suppose

are eight:)
b,f,

(a,

h, k),
k),

(a, b, g, k),
(c,f,

(b, c, e, h,
Solution:
sent

h, k),

(a, e,f, g, k), (a, (c, g, k), (d, k).)

e, h,

k),

Consider We
lit

switches.

loop.
this

Since a
list

the switching network can assume that the graph the formation lamp implies
a partial list of circuits in a circuit matrix:)
a
I 1 1

as a graph whose edgesrepreis connected, and has no selfwe can regard the of a circuit,
the

preceding
list

as

corresponding

graph.

With

we form

b
I 1

f
1

g 011

1
1

0
0
I

B=

0 00101 o 0 1 1 101 o 0 10011


o
1

o
o

6 7
8)

01011

0
0)

0
1)

o 0
o

o
matrix,

001)

Next, to
circuits.

simplify

the

we should
ring

Observe
ts :) (a,

that

the k)

following

sums

remove the obviously redundant of circuits give rise to other


== == ==

circui

b, g,

EB

(C,f, (a,

h, k) e, h,

EB EB EB

(c, (c, (c,

g, k) g, k) g, k)

(a, (b, (a,

b,f, c, e, e,f,

h, k),

(a, b, g, k) EB

k)

h, k),
g,
k).)))

(a, e, h,

k)

EB (c,f,

h, k)

148

MATRIX

REPRESENTATION

OF GRAPHS

CHAP. 7
fifth

Therefore,
any

we can

delete the
a
] 1

first,

third,

and
5

rows

from

matrix
1:

8,

without

loss

of information.

Remaining is a
b
1

by

9 matrix
h

c
0

d
0

e f
0
1

g
1

k
1 1

0
0
1

0
1

0
0
1

8 1

0
0 0

0
0 0

1
1

0 0
0
1

1 0

1 1
1

0
0

0
0
to

0
matrix

0
the

0
form

Our

next

interchange

goal is to bring columns to get


b
1

of Eq.

(7-5). For this

we

82 :
f
0
0
1

e
0
1

g d
1

a c
1 1

k
1 1 I

0 0

0
1 1

0 8 2 =

0
0
1

0
0
0
1

0
0

0
0

0
0
0

1
1

1
I

0 the

0
in

Adding

fourth

row
b
1

8 2 to

the first, we get

83.
k

e
0

f
0

g d
0

a c
1 1 1

0
1

0
1 1

0
8 3

0 0 1 0 0
1

0
1 I

0
0
0

1 0

[Is!

F].

0
0 note

0
0

0
0

0
1

I
1)

0
redundant

We

that

there are
matrix

no
of

circuits

in matrix

8 3,

and
of

fundamental circuit five, and the network


information

the

was

assumed

graph. Since the rank required to be connected, we have the

8 3 is a 8 3 is

following

about

the graph:)

number of edgese =
nullity

9,
4,
5.)))

== 5, J.l

rank
number

r =
n =

of

vertices

SEC. 7-5)

APPLICATION

TO A SWITCHING NETWORK)

149)

Constructing a graph from

a graph
its

from

its

incidence

matrix

is simple,
We

but

constructing

fundamental

circuit

matrix
B3.

is

difficult.

shall,

therefore,
B

construct an incidence matrix from Since the rows in the incidence according to

matrix
look

are orthogonal
for a

to those in
M, whose

3-

are linearly
Si nce,)

Eq. (7-4)-we must


and

first

4 by

9 matrix B 3.

rows

independent

are orthogonal B3 =

to those of

[Is! F],)

an

orthogonal

matrix

to B3

is)

=
=-=

[[F T

FT

! 14 ]

! 1 4 ],)

because 1 is

in mod

2 arithmetic

-I

=--=

I,

[i.e.,

in G F(2)

the additive inverse

of

1].

Thus b
I
1

e f
1

g d a c
0
1

0 I
I 1

0
0

0
1

0
0
I

0
0
0
I)

0
1 1

M=

0
0

0
I

0
1

0
0

0
0

Clearly,

the

rank

of M is four, and
B 3 -M
T

it

is easy

to check

that)

o.)

Before

M can
I's

most
third

two

in each

be regarded as a reduced incidence column. This can be achieved


in

matrix,
by

it must (mod

have at
2) the

adding

row

to the

fourth

M,

which

gives us

M'.)
h

b e
II
I

f g d a c
0
1 1

0
1

0
0

0
1

0
0
I 1

0
0
0
1)

M' =
l\037

0
1

0
I

0
I

0
0

0
0

Matrix

M'
by

is the
adding

reduced incidence matrix.


a
fifth

The
that

incidence
there

matrix exactly

be obtained

row

to

M' such

are

A can two l's)))

150

MATRIX

REPRESENTATION

OF GRAPHS

CHAP. 7

in every

column;

that

is,

b
1

e
1

f
0
1

g d a
0
1

c
0
1

0
0

0
0

0
0

1 A==

0 1

0 0 0 0
1

1 o .
1 1 1)

0 0 0 1
0

0
1

0
1

0
A

0
we

0
can

From

the incidence

matrix

readily
as shown

the corresponding switching

network,

construct the graph and hence in Fig. 7-4.)

a)

5)

e)

A)

J)

II)

4)

(a))

Ins ide B Ia c k Bo x)

/ /
/ I I I \\ \\ \\

,/

/'

./ -----

-- - -- - --) --a)

......)

External
k)

\037WI tch)

Lamp)
e

\\ \\ \\ \"\"\"\"-

II
Ba -......) ------) ---)

ttery)

'......

(b))

Fig.

7-4

Graph and the corresponding

switching

network.)))

SEC. 7-6)

CUT-SET

MATRIX)

151)

7-6.

CUT-SET
Analogous

MATRIX)

which graph,

the

circuit matrix, we can define rows correspond to the cut-sets and


to a

a cut-set the

columns

matrix C = [cij]in to the edges of the

as follows:) =
if ith
otherwise.)

Cij

],) ,)

cut-set

contains jth edge,

and

=0
For

example,

a graph and

its

cut-set be

matrix made

The following

remarks

may

are shown in Fig. 7-5. about a cut-set matrix

C(G)

of

graph G.)

1.

As

in

the

case

of the incidence
matrix

matrix,

permutation
renaming

of rows
of

or
the

columns in
cut-sets

a cut-set

corresponds

simply to a

and edges,
row

2.
3.

Each

in C(G)

respectively. is a cut-set vector.


corresponds to an
identical Fig. edge

A column

with all O's

forming

a self-loop.
matrix

4. Parallel edgesproduce
first

columns

in the

cut-set

(e.g.,

two columns

in

7-5).

5. In

6.

a nonseparable graph, every set of edges incident on a vertex is a cut-set (Problem 4-8).Therefore, row of incidence matrix A(G) every is included as a row in the cut-set matrix C(G). In other words,for a the graph G, C(G) contains A(G). For a separable nonseparable graph, in the cut-set matrix. For incidence matrix of each blockis contained matrix of the block fc, d, e,f, g}in Fig. 7-5 is example, the incidence the 4 by 5 submatrix of C left after deleting rows a, b, and h and columns ], 2, 5, and 8. In view of observation 5,)
rank

of C(G)

>
of

rank

of

A(G).)

Hence,

for a

connected graph
rank of

n vertices,)
n

C(G) >

].)
a circuit
in

(7-6))
is always the provided
words,)

7. Sincethe
edges
in

number
in

even, every row


both

of edges common C is orthogonal

to a cut-set and to every row


in

B,

Band

C are

arranged

the

same

order.

In other

B.CT=C.BT=O)

(mod 2).)

(7-7))))

152)

MATRIX

REPRESENTATION

OF GRAPHS)

CHAP.

7)

CJ) I /

/')

//

CD
\\. '\\

..........-------0)

0---/'/
f)

=0------0)
\\ \\

1/
I I I

@)

cD)

a 0 2

d 0 0

e
0 0

f
0 0

0 0

0 0 0

0 0

0 0 0

0 0

0 0

c=

5 6
7

0 0
0

0 0
0 0 0
Graph

0 0

0 0
0 0 0

0 0 0
0 0

Fig. 7-5

and

its cut-set matrix.

On

applying

Sylvester's
rank

theorem
of

to Eq.

(7-7),

B +

rank of

C < e,

and

since

for

a connected

graph

rank of B rank of

= en

1,
(7-8))))

C<

1.

SEC. 7-7)

RELATIONSHIPS

AMONG

Af,

Bf,

AND

C f)

153)

Combining

Eqs. (7-6) and


rank

(7-8),)
of

C == n

1.)

Thus

we have 7-6

the

following

important

theorem

for a

connected graph G.)

THEOREM

The rank
A(G), As

of cut-setmatrix
equals the
rank

C(G) of

is equal
G.)

to

the

rank

of the

incidence

matrix

which in the

graph

redundant

the cut-set matrix generally has many to define rows. Therefore, it is convenient (or linearly dependent) C a fundamental as follows: cut-set matrix, f, e edges A fundamental cut-set matrix C f (of a connected graph G with the of C such that rows correand n vertices) is an (n - 1)by e submatrix with respect to some spanning tree. cut-sets spond to the set of fundamental circuit a fundamental As in the case of a fundamental cut-set matrix, C f can also be partitioned into two one of which is an matrix submatrices,

case of the

circuit matrix,

identity

matrix

In-t

of

order

- 1. That
==

is,)

Cf

[C c : In- d,)

(7-9))

where
n

the last
1

columns

branches

of the

the identity matrix correspond to the forming formspanning tree, and the first e - n + 1 columns
fundamental

lines) are given in Fig. 7-6. Again note that in talking of cut-set matrices we have confined ourselves to include to connected graphs only. This treatment can be generalized at a time.) one component connected graphs by considering
RELATIONSHIPS
In

ing C c correspond to the chords. A connected graph and a in heavy tree (shown spanning

cut-set

matrix

with

respect to

dis-

7-7.

AMONG

Af' Bf'

AND

C f)

the reduced insection we shall explore the relationships among B matrix and the the fundamental circuit matrix fundamental cidence f' Af' C cut-set matrix f of a connected graph.

this

It has

been

shown

that)

Bf = [IJJ :

B f ],

(7-5)
(7-9))

C f == [C c i In- d,)

t denotes the submatrix corresponding to the branches and tree, subscript c denotesthe submatrix corresponding spanning chords. and tree T in Eqs. (7-5) and (7-9) be the Let the spanning same,
where

subscript

of a to the

let

the)))

154)

MATRIX

REPRESENTATION

OF GRAPHS)

CHAP.

7)

c)

d)

d 0 0

e
0

f
0 0

0 0

0 0

0 0

Cf -

0
0

0
0

0
0 0 0 0

0
0

= [C : c . 15]

0
Spanning

0
tree

Fig. 7-6
mental

in a graph and the

corresponding funda-

cut-set

matrix.)

be the same. Furthermore, in the reduced order of the edges in both equations the edges (i.e.,the columns) matrix Af-of size (n - I) bye-let incidence be arranged in the same order as in B f and Cf. Partition Af into two sub-

matrices:)
Af

[Ac !At]')
corresponding

(7 -10))
to the

where At
spanning e

consists

of the n

is

columns

tree +
1

T, and

Ac

the

remaining

submatrix
in

branches of the corresponding to the


same

chords.
in

Since

(7-4)

we

have

the columns (in mod

Af and Bf are arranged 2 arithmetic)) -

the

order,

from Eq.

Af

B\037

o.

That
and)

is,)

JJ [A c :I A t ] - _lBT -

t)

= 0,

Ac +

At- B;

O.)

(7-11))))

SEC. 7-7)

RELATIONSHIPS

AMONG

Af,

Bf,

AND

C f)

155)

Since

At is nonsingular,
A; 1, we

its

inverse

A;

exists.

Premultiplying

both

sides

of Eq. (7-11) by

get)

A; Since in mod

1 \302\267=

Ac

- B;.)

(7 -12))

arithmetic

-1

I,)
A t-l.

BT= t
Similarly,

A c.)
the

(7-13))

since the

columns
have

in

according to

Eq. (7-4),we

(in = =

f and C f are arranged in mod 2 arithmetic))

same

order,

Cf.B\037

o. 0,

That is,

[Ce :

In-l]{-\037rJ

Cc =
=

-BTt
BT t
c'

(7-14)
(7 -15) from

=A-l.A t For
in ping

(7-13). used

Figs. the

for the graph example, let us look at the following three matrices tree, and 7-1, 7-5, and 7-6. Using fa, e,f, spanning h} as the sixth row from matrix A in Fig. 7-1 to get Af' we have

g,

drop-

b
0

c d a e f
0
I

g
0

0-

0
Af

0
1

0 0 0 0
1 1

0 1 1 1 1 0 0 0 0 1 =
1 0 I

[Ac!

AJ,

0
1

0 1

0 0
h

0
b
=
[\037

c
0
1

d
0
0
1

a e f
1 0
0

g
0
1 1

0
1 0

0
0
1

Bf

=
\037]

[1 3 :

B,J,

b
1

c
0
1

d
0
0
1 I

a
1 0
0 0

e f
0
1

g
0

0
0

0 0
0 0
1

Cf =

0 0 0
0 0
1

0 0

0
0
1)))

= [Cc ! 15].

0 0 0 0

156)

MATRIX =

REPRESENTATION

OF GRAPHS)

CHAP.

7)

Bf

C c is

immediate. It can alsobe readily =BT A-I. A ct.) t

verified

that)

This leads
].

to

three

conclusions:)

A or Af' we can readily arbitrary spanning tree and


Given
B

construct
its

B f and At in

Cf ,

starting

from

an

subgraph

Af.

2. Given either

termines a graph 3. 7-8.


Given

or C f , we can
within

construct the

2-isomorphism,
in

either

Bf

or C f , Af

general

Thus since Bf deother. does so Cf. be determined cannot completely.)

PATH

MATRIX)

and to use in communication often convenient is for a A matrix defined the is matrix. path path transportation The as a and is written vertices in of P(x, (x, y). y), graph, say specificpair between vertices x and y, and rows in P(x, y) correspond to different paths for (x, y) the columns correspond to the edges in G. That is, the path matrix vertices is P(x, y) = [Pu], where) Another

(0,

)-matrix

networks

Pu =
=0
As

],) ,)

if jth

edge lies

in

ith

path,

and

otherwise.)

an illustration, 2,

There are three


them

I,

consider all paths between verticesV 3 and V 4 in Fig. 7-] (a). d, c}. Let us number [h, e}, [h, g, c}, and [h,f, paths; and 3, respectively. Then we get the 3 by 8 path matrix P(v 3 , v 4 ):)
different

a
I

b
0

c
0
I I

d
0
0 1

e f
I

g
0
I

P(v 3 ,

v4) =

2
3
[\037

0
0

0 0
at

0
I

:}
about

Some

of the

observations one can make


G are)

once

a path matrix

P(x, y) of a graph
1. A

column of all path between x


A column
between

O's
and

corresponds
y.

to an

edge
edge

that

does

not

lie in any

2.

of all ]'s
y.
with
row

correspondsto
all O's.

an

that

lies in every

path

x and

3. There is no 4. The ring


edge-disjoint sum

of any two rows in P(x, union of circuits.)))

y) corresponds

to a circuit

or an

SEC.

7-9)

ADJACENCY

MATRIX)

157)

THEOREM

7-7

If the
of the

edges of a

connected A and

graph

incidence

matrix

are arranged in the same order for the the path matrix P(x, y), then the product
A. PT(X,

columns

(mod

2))

y) =

M,)

where

the matrix
O's.)

M has

l's
left

in

two

rows

x and

y,

and

the rest

of

the

- 2 rows

are all

Proof:
As
P(v 3,

The proof is

as

an exercise

for

the

reader

(Problem Fig.

7-14).)

an example, v 4 ), just

multiply the incidence

matrix

in

7-1 to the

transposed

discussed.

0
0
1

0
0
]

0 0 0 1 0 0 0 0 0 I
A. PT(V3, v 4 ) =
0
1

1 1

0
I

0
1 1

0
0 0
1

0
]

0
1

0
0
1

0 0 0
I 0

0
0

] 0

0 0

0
1

0
0

0
I

0
I

1
0

0
I I

1
0
1

0 0

0
1

VI
V2

0
0
I

0
0
I I

0
0
I

v3 v4
Vs
V6

]
0
0

(mod
I

2).

0
0

0
0

Other properties of the to investigate on his tains less information about C or does.) B, A,
reader

path own.

matrix,

It should

the

graph

as the rank, are left for the be noted that a path matrix conof the matrices in general than any
such

7-9.

ADJACENCY

MATRIX)

As an

alternative to the
graph

incidencematrix,

it is

sometimes

more convenient

to represent a
jacency

by

matrix of
binary

a graph
matrix if there

symmetric
= x.. IJ)))

The its adjacency admatrix or connectionn1atrix. G with n vertices and no parallel edges is an n by n X = [xij] defined over the ring of integers such that)

'
,)

is an

edge between ith

and

jth

vertices,

and

=0

if there is

no edgebetween

them.)

158)

MATRIX

REPRESENTATION

OF GRAPHS)

CHAP.

7)

V3)

V2)

VI)

VI

V2

V3

V4

Vs

V6

VI

0 0 0 0

0 0 0

0 0 0 0 0

V2

x=

V3

V4

s 0

0 0
and

0 0

0 0

V6

Fig. 7-7 Simple graph

its adjacency matrix.


are

A simple graph and its

adjacency matrix
be made

Observations that
X of ].

can

immediately

in Fig. 7-7. shown about the adjacency matrix

a graph
The

G are)
along the principal diagonal of X are all O's if and only at the ith vertex corresponds has no self-loops.A self-loop of adjacency matrix the adjacency
edges.
t)

entries

if

X..==]. II)
2.

the graph

to

The

definition
is

makes

no
X

provision
defined

edges. This
without

why

matrix

was

for parallel for graphs

parallel

tSome

authors
the

equal to
parallel

number

(see Busacker and Saaty [1-2], page 109, for i and j, and of edges incident on both vertices

define Xij as example) thus take into account

edges.)))

SEC.

7-9)

ADJACENCY

MATRIX)

159)

3.

If the graph

has no

(and self-loops

no

parallel

edges,
the

degree of
or column

a vertex

of X.

equals

the number

of l's

of course), the
row

in

corresponding

4. Permutations
ing the

reorderof rows and of the corresponding columns imply 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 be interchanged. also Hence two and

graphs Gland G2 with no parallel edges are isomorphic if their adjacency matrices X(G1) and X(G 2) are related:)

only

if

X(G 2)
where

R-l.X(G

1 ).

R,)

R is

a permutation matrix.
disconnected
matrix

5.

graph

G is

and is
X(G)

in

two

components

gland

g2

if and

only if its

adjacency

can

be partitioned

as)

X(C} =
[\037\037lL+-X(\037\037jl)

where
that

of

X(g 1) is the adjacency the component g2.


partitioning

matrix

of

the

component

gland

X(g 2) is

This
any

clearly

implies
any

that

there exists no g2.

edgejoining

vertex

in subgraph
square,

gl to

vertex

in subgraph

6. Given any
always
that

symmetric,

binary

construct
is the x:

a graph G of n vertices adjacency matrix of G.


multiply

matrix Q of order n, one can (and no parallel edges) such


matrix of the matrix X2, is in the ring of

Powers

of

Let us
Fig.

by

itself

the 6

by

6 adjacency

simple graph in
shown

7-7.

below

(note
not

that

another 6 by 6 symmetric this is ordinary matrix multiplication


The result,

integers and

mod

2 multiplication):)

3
1

0
1 1

3
1

3
1 1

2 I
I

2
1

0
X2=

3
1

0
I I

4
1

2
2)

0
The

2
entry

value =

of an number of
of

off-diagonal l's in the dot


positions

in X2,

that is,
ith

ijth

entry

(i

* j)

in

X2,

row) of X.
number

product

of

row

and

jth column
rows
ith

(or jth
l's.

in which both
are

ith

andjth

of
and

have

= number

of vertices that

adjacent

to both

and
ith

jth

vertices.
jth vertices.)))

= number

of different

paths

of length

two between

160)

MATRIX

REPRESENTATION

OF GRAPHS)

CHAP.

7)

the ith diagonal Similarly, X. Thus (or column) of matrix the degree of the corresponding

Sincea matrix

commutes

in X2 is the number of I's in the ith row the value of each diagonal in X2 equals entry if the graph has no self-loops. vertex, with matrices that are its own power,)
entry ==

X.X2
And

X2.X

== X3.)

since

the product
matrix,

of

two

square

symmetric
matrix.

matrices
(Again

also a
The

symmetric

X3 is

a symmetric

that commute is note that this is

an ordinary
matrix

product and not mod 2.) X3 for the graph of Fig. 7-7 is)
2

3
I

2
8

7 6
5
I

7 4
3
X3==
I

2
0

8 7
2
0)

7
6
Let

5 I 8 4 2 0 7 2
entry

us now entry

consider the
==

ijth

of X 3.)
X2

ijth

of X3

dot
X.) n

product

of ith row

and

jth

column

(or row)

of

==

\037 k=1) n

ikth

entry of
ith

of X2. kjth

entry

of X.

==

k=1

\037

number

all different
to jth

edges from
==

vertex

edge sequencest via kth vertex.


three

of

three

number

between

of different ith and jth


the

edge seq uences of vertices.) on


X3

edges

For example, considerhow 7-7 is formed. It is given by the


row
I

1,5th entry dot product)


==

for

the

graph

of Fig.

of

X2. row

5 of

(3,

I, 0, +
I

== 3

3, I, 0). (I, I,0, I,0,0) -t- 0 -t- 3 + 0 + 0 == 7.)


edges

These

seven different [e p

edge sequencesof
e 2 }, [e 2 , e 2 , e 2 },

three

between

VI

and

V s are)

el ,

{e 6 , e 6 , e 2 },

[e 2 , e 3, e 3},

[e6 ,
t An first

e 7 , e s },

[e 2 ,

e s , e s},

[el' e4 ,

e s }.)

edge sequence is a sequence of edges in which each edge (except, of course, the 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 once in an edge sequence.))) edge may appear more than

SEC. 7-9)

ADJACENCY

MATRIX)

161)

Clearly

this

list

incl

udes

all the paths


e s }.

of length

three

between

vI

and

v 5'

that is,

{e6 ,
entry

e 7 , e s } and

rei' e4 ,

It is left as an exercise for the reader to show (Problem 7-19) that the iith 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 result that includes the properties of X, X2, and X 3 discussed general so far is expressed in Theorem 7-8.) THEOREM 7-8

Let
is the

be

number

the adjacency matrix of a simple of different edge sequences of

graph

G. Then

the
vertices

ijth

entry 1'i and

in Xr v j.)

r edgesbetween
has

It

can

in

holds for r = I, and it for any positive integer r, by In other words, assume that it holds for r of the relation) X, with the help
Proof.

The theorem

been

proved for r
then

=--= 2

and

3 also.
entry

be proved

- 1,and

induction.

evaluate

the

i}th

Xr

-= Xr- I . X,)

as was

done for
rest

X3.)

The

of the
A

proof is

left

as

an exercise

(Problem

7-17).)

COROLLARY

In a connected is k,
if

and

only if k

graph, the distance is the smallest integer


result

between

two vertices Vi and v j (for i \"* for which the i, jth entry in Xk is nonzero.

j)

This is
of vertices.)

useful

in determining

the distances

betweendifferent

pairs

COROLLARY

If X is

the adjacency matrix


Y =

of

a graph
Xn-I,)

with

n vertices,

and)

X +

X2

X3 +
if

... +
only

(in

the ring

of

integers),)

then

G is

disconnected

and

if there

exists at least one

entry

in

matrix

that is

zero.)
Between
its

Relationship

self-loops,
Likewise, information

incidence

A(G) matrix

and X(G): Recall that A(G) contains all the


adjacency

if G

has no

parallel edges, its

if a graph G has no information about G. matrix X( G) contains all the

G has neither nor parallel self-loops G is a both and contain the entire inedges (i.e., simplegraph), A(G) X(G) formation. Thus it is natural to expect that either matrix can be obtained is directly from the other, in the case of a simple graph. This relationship
about

G. Therefore,

if a graph

given in Problem

7-23.)))

162)

MATRIX

REPRESENTATION

OF GRAPHS)

CHAP.

7)

SUMMARY)

The

theory
The

of matrices
of matrices

has been
in studying

brought

to

bear

upon

the theory of
demonstrated

graphs.
in this

use

graphs has been amply

chapter.

We have seenthat there are several matrices which can be associated with matrix A and the adjacency matrix X, graphs. Two of these, the incidence a simple graph completely,that describe Two others, is, up to isomorphism. B and the cut-set matrix the circuit matrix some important features C, display 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 C C C out submatrices and matrices, pulled c' and Af' Bf' f , IJJ' In-I' Bp Bc, 1, 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.

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, B satisfy so that what conditions must a given matrix a graph can be found whose circuit matrix is B, is very useful and interesting. We shall encounter
The
this

problem

of realizability

again

in

Chapter

12.)

REFERENCES)
in this chapter. For those of elementary matrix algebra was assumed with matrices, dozens Out of these we have listed of good books are available. and somewhat two, special results, the Binet-Cauchy theorem [7- t] and [7-3]. Two A and B, respectively. are explained and proved in Appendices law of nullity, Sylvester's have some portion devoted to matrices referred to earlier Most textbooks associated recommended with graphs. Particularly readings are Chapter 13 of Harary [1-5], Chapter 4 5 of Busacker and Saaty [1-2]. Gould's paper and of Seshu and Reed [1-13], [6-4] Chapter to this chapter. A survey referred to in the last chapter is also relevant by Harary paper [7-2] proves someof the results given in this chapter. 7-1. AITKEN, A. C., \"Determinants and Matrices,\" 9th ed., Oliver & Boyd Ltd., Edinnot

Some knowledge
familiar

burgh,

1956.

7-2.

7-3.

HARARY, F., \"Graphs and F. E., Elementary HOHN,

Matrices,\" SIAM Rev., Vol. 9, Matrix Algebra, The Macmillan

No.1,

Jan., 1967, 83-90. Company, New York,

1958.)

PROBLEMS)

7-1.

Write

the

incidence

4-1(b). Put the incidence form of Eq. (7-I).)))

matrices for the matrix of

labeled
the

graph

simple graphs shown in Figs. 1-12 and of Fig. 4-I(b) in the block-diagonal

CHAP.

7)

PROBLEMS)

163)

7-2.

7-3.

7-4.
7-5.

Consider the graph in Fig. 4-3. With respect to the spanning tree [b, c, e, h, kJ, write matrices Af, Bf, and Cf in the forms of Eqs. (7-10),(7-5),and (7-9), respecEqs. (7-13)and (7-15). by actual computation tively. Verify Show that for a simple disconnected graph of k components, n vertices, and e edges n - k, e - n + k, and n - k, respectively. of matrices A, B, and Care the ranks Label the edges of the graph in Fig. 4-8, and write down its circuit matrix B. 1-5 made in Section 7-3 about the properties of matrix B. observations Verify

and nonseparable Draw two nonisomorphic, connected, simple, graphs Gland G2, with as small a number of edgesas you can\037 such that the circuit matrices B(G d = B(G2). (Hint: Gland G2 are 2-isomorphic, and must be 2-connected.) network of seven switches-I, 2, 3, 4, 5, 6, and 7-6. A black box containing a switching in Fig. 7-3. The lamp was lit when each 7-was subjected to the experiment shown 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 network the switching configuration. was obtained In Section 7-5a graph circuit 7-7. corresponding to a given fundamental sketch a procedure for obtaining a graph if its fundamental cut-set matrix. Similarly, matrix C f is given. Can you get two different (nonisomorphic) graphs for the same Cf? If yes, how are these different related? graphs the if you were given 7-8. Show that you can determine a graph within 2-isomorphism set of all spanning trees. (Hint: the set of all spanning From trees every cut-set 4-2. And the set of all cut-sets a can be determined, determines using Theorem graph within 2-isomorphism.) 7-9. If the following is the list of all spanning trees of a graph G, deternline G.

[a, c,
fa,

d, e},
d, eJ,

[a,c, d,f},
[b,

[b,

c, d, e},

[b,

c, d,f}, e,f},

c, e,f},
b,

c, e,f},
b,

[a, d, e,f}, [a,


between
b,

[b, d,

fa, 7-10.

[a,

d,f},

e,f}.)

Express the relationship of appropriate matrices.


Characterize Prove

dualism

two planar,

simple graphs

in terms

of

7-11. 7-12.

sin1ple,

self-dual

graphs

in

terms

of their circuit and

cut-set matrices.

that)

- IT B f = [ I ,ul : AT. ] ,) c At
Cf

=At-

.A

f.
in

7-13.

Write down the path matrix P(Vl, V6) for the graph 1-4 in Section 7-8 and Theorem 7-7.
Theorem

Fig.

4-3. Verify

observations

7-14. Prove
7-15.

7-7.
Bf,

X matrices of the complete graph of n vertices. in the 4-8 in Problem having graph Fig. 7-4), write its (as required X. How does the fact that the graph is separable reflect in X? adjacency matrix X of a separable graph, in general. the adjacency matrix Characterize of Theorem the 7-8. 7-17. Complete proof 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? Consider a sum of the (Hint:

Characterize Af,

Cf, and

7-16.

After

labeled

powers

of X.)
each diagonal entry in the corresponding vertex.))) X3 equals

7-19.

Show that
through

twice the number of

triangles

passing

164)

MATRIX

REPRESENTATION

OF GRAPHS)

CHAP.

7)

7-20.

Prove

that

the

number

of spanning

trees in
A\037),

a connected

graph equals the

value

of

det(Af'
where

Af is the
out

reduced incidence
in the real
field

matrix and matrix,

are carried

of the graph, and not mod 2.

the arithmetic

operations

7-21.
7-22.

Similar

graph,

to the circuit or cut-set and observe some of

define a spanning-tree matrix


and

for a connected

its

properties. let C(x, y) be the cut-sets with respect cut-set matrix Cf of

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

7-23. For a labeled graph G of n vertices, define an n by n diagonal matrix D (called the in D equals the degree of the the ith diagonal entry of G) such that degree matrix A another ith vertex in G. Define matrix E, obtained from the incidence matrix column of G by arbitrarily replacing one of the two l's in every by a -1. Show if G is a simple, connected graph the following holds (the computations are in that and not mod 2): the ring of integers

(a) E.ET
(b)

X.

All cofactors

of

the

matrix

are

7-24.

trees in G, where X is (c) Each cofactor of D - X equals the number of spanning of G. as usual the adjacency matrix Use the result obtained in Problem 7-23(c)to prove Cayley's formula (Theorem

equal.

3-10).

7-25.

7-26.

G, and P(x, y) y be a pair of vertices in a simple nonseparable graph that every circuit in G is obtained corresponding path matrix of G. Prove as a mod 2 sum of two rows of P(x, y). From this result, prove that a path matrix the graph within determines in a simple, nonseparable graph 2-isomorphism. categories: (1) r passes through [Hint: Every circuit r in G falls in one of three neither x nor y; or (3) r passes either both x and y; (2) r passes through through x or y. Considerall three cases, and use Theorem 4-11.] for a connected, self-loop-free graph Prove that Wr and Ws are G, subspaces of WGover GF(2) if and only if the number of spanning complements orthogonal
Let

x and

be the

trees in

G is odd.

[Hint: Define a
C
fB\037

new

e bye

matrix

[\037\037J.

Compute

det(MMT),

using the identity A). Show that spanning trees.])))

det(MMT)

and the Binet-Cauchy theorem = 1 (mod 2) if and only if G has an

= 0, fC\037

(see Appendix odd number of

COLORING,
8)

COVERING,

AND

PARTITIONING)

and are asked to n vertices you are given a graph G with such same color. What that no two vertices the have paint adjacent is the minimum of colors that you would require? This constitutes number a coloring Having painted the vertices, you can group them into problem.
Suppose

that

its

vertices

different set consisting of bl ue, and so sets-one of all red vertices, another forth. This is a partitioning The of and can, coloring problem. partitioning In the case of a planar of a graph. course, be performed on edgesor vertices one may even be interested in coloring the regions. These are the types graph,

to be considered in this chapter. we came across the subject the edges of a given of partitioning a spaninto sets with some specified properties. For example, finding graph the edges into two. ning tree in a connected graph is equivalent to partitioning sets-one set consisting of the edges included in the spanning tree, and the cirother consistingof the remaining edges. Identification of a Hamiltonian cuit (if it exists) is another partitioning of the set of edges in a given graph. The coloring and partitioning of vertices (or edges) is not performed out
of

questions

Earlier

as it may appear from this of mere playfulness, introduction. Partitioning such as coding theory, partitioning practical problems, applicable to many machines.) of sequential of logic in digital computers, and state reduction

is

8-1.

CHROMATICNUMBER)
Painting

all the
the

verticeshave
coloring) of

same

vertices of a graph with colors such color is called the proper coloring
graph

that
(or

no two adjacent
sometimes

simply

a graph. A

in which

every vertex

a color) has been assigned

165)))

166)

COLORING,

COVERING,

AND PARTITIONING)

CHAP.

8)

VI

Red)

VI

Red)

VI

Red)

V3

Vs

V3

Vs

V3

Vs

Green)

Y cllow)

Green)

Yellow)

Yellow)

Yellow)

(a))

(b))

(c))

Fig.

8-1

Proper colorings of a

graph.)

according

to a

given graph
three The

can be properly
proper coloring

proper coloring is
colored

called a properly
in many

colored

graph.

Usually

different ways. Figure

8-1shows
the

different proper

colorings which
A

of a graph. is of interest
graph

to us is one

that

requires

number of colors. proper coloring, and no less, K is called the chromatic number 8-1 is 3-chromatic.
minimum

G that G.

requires
verify

K different

colors
the

for its
number

is called
of

a K-chromatic graph, and


You can
that

the

graph

in Fig.

How we

In coloring graphs there


color

is

no

vertices

in one

graph component of a disconnected

point

in considering

disconnected graphs.
has to

no in-

effect on the

coloring of the other components. vestigate coloring of connected graphs only. vertices can be replaced a single edge by
be

Therefore,
All
without

it is edges

usual

parallel

between two
adjacency
we

affecting

of
need

vertices. Self-loops must to consider only simple,

disregarded. follow

Thus

for coloring

problems

Someobservations
I.

connected graphs.
directly

that

from the definitions just introduced

are)

A graph
A

consisting of
with

only

isolated

vertices

is I-chromatic. of course) is at

2.

graph

one or

more edges (not


bichronlatic).

a self-loop,

least
are

2-chromatic(alsocalled
3. A

of n vertices graph containing at least r-chromatic. For instance, least 3-chromatic.


adjacent.

complete graph Hence a

is n-chromatic,
a complete every

as all
graph having

its

vertices

graph

of r vertices is a triangle is at

4.

graph

consisting

of simply

one circuit

with

> 3

vertices is

2-)))

SEC. 8-1)

CHROMATIC

NUMBER)

167)

chromatic
numbering

if n is

odd vertices
have

2, vertices], and another


have

the same
will

and

even and 3-chromaticif n is odd. (This can be seen by . . . , n in sequence and assigning one color to to even. If n is even, no adjacent vertices will color. If n is odd, the nth and first vertex will be adjacent a third color for proper the same color, thus requiring

coloring.))
Proper
with

the

coloring minimum
yet

of a given graph is simple enough, number of colors is, in general,


been

but

a proper

a difficult

there has not


course,

found
method

a simple
of
in

way

of

characterizing

coloring task. In fact, a K-chromatic

graph. (The brute-force


always

be applied,

as

is highly
types

unsatisfactory,

because

all possible combinations can, of But brute force combinatorial any problem. it gets out of hand as soonas the size of the using
Chromatic
the

graph increases
of

beyond a few
will be

vertices.)

numbers

of some

specific

graphs
8-1)

discussed' in

rest

of this

section.)

THEOREM

Every

tree

with

two

or more vertex color

vertices is 2-chromatic.)

vertex

v in the given at tree T. Consider T as a rooted tree 1. Paint all vertices adjacent to v with color 2. Next, the vertices 2) paint adjacent to these (those thai just have been colored with till every vertex in T has been painted. (See process using color 1. Continue this Fig. 8-2).Now in T we find that all vertices at odd distances from v have color 2, v have color 1. v and vertices at even distances from while in T the vertices are of alternating colors. Since there is Now any path along vertices one and only one path between any two vertices in a tree, no two adjacent two colors. T has been properly colored with One color have the same color.Thus not have been enough (observation 2 in this section). would .)

Proof: Select
v. Paint

any

with

Though a
utilities

tree is 2-chromatic,
for

not

every

2-chromatic
What

graph,

instance,

is not a

tree.)

then

is the

graph is a tree. (The characterization)

Fig. 8-2

Proper

coloring

of a

tree.)))

168)

COLORING, a 2-chromatic

COVERING,

AND PARTITIONING)

CHAP.

8)

of

graph?

Theorem 8-2 (due to

Konig)

characterizes

all

2-

chromatic
THEOREM

graphs.)
8-2)

A graph

with at least

of odd length.)
Proof:

one edge is 2-chromatic

if and

only

if

it has

no circuits

be a connected graph with Consider circuits of only even lengths. tree T in G. Using the coloring procedure and the result of Theorem 8-1, let us properly color T with two colors. Now add the chords to T one by one. Since G had no circuits of odd length, the end vertices of every chord being replaced are differently colored in T. Thus G is colored with with no adjacent two colors, vertices having the same color. That is, G is 2-chromatic. if G has a circuit of odd length, we would need at least three colors Conversely, for that circuit (observation 4 in this section). Thus the theorem. .) just
Let G a spanning
An

upper

limit

on the
left

chromatic
an exercise

number

of

a graph

is given

by

Theorem

8-3, whose
THEOREM

proof is
8-3)

as

(Problem 8- I).)

If d max is the maximum

degree of the
number
upper vertices.

vertices

in a graph
1

G,)

chromatic

of G <
bound In

d max

.)

Brooks

[8-1]

showed

that
+

this I

complete graph of dmax

can be improved that case)


of

by

if G

has no

chromatic number

< dmax

.)

A graph G is called bipartite if its vertex set V can be decomposed into two disjoint subsets V t and V 2 such that every edge in G joins a vertex in V t So are the graphs in with a vertex in V 2' Thus every tree is a bipartite graph. 8-8. no 8-6 and a can have self-loop. A set of Obviously, bipartite graph Figs. be between a of vertices can all replaced with one edge parallel edges pair

without
Clearly,

affecting bipartiteness
every

of a graph.
Vt
and

2-chromatic

graph
subsets

is bipartite

because the
that

coloring

partiin

tions
V 1 (or one

the vertex
V 2) are trivial

set into

two

V 2 such

no two

vertices

adjacent. Si milarly, every bi partite graph is 2-chromatic,with with no a graph of two or more isolated vertices and exception;
I-chromatic.
concept, p disjoint
in

edges is bipartite but is I n generalizing this can be decomposedinto G joins the vertices in if and only if) p-partite

a graph

the

subsets subset. same <

G is called p-partite if its vertex set V l' V 2' . . . , V p' such that no edge is Clearly, a K-chromaticgraph

po)))

SEC. 8-2)

CHROMATIC

PARTITIONING)

169)

With

this qualification,

the results
graphs

of this

section

on K-chromatic

graphs

are applicableto K-partite


8-2.
A

also.)

CHROMATIC
proper

PARTITIONING)

coloring

tices into
the

different

subsets.

a partitioning of a graph naturally induces of the verFor example, the coloring in Fig. 8-1 (c) produces

partitioning)

[v p V4 },

[v 2 },

and

{v 3, v s}.)

a subset in any of these three subsetsare adjacent.Such No two vertices of vertices is called an independent set; more formally: A set of vertices in a graph is said to be an independent set of vertices or an independent set (or an internally stable set) if no two vertices in the simply set are adjacent. For example,'in Fig. 8-3, {a, c, d} is an independent set. A in any graph constitutes an independent set. vertex single A nlaximal stable set (or maximal internally independent set) is an indewhich no other its vertex can be added without destroying property. The set [a, c, d, f} in Fig. 8-3 is a maximal indepenset. The set [b, f} is another maximal dent set. The set {b, g} is a independent third one. From the preceding example, it is clear that a graph, in general, has many maximal independent sets; and sizes. be of different they may all maximal independent sets, one with the largest number of vertices Among

pendent set to
independence

is often of particu
Suppose

lar

interest.

that the graph in Fig. 8-3 describes the following problem. Each of the seven vertices of the graph is a possible codeword to be used in some communication. Some words are so close in sound) to others that they (say, be confused for each other. Pairs of such words that may be mistaken might for one another are joined for a words by edges. Find a largest set of code reliable communication.This is a problem of finding a maximal independent set with number of vertices. I n this simple largest example, [a, c, d, f} is an
answer.)

f)

a) h)

g)

Fig.

8-3)))

170)

COLORING,

COVERING,

AND PARTITIONING)

CHAP.

8)

The number of vertices in the independence number (or

the

largest

independent

set of a graph

G is

called

Consider a
different
cannot

K-chromatic

of internal stability), coefficient G of n vertices properly graph

peG).

colors.
exceed

Since the largest number of vertices in G with the same the independence number peG), we have the inequality)
peG)

colored with K color

>\037.

-K)

Finding a
maximal
in

Maximal Independent
set
in

Set:

A reasonable
will

the

set.

independent Add more


any

a graph
the

G
set,

be

to start

vertices to
of those

selecting

a method of finding with any vertex v of G at each stage a vertex that

is not produce
maximal

adjacent to
independent

already

selected. This
set,

procedure will
is not

ultimately

a maximal

independent set. This


set with,a

however,

necessarily a

largest number
A

of vertices.
(but

Finding

All

Maximal

Independent Sets:
for

reasonable

not very effici-

ent for
any

large graphs) method


can be
in

obtaining

all maximal

arithmetic Boolean developed using be treated as Let the logical (or a Boolean variable. graph sum a b the denote of a or b or both; vertex + Boolean) operation including let the ab the both verdenote of logical multiplication operation including tices a and b, and let the Boolean complement that vertex a is not a' denote graph

independent sets in on the vertices. Let

each vertex

the

included. For a given


not

graph

G we

must

find

a maximal

subset

of vertices

that

does

verticesof any edge in G. Let us expressan edge (x, y) as a Boolean product, xy, of its end vertices x and y, and let us sum all such products in G to get a Boolean expression)
include

the two end

rp

1:

xy)

for

all (x,

y)

in

G.)

Let us
it

as

a sum

further take the Booleancomplement of Boolean products:)


rp'

rp' of

this expression,

and express

11 +

f2 +

. . . + Ik.)
and
only

0 (logically false), is possible if and only if at if each if and only vertex appearing in ;:. least one /; = 1, which is possible set of G. Thus each/; the vertex (in complemented form) is excluded from will set will a maximal yield independent independent set, and every maximal
A vertex
maximal

set is

independent if rp'

set if

if rp =

which

is possible

if and

only

(true),

which

example.

be produced by this method. For the graph G in

This
Fig.

procedure
8-3,)))

can be

best explained

by

an

SEC. 8-2)

CHROMATIC

PARTITIONING)

171)

rp

ab +

bc +

bd +

be

ce +

de + ef +

eg + fg,

rp'

(a' +

b')(b' -f- c')(b'


f')(e'

(e'
Multiplying

c' + e')(d' + e') + d')(b'+ e')(


+ g').) the
aa
usual

-f-

-t- g')(f'

these
as)

out

and employing

identities

of Boolean

arith-

metic, such

a,)

a +

a =
ab

a,

a
we
get)

-t-

= a,)

'I' = b
rn'
Now

' '
e

'

--

b eg

' , , ' t- ac

'

d ' e 'f

'' ' + ac

'

eg

' '

, c d 'f 'g.)
maximal

if we

exclude
terms,
are)

these five

we get

from the vertex a maximal


acdg,

set of G vertices appearing independent set. The five


bg,

in anyone of inde-

pendent sets

acdf,

bf,

and

ae.)

Theseare all
Finding

the

maximal

independent
and

sets of the

graph.

Once all the maximal find have been we the size of the one with obtained, independent the the number of vertices to number largest get independence P( G). The in number the 8-3 is four. of independence Fig. graph To find the chromatic find number of G, we must the minimum number of these (maximal which include all the versets, independent) collectively tices of G. For the graph in Fig. 8-3, sets [a, c, d,f}, {b,g},and [a, e}, for this condition. Thus the graph is 3-chromatic. example, satisfy
Independence

Chromatic

Numbers:

sets

of G

ChromaticPartitioning: Given a simple, connected graph G, partition all verticesof G into the smallest possible number of disjoint, independent sets.
This

is perhaps the chromatic partitioning of graphs, of important problem graphs. all maximal By enumerating independent sets and then selecting the smallest number of sets that include all vertices of the graph, we just solved this The of the graph four are some chromatic problem. following partitions
problem,

known

as the

most

in partitioning

in

Fig.

8-3,

for example.)

{(a, c, d,f),
{(a,
f(c,

(b,g), (e)},
(e)},
(a, e)},

c, d,
d,f),

g), (b,f),
(b, g),

f(c, d, g), (b,f), (a,e)}.)))

172)

COLORING,

COVERING,

AND

PARTITIONING)

CHAP.

8)

V3)

V4)

Fig.

8-4

A 3-chromatic graph.)
enumeration

This

method

of chromatic
A

partitioning inefficient

(requiring and

of all

maximal
mentation

independent sets) is
is proposed Colorable

needs

prohibitively

large

amounts of computer memory.


in [8-6].
Graphs:
in Uniquely

more

efficient

method for computer


only

imple-

A graph
Fig.

that

has

is called colorable properties

a uniquely colorable but the one graph,


of uniquely

graph. The graph in


8-4 is

Fig.

one chromatic 8-3 is not a


to

partition uniquely

(Problem 8-2). For some interesting

colorable graphs, the

reader is referred

Chapter

12

of [1-5].
related to that of the independent set and chromatic partitionnext. dominating set, to be discussed A dominating Sets: set (or an externally stable set) in a graph Dominating G is a set of vertices that dominates sense: every vertex v in G in the following v is included in the dominating set or is adjacent to one or more verEither in the dominating set. For instance, the vertex set {b, g} is a tices included a dominating set. A set in Fig. 8-3. So is the set {a,b, c, d,f} dominating set need not be independent. For example, the set of all its verdominating a dominating set in every graph. tices is trivially minimal sets In many one is interested in finding dominating applications defined as follows: set from A minimal which no vertex can be set is a dominating dominating its dominance property. For example, in Fig. without removed destroying set. And so is {a, c, d,f}. Observations 8-3, {b, e} is a minimal dominating
A

concept

ing is the

that

follow

from

these definitions are)


vertex

1. Anyone
set.

in

a complete

graph constitutes
at

a minimal

dominating

2. Every

dominating set contains


may

least

one minimal
sets,

dominating set.
and

3. A

graph

have

many minimal

dominating

of

different)))

SEC. 8-2)

CHROMATIC

PARTITIONING)

173)

sizes. [The
of

a graph minimal

in number of vertices G is called the domination

the

smallest
number,

minimal dominating
a( G).]

set

4.

may not be independent. 5. Every maximal independent set is a dominating set. For if an indethe graph, there is at least one vertex pendent set does not dominate in the set. Such a that is neither in the set nor adjacent to any vertex its invertex can be added to the independent set without destroying set could not have been maxdependence. But then the independent
A

dominating

set mayor

imal.

6. An

independent
set.
independent graph G,)

set has the


Thus

dominance
independent

property
dominating

independent
maximal

an
set.

only if it is set is the

a maximal same as a

7. In

any

a(G)
Finding

< peG).)

Sets: A method for obtaining all minimal Dominating in a graph will now be developed. The method, like the one all maximal for arithmetic. finding independent sets, also usesBoolean To dominate a vertex Vi we must either include Vi or any of the vertices this for every vertex Vi is condition adjacent to Vi. A minimum set satisfying a desired set. Therefore, for every vertex V i in G let us form a Boolean product . . . of sums the vertices + Vi,)' where Vii' Vi2 ' . . . , Via are (Vi + Vii + Vi2 -1adjacent to Vi' and d is the degree of Vi:)
Minimal dominating

sets

() =

II

(Vi

Vii

-+-

V i2 -1- . . . + of

Vi,))

for

all Vi in G.)
in

When () is expressed as a sum minimal dominating Let set. Fig. 8-3:


the Consider

products,
this

each

term

it

will

us illustrate
()

algorithm

using

represent the graph

of

following

expression +

for

Fig.

8-3:)
b

() =

(a +
b

b)(b

e +

d+ e
g)(/+

+ a)(e+
e +
x,)

e)(d + b

+ e)

(e +
Since

-t- e -f-- d -+-1+

g)(g + e + I).)

in Boolean
() =

arithmetic
(a +

(x +

y)x =

= ae +
Each dominating

b)(b + e +
be

+
in

bl + bg +
the

e)(b+ d + e)(e + aedl + aedg.)


expression
example.)))
this

I +

g)
a

of the set.

six terms
Clearly,

a( G)

=- 2, for

preceding

represents

minimal

174)

COLORING,

COVERING,

AND PARTITIONING)

CHAP.

8)

8-3.

CHROMATIC

POLYNOMIAL)

In general, a given G of n vertices can be properly in many colored graph different ways using a sufficiently large number of colors.This property of a of a polynomial. This polynomial is graph is expressed elegantly by means called the chromatic of G and is defined as follows: polynomial The value of the chromatic polynomial Pn(J..,) of a graph with n vertices the number of of the gives ways coloring properly graph, using J.., or fewer
colors.

Let ci be the different ways of properlycoloring G using colors. Since i colors can be chosenout of J.., colors in)
J..,

exactly

i different

different

ways,

i.

there are out of


than
J..,

Ci

different ( \037)

ways

of properly

coloring G using

exactly

i colors

colors.

Since

i can

be any
on
n

positive

n colors
is,)

vertices),

from integer the chromatic

1 to n (it is not possible to use more polynomial is a sum of these terms;

that

Pn(l)

ii1
_

Ci(\037)

-.! II!

C2

J..,(J..,
I

- 1) + c3 J..,(J.., 2!
n.),

1)(J..,3!

2) +

...

+ cn J..,(J..,
Each Ci
any and

)(J..,

2) . . . (J.., - n + I) .
the given two

has

to be

evaluated

individually

for least

graph therefore)

with

even one

edge requires at
CI =

colors

graph. For for proper

example, coloring,

o.)

A
in

graph
n!

with n vertices and that

using

n different

colors

can be

properly colored

ways;

is,) C n
= n!.)

As an illustration, in Fig. 8-4.


'1 P 5 (A )

let

us find

the chromatic polynomial


J..,(J..,

of the

graph

given

CIA +

'1

C2

J..,(J..,

I) +

C3

1)(J..,3!
C5
J..,(J..,

2)
I

J..,(J.., + C4

1 )(J..,

- 2)(J..,
4!

3) +

)(J..,

- 2)(J..,
5!

3)(J..,

4) .)))

SEC. 8- 3)

CHROMATIC

POLYNOMIAL)

175)

Since the graph


different

in

Fig.

colors

for

proper
C 1

8-4 has a triangle, coloring. Therefore,)


= C2 =

it

will

require

at least

three

and
that

Cs =
we

5!.)
three
VI' V 2 , and

Moreover,

to colors ways.

evaluate can

c 3'

Thesethree
different

suppose

have

vertex
v 2

s must

be assigned properly to vertices done that, we have no more Having have the same color as V 3 , and V4 must
=

colors x, y, and z. V 3 in 3! = 6
left,

choices

because

have

the same

color as

. Therefore,)
C3 6.)

Similarly,

with

four colors,

vI'
color

v 2

' and

24 different ways.
two

The

fourth

can

be properly colored in 4.6 = be assigned to V 4 or v s , thus providing


V 3 can
choice.

choices.

The

fifth vertex

provides no additional
c4 =

Therefore,)

24.2 =

48.)

Substituting

these

coefficients
A(A

in Ps(A), we

get, for the graph


-

in

Fig.

8-4,)

PS(A) =
=
The

A(A

1)(A 1)(A

2) + 2A(A I)(A - 2)(A 2 2)(A -

3)(A 5A +

1)(A 4)

2)(A

3)

A(A

7).)

presence

of factors
polynomials reader

A-I
have

and

2 indicates
in

that

is at

least 3-

chromatic.
Chromatic

been studied

great
more

detail
thorough

in the

literature.
of

The interested colorful world


THEOREM 8-4
A IS)

is referred

to [8-5] for
8-6

discussion

their properties.
of

Theorems 8-4,8-5, and


chromatic

should

provide

a glimpse into the

polynomials.)

graph

of n

vertices is a complete graph


Pn(A)

if and

only
-

if

its chromatic

polynomial)

= A(A

- l)(A

- 2) . . . (A
ways
properly ways,

n +

1).)
any

Proof: With
of a graph. third in A ways A

A colors, second

vertex

there are A can be


fourth

different

of coloring
in . . . , and

selected

vertex
the

colored
A

exactly

A-I
in

ways,

2 ways,

the

in

- 3

the nth

A and

- n + 1
only if

if and

only

if

every

vertex

is adjacent to every

other. That is, if

the graph is
THEOREM

complete. .)
graph is a

8-5)

An n-vertex

tree if

and

only = A(A

if its

chromatic

polynomial)

Pn(A)

l)n-l.)))

176)

COLORING, That

COVERING,

AND PARTITIONING)

CHAP.

8)

Proof:

the theorem holds for

as an exercise to
THEOREM

prove

the

theorem

1, 2 is immediately evident. by induction (Problem 8-9).)


n

It

is left

8-6

Let a
by by

and b be two

nonadjacent

vertices
and

adding fusing

an edge between the vertices a and


Then)

b.

Let

b together

in a graph G. Let G'be a graph obtained G\" be a simple graph from G obtained and replacing sets of parallel with edges

single edges.

Pi).,)

of G

= Pn().,)of
of

G' + Pn - 1 ().,)
coloring
same

of

G\".)

Proof:

The

number
that

of

ways

properly

cases,

one such
that

vertices colors.

a and

b are

of the
number

color

G can be grouped into and the other such

two

that

a and b

are of different
a and

Since

the number

such
and

b have

different colors
coloring

of ways
of ways

of properly coloring of properly coloring b have

G',

number

of ways

of

properly

G such that

and

the same color)

\\ ,)

/)
,\"
/

\037

I\037 ,-.....
/\\)

/-\037)

\\

\037\037)
;\\(;\\

- I) (;\\ - 2) (;\\ - 3) (;\\ - .4)

;\\(;\\

- 1) (;\\ - 2) (;\\ - 3))

A(;\\

- I) (;\\ - 2) (;\\ - 3))

;\\(;\\

- I) (;\\ - 2))

15 (A) of

G=

A(A

- 1)

(A

- 2) +
(A

2A(A

1)

(A

- 2) - 3)

(A

- 3) - 4)

+A
=
Fig.
A

- I)
(A 2

(A

- 2)

(A

(A

(A

- 1)

(A

2)

- SA +

7))

8-5

Evaluation of a

chromatic

polynomial.)))

SEC. 8-4)

MATCHINGS)

177)

= number

of

ways

of properly

coloring

G\",)

Pi).,)

of G

= Pn().,)of

G' + Pn - t ().,)
the the

of

G\".

.)

8-6 is often used in evaluating For how graph. example, Fig. 8-5illustrates
Theorem
G is
The graph

chromatic chromatic

polynomial polynomial

of a of a

expressed
pair

as a

sum

of

the chromatic

graphs.

of nonadjacent

polynomials of four complete vertices shown enclosed in circles is the one

used for reduction at that stage. In the last three sections we have been concerned with proper coloring of in a graph. Suppose that in coloring the edges the vertices we are interested rather than the vertices. It is reasonable to call two edges adjacent if they have one end vertex in common (but are not parallel). A proper coloring of edges 1hen requires that adjacent results Some colors. edges should be of different 8-1 and in Sections on proper coloring of edges, similar to the results given 8-2, can be derived (Problem 8-19). to an a set of edgesin which no two are adjacent is similar Moreover, subset the of vertices.Such a is called a set of matching, independent edges

ject of
8-4.

the

next

section.)

MATCHINGS)

Suppose

that

four

applicants

a p a2 ,
and

a 3'

and a 4
a

are

available

positions PPP2' P3' P4' Ps, P6. Applicant or Ps- Applicant 02 can fill P2 or PS. Applicant a 3 is qualified for PPP2' or is fill can This situation or by represented jobs P2 PS. P3,P4' P6. Applicant 04 the graph in Fig. 8-6. The vacant positions and applicants are represented by
vacant
t is qualified

to fill six to fill posi-

tionp2

vertices.

The

edges

represent

the qualifications

of each applicant
..-- -- ........) ........ \"\"

for

filling)

/ /

/ /,----, a
l
a2)

\" \"

PI P2 p) P4 Ps

'\\ \\ \\\\ \\ \\ I I

/
I I \\ \\ \\ \\ \"'-)

a))

, /

VI

v2

a4

---)
........

P6 ---)
tions)

_/

Applicants) Fig.

Posi 8-6

Bipartite

graph.)))

178)

COLORING,

COVERING,

AND PARTITIONING)

CHAP.

8)

(a))

(b)) its

Fig.

8-7

Graph and two of

maximal

matchings.)

different
sets

VI

The questions
to hire all

= fa I'

the vertices positions. The graph clearly is bipartite, a 2 , a 3, a 4} and V 2 = {PI' P2' P3' P4' Ps,P6}' one

falling

into

two

is most

the applicants

likely to ask in this and assign each a position

situation
for

If toe answer is no, what is the maximum number of filled from the given set of applicants? This is a problem of matching of one set of vertices into (or assignment) another. More formally, a matching in a graph is a subset of edges in which no two edges are adjacent. A single edge in a graph is obviously a matching. A maximal to which no edge in the graph can be matching is a matching added. For example, in a complete graph of three vertices (i.e., a triangle) The edges shown by heavy lines in any single edge is a maximal matching. differFig. 8-7 are two maximal matchings. Clearly, a graph may have many ent maximal sizes. these, the maximal matchings, and of different Among maximal matchings with the largest number of edges are called the largest In Fig. 8-7(b),a largest maximal is shown in heavy lines. matchings. matching in a largest maximal The number of edges is called the matching matching
number
Although

are: Is it possible he is suitable? that can be positions


which

of the

graph.
matching

is defined

for

any

graph, the

it is

context

of bipartite
graph set

In a bipartite of verticesin
incident

graphs, as suggested by
having
1

introduction

mostly studied in the to this section.

into

those

with

every

vertex
in

a vertex partition VI and V 2 , a complete matching in V 2 is a matching in which there is one edge in V 1. In other words, every vertex in V 1 is matched Clearly, a complete matching the converse is not
(if

against

some vertex
matching, existence

V 2.

it exists) set

is a

est maximal For the


must

larg-

whereas of a

necessarily true.
into V 1. In

complete
vertices

have at
must

least as many

be at least as many vacant positions as the number however, applicants are to be hired. This condition, in Fig. 8-6, although F or example, there are six positions and four applicants, a complete matching does not exist. Of the three applicants aI' a2 , and a 4, each qualifiesfor the same two positions P2 and Ps' and thereforeone of the three cannot be matched. applicants This us to another necessary condition for a complete leads matching: in VI must collectively be adjacent to at least r Every subset of r vertices is not))) vertices in V 2 , for all values of r = 1,2, . . . , I VII. This condition

in V 2

matching of set VI as there are in

there

all the

V 2, first we other words, if of applicants is not sufficient.

SEC. 8-4)

MATCHINGS)

179)

in Fig. 8-6. The subsettap a 2 , a 4 1 of three vertices has satisfied tices P2 and P5 adjacent to them. That is also this condition of a complete matching is indeed existence Theorem surprising. and proof of this result.) mal statement
THEOREM
8-7) VI

only sufficient

two

verfor
for-

8-7 is a

matching of every subset of r verticesin for all values of r.)


A complete Proof:

into

V 2 in a bipartite

VI is

collectively

graph exists if and only adjacent to r or more verticesin

if
V2

the necessity of a subset of r applicants collecis immediate and has already been pointed out. Thesufficiency the \"if\" part) can be proved by induction on r, as the theorem (i.e., holds for r = 1. For a complete is referred to Theorem trivially proof, the student 11-1in [8-3], Theorem 5-19 in [4-5], or Chapter 4 in [1-9].)
The

\"only

if\"

part

(i.e.,

tively

qualifying

for

at

least

r jobs)

Let

us illustrate

this

important

theorem Five

with an senators c 3.

example.

Problemof Distinct Representatives: members of three committees, c p c2 ,


Fig.

8-8. One

member
it

from

each

committee.

Is

possible

to send

sp S2' S3'S4'and S5 are The membership is shown in committee is to be represented in a supereach one distinct representative from of the
and

committeest?

This problem is one of finding a complete matching of a set V I into set Let us use 8-7 Theorem and check if r vertices from bipartite graph. are at r to least vertices from V 2 , for all values of r. collectively adjacent VI The result is shown in Table 8-1 (ignore the last column for the time being). Thus matchthe condition for the existenceof a complete for this example the is stated in 8-7. Hence it is to satisfied as Theorem form ing possible supercommitteewith one distinct representative from each committee. A) The one. of distinct problem representatives just solved was a small
V 2 in a
/' ,/

./

--C1

\"-

/
/
I I I \\ \\ \\

........ \"\\

/'

/'

./ --51 52

........ \"

\"

\\
\\ \\ \\ I I I

C2

5) 54

/
/

\\

\"....... ........ ---

C)

./

/'

\"

........ -

55

---)

./

/'

Committees
Fig.

Senators)

8-8

Membership of committees.)
first

tThis

problem,
the

and studied by

English

known as the problem of distinct representatives, was mathematician, Philip Hall, in 1935.)))

formulated

180)

COLORING,

COVERING,

AND PARTITIONING)

CHAP.

8)

VI)

V2)

r-q)

r =

1)

[cd

[51,52J

-I

[C2J
[C3J r=2)

[51,53,54J

-2

[53,54,55J

-2

[Cl,C2J

[51,52,53,54J
[51,53,54,55J

[C2,
r = 3)

C3J

-2

-2

[C3, cd [Cl,C2,C3J) Table

[51,52,53,54,55J

[51,52,53,54,55J) 8-1)
If

-3 -2)
are M

larger
find
most

Theorem

problem would have become unwieldy. 8-7 requires that we take all 2 M the number of vertices of V 2 adjacent
cases,

there

vertices
of

in

VI' and

nonempty

subsets

VI

collectively in any large

to each
Theorem
graph.)

of these.In
8-7

however,

the following
a complete

simplified version of
matching

will

suffice for
THEOREM

detection of
8-8

if)

there

In a bipartite graph is a positive

a complete
integer

m for

matching of VI which the following

into

V 2 exists
condition

if (but not is satisfied:) in V2.)

only

degree of every
Proof:

vertex

in VI > m

> degree of every

vertex

Consider
incident

a subset
on

m. r Since
are

edges
incident

them.
vertex

of r vertices in VI. These Each m. r edge is incident


in set
=
V 2

the degree of every on at least

is no
in

greater
V2.

r vertices have at least to some vertex in V 2 . than m, these m. r edges

(m.r)/ 111

r vertices

Thus
in VI

V 2 . Therefore, into

any subset of r vertices according to


.)

in VI is

Theorem 8-7, there

collectively adjacent to r or more vertices exists a complete matching of

V2 .

In the
degree

bipartite graph of
of every

Fig. 8-8,)
in

vertex

VI

> 2

:?: degree of

every

vertex

in

V 2')

there exists a complete matching. In the bipartite graph 8-6 no such number of Fig. is found, because the = 4 > . of of a degree P2 degree 1 I t must be emphasized that the condition of Theorem 8-8 is a sufficient condition and not necessary for the existenceof a complete It will matching. be instructive that does not for the reader to sketch a bipartite satisfy graph 8-8 and yet has a complete matching Theorem (Problem 8-15). The matching problem or the problem of distinct representatives is also
Therefore,

called the
those
with

marriage real

problem (whose marital problems!)

solution, unfortunately, See Problem 8-16.)))

is of

little use to

SEC. 8-4)

MA

TCHINGS)

181)

If one fails to find a complete he is most likely to be interested matching, in finding a maximal vertices that is, to pair off as many of VI with matching, let us define a new term called those in V 2 as possible. For this purpose, deficiency, \037(G), of a bipartite graph G. A set of V 2. of r vertices in V I is collectively incident on, say, q vertices r - q taken over all values Then the maximum value of the number of r = 1,

2, . . . and
G.

all

subsets

of

V I

is called

the deficiency
of the
and

\037(G)

of

the

bipartite
that

graph

in Theorem 8-7, expressed

terms

matching

in a

bipartite graph G existsif


\037(G)

deficiency, states
only
if)

a complete

<

o.)

For largest

example, number

prepare a table for the deficiency is +

Theorem 8-9
with

a positive

you that of Fig. 8-6, similar to Table 8-1,and verify 1 graph (Problem 8-17). the size of the maximal matching for a bipartite graph gives deficiency.)
is

the deficiency of the bipartite graph in the last column of Table 8-1). It
the

in

Fig.

8-7 is

-1
that

(the

suggested

graph for this

THEOREM 8-9)

The maximal

number

of vertices

in set

VI

that

can be
VI

matched

into

V 2 is

equal to)

number of verticesin
The
maximal

\037(G).)

proof

of Theorem
matching
number

8-9 can
8-6,
vertices

be found
Theorem

in

[8-3],

in Fig.
of

using

page 288. is obtained 8-9,


=

The size of a as follows:)

in

V I

\037(G)

3.)

Matching

and

Adjacency
vertices

Matrix:

Consider a
the in

bipartite

adjacent sets of
respectively,

adjacency

and let n I matrix X(G) of

VI and V 2, having < n 2, n I + n 2 = n,

number

of

number the form)

G with nongraph vertices nt and n 2 , of vertices in G. The

G can be written
X( G)

X I2 0 ----: - -- - -

:
:

[ XI2
where

0)

] containing

the submatrix
which

12 is

the n I

by

tion as to
tices

of

the

nI

vertices

n 2 , (0, of V I are
the

1 )-matrix

the informa-

connected
12 .

to which
graph

of the

n 2

ver-

of

V 2

. Matrix

XI2 is the transpose

of X

its

all Clearly, X 12 matrix.

the information
VI

about

bipartite

G is

contained
in

in

A matching X I2 such that

into

V 2 corresponds

to a

selection of the
has

l's

the

matrix

no

line

(i.e., a row or

a column)

more

than

one].)))

182)
The

COLORING,

COVERING,

AND

PARTITIONING)

CHAP.

8)

matching

exactly one 1

in every

is complete if the n 1 by n 2 matrix made of selected row. For example, the X 12 matrix for Fig. 8-8 is)
51

l's has

52 1 0 0
==

53 54 55 0
1
1

Ct
X 12 == C 2 c 3 [l

0
1

\037l

n 1 == 3,
VI

n2

5,

n=8

and

n 1

<

n 2,

== ==

{c p c 2' {51' 52'

c3}
53' 54' 55}.)
V 1

V2
A

complete

matching

of

into

V 2 is given 52

by)

51

53 54

55)

\037

\037

\037

\037

=::

[\037)

000)
to
in 12

lj

number

A maximal matching of l's from X

corresponds 12 such

that no row
in

according of

which

to Theorem 8-9, are in one row, is


number

matrix
to)

the selection of a largest possible it has more than one I. Therefore, the number of I's, no two largest

equal

of vertices

in

VI

\037(G).)

Matching

problems
problem

the

flow

(see

in bipartite graphs Section 14-5). All

can also be
edges

formulated

in terms

of

are

assumed
sink

to be

of

unit

capacity,

and
of

the problem
flow

of

finding

a maximal

matching

is reduced to the
(also

problem
8-5.
In

maximizing

from

the source

to the

see [8-3]).)

COVERINGS)

a graph

G, a

set g of

cident on at

least

one

be an

edge

covering,

G example, a graph a spanning nected graph forest in an unconnected (or graph) is another circuit (if it exists) in a graph is also a covering. covering. A Hamiltonian interest. We have already Just any covering is too general to be of much trees and))) dealt with some coverings with specific properties, such as spanning

is said to cover G if every vertex in G is inedges a graph G is said to that covers edge in g. A set of edges a covering 5ubgraph, a covering of G. For or simply tree in a conis trivially its own covering. A spanning

SEC. 8-5)

COVERINGS)

183)

(a))
Fig.

(b))

8-9

Graph and two of


this

its

minimal

coverings.)

Hamiltonian

circuits. In
from

section

we shall

investigate
two

the minimal
destroying

coverits

ing-a

covering

which

and ability to cover the graph. In Fig. 8-9a graph are in lines. shown ings heavy be made:) The following should observations

no edge

can be removed

without

of its

minimal cover-

1.
2.

covering

exists

for a graph if and

only

if the

graph

has no

isolated ([xl deof the

vertex.)

A covering
notes

of an n-vertex
smallest

graph will
not less
than

have x.)

at least

[n/2l edges.
covering

the

integer

3.

Every

pendant
covering

edge
contains

in

graph

is included

in

every

graph.

4. 5.

Every If

a minimal

covering.
graph

we

denote

the remaining

edges of a

by

(G

- g),

the

set

of

a covering if and only if, for every vertex v, the degree of vertex in (G - g) < (degree of v in G) - I. vertex 6. No minimal covering can contain a circuit, for we can always remove an edge from a circuit without leaving any of the vertices in the circuit a minimal of an n-vertex graph can uncovered. Therefore, covering
edges g is
contain

no

more

than

- 1 edges.

7.

has many minimal coverings,and of different numbers consisting number of edges in a minimal covering of the smallest number of the graph.) covering
graph,

in general,
sizes

they

may

be of

different

(i.e.,

of

edges).

The

sizeis called the

THEOREM

8-10)

A covering g
three

of a graph

is minimal

if and only

if

g contains

no paths

of length

or

more.)))

184)

COLORING,

COVERING,

AND PARTITIONING)

CHAP.

8)

I)

.)

.)

.)

(a))

(b))

(c)) of one,

(d))
and

Fig. 8-10

Star

graphs

two, three,
path

four

edges.)

Proof:

Suppose

that

a covering

g contains a
VtetV2e2v3e3v4.)

of length

three, and

it

is)

its end vertices V2 and V3 uncovered. Edge e2 can be removed without leaving Therefore, g is not a minimal covering. Conversely, if a covering g contains no path of length three or more, all its must be star graphs in the shape of stars; seeFig. components (i.e., graphs From a star graph no edge can be removed without leaving a vertex uncovered. That is, g must be a minimal covering. .)
that Suppose

8-10).
of a

the

city. Each of

the

in graph vertices is a

Fig. 8-9 representsthe

street

map

of a part
be kept

the surveillance of a patrol number of cars to vertex covered? patrol keep every The answer is a smallest minimal The covering shown in Fig. covering. is an and it six since there are II cars. answer, 8-9(a) requires Clearly, patrol vertices and no edge can cover more than two, less than six edges cannot cover the graph.
Minimization

potential trouble spot and must car. How will you assign a minimum

under

of
digital

Switching
machine

Functionst:
is to

design
menting gives

of a
the
F

An important step minimize Boolean functions


building

in

the

logical
that

before imple-

them.

we Suppose function following


wxyi

are interested in F of four Boolean

a logical

variables

circuit w, x, y, and z.)


+

==

+ wiyi

+ wiyi

wiyz

wxyi

wxyz

wxyz,)

where +
Let

denotes logical

pair of
8-11 .

represent vertices that

us

OR, xy denotes x AND y, and i denotes NOT x. each of the seven terms in F by a vertex, and join every differ only in one variable. Such a graph is shown in Fig.

An edge between two vertices represents a term with three variables. A minimal cover of this graph will represent a simplified form of F, peras F, but with less logic hardware. forming the same function I and 7 must be included in every of the) The edges covering pendant

tThose

not

familiar

with switching functions

may

skip

this

subsection.)))

SEC. 8-5)

COVERINGS)

185)

2)

7)

Fig.

8-11

Graph representation of a Boolean function.)

e)

G)

Fig.

8-12)

graph.

Therefore,

the terms)
xy

and

xyz

are essential.)
5 or

Two additional
Thus a
simplified

edges

3 and

6 (or
is)

4 and

3 and

5) will

cover

the

remainder.

version

of F
F

xyi

+ xyz +

wyi

wyz.)

This expression
in

can again

be

represented

by a graph

of four vertices,as shown

Fig.

8-12.

The essential terms xyi and xyz cannot be covered by any edge, and hence cannot be minimized further. One edge will cover the remaining two vertices in 8-12. Thus the minimized is) Boolean Fig. expression
F

xyi

+ xyz +

wy.)

Dimer

Problem:

In crystal
Each

dimensional lattice.
edge between

vertex

is represented physics, a crystal in the lattice represents an bond

by a
atom,

threean
the)))

and

vertices represents the

between

the two

atoms. In

186)

COLORING, of the

COVERING,

AND PARTITIONING)

CHAP.

8)

study

surface properties

of crystals, one is interested


Fig.
certain

in

two-dimen-

such as the two shown in sionallattices, To obtain an analytic expression for

1-10.
surface

properties

of crystals

molecules to find (also called dimers), one is required consisting of diatomic the number of ways in which all atoms on a two-dimensionallattice can be The problem is equivpaired off as molecules(eachconsistingof two atoms). alent to finding all different such that every vertex coverings of a given graph in the covering in which is of degree one. Such a covering every vertex is of

degree one is called a dimer


ously a
matching

covering

or

because

no two

edges
This

in

a I-factor. A dimer covering it are adjacent. Moreover,


a dimer

is obvi-

coveringis a maximal to as a perfect matching.


Two
Fig.

matching.

is

why

covering

a dimer is often referred


in

different

dimer coverings
have

are

shown

in

heavy

lines in the graph


have

8-13. an even

Clearly, a graph must This condition, covering.

number of
enough

verticesto

a dimer

however, is not

(Problem

8-21).)

(a))

.III)

...)

Fig.
(b)) graph.)

8-13

Two dimer

coverings

of

8-6.

FOUR-COLOR

PROBLEM)

So far we have consideredpropercoloring of vertices and proper coloring of edges. Let us briefly consider the proper coloring of regions in a planar a on or J ust as in coloring of vertices and))) graph (embedded plane sphere).

SEC. 8-6)

FOUR-COLOR

PROBLEM)

187)

edges,

the regions
if they

of a planar
have a

graph

are
the

said to
same

contiguous

or adjacent

regionshave

color.

common edge between make two regionsadjacent.) The coloring proper of regions is also called map in an atlas to the fact that coloring, referring different countries are coloredsuch that countries with common boundaries
vertices

be adjacent

be properly coloredif no two (Two reg-ions are said to them. Note that one or more

in common

does not

are shown

in

different

colors.

Once again we are not interested in just properly coloring the regions of a given graph. We are interested in a coloring that uses the minimum number of colors.This leads us to the most famous conjecture in graph theory. The colored conjecture is that every map (i.e., a planar graph) can be properly with four colors. The four-color conjecture, referred in to already Chapter 1, has been worked on by many famous mathematicians for the past 100years. the theorem or come up with a map No one has yet been able to either prove than a that more four colors. requires plane) (in That at least four colors are necessary to properly colora graph is immediate from Fig. 8-14, and that five colors will suffice for any planar graph
will

be

shown

shortly.
may

made here in passing. Paradoxically, for surfaces the theorems have complicated plane (or sphere) corresponding been proved. For example, it has been proved that seven colors are necessary sufficient for properly and Second, coloring maps on the surface of a torus.t it has been proved that all maps containing less than 40 regions can be properwith four colors. Therefore, if in general the four-color ly colored conjecture

Two remarks

be

more

than

is false, the
a graph

counterexamplehas to be a very
Region
only

complicated

and

large one.

Vertex Coloring Versus has a dual if and

Coloring:

From

Chapter

5 we know
the

that

if it

is planar.

Therefore, coloring
vertices

regions
and)

of a

planar graph G is equivalent

to coloring the

of its

dual G*,

Color

1)

Fig.

8-14

Necessity of

four

colors.)

tIn fact, the

Heawood map-coloring
surface

theorem

gives the
than

exact number
of a sphere.

of colors

required

for
or

every

orientable

more complicated

that

See page 136,[1-5],

page

94,

[1-2].)))

188)

COLORING, versa.

COVERING,

AND

PARTITIONING)

CHAP.

8)

vice

Thus

the four-color

conjecture can be restated


of four

as

follows:

Every

planar graph has

chromatic

number We

or less.
that

Five-ColorTheorem: properly coloredwith


THEOREM 8-11

shall

now

show

every

planar

map

can be

five

colors:)

The verticesof

every

planar
will

graph can

be properly

colored

with

five colors.)

be proved by induction. Since the vertices of all graphs with 1, 2, 3, 4, or 5 vertices can be properly colored with five colors, let us assume that vertices of every planar graph n - 1 vertices with can De properly colored with five colors. Then, if we prove that any planar graph G no more than five colors, with n vertices will require we shall have proved the
(self-loop-free,

Proof' The theorem

of courset)

theorem.

Consider the planar graph G with n vertices. Since G is planar, it must have at least one vertex with degree five or less (Problem 5-4).Let this vertex be v. Let G' be a graph (of n - 1 vertices) obtained from G by deleting vertex v (i.e., v and all edges incident on v). Graph G'requires no more than five colors, according to the induction that the vertices in G' have been properly Suppose hypothesis. colored, and now we add to it v and all edges incident on v. If the degree of v is a proper color to v. 1, 2, 3, or 4, we have no difficulty in assigning This leaves only the case in which the degree of v is five, and all the five colors the vertices adjacent to v, as shown in Fig. 8-15(a). have been used in coloring is of a of that 8-15 planar representation Fig. part graph G'.) (Note Suppose that there is a path in G' between vertices a and c colored alternately in Fig. 8-15(b). Then a similar path with colors 1 and 3, as shown between band with colors 2 and 4, cannot exist; otherwise, these two paths) d, colored alternately

3)

Color
a)

I)

Color
e)

2)

Color Color
e) 5)

2)

3)

Color

5)

Color
c)

4)

(a))

(b))

Fig.

8-15

Reassigning of colors.)
Graph\"

tSee \"Regularization

of a

Planar

in this section.)))

SEC. 8-6)

FOUR-COLOR

PROBLEM)

189)

color 2. And

and cause G to be nonplanar. is a consequence of the Jordan (This used in Section 5-3, also.) If there is no path between band d colored alternately with colors 2 and 4, from vertex b we can interchange 2 and 4 of all verticesconnected colors starting to b through vertices of alternating 2 and 4. This interchange colors will paint vertex b with color 4 and yet keep G' properly colored. Since vertex d is still with color 4, we have color 2 left over with which to paint vertex v. Had we assumed that there was no path between a and c of vertices painted 1 and 3, we would have color 1 or 3 instead of released alternately with colors
will intersect curve

theorem,

thus

the theorem.

.)

of degree one Graph: Removing every vertex from the G does not the affect (together pendant edge) graph regions of a planar graph. Nor doesthe elimination of every vertex of degree two, by the two edges in series (Fig. 5-6), have any effect on the regions of a merging
Regularization

of

a Planar

with

the

planar

graph.

consider a typical vertex v of degree Let us replace vertex v by a small circle with incidenceson v. This results in a number
Now

four or
as

more
each

in

a planar

graph.

many

vertices
of

as there
degree

were
three

of

vertices

(see Fig. 8-16).


Performing

this

transformation
produce the

a planar graph G will is of degreethree. When


coloring

another regions

of the

new regions backto the original Such a transformation may


it because

regions of G can be obtained


vertex.
be

on every vertex of degree in four or more H in which vertex planar graph every of H have been properly colored, a proper
simply

by shrinking

each of the

called

regularization
regular

of a
graph

planar graph,

converts if H

a planar

three. Clearly,
coloring
regular

problems,
graphs

can it is

graph G into a be colored with four


.sufficient

of degree

three.

And

H of degree G. colors, Thus, for mapto confine oneself to (connected) planar, the four-color may be restated conjecture
planar

so can

as follows:)

in G)
(a)) (b))

Fig.

8-16

Regularization

of a

graph.)))

190)

COLORING,

COVERING,

AND PARTITIONING)

CHAP.

8)

The

regions
with

of every
four

planar, regular graph

of

degree

three can

be colored

properly
If, in
planar

colors.

a planar
graph.

graph G, every
number

graph

in which

a triangular less.)

is of degree three, its dual G* is a vertex every region is bounded by three edges; that is, G* is as the four-color conjecture may be restated Thus again of every

follows: The chromatic

triangular,

planar graph is four or

SUMMARY)

of the coloring of the vertices.

we were concerned with sections of this chapter, proper vertices of a graph.This led us to the chromatic partitioning the concept of an indepenIn the process we also developed a dominating set of vertices.Associatedin a natural and dent set of vertices maximal sets, largest maximal independent way with these sets we found sets, and the independence number; minimal sets, dominating independent the number. domination The chrosmallest minimal dominating sets, and of matic polynomial, studied in Section 8-3, was also a direct consequence
In

the

first three

proper

coloring

of vertices. developments
8-4 and
than

8-1

ing

Sections 8-4 and 8-5 contain Sections and 8-2, except that of the edges of a graph rather
edges,

8-5 are
the

parallel to those in concernedwith proper

Sections

color-

vertices.

pendent set of
maximal
matching

that
is a

is, a set maximal set

somewhat similar to a dominating the graph is either in a covering

of edgesno two An of independentedges.


set

A matching is an indeare adjacent. A of which


edge

covering edge

of edges

in the

sense that
A

every

is in

or is

perfect matching.
it

An

independent

set is

adjacent to it. also a dominating


covering

dimer

set if and

is maximal. sketch

Likewise,
in Fig.

fect. The
cepts.

a matching is also a 8-17 summarizes the


direction with

is a only if only if it is percovering if and


these

relationships among
restriction.
in

con-

The arrows
than

indicate the
or edges.)

of increasing

The last sectiondeals


vertices

proper

coloring

of regions

a planar

graph

rather

REFERENCES)
on coloring, covering, matching, deal of research has been done and published of Mirsky of the vertices as well as edges of graphs. The survey paper and references for most of this chapter. and Perfect [8-4] is an excellent source of material is very readable. Wilkov and Kim Read's survey paper [8-5]on chromatic polynomials for chromatic partitioning of graphs. Among textbooks, [8-6] present an efficient algorithm 10 and recommended readings are Chapters 4, 10, 11, and 18 of Berge [1-1];Chapters the interesting))) 12 of Harary [1-5]; and Chapters 9 and 11of Liu [8-3]. Rouse Ball [1-12]gives
A

good

and

partitioning

CHAP.

8)

REFERENCES)

191)

Independen set)

Domina ting
set)

Maximal

Minimal
t

independen
set)

dominating
set)

Largest

Smallest

maximal

minimal
t

Independen
set)

dominating
set)

(a ) Vertex

Subsets)

Ma tching)

Covering)

Maximal ma tching)

Minimal
covering)))

Perfect

matching (if exists))


(b) Edge Subsets) Fig.

8-17

Structure of

terms.)

192)

COLORING,

COVERING,

AND PARTITIONING)

CHAP.

8)

book devoted to this unsolved history of the four-color problem. For an entire problem, see Ore [1-11]. 8-1. BROOKS, R. L., \"On Coloring the Nodes of a Network,\" Proc. Cambridge Phil. Soc., Vol., 37, I 941, 1 94- t 97. 8-2. P. W., \"Graph Theory and and KASTELEYN, Crystal Physics,\" in Graph Theory Theoretical Physics (F. Harary, ed.), New York, Academic Press,Inc., 8-3. McGraw-Hill Book ComLIU, C. L., Introduction to Combinatorial Mathematics,
early
pany,

]967,43-110.
Anal.

New L.,

8-4.
8-5.

MIRSKY,

York, 1968. and H. PERFECT,


\"An

Vol. 3,
READ,

1966,520-568.
Introduction

\"Systems

of Representatives,\"
Polynomials,\"

J.

Math.

Appl.,

R. C.,

to Chromatic
\037'A Practical

J. Combinatorial

Vol. 4, No. I,
8-6.

WILKOV, Problem,\"

R. S., and W. H. KIM, J. Franklin Inst., Vol.

1968,52-71.

Theory,
Partition

289,

No.5,

to the Chromatic Approach May 1970, 333-349.)

PROBLEMS)

8-1. Prove

that the chromatic number of a graph will not exceed by more than one the maximum degree of the vertices in a graph. 8-2. Show that the graph in Fig. 8-4 has only one chromatic partition. What is it? 8-3. Show that the chromatic number of a graph G cannot exceed the diameter (i.e., the length of the longest path) of G by more than one.

8-4. 8-5.

Show
bipartite

that

a simple graph.
graph

graph

with

n vertices

and more

than

Ln2J4 J edges

cannot be a

to be a complete graph if there is one edge between bipartite vertex of set V 2 . Show that the maximum number is Ln2J4 J. of edges in a complete bipartite graph of n vertices 8-6. Show that if a bipartite graph has any circuits, they must all be of even lengths. 8-7. In a chessboard, show the positions of of queens that collectively dominate all 64 squares number (a) The minimum (an number of vertices). example of a minimal dominating with smallest number of queens such that none of them can take another (b) The maximum of a maximal independent set with largest number of vertices). (an example 8-8. Find the chromatic polynomial of the graph in Fig. 8-7. Use a technique similar 8-9. Using induction on n, prove Theorem 8-5. (Hint: to one used in proving Theorem 3-3.) satisfies the inequality 8-10. Show that the chromatic polynomial of a graph of n vertices A bipartite
is said
VI

every

vertex

of set

to every

Pn(l)

< l(l

1 )n-l.

8-11. Show

Use Theorem 8-5.) the chromatic polynonlial length n (i.e., an n-gon) is)
(Hint:
that Pn(l)

of a

graph consisting of a
I)n.)

single

circuit

of

= (l

l)n

+ (l

- 1)(-

8-12.

8-13.

that the absolute value of the second coefficient of In-l in the chromatic of edges in the graph. of a graph equals the number Pn(l) Sketch two different (i.e., non isomorphic) graphs that have the same chromatic
Show
polynomial

polynomial.)))

CHAP.

8)

PROBLEMS)

193)

8-14.

in schedule Suppose that you are required to makea class a total of n courses to be taught in m available hours of the of courses that cannot be taught at the same time because like to take both. Explain how you will make the schedule. it will be impossible to make a compatible when schedule.
coloring

a university. There are week. There are pairs some students might State the condition (Hint:

Try properly

n vertices

with

available

colors.)

8-15.

Sketch a
yet
In

that does bipartite graph has a complete matching.

not

satisfy

the

condition

in Theorem

8-8 and

8-16.

a village there are an equal number of boys and girls of marriageable age. Each of girls and each girl dates a certain number of boys. boy dates a certain number Under what condition is it possible that every boy and girl gets married to one of their dates? not allowed.) (Polygamy and polyandry

Make a completetable (like Table 8-1) for the graph of Fig. 8-6 to determine number or not a completematching Find the deficiency from this exists. table. 8-18. Show that a nonnull graph is 2-chromatic if and only if, for all odd r, every diagonal Xr is zero. The matrix X is the adjacency matrix of the entry in matrix graph. (Hint: Use Theorem 8-2.) 8-19. Just as with an independent set of vertices (or simply independent set), define an independent set of edges in a graph as a set of nonadjacent edges (not incident on a common vertex). Make some observations to those in Section 8-2. parallel Observe that matching is an independent set of edges. What are complete matchings, maximal and so on? matchings, 8-20. Explore how the covering number of a graph G with n vertices is related to the
8-17.
whether diameter of G.
a graph

8-21.
8-22.

Sketch

with an even number of

vertices

that

has no

dimer covering.

with Show that the regions of a simple planar graph G can be colored properly two colors if and only if every vertex in G is of even degree. (Hint: Use Theorem 8-2 and Problem 4-28.)

8-23. From

Two such combinations m < k. This relationship

of k objects. objects one can select v !j[k !(v - k)!] combinations are m-related if they have m or more objects in common, can be expressed by means of a graph with v !j[k !(v - k)!] vertices and with edges between every pair of m-related combinations. Makeobserthis graph is vations on the properties of such a graph. Give conditions for which (a) a null graph; (b) a complete graph. How will you select a largest set of combinations that are not m-related? Illustrate method by sketching the graph your m = 2. for v = 6, k = 3, and v distinct
aN are arranged aI, a2, . objects once once in each row and exactly

8-24.

An N by N square in which each object appears exactly called a Latin square. A Latin of 2N vertices. What graph graph? How many of these

..,

8-25.

by square can also be represented is the total number of different matchings are edge disjoint? Call a subset of vertices incident that includes at least one vertex on every edge of G a vertex cover of G. Show that the number of vertices in the smallest vertex cover is to or less than the domination number of G.))) equal

in such a way that in each column is a complete bipartite matchings in such a

9)

DIRECTED

GRAPHS)

direction
Vi

The graphs studied in was assigned to


v j could

this
the

book
edges

so far
in a

have been undirected


An

graphs.

No

graph.

edge

e k between

vertices

and

Vi. In

as going from vertex Vi to vertex v j or from v j to this chapter we shall consider directed graphs-graphs in which edges
be considered
physical

have directions.

M any
with

situations
flow

require
networks

directed graphs.
with

The street

map

of a city

pipes, and electrical are represented directed networks, for example, by graphs. Directed graphs are employed in abstract of representations computer programs, where the vertices stand for the program instructions and the edgesspecify the execution The directed is an in the invaluable tool of sequential sequence. graph study machines. Directed graphs in the form of signal-flow graphs are used for in control theory. system analysis Most of the concepts and terminology of undirected graphs are also
one-way streets,
valves in the

the planarity For example, of a graph does not is directed or undirected, and therefore Chapter 5 is applicable to both directed and undirected The same is true for graphs. most other topicscovered so far. It would be wasteful to devote another eight of directed minor chapters to the study graphs, mostly repeating, with what has already been said. In this we shall therefore, changes, chapter, out those of directed graphs that are not shared by mainly bring properties
graphs.

to directed applicable
depend on whether

the

graph

undirected

graphs.)
IS

9-1.
V =

WHAT

A DIRECTED

GRAPH?)
G consists
. .},

A directed graph (or a digraph for short) {VI' V 2 , . . .}, a set of edges E = {e p e 2 ,.
194)))

and a

of a set of vertices mapping'Pthat maps)

SEC. 9-1)

WHAT IS A

DIRECTED

GRAPH?)

195)

e3)

e7)

Directed graph Fig. 9-1 and 10 edges.)


ordered vj

with

5 vertices

every edge
undirected

onto

some

graphs,

a vertex
Vi

segment
referred

between
to

and

pair of vertices (Vi' is represented by a point with an arrow directed from


five

V j).

As in the
by

case of
a line

Fig. 9-1shows
In a digraph

a digraph

with

vertices

and

ten

example, edges. A digraph is also


but

and an edge Vi to v r For

as an

oriented graph.t an edge is not only


and

incident

on a

vertex,
Vi'

is also

incident

out of
incident

vertex

incident

into a

vertex. The
vertex vertex

vertex

which

out of, is called the initial incident into, is called the terminal vertex and v 4 is the terminal vertex and terminal vertices are the same
authors

of eke The vertex of e k' I n Fig. 9-], V 5 is the An edge for which a self-loop, such as
the

edge v ' which j

ek ek
initial

is is

initial

of edge e7 .
forms

reserve the term arc for an oriented or directed We the use term edge to mean either an undirected is or a directed edge. Whenever there a possibility of confusion,we shall explicitly state directed or undirectededge.)

es. (Some

edge.

The out-valence

number or

of edges outward

edges incident into degree) of Vi and is

incident out of a vertex Vi is called the out-degree (or of and is written demidegree) d+(v i ). The number of Vi is called the or inward demiin-valence in-degree (or Vi written as d-( Vi). In Fig. 9-1, for example,)
d+(v 1)

== 3,

d-(v

1)

==

1,

d+(v 2) == 1,

d-(v 2) == 2,

d+(vs)
It is
all

==

4,)

d-(v s) ==
in

O.)

not difficult
is equal authors
by

in-degrees tSome

to prove (Problem 9-1)that to the sum of all out-degrees,

any digraph each sum

G the sum being equal

of
to)

graph\" directed

reserving edge between

make a distinction between the terms \"oriented graph\" and \"directed the former for only those digraphs which at most one have a pair of vertices. This often leads to confusion; therefore, we use

these two terms synonymously.)))

196)

DIRECTED

GRAPHS)

CHAP.

9)

the

number

of edges

in

G;

that
n

is,) n

;=1
An

\037

d+(vJ

\037 ;=1)

d-(vJ.

isolated

vertex

is a

vertex in
vertex

which

the

in-degree

are both equal to zero. A degree one, that is, if)

v in

a digraph is

called pendant

and the out-degree if it is of

d+(v)

+ d-(v)

I.)

whereas edgese2
Since
undirected
many

Two directed edges are said to be parallel if they are mapped onto the same ordered pair of vertices. That in addition to being parallel in is, the sense of undirected edges, parallel directed edgesmust also agree in the In Fig. 9-1, edges eg , e 9 , and e 10 are parallel, direction of their arrows. and

e 3 are

not.
of

properties

directed

graphs

are the same


orientations

as

those

of

ones,

it is

often convenientto

in a

obtained from a digraph. Such an undirected graph be called the undirected graph corresponding to G. On the other hand, given an undirected graph H, we

the disregard

directed graph
can

of edges G will

assign

of H somearbitrary
called given

each edge by

direction. of H (or
unique

The

resulting
associated

digraph,
with

designated
H). Note
that

is a

an

orientation

digraph

while

digraph has a
it, why

(within

isomorphism)

undirected

graph corre-

sponding to

a given we

This is possible. but an orientation


This the

undirected graph say the undirected


When

orientations may have \"different\" a digraph, to graph corresponding

brings

us to

of a graph. the question:

are

two

digraphs
defined

considered
such

to be have
labels

same

or isomorphic?

Isomorphic Digraphs:

Isomorphicgraphs were
of graph

that they
their

identical behavior
are removed,

in

terms

properties. In other words,if


For

two isomorphic

graphs are indistinguishable.

two

digraphs)

e2) (a))

e 2)
(b))

Fig.

9-2

Two nonisomorphic digraphs.)))

SEC. 9-2)

SOME

TYPES

OF DIGRAPHS)

197)

to be

isomorphic not
the

only

must

their

corresponding
that

undirected

graphs be
also

isomorphic, but

directions

of the
digraphs

corresponding edges must


are not

agree.

For example, Fig. are orientations they


Figure distinct

9-2 shows two


of the same

isomorphic,

although

undirected graph.

9-2 (i.e.,

immediately nonisomorphic)

problem was solved by F. cases are left as an exercise

a problem. What is the number of suggests undirected The orientations of a given graph? and E. M. Palmer in 1966. Some specific Harary (Problem 9-3).)

9-2. SOMETYPES
Like their

OF

DIGRAPHS) varieties.
graphs

to the

choice
than

of assigning
undirected

undirected sisters,digraphs come in many a direction to each edge,directed


ones.
has

In fact, due have more

varieties

Simple
calJed

Digraphs:

a simple

A digraph that digraph (Figs. 9-2 and


Digraphs: Digraphs of vertices, but are

no
for

self-loop
example).

or parallel

edges is

9-3,

Asymmetric
between asymmetric

that

have

pair
or

allowed

at most one directed edge to have self-loops, are called

antisymmetric.
which
a).)

vertex

Symmetric Digraphs: Digraphs in a to b) there is also an edge (b,


digraph
Similarly,

for

every

edge (a, b)

(i.e., from

that is both
a The

digraph.
asymmetric.

a simple symmetric is caJIed symmetric and is both asymmetric is simple digraph simple will be and reason for the terms symmetric asymmetric that of binary

simple and

apparent
graph
in

in

the

context

relations

in

Section

9-3.

as a simple Digraphs: A complete undirected graph was defined vertex exactly by one edge. other every vertex is joined to every For digraphs we have two types of complete graphs. A complete symmetric from in which there is exactly one edgedirected digraph is a simple digraph vertex to every other vertex every (Fig. 9-3), and a complete asymmetric

Complete

which

digraph every
A

is an pair

asymmetric
asymmetric
symmetric

digraph
digraph
digraph

in

which

there

is exactly
contains

one edge between


n(n
n(n

of vertices

(Fig. 9-2).
of
n

complete

vertices

or

1 )/2

edges,
A

but a
complete

complete

of n

vertices contains

1) edges.
a

asymmetric

digraph

is also

called a

tournament

complete

tournament (the reason for this term will be made clear in Section 9-10). A digraph is said to be balancedif for every vertex Vi the in-degree equals the out-degree; that is, d+(vJ = d-(vJ. (A balanced digraph is also referred A balanced to as a pseudosymmetric digraph is said digraph, or an isograph.) as every if every vertex has the same in-degreeand out-degree to be regular other vertex.)))

198)

DIRECTED

GRAPHS)

CHAP.

9)

Fig.

9-3
four

Complete symmetric digraph


vertices.)

of

9-3.

DIGRAPHS

AND

BINARY

RELATIONS)

The theory of graphs and the calculus of binary related (so much so that some people often mistakenly the as a branch of of relations). theory theory In a set of objects, where) X,

relations

are
regard

closely
graph

come to

X =
a binary

[Xl' X 2 ,..
Xj)

.},)

relation

R between

pairs (Xi'

may exist.

In

which

case,

we write)

x.Rx. I J)
R to X r relation Xi has R may for instance be \"is parallel or to,\" \"is orthogonal to,\" \"is congruent to\" in geometry. It may be \"is greater \"is a factor of,\" than,\" \"is equal to,\" and so on, in the case when X consists of numbers. On the other R may be \"is son of,\" the relation hand, if the set X is composed of people, relations is defined \"is spouse of,\" \"is friend of,\" and so forth. Each of these numbers of the and this is the name on of relation. set, why binary only pairs a x j and there are relations other than \"is of\" binary Although product (Xi Xk , for example, will be a tertiary relations are the most relation), binary and the word \"relation\037' a binary relation. implies important in mathematics, a binary A digraph is the most natural of representing relation on a way
and

say that Relation

set X. Each Xi E R to xj ' a directed

X is

represented
is drawn

by

a vertex

Xi. If
Xi

Xi

has

the specified

relation

edge

from vertex

to

For

x j'

for every pair


\"is greater

example,

the

digraph
five

in Fig.
numbers

on

a set

consisting of
without

9-4 representsthe [3, 4, 7, 5, 8}.


on a
finite

(x,.,xj).
than\"

relation

Clearly, every
digraph

binary

relation

set

can

parallel edges.
relation

Conversely, every
set of its

digraph

be represented by a without parallel

edges defines

a binary

on the

vertices.)))

SEC. 9-3)

DIGRAPHSAND

BINARY

RELATIONS)

199)

5)

7)

Fig.

9-4

Digraph of a

binary

relation.)

XI)

X2)

X 3)

X 4)

(a))

(b))

Fig.

9-5

Graphs of

symmetric

binary

relation.)

element R it may happen that Reflexive Relation: For some relation every is in relation R to itself. For example, a number is always equal to itself, or a line is always parallel to itself. Such a relation R on set X that satisfies) x.Rx. I
for

I)

The digraph of a reflexive relation. vertex. Such a digraph representing a reflexive be called relation on its vertex set may a reflexive digraph. A binary no vertex has a self-loop is called an irreflexive digraph. digraph in which R it may happen that for all Xi and Symmetric Relation: For some relation if) x j' every
relation

will

Xi E X is called a reflexive have a self-loop at every

xiRx

j holds,

then xjRx

also

holds.)

\"Is spouse of\" is a symmetric relation. symmetric \"Is equal to\" is both symmetric and reflexive. The digraph of a symmetric because for relation is a symmetric digraph every directed edge from vertex Xi to x j there is a directed edgefrom x j to Xi' of an irreflexive, symmetric binary relation on Figure 9-5(a) shows the graph a set of four elements.The same relation can also be represented by drawing of vertices that are related, as in just one undirected edge between every pair Thus every undirected graph is a representation of some Fig. 9-5(b). sym-)))

Such a

relation is called a
relation.

but

irreflexive

200)

DIRECTED

GRAPHS)

CHAP.

9)

metric

binary

relation
with

undirected
2e

graph
edges.
opposite

e edges

(on the set of can be thought

its

vertices). of

Furthermore,

every
with

as a

symmetric digraph

directed

(A two-way street is equivalent to two


directions.)

one-way streets
if for

pointed in
elements
Xi'

Transitive

X j'

Relation: A relation R is and X k in the set,) xiRx j and


xiRx

said to be transitive
xjRx k)
k.)

any three

always

imply)

The

binary

relation

\"is X

greater

than,\"

for example,
\"Is descendent

is a

transitive

relation.

If

Xi > x j and

of a transitive
The is shown
transitive

xj >

k , clearly

Xi > x k .

of\" is

another example

relation.

irreflexive and asymmetric) binary relation (but digraph of a transitive in Fig. 9-4. Note the triangular A subgraphs. digraph representing directed relation (on its vertex set) is called a transitive graph.

Equivalence
it

Relation: A
symmetric,
\"is

binary

relation

is called

an equivalence relation if
equivalence
\"is

is

reflexive,

and transitive.
to,\"

Some examples of
\"is

relati

ons are

parallel

\"is equal

to,\"

congruent

to,\"

equal

to

to.\" modulo m,\" and \"is isomorphic be called an equivaThe graph representing an equivalencerelation may an equivalence does lence graph. What graph look like? Let us look at an 3\" to modulo of the equivalence relation \"is congruent consisting example, is shown in Fig. 20. The graph defined on the set of 11 integers, 10through undirected but each 9-6. (Recall that edge in Fig. 9-6 represents two parallel

oppositely

disjoint classes,each in
undirected
reflexivity).

directed edges.) In Fig. 9-6 we see that


subgraph
Furthermore, an

set of the graph is divided into three Each component is an component. at each vertex (due to (due to symmetry) with a self-loop in each component every vertex is related to (i.e.,
the

vertex

separate

joined by

edge

to) every

other

vertex.)

== I

(mod

3)) Fig.

==

2 (mod

3))

==

0 (mod

3))

9-6

Equivalence

graph.)))

SEC. 9-4)

DIRECTED

PATHS

AND CONNECTEDNESS)

201)

In general,

an equivalence
(called
and

relation on a set partitions


classes) such
in the
that

the two

elements

set into classes same class if


ambiguity

only

equivalence if they are


membership

elements

regarding

have been component

to band
that

related to xj but not every vertex is joined to every is related to c, a is also related

related. Symmetry ensures that equivalence class; otherwise, vice versa. Transitivity ensures
other to

of the are in the there is no


Xi in

that

may each

vertex,

because

c. Transitivity

if a is related also guarantees


an element in the set.

no
in

element
a class

to be

can be in more than one class. Reflexivity by itself, if it is not related to any other
binary

allows

element

R on a set can alsobe represented by a (0, I), n by n matrix, where n is the the set. The i, jth entry is 1 if Xi RX j is in the matrix matrix of the relation \"is true, and is 0, otherwise.For example, the relation than\" on the set of integers greater {3, 4, 7, 5, 8} is)

Relation Matrices: A

relation

a matrix, called a relation number of elements in

matrix.

It is

5
0
I

8 0
o .

0 0 0 0 0
I I I I

4
7
5

0
I I I

0
0 0
I

0
I

0
0)

8
We

shall

see

in

Section

9-8 that
binary

this is precisely the

adjacencymatrix

of the

digraph

representing

the

relation.)

9-4.

DIRECTED

PATHS

AND

CONNECTEDNESS)

they

Walks, paths, and circuits in a directed graph, in addition are in the corresponding undirected graph, have the added

to being what
consideration
edges s e 7 V 4 e 6 V 3 e l VI

of orientation.
(although
tent

For example, in
is a path
in \"directed\"

Fig.

9-1,
from

the sequence
V s to

of vertices and
V

V s e g V 3 e 6 V 4 e 3 VI

VI' whereas

a path

direction

from

the corresponding undirected V s to V 1. A distinction must to

graph) has no such consisthese two be made between

types of
either

paths. It is natural

call

the first
The

and the second


a directed
A directed and

one a semipath.
path or a

word

cutsets. Moreprecisely:
edges,
a

semipath, and
to

V 5 to VI' from one a directed path \"path\" in a digraph could mean for walks, circuits, and similarly

walk from beginning

a vertex Vi
Vi

v j is

with

oriented from the vertex

ending precedingit to the

and

edgein

directed

walk

appears

more

than

an alternating sequence of vertices is with v j ' such that each edge vertex following it. Of course, no but a vertex may appear))) once,

202)

DIRECTED

GRAPHS)

CHAP.

9)

than more once, just as directed graph is a walk a directed walk. A walk

in

the

case

of undirected

graphs.
a

semiwalk
but

in a
is

in

the

corresponding

undirected

graph,
directed

not

in a

digraph can

mean either

walk

or a

semiwalk. The definitions


similarly.

directed

and directed circuit can be written circuit, semicircuit, to Fig. 9-1oncemore. The set of edges [e t , e 6' e 3} is circuit. But [e t' e6 , e 2 } is a semicircuit. Both of them are circuits.
of

Let

us turn

Connected undirected (i.e., Digraphs: In Chapter 2 a graph graph) was defined as connected if there was at least one path between every of pair are two different we vertices. In a digraph there types of paths. Consequently, in digraphs. A digraph G is said to have two different types of connectedness if there is at least one directed path connected be strongly from every vertex A digraph G is said to be weakly if its correconnected to every other vertex. but G is not strongly In is connected connected. sponding undirected graph is strongly connected, and the other one is weakly Fig. 9-2 one of the digraphs The statement that a digraph G is connected simply that its means connected. or corresponding undirected graph is connected; and thus G may be strongly A directed graph that is not is dubbed as connected connected. weakly

disconnected. Sincethere are


types

we can define two types of connectedness in a digraph, also. Each maximal connected or strongly) (weakly subgraph of a digraph G will still be called a component of G. But within each be called the connected will of G the maximal strongly subgraphs component
two of

components

fragments (or strongly For example, the


component

connectedfragments)

digraph in Fig. gt contains three fragments


e 3 , e 4 , and

9-7

Observe

that

e9

do

not

appear

of G. consists of two components. [e p e 2}, res, e6 , e 7 , e g }, and in any fragment of gl.)

The

[eto}.

e I)

es)

gI)

Fig.

9-7

Disconnected digraph

with

two

components.)))

SEC.

9-5)

EULER

DIGRAPHS)

203)

(e I , e2

))

----)

(e lO ))

Fig.

9-8

Condensation

of Fig. 9-7.)

each

Condensation: The condensation strongly connected fragment

edges single
in

a digraph G is a digraph in which a and directed all vertex, by replaced are from one strongly connected to another replaced by a component G in Fig. 9-7 is shown directed edge. The condensationof the digraph
G c of is

Fig.

9-8.

Two observations I. The

can be made from


strongly

the

definition:)

condensation of a
condensation

connected

digraph

is simply

a vertex.

2. The

of a

digraph has

no directed circuit.)

Accessibility:

from vertex

strongly other vertex.)

In a digraph a vertex b is said to be accessible (or reachable) G is a if there is a directed path from a to b. Clearly, a digraph connected if and only if every vertex in G is accessible from every

9-5.

EULER

DIGRAPHS)

The notion of the Euler graph can be extended to digraphs also. In a walk starts and ends at (i.e., a directed walk that digraph G a closeddirected the same vertex) which traverses every edge of G exactly once is calleda is called directed Euler line. A digraph containing a directed Euler line an Euler digraph. The graph in Fig. 9-9 is an Euler digraph, in which the walk a b c d e f is an Euler line. When is a digraph an Euler digraph? Clearly, the must be digraph connected, with the possible exception of isolated vertices; otherwise, every be traversed in one walk. In fact, an Euler digraph must be edge cannot need not be connected connected, strongly although every strongly digraph an Euler digraph (Problem 9-13).Theorem 9-1 (whose proof follows the 2-4 test for almost verbatim) provides a very simple proof of Theorem has an Euler line.))) determining whether or not a digraph

204)

DIRECTED

GRAPHS)

CHAP.

9)

3)

2) a)

4)

Fig.

9-9

Euler

digraph.)

THEOREM

9-1
an

A digraph G is

Euler

digraph
v

if and only
in G].)

if

G is

connected

and is balanced

[i.e.,d-(v)
Let

d+(v)

for every vertex

us now

consider an application of
in

important problem referred to as the teleprinter's problem, in using the digraph, and was presented
communication

Euler digraph The theory. problem, in 1940 was solved


the a classic

for solving an
which by

is

often

I.

G.

Good

Teleprinter'sProblem:How
of

long

is a

I's and

the

O's such that no subsequence sequence? Construct one such longest sequence.
distinct
2 r

[9-2]. circular (or cyclic) sequence longest of r bits appears more than once
paper

in 1946

in

construct

a circular sequence 2r bits of r bits be repeated. subsequence


Clearly,

Solution:Sincethere are 2 r sequence can be no longerthan

bits long

0 and 1, the r-tuples formed from we shall Theorem 9-1, long. Using with the required property that no

Construct a digraph G whose vertices


there

are

are 2

- 1

all (r

1 )-tuples be)

of O's

and

1 's.

vertices

in G.

Let a typical vertex


where
CX;

CXI CX 2

. . . cx r - p) this

0 or 1.)
. . . cx r - I )

Draw an edge directed


vertices
cx I CX 2

from

vertex

(cx I CX 2

(cx2 cx)... ... each


CXI

CXr-IO) and (cx 2 CX)... cxr-II); cxr_IOandcx I CX2 ... cxr_II, respectively.

label

to each of two these directed edges

from
when

of the
=
CX2

2r-1 vertices.(A self-loop ... = CXr - 1 = 0 or 1.)


digraph

will

result in each

Draw two suchedges directed of the two cases because for each
to
vertex

The
in-degree

resulting

is an

Euler digraph

the

equals
G consists

line
any

in

the out-degree of the 2r edges, edges


in

(each being equal


each

two).

A directed
cx I CX 2

Euler

two

consecutive

the

CX2 CX)

. . . CX r CX r + I ; that

to the r
made

- 1 leading
first

is, the r of the bits of

Euler
1

with a distinct r-bit line are of the form


bits

label. The labels of


. . . CX r - I CX r ; edge

trailing

of the

first

are

identical

of the

bit

of 2 r bits, second edge. Thus in the sequence each of the edges in the Euler line, every possible)))

SEC. 9-5)

EULER

DIGRAPHS)

205)

o
= 00 I I)

0)

e8

e2

= 0001

e 3 = 00 I 0
e4

ell
= 0101)

= I0 1 I

e 12 =0111
e 13 =1111)

e 1 = 0000)

e6 = 0 I 00

e s = 1010
e 10 = I I 0 I)

e IS)

= I 1 00

Fig.

9-10

Euler digraph for

maximum-length

sequence.)

subsequence have the

of r bits occurs as the label of an edge; and since no two edges same label, no subsequence occursmore than once. The circular is the two ends of the sequence.) achieved by joining arrangement

of obtaining procedure 0000101001101111 such is sequence. sequence maximum-length correspondingto the walk e l e 2 e 3 e 4 e s e 6 e 7 e g e 9 e lO ell e l2 e l3 e l4 e lS e 16 . This problem the position is also encountered in locating of a rotating with the two different of marks. drum surface 9-19) (Problem carrying types shift register The problem of the rotating drum is similar to that of a feedback in Chapter each arrange12). The quest for a word in which (to be discussed
4,

For r

==

the

graph

in Fig.

9-10 illustrates the


One

such a

ment of r
cryptography,

letters of
difficult

is also m. ]n

It is
number

not

given alphabet appears exactly once, encountered in the same problem (Problem 9-20). size need not be 2. It could be any to see that the alphabet
a
maximum-length

that case, the


out-degree rather
m,

sequence

is m r

symbols long.
Euler

The in-degree and


digraph equals Number of Euler

of

each

vertex

in

the

corresponding

than

two.

Lines: In Fig. 9-10 there is more than one Euler line. In the 16distinct Euler lines. (Note that rotations of the same has fact, digraph the number of distinct of are considered not distinct.) edges Finding sequence in many directed Euler lines in a given Euler digraph is also of interest G. This N. of enumeration was solved deBruijn in))) by problem applications.

206)

DIRECTED

GRAPHS)

CHAP.

9)

1946

for

those
vertex

regular Euler
were

digraphs in
and

which

the
in

in-degree
Fig.

of

every van

exactly

two, the digraph


deBruijn

9-10, Euler

for example.

and out-degree In

1951
problem

Aardenne-Ehrenfest

[9-9] solved the


directed

more

general

of counting
of by

the number
distinct

of distinct
in

lines in any Euler

digraph.

The number

be obtained
the

counting

Euler lines certain types

a balanced,

connected
G,

of spanning trees in

to be

digraph G can covered in

next

section.)

9-6.

TREES
A tree

WITH

DIRECTED

EDGES)
as

same for has no circuit-neither a digraphs. A tree is a connected digraph that directed circuit nor a semicircuit.A tree of n vertices contains n - 1 directed and has properties similar to those with Trees with undirected edges edges. in many applications, suchas electrical directed edges are of great importance
any

circuit.

(for undirected graphs) was defined The basic concept as well as the

a connected
\"tree\"

graph
the

without

term

remains

of languages,computer programming, to few. name a counting problems, In addition to being trees in the undirected have sense, trees in digraphs additional and variations from the relative orientations properties resulting directed of the edges. One such particularly useful type of rooted tree with called an arborescence and is definedas follows: is edges
network

analysis,

game theory, theory

and

Arborescence:

digraph

G is

said to

be an

arborescence

if)

1. G 2.

contains

no circuit-neither directed nor


v of

semicircuit.

In G

there is preciselyone vertex


is called

zero in-degree.)
An

This vertex v
in

the root

of the

arborescence.

arborescence

is

shown

Fig.

9-1 I.)

(root))

Fig. 9-11

Arborescence.)))

SEC.

9-6)

TREES WITH DIRECTED

EDGES)

207)

THEOREM 9-2)
An

arborescence

is a tree
one.)

in

which

every

vertex

other

than

the

root

has an

in-degree of exactly
Proof:

An arborescence
1. Therefore,

with

n vertices

can have at
all

most
vertices

1 edges

because

of condition

the sum
+ d-(V2)

of in-degrees of

in

G)

d-(vt)

... + d-(v

n)

< n

1.)

one is zero because of left-hand side of this equation, only must all be positive integers. Therefore, they must all be 1's. one of vertex since there are exactly n - 1 vertices of in-degree one and Now, 1 it n also G has S ince G is circuitless, zero, digraph exactly edges. in-degree Of

the n

terms on
2;

the

condition

others

must

be connected,

and hence a

tree. .)

An arborescence is in a sense a tree directed out of the root. Therefore, an arborescence is sometimesreferred to as an out-tree. (Reversing the direction what may be called an in-tree.)) of every edge in an arborescence will produce

THEOREM

9-3

from the root R to every other In an arborescence there is a directed path G is an arborescence if there is a vertex vertex. Conversely, a circuitless digraph v in G such that every other vertex is accessiblefrom v, and v is not accessiblefrom any

other

vertex.
an

Proof. (a) In
R

arborescence

consider
can

and

we get Since an
from (b)

as far as possible. P continuing a vertex whose in-degree is two


arborescence
R

end or

a directed path P starting from the root only at a pendant vertex; otherwise, more. A contradiction.

is connected,

every vertex lies on


vertices.

some directed

path

the root

to

each

of the

pendant

circuit,

Conversely, since every vertex in G is accessible from v, and G has no G is a tree. Moreover, since v is not accessible from any other vertex, other vertex is accessible from v, and therefore the in-degree of d-(v) = O. Every each of these vertices must be at least one. The in-degree cannot be greater than in one because there are only n - 1 edges in G (n being the number of vertices

G).

.)
The

following

is an

important

to the application of arborescences


arithmetic

theory

of computer

algorithms.
expression)

Polish Notation: Consider the a+b-

c.d
gX

.
or ALGOL)
this

-I)

(9-1))

In a

procedural language

(such

as FORTRAN

expression)))

208)

DIRECTED

GRAPHS)

CHAP.

9)

might

be written

as)

a + b
where

- c.d

\037

(g

i x

- f),)

(9-2))

i denotes exponentiation. must perform the arithmetic the computer In evaluating this expression in a certain order; otherwise,it will produce a wrong result. Let us operations be the operations in this expression in the order in which they number might

performed.)

a + b

- c.d \037 (g

i i i

i i
CD@)

i x

- f).

(9-3))

@wQ)@

To evaluate

sion backand
To

forth

will have to scan the expressuch an expression,the machine to find the sequence of operations to be performed.

avoid

scanning

back and

forth,

the

computer

makes

a preliminary

as (9-2) into the Polish notation such translation of expressions (invented by is also called parenthesisthe Polish logician, Lukasiewicz).Polish notation the it contains has because no parentheses. This notation free notation, the that in same order as are the they advantage operations appear exactly

performed.

The basic

idea

in

Polish

notation

is that
than

binary

operator

appears

just to

the

left y

of is

x+

two operands written as + xy.


the
first

rather

in

between
.of

the two

operands. Thus
from

The

translation

expressions

procedural

language into Polish notation

is extremely

important
(or

in compiling and
by

can be
of

accomplished by
arborescence

representing
a

the

given expression
constant)
internal

means

an

as follows: Each variable

appearing
vertex
its

in the

expres-

sion is represented by

binary operator having rescence for expression(9-2) is shown To obtain the expressionin Polish

vertex. Each pendant the two subarborescences


in

as

operands.

a represents An arbo-

Fig. 9-12. we traverse the notation,

arborescence)

j)

Fig.

a+

9-12 Arborescence b - c . d --;- (g t x

for
f).)))

SEC. 9-6)

TREES

WITH

DIRECTED

EDGES)

209)

starting

by the
in

as indicated left to right and from top to bottom, from the root from that has not dotted line in Fig. 9-12. Each time we come acrossa vertex its label to the existing string. This process been traversed before, we append Fig.

9-

2 yields)

+ a
An
right

cd --:- \302\267

gxf)

(9-4)) : We start at the is encountered the

expression
and

extreme

in Polish notation is evaluated as follows an operator move to the left. Whenever

the two operands immediately to the right of operation is performed between as one operand it. After an operation is performed, the resultant is regarded under this procedure expression for the next operation. You can verify that (9-4) is equal to (9-2). The advantage of expression(9-4) over (9-2) is that in (9-4) there are no parentheses and the operators appear in the order (from in to be which are to acted right left) upon. Therefore, no back and they forth

scanning

is required
relative

during

the

computation.
in the
in

Ordered
left

Trees: You must have


positions

noticed that
of the
and

expression
the

arborescence
of the

of Fig. 9-12the
or

vertices

plane

paperthis

right, it is

up or

down-are
and

important

must

sense

its \"rigid\" isomorphic to graph, this is in and This fact is a not properties. purely graph-theoretic problem; the first and only time in this book we shall consider such a structure. In computer a tree in which the relative order of subtrees literature at each vertex must be preserved is called an ordered tree or a planar meeting tree (because the in the plane of the tree can be visualized as rigidly embedded means an ordered science the term tree usually tree, and paper). In computer the a tree is drawn at with the root down by convention top. hanging a
a graph
Spanning

be preserved. In it may not preserve

Arborescence:
spanning

analogous to a
directed

tree

A spanning in an

tree in an undirected

n-vertex

connected

digraph,

tree that
9- 13 is
rescence

edges. is an

A spanning arborescence.
is

arborescence in a For example, a


a striking

graph, consists of n - I connected digraph is a spanning


spanning

arborescence

in

Fig.
arbo-

{f, b, d}. There


and an Euler

relationship
out

between a
by Theorems

spanning

line. This is brought


c)

9-4 and 9-5.)

2)

f)

Fig.

9-13

Euler

digraph.)))

210)

DIRECTED

GRAPHS)

CHAP.

9)

THEOREM

9-4

In a connected, balanced digraph . . . , em) be an Euler line, which starts


vertex

- 1 edgesthat
subdigraph

of eland

The
spanning

n vertices and m edges, let W = (eJ, e2, ends at a vertex v (i.e., v is the initial the terminal of em). Among the m edges in W there are vertex \"enter\" each of n - 1 vertices, other than v, for the first time. the n vertices is a with g of these n - 1 directed edges together
G of

and

arborescence

of G,

rooted

at

vertex

v.)

Illustration:

Before
W

proving

Fig. 9-13,

(b d

c ef

2. The subdigraph [b, d,


Proof:

gh
f}

a)

is
g, g
going

the theorem, let us look at an example. In Euler line, starting and at vertex ending a spanning arborescence rooted at vertex 2.)
is an vertex includes
to

In the

subdigraph

v is

of in-degree zero, and


going

every to

other

vertex
n

is of

in-degreeone; for
and no edge
and

1 vertices,

g is

connected arborescence in
Theorem

contains

- 1 directed
v.

exactly one edge v. Moreover, the way

each

of the
in

is defined
g

W,

edges. Therefore,

is a spanning

G and

is rooted

at

.)

of obtaining a spanning arborescence provided the digraph is Eulerian. Conversely, a spanning arborescence in an Euler digraph, an Euler line can be given 9-5. This important result discovered by T. van constructed using Theorem n in 1951 is used in counting the numAardenne- Ehrenfest and N. G. deBruij ber of distinct Euler lines. Forthe sake of traversing the edges along with rather than opposite to the direction of edges,it is better to express Theorem 9-5 in terms of an in-tree, in which the direction of every has been inverted. that is, an arborescence edge In Fig. 9-14 the subdigraph [e 2 , e 3 , e 7 , e lO ' ell} is a spanning in..tree.)

9-4 provides
specified

method

rooted at

any

vertex,

THEOREM

9-5

Let G

R. Let

e1

W =\037 (eJ,

in G, rooted at a vertex in-tree and T be a spanning Euler digraph R. Then a directed walk an edge in G incident out of the vertex if it is constructed as follows:) e2, . . . , em) is a directed Euler line,

be

an

be

e9)

e4)

e 1) Fig.

9..14

Spanning in-tree rooted

at R.)))

SEC. 9-6)

TREES

WITH

DIRECTED

EDGES)

211)

1. No

edge is
exiting

included

in

W more than

once.
to

2.

In

outgoing

a vertex the one edge belonging edges have been traversed. is terminated
on

T is

not used

until

all

other

3. The

walk

no edge left

which
W must

only when a vertex is to exit.) terminate at R,

reached from

which

there

is

Proof: The walk


entered as often there is an edge
as

because all verticesmust

have

been

a in

G is balanced). Now they have been left (because suppose in W. Let v be the terminal vertex G that has not been included

of some edge b not also be the initial vertex v must in W. Edge b going of vertex v must out be in T, according to rule 1. This omitted edge leads to another in c so on. omitted and T, Ultimately, edge find an outgoing edge there not we arrive at R, and in W. This contradicts included
Since

of a.

is balanced,

included

rule

3.

.)

The number
starting

with

of distinct Euler lines formed edge e 1 at R, can be computed


after

from
by

a given

considering

all

in-tree T, and the choices


this

available at each vertex,

starting

with e 1.

Sincethere
to be

is exactly

one outgoing
remaining

edge in
d+(vJ

T at

each vertex and


vertex

selected last (rule 2), the


in)

- 1 edges at

edge Vi can

is

be

chosen

[d+(vJ

I]!

ways.)

And

since

these are

independent choices, we
n i

have

altogether)

[d+(v i ) II ==
1)

I]!
in

(9-5))

different

Euler lines that Let us apply these


9-14,
following

meet

the

three

rules
ell}'

Theorem

9-5. directed

Fig.

from
two

three rules to obtain the in-tree [e2 , e 3, e 7 , e lO '


directed

different

starting

Euler lines in with edge e t . We get

the

Euler es

lines:)
e 7 e g e 9 e lO ell

(e l
and)

e l2

e6

e 2 e 4 e 3),)

(e l e l2 The

eg

e 9 e lO ell

e s e 6 e 7 e 2 e 4 e 3).)

value of expression (9-5)for Fig. 9-14 is 2. Note that these are not all the directed Euler lines in the digraph, but only those that are generated by the with the rules in Theorem 9-5. specific in-tree in accordance The result in Theorem 9-5 may seem contrived at first but it is a sight, natural Euler lines in a directed very step in counting the number of distinct

digraph,

which

will

be undertaken

in Section

9-9.)))

212)

DIRECTED

GRAPHS)

CHAP.

9)

9-7.

FUNDAMENTAL The

CIRCUITS

IN

DIGRAPHS)

edges of

T are also caIIed


mental

a connected digraph not


chords

with
when

graphs, every chord C i


circuit

(which
of

A cut-set in

may be a directed circuit a connected G (just as digraph


the

in a specified spanning tree included to T. Just in as the case of undirected respect added to the spanning tree T produces a fundaor

a semicircuit).

in an

of G into two disjoint subsets VI and V 2 such that the cut-set consists of all those in V t and edges that have one end vertex the other in V 2 . All edges in the cut-set may be directed from VI to V 2 , or vice be directed from V t to V 2 and others from V2 to Vt. t versa, or some edges may The concepts of spanning trees, fundamental and fundamental circuits, cut-sets are iIIustrated in Fig. 9-15. A spanning tree is shown in heavy lines. Observe that some of the fundamental circuits are directed circuits and others are semicircuits. The five fundamental each corresponding to cut-sets, an edge in the spanning tree, are also shown.)
partitioning

undirected graph) induces

vertices

Ring

Sum

of Circuits:
subgraphs

Just as in
of

undirected

graphs,

we can
ring

from undirected graphs are also applicable

sum of two is another of that are either subdigraphs g I EB g2 subdigraph consisting edges in gl or in g2 but in both. not As in undirected the ring sum of two circuits or semigraphs, (directed in a is either a third circuit or a union of circuit) digraph edge-disjointcircuits. For if we disregard the directions of edges in the circuits, the earlier results
between

tions

define opera-

a digraph.

In particular, the

operation,
Every
sets

EB,

circuits
this

and
group

element of

fundamental circuits with


also.)

to digraphs. Under the ring-sum unions of edge-disjoint circuits form a group. can be expressed as a ring sum of some of the to a spanning tree. The same holds for cutrespect

Directed Circuits Only: The most important of a set of property - n + 1) fundamental circuits in a connected graph G (directed or undirected) is that these circuits form a basis for aII circuits in G. Any circuit in a digraph) can be obtained as a ring sum of some (directed or semicircuit of these circuits. But in many applications we are interested only in the set of Is there a similar basis for all directed directed circuits in a digraph. circuits? The answer, unfortunately, is no. The ring sum of two directed circuits is or edge-disjoint not necessarily another directed circuit union of directed circuits. For example, in Fig. 9-15 the ring sum of directed circuits In fact, it can be shown that a c b EB a d g b = d g c, a semicircuit. there
Set of
e
J.l (=

exists

no binary operation under unions of directed circuits) form


t A

which

aII

directed

circuits

(and edge-disjoint
a directed

a group, in the

let alone

a vector space.)
called
cut-set.)))

cut-set

in

which

all edges

are oriented

same direction is

SEC. 9-8)

MATRICES

A,

B, AND C OF

DIGRAPHS)

213)

Rank Nullity

,.

= 5) = 4) P.

Spanning

tree T'

{a, d,f,

h,

k})

Chord-set toT'

wi th

respect

{b,c,e,g})
(semicircuit))

df
Fundamental
wi

circuits)

dkhc)

(semicircuit))
(semicircuit))

th respect

to T)

khg)
adkhb)

(directed

circui t))

ab)

bcde)

Fundamental cut-sets)

ef)
wi

th respect

to T)

hcgk)

hcgh)
Fig.

9-15

Directed

graph and a spanning


situation

tree.)

The

practical

with

acyclic

significance of this digraphs, the topic of

is to

be discussed

in

connection

Section 9-11.)

9-8.
in

MATRICES

A,

B, AND

C OF

DIGRAPHS)

The Chapter

matrices 7 for matrices

associated
the

with a
orientation

digraph are quite


the

similar

an undirected
consist

graph, with
of the
(instead

following
of

to those discussed basic difference. In undirected

order to account for


cut-set

graphs).

The numbers

+ 1, 0, -1 are regarded
as

of +

1,0, -1

edges, the incidence,circuits, and


only
as

0 and
ordinary
in

for

real

numbers.
arithmetic

Their addition and multiplication (and not modulo 2 arithmetic

interpreted in the case of

are

as

ordinary

undirected graphs).Conse-)))

214)

DIRECTED

GRAPHS)

CHAP.

9)

quently,

the

vectors

and vector
the

spaces associatedwith

digraph

and

its

subdigraphs are over

field

of all real

numbers, and not GF(2).

Incidence Matrix: The to


is edges, and no self-loops vertices

incidence an

n by n

and

columns
==
==

correspond if jth

n vertices, with matrix e of a digraph matrix A == [aij]' whose rows correspond to edges, such that)

aij

1, -1,

== 0, A digraph

edge is incident out of ith vertex, ith vertex, if jth edge is incident into if jth edge is not incident on ith vertex.)
are edges

disregard
in

and its incidence matrix the orientations of the

shown and

in Fig.

9-16. Observethat
change

if we

correspondingly

-1 to 1

identical to Fig. 7-1. incidence matrix, Fig. 9-] 6 becomes 7-1 on the properties of the incidence Observations 1-6 made in Section also hold for digraphs. matrix of an undirected graph, with minor changes, is zero, the rank of the Since the sum (in the real field) of each column is less than n. In fact, we have the of a digraph of n vertices incidencematrix to Theorem 7-2, which can be proved following theorem, identical along

the

similar

lines.)

THEOREM9-6

If

of A(G) =
Deleting

A(

G)

is the - 1.)

incidence

matrix

of

a connected

digraph of

vertices,

the rank

anyone

row from

we

matrix.

The vertex

corresponding to
It was

get Af'
the

the (n
deleted

- I) bye
row

reduced

incidence

is called the

reference

vertex.
7 that if A is the incidence observed in Chapter submatrix of graph, the determinant of every square A is either 0 or 1.This was a result of the fact that the determinant was defined 2 arithmetic in modulo and, therefore, could have no other value. I n the case of digraphs, A is in the real field, and on the incidence matrix the of its square submatrices it would appear that determinants first sight in value. This, however, is not the case, as shown couldacquire integral any the following important theorem.)
Unimodularity

of A:

matrix

of

an undirected

THEOREM

9-7)

The

determinant

digraph,
Proof:

is 1,
The

-1, or o.
theorem

of every square

submatrix

of

A, the

incidence

matrix

of

a squaresubmatrix
or
row M

of A.

can be proved Consider a k by

directly

by

k submatrix

expanding M of A.
M

If

the determinant of M has any column


0 if every

consisting contains

of all the two

of

zeros, det M is clear1y zero. Also det nonzero entries, a 1 and a -1.)))

column

SEC.

9-8)

MATRICES A,

B, AND

C OF DIGRAPHS)

215)

V6)

V4)

c)

VI)

d)

Vs)

(a))

vI
t'2

0
0 0

0
0 0

0
0 0

-I
0 0

0
-I 0

0 -I

V:J

0 0
0 0

0 0
-I 0

V4

-I
0

-I
0

-I

-I
0

0 0
0)

Vs

V6

(b))

Fig.

9-16

Digraph and its incidence matrix.)

Now

column
a single

if det M * 0 (i.e., M is nonsingular), then the sum of entries in each IV! must of M cannot be zero. Therefore, have a column in which there i\037 nonzero element that is either + 1 or -1. Let this single element be in the

(i, j)th

position

in

M.

Thus)
---L 1 \302\267 M.. det M = I det Ii')

where

(k -

1)

Mij is by (k
it q)th

the submatrix - 1) submatrix


must
position.

of

M with
M ij is

its

ith

row

and jth

column deleted.
is nonsingular);
entry,

The
say

also nonsingular
with

(because M
a single
in

therefore, in the (p,

too

have at least one column det Mij about Expanding


M

nonzero
the

this element

(p, q)th

position,)

det

ij

(k

of a nonsingular :t:[determinant - 2) by (k - 2) submatrix

of

M].)))

216)

DIRECTED

GRAPHS)

CHAP.

9)

Repeated

application

of this

procedure yields)
det M =
=:t

1.)

Hence

the theorem.
matrix called
in

.)
submatrix having a determinant (Unimodular matricesalso play
of I,
an

or0
tant

Any is

every square a unimodular matrix.


programming.))

with

- I,

impor-

role

linear

G be a digraph Circuit Matrix of a Digraph:Let with e edges and q An circuits (directedcircuitsor semicircuits). orientation (clockwise arbitrary or counterclockwise) is assigned to each of the q circuits. Then a circuit B = matrix defined as) [bij] of the digraph G is a q by e matrix

bij

I,

if ith circuit

== 0,

includes jth edge, and and circuit coincide,


if

the

orientations

of the

edge

I,

ith

circuit

i{lcludes does not


of the

jth edge,

but

the

orientations

of the

two are
if

opposite,
include the jth edge.)
digraph
in

ith

circuit
matrix

For example, a circuit

Fig.

9h

6 is

a
0

b
0

c
0
I I

d
1

e
0

f g
1 1 I

-I

o.

0
I

-I 0

-I
0

-I
0

0 0
0
0)

-I
Note

the four circuits is entirely clockwise orientation, in the second the third row counterclockwise, and the fourth counterclockwise, clockwise. Changing the orientation of any circuit will simply the sign change of every nonzero entry in the corresponding row. Also note that if we subtract the first row from the second, we get the third Thus the rows are not all row.

that

arbitrary.

The

the orientation circuit in the

assigned to each of
row

first

is assigned

linearly independent (in the real field, Observations 1-7 made in Section undirected graph are applicable to the

of course). 7-3 about


circuit

the circuit

matrix

of

an

matrix

of a digraph

also-with
rows (this

some obvious

minor

changes.
to in

circuit matrix are orthogonal the real field), as proved


THEOREM

Just as for undirected graphs, the the rows of the incidence matrix
9-8.)

of the time

in

Theorem

9-8)
A

Let B and

be,

loop-freedigraph

such

respectively, that the

the circuit columns in

matrix

and

incidence

matrix of a
using

self-

B and

A are arranged

the

same)))

SEC. 9-8)

MATRICES

A, B, AND C OF

DIGRAPHS)

217)

order of

edges. Then)
A.BT

= B.AT

0,)

where

superscript

T denotes
the

the

transposed

matrix.

in B and the kth row in A. If the circuit m does on vertex k, the product of the two rows is clearly zero. If, on the other hand, vertex k is in circuit m, there are exactly two edges on k that are also in circuit m. This situation can occur in (say x and y) incident four different ways, as shown in Fig. 9-17. (The other four with the cases only orientation of m reversed x and yare are identical to these when interchanged.) The possible in row k of A and x and row m of B in column entries positions tabulated for of four each these cases.) yare Proof:
include

Consider
any

mth

row

not

edge

incident

Case
Column

Rowk
x

Rowm
Column 1
y

Dot
y

Product

Column

Column

Row

k.Row

(a)

-I

(b)
(c)

1
-1
1

-1
-1
1

-1
-1

1
1

-1
-1

0
0

(d)
In

0)

each

case, the dot

product

is zero.

Therefore,
B) and

the theorem. Theorem 9-8, it

.)
can

UsingSylvester'stheorem
k)

(Appendix

be shown)

k)

(a))

(b))

k)

k)

(c))

(d))

Fig. 9-17

Vertex k

in

circuit

m.)))

218)

DIRECTED

GRAPHS)

CHAP.

9)

that

in a

digraph

with

e edges)

rank

of B

rank

of

A =

e.)

Moreover, for a connected graph)


rank

of A

I,)

and therefore)
rank

of

B =

I.)

B hold for The A and two important properties of matrices following digraphs also, and can be proved as was done for undirectedgraphs in Chapter in ordinary real arithmetic and not in 7 (except that here we are working
modulo

2 arithmetic).)

1. The nonsingular

submatrices of
with

order

of

A are

in one-to-one

correspondence
vertices.

the

spanning

trees of the

connected digraph of n
J.l

2.

The

nonsingular

submatrices of B
with

of

order

(=

I) are
of

in

one-to-one

correspondence

the chord
of

set

(complement

the

spanning

tree) of the
Tree:

connected digraph
For

n vertices

and e

edges.) a value

Signof a Spanning
submatrix
of

a digraph the
sign

determinant of the
T can T.

nonsingular

+ 1 or

- 1.This
it

of A

corresponding to a spanning
is referred Chapter

tree of

assume either

analysis of a certain class of electrical of the spanning trees.Note that the a for of a tree is defined ordering of verticesand sign only spanning particular in or columns in a matrix A two rows (because interchanging changes edges tree is relative. Once the sign of its determinant). Thus the sign of a spanning the sign of one spanning tree is arbitrarily chosen, the sign of every other or with respect to this tree as is determined negative positive spanning
As we shall

see in

to as the 13, in the

networks

is necessary

to know the signs

spanning

tree.
the

We have Theorem 9-9 for determining Trees: trees in a connected digraph.(An identical in Problem undirected graphs was given 7-20.)) number

Number of Spanning of spanning

result

for

THEOREM9-9

Let Af
number

be

the

reduced

incidence
in

matrix

of

a connected
of)

digraph. Then

the

of spanning

trees

the

graph
det(Afe

equals the value


A\037).)))

SEC. 9-8)

MATRICES

A,

B, AND C OF

DIGRAPHS)

219)

Proof.

According

to

the

Binet-Cauchy

theorem

(Appendix

A))

det(Af. A\037) =

sum
majors

of the products of of A f and A\037.) unless


both
it

all corresponding
spanning tree,
have

Every

case

major of Af or its value is ] or

A\037

is zero
Since

corresponds

to a
tree.

in

which

+] or

- 1,

-1.

majors

of Af and
_)

A\037

the

same value

the

product

is +]

for each spanning

Circuit Matrix: The J.l fundamental respect to some specifiedspanning circuit matrix Bf for a digraph.The orientation fundamental circuits is chosen to coincide with Bf' a J.l by e matrix, can be expressedexactly in of an undirected graph in Section 7-4:)
Fundamental (with
chord

circuits
tree)

define assigned of the

each made by a a fundamental to each of the

that

chord. Therefore,

the

same form

as

in

the

case

Bf
where
I JJ

= [IJJ :

Bt]')

is the
in

identity

the edges

a spanning

matrix of order J.l, and the columns of tree. This is illustrated in Fig. 9-18.)

Bt

correspond

to

d)

d
0

g 0 0

f 0
0

-1
0 0

0
-1

0
-1

0
0

=
f

0
0

= II I #J.I Bf J
I

Fig.

9-18

Digraph and its

fundamental

circuit

matrix.)))

220)

DIRECTED

GRAPHS)

CHAP.

9)

The

cut-set

submatrix
tree

matrix C of a digraph G is alsosimilarly C f , the fundamental cut-set matrix with respect

defined.

And

\"So spanning

is its

to a given

in

G.)

9-9.

ADJACENCY

MATRIX
matrix

OF A DIGRAPH)
used

Another

important

in

the

is the adjacency matrix defined digraphs n vertices, containing no parallel of the

as follows:
the

and study representation Let G be a digraph


adjacency

of with

digraph G is

edges.Then
I

matrix

==

[xij]

an

by n (0,

)-matrix

whose
ith

element)
vertex

x..==I , IJ)
==0 ,)
A

if there

is an

edge directed from

to jth

vertex,

otherwise.) adjacency
matrix names.
matrix

digraph
different

and its

are

shown
different

in Fig.

9-19.
and
it

The adjacency
has
transition

occurs

in many

disciplines,

therefore

the calculus of relations it is called the relation matrix. (Observe that the relation matrix defined in Section 9-3 is the same as the it is called matrix of the corresponding digraph.) In network flows adjacency the connection matrix. It is also known as the precedence matrix or preference in some I n scheduling and matrix sociological applications. critical-path is known as the predecessor matrix. analysis the adjacency matrix Let us make the following observations on the properties of the adjacency X of a digraph G.) matrix
In

the theory

of sequential machines

is called

matrix.

In the

I.

X is

a symmetric

matrix

if and

only if G is
main

symmetric

digraph.

2.

Every nonzero element on the the corresponding vertex.)


4

diagonal

represents

a self-loop at

')

5)

o)

o)

x= 3 4
5 5

0 0
0

0 0

0 0

0 0
0
o)

o)))

Fig.

9-19

Digraph and its adjacency

matrix.)

SEC. 9-9)

ADJACENCY

MATRIX

OF A DIGRAPH)

221)

3.

There

is no

way

of

showing

4. The
and

adjacency sum of each row


matrix

is defined equals

parallel only for a

edges

in

X.

This

is why

the

digraph without
in-degree

parallel

edges.

the out-degree nonzero

the

sum

of each
number

column equals the


of

vertex. The edges in G.


5. Permutation
corresponding

entries

of the corresponding vertex, of the corresponding in X equals of the number


by a
vertices.

of

any

two

rows

accompanied

permutation of
The

the

columns

does
only

not alter the


the

graph.

permutation

merely

corresponds

to a
and

reordering of
if their

Thus

two digraphs
only

are isomorphic if
such permutations.

adjacency matrices differ


the

by

6. If X

is the

adjacency

matrix of
matrix

a digraph G, then
a digraph

transposed by

matrix

XT is the

adjacency

of

GR

obtained

reversing

the

direction of every 7. For any square (0,

edge

in G.

G of
The

n vertices,

I)-matrix Q of order n, there exists such that Q is the adjacency matrix

a unique
of G.)

digraph
of a
con-

adjacency

matrix is used
means

as a tool to
in

investigate

the

properties

digraph, specially by
nectedness

of

a digital
its

computer. For example, the


adjacency

of a digraph

is reflected

matrix

in the following

fashion.

and the Connectedness


only

Adjacency

Matrix:

A digraph is
a way

disconnected if and
X as

if its

can

be

ordered in such expressed as the direct sum of two


vertices

can be

that its adjacency matrix square submatrices X I and X 2

follows:)

x =
[\0371_

.)

(9-6))

:--\037J

Such
have

a partitioning
no edge Similarly,

is possible if and only if the vertices the vertex set in to or coming from going a digraph is weakly connected if and only
a way

in the
X 2. if its

submatrix

Xl

vertices

can be
the

ordered in
form

such

that

its

adjacency

matrix

X can

be expressed in

(9-7) or (9-8):)
X

==

-\037\037--!--\037J,

[ X 2I

X 2J

(9-7))

X =
[\037I--i-\037I:

(9-8))
1)

where Xl and X 2 are square submatrices. Form (9-7) representsthe there is no directed edgegoing from the subdigraph corresponding

case

when
I

to X

to the)))

222)

DIRECTED

GRAPHS)

CHAP.

9)

one

corresponding
that

to

X 2 the

. Form

(9-8) represents
corresponding
a digraph

the case

when

there

is no

directed edge A digraph


connected.

going to
is

subdigraph

to Xl'
if

neither

Therefore,

unconnected we conclude that

and only if the vertices of G cannot be X is expressible in the form {9-6), (9-7),
Number Theorem

nor weakly connected is strongly G is strongly connected ordered such that its adjancency matrix

of 7-8,

Edge concerning

or (9-8). We have the following result, similar to Sequences: X of a digraph G.) the powers of the adjacencymatrix

THEOREM

9-10

The

(i,j)th

entry
the

of r edges from
Proof:

in Xr equals the number ith vertex to the jth.)

of different,

directed

edge

sequences

(By induction)

The theorem
the

is trivially

true for r

= 1. As
The

the

inductive
entry

hypothesis, Xr( = Xr-l

assume
\302\267 X))

that

theorem

holds

for

Xr-

1.

(i, j}th

in

k=l) n

\037

[(i, k)th

entry
of all

in

xr-l].

Xkj

\037 k=l

(number of length

directed edge sequences


vertex

(9-9))

- 1 from
k to

i to

k).

kh)

depending on whether sum (9-9) is nonzero if and only if there is a directed edge sequence r from i to j, whose last of length is from k to j. If the term is nonzero, its value equals the number of such edge edge sequences from i to j via k. This holds for every vertex k, 1 < k < n. Theredirected fore, (9-9)is equal to the number of all possible edge sequences from
induction

according to the or not there is a

hypothesis.

directed edgefrom

In (9-9), x kj = 1 j. Thus a term

or 0,
in

the

i to j.
As

.)
in

the
Xr

case of
the

entry

in

gives

number

Theorem 7-7, it must be kept in mind that of all directed edge sequences from
in

the vertex

(i,j)th i to

j.

These edge sequences fall

three

different

categories:)
which

1. Directed paths from i to j: Those directed edge sequences in vertex is traversed more than once.
2.

no

Directed

walks from i to j:
may

Thosedirected
once,
which
but

edge no

sequences edge

vertex
than

be

traversed

more than

in which a is traversed more

once.

3. Those
more

directed edge
than

sequencesin no easy way


this

an edge

may also

be traversed

once.)
of

from

there is Unfortunately, 2 and 3. This is why


directed

separating

these,

simple

method

cannot
a specified

say, category 1 be employed for


length.)))

enumerating

paths

or directed

circuits of

SEC. 9-9)

ADJACENCY

MATRIX

OF A DIGRAPH)

223)

For example, examine in Fig. 9-19:) digraph

the

fourth

power

of the

adjacency

matrix of

the

I 1

0
I 1

1 I

2 2

2 2

4 == X

O.

000
I I 2)

2 2
The

entry

in the
length third

sequencesof a walk). The


length

second row and third column c b gf(a directed walk four:


diagonal

four

gf

gf

(not

beginning a directed

of entry represents two directed edge sequences and ending at vertex 3: g e c b (a directed circuit) and the remaining circuit). The reader should also examine

two directed edge represents 2 to 3) and d d c b (not from

entries

in X4.

A method the number of spanning Number of Arborescences: of counting 7-23. There is a in a labeled, undirected graph was suggestedin Problem arborescences in a similar for counting the number of spanning formula arborescences of the spanning labeled, connected, simple digraph.(Counting of counting them in a simple, in any connected extension digraph is a trivial and addition connected right away, digraph. The self-loopscan be discarded the number of the b to an existing edge a simply of a parallel doubles edge

trees

with a arborescences-repeating the same arborescences In preparation for the arborescence formula, counting

simple digraph
K(

G of

n vertices, an

by

n matrix

by b.) let us define, for a called the Kirchhoff matrix


replaced

G)

or
==

==

[kij]:)

ku

d-( vJ,) -xu')

in-degree
(i, j)th

of the
in

ith

vertex,

k ij

==

entry
its

the

adjacency

matrix,
in

with a
Fig.

negative
to zero,

sign.)

For example, a digraph and The sum of the entries in


means

K matrix

each

column

are shown in a K matrix

9-20.
which

is equal

that

the n rows

are

linearly

dependent;

therefore,)

det
Next

== O.)

we explore
9-11)

the special

property of

the

K matrix

of an

arborescence.)

THEOREM

A simple

digraph G of
and only
if

vertices

rooted

at

VI if

the

n - 1 directed is an arborescence edges (I, 1) cofactor of K(G) is equal to 1.)


and
with 'l.'n

Proof: (a) Let G be an arborescence Relabel the vertices as VI, 'V2, . . . ,

n vertices

such

that

and rooted at vertex VI. vertices along every directed)))

224)

DIRECTED

GRAPHS)

CHAP.

9)

path
K(

from

G) to

the root conform with


in

v 1

have this

increasing relabeling.
v 1

indices. Permute
zero,

the

rows

and

columns
only

of

Other

Since the entries

in-degree of
K( G) are)

equals

the first column contains i >

zeros.

k ij =

0,

j,

= -x.. k.. IJ IJ')


= k.. II
Then
1 ,)

i < .,
J

i >

1.
at

the

matrix

of an

arborescence rooted
0 0

VI is

of the

form)

-X12
1

-X13
-X23
1 0)

-X14
-X24
-X34

-x

In

-X2n
-X3n

K(G) =

0 0

0 0

o)

o)

o)

o)

1)

Clearly,

let

= 1. the cofactor of the (1, 1) entry is 1; that is, det K 11 and and n - 1 edges, (b) Conversely, let G be a simple digraph of n vertices the (I, 1) cofactor of its K matrix be equal to 1; that is, det K 11 = 1. Since det K 11 \"* 0, every column in K 11 has at least one nonzero entry.

Therefore,)

d-(v;) There

> I,)
to go
=

for i =

2, 3,

. . . , n.)

are only n

edges

around. Therefore,)
1,)

d-(Vi)

for;

= 2,

3, . . . , n,)

and)

d-(Vl)
Now

= o.)
G has

since

no vertex
it

in

circuit

at all,

has

to be a through

an in-degree of more than directed circuit. Suppose that

one, such

if G

a directed

can have any circuit

exists, which ;J, ;2, . . . , ir

vertices Vii' Viz, . . . , Vir. Then the sum of the columns zero. (This is because each of these columns contains exactly for the incoming a 1 on the main diagonal, and a -) two nonzero entries, edge in K 11 from the vertex preceding it in the directed circuit.) Thus these r columns are linearly dependent. Hence det K 11 = 0, a contradiction. Therefore, G has no
passes in K 11 is
n

circuits. If G has

edges

and

no circuits,

it

must

be a tree.

Since

in

this

tree)

d-(Vl)
and)

0,)

d-(v,.} G must

= I,)

for; =

2, 3,

. . . , n,)

be

an

arborescence

rooted

at vertex

VI.)))

SEC. 9-9)

ADJACENCY

MATRIX

OF A DIGRAPH)

225)

The
Vq .

arguments

in (a)

and

(b) vertices

are valid in G

Any

reordering

of

the

rows and columns in the determinant. .)

K(G).

Such

for an arborescence corresponds to identical do not alter permutations

rooted the

at

any

vertex

permutations

of
sign

value or

of

Next we come to
Bott and J.
THEOREM

an

important and

result,

P. Mayberry

was

proved

which was first by W. T. Tutte.)

discovered

by

R.

9-12
digraph

the

Let K(G) be the Kirchhoff matrix of a simple of K(G) is equal to the number (q, q) cofactor
V q .)

G.

Then

the value
in

of

of arborescences

G rooted

at the vertex

of Theorem 9-11 and on the fact that The proof depends on the result Proof: the determinant of a squarematrix is a linear function of its columns. Specifically, if P is a square matrix of n column vectors, each of dimension n, that is,) consisting
P

[p h

P2, . . . , (Pi

+ pD,

. . . ,

Pn])

then)

det P =

det[pbp2,'..
+

,Pi'...

,Pn]

det[php2,...

,p\037,... ,Pn].)

(9-10))

can be

of K(G) that vertex Vj has in-degree of d j . Thejth column of d j different columns, each corresponding to a graph in which v j has in-degree one. And then (9-10) can be repeatedly applied.After of columns can be carried out for each j, j * q, and det Kqq(G) can this, splitting of subgraphs; be expressed as a sum of determinants that is,)
In

graph

G suppose

regarded as the

sum

det
where

Kqq(

G)

\037 g)

det

Kqq(g),

(9-11))

g is a

subgraph

of
in

G, with

the

following

properties: one,

1. Every 2. g has

vertex
n

g has

an in-degree

of exactly
1 edges.

except

vq .

1 vertices,

and hence n

From Theorem 9-11,)


det

Kqq(g)

= 1,

if and
otherwise.)

only

if

g is

an arborescence

rooted at q, of arbo-

=0
Thus
rescences

,)

the

summation
rooted

in Vq .

(9-11)

carried

over

all

g's

equals

the number

at

.)
in

Theorem 9-12 is illustrated in Fig. 9-20. The cofactor of every entry second row of the K matrix is 3. The digraph does indeed have arborescences rooted at vertex 2. For an Euler digraph G, all cofactors of K(G) are equal, because the of each row and the sum of each column zero. Let this common equals

the

three

sum
value)))

226)

DIRECTED

GRAPHS)

CHAP.

9)

0
b

-1
0

0 -1

h K( G) =

-1

3
2

0
0

-1
-1

2
-1

-1
2

a
G)

d)

3)

3)

d)

3)

b)

b)

g)

b)

h)

2)

f)

4)

2)

f)

4)

2)

4)

Fig. of

9-20

Digraph G, its

matrix, u

and all

arborescences rooted
different

at 2.)

all cofactors

of K(G) be u. This

rooted

at any given

vertex in

G. The

is the nUlnber of number of different is given

arborescences

Euler

lines

associated

with
Theorem

each of

these distinct
obtained.)

arborescences

by Eq.

(9-5). Therefore,

9- J 3 is

THEOREM9-]3)
In

an

Euler

digraph

the

number

of
n

Euler

lines

is)

U . II

i = 1)

[d-(v,.}

- I]!.
number

From

connected

Euler

theorem we can compute the balanced digraph. As an example, lines in Fig. 9-10. Its K matrix is)
this
]

of

Euler

lines

in

any

let us compute the

number

of

-1

2 -1

0 -I

0
0

0
0

0
0

2 -]
2

0
-]

0
0

0 -] -]
-]

0
0

0 -]
0

2 -1

0
0

0
0

0
0

0
0

0
0

0
0
0

0 -1

0
0

2 -1
0
2)))

-1 -1

SEC. 9-10)

PAIRED

COMPARISONS

AND TOURNAMENTS)

227)

Hamilas they do in the directed (In this matrix, vertices appear in the order tonian path e2 e 3 e 4 ell e l2 e l4 e IS .) The cofactor of any term in this matrix is 16, and therefore a == 16 in Theorem 9-13. Since d-(vJ == 2 for each Vi in Fig. 9-10,)
8

II =
i

1)

[d-(vJ

- I]! == lines in
of

1.

Therefore,

the

number

of Euler
Euler the

However, for a regular often easier to compute


(Problem

digraph, number

9-10 is 16. Fig. such as the one

in

Fig. other

9-10,

it is

Euler

lines

by

methods

9-18).)

9-10.

PAIRED

COMPARISONS

AND

TOURNAMENTS)

In many experiments, specially in the social sciences, one is required to a number of given objects by comparing only two at a time.This is called where a numerical the method of paired comparisons, and is used in situations measurement is difficult, for individual example, preference for pieces of The items are presented two at a time and he is asked to to a subject music.
rank state

his

preference.

After

having noted the


n

results of

all

possible
n

n(n

1 )/2

paired

comparisons

of the
a natural

objects,

the

experimenter

ranks the

objects

in

order
A

of preference.
digraph

comparison

the results of a pairedclassic experiment of Kendall [9-5] are shown in Fig. 9-21. Six different dog foods {I, 2, . . . , 6} were to be ranked. Each day two of the six delicacies were served to a dog, and the dog estabthe other according to which he lished preference for one food over plate for 15 days, so that all possible finished first. The experimentwas conducted an edge is drawn the from representation, pairs could be tried. In the graph to 2 in Fig. preferred dish to the less preferred. For example, 1 was preferred 9-21. Such a graph is called a preference graph. a rank from a given is, in general, not easy. Establishing preference graph In Fig. 9-21, due to some canine inconsistency, the for example, dog preferred of the three is the best?) food lover 2, 2 over 4, and then 4 over I. So which
is
way

of

representing

experiment.

The

results

of a

2)

6)

3)

5)

4)

Results Fig. 9-21 son experimen t.)))

of a

paired-compari-

228)

DIRECTED

GRAPHS)

CHAP.

9)

On

Tournaments:

A similar situation

is encountered
which
a

in

tournaments.

The

results
every
from

of a
other
vertex

in round-robin tournament may also be represented by

every player has played against in which an edge directed digraph

a to

complete

tournament

result of a
tournament
Ranking

b represents the victory of player a over player b. This is why a complete or asymmetric digraph was called a tournament in Section 9-2. The digraph in Fig. 9-2 I can also be viewed as the The of ranking players in a six-player tournament. problem in a paired-comparison experiment. is identical to that of ranking
Score:

by

has been
player

traditionally

by his

score.
score

A straightforward method of ranking, used in round-robin tournaments, The scoreis the number of games the

and

the one
rank

that
each

is to

terms of the its score.The


corresponding

dog

food,
vertex

the number player


in

of times

the

particular

of a

a tournament

equals

player has won. In preferred is the out-degree of the


dish was

in the

digraph.

Thus if

we

use the

scores for ranking, we would rank the six dog


(1,

foods as)

3),

(2, 5,

6), and

4.)

I and 3 are tied for the first rank; there is a three-waytie for the and food 4 is the least preferred. rank; the vertices is not always a according to their out-degrees Ranking In it the is easiest. this method loses satisfactory method, although particular, if is the tournament the not do comsignificance incomplete(that is, players pete in the same number of games). Path: Another method sometimesusedis to rank Ranking by Hamiltonian in a directed Hamiltonian path, the players such that each player has defeated I 3 2 5 6 4. In this his successor. One in 9-21 such is let ranking context, Fig. us prove the following result regarding Hamiltonian paths in a tournament.)
That

is, foods

second

THEOREM 9-14)
Every

complete

tournament

has a directed

Hamiltonian

path.)

Proof:
By

actual

sketching,

The theorem will be proved the theorem can

by induction

on
hold

the

number

of vertices.
tourna-

be shown
us

to

for all

complete

ments

of

1, 2, 3, and

4 vertices.Let

make

the inductive

assumption

that

the

and then prove that theorem is true for all complete tournaments of n vertices, it of n + 1 vertices. also holds for all tournaments of n + 1 vertices. Let g be an n-vertex Let G be any tournament complete of G. By inductive subtournament complete g has a directed Hamilassumption, tonian path. Let that path be VI V2 . . . V n . Let the vertex present in G but not in g be called v n + l' of n + 1 vertices, the Since G is a complete tournament vertex V n + 1 in G has of the other vertices Vb V2, . . . , V n . The a directed edge either to or from each

following
Case

1:

three cases are possible. The edge between v n + 1 and

V1

is directed

toward

l'

Then

we

have)))

SEC. 9-10)

PAIRED

COMPARISONS

AND TOURNAMENTS)

229)

Vn + I)

Vn + I) Vn)

VI)

Vn)

VI)

(a)

(b)
I

Case

Case

vn +
vI

Vn)

Vi- 1) (c)

Case
Fig.9-22

3)

Three
Vn

cases of Theorem9-14.) and the


Vn

Hamiltonian

path

t'n+ 1 VI V2 . . .

in G,

Case tonian Case to


Vn .

2: There

is

an

edg\037

directed

from

to

Vn +

case, as we move from V 1 to V m we encounter a reversal of direction in the edges incident on V n + 1. This reversal must occur because edge (V 1, V n + 1) is directed toward V n + h but edge (vn , V n + 1) is directed away from v n + 1. Call the vertex at which the first such reversal occurs Vi (Vi may be V n itself). Then edge v n + l' See Fig. 9-22(c). In this case we have a be directed toward (Vi- h V n + 1) must directed Hamiltonian the path VI V2 . . . Vi-l V n + 1 Vi Vi+ 1 . . . V n in G. Therefore,
In this

is VI V2 . . . V n V n + 1, and the path in G, which 3: Instead, both these edgesare directed

proof is complete[Fig.9-22(a)]. l' Then also we have a Hamilproof is complete [Fig.9-22(b)].


from
V1

to

Vn + 1

and

from

vn +

theorem. .)
Coming

back if the

to

the original

know
ranking

that

is

digraph is always possible.


this

problem of a complete tournament,

ranking

the at

vertices,

least

we now one Hamiltonian

also suffers from some drawbacks. For between such a ranking and the scores of the have more than one directed Hamiltonian may players. Second,a tournament and therefore several different are possible. In Fig. 9-21, for path, rankings 1 3 2 5 6 4 and 1 3 5 6 2 4 are two different Hamiltonian instance, rankings. However,
method

of ranking

one,there

may

be discrepancies

Ranking
any

with

tournament
Vi

directed from

Violations: For a given ranking of the n vertices in or incomplete), a violation is defined as an edge (complete to v j if v j precedes Vi in the ranking. For example, in Fig.)))
Minimum

230)

DIRECTED

GRAPHS)

CHAP.

9)

9-21

the

order

13

6 to

order 3 1 to 5, and 1 to 6.
2. The
Ranking

2 564 has the 2 5 6 4 1 has


minimum
given

following
five

two

violations,

violations-edges 1 to 3, 1 edges

4 to 1 and to 2, 6 to 2,
fewest

with

the

number of

violations represents the


be shown
that

possible

upsets

for a

tournament.

It can

a ranking

with

violations automatically includes the ranking to scores, according as well as a Hamiltonian is ranking. Moreover, a minimum-violation ranking Thus this may be considered also meaningful for incomplete tournaments. the best method of ranking. to find one with of n vertices, out of all n! possibleorders However, A method minimum violations is computationally difficult. using dynamic programming has been used and is the best available so far, but it is comminimum
putationally

slow

and

cumbersome.
all n! rankings represents a among all removal from the digraph will eliminate the digraph acycJic. Acyclic digraphs are is, make section.)

A minimum number

of

violations

smallest set
directed
in discussed

of

edges
that

whose

circuits,
the

next

9-11.
In

ACYCLICDIGRAPHS
many situations
with

AND

DECYCLIZATION)

and one is consemicircuits are of no significance, a has a directed circuit. A not or cerned only given digraph us make the is called Let directed circuit folthat has no acyclic. digraph about acyclicdigraphs: lowing observations
whether

I.
2.

edges) is an acyclic digraph, but the in Fig. 9-4 is acyclic, but is not true. For example, digraph
Every

tree

(with

directed

converse
it is

the

not a

tree.
be condensed. That is, the condensation Gc The is G G itself. converse also because if is of an acyclic digraph true, Gc = G, obviously G has no directed circuit. 3. An acyclic digraph represents an irreflexive, asymmetric relation. But of an irreflexive, asymmetric relation is not the necessarily digraph
An

acyclic

digraph

cannot

acyclic.

(Why?)
if and

4. A digraph

G is acyclic directed path.


4 has in
ith

only if every

directed

walk

in

G is

also a

5. Observation
(i,j)th entry k from the
THEOREM

a significant

Xk gives the vertex to the

implication: If a digraph number of distinct directed vertex.) jth


one vertex

is acyclic,

paths

the of length

9-15

Every

acyclic digraph G has


with

at

least

with

zero

in-degree

and at least

one vertex

zero

out-degree.)))

SEC. 9-11)

ACYCLIC

DIGRAPHS

AND DECYCLIZATION)

231)

whose directed length cannot Proof: Consider any maximal path (i.e., a path be increased by an edge at either end) P in G. Let v be the vertex where P starts w be the vertex where it ends. and Since G is acyclic, v and w must be distinct. Now the vertices in G can be divided into two classes: The set VI of vertices that are on P, and the set V2 of the remaining vertices. into vertex in VI' Otherwise, G vertex v from any There is no edge incident would a directed circuit. Also, there can be no edgeincident into v from any have in V2 ; otherwise, of P could have vertex the length been increased by adding this = O. Similarly, vertex w has no edge incident of 'I), d-(v) edge. Thus the in-degree = out of it; that is, d+(w) O. .) 9-16

THEOREM

A digraph G is acyclic if and only if its vertices can be matrix.) adjacency matrix X is an upper (or lower) triangular Proo.f: (a) Let

orderedsuch

that

the

us assume that

X is

upper triangular;
for

that

is,)

= x.. IJ) It can


X3,

0
that

i > j.)
is also

be,seenby

direct

multiplication
X.

X2

X4, . . . , all

powers of

Since

every

diagonal

upper triangular, and so are entry in all powers of X is zero,

G has no

directed circuit. That is, G is acyclic.

Next remove V2 from G - VI. By continuing vertex in the reordering. this process all the vertices are reorderedt as Vb V2, . . . . X of G with the vertices appearing in this Now consider the adjacency matrix order. The first column (corresponding to VI) has all zeros. The second column - V I, and therefore contains all zeros. below the first row represents vertex V2 in G And so forth. is upper triangular. This matrix Thus the adjacency proves part (b) of the
this second
theorem.

that G is acyclic and then the second assume part of the theorem, the vertices of G, as follows: to Theorem 9-15, there is at least According of the vertices let this one vertex in G whose in-degree is zero. In the reordering on VI from G. The be the first vertex VI. Now, remove VI and edges incident G - VI must also be acyclic, because G was acyclic. remaining digraph Therefore, in G - VI is zero. Let V2 be G - VI has also at least one vertex, whose in-degree

(b) For

reorder

The

lower triangular

portion

reordering

of

the

vertices

with

of the theorem can also be zero out-degrees, or by considering

proved

either

by

XT and

GR.

.)

useful

X of a digraph G, the following result is quite Given the adjacency matrix in finding out whether or not G is acyclic.)

THEOREM

9-1 7 only if det(1 size as X.)

the identity
tThis

Digraph G is acyclic if and matrix of the same


is called

X)

is not

equal to

zero, where

is

a topological

also.))) sorting. SeeSection14-8

232)

DIRECTED

GRAPHS)

CHAP.

9)

Proof.

Det(l

X)

if

and

only
I

if the X2 +

inverse (I
...

- X)-l exists.But)
+

(I

- X)-l

X +

Xn

....)

(9-13)t)

cycle of any

This inverse (I - X)-l exists if and only if the infini te series (9-13) converges; that is, Xk = 0 for all k > someN (because X contains only nonnegative entries). However,Xk = 0 for all k > N if and only if G contains no directed edge N or larger. And this is possible if and only if G contains no of length sequence
length.

.)

in many Acyclic digraphs are of enormous importance It inconsiswas out that directed circuits applications. pointed represent tencies in ranking by paired comparisons. Directed circuits may represent undesirable feedback paths in an electrical network. In the project graph of a CPM (critical PERT or path method) (program evaluation and review a directed circuit a technique) represents seriouserror, and must be eliminated. This is becausea directed circuit, a must say abca, implies that activity be completed before activity and c and b a. before before this b, c, Obviously, is an impossible situation and nothing will A in done. similar situation get Decyclization:
computer

programming

often

arises and is

justifiably

known

as the

deadly

encounter or the deadly embrace (Problem 9-26). In deductive logic (where vertices axioms or statements and represent directed edgesrepresent the theorems from or derivation of one statement a a directed circuit circular and hence others), reasoning implies fallacy. Thus it is important with a to know how to break these vicious cycles minimum of effort.In other find a smallest set of directededges whose words, will render the given digraph G acyclic. removal for Consider, example, Fig. 9-2(a). The digraph contains severaldirected circuits:e1 e 2 e 3, e 4 e 6 e 3 , and e 4 e S e 2 e 3. In this simple case, one can tell by that the removal of edgee3 will eliminate all directed circuits. This inspection is the smallest set of edges whose removal makes the remaining digraph whose removal acyclic. Such a smallest set of edges destroys all directed circuit in a digraph G is known as a minimum-feedback arc set in electrical a digraph engineering. I n general, may possess several minimum-feedback arc sets. Obtaining one such smallest set of edges may be called minimal decyclization of a digraph. Minimal of an arbitrary directed graph is at best a tedious decyclization affair. No sinlple method l1as been found so far. One method proposed in the literature (in 1969) uses Theorem as follows: Make the adjacency matrix 9-16, X upper as much as possibleby interchanging rows (and corretriangular below (and on) the principal diagonal) sponding columns). The l's remaining
tThis
(I

identity

can be seen

by

premultiplying

both

sides of

(9-13)with

the

matrix

X).)))

CHAP.

9)

SUMMARY)

233)

represent
I.

a minimum-feedback
all directed
9-11,

arc set. Another


in

method

can

be)

Obtain
Problem

circuits

the

given

digraph

G (using the result


its

of

say).
as
of

2. Express
3. Take
in

each directed circuit

a Boolean directed

sum of
circuit

edges.

the Boolean
2. (The

product

all

expressions

obtained
as

step

a.a

= a,
of

a+
whose arc

absorption laws of a == a, and a + ab

Boolean algebra are applied,such = a.)

4.

Each of

that

resulting terms in the sum of the products represents a set circuits. Pick a term all directed removal will destroy edges this is a minimumof edges; consists of the smallest number
the set.)

feedback

the

To illustrate the procedure, circuits are) directed

let us consider the

digraph

in Fig.

9-2(a).

All

e l e 2 e 3,
Expressing

e 3e 4 e 6 ,

and

e 2 e 3 e 4 e S .)
multiplying

these

as a

product of Boolean sums and e6 )(e


e3 +

out

and

simplifying,
(e l +

we

get)

e2 +

e 3 )(e

3 +

e4 +

2 +

e4

e s)
+

= el e 4
Clearly,
would

e l e 6 e S + e 2e 4 + e 2e 6 + e 3.)

break

number

of these terms represents the set of edges whose removal the smaIIest directed circuits in Fig. 9-2(a). The set with are Both these methods of edges, [e3 }, is the answer we were seeking.
anyone all

impractical

for large

digraphs.)

SUMMARY)

Most

of the
in

important and
this

fundamental

features there

investigated
graphs, from

digraphs:one in
such as
their

We saw that chapter. their which properties


thickness,

are

of directed graphs were two different aspects of


of

planarity,

spanning

are similar to those trees, fundamental

undirected

circuits, and

cut-sets; in
decyclization,

those of

different second aspect, digraphs have properties altogether undirected graphs, such as strong connectedness, arborescence, and

so on.
binary

The close relationshipbetween

relations

and digraphs was

explored.
such

Applicationsof
as in sequence

digraphs

ar.e virtually
in

unlimited.

Some
and

important

ones,

generation
in

telecommunications

paired

comparisons,

were dealt with

detail.

Others

were simply

mentioned.)))

234)

DIRECTED

GRAPHS)

CHAP.

9)

Undoubtedly,

of digraphs For the rest

a great deal more remainsto besaid.Additional properties are presented in the form of problems at the end of this chapter. the reader must the tools on his own, using and results explore
the

presented

in

chapter.)

REFERENCES) and Cartwright [9-3] Norman, for those with little mathematical not covered in background. This book is recomn1ended reading for many of the topics this chapter. was written by Moon [9-7] Specializing even further, a 100-page monograph definion tournaments (complete asymmetric digraphs) alone.This is a compactly written tive book and is highly for those wishing to know all about complete, recommended in operations research, KaufFor applications of directed asymmetric digraphs. graphs mann's book [9-4] is a good source. In particular, Chapter 4 contains an excellent presentation of the prop\037rties of digraphs. (Be prepared for slightly different terminology.) For
has
by

An entire

400-pagebook

been written

Harary,

on

the theory

of digraphs. It is a

textbook written

specially

methods

Chapters 13-17 of Berge [I - I], intermediate-level reading; Chapters 8- 10 of Ore [I-9];and 16 of Harary [1-5] as a more advanced level of reading on digraphs. Chapter The classic works of Good, Kendall, and deBruijn, and Tutte van Aardenne-Ehrenfest have already been referred to. Chen and Wing [9-1] give some properties and interesting of a digraph was the subject of the of acyclic digraphs. Minimal decyclization applications thesis by Lempel [9-6]. doctoral 9-1. CHEN, Y. C., and O. WING, \"Some Properties of Cycle-Free Directed Graphs and the Identification of the Longest Ins!., Vol. 281, No.4, April Path,\" J. Franklin 1966,
293-301. 9-2.

of paired comparison, Kendall's Other books recommended are Chapters

book [9-5]is
5-7

recommended.

in Ore

[1-10]as very

introductory

reading;

GOOD, I.
HARARY, tion

9-3.
9-4.

1946, 167-172.

G., \"Normal

Recurring

Decimals,\"

J. London Math.
Structural

Soc.,

Vol. 21 (part 3),

and D. CARTWRIGHT, F., R. Z. NORMAN, to the Theory of Directed Graphs, John Wiley A.,
New

Models:

An IntroducYork,

& Sons,

Inc., New

1965.

KAUFMANN,

Inc.,
Paris.)

Graphs, Dynamic Programming and Finite 1967. (Originally published in French York,

Games,

Academic

Press,
Editeur,

in 1964,

Dunod

9-5.

KENDALL,

1948;

9-6.
9-7.
9-8.

LEMPEL,

Charles M. G., Rank Correlation Methods, Griffin and Co., 3rd ed., Hafner Publishing Inc., New York, 1962. Company, Feedback Arc and Vertex Sets of a Directed Graph,\" A., \"Minimum

London,

IEEE

Trans.
MOON,

Circuit Theory, Vol. CT-I3, No.4, Dec. 1966,399-403. and Winston, Inc., J. W., Topics on Tournaments,Holt, Rinehart
W. T.,

New

York,

1968.
TUTTE,

9-9.

\"The Dissection of Equilateral into Equilateral Triangles,\" Triangles Phil. Soc., Vol. 44, 1948,463-482. VAN AARDENNE-EHRENFEST, \"Circuits and Trees in Oriented T., and N. G. DEBRUIJN, Graphs,\" Simon Stevin, Vol. 28, 195 I, 203-2 17.)

Proc. Cambridge

PROBLEMS)

9-1.

Prove

that

in any

sum of their

out-degrees;

of all vertices is digraph the sum of the in-degrees and this sum is equal to the number of edges in

to the equal the digraph.)))

CHAP.

9)

PROBLEMS)

235)

9-2.

9-3.
9-4.

9-5.

9-6.
9-7. 9-8.

with 1, 2, and 3 vertices. orientations of a complete graph of four vertices. Characterize each of the resulting relations. digraphs in terms of binary An irreflexive, transitive relation on a set is called a strict partial order. asymmetric, Give two examples of strict partial orders. Show that the digraph of a strict partial order is acyclic. Is the converse also true? The combinations of reflexivity, and transitivity define eight (23 = 8) symmetry, and partial relations. Two such relations are equivalence order. types of binary List the other six and sketch a digraph for each. and study the directed Hamiltonian Define and semi-Hamiltonian circuit circuit

Sketch
Sketch

all

different

(nonisomorphic)

simple digraphs

all

distinct

(nonisomorphic)

in

a digraph.
that

Prove
cut-set.

every

edge in a digraph
digraph,

b\037longs

either

to a directed circuit

or a

directed

For an n-vertex
R

define

an n by n accessibility is a directed path

(or
one

reachability)

matrix

[rij] as

follows:)

rij

1,)

if there

of length

or more from i
= 0,) Devise
that not otherwise.)

to j,

of obtaining R from the powers of the adjacency matrix X. (Note this reachability matrix is slightly from that in [9-3], because we do different include paths of Zero length; i.e., ra is not necessarily one.) a.method
possible

9-9. Is 9-10.

it

matrix
Show

for two R? Explain.

nonisomorphic

digraphs

to

have

the same

reachability

that if R is the reachability matrix of a digraph G, the value of the ith entry in the principal diagonal of R2 gives the number of vertices included in the strongly the ith vertex. connected fragment containing that the following procedure applied to the adjacency matrix X = [Xij] of a digraph G will yield the reachability matrix R of G. Step I: Let Xli, Xl j, . . . , Xl m be the nonzero elements in the first row. Add the element ith, jth, . . . , mth rows to the first row. Replace each nonzero by a 1 (Boolean sum). that there are k additional nonzero elements p\037 Step 2: Suppose q, . . . , r generated in the first row as a result of step 1. Add the pth, qth, . . . , rth rows to the first row, and replace each nonZero element by a 1. l's can be added to the first row by this Step 3: Repeat step 2 until no additional
Show

9-11.

process.
Step

4:

Repeat
by)

9-12.

Prove that
defined

an n-vertex

the process on every row of X. digraph is strongly connected


M = X

if

and

only if the matrix

M,

X2

+ X3 +

... +

Xn,

has

no zero

9-13.

Prove Also

9-14. List 9-15. The Euler


for r =

adjacency matrix. that every Euler digraph (without isolated vertices) is strongly connected. show, by constructing a counterexample, that the converse is not true. all 16 distinct directed Euler lines in Fig. 9-10.
entry.

X is the

the teleprinter diagram or the Good diagram Sketch and label GD(3) and GD(5). Find one in each. [Hint: GD(r) circuit directed Euler line and one directed Hamiltonian has 2 r 1 vertices and 2 r edges. A vertex in GD(r + 1) corresponds to an edge
digraph

in Fig.

9-10 is

called

[abbreviated

as GD(4)].

in

GD(r).])))

236)

DIRECTED

GRAPHS)

CHAP.

9)

9-16.

An edge digraph
1. There

or a

line

digraph
Vi

L(G) of a digraph G is defined


in L(G) for

as

follows:

is exactly

one vertex

2. Whenever edges ei and into a vertex V and e j from the corresponding

every edge ei in G. e j (for a self-loop ej = e;) are such that ei is incident is incident out of the same vertex v, an edge is drawn
Vi

to V j in

L(G).
G, show
that

Show that

GD(r is the the

+ 1) is a line

9-17. If

EIGI 2n 1.E

is the
IG I

9-18. Prove that

number of Euler number of Euler lines in L(G). number of directed Euler lines in
- 1r) 2 2T

digraph of GD(r). lines in an n-vertex Euler


GD(r)
is)

digraph

(Hint:

Use the

results of

Problem

9-16

or use

Theorem 9-13.)

9-19. A

and rotates in discrete steps of 8 degrees, you are to determine its precise 0 position as follows. Divide the surface of the drum into k = 360 /8 sectors, and r conMount paint each sector black or white (or conducting or nonconducting). secutive reading heads-each capable of detecting the color of the sector. one such arrangement of Given some 8, express k and r in terms of 8. Sketch colors on the drum for k = 16.

drum

9-20. What

out of three symbols (letters) x, y, longest circular sequenceformed is repeated. Give one no subsequence (words) of four symbols such [Hint: Form a regular Euler digraph with d-(Vi) = d+(v;) = 3, in sequence. the manner of Fig. 9-10.] 9-21. Prove that any acyclic digraph G is an arborescence if and only if there is a vertex V in G such that every vertex is accessible from v. 9-22. Prove that for every n > 3 there exists at least one acyclic complete tournament of n vertices. (Hint: Use induction.) matrix of a digraph G, and let the vertices in G be 9-23. Let R(G) be the reachability ordered such that the sums of the rows in R(G) are nonincreasing; that is,) is the
such

and z

that

j=l
Show
if

n \037 \037

r\"> IJ -

n \037 \037 j=l) vertices

r k J' in

for every

i <

k.)

R(G)

with this ordering is an upper triangular

of

R(G) that digraph G is

acyclic

if and

only

matrix.

9-24.

9-25.

Prove that a digraph G is acyclic if and only if every element on the principal R(G) is zero. (or accessibility) matrix diagonal of its reachability Prove that an acyclic digraph G of n vertices has a unique directed Hamiltonian in R(G) is n(n - 1)/2. elements if the number of nonzero path if and only
are

9-26. There

15 computer

programs that

must

be processed

according to

the following

set of orders:)
1 > 2, 7,

13,

2 > 3, 8, 14,
3

>

9, 15,

4> 3, 5 > 4, 11,


6

>

5, 12,
6,)))

7>

CHAP.

9)

PROBLEMS)

237)

8 >

7, 9, 14,

9 > 15,

10> 4,9,

11> 10,

12>11,
13

>

7, 12,

14 >
where

13,15,
processed

1 > 2, 7, 13 means that after 2, 7, and 13 can be programs only 1 has been processed. Is it possible for the programs to be processed? program If so, give a processing sequence. [Hint: Write X(G); derive R(G) from X(G) using 9-23 to check if G is acyclic.] Problem Problem

9-11.Use

9-27.

A digraph defined on

the

relation

\"is

a parent

of\"

is called the

(Genetic digraphs digraphs.

are

useful

in biology.)

Investigate

properties

a genetic digraph. of genetic

9-28. Use digraphs


missionaries

solve the classical problem of \"three cannibals and three edible to cross a river in a boat that can hold at most two people, and all the missionaries and one of the cannibals can row the boat. Also, at no time should the cannibals outnumber the missionaries on either shore.\" (Hint: by a directed edge.)))) Represent each state by a vertex and a possible transition
to seeking

10)

ENUMERATION

OF GRAPHS)

Arthur

Cayley graph

(1857), theory

interested in
different hydrocarbon

one of the founding for the purpose

fathers

of graph
trees.

of counting

The

theory, became number of

trees

with

paper, a great tion) of different


some

vertices gave him the number of isomers of the saturated atoms, that is, C n H 2n + 2 . Since Cayley's classic deal of work has been done on counting (also called enumeraof graphs, and the results have been applied in solving types
of n n carbon

practical

problems.

been in earlier introduced Some enumeration problemshave already 2 the number of edge-disjointHamiltonian chapters. For example,in Chapter was discussed. in the complete graph of n vertices Enumeration of circuits trees in Section 3-6; finding all spanning trees in Section 3-9; the number of of vertices of length r between a specified different pair edge sequences the number of different 7-24; (Theorem 7-8); Problems 7-20, 7-23, and at a given vertex in Chapter rooted arborescences 9; and the number of directed Euler different lines in a digraph, also in Chapter 9, were all probIn this chapter a more unified to enumerlems of counting approach graphs. ating graphs will be taken. Certain enumerative techniques will be developed A thorough and used for counting certain types of graphs. exposition of is the most powerful tool in graph enumeration, theorem, P6lya's counting the central feature of this chapter.)

10-1.
All

TYPES

OF ENUMERATION)
problems number

graph-enumeration the

fall into two

categories:)
a particular)

I.

Counting

of different
238)))

graphs (or digraphs) of

SEC. 10-1)

TYPES

OF ENUMERATION)

239)

for example, all connected, two circuits.


kind,

simplegraphs with
of a particular
type

eight

vertices

and

2.

Counting

the

number
number
in

G, such
vertices
The

as the
type of

of subgraphs
of
G.)

in a
length

given graph
k

edge-disjoint

paths of

between

a and b

second

graph G and
encountered

problem usually
of this

involves

a matrix varied

representation
often

of as
this

manipulations

matrix.
not

those
chapter.

in

the

in practical applications, are first category. We shall not

Such problems, although


as

and

interesting
in

consider such
is of
utmost

problems
importance

In problems must be clearly

of type
distinct

the

word
the

\"different\"
graphs

and

understood. If
from

are

labeled

(i.e., each vertex is

graphs are counted.On the other case of unlabeled the word \"different\" means nonhand, graphs and set of each is as one. counted isomorphic, isomorphic graphs As an example, let us consider the problem of constructing all simple - 1 with n vertices and e There are unordered gra,phs edges. n(n pairs of )/2 vertices. If we regard the vertices as distinguishable from one another (i.e.,

assigneda name
in the

all others), all

labeled

graphs),

there are)
1\302\273

( 1 0-1 ))

c(n:
ways

))

of selecting

e edges

to form

the

number
Many

of simple
of these
for

labeled graphs with

Thus expression graph. n vertices and e edges.


is,

(10- I) gives

the

except

the

labels

graphs, however, are isomorphic(that of their vertices). Hence the number


and

they are of simple,

the same unlabeled

that given by (10- I). an equivalence relation unlabeled (Problem 10-1). The number of different graphs (of a certain type) of equivalence classes, under isomorphism, of the labeled equals the number For example, we have 16 different labeled trees of four vertices (Fig. graphs. these and trees fall into two equivalence classes,under In 3-15), isomorphism. class, and the Fig. 3-15 the 4 trees in the top row fall into one equivalence Thus we have only two different unlabeled trees of remaining 12into another. four vertices(Fig.3-16). Let us now proceed with counting certain specifictypes of graphs.) vertices
Among

graphs of n

collection

e edges is much smaller than of graphs, isomorphism is

THEOREM

10-1
of

The

number

simple,

labeled graphs
2n(n-l

of n
)/2.)

vertices

is)

( 10- 2))))

240)

ENUMERATION OF

GRAPHS)

CHAP.

10)

Proof:

The numbers of simple

graphs

edges are obtained by substituting The sum of all such numbers Then the use of the following
+
(\037) (\037)

0,
is the
identity

1, 2, . . . , n(n
proves

vertices and 0, 1,2, . . . , n(n - 1)/2 1)/2 for e in expression (10-1). number of all simple with n vertices. graphs
of n the theorem:)

+
(\037)

...

k (k

1)

+ (Z) = 2k .

.)

10-2.

COUNTING

LABELED

TREES)

Expression

graphs
others

of

n vertices

(10-1) can and n

be used to obtain - 1 edges.Someof


circuits.

the these

number

of simple

labeled

are going

will
which

3-10,
THEOREM

be unconnected graphs with the number of trees.) gives


3-10)

Let

us

trees and now prove Theorem


to be

There

are nn-2
Theorem

labeled trees with


3-10:

n vertices

(n >

2).)
T be labeled1,2,3,. .
having

Proofof
Remove

Let the
the

vertices edge

of a tree

.,

n.

the pendant

vertex (and

incident

on it)

the

smallest

label,

which is, say, at. Suppose that b t was the vertex adjacent to at. Among the remainwith the smallest label, and b 2 be let a2 be the pendant vertex ing n - I vertices is repeated on the vertex adjacent to a2. Remove the edge (a2, b 2 ). This operation and then on n - 3 vertices, and so on. The process remai ning n - 2 vertices, the is terminated after n - 2 steps, when only two vertices are left. The tree T defines
the sequence)

(bb b 2 ,...,
uniquely.

b n - 2 ))

(1 0- 3))

For

Note that
Conversely,

a vertex

example, for the i appears in


given

tree

in Fig.

10-1 the

sequence
if

is (I,
it is

1, 3, 5, 5, 5, 9).

sequence

(10-3)
n

if and only 2 labels,

not pendant

(see
be)

Problem 10-2).
a sequence

(10-3) of
8)

an n-vertex

tree can

())

4)))

Fig.
which

10-1
yields

Nine-vertex labeled tree, sequence (1, I, 3, 5, 5, 5, 9).)

SEC. 10-3)

COUNTING

UNLABELED

TREES)

241)

constructed

uniquely,

as follows: Determinethe

first

number

in the

sequence)
( 1 0-4))

1,2,3, . . . , n)

in sequence (10-3). This number that does not appear is a l' And thus the clearly In edge (ai, b 1 ) is defined. Remove b 1 from sequence (10-3) and al from (10-4). find in the the remaining sequence of (10-4) the first number that does not appear remainder of (10-3). This would be a2, and thus the edge (a2, b 2) is defined. The till the sequence (10-3)has no element construction is continued left. Finally, the last two vertices remaining in (10-4) are joined. For example, a sequence) given

(4,4,3,1,1),)

we can construct is (5,4). Next,

a seven-vertex (4,3).

tree as

follows: (2,4) is the


and 7)

first

edge.
in

Then

(3,1),

(6,1),

finally

(7, 1),

as

shown

The second Fig. 10-2.

.,)

Fig.
4)

10-2

quence
n

Tree constructed (4,4,3,1,1).) we can

from

se-

For each
n numbers,

of the

- 2

elements in

sequence

(10-3)

choose anyone

of

thus forming)
nn-2)

( 1 0- 5))

- 2)-tuples,eachdefining a distinct labeled tree of n vertices. And since each tree defines of these sequences uniquely, one there is a one-to-one correspondence between the trees and the nn-2 Hence the theorem. sequences. .)
(n
Rooted

Labeled the

Trees: nn-2 labeled

In a

For each of
of

rooted graph one vertex


n

is marked

trees we have
a root.

rooted

labeled

as the root. because trees, any

the

n vertices

can be made

Therefore,)

THEOREM 10-2)

The number

of different

rooted,

labeled trees with


nn- 1 .)

n vertices

is)

( 1 0-6))
given

All rooted

trees for

I, 2, and 3

are

in

Fig.

10-3.)

10-3.

COUNTING UN

LAB fLED

TREES)
of

The problem

of

enumeration

unlabeled

requiresfamiliarity

with

the

concepts

trees is more involved of generating functions and partitions.)))

and

242)

ENUMERATION OF

GRAPHS)

CHAP.

10)

n
1

Labeled free trees


.

La

beled

rooted

trees

2f

\0371 3

\037I 03
3

fl

3 4\037 .
1

u2
u3

..2

01

02

ul

\0372

\0372

\\;:3

\0373

\\12)
\0373

Fig. 10-3 Rooted labeled trees of one,

two,

and

three vertices.)

Generating
One

Functions)

of the

most

useful

tools

in enumeration

techniques is the generating


series)

function. A

generating

function
f(x)

I(x)

is a

power
a2x
2

== a o +

a1x +

...)

( 10-7))

in which

some

dummy
depends

variable
on a
function)

x. The coefficientOk of Xk is the desired number, collection of k objectsbeing enumerated. For in example,

the generating
+

(l

x)n =
(\037)

+
G)x
the

G)X2

(;)x

...

C)xn,) of n

(10-8 ))
different

the

coefficient

of

\037k

gives

number

of distinct combinations

objects

taken

k at a
example,

time.
consider

As another

the following
(1 +
00

generating
x3+ xk.

function:)

(1

- x) - n

==

x + x2
n +

...)n
( 1 0- 9))

==

k
k)

- 1

k=O

I:

The

coefficient

of

Xk

in

(10-9)

gives the ways

of selectingk

objects

from

n)))

SEC. 10-3)

COUNTING

UNLABELED

TREES)

243)

(distinct)

objects

with unlimited
are

repetitions.t Note that

the

variable

x has

no

We significance. The generating

interested
function

called a
function

counting

series

only in the coefficients. is used as a counting deviceand An or an enumerator. operation

is therefore

on
the

also a generating
sequence

is

simpler

coefficients

ao'

at,

than a 2, . .
to

. . Fora
Chapter

the corresponding
detailed

operation on
in

of

treatment

of generating
[10-1].)

functions,

the reader is referred


Partitions)

2 in [3-11]

or Chapter 3

Another
that

useful

and

important

concept
When

in enumerative
a positive

of

a partition
of

as a sum

of a positiveinteger.
integers)
p ==

combinatorics is integer p is expressed

positive

At +

A 2 A3

+ >

A3 +

... +
>
Aq

Aq, 1,)

such

that)

At

> A2

>

...

>

( 1 0-1 0))

the q-tuple is called (3 1 1), (2 2 1), (2 1 1

partition

of

integer

1), and

(1 1 1 1 1) are parts
parts

p. For example, (5), (4 1),(3 2), of the the sevendifferent partitions


It is
exam

integer 5. venient to
partition

The integers, A;'S, are called represent the repeated

of the partitioned number p. by means of exponents; for

conpIe,

as (2 1 3). (2 1 1 1) is written The partitions of an integer p may be unrestricted or may have some restrictions on them, such as no repetition of any part [i.e., Ai =1= A j in (10-10)], k is allowed. or no part greater than The number of partitions of a given is obtained with the function. For often of some integer p generating help the in the coefficient of Xk example, polynomial)

(1 +
gives
page

x)(1 + x2 )(1
without

x 3)

. . . (1 +

))

( I 0-11 ))

the
111,

number
[3-11]).

of partitions,

repetition,

of an

integer k <

p (see

Partitions are important to us because many graph-enumeration can be expressed in the form of partition problems.)

problems

Rooted Unlabeled
Coming

Trees)

is one

in

which

back to counting trees, let all vertices except the


can

us recall that a rooted, unlabeled tree root are assumed alike.Let un be the)

tThe

result

be proved

as

follows:

let a specific

selection be a

list

of k

order. The a;'s are not a3 + 2, . . . , ak + k


list is distinct.

1 by

necessarily adding selection integers

Thus

every distinct

as a selection

of k

Let the n objects be labeled 1, 2, 3, . . . , n, and in nondecreasing integers at, a2, . . . , ak arranged distinct. From this list we get a new list at, a2 + 1, in the new 0 to at, 1 to a2, and so on. Each term with unlimited repetitions can be identified uniquely from integers 1, 2, . . . , n + k - 1.)))

244)

ENUMERATION OF

GRAPHS)

CHAP.

10)

w)
Fig.

,)
into

10-4

Rooted

tree decomposed

rooted

subtrees.) the number is exactly

of unlabeled, rooted trees of n vertices, and let un(m) those rooted trees of n vertices in which the degree of the
number

be root

of m.

Then)
nt

Un

==

m= 1)

\037

un(m).

Any

rooted

tree T

of n
m

vertices

and

with root R
in

of degreem

can

be looked

upon as composed of edge between its root

rooted

and

tree is composed of four rooted In an n-vertex tree T the


thus

subtrees, R. For example,


subtrees.
n

each attached
Fig.

to R

by

means

of an

10-4

an II-vertex,

rooted

vertices

are

distributed

subtrees, and

T defines

pose that

k j is

the number

of such subtrees(in
3k J +

an m-part partition

of the
T)

number

among the m n 1. Sup-

with

j vertices. Then)

kt + 2k 2
and)

... +
+

(n

I)k n -

== n

1)

( I 0-12) ( I 0-13))

k t + Note

k2

kJ +

... + kn - t
(0

== m.)

that Eqs.
in

(10-12) and (10-13)represent an


i appears

m-part

1,

which

integer

ki

times

< ki

<

In Fig.10-4, for

- I).

partition

of integer

example,)

==

11 ,

m == 4 ,)

k t == ],

k2
==

==

2,

ks
==

==

I,

kJ
Thus and)

==

k4

k6

==
\037

k7

==

kto

==

O.)

k j == 4
==

\037jkj
One

10.)

U distinct can construct rooted trees withj unlabeled vertices.Out of j subtrees trees we select k j trees to form of T. Since the same tree may the more than once as a subtree of T, we have the problem of finding appear number of ways of selectingkJ objects out of U j objects with unlimited repeti-)))

these

SEC.

10-3)

COUNTING

UNLABELED

TREES)

245)

tion.

According

to Eq.

(10-9),this

number

is)

( 1 0-14)) (Uj+k:j-I).) Since


distinct

each such
trees

selection can be made


this specific partition
_ -

independently,
is)

the

possible

number of

for

Un

( k I'

k 2' .

. . ,k n-

uI + k (
k l

U2

k2
k 2

I)

- 1 ...

Un- 1

knkn-I

)(

)
( 10-1

5))

where

un(k

l' k 2 , . . . , k n - I )

stands

for the number

of

n-vertex,

rooted

trees

corresponding

to the

partition)

lk12k23k3...(n_l)kn-l.)

Addition
yields

of un(k p total

k 2' . . . , k

n-

I)

over

all possible
is,)

partitions of

the

number of spanning
U n ==
n -I \037 \302\243..Jrr

trees. That
U. J +
1

k. J
k
. J)

. )

j= partitions of n - I

(10-16))

is \"a recurrence we have obtained in (10-16) relation-a solution It the number of of combinatorial rooted, gives Un' many problems. typical unlabeled trees of n vertices, in terms of Up U 2 ' . . . , Un-I' To use this relation, one builds up numerical tables in a step-by-step fashion. For example,) What
U I)

== 1
1

U2 =

+
11

(U
u 3

1)

= I,

2 + (U

1)

+
(U

1)

2.)

To

evaluate

U4 ' we first
(3),

have to
(2,

find

all

partitions

of integer
1).)

3. These are)

I),

and

(I, I,

The

sum

of the 3+

respective terms contributed by

these

partitions

is)

U4 =

(U
Similarly,

I)

+
(U

I)(U
observe
that

1)
the

Cl +:
4 has five
1)

4.)

to evaluate

Us we

integer

different)))

246)

ENUMERATION OF

GRAPHS)

CHAP.

10)

\037) \037)

v)

\\V)

Fig.

10-5

Rooted,

unlabeled trees of one,

two,

three,

and four

vertices.)

partitions,

and these are)


(4),

(3,1),

(2,2),

(2, 1,

1),

and

(1,

I, 1,

1).) is

The number of rooted treescorresponding to obtained using The sum yields us:) (10-15).
Us
== U 1

each

of these five partitions

3
+

Ul

1 U2 +

U2

(
==

422 )
1 +

(
1 +

+ )

U3

U4

(
9.)

1 +

2+ 4

==

And
four

vertices

so on. In Fig. 10-5, all are shown.


involved.

rooted,

unlabeled

trees of

one, two, three, and

Clearly, computation of

un

for,

say,

==

tedious and

It requires

obtaining

are 490 partitions of 19),computing 19 (there of the combinatorial product term)


U

20, using (10-16) is extremely all possible partitions of integer U 19' U 18' . . . , u 2 , U l' evaluation

j +

kj
k. J)

for

each

partition,

and then taking the sum

of all

490

such

terms.
in

some of these difficulties Counting Series for Un: To circumvent let us find its series of (i.e., the generating counting putation Un' where) u(x),

com-

function)

u(x)

==

u 1x
00

U2 X 2 +
n

U 3X 3

+)
( 1 0-1 7))

==

n=1)

I:

unx
00

== x \037 U nxn
n=1)

Substitution

of(10-16)
yields)))

in (10-17)

and

substitution

ofn

1 by

its

partition

as

in (10-12)

SEC. 10-3)

COUNTING

UNLABELED

TREES)

247)

00

u(x)

== x \037 \037. n=1) partitions of n - 1

U1 + (

k
k

l 1

I
X

k1

U2 + (

k2 k2

- l

)
k nk npositive

x2k2

...
(

Un - 1 +

( 1 0-18))

(n-l )knl. X )
a partition

1)

Observing

that every
(10-18)
U 1

sequence of
be rearranged
1 1

integers

forms

of

some integer,
U(x) ==
X

can +

as)
U2 +

k
k

I
Xkl

[ kl=O

i:

k2
k
2

- l

(
. .

)
Un-l

J[

\037 k2-0

)
]

x2kl

J (10-19))

\302\267 \037 .\302\243..J [ k n -l=O

+ knk n1)

n-l )k (n- 1) X( )

...

Substituting

the identity

(1
in (10-19)

xm)-p

==

t )=0

p+
(
])

\037

l
xmj

)
is,)
3

gives us the desired counting


U(x) == x(I
00

series. That

- x)-ul(l -

x )-u2(1
2 r

)-U3 . . .) (10-20))

== x

II (1
r=1)

xr)-u

Calculation

of

Un

from

(10-20)
substituting

involves
the

building
values

up a

table

of

u i for
first

==

I,

terms

- 1, and 2, 3, . . . , n in the series (10-20)are)


U(x) == x

in (10-20).

The
7

10

2 3 + x + 2x +

4x 4
9

9x s

+ 20x6

48x

+
The

115x

286x

719x 10 +

....)
extend
an
the

(IO-20a))

reader

should
function

verify
u(x)

(10-20a) himself and


can be of both

expansion

through

another

10 terms.

The generating
follows:

expressed

in

alternative

form
get)

as

Taking the

natural

logarithms == In

sides of Eq. (10-20), we


U r In(I

In u(x)

00 \037 r=1) 00

- xr )

== In

x +

r=1
00

\037

00 ri x U r \037 -=-

i=1
00

I)

=-=

In x

+ L

;=1 I
00

-;- L r=1)
1 -;-U(Xi).
I)))

ri
UrX

== In

x +

\037 i= 1

248)

ENUMERATION OF

GRAPHS)

CHAP.

10)

Therefore,)
U ( X ) == Form

xe

\037\0371

(l/i)u(x')
.)

( 1 0- 21 ))

(10-21)

is due
the

to George Polya,

whereas

(10-20)

is Arthur

Cayley's.

rooted To obtain function for (free) unlabeledtrees from generating at a tree as unlabeled one can look of rooted subtrees, trees, (free) composed vertices in the tree. For at some all other sort of central vertex distinct from this, we shall use the concept of centroid in a tree.)

Centroid)
with In a tree T, at any vertex v of degree d, there are d subtrees only as the number of each subtree at v is defined vertex v in common. The weight of as the the vertex v is defined in the subtree. Then the weight branches of of the heaviest of the subtrees at v. A vertex with the smallest weight weight of T. in the entire tree T is called a centroid it can be shown that Just as in the case of centers of a tree (Section 3-4), It either two centroids. tree has one centroid can or also be shown that every 10-6 a tree with if a tree has two centroids, the centroidsare adjacent. In Fig. tree with and a two centroids a centroid a centroidal (called a (called tree)
bicentroidal

tree)

are

shown.

The centroids
are

are shown

enclosed

in circles,

and

the numbers next

to the

vertices

the weights.)

Free UnlabeledTrees)
Let

t'(x)

be the counting
bicentroidal

series for
trees.

centroidal

trees,

and

[\"(x)

be the
all

counting series for


(unlabeled,

Then
two.

t(x),
That

the counting
is,)

series for

free)

trees,

is the sum
t(x) ==

of the
t'(x)

+ [\"(x).)

(10-22))

that an n-vertex bicentroidal tree can be regarded trees each with n/2 == m vertices, and joined at tree will always have an even number of their roots by an edge. (A bicentroidal == 2m vertices n trees with number bicentroidal is) the of Thus vertices; why?)

To obtain

[\"(x),

observe
rooted

as consisting

of two

7) 6) 6) 7) 3) 6) 7) 5)

(a) Centroidal Fig.

Tree)

(b)

Bicentroidal

Tree)

10-6

Centroid and

bicentroids.)))

SEC.

10-3)

COUNTING

UNLABELED

TREES)

249)

given

by)

t\" n

Um

+
2

=
)

um(u m +
2)

1) ,

(
and

therefore)

t\"(x) =
=

m= 1

i:

um(u

m 2)

1) x 2m

-1 L; 2 m=l
1

U mX

2m

-1 L; 2 m=l)
\037

(u

mxm)2

(10-23))

_ -2
The

2 UX ( ) +

m\037l

( Umx

m 2 ) .)

If n is tree can be odd or even. number of vertices, n, in a centroidal T his maximum the have is maximum the centroid could odd, 1). weight ten is achieved only when the tree consists of a path of n - 1 edges. On the other the centroid if n is even and the tree is centroidal, the maximum hand, weight is achieved when the degree could possiblyhave is t(n - 2). This maximum of just one edge. of the centroid is three, and one of the subtrees consists an n-vertex (free) n is it is clear that whether odd or even, Thus, regardless tree can be regarded as composed of several centroidal rooted trees, rooted at - 1)/2J the centroid, and none of these rooted trees can have more than L (n x. I n view of where than the no denotes edges, largest integer greater Lx J
this

observation,
missing

an

involved
steps

manipulation

of Eq.
=
m\037l

leads (10-21)

to

the

fol-

lowing (for

see [10-3]):)

t'(x)

= u(x)

U2

(x)

(u mx

)2.)

(10-24))

Adding

(10-23) and (10-24), we get the


t(x)

desired counting
(x)

series:)

= u(x)

\037(u

2 u(X \302\273).)

(10-25))

This

relation,

which gives the


first

tree-countingseriesin
by Richard

terms
in

of the
1948

counting

series, was
=

obtained

Otter

and

rooted-tree is known

as Otter's formula.
leX)

The

first

10 terms
+
8

of (10-25)are) 2x 4
9

x +
+

x2
23x

x3+
+

3x s

+ 6x6

Ilx

47x
it

106x 1o +
another

....)
The
first

The

reader

is encouraged

to extend
given

by

10 terms. book

26

terms

of both
By

u(x) and lex) are


now

in

Riordan's

[3-11], page

138.
is an
types

you

must

involved subject. And


of graphs-rooted

of graphs have the impression that enumeration it is. So far we have enumerated only four varieties. and free trees, both labeledand unlabeled
indeed

It

is)))

250)

ENUMERATION OF

GRAPHS)

CHAP.

10)

difficult
provided

to proceed further without counting by a general

some then

additional
it

enumerative
shall can

tool. This is
first

theorem due to P61ya. We


show how

state

and discuss
ing

P6lya's theorem

and

be applied

for count-

graphs.)

10-4.

POLYA'S

COUNTING

THEOREM)

in understand To theorem, we need a few additional P6lya's concepts we shall first define a permutation and combinatorial theory. In this section Then we shall show how a see how it can be represented in different ways. a P can form a group (called a permutation set of permutations under group) called we shall T hen introduce a binary operation composition. polynomial called the cycle index of a permutation group P. Finally, we shall show that D to a range R (both D and all mappingsf,.'s from a domain R being finite) are divided into equivalenceclasses by any permutation group P acting on the

domain D.
After

introducing

these

concepts
And

configuration-counting

series.
P6lya,

the celebrated

theorem of
of the

we shall define figure-counting series and will be followed by the statement of which the configuration-counting expresses
this

series in

terms

figure-counting
of the

series and the cycle index


will

of

the

permu-

tation group. two illustrative


If P6lya's

The statement
examples.

theorem
to

be

followed

by discussion and

theorem and the

buildup

it do

theorem and be able


Permutation)

you, don't worry; you


to

are not
use

alone.

What

is important
different

to not appear very intuitive is to understand the


types

it for counting

of graphs.)

On a finite from A onto

set

A of

some objects,

a permutation
a bed
( bdca)

11: is b, c,

a one-to-one d}. A

mapping

itself.

For example,

consider a set fa,


==

permutation)

11: 1

takes

a into b, b into d, c

into

c,

and
11: 1 (a) 11: 1 (b) 11: 1 (c) 11: 1 (d)

d into
== == ==

a.

Alternatively,

we

could

write)

b, d,
C,

== a.)

The

number

of elements

in

the

object

set on

which

permutation

acts

is)))

SEC.

10-4)

POLYA'S COUNTING

THEOREM)

251)

called the

degree of the
can
element

permutation.

The

degree

of

11: t

in

the

above

example is

four.
A

permutation
an

also be
of the
I

represents
.
mappIng.

represented by object set and


.
11: t

a digraph,
the

in which
edges

each vertex
the

directed

F or

examp

e, t h e

permutatIon

grammatically

by Fig.

10-7.)
b)

a bed = ( b d c a)

represent

IS

represente

d dIa-

a)

c) d)

Fig.

10-7

Digraph of a

permutation.)

that the in-degree and the out-degree of every vertex in the a permutation is one. Such a digraph must into one or decompose This suggests yet another way more vertex-disjoint of directedcircuits (why?). a permutation-as a collection of the vertex-disjoint, directed representing
Observe

digraph of

circuits

(called the cycles of the


as

permutation).

Permutation
(\037\037 \037:)

can
is called

thus the

be

written

(a b d)(c).

This compact and

popular representation

The number of edges in a permutacyclic representation of a permutation. tion cycle is called the length of the cycle in the permutation. Often the only information of interest about a permutation is the number of various A of cycles lengths. permutation 11: of degree k is said to be of type

(up

U 2'...,

u k )if11:hasu
(a b d)(c) (2, 0, 2,

i cyclesoflengthifori

1,2,...,

k. For example,
(a bf)(c)(d

permutation

is of type

is of type

(I, 0, 1,0)and
...

permutation

e h)(g)

0, 0,

0, 0, 0). Clearly,)
2u 2 + 3u 3 +

IU t +

kU

k.)

(10-26))

Another

introduce

useful method for indicating the type of a permutation is to k dummy variables, say, Y l' Y 2' . . . , Y k' and then show the type
by

of permutation

the

expression)

Y 12.\" Y

O'I

0'2

Y k')

O'Ie

(10-27))

Expression (10-27) is
structure

called the

cycle

structure

of

the

eight-degree

permutation

of 11:. For example, the cycle b (a f)(c)(d e h)(g) is) 2 Y 1

2 O 2 O o o o o Y 1 Y2 Y 3 Y4 Y S Y6 Y 7 Y8 Note

2 Y 3')

that

the dummy

variable y i

has

no

significance

except as

symbol

to)))

252)

ENUMERATION OF

GRAPHS)

CHAP.

10)

which

subscripts

(indicating the lengths) and


distinct have

exponents (indicating
(acting
[10-1]).

the

num-

ber of
So
permutation

cycles) are attached. Two


the

permutations

on the same

object set) may


far we

same cycle structure


the

(page 149in
and
of

have discussed only


Let

representation

properties

of a
col-

individually.

us now

examine a set

permutations

lectively.

On a
including

set A
the

example,

we have a total of k! possible permutationswhich takes every element into itself. For the following are the six permutations on a set of three elements
with

k objects,

identity

permutation,

{a, b, c}:)

(a)(b)(c), (a b)(c), (a c)(b), (a)(bc),


Their cycle structures,
respectively,

(a

b c),

(a c b).)

are)

Yl,

YIY2'

YIY2'

Y 1Y2'

Y3'

Y3')

(10-28))

Composition
Consider

of
the

Permutations)

two permutations
1t 1

1t 1

and

1t 2 on

an object
I

set {I,
.)

2, 3, 4, 5}:)

==

I 2
( 2 1

345
4 5 3)

and

1t 2

==

2 3

4 5
2 5

(3

composition
by

of these
first

two permutations
1t t
and

1t 2 1t 1

obtained

applying

then

applying

is another permutation 1t2 on the resultant. That is,)

1t 2 1t 1(1) == 1t2(2)
1t 2 1t 1 (2)

== 4,
== == ==

== 1t 2 (1) == 1t 2 (4)

3, 2, 5,

1t 21t 1 (3)

1t21t 1(4) == 1t 2 (5) 1t21t 1 (5)


Thus)
1t 2 1t 1

== 1t 2 (3) ==

== I.
.)

12345
( 43251

)
same

Thus

among
binary

a collection
operation.)

is a

of permutations on the

object

set, composition

Permutation

Group)

A collection

of m

permutations ==

P == {1tl' {aI'

1t 2 ,

. . . , 1t m J acting

on a

set)

a 2,

. , akJ))) \302\267 \302\267

SEC.

10-4)

POLYA'S COUNTING

THEOREM)

253)

forms
closure,
Such
verified

composition, if the four postulatest of a group, that is, satisfied. associativity, identity, and inverse (see Section a group is called a permutation it can be easily For example, group. that the set of four permutations)

a group under

6-1),are

{(a)(b)(c)(d), (a c)(bd),

(a b

c d),

(a deb)})

(10-29))

a permutation acting on the object set fa, b, c, d} forms group. The number of permutations m in a permutation group is calledits order,
and

the

number

of elements
degree

in

the

object

set on

which

the

permutations

are

group. In the examplejust cited, the degree and order of the permutation group is four. both It can be shown that the set of all k! permutations on a set A of k elements forms a permutation Such a group, of order k! and k, is called thefull symmetric group. degree group, Sk.)
of the

acting is called the

permutation

Cycle

Index
For

of a Permutation

Group)

a permutation

all
the

m permutations in P index cycle Z(P) of

group P, of oraer m, and divide the sum

if we

add the

metric

group

of degree

P. For example, the S3, the full comesout to be) three, according to (10-28)
=

by m, we get an index of cycle

cycle structures of expression called


sym-

Z(S3)

-i-(y? +
permutation

3YtYz

2Y3)')

(10-30))

Similarly, the cycle index


four)

of the

group

(of degree four

and order

shown

in (10-29)

is)

\037

(yt

y\037

2Y4)')

Since

the
it

cycle index is the


with

most
types

important find

concept Z(S4).

in this

section, let us
in

illustrate
Table

another

example.
different

Let us

10-1 gives the

of permutations

possible

S4,

the

full

four. symmetric group of degree 10-1 is easy to understand and Table to construct. For example, we have six permutations of type (2, 1, 0, 0) on the object set {a, b, c, d}:)

(a)(b)( cd),
(b)(c)(a d),
tIn fact,
composition,
it

(a)(

c)(b

d),

(a)(d)(b
(c)(d)(a

c),
b).) is closed with respect satisfied (Problem 10-4).)))

(b)(d)(ac),

can be shown that if a collection of permutations the remaining three postulates are automatically

to

254)

ENUMERATION OF

GRAPHS)

CHAP.

10)

Number

Permutation

Type)

of Such Permutations)
1

Cycle Structures)
Y1

(4, 0, 0, 0)

(2, 1,0,0)

(1,0, 1,0) (0, 2, 0, 0)


(0, 0,

6 8

YtY2

0,

1))

3 6)
Table

YIY3 YI
Y4)

10-1) 10-],

To get the

cycle index of S4 from


the

Table

we multiply the
the

corresponding
then divide

entries

in by

second
4!,

the sum

the

and third columns, add order of the group. Thus)


=

products,

and

Z(S4)

}4 (yt

6yfY2

8YtY3 +

3y\037

6Y4)')

( 1 0-

31 ))

To

display

the variables
as)

involved, the cycle index of


==

a permutation

group

P is

often written
is evident group
as

Z(P) It
that

Z(P;

Yl'

Y2'

\302\267 \302\267 \302\267 , Yk)')

computation
quite

of the
involved

cycle index
and

of an

arbitrary

permuta-

tion

can become
Sk,

laborious.

There are
in Eq.

certain
forms. For

These are related to the partitions k satisfying of integer more on methods of obtaining cycle indices, the reader
[1- 5].)

groups,such

whose

cycle indices

have been derived

closed (10-26).

should see[10-]] and

Cycle

Index of

the Pair

Group)

the n vertices of a graph G are subjected to permutation, the unordered vertex also For n(n 1)/2 get permuted. pairs example, let V = [a, b, c, d} be the set of vertices of a four-vertexgraph. The permutation)
When

==

( dbae) )

a bed

on the
paIrs:)

vertices

induces

the following
==

permutation on the
ad be bd cd . de ba be ae))
the induced

six

unordered

vertex

P' The diagrams of permutation


Fig. on

ab ae
( db da

and

permutation are shown

in

10-8.

Notice

that

a YIY3
set.)))

permutation

on the vertex

set inducesa Y\037permutation

the vertex-pair

SEC. 10-4)

POLY A'S

COUNTING

THEOREM)

255)

d)

ab)

ae)

bd)

ad)

b) e) be) de)

Permutation Fig. 10-8 on vertex-pair set.)


Similarly,
graph

on vertex

set and

the induced permutation

results
n(n

(or
can

be

induced
(Problem

n! possible permutations the n vertices of a on vertex pairs of the n(n - 1 )/2, unordered, 1) ordered vertex pairs, in the case of digraphs). Furthermore, it shown that if a set of permutations on the vertices forms a group, the set of permutations will also form a group on the pair of vertices
each

of the

in some

permutation

10-5).

For

instance,
of

the

full

symmetric

group
Let

Sn on

vertices

of a

graph induces
an R4

a group Rn
the
full

n! permutations

on the pairs
on

induced induced

group by S4,

is called the

pair group

Rn'

symmetric

group
the

of vertices.t Such us work out the pair group the vertices of a four-vertex
of a graph
A

gra ph.

The identity
identity

permutation on
on
one

four

vertices
vertices.

produces an
with
of

permutation

cycles of length
one

and

the six pairs of one cycle of length

permutation

two
per-

two

produces

two cycles

of length
induced

and

mutations

two cycles of length in S4 and the

permutations
Term

And so on. The cycle structures two. of the corresponding cycle structures on the pairs of vertices are shown in Table] 0-2.)

in Z(S4))

Induced Term
Y\037 YrY\037

in

Z(R 4 ))

No.

of Permutations)
1

Yt

YrY2

YIY3
Y\037 Y4)

YJ
YrY\037

6 8

Y2Y4)

3 6)

Table 10-2)

Therefore, the cycle index

of

the

pair

group +

R4

(induced

on

the pairs

of

verticesby

S4)

is

Z(R 4)

d4(Yf
for Z(R

9yty!

8y\037

6YZY4)'

(10-32))

For a

general

expression n = 2,

n)

see [10-2].)

tExcept for rather than 2.)))

in

which

case

the number

of possible permutations

on the pair is

1,

256)

ENUMERATION OF

GRAPHS)

CHAP.

10)

Equivalence
As

Classes

of

Functions)

let us introduce to describing P6lya'stheorem, concepts. Considertwo sets D and R, with the number of Let I be a mapping which (or function) I R I, respectively. D to a unique image maps each elementd from domain fed) in range R. Since can be mapped into the each of the I D I elements of the IR I elements, any

a further

preliminary

some additional elements I D I and

number of different Now let there


define

functions

from

be a permutation
and/
2

two
that

mappings/!
for

as

D to R is I R I'DI. P on the elements of set if there is some permutation P-equivalent


group
have)

D. Then
11:in

P such

every

d in D

we

11 (d)

== 12

[11:(d)].)

(10-33)) equivalence relation can


be

That the
shown

relationship

defined

by (10-33) is an

as follows:)
is

1. Since P
and

a permutation

group,

it contains

the

identity

permutation\037

thus

(10-33) is reflexive.
permutation
11:,

2. If P contains
11:- 1 . Therefore,

it

also

contains

the inverse
and
11:2 ,

permutation

the relation
if P

is symmetric permutations
makes

also.
it must also contain a transitive relation.)

3.

Furthermore,

contains
11: 111: 1..

11: 1

the permutation

This

P-equivalence

Since an equivalence relation divides a set into equivalence classes, all D to R are divided into equivalenceclasses a permutation from by let D == {a, b, c} and R == {s, t}. group P acting on set D. As an example, 2 3 = 8 mappings 11,/2' . . . ,/8 from There are D to R, as shown in Table
mappings 1 0-

3 .)

11

12

13

14
t

15
s

16
t s

/7

/8

I(a)

s
t

I(b) I(c)

s s

s
t

s s

t t 10-3)

t t

t t
t

Table

Now suppose

a permutation group P
can

==

[(a)(b)(c),
in

(a b c),
Table

D. The

reader

into four equivalenceclasses. They


[ Id

verify that the eight mappings


are)

(a c b)} is acting on 10-3 will be divided

[/2' [3'j\037} \037

j\037, .f\037 [15 \037 },

[ 18 }.)))

SEC.

10-4)

POLYA'S COUNTING

THEOREM)

257)

Palya's

Counting Theorem)

finite D and range R, together with a sets, domain P on D. To each element let us assign a quantity permutation group pER and call it the content of the element (or weight) w[p] p. The weight w[p] can A mappingffrom D to R can be described be a symbol or a real number. by a sequence of I D I elements of set R such that in the sequence the ith element is the imageof the ith element of set D underf Therefore the content W(f) of a mappingf can be defined as the product of the contents of all its images. That is,)

Let us considertwo

W(f) =

dED)

II w[f(d)].

all functions class defined Clearly, belonging to the same equivalence by we define the weight of an entire Therefore, (10-33) have identical weights. D to range R) to be the (comfrom domain equivalence class (of functions the nummon) weight of the functions in this class. Our problem is to count ber of equivalence classes with various given D, R, permutation weights, what group P on D, and weights w[p] for each pER. This is exactly P6lya's theorem gives. counting In elements p of set R are called figures, and funcP6lya's terminology, tions f from D to R are called configurations. Often the weights of the elex. In that ments of R can be expressed as powers of some common quantity of set R can be neatly to elements case the weight described assignment by means of a counting series A(x))
00

A(x)

'1=0)

:E aqX',
set

(10-34))

where

aq

is the

number

of elements
can

in

R with

weight x q . t Likewise,

the

number of configurations
configuration

be expressed

in terms

of another

series,called

counting

series

B(x), such
=

that)

00

B(x)

\".=0)

:E b \".x'\"

(10-35))

where

b m is the

number

of

different

configurations
known

having
as

can state the following powerful result


THEOREM

P6lya's

weight x counting

. Now

we

theorem.)

10-3

The

counting series

series R(x) is obtained by substituting configuration-counting i A(x ) for each Yi in the cycle index Z(P; Yh Y2, . assigned to
series figures

the figure. . , Yk)

of

the)

tIf the content then the figure-counting

cannot be expressed as powers of a single quantity will be a multinomial in different variables, rather than

x, in

just one

variable

x.)))

258)

ENUMERATION

OF GRAPHS)

CHAP.

10)

permutation

group P. That
R(x}

is,)

= Z(P;

\037

aqx

2q 3q , \037 a qx , \037 a qx , . . . , \037 aqx kq ).)

(10-36))

The

proof

illuminating

Our interest
some

of P6lya's theorem, although not complicated, and is therefore left out. The reader can find in the application of the theorem; is mainly

is not
it in

particularly

[10-1], page

157.
with

let us

illustrate

it

examples.)

Example 1:
how

Suppose that
can the

we

are given

a cube and four


on any

many

ways
are

balls be arranged

the

corners

(identical)balls.In of the cube? Two


cube
they

arrangements

be transformed
The

answer

considered the same if by into each other. is seven, as can be seenby


set

rotation

of the
in Fig.

can

inspection

terms the domain D is the

of the

eight corners

of the

cube,

10-9. In P6lya's and the range)

Fig. 10-9
R consists
ball,\"

Attaching

four

balls to

corners of a

cube.)

of two
contents

elements (i.e., figures),


x
1

\"presence

with

and
00

x O , respectively. =

of a ball\" or \"absence of a The figure-counting series is) =

A(x)

L
q=O)

fl QqX

o QoX +
content

QtX1

1 +

x,
the

(10-37))

since

a o, the

number of figures

with

0, is

figures

with content

I, is also one.The

one, and aI'


are

number

of

configurations

28

== 256

different

The permutation balls to the corners of the cube. assign mappings that group P on D is the set of all those permutations that can be produced by with their cycle structures are) rotations of the cube. Thesepermutations

I. One identity
2.

permutation.

Its

cycle structure

is

y\037.

Three

180

rotations

around lines connecting


is yi.)))

the

centers

of opposite

faces. Its cycle structure

SEC. 10-4)

POLYA'S COUNTING
90\302\260 rotations

THEOREM)

259)

3. Six
necting

(clockwise

the

centers

and counterclockwise) of opposite faces. The cycle structure lines connecting the structure is yi.

around lines conis Y\037.

4.

Six

180\302\260 rotations The

around

midpoints of

opposite

edges.
5.
Eight

corresponding

cycle around

120\302\260 rotations

cube.

The cycle structure index

lines connecting opposite corners in the of the corresponding permutation is y\037y\037.)


consisting

The
therefore,)

cycle

of

this

group

of. these

24 permutations

is,

Z(P)

-t24 (y1

9yi -t- 6y\037

8y\037 yj).)

(10-38))

Using Polya's I + x for y l'

theorem, we now substitute the figure-counting series, that


I

is

x 2 for

Y2'

3 + x

for

Y3'

and

I +

x 4 for

4. This

yields the

configuration-counting series.)

B(x)=

x +

3x 2

3x 3 +

7x 4

3x 5 +

3x 6

x 7 + x 8 .)

( I 0-

3 9))

The coefficient of x4 of content x 4 (i.e.,


exhaustive

in B(x)

with

gives the number of P-inequivalent four balls). This verifies the

configurations

answer obtained by

inspection
total

in Fig.
of

10-9.
is
the

contents (with P-inequivalent configurations x O , x I, x 2, . . . , 8 ) is obtained which by adding all coefficients in (10-39), 23. It may be observed that this is the number of distinct ways of painting the of a cube with two colors eight vertices (one color corresponds to and the other with the \"absence of a ball\. of a ball\" \"presence number

The

Example that

2:

In example

we

were

the

are given two red balls and two blue number of distinct arrangements on the
we

given four identical balls. Now suppose balls, and are again askedto find corners of the cube. Clearly, D,

P, and

will remain the same as they in example I. Only the range R were Z(P) and the figure-counting series A(x) will change. The range will contain three elements: (I) presence of no ball, (2) presence and of a red ball, (3) presence of a blue ball. Choosing x to indicate the of a red ball and x' to presence in the range mentioned indicate the presence of a blue ball, the three elements
above

will

have

the contents

X'O,

Xl x'o,

and

x' I,

respectively.

Therefore

the figure-counting
A(x,

series
x')

is)

= xOx'o

+ xlx'o
series

XOX'l

== 1 +

x +

x'.)
configuration-)))

Substituting

this

figure-counting

in (10-38),

we get the

260)

ENUMERATION

OF GRAPHS)

CHAP.

10)

counting

series)

B(x, x')

14[(1+
+ 8(1

X')8 +

9(1 +
X 3

X'2)4 +

6(1 +

X'4)2

+ x + x')2(l+
3x 2

X'3)2]

= 1+

x + x' +
2

3X'2 +
4

3xx' + 3x3 13x


3

3X'3)

+ 7x

x'
2 3

+
x'2 x'2

7XX'2 +
+

7x

7X'4 +
4

x'

-f- 13xx'3

+ 22x + 24x

3x s +

2 + 24x x'3
22x 3XX'6 4

+ 7xx's+
+

x'2

3x's + 13xx' + 13xx'4 + 3x6 + 3X'6 + 7x sx' 2 3 + 22x x'4 + 24x x'3 + x' +
7X SX'2
xx\"

(10-40))
x\"

3x 6x'
X 8

+
+

+ 7x
+

x's

13x 3x'4
+

4 x'3) + 13x

X'8 +

x'x' +

3x 6x'2

+ 3x2 x'6

3X SX'3

+ 3x3 x's

7x 4x'4.)

The coefficientof x r X'b in (IO-4P) is the number of distinct with arrangements r red balls, b blue balls and 8 - r - b corners with no balls. The number of with two red and two blue balls is, therefore, 22. arrangements F or some other of the applications of non-graph-theoretic examples the reader should work out Problems 10-10, 10-11, P6lya's theorem, 10-14,
and

10-15.

Let

us now

return

to

the

counting

of graphs.)

10-5.

GRAPH

ENUMERATION

WITH

PDLYA'S

THEOREM)
Enumeration

of

Simple

all unlabeled,

as a
two

simple graphs of n
(i.e., (for

mapping

pairs of vertices
elements an

sand edge
t,

is joinedby
Ing

problem of counting G can be regarded Any - I) unordered the set D all of of configuration) !n(n n(n 1)pairs of vertices). Range R consists of digraphs If a vertex pair t, with contents Xl and xo, respectively. in G, the vertex pair maps into s, an element with content
Graphs:
vertices.

Let us consider the

such graph

into Xl; . otherwise,


serIes

..

an

element
==

with content
q =
1

Xo

== 1.

Thus

the figure-count-

IS)

A(x) The tions vertices tBecause

\037

aqx

x.)

relevant

on the of

permutation group in this pairs of verticesinduced by Sn the graph). t Therefore, the

case (the

configuration-counting series is)

is Rn' the group of permutafull symmetric group on the

labeled

in an unlabeled graph, all n vertices are indistinguishable. Were we to count the permutation group would have consisted of only the identity permutation. Substitution of 1 + x in its cycle index would have yielded the simple result of expresgraphs (10-1).)))

sion

SEC.

] 0-5)

GRAPH ENUMERATION by substituting


1

WITH

POLYA'S

THEOREM)

261)

obtained

x for

Yp

2 + x

for

Y2'

1 +

x 3 for

Y3'

and

so on

in Z(R

(1) For

n ). Some n =

specific
3,)

cases are

Z(R 3)

=
i(y\037

3YIYz +

2Y3)')

Therefore,

the

configuration-counting
=

series

is)

H(x)

\037

[(I x

X)3
x 2

--1-

3(1

--1-

x)(I

XZ) +

2(1 +

x 3 )])

=-=--= 1 --4

--4-

3 -1- x .)

The

coefficient

of

Xi

in B(x)

is the
here

The content
with

of a configuration

is the

number of configurations number of edges in

with the

content correspond-

Xi.

of nonisomorphic ing graph. Thus the number simple graphs is how it should be, 0, I, 2, and 3 edges is each one.This
1 0- 1 O.

'of three vertices in Fig. as shown


Substituting

(2)
1

For
Yi

n =
in

4, the cycle index Z(R4 )


(10-32),

is given

in (10-32).

Xi for

we get)
2 X )2

B(x) =

\037[(

24

X)6 -t- 9(

+
4

x)2(1
)]

-t--

+ 8(1

)2 ( 1 0-41 ))

--4-

6( I +

x 2)( 1
2

-t--

=
In

-1- x --4- 2x

-t

3x 3 +
the

2x 4

XS +

x 6 .)

the (10-41) vertices and r


.)

coefficient of

xr

gives of

number

edges. The validity

series

of simple graphs with four (10-41) is verified in Fig. 10-11.)

.) .)

/)
.)

<

<1
\037

Fig. three

10-10. vertices.)

Simple

unlabeled graphs of

.)

.
.

.)
.)

. .)
.

.)

.)

: 7IDI2J\037

\037:J\037)
Fig.

10-11

Simple

unlabeled graphs of

four

vertices.)))

262)

ENUMERATION

OF GRAPHS)

CHAP.

10)

(3) For n

==

5, the

cycle index
the

Z(Rs) is given
counting

in

Problem

10-9. Substituting

1+
five

Xi

for

Y i in

Z(R s), we get

series B(x)

for simplegraphs of

vertices,

as follows:)

B(x) =

I\037O

[(1

X)10 +

10(1 +
X 2

x)4(1+ x2 )3
30(1 +

+ +

20(1 + xXI X4)2

)3

15(1 +

x)2(l +
+

)4 +

x 2 )(1

+ 20(1 + xXI I + x + 2X2


+

x 3Xl + x 6 ) + 24(1 + X S )2] s 3 4 6 + 4x + 6x + 6x + 6x + 4x

(10-42)
7

2x

x9 + x

iO

.)

Again,
of

for each
five

graphs The number counted similarly.


Enumeration
multi

r the coefficient of xT in vertices and r edges.


of

(10-42)
with

gives the
n vertices

number of simple
for any n can

simple,

unlabeled

graphs
that

be

of Multigraphs: of n

Suppose
at most

we

are

interested

in counting
between

graphs

vertices,
domain

in

which

two edges

are allowed
same

pair of vertices.

In
may

this

case

the

and the permutation


range,

group are the


edges. and
vertex

as they

were for

simple graphs.
by (I)
indicates

The

however,
u, with

is different.

be joined

no edge, (2) one edge,or (3) two


contents presence

A pair
Thus

of vertices
range

R
==

contains three elements,say, s, t,


that
0,

is,

Xi

1, 2. Threfore,

xO, Xl, of i edges between a the figure-counting series becomes)


the
1

x 2 , respectively; for i pair,

x +

x 2 .)

(10-43))

Substitution
tion-counting

of 1 +
series.

xr

For

x 2r for Y r in Z(R n ) will yield the n == 4, using the cycle index from

desired configura(10-32),

we get)

l. [(1 + 24

x+
x 2

)6 +

9(1 +

x +
+ +
12
.)

x2 )2(1

x2 +

)2 +

8(1 +

x3

X6)2

+ 6(1+
== I

+ +
lO

x 4Xl

+ x 5x
9

+ 3x2
+

+ x4 5x 3 + 8x 4
Xii +
X

x 8 )] 9x s

(10-44))

+ 12x6

-f- 9x

8x

+ The

3x

of four multigraphs parallel edges between

Xi in (10-44) is the number of distinct, unlabeled, vertices and i edges (such that there are at most two coefficient of x 3 is the any vertex pair). For example. are shown in Fig. 10-12. 5, and these five multigraphs a pair of vertices,))) Instead of allowing at most two parallel edges between

coefficient

of

SEC.10-5)

GRAPH

ENUMERATION

WITH POLYA'S THEOREM)

263)

v:)
at most

r:)

\037

I)

n)
three edges, and

K)

Fig.l0-12
had
would

Unlabeled llel

multigraphs edges.)

of four vertices,

two para

we allowed any be the infinite

number

of

parallel

edges the figure-counting


I -t-)

serIes

series)
1 +

A(x) ==

x +

x2

x3

I-x)

(10-45))

we have to consider Enumeration of Digraphs: For enumerating digraphs the domain. The relevant as constituting I) ordered pairs of vertices will consist of permutations induced on all ordered pairs permutation group of vertices by Sn. The cycle index of this permutation M n , can be group, obtained in the same fashion as was done in the case of Rn' For example, for n == 4, Table 10-4 gives the terms in Z(M n) induced by each term in Z(Sn).)

all n(n

Term
yt

in Z(S 4))

Induced

Term
yl2
YrY\037

in Z(M 4))

YrY2 YIY3
Y\037 Y4)

Y1
Y\037

y1)

Table
Therefore,

10-4)

the

cycle index =
1

is)

Z(M

4)

24

(yj2

-+-

6yty\037

-+- 8yt

-+-

3y\037

-+- 6yl).)

( I 0-46))

digraph the figure-counting series A(x) == 1 + x is applicable, becausea given ordered an pair of vertices (a, b) either doesor doesnot have I + Xi for every Y i in (10-46), we edge (directed) from a to b. On substituting series for four-vertex, get the following configuration-counting simple
For

a simple

digraphs.)

B(x)

==

\037[(I + 24

X)12 +
X 2

+ 6(1 + x)2(1
6(1 + 13x 3 +
+
X 4

)S +

8(1 +

)4

+ 3(1
== I +

+
7

)6 +
2

)3]

x + 38x
+

5x

+
8

27x 4
+

38x 5 +
Xli

48x 6
X 12.)

( 1 0-47))))

27x

13x

5x 10 +

264)

ENUMERATION

OF GRAPHS)

CHAP.

10)

.)

r:)

r:)
Fig. 10-13
Simple

r:)
unlabeled

I)

o)

.)

digraphs

of four vertices and two

edges.)
four in

The coefficientof x j in (10-47) is the number of simple digraphs with vertices and j edges. For example, the five digraphs of two edges are shown
Fig.

10-13.

The general expression for the cycle index, Z(M n ), of the permutation group on n(n - 1) ordered pairs induced by Sn is given in [1-5], page 180. the approDigraphswith parallel edges can be enumerated by substituting in Z(M n ).) priate figure-counting series, say (10-43),

SUMMARY)

areas in graph theory Enumeration of graphs is one of the most involved we have briefly and deserves an entire to itself. In this volume chapter, most of them being some enumerative presented techniques-the important in The theorem. using P6lya's theorem is P6lya's counting major problem
finding

the

appropriate
of a

One could think

permutation a hundred

each presenting

special

group and then different types We have, in problem.

obtaining

its cycle

index. the

of graphs to be countedthis

chapter,

counted

of labeled of unlabeled graphs (enumeration graphs is multi much easier): (1)rooted free trees, trees, (3) simplegraphs,(4) graphs, (2) and (5) simple digraphs. Important as these types of graphs are, they were in as illustrations. One could, for example, be interested enumerated mainly that are n with vertices all unlabeled, simple graphs (1) connected, counting and so on. or (4) self-dual, or (2) planar, or (3) nonseparable, and reported as have been enumerated Many such types of graphs there are of research in the but literature, graphs that have many types papers to be counted.) yet

following five types

REFERENCES)

to supplement the recommended 1, 3, 4, 5, and 6 of [10-1] are strongly this chapter. For see the paper by enumeration, survey of the literature in graph which contains a list of 66 solved problems Harary [10-4], as well as Chapter 15 of [1-5], The latest list of 27 with the appropriate references where the solutions are to be found. in another article by Harary in graph enumeration is discussed unsolved [10-51. problenls which For a lucid exposition of P6lya's counting see the paper by deBruijn, theorem, appears as Chapter 5 in [10-1], or see Chapter 5 of the book by Liu [8-3]. For some to graph enumeration, see[10-2], excellent of applications of P6lya's theorem illustrations [10-6], [10-7], [10-8], and Chapter 6 of [3-1 1].))) Chapters
material

in presented an exhaustive

CHAP.

10)

PROBLEMS)

265)

Many on, can


given

counting problems

be

regarded

in chemistry, as graph-enumeration

physics,

6 of [10-1] and in [10-4]. in Chapter mechanics is given in problem in statistical automata is given in [12-5]. The pioneering papers of Cayley, Redfield, and P6lya are not list. They have been referred to in most of the following: 10-1. BECKENBACH, E. F. (ed.), Applied Combinatorial Mathematics,

biology, information theory, and so of such applications is problems. A survey A detailed treatment of an application to a of distinct [10-9]. An application to counting
included John

in the

following

Wiley &

Sons,

Inc., New
10-2. 10-3.
HARARY,

Trans.
HARARY, Michigan

1964. F., \"The Number of Linear, Directed, Am. Math. Soc., Vol. 78, 1955,445--463. F., \"Note on the P6lya and Otter
York, Math

Rooted

and Connected

Graphs,\"

10-4. HARARY,
Physics

10-5.

HARARY, Enumeration

10-6.
10-7. 10-8.

PALMER,

Forn1ulas for Enumerating Trees,\" Journal, Vol. 3, 1956,109-112. Enumeration Problems,\" in Graph Theory and Theoretical F., \"Graphical (F. Harary, ed.), Academic Press,Inc.,New York, 1967, 1--41. Under Group Action: Unsolved Problems in Graphical F., \"Enumeration IV,\" J. Combinatorial Theory, Vol. 8, 1970, 1-11. E. M., \"Methods for the Enumeration of Multigraphs,\" in The Many Graph

Facets of
New
READ,

Theory
New \037'On

York,

Inc.,

York,

R. C.,

the

(G. Chartrand and S. F. Kapoor, eds.),Springer-Verlag 1969,251-261. of Self-Complementary Number Graphs and Digraphs,\"
38,

J. London
ROBINSON,

Math. Soc.,Vol.
R. W.,

1963,99-104.

J. Combinatorial \"Enumeration of Non-separable Graphs,\" Theory, Vol. 9, No.4, Dec. 1970, 327-356. 10-9. UHLENBECK, G. E., and G. W. FORD, \"Theory of Linear Graphs with Applications of the Properties of Gases,\" in Studies in to the Theory of the Virial Development NorthStatistical Mechanics, Vol. 1 (1. de Boer and G. E. Uhlenbeck, eds.), Holland Publishing Amsterdam, 1962, 123-21I.) Company,

PROBLEMS)

10-1.

Satisfy yourself that for a set of is indeed an equivalence relation. transitive.


Prove

graphs

isomorphism

(as defined
is

in

Section

2-1)

That

is, the

relation

reflexive,

symmetric,
if degree

and
of

10-2. 10-3.

that

a vertex

appears

in sequence

(I0-3) m

times

if and

only

V=M-l.
Prove

that is one

a digraph
digraph A

in

which

vertex

can be decomposed into


every of a

(Hint:

In such a
that

the in-degree as well as the out-degree one or more vertex-disjoint directed is a directed circuit.) component

of

every

circuits.

10-4.

if the subset satisfies a subgroup finite group forms the existence of the inverse of an element closure postulate. (Hint: Show a E A as follows: Elements a, a 2 , a3, . . . cannot all be distinct because the group is finite, but they must all be in A because of the closure Suppose that property. - a P = a q , where p > q. Therefore, a P q = 1 or a-I = a p q I .)
Prove

a subset

the

10-5.

P on an object set S forms a group, the set R that if a set of permutations permutations induced by P on set S x S also forms a group. [Hint: Prove on S x S induced closure by showing that the composition of two permutations by the comby any two pernlutations lll, 112 (in P) is the permutation induced

Prove

of all

d. Then position (1l2.1l

use

Problem

10-4.])))

266)

ENUMERATION OF

GRAPHS)

CHAP.

10)

10-6.

of the identity Show that the cycle index of a group consisting permutation is Y1, k being the number of elements in the object set. 10-7. Show that the cycle index of the induced pair group R 3 is the same as that That is,) = 1

only
of S 3.

Z(R3)

10-8.

Show that

the

cycle index Z(Ss)

6(Y1 + 3YtY2 + 2Y3). of Ss, the full symmetric group of degree five,
+

is

5! (YI
+

10Y?Y2 +
20Y2Y3

20YTY3

15YtY\037

30YtY4 +

+ 24ys).

(10-48)

10-9.

Show that unordered

the
pairs

cycle index of the induced by S 5) is

unordered

pair

group Rs (on

the

set

of 10

Z(Rs)

5 !(Yl
+

10yty\037

+ 20YIY\037 + +

15YTY\037

30Y2yi
Problem

20YtY3Y6

24y\037).

(Hint:

Use the

result of

10-8.)

10-10.

colors.

Find the different three of an octahedron with ways of painting the six vertices if they cannot be made to coincide Two octahedrons are coloreddistinctly First show that the cycle index of the permutation by any rotation. [Hint: group is
(y\037 + 2\037

6YfY4

-+ 3YfY\037

+
I

6y\037 +

8YJ).

Then substitute

the

figure-counting

series
values

x \037-

+ x'.]

10-11.

List six

all partitions of 5, vertices. (You may

and use them

use

the

to find U6, the number of of U t, U2, . . . , Us given

unlabeled trees of in this chapter.)

10-12.

Given a square, show that there are exactly eight distinct motions (combinations of rotations and reflections) which the square into coincidence with itself. bring D 4 ). Furthermore, form a group (called dihedral Show that these motions group

show

that

the

cycle index
Z(D 4 )

of
1

this

group

is +
3y\037 +

g(Yt

2YTY2

2Y4).

the order of Dn, the group of symmetries of a regular n-sided polygon, Find the cycle index of Dn. 10-14. with four beads-some blue and some Suppose that we are to make necklaces are considered green. How many distinct necklaces are possible? Two necklaces to the other by any combination of indistinguishable if one can be made identical Use Z(D 4) and follow the procedure of example 1.] rotation and flipping. [Hint: 10-15. Find the number of different ways of painting the four faces of a pyramid with two colors. 10-16. Find the counting series for unlabeled, connected graphs with exactly one simple, circuit. [Hint: Use'Z(Dn) and consider the graph as consisting of a single circuit with one or more trees attached to its vertices.] 10-17. Find the series for the structural of saturated alcohols isomers counting rooted tree in which 10H. CnH2n+ (Hint: Consider the compound as an n-vertex each vertex is a carbon atom. The carbon atom correcarrying the OH radical find the counting series for unlabeled, rooted trees in sponds to the root. Then which the root is at most of degree three and the nonroot vertices are at most of degree four.))))

10-13.

Show that
is 2n.

CHAP.

10)

PROBLEMS)

267)

A permutation 1l applied on the vertex set V of a graph G is called an automorphism of G is an isomorof G, if 1l preserves the adjacency. That is, an automorphism Q(G) on G forms a phism with itself. Prove that the set of all automorphisms This group will obviously be a subgroup of Sn. Use the result of (Hint: group. is also that an automorphism followed Problem 10-4, after observing by another an automorphism.) G if G is (a) a completegraph 10-19. Find the automorphism group Q(G) of a graph with n vertices. Find number a graph with minimum of n vertices, and (b) a circuit of vertices n > 1 in which Q(G) consists of only the identity permutation. is 10-20. Prove that the number of ways an unlabeled n-vertex graph can be labeled n!/I Q(G)\\, where I Q(G)\\ is the order of the automorphism group Q(G) of G. of group theory. The The problem (Hint: knowledge requires some additional proof can be found on page 180in [1-5].))))
10-18.

GRAPH-THEORETIC
11)

ALGORITHMS

AND COMPUTER PROGRAMS)

a digital computer in solving graph-theoretic problems an important part of learning graph theory, especially for those interestedin applications. Most of the practical problemswhich call for graph for hand theory involve large graphs-graphs that are virtually impossible In fact, one of the reasons for the recent computation. growth of interest in has been the arrival of the high-speed electronic computer. theory graph Problemsthat hitherto were of academic interest only are suddenly being solved by the computer, and their solutions are applied to practical situations. have been written to handle Computer programs successfully large graphs
be

To

able

to use

is undoubtedly

encountered in networks, circuit


We
fast limit
must

PERT, layouts,

flow and

problems, the like.


that

transportation
although

networks, electrical
are computers they quickly reach problems (in fact,
very their any

and

hasten to add, however, 9 operate at nanosecond (10if used as a brute force to solve

our

second)

speeds,

graph-theory

combinatorial

problem).

Consider,

for example, the

problem of

finding

circuit in a weighted complete graph of n vertices, - ])! different are traveling salesman problem. There t (n circuits. One may be tempted to use brute Hamiltonian force and generate all their Hamiltonian circuits and compare For a graph with 10 vertices, weights. the number of Hamiltonian circuits is t - 9! = 181,440, and this method may we have be all right. But for a graph of 20 vertices,
lowest-weight that is, the

Hamiltonian

t-(n

- I)! =

t-19!

\037

10 16 ,
one

and to

second would require about


6

perform t - 19!

operations

at the

rate of even = 2 years.)

operation

per nano-

x
X

10

10 16 3 X 107
268)))

SEC.

11-1)

ALGORITHMS)

269)

the aid of mathematical tools one cannot amply clear that without the desired numerical answer, regardless of the speed of the elecof the computer must be combined with the tronic computer. The power of mathematical techniques. ingenuity is the case with all combinatorial As problems, the manipulation and and subgraphs is essentially nonnumerical. That of graphs is, in analysis Thus
hope

it is

to get

the decision-making of the programs it is primarily ability graph-theoretic its ability to perform arithmetic operations. computer that is used rather than In this chapter it is assumed that the reader has some familiarity with
computer

programming.)

11-1.
An

ALGORITHMS)
algorithm

a certain mathematical is, in essence, a recipe for solving It a consistsof set of that when instructions followed problem. step by step will lead to the solutions of.the problem. be Every step in an algorithm must and must terminate after and an unambiguously defined, algorithm precisely in a finite number of steps. As pointed out having solved the given problem Knuth must have five features: 4, [11-39], page every algorithm by important and effectiveness. finiteness, definiteness,input, output, in be An algorithm can be expressed different forms: (I) the steps may in English; (2) it may be in the form of a computer written written program in complete detail in the language understandable by the machine in use; or be expressed in a form betweenthese two extremes, (3) the algorithm may such as a flow chart. Each form has certain advantages and shortcomings. in ordinary an algorithm is first expressed Usually, language, then converted into a flow chart, and finally written in the detailed and precise language so
that

a machine

can execute it.


flow

of chart is the best. It is the most popular form and It is the of language programming expressing independent of the computer the student may have at his disposal. As examples of actual at the end of this of several tested programs are provided listings programs, in is One of the APL (A Programming programs Language), and the chapter.

For our purpose the

an algorithm.

others are in

FORTRAN.

it is supnot only do what must of Algorithms: An algorithm Efficiency criteria for efficiency of posed to do, but must do it efficiently. The two main and computation-time an algorithm are the memory requirements as a funcIn our case the input and its size is is a graph, tion of the size of the input. e. Formost graph probthe number of vertices, n, and the number of edges, not the bottleneck, but the comlems the memory requirement is generally time can be (as we saw in the opening remarks of this chapter). putation In evaluating of an algorithm one n1ay seek the \"worstof merit the figure case\" execution time (i.e., the time taken for the worst possible choice of a)))

270)

GRAPH-THEORETIC of the

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

graph

case.\"
Often,

given size),
than

or

the

\"best-case\"

execution

time

or the \"average-

one algorithm is available for one graph-theoretic one algorithm can easily be seen to be more efficient than for all nontrivial graphs. In many the relative others, cases, however, efficiencies can be compared in the context of the size and structure of only the graph, detailed implementation of the algorithms, and the computer used. A detailed of the performance of a graph-theoretic is analysis algorithm in such analyses, as that involved. We will not indulge would reextremely on quire a chapter in itself. We will, however, make some grossobservations of the algorithms; namely how the computation time grows as complexities a function of n or e, as nand e become that the worstvery large, assuming case graph is provided as the input. Such an index of performance, too unrealistic to be useful in estimating the expected time of a computation
more

problem.

Sometimes

program, is often
studies.)

valuable

in classifying

algorithms

and

in

their

theoretical

11-2.

INPUT: COMPUTER REPRESENTATION


OF

A GRAPH)

has someinputs-thedata with which the algorithm begins as a for the input for (just recipe a dish calls for raw ingredients). Naturally, our algorithms here will be one or more graphs (or digraphs). A is graph and is in a in to stored the one of followgenerally presented digital computer five forms. Each has advantages and disadvantages.The choice ing depends the type of machine, and whether on the graph, the problem, the language,
An algorithm
or

not

the graph is

modified
The

during

the

course

of the
in

computation.
a graph

is fed

scribedin [11-25] and


tinct number
n by

(a) Adjacency to a computer is its


Matrix:

most popular
matrix. use

form

which

or digraph
a dis-

adjacency

For example,

algorithms deassigning

[11-47] the

to each of

n binary matrix X(G) is used for representing G during input, storage, is either a 0 or a I, the and output. Since each of the n 2 entries adjacency 2 Bits can be packed into words. matrix requires n bits of computer memory. in bits a the number of Let w be the word length (i.e., computer word) and n be the number of vertices in the graph. Then each row of the adjacencymain fn/wl machine words. of n bits trix may be written as a sequence (fxl denotes the smallest integer not less than x.) The number of words required to store
the

the adjacency matrix. After n vertices of the given graph (or

digraph) G, the

adjacency The

matrix

adjacency

is, therefore, nfn/wl. matrix of an undirected

graph is symmetric,
in it.)))

and

therefore

This requires storing only the upper triangle is sufficient. often costs bits This saving in storage, of storage. however, it is worth plexity and computation time. In some problems

only

n(n

- 1)/2
com-

increased

SEC. 11-2)

INPUT:

COMPUTER

REPRESENTATION

OF A GRAPH)

271)

It must
without
sent

be kept

parallel

parallel

in mind that the adjacency edges. As discussed in Chapter edges in an adjacency matrix.

7, it

matrix is defined for graphs is not possible to repre-

(b) Incidence
storing

Matrix:

Occasionally,

an incidence
algorithm

and

manipulation
matrix

of a

uses the incidence storage,which might


because

graph. The

A(G).

be more

An incidence matrix than the n 2 bits needed


than

the

number
occasions

n. On rare
ther
than

storage.

use the incidence ramatrix the in spite of the increased requirements in matrix, adjacency Incidence matrices are particularly favored for electrical networks
networks.
representation numbered
in

of edges e is usually greater it may be advantageous to

matrix is also used for for example, n. e bits of requires for an adjacency matrix, the number of vertices
in [11-68],

and switching

(c) EdgeListing:Another

the graph as vertex pairs, having order. For example, the digraph

Fig.

used is to n vertices in 11-1 would appear


often the
(3,

list

all

edges arbitrary

of

some

ordered pairs: (I, 2), (2, following this graph been undirected,we (5, 2). Had
each

1),(2,4),

2), (3, simply

3), (3,
ignore
in

as a set of the 4), (4, 1),(4, 1),


the ordering
representation
in

would

vertex

pai r.
self-loops

of a graph
The

and Clearly, parallel edges or digraph.

can be

included
n)

this

number

of bits

required to

label (1through
<n

each

vertex

is b, where

2
And

b- 1

< 2

.)

since

each

of the e
is)

edges requires storing


2e.

two

such

numbers,

the total

storage required
Comparing
than

b bits.)
this

this
adjacency

with

n 2 , we

see that

representation

is more

economical

the

matrix

if)

2e.b In

<

n 2.)

for a graph whoseadjacency matrix is sparset, edge listing method of storing the graph. convenient form for inputting a graph into the comEdge listing is a very but the storage, within the retrieval, and manipulation of the graph puter, For extensive search techniques computer become quite difficult. example, be required for finding out whether or not a graph is connected would
is a

other words, more efficient

(Algorithm

in

Section

1-4).
A

(d)

Two Linear
by

Arrays:

slight

variation

the graph

two

linear

arrays,

say F

= (/1,/2' . . . ,Ie) and


called

of edge

listing

is H

to represent = (h l' 11 2 , . . .
sparse

,)

t A matrix that contains many zero elements is matrix implies a small e/n ratio.)))

a sparse

matrix. A

adjacency

272)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

Fig.

11-1

A digraph.)
ith just

he)' Each entry h to vertex hi


J:. and hi\") For two arrays)

in if G

these

is a

label. The G is undirected, digraph. (If


arrays

is a vertex
in

edge e i is from vertex e i as between consider

example,

the digraph

Fig.

11-1 would

be represented

by

the

F == (5,2,1,3,2,4,4,3,3),

H
This

==

(2,

], 2,

2, 4,
the

I, 1,4,

3).)

representation,
sorting

which was
in weighted

used in

algorithm

in [II-58],

lends itself
are

to

convenient

graphs. The storage requirements


method

the

same

as in (c).
efficient

used frequently for graphs n linear means of After large arrays. the in the numbers . . . we order, ], 2, , n, vertices, assigning any represent each vertex k by a linear array, whose first element is k and whose remaining are the vertices that elements are immediate successors of k, that is, the vertices which have a directedpath of length one from k. (In an undirected graph these are simply vertices adjacent to k.) The five-vertex in Fig. 11-] digraph will in as follows this appear representation.)
in which the
is by
I

Another (e) Successor Listing: ratio e/n is not

: 2

2: 1,4

3:2,3,4

4: 1, 1
5:2)

For

an undirected

graph the neighbors (rather

than

the

successors)

of)))

SEC. 11-3)

OUTPUT)

273)

every

vertex

are listed.

Therefore, each edge appears

twice-an

obvious

red undancy.
with that let of the adjacency matrix, To compare its storage efficiency in the case of a digraph) of the vertices the average degree (out-degrees word is needed for the label of graph. Assuming that one computer each vertex, the total storage requirement for an n vertex graph is n( 1 + day) is more efficient than the adjacency matrix words. Thus the successor listing

day be in the

if)

day <

\037

l-

I,)

being

the

word

length.
neighbor

The successoror
finding

listing

form

is extremely
the

convenient for
graph

path-

algorithms,

and for

a depth-first searchon

[11-61].)

observedthat the foregoing methods of graph representaare necessarily related in that they entirely different. In fact, they one the same information. to convert convey Simple programs can be written in these representaform into another (Problem 11-2). Additional variations at hand. For instance, a weighted tions can be made to suit the requirements can be represented by an n by n weight matrix (also called cost matrix graph that instead of or distance except matrix), which is like the adjacencymatrix It should, matrix. I's the weights of the edges appear as the entries in the
You must have
are
tion

not

however, be kept
rithm
proper

may

of the algoin mind that in many problems the efficiency the graph is presented. Thus the depend on the form in which of the data structure is important.) choice

11-3.

OUTPUT)

the

has an output-the cookeddish from the recipe. Unlike will vary from problem to or more graphs, the output input, the program If we make the consists of may output subgraphs, problem. if an output the the matrices.On other is, hand, print appropriate adjacency we may of planarity of a given graph, a yes or no to the question for instance, YES or NO. In addition, if the answer is ask the program to simply print the we choose to YES, may get planar representation of the graph; or if the For a shortest-path answer is NO, we may ask for the thickness of the graph. a pair the we wish distance to (shortest) between algorithm, may simply print of edges a sequence of specified vertices x and y. Or one may desire to output a shortest describes path between x and y. And so forth. (or vertices)which are as varied as the algorithms. The outputs
Every algorithm
which

is one

Let us now

proceed

with

some

specific

algorithms.)))

274)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

11-4.

SOME
1:

BASIC ALGORITHMS)
Connectedness

Algorithm

and Components)

The

first will

questions be:

will our first algorithm ponents of G? Therefore, connectedness and components of a given graph.

graph G

Is G

one is most likely to connected? If G is not

ask

when

encountering

a new

connected\037 be

what

are the

comthe

one

that determines
the

In addition to of connectedness

being an important and components

question

in its
many

own
other

right,

question

arises in

algorithms.

For

a graph or isomorphism G for separability, planarity, example, before testing with another graph, it may be better for the sake of efficiency to determine the compopents of Gand then each component to the desired scrutiny. subject The connectedness is very basic and may serve as a subroutine in algorithm more involved here graph-theoretic algorithms. (The reader may be reminded that although a graph is connected in drawing a graph one might see whether or not, the connectedness is by no means obvious to a computer or human in other such as those discussedin Secforms, being if the graph is presented

tion

11-2.)

X of a graph, it Given the adjacency matrix is possible to determine whether or not the graph is connected by trying various permutations of rows and the corresponding of X, and then if it is in a blockcolumns checking diagonal form. (See observation 5 in Section 7-9.) This, however, is an inefficient because it may involve n! permutations. A more efficient method method, would be to use Corollary B of Theorem 7-8, and check for zeros in the matrix)

y
This

==

X +

X2 +

...+

Xn-l.)

is not very efficient, as it involves a large number The an is efficient tiplications. following algorithm:
too

of

matrix

mul-

Descriptionof the
of adjacent

Algorithm:

The

basic step
start

in

this

algorithm

is the
in

fusion

vertices

(recall Section 2-7).We


that

with

some vertex
fused

the

graph

and fuse all

vertices
it all

are

adjacent

to it.
that

Then we take the


adjacent
to

vertex

and that

again fuse
of

with

fusion

is repeated

those vertices until no more

are

to it now.
This

verticescan be fused.
a single

This process
indicates
this

a connected
every

component has been\"fused\"


in the
a different

vertex. If

exhausts

we start with graph, the graph is connected. Otherwise, and continue the fusing (in operation. component) vertex to the ith vertex is In the adjacency matrix the fusion of the jth that the row to the ith row is, jth logically adding accomplished by OR-ing, as well as thejth column to the ith column. that in logical adding (Remember

vertex

a new vertex

+0=0+

1 from

column
in

are discarded
matrix,

the

andO+O=O.)Thenthejthrowandthejth matrix. or time (If it is difficult


columns, they

consuming

to

discard the specifiedrows and


the

one are

taking

care

that

may leave these rows and not considered again in any

columns
fusion.))))

SEC.

11-4)

SOME BASIC ALGORITHMS)

275)

a self-loop resulting a fusion appears as a 1 in the main from but parallel edges are automatically by a single edge bereplaced have cause of the logical addition (or OR-ing) operation. These,of course, no effect on the connectedness of a graph. The maximum number have to be performed in this of fusions that may is n - I, n being the number of vertices. And since in each fusion algorithn1 one performs at most n logical additions, the upper bound on the execution time is proportional to n(n - 1).)
Note

that

diagonal,

Read G. Initialize:
subgraph

\037 G,

component

count c

\037 1)

Select

vertex

in

g)

Fuse
new

to i with

all vertices adjacent i, and call the


i)

vertex

No)

Delete from g, vertex i (along with all vertices fused with i) call the
remaining

subgraph

as

g)

c\037c+l)

Yes)

No)

Print

each
its

with

vertices)

Fig. 11-2

Algorithm

1: Components

of

G.)))

276)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

A in

proper

choice

of the

initial

vertex

(to which

adjacent vertices
one 11-6).

are fused)
not pay is

would improve the efficiency, component provided of a price for selecting the vertex itself (seeProblem too much A flow chart of the \"Connectednessand Components
each

did

Algorithm\"

shown
together
given

in

Fig.

11-2.
to

A complete computer program, ready with the legend identifying the


at

be executed,

variables

used

the end of the chapter. Note that program in each component. vertex as the initial To illustrate the program, an input and the resulting output is a 20 by 20 adjacency matrix follows: The input representing

the

written in APL\\360, in the program, is selects a vertex with


are

maximum

degree

shown

as

a 20-vertex

is a list of components (COMP) followed by the names graph, and the output in each Vertex i corresponds to the of vertices (VERT) included component. ith row and column in X. modified program (without vertices of maximum) A slightly selecting
INPUT N

20

o 1

101

10101

0 0 000 1 0 0 0 0 000 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0

1 100
1 1

1 0 0 0 0 0 0 0 0 0 000
0 0 000 101

0 0

o 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

100

1 0 000

000
001 001

o 0 0 0 0 0 1

0 0 0 0 0 1 001

1
1

o 0 000 1 0 1 0 1 0 0 0 0 0 0 o 0 000 1 100 1 0 0 0 0 0 0 o 000 0 0 0 0 000 1 1 000 X=)


o

1 000
001 1
0 0
0

000

1 1 1 0 0 0 0 0 0 0 1

1 100 1 0
o 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0

000

0 1 0 0 0 0 0 001
000

000
0

000
o 000

0 0 0 0 1 0 0 0 0 0 0

0 0 0 0 0 0 0 000

1 000
000

o 0 0 0 0 0 0 0 0 0 0 0 0 1 0

0 0

100000000 11 o 0 0 0 0 0 0 0 1 001 0 0 0 0 0 0 0 0
o 0 0 0 0 1 000 000 o 000
o

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 1 1 101
OUTPUT

000

000
001

1
0)

o 0 000
COMP

1 100 1 0
6 7
1

0 0 0 0 1

1; VERT:
VERT:

10

16

20

COMP2;
COM P
3; 4;

5
17)))

11

VERT: VERT:
VERT:

9
4

COMP

12 14 15

13

caMP 5;

COM P 6; VERT:

18)

SEC. 11-4)

SOME

BASIC ALGORITHMS)

277)

degree
after write.

as the
they The
(with

initial

are

OR-ed

execution
varying

and without with the initial row) time of this FORTRAN


vertices

took

discarding the rows and columns 35 FORTRAN statements to for a typical 50-vertex program
IBM

graph

number

of edges and

components) on the

7044

was

-to- second.)
Algorithm

2:

A Spanning

Tree

and used algorithms in graph most Perhaps the best known frequently a spanning-tree are the spanning-tree algorithms. In its simplest form tree in connected a given algorithm yields one spanning graph. If the graph is a the should disconnected, algorithm produce spanning forest containing 1 n - p edges, where is the number of p > components in the disconnected as a of such an algorithm, we can find out graph. Clearly then, by-product whether or not the graph is connected, and if the graph is disconnected, its In fact, sometimes a spanning-tree algorithm components can be identified. the given is used for testing connectedness of a graph. If, on the other hand, with each has a distance or associated weight edge (weighted graph), graph we may wish to find The a spanning 1xee with smallest possible weight. significance of an algorithm for such a tree (called minimal or shortest spanning for obtain3-10. A spanning tree is also needed tree) was discussedin Section a in A s we some fundamental set circuits. saw Section of 3-9, ing algorithms for generation difficult of all spanning trees (a much more task) in a given connected graph G alsostart by first obtaining one spanning tree. Let the given undirected self-loop-free(if Descriptionof the Algorithm: the be discarded) has graph G contain n vergraph any self-loops, they may . . . , n, and the graph be tices and e edges. Let the be labeled vertices 1, 2, described by two linear arrays F and H [Le.,in the form (d) of Section 11-2] such that h E F and hi E H are the end verticesof the ith edge in G. is tested to see if either or both each At edge stage in the algorithm a new in far. t At the kth stage, 1 < k < of its end vertices tree f(Jrmed so any appear arise: in h five different conditions the e, may examining edge (I k , k )

theory

I.

2.

3.

h k is included in any of the trees constructed so k nor edge is named asa new tree and its end verticesl k , h k are the value of c by 1. c, after incrementing given the component number == If vertexl k is in s.)me tree Ti (i I, 2, . . . , c) and h k in tree Tj (j == ], theretrees; 2, . . . , c, and i * j), the kth edge is used to join these two fore, every vertex in Tj is now given the component number of T;- The val ue of c is decremented by I. If both vertices are in the same tree, the edge (Ik' h k ) forms a fundamental circuit and is not considered any further.) If neither
in G,

vertexl

far

the kth

tlnitially

occur
algorithm

there is no tree formed. The very first edge ([1, hI) considered will always in a spanning tree (or forest). the spanning tree (or forest) Thus by this generated is very much dependent on the ordering of the edges.)))

278)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

4.

If vertexl

k is

in

a tree

to Ti
5.

by

assigning

T i and h k is in no tree, the edge (Ik' h the component number of T,. to h k also.
tree

k) is

added

If vertexlk

is in

no

to Tj by
These

assigning

the

and h k is in a tree Tj' the edge (I k , h k ) is added number of Tj to Ik also.) component


by

five

cases

are marked

circled

numbers

in the

flow

chart

of the

algorithm shown in Fig. 11-3. based on this algorithm depends The efficiency of a computer program or not the end vertices of on the speed with which we can test whether mainly have occurred in any tree formed so far. For the under consideration edge a linear array (called VERTEX in the program we maintain this listtesting, an edge (i, j) is included in the cth tree, the ith and jth ing) of size n. When when another entries in this array are set to c. Subsequently, edge (Ik' h k ) is in array examined, it is only necessary to check if thelkth and the hkth entries VERTEX are nonzero. A zero in the qth position in the array indicates that the vertex q has not so far been included in any tree. At the end of the execution,

this array VERTEX identifies the components be described Unlike a component, a tree cannot as the we must have an array of edges Therefore,

of the

graph.

by a
output.

be calledEDGE.If the
in

set of vertices alone. Let this linear array


in

kth

edge

(in the original

were placed) is

the

cth

tree, EDG

entries in
in the
uniquely

array

EDGE

correspond spanning
main

order E(k) = c; otherwise, to the chords (i.e., the


array,

which

the

edges

it is edges

zero.
not

All zero
included

spanning tree or
identifies

forest).This
loop

together

with

arrays F

and H,
of

the

tree (or
is

In this edges).

algorithm the

forest) generated by this executed e times (e being the

algorithm.
number

or not the end vertices have appearThe time required to test whether of both e and n. Thus the time bound ed in any tree is constant-independent the ratio of the algorithm is proportional to e.t In case for the execution e/n a new variable to keep is high, execution time can be reducedby introducing When this variable reaches the value count of the edges included in the tree. terminate would of n - 1, the (only if the graph is connected; program

otherwise, we must

examine

every

edge).

based on this A ready-to-be-executed program in FORTRAN language, of the For an ALGOL listing is given at the end of this chapter. algorithm, same program, see [11-58].A randomly generated graph of 50 verticestook

iu

second

on

the

IBM

7044,

using

FORTRAN

IV.
Section

Minimal-Spanning-Tree

Algorithms:
by Kruskal

use the
graph

algorithm

suggested

As discussed in to find a shortest

3-10,

we can

spanning
associated

tree
with
only

in

G in which

This can

every edge has a distance (or weight) with the be accomplished algorithm just described. The

it.

addi-)

two partial trees (Tf' Tj ) as implemented in the tThe time required for merging efficient setof n. There are, however, FORTRAN very program is not independent which almost accomplish this.))) available merging algorithms

Read

F.H,n.e
A. \037 1

se t

c\037O

In

\0370)

Yes)

Yes)

c\037c+l

start
new

tree

(fk

Tc with ' h k ))

Yes) I nelude

Inelude
)

Uk. h k in T. I)

(fk' h k in T. J)

Combine into one

tree

T;. Tj. ((k.

hk

c\037c-l)

o)

CD)

CD)

(2))
CD)

In \037In + 1)

Yes)

Pri n t

spannIng

tree/forest)

\037k

+ 1)

Fig.

11-3

Algorithm 2:

Spanning

tree/forest.)

tional
weights,

work required is to first sort the edges in a nondecreasing order of their them by F and H arrays. That is, the following) before representing
279)))

280)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

set

of inequalities
wt

must be
(J:., hJ

satisfied:)
wt

of

edge

<

of

(h+

l' h i +

1)')

for

all

<

< e

I.)

Because

of the

sorting involved,
[3-10]

Kruskal's algorithm
was

is not

as efficient

as
no

the one due to


Dijkstra

Prim

(which

also discovered

independently by
3-10, requires
successively

[11-16]).

The latter
builds

sorting of edges,but
necting

in Sec. algorithm, as outlined a minimal up spanning tree by


its

con-

For a FORTRAN neighbor. of Prim's listing implementation minimal-spanning-tree see [11-70]. The computation time of this is proportional algorithm, algorithm to n 2 , n being the number of vertices, [11-22]. Minimal tree has been found in providing a lower useful quite spanning bound on the length of the traveling salesman's route [11-28].

the partially
an

formed tree to

nearest

of

efficient

Spanning

Trees

with

Desired

Properties:

tree,

one

may wish

to

find

a longest

spanning

with

in trees with other a specified

desired

properties
can

Instead of a shortest spanning tree. Or one may be interested and constraints, such as a spanning tree
Algorithm

maximum degree or diameter.


be used

with

appro-

priate additional sorting or testing

for such

purposes also.

All Spanning Trees: As we shall see in Chapter 13, analysis of Generating electrical networks basically reducesto finding all spanning trees in graphs. a dozen different algorithms Because of this important application, more than for generation of all spanning 3-9 we trees have been proposed. In Section of cyclic interchange. Since the discussed one of these methods, the method number of spanning the efficiency of trees even in a small graph is very large, A these algorithms is of paramount of these methods was survey importance. H e the done Chase in his Ph. D. concludes that most efficient thesis [I 1-8]. by of the which consists is algorithm by Minty [11-43], essentially type suggested of deletion of an edge and of successively reducing a graph by operations of its end vertices. From the spanning trees of reduced fusion (which graphs are much smaller) the spanning trees of the original graph are obtained. To size are not ensure that the algorithm terminates, graphs below a certain instead their spanning trees are obtained A reduced any further; directly. is in ALGOL based on this method given [11-42].) compact program
Algorithm

3:

A Set

of Fundamental

Circuits)

we are required to find a set of fundamental circuits in a given The described be can used for generating graph. spanning-tree algorithm just if is fundamental the additional work circuits following performed: While examining the kth edge (Ik' h k ) in Algorithm 2, if condition 3 arises h k occur instead of simply in the same tree TJ, then (i.e., both vertices/ k and in T form the between this we must find those that edge edges path rejecting i and h and the h a circuit. . This constitute fundamental path edge (Ik' k ) Ik k a is the main here.In this [11-52]tree-felling Finding path problem procedure)))
Sometimes

SEC.

11-4)

SOME BASIC ALGORITHMS)

281)

where the edge (fk' h k ) is added to Tj, and all pendant are deleted iteratively. This method, however, graph have been proposed by turns out to be inefficient. More efficient methods Welch and Corniel [11-25],and Paton these [11-47]. [11-68], Gottlieb Among to be the most efficient,and is as follows: three, Paton's algorithm appears to see if it Description of the Algorithn1: Here also each edge is tested so far; but instead of taking forms a circuit with the tree constructed the order (as was done in Algorithm 2), we edges themselves in an arbitrary on select a vertex z and examine this vertex by looking at every edge incident is the vertex added most recently to the z. (Vertex z, as we shall shortly see, of the given connected graph G == formed tree.) Let the vertices partially the graph be given by its adjacency matrix (V, E) be labeled I, 2, . . . , n, and T X. Let be the current set of vertices in the partially formed tree, and let W in T as be the set of vertices that are yet to be examined (i.e.,those vertices, on them). well have one or more unexamined edges incident as not in T, which Initially, T == 0 and W == V, the entire set of vertices. We the algorithm start by setting T == I, the first vertex, and W == V. 1 will be regarded as the root of the tree to be formed. After initializaVertex tion, the following procedure is used:
has

been suggested,

verticesof the

resulting

I. 2.

If If

T n T n

W W

==

0,

then the

algorithm is terminated.
z in

* 0,
remove

choosea vertex
every z from

T n

W. on z.

3. Examine z by
edge
left,

considering

edge incident
if vertex

If there

is no

such

W, and go

to step I.
p is in

4.

If

there

is such
find

an edge
the

(z, p), test

T.

5. If pET,
with

fundamental

circuit

consisting of
the

the

unique

path from z to
the

in

tree

(formed

edge(z,p) from

graph,

and go
the

to step 3.
and

edge (z, p) together so far). Delete

6.
As

If

1:-

T, add the

edge (z,
graph,

p) to

tree

vertex p

(z,p) from
mentioned
find

and go

to step 3.
part

to set T. Deleteedge

earlier,
the an

How do we

cedure provides
We maintain

unique answer:

the only tricky path from z

in this
in

to p

the

tree?

algorithm is in step 5. The following pro-

a pushdown list (a stack) TW == T n W, which stores The most recently examined. in the tree that have not yet been those vertices added vertex is at the top of the stack. Each time a vertex is taken for examiand is removed from the stack. nation it is taken from the top of this stack, Two linear of length n are employed: LEVEL(i) being the distance of arrays vertex the root of the spanning tree (i.e.,vertex i from being I), and PRED(i) a vertex v such that (i, v) is an edge in the tree with v nearer the root. In of i in the path from the root to i. other words, PRED(i)is the predecessor =-- - I if and LEVEL(i) only if vertex i is not in set T, the current set of tree to - 1 for i == 2, 3, . . . , n.))) vertices. LEVEL( Initially, I) is set to 0 and LEVEL(i)

282)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

In

step

5 vertex

z is under examination and an

edge (z, p) has


formed
by

been

found

such that

the tree,
ing

we trace the

vertex pET.

To find
unique

the

fundamental

circuit

(z, p)

with

the

PRED(p),

to p in the tree by successively findtill we encounter predecessors PRED(z), PRED(PRED(z\302\273,..., as shown in Fig. 11-4, the) the predecessor of p. In other words,
path

from z

(Root))

(Unexamined

vertex in

T))

(Examined

vertices))

p)

PRED

(PRED
(z))

(z)))

PRED

(Vertex

being examined))

(Unexamined
vertex))

Fig.

11-4

Generation
is)

of a

fundamental

circuit.)

fundamental

circuit
z,

generated

PRED(z),

PRED(PRED(z\302\273,.

. . , PRED(p), p, z.)
the

The

most

k every vertex examined. That

important thing in T is a vertex is, if k E T n


PRED(k)

to note is
which W,

that

predecessor

is either then)

already

PR ED(k) of examined or is being

t- W

but

PRED(k)

T.)

flow

chart

executedFORTRAN
The pends

of the algorithm is
program

given

is provided

execution time is bounded by and on the structure of the graph

in Fig. 11-5, and a ready-to-beat the end of the chapter. V n , 2 < v < 3, and the value of v dealso on the labeling of vertices [11-47].)))

Read

n, X)

Initialize:
TW\037 1

LEVEL

\037-1

LEVEL (1) +-0)

Yes)

\037

top

of TW
TW)

pop

Yes)

Pick an edge

(i.e.Xzp

(z, p)

= 1 ))

No)

Output
circui t

the

fundamental
Add

push

(z, p) to tree p in TW
\037z \037LEVEL

(z), PRED (PRED (z \302\273,)


. . . ,)

z, PRED

PRED (p)
LEVEL (p)

(z) +

PRED
1)

(p), p,

z)

zp

\0370 \0370)

pz

Fig.

t 1-5

Algorithm 3:

Fundamental

circuits.)

283)))

284)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

Although

for
will

algorithm
fundamental
After
LEVEL(y)

work

we assumed that simplicity for disconnected graphs


component
first with

the

graph

is connected,
it

the
all
I.
that

also. First, of a spanning


is no

will

produce
vertex

circuits in the having exhausted the


=

component, y as

the containing we select a


there

starting

vertex y such
tree

-),

and start

the root
till

in the
with

continues component. This procedure

vertex

left

second - I as
(using

its

LEVEL.

Typically for FOR TRAN IV)


All Circuits
in

graph

of

50 vertices

took an

second

and 132 edges the IBM to generate a set of fundamental

7044

circuits.

Graph: All circuits of an undirected graph be found by first forming the set of all linear combinations (i.e., ring of the fundamental circuits and then discarding from this set all those circuit sets that contain other circuits. (This is becausea linear combination of circuits can be either a circuit or a union of edge-disjoint circuits. And a
Undirected

might sums)

union

of edge-disjoint
combinations
every

circuits contains
inefficient.

other J.l

circuits.) fundamental

Such circuits

however, would be very


linear

From

an algorithm, 2 JJ - J.l - 1

must be
other

pairwise with
approach
may

to test

made, and then each of these mu.st be compared a different for containment. Therefore,

has to
the

be taken.

To reduce
be

tempted

soon as it is that a genuine


another

storage requirement to suggest discarding This approach, generated.

circuit was
generated

one and the number of comparisons, of circuits as every edge-disjointunion we might find For however, is faulty. of some discarded circuit set and combination

circuit

later.

that

the fundamental circuits so of ordering before of edge-disjoint circuits as it is produced discard a union and then make pairwise comparigenerating all 2JJ - J.l - I combinations sons. In a more recent paper [11-24], Gibbs has pointed out an error in for Gibbs's Welch's algorithm and has proposeda modification. algorithm
one

Welch [11-68]proposeda scheme


could

of fundamental circuits is essentiallyan storage proportional to 2JJ . Finding an efficient for identifying all circuits in a graph is an open problem. For algorithm see Prabhaker [II-50].) a survey of circuit-generation algorithms

generation

of all circuits from

a set

exhaustive

method

and requires

Algorithm

4:

Cut-Vertices
that

and Separability)
a graph

Having found out

most likely
cut-vertices

to in

ask G?

connected, the next question one is is: Is the graph G separable? That is, is there one or more like to find the cut-vertices If the answer is yes, one would
G is

of G. and the blocks (maximal subgraphs) nonseparable are important in the study of As pointed out in Section 4-5, cut-vertices this algorithm may serve network. Moreover, vulnerability of a communication and as a subroutine such as for planarity for other isomorphism.))) algorithms,

SEC.

11-4)

SOME BASIC ALGORITHMS)

285)

Preliminary

Simplification: disconnected,
to

In

this

algorithm,

as in

perform
ity

some preliminary
being

of

simplification. If the given we could a pply Algorithm


all the

graph

most others, it pays to has the possibil1 and consider each

component as a connectedgraph.It will

execution time

be a waste of computer memory and components of a disconnected graph. if the graph all the selfis not simple, we can immediately discard Similarly, or absence has no effect on loops and parallel edges,since their presence we can prune the Third, if the graph has any pendant vertices, separability. vertices. (In the pruning we graph by repeatedly deleting pendant process must keep in mind that every vertex adjacent to a pendant vertex is a cutvertex, except in the trivial case where the graph consists of just one edge.)

drag

along

Usually

these

simplifications method of a

will have

substantially

reduced

the

size of the

original graph. t
A testing

straightforward separability

(which was used graph would be to remove

in

[5-8], each

for vertex

for example) in turn (by

deleting the correspondingrow

and column from then to test the resulting for connectedness, graph is an inefficient method, and we can do better

its adjacency matrix X) and using Algorithm I. But this a different using approach,
the

suggested
Let us

by

Read

[11-53].
result

recall a
if

from

Chapter

4: Two

edges are in
contains

same

block

if

and

only

there

exists
first

at least

one circuit

that

(Problem 4-10).At of a blockwe would


storage-consuming

to use sight it may a ppear that have to generate all circuits-an

these edges this characterization


both

obviously timethat

and

The following two results, however, reveal would suffice to generate only a set of fundamental circuits:)
affair.
LEMMA I)

it

nonempty

intersection

of

two

fundamental

circuits

in a graph is

always

path.)

Prool:
chords

forming

With respect to fundamental


and

some specified tree spanning circuits 11 and 12, respectively.


connected
this in

T, let
path

eland

e2 be two

Then

tains

two edges, x
(that

y, not

j'1

n 12,
end

there is a
vertices

if 11 n j\037 conPI in 11 between

x and y
the

is,

end-vertices

a path of edge
inj\037

between one y); and


between

of the

of edge

path

does

not contain

there

is a

path P 2

x and y

that does

contain chorde2 . Then

x and one of chord e l' Similarly,


the

subgraph)

PI U P 2
contains a circuit
without

{x,y})

containing

any chord,
performed

which is
only

impossible. .)
produces a
net

tA
running

preliminary
time.)))

simplification

is to be

if it

saving

in

286)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

II)

LEMMA 2

band
then

In a graph G if edges a and b belong to a fundamental circuit /;, and c belong to another fundamental circuit fj such that a t- fj and a and c both are in r.) r in G such that there exists some circuit The proof
follows

if

edges

c t-

.f\"

Proof: b but not


containing

from E9 fj

a or c. Therefore,j; a and c. .)
as each
the

Lemma 1, because /; n Ii is a circuit (not an edge-disjoint

is a

path

containing

union

of circuits)

Descriptionof the
one,

and

If we generate fundamental circuitsone by Algorithm: fundamental circuit is generated we labelt (or relabel) all its
the

edges identically, using


blocks
in

following

procedure,

we

will

have

identified

the

graph:

Each edge in the first fundamental circuit is labeled with 2's. When the second fundamental circuit is found, it will have either all its edges unlabeled, or some of its edges would be labeled 2. In the former case, label every edge of the second fundamental circuit with 3's, and in the latter case with 2's. When this process reaches the mth (I <\037 m < e - n + I) fundamental cirof three conditions:) cuit, we may find anyone

l. If every
them
others
3.
with

edge

in the

mth fundamental q + I.
fundamental
the

circuit is unmarked,

label

all of

a new

integer
the

2. If some edgesin
Suppose
others

mth

are unmarked,

labeleach of

unlabeled

circuit are marked u ones as u also.

and

all

that some edges in the mth fundamental circuit are marked . and others . . are and some unmarked. Let u < v < w, u, v, , w < . . . . Then relabel all edges marked v, w, . . . , in G as u, and label all unmarked edges in the mth fundamental circuit as u also.)

When this process terminates, after having fundamental circuits generated and labeled the edges in each of them, the following has been accomplished: that belongs to a circuit has been labeled. two Moreover, Every edge any edges have the same label if and only if they are together in some circuit (not In other words, each set of edges necessarily a fundamental circuit). carrying is more identical labels constitutes a block.If there than one block in the the graph is separable. Any vertex on edges with incident different graph, labels is a cut-vertex. An edge that has not acquired any label is a bridge. (A bridge is an edge whose removal disconnects the graph.)

In

this

algorithm

an edge

belonging to a

circuit

gets

relabeled

many)

can be conveniently performed using the adjacency matrix X and by tThis labeling writing over it. The edge between the ith and jth vertices is labeled q (q = 2, 3, . . . , e - n + I), simply by replacing Xij and Xji with q (Xij only, if the upper triangle is used). Entries that are still l's correspond to unlabeled edges. Others will have labels 2, 3, . . . ,
and

so on.)))

SEC.

11-4)

SOME

BASIC ALGORITHMS)

287)

An obvious source of inefficiency. improvement suggested by Paton [I I -48] reduces the relabeling of edges by the following devices: Instead of relabelingthe edges in a fundamental circuit as soonas it is generated, we wait till a vertex z in Algorithm 3 has been completely and then examined,

times-an

assign identical
generated.

labels to

the

fundamental

circuits

(passing

through

z)

thus

be performed n times and not J.l only times. we need not label every edge in the graph (Problem Moreover, 11-11). It is left for the reader to construct a flow chart for the block-identification 3 is completely embedded. Remaining details algorithm in which Algorithm
Therefore,

labeling

has to

can

be found in [11-48]. an entirely different approach, Hopcroft and Tarjan an algorithm the which is faster than Tarjan [I 1-61] have given here for certain types of graphs.Their described uses algorithm
Using

[11-31]

and

algorithm

depth-first

search on the graph (to

be discussed later
< }' <

in

this

chapter),

and the graph is to

be input

in

the
the

e, whereas
proportional Analysis

time

form. Its execution time successor-listing bound for the Read-Paton algorithm
1

is proportional to described here is


of the
n

to nY, where and

2, depending on the
that

structure

graph.
and

extensive

tests show

for

a typical
of

graph of
(on

vertices

edges, Hopcroft
algorithm I I

as

and Tarjan'salgorithm long as e < 5n. For graphs


algorithm
an

outperforms

IBM 7044)
graphs

much

higher
for

Paton's densities (Problem


(since
7 se-

-I)

e<
conds

Paton's 3/1

performed
400-edge
with

better. Thus
algorithm

planar

6), Hopcroft
80-vertex

and Tarjan's

will

in

general

be faster.

Typically, for
5:

for block identification


Directed

either

graph, the IBM 7044 took about of the two algorithms.)

Algorithm

Circuits)
important

One of the most


(also called

things

about

a digraph

is

its

directed

circuits

of directed circuits in many applications cycles). The significance was discussedin Chapter 9. Unlike the case of undirected graphs,no techis known circuits such nique by which we can obtain a basicset of directed that the directed circuit in is as a linear of obtained combination every digraph this basic set. Therefore, Algorithm 3 is of little help in obtaining all directed circuits of a digraph. We must generate every directed circuit individually. For this we must examine each edge (unless the edge is known a priori to times. belong to no directed circuit) many

Preliminary Simplification: Although prior application of the following

it is

not necessary,
will

in

most

cases

the

two

steps

simplify

a given

digraph.
slight

First, if the digraph is likely


modification

to

be disconnected,

use Algorithm
identify

1 [with

for a digraph

(Problem 11-7)]to
one

the

connected

com-

ponents,
delete

and

then

consider

component

at a
them)

time. Second,successively
that
in

all vertices

(and the edges


such
identify

incident on
a vertex
because

have zero
any

or zero out-degree. Clearly, These vertices are easy to

in-degree
circuit.
rows)))

cannot lie
they

directed

correspond

to entire

288)

GRAPH-THEORETIC == d+(v) 0] For example,

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

[for X.
h

would

deleted, hand, 9-2 I.

or columns [for d-(v) == 0] of zeros in the adjacency matrix if the digraph given was the one in Fig. 9-16, edges G, b, and be eliminated. Then in the next go-round edges e and c would be three d, f, and g. On the other leaving us a digraph of only edges, this method of simplification will not reduce the digraph shown in Fig.

This algorithm, first proposed by Roberts Description of the Algorithm: Flores [11-56] and subsequently systematizedby Tiernan uses an [11-63], exhaustive search to find all directed circuits in a given digraph G. As usual, the vertices of G are assigned I, 2, . . . , n as their names. The algointegers rithm a directed on starting from a vertex Pl and building path P == depends no further until vertices (satisfying certain conditions) are (p l' P2' . . . , Pk) \"available\" at vertex it is not possible to extend the directed Pk. At Pk' when is a directed edge from path any further, the algorithm checks to seeif there a directed circuit (PI' P2' . . . , Pk' Pl) has edge, Pk to Pl. If there is such an been found and is duly If there is no such edgein the digraphs, recorded. we move back one vertex the path again from Pk-l to Pk- 1 and try extending a directed circuit is found or (if there is one). Whether along a different edge makes vertex Pk forbidden for the next extension from not, the algorithm avoiding going over the same path). Pk- 1 (thus This for directed .circuitsand then moving back a verof looking process tex is continued till we finally backtrack to the vertex P 1 itself. Thus all directed paths starting recorded. from Pl have been examined and directed circuits The iteration with the next vertex, the entire processis repeated. Starting starts with vertex P 1 == I and ends with P 1 == n. In this exhaustive search for directed we must take the following paths and
precautions:)

I.

In the process of extending a directed circuit must any vertex


available\"
that

each

be avoided.

has

already

path, going round and round This is achieved by insisting that been included in the directed path is \"not
directed

for

extending

the path.
of q

2. Generating a directed circuit


in

vertices

q times-once

at each vertex
insisting

the

circuit-must

be avoided.
is available

This is accomplished by

that

no vertex i
vertex
circuit

< P1
This

Pl.

commences

extension, if the path beginswith for a particular directed the search rule assures that only when its lowest-numbered vertex is at the path
for path

initiation.)

3.

than once during the path The same path must not be considered more an updated list offorbidden This is accomplished by keeping extension. vertices in a binary n by n matrix H == [hij]. The I entries in the ith row that are forbidden from vertex i(i.e., if vertex correspond to the vertices that the vertex is forbidden from i, set hij +-- I). A 0 entry indicates j vertex is not forbidden (i.e., if h ij == 0, then vertex j is not forbidden)))

SEC. 11-4)

SOME

BASIC ALGORITHMS)

289)

from

vertex

i). Matrix
starting

is

reset

to zero

each time a

new

vertex

is

chosen
The

as the

vertex.)

as its adjacency matrix [see Section I digraph is inputted with are labeled as usual 1, 2, . . . , n. The directed integers consideration is represented by a linear array)

-2(a)].

The

vertices

path

under

p =
of

(Pl'P2'... of every

,Pk-l'Pk' 0, 0,...,0,0))
path

order

n. The

first vertex

is P

and

the

last one is

P k.)

Fig.

11-6

Digraph.
example.
be

The algorithm can be best explained with the digraph of Fig. I 1-6, the following steps
Path P

an
will

When

applied to

performed:

PI P2 P3
1 1

P4 ps

Action on P

0 2

1
1 I 1 1 1 1 1 1

2
2 2 2 2 2 2 2 0

0 0 4 4 4 4 4 0 5 0 0 0 0 3 0 0 0 0

0 0 0 3 0 5 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Report circuit: set h 4 , 3 +No circuit: set h 4 , 5 No circuit: h4, I \037


+h4,2
1

\037 h4,3

+- h4,4 \037

h 4 ,s

+- 0;

h2,4

+-

1 No circuit: h2,S \302\253No circuit: h2, I \037 h2,2 +- h2,3 \037 No circuit: PI +-PI + 1; H \037o

h2,4

+-

h 2 ,s +-

0;

h l

,2 \037 1

2 2 2
2

0 4 4 4

Report circuit:
Report

h 4,

3 \037 1

2
2 2

4
4 0 5

5 0 0

circuit:
h 4, I

No circuit:

h 4 ,s +- 1 +- h 4 ,2 \037 h 4 ,3 \037 h 4 ,4 \037 h 4 ,s +h2,S

0; h2,4 +-

2 2

Report circuit:
No

+-

1
\037o)))

0 0 0

circuit:

PI +-PI

+ 1; H

290)

GRAPH-THEORETIC P (Cont.)

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

Path

PI P2 P3 P4 Ps
3
4
4

Action

on P

0 0
0
5

0 0 0
0
0

Report

circuit:

PI

\037

pt

+ 1;

H \037

0 0
0

No
No

circuit:

4 5

0 0

0 0 0 0

0 0

h4,S

\037 1

circuit:

PI \037PI stop)

+ 1; H

\037O

No

circuit:

The flow rithm given

chart of this
in

algorithm,

[11-63],

is shown

in Fig.

You must have observed that a systematic and exhaustivesearch for directed circuits. As shown in the example, the same directed path is traversed many times. Even a directed circuit is examined and its several times before turn to be accepted usually rejected arrives. Consequently,the algorithm is very slow, and there is room for considerable improvement. To quote Tiernan this \"would be [11-63], algorithm to a utilize on 50 arcs 7 more than or vertices\"-a costly graph containing small graph indeed. The could be easily modified to generate all directed Hamilalgorithm tonian circuits. This, in fact, was the original purpose of the algorithm as and Roberts Flores reported by [II-56]. A random directed and 434 directed cirgraph of 20 vertices, 55 edges, 17 seconds cuits took about that this method, on the IBM 7044.This indicates a but exhaustive is in terms of inefficient search, quite involving systematic execution time. A similar but somewhat more involved, considerably faster, algorithm but more See also requiring storage was proposed by Weinblatt [11-67]. [11-50].)

is a modified version of the 11-7. this algorithm is nothing more than


which

algo-

11-5.

SHORTEST-PATH

ALGORITHMS)

number of optimization problems are mathematically equivalent shortest paths in a graph. Consequently, shortest-path algorithms have been worked over more thoroughly than any other algorithm in graph More than 100 papers have been and dozens of algorithms theory. published have been proposed. are better than others, some Some of these algorithms are more suited for a particular structure than others, and some are only of earlier algorithms. For a good comparative of minor variations study the various shortest-path 1968, a survey paper by year algorithms through [11-17] is highly recommended.))) Dreyfus
A large to finding

SEC.

11-5)

SHORTEST-PATH

ALGORITHMS)

291)

Read n,

P+-O k +-1
+- I)

PI

Yes)

Clear the list of forbidden

P I +- PI + I P +k PI)

vertices

from

P k)
=)

Make Pk forbidden
from

>

Pk - I)

I k+-k+ +- i) Pk

P k +- 0

k+-k-I)

Fig. 11-7

Algorithm

5: Directed

circuits.)

There are
encountered
first

different

types

among

these

of shortest-path problems. are the following five, of which

Most
we

frequently

shall

solve the

three:)

].

Shortest

path between two


paths

specifiedvertices.
of
vertices.)))

2. Shortest

between

all pairs

292)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

specifiedvertex 4. Shortest path between specifiedvertices


3.

Shortest

paths

from a

to

all others.
that

passes

through

specified

vertices.

5.
In

The

second,

third,

and so

on, shortest paths.)


becomes the

a worst-case

situation,

type

identical shortest

to 3,

because (as we

shall
vertex

see shortly) to another

in the specified

process of finding

path from a
the

specified

all other
Algorithm

vertices. Let
Specified

vertex, we may have us deal with type 1


Path

to

determine

shortest

paths

to

first.)

6: Shortest

from

to

a Specified

Vertex

Another

Vertex)
the can

The another
A

problem of finding specified vertex t,


D
== ==

shortest be stated

path from a as follows:


n

specified vertex
by an
n

to

simple

matrix dij

weighted digrapht where) [dij]' (or

G of

vertices

is described

by

length

distance

or weight) of the

directed edgefrom

vertex

i to

vertex j,

do > 0,
no edge from i to j (in carrying out a program 00 a large number, say 9999999).)
is

d..
II)

==

0,

do

== 00,

if there is by

replaced

the triangle need not be satisfied.That is, inequality n if is satisbe than . the less d d fact, [I triangle inequality may ik jk dij + would be trivial because the direct edge fied, for every i, j, and k, the problem be x to vertex y.] The distance of a would the vertex shortest from (x,y) path directed path P is defined to be the sum of the lengths of the edges in P. The a starting from possible path and its length problem is to find the shortest

In general, do *- dji' and

vertex s to a

terminal

vertex

t.

have been proposed for the shortest path Among several algorithms that efficient one is an algorithm between a specified vertex pair, perhaps the most

due to

Dijkstra[11-16].
Dijkstra's
in the
labels.

of the Algorithm: Description the given digraph. At each stage nent labels and others temporary

of algorithm labels the vertices vertices have some algorithm permaThe

algorithm

begins

by

assigning)

all self-loops, is not simple, it can be simplified by discarding tlf the given digraph them. and replacing every set of parallel edges by the shortest (least-weight) edge among = d ji , and effectively For an undirected graph Also, the graph need not be directed. dij directed edges of the same weight. each undirected edge is replaced by two oppositely the disIf the graph is not weighted, assume dij = ], and the adjacency matrix becomes

tance

matrix.)))

SEC. 11-5)

SHORTEST-PATH

ALGORITHMS)

293)

a permanent n remaining

label 0 to
I

the

starting

vertices. label,

From according

gets a

permanent

vertex s, and a then on, in each to the following


permanently
by)

temporary label 00
iteration

to

the

another

vertex

rules:)
gets a new

I.

Every

vertexj

that

is not
is given

yet

labeled

temporary

label whose value


min

[old

label of

j, (old label of

i +

dij)]')

(11-1))

tion, not

where i is the latest vertex permanently and di} is the direct distance between
joined

labeled,
vertices

in the previous iterai and j. If i and j are

by an

edge,

then

dij

== 00. the

2. The

smallest value among all


the

temporary

labels

is found, and
vertex.

this

becomes

permanent

label of the
the

corresponding
for permanent
the

In

case

of

a tie, select

anyone

of

candidates

labeling.) vertex
t

Steps 1 and 2 are repeated alternately


permanent

until

destination

gets

label.

The first vertex to be permanently labeled is at a distance of zero from s. The second vertex to get a permanent I n label (out of the remaining is 2 n the the vertex closest s. the to From vertices, vertices) remaining next one to be permanently so is the second closest vertex to s. And labeled on. The permanent label of each vertex distance of that vertex is the shortest from s. This statement can be proved (Problem 11-13). As an by induction illustration of Dijkstra's us find the vertex B to let distance from procedure, G in the digraph shown in Fig. 11-8. We shall use a vector of length seven to show the temporary and permanent labels of the vertices as we go through the solution. The permanent labels will be shown enclosed in a square, and the most is indicated by a recently assigned permanent label in the vector
tick

o!

The labeling
B../
(Q]
[Q]

proceeds

as follows:)

A
00

C
00
1./

D
00

E
00
00

F
00
00

G
00

Starting

Vertex

B is

labeled

O.

7 7

00
00

00
00

[ill
ill] [Q]

[JJ
OJ OJ

00

00

All successors of B get labeled. Smallest label becomes permanent.

4
4
4../ @]
@]

00 00 14

5 5 5

4./
[1J [1J

00
00 I 1

of C get Successors

labeled.

(Q] [Q] (Q] [Q] (Q]


(Q]

[JJ IT] IT] OJ IT]


[JJ

14 12
12

5 5,/
rn

[1]
@]

11
I 1

@] @]

@]
@]

]1
7./

12
12

rn
rn

@]

@]

[1]:

Destination labeled.)))

vertex

gets permanently

294)

GRAPH-THEORETIC

ALGORITHMS

AND

COMPUTER

PROGRAMS)

CHAP.

11)

2)

B)

10)

c)
Fig.

F)

11-8

Simple weighted digraph.)

for the job of distinguishing the programmed except the vertices from labeled which is ones, permanently temporarily An efficient of method this is to associate slightly tricky. accomplishing indices I, 2, . . . , n with the vertices, and keep a binary of vector VECT order n. When the ith vertex becomes the ith element labeled, permanently 0 to I. in this binary vector changes from A flow chart of this algorithm is given in Fig. 11-9, and a FORTRAN is provided at the end of the chapter. of the program listing The algorithm described does not actually list the shortest path from the vertex to the terminal vertex; it only gives the shortest distance. The starting shortest path can be easily constructed by working backward from the terminal vertex such that we go to that whose label differs exactly predecessor the length of the connecting edge. (A tie indicates more than one shortest by the shortest a record path.)Alternatively, path can be determined by keeping of the vertices from which was labeled permanently. This record each vertex can be maintained linear array of length that whenever n, such by another a new permanent label is assigned to vertex j, the vertex from which j is directly reached is recorded in the jth position of this array.)

All steps

are easily
labeled

Remarks)

I. In this a permanent
destination

algorithm,

had

we continued
than

the labeling
at the
algorithm

until

every

vertex the

got
the

label (rather
vertex

stopping

permanent labeling of
for computer

paths from

starting

t), we would have gotten an s to all other vertices. A vertex


in

program

shortest for this


the

purpose,
2.

written

ALGOL,

is given
from s),

in

[11-6].

If we

take a shortest path

the then

vertices

(which are accessiblefrom arborescence T rooted at vertex

starting vertex the union of

s to each of these paths


s is the be). Such

other be an

will

s.

Every

path
(and

in

from may

shortest path

in

the

digraph

called the

(or graph,
arborescence

as the

case

shortest-distance

shortest-distance

(unique) a tree is tree in an)))

Read D, n, s, t; LABEL \03700 LABEL (s) \0370

VECT
i\037s

\0370, \037 1)

VECT (s)

j\037l)

In \03700)

No)

No)

z \037d

ij

+ LABEL

(i))

LABEL j\037j+
1) No)

(j)

\037z)

Yes) VECT

(p)

\037 1

i\037p)

m \037LABEL
No)

(j)

\037j)

PRINT)

Fig.11-9

Algorithm

6: Shortest
295)))

distance

from

s to

t.)

296)

GRAPH-THEORETIC

ALGORITHMS

AND

COMPUTER

PROGRAMS)

CHAP.

11)

undirected

graph-not
in

to be
3). This

confused

with

the

shortest

duced
in

Chapter

arborescence

may be

constructed as a by-product

spanning

tree intro-

Algorithm

label, and
is added
of

if each

6, if the labeling time a vertex


arborescence.
in

to the
11-8

is continued till every vertex gets a permanent the corresponding is labeledpermanently, edge the shortest-distance arborescence For example,

Fig.

is given

Fig.

11-10.)

2)

(7)
G)

3)

(4) F)

Fig. 11-10 3. In

of Fig. Shortest-distance arborescence

11-8.)

this algorithm,
and

as more vertices
needed In

acquire

permanent
vertex

ber of additions
continues

comparisons

to modify

to

decrease.

the case
additions

where every
and

beled, we need n(n


computation 4. Notice

1 )/2

2n(n

- I) comparisons.

labels the numthe temporary labels lagets permanently


Thus

the

time is proportional to n 2 . n the computation time is independent of the that for a given assumed have. This is because it is tacitly number of edges the digraph may that the digraph is complete-each missing edgeis simply given a very large is also borne out by the following typical data: On weight. This observation the IBM 7044,for a random digraph of 80 verticesand 3200 edges, it took tS secondto find the shortest distance from a given vertex to all others. Another random graph with 80 vertices but only 1000 edgesalsotook is second for the

same computation.
n(n

This can be computation. labels of the temporary alters test which another achieved by incorporating labeled that are successors of the most recent permanently those vertices only for testing taken a trade off here betweenthe time vertex. There is, of course,
it is

5. If the - 1 )],

digraph

is sparse

[i.e., the number


the

of edgese is
of

much

smaller

than

possible

to reduce

time

and the time


given

that

is

saved
which

as a result
takes
another

of

this

test.

An

ALGOL
that

program
graph,

of
is

Dijkstra's algorithm,
in [11-38],

advantage

of the sparseness
technique

of the

pages 43-44. For

reduces

computa-

7. see remark 3 in Algorithm tion time in sparse graphs, of 6. If the given digraph G is not weighted, every edge in G has a weight Then the problem is matrix. one, and matrix D is the same as the adjacency rather than real arithmetic. logical operations simpler. We perform If some))) 7. We have assumed the distances dij are all nonnegative numbers.

SEC. 11-5)

SHORTEST-PATH

ALGORITHMS)

297)

6 will not work. (Negative distances Algorithm The costs and the positive ones profits.) reason 6 is that once a vertex is permanently labeled its for the failure of Algorithm be altered. label cannot been proShortest-path algorithms have, however, will solve this problem, provided the sum of all dij posed (see [11-17]) that is positive. around every directed circuit (The problem has no solution if a s to t exists, from circuit having a vertex on a directedpath negative-weight because then one could continue minimizing the distance to - 00 by going The computation round and round this circuit.) time of the existing algo-

of the

distances are negative,

in

a network

may represent

rithms

that

can

handle

negative
by

di}

is n

3 and

not
that t

8. It

was suggested

T.

A. J.

Nicholson
that

carrying would

the improve

algorithm

simultaneously from both ends sand


shown in

shortest-path the speed.

has, however, Dreyfus [11-17] improve the efficiencyonly


nearly

the double-ended

procedure would

certain

types
actually

of digraphs. In the
either

case where
end or the

all n

other, the double-ended procedureis one-ended procedure. For an ALGOL

vertices must be permanently

labeled from
less

one

efficient

than

Dijkstra's

listing

of Nicholson's

double-ended

program seeAlgorithm
Algorithm 7: of Vertices)

22

in [11-6].)
Between

Shortest Path

All Pairs

n(n

Sometimesone is interested in - I) ordered pairs of vertices available that


being

finding in

the

shortest

paths between all


1 )/2

digraph

(or

n(n

unordered
6 for

pairs of vertices in an undirected this purpose, the computation

were to use Algorithm time would be proportional to n 4 .


graph).

If we

There

are

sideredbest,
improved
on

several algorithms
both

can

do

better.

Among these, two

are con-

time

as [11-15] equally efficient. One is due to Dantzig based [11-60]; the other one is due to Floyd [11-21], require procedure by Warshall [11-65]. Both algorithms computation 3 proportional to n . We shall describe the Warshall-Floyd algorithm.

by Tabourier

Description

of

the

Algorithm:

The algorithm
it is

works by
to do

inserting

one

or

more vertices into


Starting

paths, whenever
the

advantageous

so.
different

with

n by n matrix

Matrix Dk , I < k < . . . , Dn are constructed sequentially. of the of as the matrix whose (i, j)th entry gives the length n, may shortest directed path among all directed paths from i to j, with vertices I, 2, . . . , k allowed as the intermediate vertices. Matrix Dk == [d\037j)] is constructed from Dk- 1 according to the following rule:)
matrices

D == [dij] of

direct distances, n

Dp D 2, be thought

== d\037\037)

Ii

min

[d\037\037 Ii'

- 1)

Ik ( d\037k

- 1)

(k. d ki')

- 1 \302\273 )]

( 11-2))

for
and)

k
d\037J)

== 1,

2, .

. . , n,

== d '))) u

298)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

That do

is, in >

iteration
for 3.

dn +

1, vertex d lj' In iteration 2,


example, The

Suppose,

is 7 4

19 5

following

in the path from vertex i to j if inserted, and so on. that the shortest directed path 7 to 3 vertex from replacements occur:)
1

is

inserted

vertex

2 is

Iteration 1: d\037oJ is
Iteration
Iteration Iteration

replaced

by

(d\037Ol)

d\\oJ).
di\037\302\273.

4:
5: 9:

d\0373J

is replaced

by (d<Jl by by
(d\0374l

+
+ +

d\03743) is d\03783) is

replaced replaced

d\03743\302\273.

(d\0378J

dk

i).)

the shortest distance is obtained in d\03793)' the value of this entry will be altered in subsequent operations. The flow chart of the algorithm is given in Fig. 11-11 and a FORTRAN
Once
listing

not

is given

at the end

of the

chapter.

Its ALGOL not


path
n(n

listing can

be found

in

[11-21].

The algorithm described so far does the shortest distances. Obtaining the
Algorithm

actually list the path; it only gives in is slightly more involved than -

6, because now

there are
the

I) paths
==

required, not
vertices

just

one.

An efficient

method of

obtaining

intermediate
[zij] vertex

a matrix Z shortest paths is by constructing such that entry zij is the first policy matrix), matrix path from i to j. The optimal-policy
Initially

(referred from i

of the to as the optima/along the shortest


in each

Z can

be constructedas follows:

we

set)
==

Zij

J,)
,)

if d.. I)

* 00,
00.

=0
In the

== if d.. I))

kth iteration if vertex k is inserted between i and j, element zij is reof the Z by the current value of Zik' for all i and j. This updating matrix is done during each iteration k, where k == 1, 2, . . . , n. At the end, the shortest path (i, v I' V 2 , . . . , vq,j) from i to j is derived as a sequence of vertex numbers from matrix Z as follows (seeProblem 11-15):)
placed
VI == zij') V2 ==
V3 ==
ZV1,j') ZV2,j')

==

ZVq,r)))

Read

n,

0)

k\037l)

k\037k+

1)

j\037l)

Prin t 0

(=

On ))

No)

s \037d i k + d k j)

No)

d.

IJ)

\037s

No)

j + 1) j \037

Fig.

11-11

Algorithm 7:

Shortest

path
299)))

between

eVery vertex-pair.)

300)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

Remarks)

I.
only this

Notice
one

n by n

that for computational purposes we matrix. Other constructed matrices


we
matrix

need can

memory space be overwritten

for on

matrix.

2. trices

ments
j
of (n =1=

To estimate the execution time, note that D l' D 2 , . . . , Dn' sequentially. For each - 2), because to be is -

have

computed
.
d\037Z-1)

(n

l)(n

in

to construct n manumber of eleEq. (11-2) i =1= j, i =1= k,


D k the

k (although,

this

slight
n 2) :::= 3

for simplicity, in the flow chart saving). Thus the execution time
=

we have not taken


is

advantage

proportional

to n(n

- 1)

00 in Eq. (11-2), it is possible to circumvent n - 1 is a trade additions and comparisons in exchange for an additional test. This 7 is off just as in Algorithm 6, but since the execution time for Algorithm 3 n to it include extra test for almost to this , every digraph. proportional pays (Note that the test is not included in the flow chart.) 4. If the graph is sparse, that is, the number of edges are far fewer than - I), it is possible to take advantage of the special structure and reduce n(n
3. Whenever

the labor

and subgraph graph. As an


vertices
putations

Torres

5. As
with

in each Shortest paths are obtained the graph. these are put together to obtain the shortest paths in the entire extreme example, considerthe case in which a digraph of n each. The number of comconsists of the two digraphs of nl2 vertices of 75 per cent. See H u and reduces from n 3 to 2(nI2)3, a reduction [11-33] for decomposition algorithms.
by

decomposing

in

Algorithm

6, if the digraph

is

unweighted,

that

is,

D =

X,

the

computational
logical

time
operations.

can be

reduced by

replacing

the

arithmetic

operations

Transitive
us construct
Add path transitive

an (of

Let G be a simple, n-vertex digraph. Let Closure of a Digraph: edges to G as follows: simple n-vertex digraph by adding edge (i,j) directed from vertex i to j if and only if there is a directed H is called the 1) from i to j in G. Digraph any length 2, 3, . . . , n of G. In other words,) closure

another

X(H)

==

R(G),) Hand

where

X(H) is the adjacency


matrix

matrix

of

R( G) is the

reachability (or
G can
X(G),

accessibility)
It is

of

G.
the

easy to
by

see that

transitive

obtained

applying

ALGORITHM

closure 7 to the

of a

given

digraph
matrix

be

adjacency

i.e. by

closure setting D +- X. The time taken by this method of obtaining transitive 3 more o f better. For discussions n We do . to is proportional can, however, see for closure efficient transitive [I 1-45].))) algorithms

SEC. 11-6)

DEPTH-FIRST

SEARCH

ON A GRAPH)

301)

of Sometimes, notably in critical path analysis 14), one needs the longest (rather than paths the shortest) from a specified vertex to all others. One would that expect maximization minimization in procedures analogous to the procedures Algorithms 6 and 7 would yield the desired paths.But for an arbitrary digraph this will not work. For in the process of maximization, one could go round and a directed circuit and the length round would be made arbitrarily large. Another is the following: In the shortest-path problem, if (s, t, difficulty s to t, then the subpath (t, u, . . . ,f) from U, . . . ,f) is a shortest directed path is a shortest path from t to fIt is this property on which the shortest-path are based. On the other hand, if (s, t, u, . . . , f) is a longest directed algorithms s to f, there may from well exist a directed path from t to fvia s that is path longer than the subpath (t, u, . . . ,f). Both these difficulties if the given digraph is acyclic (which is disappear
Longest-Path
networks

Analysis:
(see

activity

Chapter

the case for activity longest paths from

networks).

given

vertex

Dijkstra's algorithm to all others in

can
an

then

be

used

to find

acyclic

digraph.
in

The

details are left


6 and
may

as

an exercise

In addition to the 7, there are several


be

(Problem I] -16). three shortest-path problems


other

dealt with

Algorithms

shortest-path

problems.

For example,

one

second-shortest path from s to f Or one may be interested in certain path from s to fthat passes through more, specified vertices. For these and [I 1 1 7] and [I 1-3] are recommended, while we move on to an altogether different problem.)
interested

in finding the a shortest finding

11-6.

DEPTH-FIRST

SEARCH ON

GRAPH)

In this section we shall discuss a powerful of systematically tech\037ique such that every edge is traversed exactly traversing the edges of a given graph once and each vertex is visited at least once.This the depthcalled technique, on a graph and used was first formalized first search (DFS)or backtracking by Hopcroft and Tarjan [I 1 -3 I] and was subsequently studied in some depth by Tarjan [I 1-61]. It is evident that for answering almost any nontrivial about a question given graph G we must examine every edge (and in the process every vertex) of G at least once. For example, before declaring a graph Gto be disconnected we must have looked at every edge in G; for otherwise, it might happen that the one edge we had decided to ignore could have made the graph connected.

The same can be said There are two natural

as we
incident

move on

from v and

of separability, planarity, and the like. or searching the edges of a graph v we scan all edges vertex to vertex: (i) once at a vertex then move to an adjacent vertex w. At w we scan all edges)))
for questions
ways

of scanning

302)
incident

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

This process is continued till all edges in the graph are scanned. out at each vertex is referred to as the breadth-jirst fanning in Algorithm 3. I t was also search of the graph. This was the method used 1 and 6. (ii) An opposite approach is employed implicitly in Algorithms on vertex v, we move to an adjainstead of scanning every edge incident w (a vertex v with cent vertex not visited before) as soonas possible, leaving possibly unexplored edges for the time being. In other words, we trace a walk possible. This method of through the graph going on to a new vertex whenever to be the graph, called the depth-jirst search (DFS), has beenfound traversing algorithms, because of the very useful in simplifying many graph-theoretic on the edges. of the vertices and orientations imposed numbering resulting
on w.

This method

of

Nunzbering

Vertices a vertex

and

graph,
serial

whenever

Orienting v is visited
that

Edges

in

DFS:

During

a DFS on
it

for the

first

time

we assign

a distinct

number
during

NUM(v), so
the

visited
along its

traversal.
traversal.

the route

of the
the

== i if v was the ith vertex to be each on an orientation is Also imposed edge When the search terminates the undirected NUM(v)

graph G on which
best described

DFS

vertices numbered 1, 2, . . . , n.
by

was being
The

performed, becomesa digraph of the DFS algorithm details

G with can

be

the

following

steps:

undirected Let G be the given Description of the DFS Algorithm: graph, as neighbor listings (i.e., representation 11-2). Let (e) in Section and FRON be the specified vertex from which the search is to begin.PALM are two disjoint subsets into which the edges of G are to be partitioned.

inputted

\037 0, FRON \037 0 1: Set v \037 x, i \037 0, PALM Step Step 2: Set i \037 i + 1, NUM(v) \037 i on v. Step 3: Look for an untraversed edgeincident

Step

4:

Step 5:

incident on v has If there is no such edge (i.e.,every edge go to Step 5; otherwise, already been traversed), edge at v, say (v, \",'), and traverse (b) Pick the first untraversed this edge. Orient the edge (v, w) from v to \",'. Now you are at vertex w. before this during (a) [f w is a vertex which has not been visited is undefined), add edge (v, w) to search (that is, if NUM(w) the set PALM. Set v \037 wand go to Step 2. earlier (that is, NUM (b) If w is a vertex which has been visited (w) < NUM(v\302\273, add edge (v, w) to the set FRON. Go to are back at vertex v. 3. You Step Checkto seeif there exists some traversed edge (u, v) in set PALM oriented toward v. (a) If there is such an edge move back to vertex u. (Note that II v was visited for the first time.) Set is the vertex from which v \037 u and go to Step 2.)))

(a)

SEC. 11-6)

DEPTH-FIRST

SEARCH

ON A GRAPH)

303)

(b) If

there is no such edge(u, v),


traversed

stop

(we

are back at

root x,
con-

having

every

edge

and visited

every vertex

nected

to x).

in Fig. The DFS algorithm described is illustrated by an example just vertex 11-12.In the given graph G of five vertices and eight edges, the starting 11-12 in Fig. the edges are explored is given x is specified. The orderin which \037 G is given in Fig. 11-12(c).) and for this order of traversal (b),

4
I

5 \\ \\ \\ \\ I

I' ,

(x , a): (a, b): (b, x):

(b, c): (c,a): (b, d):

Branch Branch Frond Branch


Frond

I ' \\ 1 \\

{
\\ \\ \\ \\

\"'\\ \" I

,
J

(c,x):
(d,x):

Frond Branch
Frond

,
\\ \".......

/ / //)

I /

....

Graph G

before DFS)

Order
were

in which
scanned.)
(b))

edges

Graph G after

DFS)

(a))

(c))

Fig. Palm

11-12

Depth-first search on a

graph.)

Tree

and

Fronds:)

It is not
bering
resulting which

undirected

to any connected, to see that if this DFS procedure is applied after numn vertices and e edges), it will terminate graph G (with \037 the vertices I, 2, . . n and orienting every edge in G. Let G be the - 1 oriented each of Consider PALM, the set of n edges, digraph. led to a new vertex during DFS. the This subdigraph (defined by the
difficult

.,

set PALM) is a spanning arborescencein G, because every vertex in this to one, and the inequal except the root x, has an in-degree and its properties.) degreeof x is zero. (Review Sec. 9-6, to recall arborescence not in the tree. This spanning arborescence is referred to as a palm Edges
edge subdigraph,
to the palm tree (i.e.,edgesbelonging frond every (a, b) vertex b was visited

set FRON)
before

a,

are calledfronds.Sincefor < NUM(a). In NUM(b)


to

other words,every
lower-numbered

frond

is oriented

from a

higher-numbered vertex
given

vertex.
itself

The DFS by
whether or not

does

not reveal

properties of a
it

graph

G (except

vertices in

G is connected). What
manner

does,

however,

is to number the

a systematic

and partition

the edges into two

sets PALM)))

304)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

DFS a makes just discussed. It is this which of efficient algorithms for solving a surnumber of graph-theory problems. The following are some of prisingly large the problems for which have been constructed employing DFS. algorithms of blocks and cutof components. (2) Identification (1) Identification of connectivity three vertices, subgraphs [11-61]. (3) Identification of maximal
and

FRON,

with
in

properties

powerful tool

the

construction

or more [11-32]. (4)Planarity


graphs

[11-31],

[11-32].

ed subgraphs)

(6) Identification of in a digraph [11-61].


the

and [11-62]. (5) Isomorphism of planar connectfragments (i.e., maximal strongly

It has
time of all
the

been shown (see these six algorithms


is given
in

appropriate
is proportional

graph

the

neighbor-listing

every these
We

edge must algorithms,


shall

be examined at least once, disregarding multiplicative constants, of course.


sketch

reference) that the computation to e, the number of edges,if form of Sec. 11-2( e). And since this is also the lower bound on
a problem

now
with

the

planarity

algorithm,

to

which

DFS

has
in

been

applied

spectacular

success,

resulting

in drastic

improvements

computation

time

over earlier Testing)

methods.)

Algorithm

8:

Planarity

The problem

of determining
pointed

whether

or not

a given graph is planar is an


planarity

important one. As
of

out

in Chapter

5, the

characterizations

are Kuratowski, Whitney, theoretically elegant) are difficult to unsuitable for testing by a computer. and, They implement; besides, if a graph is planar, these methods do not yield a plane representafor example, what is needed. It has been shown, that if is often tion, which is used to test planarity of an n-vertex characterization Kuratowski's graph time is at least proportional to n 6 (see [5-8]). (n > 5), the computation In recent years many for planarity testing have been proposed algorithms for a Most of these methods and on (see [5-8] survey). computers programmed as which works follows: A planar the employ map-construction approach, a the G is first of is most g circuit) given graph algorithms subgraph g (in the and mapped on a plane. Then selected gradually remaining edges are added to g, such that no crossings occur. If we succeedin the reconstruction, a plane representationof graph G is obviously planar, and we have obtained

or MacLane (although

fail, G is nonplanar. The only difficult part of such an algorithm is that in the early stages of of adding edgesto g we have choices available (i.e., ambiguity) in placement us from an A earlier later choice made adding may prevent wrong edges. edge, even if the graph is planar. For example, in Fig. 11-13(a), suppose that the starting subgraph g was the circuit {e p e 2, e 3 , e 4 , e s }. Then we add edges crossover. Now we find that the last edge e tO e and e without e , , g any eo, 7 , g this we might erroneously con-))) be added without a crossing. From cannot
G.

If we

SEC. 11-6)

DEPTH-FIRST

SEARCH ON A

GRAPH)

305)

v)

(a))

(b))

Fig.

11-13

Two mappings of a

graph.)

for

planar. On the other hand, had we selected a different vertex v, we would have obtained a planar representation, placing shown in Fig. 11-13(b). This essentially is the problem in the map-construction method of
elude

that

G is non

face

as

plan-

arity

testing,

and

different

procedures

have been devisedto solve out


in

it.

Preliminary

graph can,
tain

in

As pointed Simplification: be reduced to a much general,


steps.

simplifying

These

steps do not

5-5, an arbitrary if subjected to cergraph affect the planarity (or the nonSection smaller

planarity) of a graph.)
I.

Apply

Algorithm

to

check
one

nected, consider only 2.


Remove

component

for connectedness. at a time.

If the graph is disconedges

all

self-loops,

and replace

each set of

parallel

by a

single

edge.

3. Eliminate
on the
graph 4. Apply

every vertex.

vertex Apply

of degree two by merging steps 2 and 3 alternately


any

the two

edges incident
the

and repeatedly, till


blocks (i.e., maximal
till

cannot

be reduced

further. the

Algorithm 4 to
subgraphs).

partition

graph

into its

nonseparable

5. Subject reduction

each block to reduction is possible.


block

steps

3 and

2 alternately e edges

no

further

6. Each simplified
tested for)

thus

obtained,

with

and

vertices,

is

n>

5, (11-3))))
-

e > 9,

e<

3n

6.)

306)

GRAPH-THEORETIC

ALGORITHMS AND

COMPUTER

PROGRAMS)

CHAP.

11)

If and
is

any of these three inequalities is not we move on to the next block. Every
planar,

satisfied, graph e >

our with

and

every simple graph

with

3n

- 6 is nonplanar.)
Steiglitz,

job is n < 5

finished,

or e

<9

One

planarity down

testing
in

algorithm
simplification.

due to Bruno,
Each

and

Weinberg

[5-2] goes
broken

a step further
into Then

nonseparable

graph is further

its maximum 3-connectedsubgraphs 3-connected (called the following result, due to W. T. Tutte, is used: A graph is planar if and only if all of its 3-connected components are planar. This is not as efficient as the one due to Hopcroft and Tarjan however, algorithm, [11-31],which will be described next.
components). The planarity-testing algorithm is quite Description of the Algorithm: the main involved. We shall sketch only its essential features. To understand to let us consider the following decompositionprocedure applied algorithm, and e edges: a given simple, nonseparable graph G with n vertices

Step 1: Find of g as VI V 2 , . .
Step

Circuit-Path Decomposition:
some . , and

circuit

Kin

G. Set g

\037

K.

Label
\037

the vertices
1.

and edges begins and Pi. If there

e t, e2,

. . . , respectively.

Set i
find

2: If
labeled

there is an unlabeled edgein G,


vertices

a path

ends at
is

but consists
in

only

of

unlabeled

Pi that edges. Store

no

unlabeled
in g.
4:

Step 3: Set g \037


vertices
Step

edge left
g

G,

go to
\037

step 4.
i +

U Pi.

Set i

1. Label the

Return to
Print

step 2.
'Pm.

unlabeled edges and

Stop.

be shown ([5-8]) that the procedure just outlined decomposes the Since G into one circuit and m == e - n paths. simple, nonseparable graph as two edge-disjoint the circuit may be lookedupon paths, G is thus decomsuch a decompointo e - n + 2 paths. It may be noted that although posed
It can
G is which G may not be unique, the number of paths into graph For example, and e - n paths. decomposed is constant and equalsonecircuit each with one circuit and in Fig. 11-13 consider two distinct decompositions,

g,PI,P2'.'.

sition of a four (10 -

==

4)

paths:)

tel' e 2 , e 3, e 4, and In this

e s}, {e6 },
{e7 ,

fe lo }' e g }, [e 9 },

[e 7 ,

e 9 },

reg}, [eto}.)

[el' e 2 ;

e 3 , e 4 , e s }'

[e 6 },

circuit-path decomposition, we can map the circuit K on a plane, A new path are generated. to add new paths P t' P2' . . . , as they will new or make two face into an will either divide faces, g U Pi existing Pi addmethod of arbitrarily added to the planar map g. This nonplanar, when lead to a situation shown in Fig. as they are generated may 11-13, ing paths To solve this problem, one can either))) which has already been discussed.

and continue

SEC. 11-6)

DEPTH-FIRST

SEARCH

ON A GRAPH)

307)

1. Continue

adding paths
alternative

till

no

path

explorethe 2. Continue
found

choices

can be added. Then backtrackto he could have made earlier, or


till

at different paths but not add them to K, to look must be placed in, or it is ascertained which face a path face the path is placed in.) does not matter which

it

is

that

it

and Tarjan (see [II-53]) use approach I, but Hopcroft algorithms 2 have and have that their used shown [11-31] algorithm is more approach efficient of it. They use list processing and have an elaborate program because in lines The gist of their technique of resolving of ALGOL). (985 ambiguity is as follows: adding paths, at any stage we have a path that Suppose Pi (on top of a pushdown list of we whose are resolve. Let a and b be the end to paths) trying ambiguity vertices in Fig. 11-14 shows the different of Pi. The flow chart cases that may arise and what action is taken for each. These stepsare explained by means of Fig. 11-15. In Fig. 11-15(a) path Pi can be swiveled at vertices a and b, and therefore can divide either the face \"above\" the path P r This or \"below\" of ambiguity must be resolved.To this verresolve from some path Pi starting ambiguity, tex x on path Pi a new of un(The path Pk consists path Pk is constructed. labeled edges and it terminates a labeled vertex.) as soon as it touches If both end vertices x and y of Pk are on path Pi' as shown in Fig. 11-15(b), can be either of the two facesswiveled at divides vertices x and y and thus Pk one \"above\" Thus not only did we not resolve the Pi and the other \"below.\" in placement of path Pi' but we have a new path Pk whose ambiguambiguity must be resolved first. Path Pk is put above Pi in the stack, and we begin ity its ambiguity just as we were doing for Pi. resolving Another is that the end vertex y is neither on path Pi nor on possi bility but on a In this case Pi cannot be different as shown in Fig. 11-15(c). path, Pj as to which face Pi divides. and there is no ambiguity therefore swiveled, As in Fig. ll-15( d), if path Pi ends on a vertex in path P j between a and b, then with Pk) can stiJl be swiveled about a and b. Therefore, the Pi (together in Pi remains. The path Pk' however, divides the face a x b y a ambiguity a from we shall have to generate another Therefore, path unambiguously. vertex on Pi for resolving ambiguity in the placement of Pi. on P j but not between in the case where path Pk ends on a vertex Finally be a and b, we have the situation in Fig. 11-15(e). The path Pi can still shown in path Pk with is no ambiguity swiveled. But, unlike Fig. 11-15(b),there to resolve ambiguity be generated to Pi. Therefore, a new path must respect in Pi' and that path can be generated starting from any vertex in path y a x b, which is path Pi extended up to vertex y on Pj. In summary, of routines (a) for finding the planarity consists algorithm each block))) blocks (i.e., maximal nonseparable subgraphs), (b) for partitioning
Some

No)

Store p., and I ambiguity of the next path in the stack)))


resolve

another Pi in the list. Build at some vertex x path Pk starting between a and b on Pi. (suppose Pk ends at vertex y)) Retain

Add p. to g. I Resolve ambiguity

of the next in the stack)

path

/
7
Yes
I

Fig.

11-14

(b)

in p. I

path Pk above the stack, and resolve the


Put
ambiguity

of Pk)

Fig. 11-14 (c)


Pa

\037 No

Remove p. from I stack.

th Pi is resolved the

Resolve ambiguity of the next path in the stack)

Store

Pk

Continue

Yes

resolving
of p. I

ambiguity by

generating

another

path between
b

Fig. 11-14 (e))

and

\\J
Fig.
Store Pk. Can tinue resolving ambiguity Pi by generating path between y and b)

11- I 4 (d))

of

Fig. 11-14

Resolution of ambiguity
308)

of path Pi.)

SEC.

11-6)

DEPTH-FIRST

SEARCH

ON A GRAPH)

309)

a)

b)

(a))

(b))

(c))

(d))

(e))

Fig. 11-15
into

Resolution

of ambiguity

of path
paths,

Pi.)

paths,

planar

(c) for deciding where to add these The DFS is used in both representation.

and

(d) for

building

(a) and

ed from

(b). The paths generatproperties (d), representaexcept

the resulting several palm tree and fronds have important which are made use of in (c) and (d). The time required for each, of edges, e. The building is proportional to the number of planar n tion requires time to n the number n, proportional being log

of

vertices.)))

310)

GRAPH-THEORETIC

ALGORITHMS

AND

COMPUTER

PROGRAMS)

CHAP.

11)

for the entire algorithm is proportional to Euler's equation e is proportional to n, in graphs subjected algorithm.) been improved and was reported in This algorithm has subsequently Ph.D. version is Thesis [11-61]. The time taken by the improved Tarjan's form of the improved version simplified proportional to just n. A somewhat
Thus
n

the

theoretical

time bound

log

n.

of (Because to planarity

appearedas a Cornell
ALGORITHM

University

technical

report

[11-61].)

11-7.

9:

ISOMORPHISM)

if there exists a one-to The graph isomorphism problem is to determine vertices of two graphs G1 and G 2 that prebetween the one correspondence of graph isomorphism arises in serves the adjacency of vertices.The problem many

fields,
For

such as
a survey
it

chemistry,
the

switching

theory,

information

retrieval,
[11-9],

and
and

linguistics. Consequently,
sively.

isomorphism

and references,
is always

see Corneil's Ph.D.thesis


to determine whether
fixed

problem

has been

studied exten-

[11-]2].

Theoretically,
G1
and

possible by

or not

two

graphs

G2 This reidentical. become matrices process may adjacency Such n being the number of vertices. quire all n! reordering and comparisons, with time an inefficient in which the n, factorially grows running procedure, a An solution is of limited use for practical algorithm guaranteeing problems. in running time proportional to a constant power of n is desirable, but no such
G 2 are isomorphic

keeping G 1

and

reordering

vertices of

to

check

if their

algorithm

h;ts

been

discovered
efficient

for determining if two


isomorphism

arbitrary

graphs

are

isomorphic.
tain

t
however,

There are,
types

algorithms

available

for cer-

of graphs.

Some of
in

these are
V-44-V-52.
no k-strongly regular subgraphs a k-strongly regular graph. with special
book.))

I.

Isomorphism

trees:
planar graphs

[11-9], pages
graphs: containing
definition

2. Isomorphism in
3. Isomorphism
for in

[11-32].
of

large

k: see

[11-9] for
partially

in 4. Isomorphism and

labeled

graphs

structure: [II-59]

[11-64].

(See

also Chapter

15 in

this

Heuristic

Procedure)
given

If two
to
try

graphs

Gland

G 2 are arbitrary,
not

to

show

if Gland
problems

G2

are

isomorphic.

the usual approach This is done by asking

is first ques-)

tThere are
exist,

for

and

inefficient

ones may never and use it algorithm


better

which only factorially or exponentially growing algorithms be found. In such cases, one doeshave to live with an for small graphs.)))

SEC. 11-7)

ALGORITHM

9:

ISOMORPHISM)

311)

tions

of the
1. Do

following

type:)

Gland
1

G2

have

the the

same same nj

number of number of
degree

vertices? edges?
same
in

2. Do G 3. Is the

and

G 2 have

number

of vertices

with

i the

both,

for

==

1,

2, . . . ?

4. Do both
mative?)

graphs have 5. For each component

the are

same

number

of components?

questions

1, 2,

and 3 answered in

the

affir-

6. Are the
and on.

characteristic polynomialst
same (taken
in

of the

X(G 2) the

field

matrices their adjacency of real numbers)?)

X( G 1 )

And

so

is no, Gland G2 are nonquestions an isomorphism. not guarantee An is the same for all graphs of a graph G is a number that invariant number of vertices n, are to G. Some examples of invariants isomorphic number of edges e, rank R, nullity of components p, connectivity, J.l, number A matrix. in the characteristic and coefficients polynomial of the adjacency
Clearly, isomorphic. if the

answer to

any

of

these

A yes

answer, however,

does

complete set graph within


The

of invariants
isomorphism.

is

a set

of invariants

that

completely

describes

of graph isomorphism is solved if we can find a complete G 2 and then check to see if they are identical. Gland The problem of finding a complete set of invariants can also be thought we of as the coding of a graph. If we could find a complete set of invariants, would This sequence would contain all the essential place them in a sequence. a graph. Two graphs would be isomorphic if and information about only if their codes were the same. The problem of coding trees and some other types no method of But there exists of graphs has been solved, [11-54], [11-66]. with a large number of vertices. coding an arbitrary graph have been proposed (and programmed) Numerous heuristic procedures
problem

set of

invariants

for

basedon

the both

idea

same for

Gland

approaches work n < 7 which have shown that two simple, connected graphs with But these heuristic answers for questions 3 and 6 are isomorphic.
fail

and if they are the if you compute many invariants, Heuristic G 2' it is likely that Gland G2 are isomorphic. For example, it can be well for graphs of small orders.

that

affirmative

algorithms the

for

large

arbitrary

Sometimes heuristic proceduresare resort method involving vertex-by-vertex


tit

graphs.

also used

for

simplifying

last-

correspondence

between
AI),

Gland)
is indepen-

is not difficult order

to show that

the

characteristic
in

dent of the

in which the

vertices appear

the adjacency

polynomial, det(X matrix X.)))

312)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

G 2.
to)

For example, the

number of comparisons can


k \037 n i = 1)

always

be reduced

from n!

i !,

k where)
\037

i-I)

n i === n.

This
vertices age
than

is because
with of its
n!.)

in

reordering

the

vertices degree,

in G 2
that

it

suffices

the same
with

degree. For a graph


the

does

to permute only not have a large percent\037

vertices

same

the number

n i ! is

much

smaller

11-8.

OTHER

GRAPH-THEORETIC ALGORITHMS) and basic,


available
all.

The algorithms described so far, although very important a few samples out of scores of graph-theoretic algorithms only the literature. Obviously, it is not possible to include them are) for graphs other commonly used algorithms
I.

are

Some

in of the

(i.e., maximal G given digraph [11-61].


Find

Find all fragments


a Hamiltonian

strongly

connected

subgraphs) undirected

in a

2.
3. 4.

path (if Hamiltonian

there is one) in
circuits
in

a given

graph.

See [11-49].
Find

all

directed

a given

digraph.

See [11-13],
graph

pages 35-37.
Find

a maximal

complete

subgraph
in a

(clique)

in

a given

G. See

[11-1]and [11-44].

5.

known bipartite graph. An algorithm, used this is often for method, solving assignment subroutine problem. The Hungarian method is availableas a standard See [9-4], in most operations research computer program packages. for time the 265-269. The computation Hungarian method, for pages to e. n. Recently a of n vertices and e edges, is proportional a graph
Find

maximal

matching

as the Hungarian

more

efficient it

algorithm takes

has

been

[11- 30];

time

proportional weighted
rate

proposed by Hopcroft to (e + n).\037.

and

Karp

6.

Given

connected
the

digraph

in

which
through

the

weight
that

of an
find
the y in G.

edge represents the maximum possible flow from This is the well-known maximum-flow
maximum

of flow a vertex x
in

edge,

to another vertex
and 4-6

problem Sections

Ford-Fulkerson

algorithm
algorithm

(discussed
is also

is solved by and 14-1).


in

The
see

Ford-Fulkerson
research.

a standard

program
improved

operations

See [9-4].

For a more recent and


[11-19].)))

algorithm

Edmonds

and Karp

SEC. 11-8)

OTHER

GRAPH-THEORETIC

ALGORITHMS)

313)

7.

Find the chromatic


Given

number

of

a given

graph. See [11-26].


its

8.

an

acyclic

digraph,
definition,

perform a
an

topologicalsorting of

vertices.

See Section

14-8 for

algorithm,

and references.

9. Given a connected weighted the vertices of G into G, partition graph size so as to minimize the total weight subsets no larger than a given of edges cut in the process. For a heuristic to solve this algorithm see [11-36]. Also, see [11-35]. important but difficult problem,

10.

Given

a connected

weighted
has

graph G, find
traveling-salesman

a Hamiltonian

smallest weight. This is the

problem,

circuit with for which no


algorithms

satisfactorysolution
see [211.
I

been

found

so far.

For

heuristic

].

In a given
minimum

graph G ==
cardinality)

(V,

E),

of edges

E ' c E such
in E
Section

find a

smallest subset (i.e., subset ' . This


8-5.
that

of

every

vertex

of G is
a

incident on at least one of the edges smallest was discussed in covering efficient algorithm.

problem of finding
See [11-18]

for an
V'

12. In a
such

given

that

one vertex

G == (V, E), vertex of G not every in V'. This problem


graph
in

find

sn1allest in

subset V'is

of vertices
dominating
this

included

adjacent to at least set


problem

of

finding

a smallest

was discussed is much more


13.

Section

8-2.

Superficially

similar to 1I,

difficult.)

In a given digraph G, find from G would destroy all

a smallest

set of

directed circuits.A

edges

which

when

deleted

method

of finding

this

minimum decyclizationedge set (or feedback are set) was outlined in Section 9-1 I, but the computation time grew exponentially with n, the number of vertices.)

14. in
now

the

wish

previous problem instead of finding to find a smallest set of vertices


in

a smallest in G

whose

set of edges we removal destroys


is known

all directed circuits


for
15.
this

G. Just

as for

13no efficient

algorithm

problem.

G == (V, E), and a subset V' of weighted graph tree in G which spans the vertices in V' (and as a Steiner tree, is much possibly some more). Such a tree, known more difficult to obtain than a minimal spanning tree for G. The of extra vertices may lead inclusion difficulty arises from the fact that to a different tree with a smaller total weight. Although no efficient of this problem, an has been found for an exact solution algorithm can be obtained approximate solution by an efficient algorithm given with a Steiner Trees by S. K. Chang (in \"The Generation of Minimal Topology,\" J. ACM, Vol. 19, No.4, October 1972,699-711).)))

Given a connected V. Find a minimal

314)

GRAPH-THEORETIC

ALGORITHMS

AND

COMPUTER

PROGRAMS)

CHAP.

11)

11-9.

PERFORMANCE

OF GRAPH-THEORETIC ALGORITHMS)

As observed in Section 11-7, for a given graph-theory problem it would in an execution a solution to have an algorithm which guarantees time proportional to someconstant nand e are the of n or e (as usual, power number of vertices and in the given graph). In other edges, respectively, time t (for the worst possible graph) can be expressed as) words,the execution
be desirable t
and

<

rxn

or

< pe q ,)

value of k and q the better. Such an algorithm (whosecomby a polynomial in n or e) is called a polynomial bounded For example, Algorithm I (connectedness and compoalgorithm. k == 2. Algorithms since 2, 3, 4, 6, 7, and 8 nents) is polynomial-bounded, are also polynomial-bounded, 5 and 9 are not. Someimporbut Algorithms tant polynomial-bounded graph-theoretic algorithms along with their bounds)
the

lower the
time

putation

is bounded

Problems Connectedness
components

Run-Time Bounds and


n 2

Relevant

References

or e

[11-29], [11-61]

Spanning
Minimal

tree
spanning

e
tree 2 <
n 2

[11-58]
[11-22], <

n2
n v, v

[11-70]

Fundamental

circuit-set

[11-47]

Cut-vertices and blocks


Bridges Shortest

or e

n 2 or path

[11-48], [11-61] [11-10],[11-61]


[11-16],

between
between

two

vertices

n 2

[11-73]

Shortest
all

paths

n3
nfX.

vertex-pairs

[11-21], [11-73]
[11-45]

Transitive

closure

2<tX<3
n 2

Strong connectedness
and

or e

fragments

[11-29], [11-61]

Planarity

e
e
in

[11-62]
[11-39]
[11-30]

Topological sorting
Maximal matching a bipartite graph
Minimal Minimal

n 5/ 2

cut edge

nP

[11-19] [11-18], [11-46])


Algorithms)))

2<P<3
cover n3

Table 11-1

Polynomial-Bounded

SEC. 11-9)

PERFORMANCE

OF GRAPH-THEORETIC

ALGORITHMS)

315)

and

graph e <
into

relevant
n(n

references are shown


-

in

Table

I I-I.

Note that

that since
n

1)/2 <

for a simple
convertible

/2,

bounds

in terms
in

of e and

are

each other. It
the

should also be kept

bounded by
computer

time

take same power of n may (for the same graph) becauseof their

different algorithms very different amounts of actual


mind
different

multiplicative

constants.
for which it is On the other hand, there are graph-theoretic problems Take, for examalgorithm. simply not possible to have a polynomial-bounded as disof generating all spanning trees of a given graph, ple, the problem 11-4. The number of spanning trees in an n-vertex cussed in Section simple, if each spanning tree were labeled graph can be as high as nn-2. Therefore, trees would generatedin c -units of time, the algorithm to generate all spanning can consume c_n n 2 units of time. Thus no polynomial-bounded algorithm hold for problems of generating be found for this problem. Similar arguments and so forth, all cliques, all circuits/directed circuits, all paths, all cut-sets,

for a given
There

graph.

is a

third

category

of graph-theoretic

problems, for which

so far

no

polynomial-bounded

algorithms
that

have been

discovered, nor has it

been

pos-

sible
problems.

to show
of important
time

polynomial-bounded

algorithms

Detection

of isomorphism

(Algorithm

list

tion

present,
limited

in problems of this type is given these problems (using the best and the worst possible graph) grows exponentially for

do not exist for these 9) is one such problem.A 11-2. The computaTable
available

solving

algorithm or

at

factorially

(but
very

not polynomially) with n. Such inefficient algorithms are obviously of use for practical problems. Heuristic techniques are the mainstay their solutions.

of

Based on a remarkable result of


showed the following all other problems problem, is, if a polynomial-bounded
[11-34]
in

Richard StephenCook (1971),

Karp

surprising
Table

result: Except for


are polynomially
one,

the

isomorphism
that

11-2

equivalent,

algorithm exists for

polynomial-bounded)

Problems)
Chromatic

Relevant References)

number

[11-26], [11-41]
[11-44]

Smallest
Maximal

dominating set
clique

[11-20]

Hamiltonian Traveling
Minimal

circuit
circuit

[11-56]

Directed hamiltonian
feedback

[11-56]

salesman problem
edge-set
set
Chang

[11-28]

[9-6]

Minimal feedback vertex Steiner tree

[9-6]
in Section

11-8

Isomorphism)
Table

[11-64]) (11-9],[11-12],
11-2

Nonpolynomial

Algorithms)))

316)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

algorithms

can

be found

for the others.

involved and is not very relevant for us here.(The lems includes a number of other combinatorial and lems in addition to the top nine in Table 11-2.))

The proof of

this

equivalence
class

is prob-

Cook-Karp

of

graph-theoretic

prob-

11-10.
The development

GRAPH-THEORETIC COMPUTER LANGUAGES)


interest in graph-theoretic increasing computations of several programming languages for the sole
such

has led to

the

purposeof
he

han-

The major goal of on graphs in operations with another communicating


dling

graphs.

a language

is to enable the

user to forwere

mulate

a compact

and natural

manner, as if

language [I I -37], the statement for a spanning tree and would statement IF (G, PLANAR) G is planar, otherwise to statement 3. Once such a language is developed and implemented, its advantages are enormous. It makes the writing of graph-theory and programs compact. easy It frees the user from having to concern himself with many unnecessary on the essential features of his program. details and allows him to concentrate The disadvantage of \037uch a language, as of all special-purpose languages,is that a great deal of time, and expense to develop such a it takes trouble, of which can be used for the in only purpose writing programs language, graph

graph theorist. For example, in one such SP ANTREE @ G would call the subroutine find a spanning tree of the graph G. Another 3 would transfer control to statement 17 if 17,

theory.

F or such a graph-theoretic to be useful to many users, computer language a large numwith different problems in graph the must have theory, language ber of primitives (i.e., basic graph-theoretic such as \"remove statements) the shortest vertex k of G\", \"add an edge between vertices x and y\", or \"find distance from vertex u to vertex v in G\". Moreover, the graph-theoretic lansymbolic language must have all the computing facilities of an existing functions that the can as so such FORTRAN, perform programmer guage
which

are

not covered

by

primitives.

Since

there is

little

to

be gained

by devel-

all graph-theoretic languages oping an entirely new language from scratch, available and being developed are extensions of some well-known programmi ng language. available at present are) Some graph-theoretic computer languages
I.

Graph-Theoretic

Language

(GTPL) at the

University

of

West

Indies,

Jamaica [II-52]. It is an
2.

extension of

FORTRAN.

Graph

Algorithm Software Package Illinois [11-7]. It is an extension ofPLjl.)))

(GASP)at

the

University

of

CHAP.

11)

SUMMARY)

317)

3. HINT at 4. G RASPE
extension

Michigan State University


LISP
University

[11-27]

is an

extension of the list-

processinglanguage
at the
of LISP

1.5.
of

Houston,

[11-23] and

[11-51], is also an

1.5.

is an 5. Directed Graph Processor (DIP)at Carnegie-Mellon University a report by Terry C. Gleason, 1969.) extension of PL/ 1.(See 6. An Interactive Graph Theory System at the University of Pennsylvania is an extension of FORTRAN [11-71]. 7. Graphic

Extended ALGOL di Elettronica del Politecnico

(GEA) at
Milano,

Instituto

di

Elettrotecnica

ed

Italy is an

extension of ALGOL: of digraphs,

[11-13]
and

[11-14].

8. AMBIT/G,

developed

by

C.

Christensen

for manipulation

is an

extension

of AMBIT

[11-57].
Language

9. GIRL-Graph Information Retrieval 10. FORTRAN Extended Graph Algorithmic the University of Maryland [11-2].)
The

[11-4].
(FGRAAL)

Language

at

interested

reader

should

consult the cited

referencesfor

the

details

of

these languages.)
SUMMARY)

presented in this chapter. applying graph theory physical problems as flow (such problems, assignment problems, identification of a chemical network, compound, topological analysis of an electrical layout of a printedcircuit it is the essential to be able to enlist board, etc.), help of the digital Without the of electronic computer. help high-speed computers,he cannot in solving a nontrivial of to handle a a size encountered hope graph generally
Computational

aspects
in

of graph

theory were

For anyone

interested

to solve

practical

problem.

A computer that has been \"taught\" elementary graph theory (such as, if graph G is separable, or pick out find a spanning tree in G) can be of out immense aid even to a \"pure\" It relievehim theorist. for can, instance, graph
of the and

drudgery

of

finding

graphs

with

special

properties

to serve as examples

counterexamples.

to a computer, one must know obviously find and In one must addition, programming graph theory. The efficient most of useful graphalgorithms. important prerequisite any theoretic algorithm is that the running time of its program on the computer with n. It should be propormust not rise factorially or even exponentially k tional k is some fixed number-preferably a low number.))) to n , where To be able both computer
graph

to teach

theory

318)

GRAPH-THEORETIC

ALGORITHMS

AND

COMPUTER

PROGRAMS)

CHAP.

11)

REFERENCES)

As yet, there is no one reference where all or most of the graph-theoretic algorithms available. Each algorithm has to be looked up individually in a published paper, thesis, or report. Consequently, this chapter contains a long list of references. It is unlikely that student would be interested in all of them. anyone For a general introduction to the nature of graph-theoretic two computer algorithms, and papers of Read [11-52] [11-53] are recommended. Lehmer's paper [11-40] is an excellent treatise on the use of computers for solving combinatorial problems. Among the few books that do discuss some aspects are of using to solve graph-theoretic problems computers Even [11-20],Berztiss 3, 6, and 8, Knuth [11-39], which is at an advanced [11-5], Chapters which is in German, and Bellman, Cooke, and Lockett level, Knoedel [11-38], [11-3]. A related book on combinatorial It develops computing by Wells [11-69]is also recommended. and uses a special programming language for combinatorial applications. developed 11-1. AUGUSTON, J. G., and J. MINKER, \"An Analysis of Some Graph-Theoretical Cluster J. ACM, Vol. 17,No.4, 1970,571-588. J. ACM, Techniques,\" (Correction:
are

Vol. 19, April


11-2.
BASILI,

1972,

244-247).

V.

R., C.

K.

MESZTENYI,

and Language,\"

W. C.

REINBOLDT,

\"FGRAAL:

Fortran

Extended 1973 on

11-3.
11-4.

TR-179, March 1972. See also Report TR-225, January of FG RAAL. and Computers, BELLMAN, R., K. L. COOKE and J. A. LoCKETT, Algorithms, Graphs Academic Press,Inc.,New York, 1970.

ScienceCenter

Graph

Algorithmic

University

of Maryland,

Computer

Report

implementation

BERKOWITZ, Syntax,\" New

S., \"GIRL-Graph in Software Engineering,

Information

Retrieval
ed.),

Vol. 2 (J. T. Tou,


Theory

Language-Design of Academic Press, Inc.,


Academic Press,

York, York,

1971, 119-139.
A. T.,

11-5.
11-6.

BERZTISS, New

Data Structures;

and

Practice,
Between

Inc.,

1971. Start

BOOTHROYD,

Nodes 11-7.
CHASE,

23: Shortest Path J., \"Algorithm of a Network,\" The Computer Journal,

Node and
Nov.

All

Other

Vol. 10,

No.3,

1967,

307-308.

Also see Algorithm 22. S. M., \"GASP-Graph Technical Algorithm Software Package,\" Quarterly UniDec. 1969, Department of Computer Science, Progress Report, Oct., Nov., Urbana. versity of Illinois, All Spanning Trees of a 11-8. S. M., \"Analysis of Algorithms for Finding CHASE, of Illinois, No. 401, Department of Computer Science, University Graph,\" Report Urbana, Oct. 1970. of Computer 11-9. CORNElL, D. G., \"Graph Isomorphism,\" Ph.D. Thesis,Department Tech. version of Toronto, Toronto, Canada, 1968.Updated Science, University 1970. Rep. No. 18,April D. G., \"An n 2 Algorithm 11-10. for Determining the Bridges of a Graph,\" CORNElL, Information Processing Letters, Vol. 1, No.2, 1971,51-55. the Automorphism Partitioning D. G., \"An Algorithm for Determining CORNElL, of an Undirected Graph,\" BIT, Vol. 1972, 161-171. 12, No.2, 11-12. CORNElL, D. G., and C. C. GOTLIEB, \"An Efficient Algorithm for Graph Isomorphism,\" J. ACM, Vol. 17, No.1, Jan. 1970,51-64. \"A Graph-Theory Oriented Extension 11-13. CRESPI-REGHIZZI, S., and R. MORPURGO, 1-43. to Algol,\" Calcolo, Vol. 5, No.4, 1968, \"A Language for Treating Graphs,\" S., and R. MORPURGO, CRESPI-REGHIZZI, Comm. ACM,Vol. 13, No.5, May 1970,319-323.)))

11-11.

11-14.

CHAP.

11)

REFERENCES)

319)

11-15.

11-16.
11-17.

G. B., \"All Shortest Routes in a Graph,\" Proceedingsof the International DANTZIG, Published by Dunod Symposium on Graph Theory, Rome, Italy, July 1966,91-92. Editeur, Paris. in Connection with E. W., \"A Note on Two Problems DIJKSTRA, Graphs,\" Numerische Math, Vol. 1, 1959, 269-271. J. Operations of Some Shortest-Path Algorithms,\" DREYFUS, S. E., \"An Appraisal

11-18.EDMONDS,
11-19.
Efficiency

Research, Vol. 17, No.3, 1969,395-412. J., \"Paths, Trees, and Flowers,\" Canadian J.
EDMONDS,

of Math.,

Vol.

17, 1965,

449-467.
J., for

and R. Network

M.

KARP,

\"Theoretical
ACM,

248-264.

Flow Problems,\" J.

in Improvements Vol. 9, No.2,


Company,

Algorithmic April 1972, 1973.

11-20. EVEN,
11-21.
FLOYD,

11-22. FRAZER,

S., Algorithmic Combinatorics, R. W.. \"Algorithm 97: Shortest

The

Macmillan

New York,

Path,\"

Comm.

ACM, Vol.

5,1962,345.

W. D., \"Analysis of Combinatory Algorithms-A Sample of Current 1972 S.J.C.C., 483-491. Methodology,\" Proc. AFIPS 1.5 11-23. FRIEDMAN, D. P., D. C. DICKSON, \"GRASPE J. J. FRASER, and T. W. PRATT, -A RS Report Graph Processor and Its Application,\" University of Houston, 1-69, August, 1969. 11-24. GIBBS, N. E., \"A Cyclic Generation Algorithm for Finite Undirected Linear J. ACM, Vol. 16, No.4, Oct. 1969, 564-568. Graphs,\" 11-25. C. C., and D. G. CORNElL, for Finding a Fundamental GOTLIEB, \"Algorithms Set of Cycles for an Undirected Linear Graph,\" Comm. ACM, Vol. 10, No. 12, Dec. 1967,780-783. 11-26.GRAHAM, G. D., \"An Algorithm to Determine Number of a the Chromatic Technical of Computer Graph,\" Science, University Report No. 47, Department of Toronto, Canada, Nov. 1972. 11-27. HART, R., \"HINT: A Graph Processing Research Report, Computer Language,\" Institute for Social Science Research, Michigan State East Lansing, University,

11-28.HELD,
11-29.

Feb. 1969.
M.

Spanning

and R. M. KARP, \"The Trees: Part II,\" Mathematical

Problem and Minimum Traveling-Salesman Vol. 1, 197 I, North-Holland Programming,


\"On

Publishing Company, R. C., and E. HOLT,

6-25.

M. REINGOLD,

the Time

Required

to

Detect 6,

Connectivity

in

Graphs,\"

Mathematical

Systems Theory, Vol.

Cycles and No.2, 1972,

103-106.

11-30.

HOPCROFT, in

Bipartite

Switching

11-31. HOPCROFT,

J. E., and R. TARJAN, \"Planarity Testing in Vlog V Steps,\" Computer Science Technical Report No. 201, Stanford University, Stanford, Calif., March 1971.Also in Proc. IFIP Congress, Ljubljana, Booklet Ta-2, August 1971,18-23. 11-32. HOPCROFT,.1. E. and R. E. TARJAN, of Planar Graphs,\" in Com\"Isomorphism (R. E. Miller and J. W. Thatcher, plexity of Computer Computation, eds.) Plenum Press, New York, 1972, 131-152. 11-33. Hu, T. C., and W. T. TORRES, \"Shortcut in Decomposition Algorithm for Shortest Paths in a Network,\" IBM J. of Res. Vol. 13, No.4, July 1969,387-390. Develop., 11-34. Combinatorial Problems,\" in Complexity Among of KARP, R. M., \"Reducibility and J. W. Thatcher, eds.) Plenum Press, Computer Computation, (R. E. Miller New York, 1972, 85-103. 11-35. KERNIGHAN, B. W., \"Optimal Sequential Partitions of Graphs,\" J. ACM, Vol. 18, No. I, 1971, 34-40.)))

\"A n 5 / 2 . Algorithm and R. M. Karp, for Maximum IEEE Conf. Record of the Twelfth Annual Graphs,\" and Automata Theory, 1971, 122-125. J. E.,

Matchings Symp. on

320)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

11-36.

Graphs,\"

11-37.
11-38.
11-39.

B. W., and S. LIN, \"An Efficient Heuristic Procedure for Partitioning Bell System Tech. J., Vol. 49, Feb. 1970, 291-307. C. A., \"A Graph-Theoretic in Graph Theory and KING, Programming Language,\" Computing,(R. C. Read, ed.), Academic Press, New York, 1972, 63-74. See also doctoral 1970. King's Indies, thesis, University of West Methoden und ihre Anwendungen, SpringerKNOEDEL, W., Graphentheoretische
KERNIGHAN,

Verlag, Berlin,
KNUTH,

1969.

D. E., D.
1 79-

11-40. LEHMER,
1 960,

Addison-Wesley Publishing Appl. Math.,


I 93.

Vol. 1, Fundamental Algorithms, Reading, Mass., 1968. Proc. Symp. H., \"Teaching Combinatorial Tricks to a Computer,\" Vol. 10, Combinatorial Analysis, American Mathematical Society,
Programming, Company,

The Art 01 Computer

Inc.,

11-41.

MATULA, in

Graph

and W., G. MARBLE, Theory and Computing D. M. D.

J. D.

ISAACSON, Read,

\"Graph

(R. C.

ed.),

Coloring Algorithms,\" Academic Press, New York,

1972, 109-122.

11-42.

McILROY, Vol.

\"Algorithm 354:

Generator

of Spanning
All

Trees,\" Comm. ACM,


of a Graph,\"

11-43.
11-44.

12, No.9, Sept. 1969,511. G. J., \"A Simple Algorithm MINTY, Circuit

for Listing

the

Trees

IEEE

Trans.

1965, 120. Theory, Vol. CT-12, No.1, March G. D., \"Algorithms for Finding of a Graph,\" MULLIGAN, Cliques No. 41, Department of Computer Science, of Toronto, Report University
May

Technical
Canada,

1972. J. I., \"Efficient

of the Transitive Closure of a Directed Letters , Vol. 1, 1971,56-58. R. Z., and M. O. RABIN, \"An Algorithm for a Minimal Cover of a NORMAN, Proc. Amer. Math. Soc., Vol. 10, 1959, 315-319. Graph,\" 11-47. PATON, K., \"An Algorithm for Finding a Fundamental Set of Cycles of a Graph,\" A C M , Vol. Comm. 12, No.9, Sept. 1969, 514-518. 11-48. PATON, K., \"An Algorithm for the Blocks and Cutnodes of a Graph,\" Comm. ACM, Vol. 14, No.7, July 1971, 468-476. 11-49. POHL, I., \"A Method for Finding Hamilton Paths and Knight's Tour,\" Comm.
11-45.
MUNRO,

Determination

11-46.

Graph,\"

Information

Processing

ACM, 11-50.

Vol. 10, No.7,


M.,

July

1967,446-449.

PRABHAKER,

\"Analysis
Department

August 1972. India, \"A Language and D. P. FRIEDMAN, Extension for Graph Processing and Its Formal Semantics,\" Comm. ACM, Vol. 14, No.7, 1971,460-467. 11-52. READ, R. C., \"Teaching Graph Theory to a Computer,\" in Recent Progress in Combinatorics (W. T. Tutte, Press, Inc., New York, 1969,161-173. ed.), Academic 11-53. READ, R. C., \"Graph Theory Algorithms,\" in Graph Theory and Its Applications (B. Harris, ed.), Academic Press, Inc.,New York, 1970, 51-78. 11-54. READ, R. C., \"The Coding of Various Kinds of Unlabeled Trees,\"in Graph Theory and Computing (R. C. Read, ed.) Academic New York, 1972, 153-182. Press, 11-55. REINGOLD, E. M., \"Establishing Lower Bounds on Algorithms-A Survey,\"

Master's Thesis, nology, Kanpur,


PRATT,

of Algorithms of Electrical

for

Finding

all

Circuits

Engineering,

Indian

Institute

of a Graph,\" of Tech-

11-51.

T. W.,

11-56.ROBERTS,

Proc. AFIPS, S.J.C.C., 1972,471-481. S. M., and B. FLORES, of Hamiltonian Circuits,\" Generation \"Systematic Comm. ACM, Vol. 9, No.9, 1966,690-694. 11-57. ROVNER, P. D., and D. A. HENDERSON, JR., \"On the Implementation of AMBIT/G: A Joint Graphical Programming Language,\" Proc. Intern. Coni. on Artificial Intelligence, 1969,9-20. 11-58.SEPPANEN, J. J., \"Algorithm 399: Spanning Comm. ACM, Vol. 13, No. Tree,\"

10,1970,621-622.)))

CHAP.

11)

PROBLEMS)

321)

11-59.

Chemical E. H., JR., HA Graph Theoretic Algorithm for Matching J. Chern. Doc., Vol. 5, No.1, Feb. 1965, 36-43. 11-60. TABOURIER, Y., HAll Shortest Distances in a Graph. An Improvement to Dantzig's Inductive Algorithnl,\" Discrete Mathematics, Vol. 4, No. I, Jan. 1973,83-87. 11-61.TARJAN, R., HDepth-First Search and Linear Graph Algorithms,\" SIAM J. Comput., Vol. 1, No.2, June 1972,146-160. Science Department, 11-62. TARJAN, R., \"An Efficient Planarity Algorithm,\" Computer 1971. (A simplified Stanford November version Report No. CS-244-71, University, of this report was published as Cornell Univ\037rsity Science Technical Computer in April 1973 by Hopcroft and Tarjan.) Report No. TR73-165, 11-63. TIERNAN, J. C., HAn Efficient Search to Find the Elementary Circuits Algorithm Comm. of a Graph,\" ACM, Vol. 13, No. 12, Dec.1970,722-726. 11-64. -A Heuristic for Testing Pairs of Directed Line UNGER, S. H., \"GIT Program for Isomorphism,\" Comm. ACM, Vol. 7, 1964,26-34. Graphs 11-65. WARSHALL, J. ACM, Vol. 9, Jan. 1962, on Boolean Matrices,\" S., HA Theorem
SUSSENGUTH,

Structures,\"

11-66.

1112.
Planar

WEINBERG,

L., Triply

HA Simple

of

Connected
\"\"A

the Simple Cycles of a Algorithm for Finding Vol. 43-56. 19, No. I, Jan. 1972, 11-68.WELCH, J. T., JR., \"A Mechanical Analysis of the Cyclic Structure of Undirected Linear Graphs,\" J. ACM, Vol. 13, No.2, April 1966, 205-210. 11-69. WELLS, M. B., Elements of Combinatorial Press, Inc., Computing, Pergamon H., New

11-67.WEINBLATT,
Finite

142-148. No.2, 1966,


Directed

and Efficient for Determining Isomorphism Algorithm Circuit Graphs,\" IEEE Trans. Theory, Vol. CT-13,
Search

Graph,\"

J. ACM,

Elmsford,

11-70.

WHITNEY,

1971. N.Y., V. K. M., HAlgorithm


M.

422:

Minimal
Theory

Spanning Tree,\"

Comm.ACM,

Vol.

15, No.4,

11-71.

WOLFBERG,

April 1972,273. S., HAn Interactive


Engineering,

Graph

MooreSchoolof Electrical
1969. Also
Moore

University

System,\" Ph.D. Thesis, The of Pennsylvania, Philadelphia,

11-72. YEN,
11-73.

School Report No. 69-125. HFinding the K-Shortest LooplessPaths in a Network,\" Management Sci., Vol. 17, No. 11, 1971,712-716. J. Y., \"Finding the Lengths of all Shortest Paths in N-Node Nonnegative YEN, Distance and N 3 Comparisons,\" J. Network Using !N 3 Additions Complete Vol. 19, July 1972, 423-424.) ACM,
J. Y.,

PROBLEMS)

11-1.For

the behavior of an algorithm, random A used. studying graphs are often at random from the set of all distinct graph is random if its edges are drawn pairs of vertices. Write a subroutine for generating simple random graphs of a given n and density, where density is defined as the ratio e/n(n 1) for a directed graph - I) for an undirected and 2e/n(n graph. (Hint: Use an appropriate pseudorandom-number generator, and obtain the adjacency matrix.) for converting the following subroutines matrix. (a) Adjacency matrix to incidence to adjacency matrix. (b) Incidence matrix matrix to edge listing. (c) Adjacency (d) Edge listing to successor listing.
Write

11-2.

graph

representations:

(e) Successor listing

to adjacency

matrix.)))

322)

GRAPH-THEORETIC

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

11-3.

Write a program in the assembly language of the machine you may have to pack a given adjacency matrix the given matrix uses full words for X(n, n). Assume that it is 0 or 1. each entry whether
a FUNCTION
gives

11-4. Write
(i,j)

subprogram ADJ,

which

when

supplied

with the subscripts


its

the

ijth entry
adjacency

of

that the packed

(packed) adjacency matrix is in a COMMON


the

matrix as

value.

Assume

area.

11-5. The algorithm


How will
is getting
you

for connectedness restore it? (Hint: a time.)

given

in

the

Observethat

only

text modifies the adjacency matrix. one row of the adjacency matrix
the vertex of I. Assume the

changed at
to

11-6.

when it would be profitable to determine maximum degree in each component before fusion in Algorithm matrix. graph is given in the form of an adjacency
Analyze

determine

11-7.

Will

Also 11-8.
In

1 require Algorithm a program write for

any modification to find identifying all fragments

the

components of a digraph.
Xp,z are

of a digraph?
the
What

Algorithm

3, after an
in

edge (z,p)

has

been

considered
and X?

graph;
could

that is, be done

matrix X entries Xz,p adjacency if one wanted to avoid modifying

it is deleted from made zero.

11-9.

While considering the edge (z, p) if we found that p was already in the tree, we circuit. Let L = LEVEL(z) - LEVEL(p). went ahead to discover the fundamental circuit will contain all and only edges on the path of that the fundamental Prove the two edges (z, p) and from length L from z to the root of the tree, apart
(p,
PRED(p\302\273. following

11-10.

Use the
below

convention
downward

Draw the tree


left
in

from

the root. When vertex z is being examined, the edges (z, p) are added from to right. If z is the vertex under examination, define the trunk as the path the tree T from z to the root. Then show that the vertices in T fall into four

in drawing the tree developed by Algorithm 3. the root, and add vertex p at depth LEVEL(p)

classes:)

1. 3.

Vertex

z that below

is being

examined.
and added
during

2. Vertices
Vertices

z-unexamined
the

the examination

of z.

to the \"left of\"

trunk-unexamined

and at a distance of one from

the

trunk.
on

4. Vertices

and

\"to the

right

of\"

the trunk-examined.)
circuit

11-11.

In

Algorithn1

4 let
fundamental

11 be a

fundamental

found

while

and 12 be a

circuit

found

later

while

examining

show that the tree edge (z l' PRED(z 1)) is in both 11 and not necessary to label the chords? 11-12. In Algorithm 5 suggest a quick way of testing whether a vertex v, which is being in the path array P. [Getting every p(i) for considered for extension, is already i = 1, . . . , k, where k is the length of the path built so far, and comparing with v is obviously bad.] Give a flow chart for the algorithm incorporating this. In Algorithm 6 suppose you suspect 11-13. that the graph is disconnected and the starting and the terminal vertex may not be in the same component. The flow chart given in Fig. 11-9 works it is inefficient. for this case also, but Suggest a method of will have to add a test box at speeding up the detection in this case. (Hint : You an appropriate placein the flow chart, on the outcome of which you would decide whether or not to continue.) 11-14. Modify Algorithm 6 so that it lists all shortest paths from s to t.)))

vertex Zh Z2. If 11 n 12 *- 0, it was 12. Is this why


examining

CHAP.

11)

APPENDIX

OF PROGRAMS)

323)

11-15.

Z as mentioned in Algorithm Given the optimal-policy matrix 7, write a subroutine a specified i and j, as a sequenceof for the shortest path (i, . . . returns that

,j)

vertex

numbers.

11-16.

11-17.

11-18.

11-19.

11-20.

6 to obtain the longest to Algorithm distance from a Write a program similar vertex s to all vertices accessible from s in a given acyclic digraph. 7 can also be used for detecting whether or not a given graph is conAlgorithm D k represents nonexistence of a path.) As presented, n\037cted. (An 00 in matrix Rewrite Algorithm 7 solely for the is inefficient for this purpose. the algorithm in a graph. (Hint: Use X rather than purpose of identifying various components D and logical operations rather than arithmetic ones.) Compare its efficiency with I. that of Algorithm Give an algorithm to find a cut-set with respect to a given pair of vertices a, b. You are allowed Assume that the graph is given in terms of its F-H representation. to scan the F-H arrays only twice. [Hint: If there is no edge (a, b), add one. Choose an edge e in G not parallel to (a, b) by fusing its end vertices. the edge (a, b). Shrink Someedgesmight now become parallel; continue shrinking.] if e* is a bridge. (Hint: Given an edge e*, write an efficient algorithm to determine e* is a bridge if and only if {e*J is a cut-set. Use the result of Problem 11-18.) Edge Write a program for generating all spanning method trees, based on Minty's described in Section I 1-4.)

APPENDIX

OF PROGRAMS)
listings

following

of the algorithms described are given in the of some in APL\\360; the rest are in Program 11-1 is written IV in the form of subroutines. The variables in the subroutines FORTRAN a graph 100 vertices are dimensioned such that with no more than can be given as input.)

Program

pages.

Program

11-1:

Connectedness

and Components)
SL+-R+-1N

[1]

[2]
[3]

C+-1

[4]

LOOP1 : I+-Dlf VA+-X[I ;]

/D+-+/X

[5]
[6]

VA[I]+-1
VN+LOOP2:

'\" VA

[7]

VA+-VAv(v/X[
\037(OF+

;VA/SL])

[8]

/VN\" VA)/LOOP2

[9]

VN+- '\" VA
';C;';

[10] 'COM P

VERT:'

;VA/R

[11]

\037(O=

+ /VN)/HAL T

[12] R+-VN/R [13] NA+- VN/S L [14] X+-X[NA ;NA] [15] SL+-lpR [16] C+-C+1 [17] \037LOOP1
[18])

HALT:

'HALT')))

324)

GRAPH-THEORETIC
X
N

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

Adjacency matrix of 9 Number of vertices in G


Label

C
I

of a

component

Vertex

with maximum
X

degree in
VA

VA VN
R

Ith row of

Logical complement of List of vertices in 9

NA SL

Vertices not adjacent to I Relabeled list of vertices in

9)

Program

11-2:

Spanning

Tree/Forest)
SPTREE ( F , H , N , E , EDGE,

SUBROUTINE

INTEGER DO 4

C,
L L) L

, EDGE(E)

F(E)

, H(E)

, VERTEX(100)

V1,

V2

= = =

1 , N

VERTEX(

0
1 , E

DO
6
EDGE(L)

6 0
0 0
K

= 0

C =
M K

= = = = =

10

V1
I IF

F(K)
GO

(I

VERTEX(V1) .EO. 0)
VERTEX(V2)

TO

39

J =
IF
IF

V2 = H(K) (J (I
= J
= I

.EO. 0)

GO

TO

36

- J)

21, 50, 18

18
21 23

IJ I

J
I

IJI
L

DO 26
IF
VERTEX(L)

1 , N

(VERTEX(L)
=
I

J)

26, 23,
1

25

GO

TO 26
VERTEX(L) =

25
26

VERTEX(L) CONTINUE

DO IF

32

1 , E

(EDGE(L)
=
I

J)

32, 29,
- 1

31

29

EDGE(L)

GO

TO 32
=

31 32

EDGE(L) CONTINUE

EDGE(L)

C =

C -

1
=

EDGE(K)

GO TO

49)))

CHAP.

11)

APPENDIX

OF PROGRAMS)

325)

36

EDGE(K)

VERTEX(V2)

GO TO 49

39

V2

=
=

H(K)
VERTEX(V2)

J
IF

(J

EDGE(K) VERTEX(V1)

.EO. 0) = J
= J

GO

TO

45

GO TO

49
=

45 C

C + 1

EDGE(K) VERTEX(V1) VERTEX(V2)

C
= =

C C
-

49
50

M IF

1
(N

(M .EO.

1)

.OR.

.EO.

E)

RETURN

GO TO
END)

10

Program

11-3:

Fundamental
FCRKTS CIRKIT(100), , TW(100) = 0
L

Circuits)
( X , N , NULTY)

SUBROUTINE INTEGER

LEVEL(100)
,Z

, P , PRED(100)

PREDOP

1 NULTY

, X(N,N)

DO
5
NROOT

1 , N

LEVEL(L) =
= = 1 1
ITW

TW(1)

= NROOT
= 0

LEVEL(NROOT)

10

IF

(ITW
TW(ITW)

.EO. 0)
=
P

GO

TO

38

Z =

LVLSUC

LEVEL(Z) + 1
= 1 , N 3 5, +

DO
IF

35
(X

(Z, P\302\273

35,
0)

15 GO

15

(LEVEL(P) = P TW(ITW)

IF

1 .NE.

TO 21

ITW = ITW + 1

PRED(P)
LEVEL(P)

= LVLSUC

GO TO

33
= =

21

NULTY PREDOP M

NULTY + 1 PRED(P) = Z

CIRKIT(1)

Z)))

326)

GRAPH-THEORETIC
26

ALGORITHMS

AND COMPUTER PROGRAMS)

CHAP.

11)

J = PRED(J)

M=M+1
CIRKIT(M) IF

= J
.NE.

(J

PREDOP) =

GO

TO

26

M=M+1
CIRKIT(M)

PRINT

1000,
=

NULTY, (

CIRKIT(J)

, J

1,

, CIRKIT(1)

33

X(Z,P)

X(P,Z)

= 0
ITW

35
38
39

CONTINUE

ITW

1 =

GO
IF

TO

10
NROOT

DO 39
RETURN

NROOT

N \302\273

(LEVEL(N

ROOT)

.Eo. ( - 1
4 , 24H

GO

TO

40
1000

FORMAT
END)

(4H

THE I

FUNDAMENTAL CIRCUITIS (

20

) )

Program

11-4:

Shortest

Distance from

s to t)
D

SU BROUTINE C

DYSTRA (
OUR

, N

, S , T , LABELT

))

C
C)

9999999 IS
DIMENSION
INTEGER

INFINITY

LABEL(100)
P , S , T ,

DO

D(N,N), L = 1 , N

VECT(100) ,

LABEL(L)

= 9999999
= 0

VECT(L)

LABEL(S) VECT(S)
I

= 0 = 1

10M

= 9999999 DO 18 J = 1 , IF (V E CT (J ) . Ea.
Z IF IF M

1)

GOT 0

18
Z

D(I,J) (Z. (LA


LT. BEL

+
(J)

LABEL(I)

LA BEL ( J \302\273 LA BEL ( J ) . G T.

M)

GOT 0

18

LABEL(J)

P = J

18

CONTINUE

VECT(P) IF
I

(P
= P

.Eo. T) 10
=

GO TO 23

GO

TO

23

LABELT R

LABEL(T)

ET URN

END)))

CHAP.

11)

APPENDIX

OF PROGRAMS)

327)

Program

11-5:
Pair)

Shortest

Path

Between

Every

Vertex

SUBROUTINE C

FLOYD

(D,

))

C
C)

9999999
INTEGER

IS

OUR

INFINITY

DATA
DO

IN

FNTY
K I

D(N,N), /
= =

9999999 /

12

1 , N 1 , N
IN N ) GO

DO
IF

12 (D
(

I, K) . Ea.

F N TY

GO

TO
TO

12
11

DO
IF S
IF

11
(D(K,J)

J = 1 ,

.Eo. INFNTY + D(I,K) D(K,J)


.LT. D(I,J\302\273

(S

D(I,J)

S)))

11
12

CONTINUE

CONTINUE
RETURN

END)

GRAPHS
12)

IN SWITCHING
THEORY)

AND

CODING

concepts

in the previous chapters has been on introducing more but to make theory. Some applications were given, mainly the concepts clearer. In the remaining we shall discuss in detail some chapters
The

emphasis

of graph

applications.
inside
in

In Section 7-5 we saw how the a black box could be determined 8-5 a minimal cover of Section
function. networks

configuration
with a

of a

switching

network

the

graph

help of graph theory. Again, led to the minimization of


will

switching switching

In

this

chapter

graph theory

be

applied

to study

further.

of Paul Ehrenfest's theory came into being with the publication could be applied paper in ] 910, in which he suggested that Boolean algebra to automatic The first mathematical formulation of the telephone exchanges. of a contact network behavior was network) (a particular type of switching given by C. Shannon in 1938. Since 1938, switching theory has developed it was intended to provide the communicationsengineer rapidly. Originally, with tools for analysis and synthesis of large-scale networks, relay switching such as a telephone exchange. In recent years, however, the enormous growth of switching motivated of theory has been mainly by its use in the design Switching

digital computers.

Unlike the
switching
Switching

signals

in a are

classical electrical network


only

(say, in

a radio

receiver),

network signals have


networks

two

values-designated

as 0 and
signals.

I.

designed
A depends

to process
as

and store such binary


either

A switching

network can
network. time

be classified
combinational

a combinational
network

network
one

or a
switching

sequential given

switching
input

is

whose

output at a

only on the

at

that

time.
at

network, input

on the

function of the

at that

other hand, is one time and during


328)))

whose output
its

A sequential given time is a


In

entire

past history.

other)

SEC. 12-1)

CONTACT

NETWORKS)

329)

words,
does

not.

the smallest deskcalculator,


A

a sequential network All digital systems,


and

has
from

memory, largest constructed


the

are

whereas a combinational network multimillion-dollar computer from these two basic types

to

of

circuitry-combinational
combinational

sequential.

contact network,

be classified as (1) a switching network can further gate network (see [12-5],page 77).It is in the study as the most natural of contact networks that graphs of representation appear the switching network, as we shall see in the next section. Although attempts have been made, use of graph theory in little has been accomplished the by We shall therefore networks confine ourselves (see Section 9-3 of [ 1-13]). gate to the contact-type networks in this chapter.) or

(2) a

12-1.

CONTACT

NETWORKS)

A relay household
having

two

contact (or a contact, for brevity) switch used for controlling the in the open state there states;
closed
in

can
light. is no
path

be thought of as an ordinary It is a two-terminal device conductive


that

terminals; in the current to flow


Usually,

state there either direction.


by

exists a
one

will

allow

path between the the electric


bilateral in

Thus a

contact is a

device. Fig. ] 2-1.)

a contact

is represented
\037
X. I)

of the

symbols shown --or

.-/
X.,)

e>----.

.)

II)

Xi)

.)

x.I) represent

Fig. A contact an

12-1

Symbols used to

a switch

contact.)

is a network of interconnected contacts (see Fig. 12-2 a graph, in contact be network can example). Every by represented which the edges are the contacts and the vertices are the terminals. In fact, for our purpose, the following is the definition of a contact network:A contact network is an undirected, connected graph G (with no self-loops) in which each edge has a binary variable assume associated with can it, which only Xi two val ues, I or O. The binary variable Xi assigned the to a contact is I when contact is closed and is 0 when the contact is open. The input-output behavior of a contact network is usually in expressed the form of functions,)
network
for

f(x of

p X 2'

. . . , xk ),)
f
of

the

binary

function

variables. Such a function and must itself assume a value here,


two is

is called 0 or I.

a switching (or Booleant (or

Boolean)
switching))

tSwitching However,

algebra, as defined in switching theory these

actually

terms

a special case of are often used interchangeably,

Booleanalgebra.
as it

causes

no confusion.)))

330)

GRAPHS

IN

SWITCHING

AND CODING THEORY)

CHAP.

12)

algebra, which is used in defined as follows:


A

expressing

and

manipulating

switching functions, is of a
finite

Boolean

algebra

set

Xl'

X 2,
(called

. . .,Xk
Boolean

and

(like rings and fields in Chapter 6) consists two binary operations + (called Boolean

addition)

and

\302\267

multiplication) Xi
==

satisfying the following postulates:)

1. Either
2.
Xi'

Xi

== 1 or
Xi

O.

For every
such

there

exists
==

another
X\037

variable
if
Xi

x\037, called

the

complement

of

that

if
+

Xi

0, a,
{

==

1, and
Xi

==

1, x\037== o.

3. (a) Sum Xi

xj

if

==

== X == j

0,

1,

otherwise;)
if Xi
==

(b) Product
With these

XiX j

==

I,
{0,)

X j == 1,

otherwise.)
number

simple postulates a
are

of

interesting

results

can be

== Xi. that it can be easily shown Xi + xix j networks one encounters two types of problems-the problem In contact we are given a contact and the problem of synthesis. In analysis of analysis under which there will be an are asked to find conditions network G and electrically conducting path between a pair of vertices (Vi' Vj ) in G. In syntheas possible) a sis, on the other hand, we are asked to design (as cheaply with the We shall deal network that can meet the given requirements. problem
For

derived, which
example,

very

useful

in the

simplification of switching

expressions.

of analysis
12-2.

first

and

then with that

of

synthesis.)

ANALYSIS
Consider

OF CONTACT two vertices


by
in

NETWORKS)

any one

a contact

network

G. Since

G is connected,

there

are

can be identified
edges

in

Each of these paths paths betweenthese two vertices. with the Boolean product of the variables associated between 12-2 distinct the eight the path. For example, in Fig. paths

or more

the

verticesa and

bare)

(X I X 5 ),

( X I X'3 X I ),

( X 2 X 3 X I ),

( X 2 X 3 X; X 5)' ( X 3X
4

( 12- I))

(X 2 X'I
Each

X I j,

( X 2 X'I X'3 X 5 ),

( X 3 X 4 X I ),
product

X; X 5) .)

of these

contact

network

products is called G.
;

a path
product

between

vertices

a and b in

the

Clearly, the value of a path has a value of I path product an of the existence implies

is

if and

only if each
1

variable

in

the

otherwise,

it is O.

The value

of a

path product

electrically

conducting

path between

and

b)))

SEC. 12-2)

ANALYSIS

OF CONTACT NETWORKS)

331)

c)

b)

a)

f)

Contact network Fig. 12-2 vertices and nine contacts.)

with

SIX

through
tion

between
path

the
and

For an electrical conducthe corresponding contacts in the network. the two vertices, it is necessary and sufficient that at least one of n 1. I be other the of all Boolean sum words, path products products
specified

between a

of vertices (Vi' V j ) is 1 if and only if the terminals Vi in connected the contact network. Therefore, the electrically Boolean sum of path products is referred to as the transmission of the contact network between the two specifiedvertices. For example, the transmission
pair

v j are

between

vertices
Fab

a and b
Xl Xs +
-t
Xl

in

Fig.

12-2

is)

X') Xl

X 2 X)X

I +

X2X)X )X S + X 2 X
X 5 .)

'

'
1 Xl

X 2 X'I

(12-2)) X') X 5 +

X) X 4 X I + X) X 4 X')

Finding

the transmission

between specified vertices


all

network
finding

consists of
the

enumerating

paths

between

in a given contact the two vertices, and

Boolean based

sum on the
path

of the path products.


Boolean
in

plifications

postulates of the
products
I

Furthermore, possiblesimare also performed. algebra the following identities are

For example,in
evident:)

the

listed

(12-1),

XIX)X

I)

X I X),)
0,) ,)

X 2 X) X; Xs
X 2 X'I X I) and)

=
=0

= X) X4 X') X 5
Therefore,

o.)

the =

switching

function between

verticesa and
X'I

b in

Fig. 12-2

is)

Fab

X I X 5 + X I X') + X I X 2 X) +
all

x 2 X;

X5 +
which

X I

X) X 4.)

( 12-3))

Clearly,

Fab

gives

different
b.)))

conditions

under

conductive

path

exists between

a and

332)

GRAPHS

IN

SWITCHING

AND

CODING

THEORY)

CHAP.

12)

Normal

forms.

Form: A For example,


FOb ==

switching

function of

can expressing

another way
XI(X s +
X'3

be expressed (12-3) is)

in

many

different

X 3(X2 +

X 4 \302\273 + X'I

X2X\037XS.)

( 12-4))

A Boolean
when

function

expressed
the

as a
(12-4)

said to be in form, but in

F(x p X 2, . . . , xm ) of m binary variables x p X 2 , . . . , X m of course) of the variables is sum of products(Boolean, normal or natural form. Function FOb in (12-3) is in normal

it is

not

in

normal

form.

the transmissions one is interested in finding between all result is best expressed as in a given contact network G. The pairs of vertices an n by n matrix called the transmission matrix T == [tij] of G, where n is the number of vertices, and tij is the transmission between vertices i and.i in G. T is a symmetric matrix with every diagonal entry t u == I.) Clearly,

Occasionally,

X4) 4)

2)

Fig. for

12-3

Contact network.)
in

The transmission
1

matrix

the
2

contact

network shown
3

Fig.

12-3

is)

4
tX3
X\037(X2 x\037(x 3

XI
3

+
1

X 2X

X 2 +X

+ + X4
I

x IX3) X I X 2)

2
3 4
The

XI X 2 x\037(x 2

+ X 2X +X
IX

X 3 --t- X I X 2
X tX

X3 +

-i- x I x 3)

x \037 (x

3 -t-

IX

2)

I X4)

of all enumeration involves of a transmission matrix determination A method of better a network. in vertex between determining pair every paths defined as connection matrix is from the primitive a transmission matrix, follows: matrix Q = [qij] of an n-vertex contact network Theprimitive connection as) G is an n by n matrix, whose elements qij are defined
qu ==

I,

for

all i,

= 0, qij
WIse,)

if vertices i and

j are not

directly

joined

by a

contact;
edges

other-)

qij

== Boolean

sum of the variables joining vertices i and j.) connecti{)T} matrices

associated with

all

directly

The

primitive

for the contact networks

in

Figs.

12-3

and)))

SEC. 12-2

ANALYSIS

OF CONTACT NETWORKS

333

12-2,

respectively,

are
1 1

1
Xl

Xl
1

X2
X3
1 I

0
0
I

2
3 4
a b
0
1

X2

X3

X4
1

0
c
Xl
Xs

0
d
0
Xl
I X3

X4

e
X 2

f
X3

a
b

0
Xl

0
0 X'I
X 3

0
0

C
d e

Xs
I Xl

0 X2
X 3

X3

+
1

X3

X4 0
1)

0 0

0 0

X'I +

f
The

X4

the connection matrix is also symmetric, and it contains information a about contact network. complete Let Qk be the kth Boolean of Q (i.e., Q multiplied power by itself k times, the rules of Boolean as defined in Section 12-1) for some using algebra, k. let each in be Qk Furthermore, positiveinteger entry simplified, such as) primitive
X + and)
1 X

== X == xx

+ x' ==
== X

1,)

XX'

== 0 ,)

X +

+ xy == x.)

Then examinethe ijth entry in the simplified Qk.What we have done amounts to tracing all edge sequences i and of length the vertices 1, 2, . . . , k between the simplification }; and by employing process, we have eliminated all that of going over the same redundancies, including edge more than once (xx == x) and going over the same vertex more than once (x + xy == x). Thus the in matrix Qk represents all paths of length k or less between ijth entry vertices i and}. Since in an n-vertex n ], graph the longest path is of length we have)
THEOREM

12-1)
T
by)

The transmission matrix connection matrix Q, is given

of

an n-vertex

contact

network,

with

primitive

T =

Qn-

.)

In case

one is

interested

in

evaluating

the
12-1,

switching
which

function
computes

only

between
switching)))

a specified

pair of

vertices, Theorem

the

334)

GRAPHS

IN

SWITCHING

AND CODING THEORY)

CHAP.

12)

functions
efficien

between
t
:)

all n(n

)/2

pairs,

is wasteful.

Theorem 12-2 is

more

THEOREM

12-2)
Qjj

Let
Boolean

be

the

algebra
equals

ljth minor of the and simplified using

primitive Boolean

connection identities).

matrix Q (computed in funcThen the switching

tion

F ij

Qij.)

12-2 can be proved using led to similar to those which arguments 12-1. The details of the proof are left as an exercise. the evaluation Even of the minor Qu is quite laborious and cumbersome. A simpler method, called the node-removal is often employed in method, for 315-323, evaluating pages Fu' The interested reader is referredto [12-10], details on node-removal techniques.)
Theorem

Theorem

12-3.
network

SYNTHESIS

OF

CONTACT

NETWORKS)
requirements
that

Designing a network from given We can assume synthesis.


in any

is the requirements

the

general problem of of the contact


functions.

network to be designed are given


are given in We can further (i.e., as
just

the

form

of

switching

(If they

other
assume

form,
that
of

a Booleansum
switching
of

into they can be converted the switching functions are

switching
given

in

functions.) normal form

products).
In

Two-Terminal
one

Contact Networks: function F(x p x 2 '


network

a two-terminal

. . . , x m ) of

and

we are

to design a

realizing

this

synthesis we are given m variables, in normal form, as the transmission function

between two
number

its vertices.

if we are not concerned with the This problem is trivial economizing function in a natural can be of contacts, because any switching form an extravagant realized by a sufficiently large number of contacts. But such A realization to be useful should contain not realization is usually acceptable. It is this requirement that makes the synthesis as few contacts as possible. In Fig. three of many possible 12-4, for example, are shown problem difficult.

The simplest if this is the

realizations of a very simple switching among the three networks


most

is the

economic

Are there any methods that contact network for a given


The
switching

realization will guarantee


function?

function (with only four variables). one in Fig. 12-4(c). We may ask possible. If so, how can we be sure?

our

arriving

at

a most

efficient

problem
function
by

of
exhaustive

finding

with a

a contact network that realizes an arbitrary minimum number of contacts has not been solved

yet (except

enumeration)

and is not

likely

to

be solved

in

the)))

SEC.

12-3)

SYNTHESIS

OF CONTACT NETWORKS)

335)

a)

b)

b)

(a) Realization

with

Nine

Contacts)

(b) Realization

wi

th Seven

Con tacts)

a)

b)

(c) Realization

with

Five

Contacts)
FOb

Fig. 12-4

Three

different

realizations

of

wx +

wy

wz

xyz.)

of switching near future. if we consider a restricted type However, called single-contact networks, the problem becomes manageable. Single-Contact

network,

Network:

A contact

able Xi
only an

(either

in uncomplemented

edge is called a single-contact network can be opened or closedindependently. network in Fig. 12-3 is an SC network, but those in Figs.
one SC
Any
contact only

network in which binary varievery or complemented form) is associated with Thus each contact in (or SC) network.
For

example,

the

12-2 and 12-4 are

not.

transmission
function

(or SC function).

once,

it is

further

[the

type

be realizedby an SC network is called a singleSince in an SC network a variable appears the sum of its path products any not possible to simplify of simplification performed on expression (12-2) to produce
that can
other

expression (12-3)].In terms. Every product


terminals,

the

path.

no redundant an SC function contains the specified a distinct between path represents a distinct in to and literal a term edge in corresponds every product is not function F == X 1 X 2 + x 2x; + X'tX2X4 For example, switching words,
term

an SC function.

Realization of an
function
FOb is an

SC

Function:

SC function,

Once we are assured that a given switching we know unambiguously every path between)))

336)

GRAPHS

IN

SWITCHING

AND

CODING

THEORY)

CHAP.

12)

a and b in the network we intend to design. The how to design an SC network for an SC switching work is unique up to 2-isomorphism. This is because
vertices

following function.

shows

procedure The net-

the set
within

of all paths

between a pair
(see Section
Procedure

of

vertices

specifies

a graph

uniquely

2-isomorphism

4-8 and Problem 7-25).


for

Realizing
Fab

a Given
the

SC

Function

of m

Variables
respect

xp

X 2'

. . . , Xm :

Step

1 : From

obtain

path matrix

P (a,b)

with

to the

vertex

pair (a,b).
a column of all l's to P(a,b). 2: Append This Step implies of an edge (with associated between a and variable, say, xo) a into Let the circuit. circuit matrix verting every path resulting
Step

the addition conb, thus

be denoted
eliminate

as B.

3:

dependent

Use Jordan's method of elimination (mod rows in B. Rearrange the resulting fundamental

2) to

all

circuit

matrix

into the standard form (review

Section 7-4, if
Bf ==
[I :

Bf

necessary):)

Bt].)

Step

4: From

Bf obtain the
C f ==

fundamental

cut-set

matrix
- t ].)

C f , given

by)

[C c :

In

- t] ==

[B; :

In

Step

5: From

performing nonsingular

C f obtain Af' the reduced incidence matrix, modulo 2 sums of rows in Cf. This corresponds matrix R such that) transformation
Af
==

by

appropriately

to

obtaining

R.

Cf

,)

where
taking

sets
entire

In step 5 we are essentially cut-sets so that they produce ring of edges incident at each vertex. This is the most laborious stepin the and becomes prohibitive for large on this (more procedure, graphs
Af

has at

most two l's


sums

in

each

column.

different

of fundamental

later).

Step 6: Form
that

the

incidence

matrix
I's).

by

adding

the

each column

has exactly two


us apply
this

From

matrix

missing row to Af (so A draw the graph, and

remove edge Xo.


Example:

Let

procedure

to obtain

a graph

that

realizes

the

SC function)
Fab

==

XtX2X3XSX7 +

X t

X 3 X4 X 6 +

Xt

X S

X 6 XS + 6 X 7 .)

X2X 4
( 12-5))))

X2X

XSXS +

X3X4X6X7XS +

X SX

SEC. 12-3

SYNTHESIS

OF CONTACT NETWORKS

337

Step

1: The

path

matrix

is

Xl
I 1

X 2 I

X3
I 1

X 4 Xs
0
1 1

X 6 X 7 Xg
0
1 1

I 0 0

0 0
1

0
1

1
P(a,b)

0
I 1

0
0
1 1

0
1

0
1

0
0 I
I

0
0
I
I

0
1

0
0

0
I

0
1

I
0)

0
at

Step

2: Appending

a column
variable

of l's

the

end

of matrix
B:)

P (a,b)

and

iden-

tifying

the column

by

xO' we get

circuit
X6
0
1 1 X 7 1

matrix

Xl
1 1 1

X2
1

X 3 I 1

X 4 Xs 0
I

Xg 0

Xo
1
1 1 1 1 I I)

1 0
1

0 0
1 1

0 0

0
1

0
0
I 1

0
1

B=

0
0 0 0

0 I 0
1

0 0
1 I

0 0
1 I

0
I 1

0
I

0 0

Step

consists
submatrix. third

in

of elimination step is somewhat involved. Jordan's method of adding (mod 2) rows to other so as to form an identity rows For example, adding the first row to the second as well as to B we get)

3: This

the

Xl
I

X 2 X 3 X 4 Xs
1 1 I 1 1

X 6 X 7 Xg Xo
0
1

0
1

1 1

I
1 I

0
0
1

1 0
0

0 0
B

0
I

0
1

0
0
1

1 0
0
1

1-

0
0 0

0
1 1

0
0
I 1

0
1 1

1 .
1 1
1)))

0 1
0 0

0
1

0
1

338)

GRAPHS

IN

SWITCHING

AND CODING THEORY)

CHAP.

12)

In

BI

adding

the

second

row to the
Xl
1

fourth

and

sixth

rows, we

get)

X 2 X)
1 1 1 1

X 4 Xs
0 1 0 1
1

X 6 X 7 Xg Xo 0
1
1 1

1
1 1
1

0
0
1 0
1 1

1 0
0
1 1 1

0 0
B2
==

0
I

0
I 1 1 1

0 0 0 0

0
1 1

0
1 1

0
0 0

0 0
1

0 0
1

0
but

0
one

In this each

column

attempt to eliminateall occurs in a different


Xl 1
0

in a

column

(making sure the


get)

in

row), we
X 4

ultimately

X 2 X)
1

Xs
1

X 6 X 7 Xg Xo
0 I

0
1

1
1

0
1

0
B) ==

0 1

1
1

0 0

0 0

0 0

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

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 From this
matrix

we get
Xl 1

the fundamental
X 4 Xg 0
1

circuit matrix
Xs X7 Xo
1 1

in

standard

form:)

X6 0
0
0
1

X 2 1 1 1

X)
1

0
0
1

1
1 1 1

Bf

==

0 0
0

0
1

0
1
1

0
0
1

0
0

==

[1 4 : B 1].

Now

we have the following rank number

information about
matrix

the

desired

network:)
n

of circuit
(including

B == J.l == e xo)

==

4,

of edges

e == 9,

Therefore)

number of vertices
rank

n == 6, == n

of the cut-set

matrix

== 5.)))

SEC. 12-3)

SYNTHESIS

OF CONTACT NETWORKS)

339)

Step

4: The fundamental 3) is

8f

in

step

cut-set matrix immediately obtained as)


Xl
1 1

(with

respect

to the

same tree as

X 4 Xg
1 I 1

X6
0 0 I
1 I

X2
1

X 3 Xs
0
I

X 7

Xo

0
0
1

0
0
0

0
0
o .

0 0 0
1

0 0
0 0

Cf == [8; :

In-d

==

I I 1

0
0 0

0
I

0 0

0
1)

Step

5: After

many trials we
C f

find

that

if we

elementary row operations on The l's per column. operations

we get

matrix

perform the following three at most two that contains

are)

Add (mod
Add
Add

(mod
(mod

2) row 5 to row 1, 2) row 3 to row 5, 2) row 4 to row 3.)


Af is)

The

resulting

reduced

incidence matrix
Xl

X 4 Xg

X 6 X 2 X 3 Xs
1 1

X 7

Xo

0
1 1

0
1

0
0

0
0

I0

I Af == 0
1

0 0
1

0 0
0

0
0
1

0
0

1 0
1

1 1
0

o . 0
1)

0
0

0
Step
that

6: We

every

column

A by adding get the incidence matrix now has exactly two 1 's.)

a row at the bottom

such

Xl 0
1

X4 Xs 0
0

X 6 I

X 2 X3
I

Xs
0
0
1

X 7

Xo

0
I
1

0
1

0
0
1

1 0
0

0
0
1

0
0
0

0
A== 1

0
0

0
0

1 0 0 0 0 1 0 1
1

0
Finally,

0)

the

required
A,

contact network is constructed (seeFig.12-5)


and

from

the

incidence

matrix

then

edge

Xo

is deleted.)))

340)

GRAPHS IN

SWITCHING

AND CODING THEORY)

CHAP.

12)

X7)

a
I \\ \\ \\ \\ I '

b : Fig.

,,

\"

..................._----\"\

,,/

//

//

Xo

12-5 Realization of sion (12-5).)

Fab

in expres-

we see that steps of an SC switching function, require no conditions on Fab for their completion. Step 3 involves some labor, but it is also guaranteed to terminate. Any matrix of rank k can be reducedby Jordan's of elimination to one of the process forms (see [7-3]):) following

In

this

six-step

synthesis

I, 2, 4, and

6 are

easy and

\037

[Ik ! 0],)

or
tJ+\037}

I k .)

O [OJ

whether or not be performed 1,2, 3, and 4 can always Realizability: Steps the given switching will fail at F is an SC function. The procedure function 5 if a F is an in not SC and we will succeed not function, obtaining step This leads us to an reduced incidence matrix by elementary row operations. in graph theory: When a given (0, 1)can extremely important question be a cut-set M may matrix matrix of some graph?An arbitrary (0, I)-matrix or may not be a cut-set matrix. For example, the matrix)

o
L =
1

I 1 0)

0
I

010

[:)
cannot

001)

This can be verified by considering matrix of any graph. (mod 2) sums of the three rows, and observing that this into a matrix row operations transformed by elementary no incidence matrix can be at most two l's per column. In other with words, with L as a cut-set matrix. found to correspond L is unique. It can be shown that this is the smallest (0, 1)The matrix It is also clear that any be a cut-set matrix of any graph. matrix which cannot be a cut-set matrix either. matrix cannot M, if it contains L as a submatrix, matrix of a graph Let us look at another facet of the situation. A cut-set G is also the circuit matrix of its dual G* if and only if G is planar. Suppose a submatrix which we know to be the))) that matrix M = [M 1 : I k ] contains
be a cut-set seven possible cannot be matrix

all

SEC. 12-3)

SYNTHESIS

OF CONTACT NElWORKS)

341)

circuit

M cannot be a cut-set matrix; of some nonplanar graph H; then where a nonplanar a situation subgraph has a dual, which is impossible. Thus we have a secondnecessary if a matrix M == condition: it must of any not contain the circuit matrix [M 1 : I k ] is to be a cut-set matrix, that a graph is nonplanar if nonplanar graph. From Theorem 5-9, we know and only if it has as a subgraph either of the two Kuratowski graphs or any if M is to be a cut-set to either of them. Therefore, graph homeomorphic it must not contain a circuit matrix of either Kuratowski matrix, graph, or to either of them. any homeomorphic graph in a remarkable paper that It has been shown the two necessary by Tutte is conditions discussed so far are also sufficient. The proof of sufficiency realizability extremely long and is based on the theory of matroids.The are stated in Theorem 12-3 (for a conditions for a cut-set matrix precisely matrix
otherwise,

we have

or [12-14]).) proof see[12-11]


12-3

THEOREM

Necessary

and

sufficient

conditions

for

the (0, 1)-matrix

to

be

a cut-set

matrix are
1.

that)

M does

not

contain

L or

LT

as

a submatrix.
matrix

2.

M does not contain the circuit graph homeomorphic to either

of either

Kuratowski

graph,

or

any

of them.)

Realizability

of M as a that

Circuit

Matrix)

Suppose

we want

to

find

whether

or not
cut-set

fundamental
following

result,

circuit matrix (rather than the analog of Theorem


answer.)

12-3and

a matrix M == [Ik M 2] is the of some graph. The matrix) by Tutte in the same proved

paper, has the


THEOREM

12-4
and

Necessary
matrix

sufficient

conditions

for the

(0, 1 )-matrix

M, to

be a

circuit

are that)
not

1. M does

contain

L or

LT

as

a submatrix.
of

2.

does

not

contain

graph Note

homeomorphic that

the cut-set matrix to either of them.)

either

Kuratowski

graph, or

any

an arbitrary
fundamental

(0,
cut-set

1 )-matrix

M falls

into one

of four
G*

categories:)

1. M

is a

matrix

of some graph

G and a fundamental
are

circuit

matrix

of another
cut-set graph

graph G*
matrix

(graphs G and

planar). a circuit

2. M is a fundamental matrix of any

of some graph

G, but

is not

(G is

nonplanar).)))

342)
3.

GRAPHS

IN SWITCHING AND CODING THEORY)

CHAP.

12)

M is
graph

a circuit matrix
(G is

of

some

graph

G,

but

is not

a cut-set matrix

of any

nonplanar).
a cut-set

4. 12-4.

is neither

matrix nor a circuit

matrix

of any

graph.)

SEQUENTIAL

SWITCHING

NETWORKS)
combinational

networks. Let switching as sequential networks (better known As pointed out earlier in the chapter, the output of a sequential machinest). network but also on their past history. not only on the present inputs depends A sequential machine the information about must, therefore, be able to retain of \"state\" of a sequential network, past inputs. This introduces the concept So far,

we have considered only


the

us now

study

sequential

switching

where

the

\"state\" corresponds
machine

to the
is defined

memory

of

the

past inputs.

Mathematiof\037)

cally, a
A

sequential

as follows:
consists

sequential'

machine

is a [v P
V2'

mathematical system M, which


. . . , V n} of . . . , xm}

1.

A finite

set

internal

states (or

simply input output

states). alphabet. alphabet.

2. 3. 4.

A finite set X A finite set A function


state

= [x l' x2 ,
==

of inputs

called the
called the combination
v k

[z l' Z 2'

..

. , Z p}
assigns
(Vi'

of outputs to every

or mapping
function

that

and
transition

the present

input

Xj)

a next

state

. This

of the present function is called


an output Z s to present input.)

the

of M.

5. Another function, every combination There are two

called the
(Vi'

output

function,

assigns
the

Xj)

of the

present state and


describing

equivalent methods of
the state

a sequential
weighted,

machine: (1)
directed

tabular

form,

called

table, and (2) a

graph,

called

the state graph (or state diagram). in the state graph corresponds to a state Each vertex of the sequential a transition from the present state machine, and each directed edgerepresents to the next. Every edge (Vi' V j ) has an ordered pair of weights X k , Zq assigned if the present state of the to it. This weight the fact that pair represents machineis Vi and if the present input is x k an output Zq results, and the next state will be v r The state table and the state graph of a sequential machine)
tSequential

switching

sequential nets, or
used

sequential

for

sequential
employed

commonly

networks are also called sequential networks, sequential machines, circuits. The terms finite-state machines and automata are also machine is perhaps the most switching networks. The form sequential term and we shall use this term.
of a sequential machine is somewhat restricted. completely specified sequential machine.)))
It is the

\037This definition

Mealy model

of a

deterministic

and

SEC.

12-4)

SEQUENTIAL

SWITCHING

NElWORKS)

343)

with)

states

==

[A,

B, C,

D},

in puts

X == [1, 2},

outputs)
are

==

[a,

b,

c})

shown
A

in Fig.
B, for

12-6. In

the

state

graph

the edge
the
output

with

weight

pair
state

from verA and

tex
input

to
I

is

example, indicates that when the machine produces an applied

machine
a and

is

in

the
B.)

will go into

state

2.h)

D)

, c)

e)

Next state/output

Presen t
state
A

2
B/a

Inputs

A/b

e/c

D/c
B/b

C
D

D/e
B/a
graph

A/c)

Fig. 12-6

State

and state

table for

a sequential

machine.)

Properties of
The

State Graphs)
observations

following

can be

made
the

about

the

properties

of state

graphs:)

]. In response to eachspecified

input

machine

in a given

present state
each

goesinto
is m,

a specific

next state.

one for each input; and there is no similar restrictionon the

Therefore, the out-degree of the state graph has nm edges.


in-degrees.)))

vertex

Note

that

344)

GRAPHS IN 2. Since an

SWITCHING

AND CODING THEORY)

CHAP.

12)

input

may

leave

a sequential graph. parallel

machine
but

in

its

present

state,

self-loops may 3. A state graph


weight

occur in
also

a state

may

have

edges,

they

will have

different

pairs.

4.

a starting

the states of a sequential machineis designatedas the machine is required to be in this state before of a machine with a designated any input is applied. The state graph state is regarded as a rooted digraph, the root being the starting

In

most cases
state,

one of
and

starting state.

5.

state no matter which input (if any) that the machine cannot leave, is applied, is called a persistent state. If a sequential machine has a will have no directed edge persistent state, the corresponding vertex
it

going from
6. A sequential
strongly

to

another

vertex.
strongly

machineis saidto be
Thus

connected

if its
other

state graph is
connected

co.nnected.

a sequential
to

machine M is strongly
state from
any

if and

only if M
input

can be brought
sequence.)

any

state

by an

appropriate
The
the

state graph

of a sequential
it is
its state
machines

machine

contains

all the
the

information about
of a given arise in the

machine.

Therefore,

machine by studying theory of sequential be interested in


machine

possible to study graph. Some of the


are

properties that problems

1. Analysis: In analyzing the


determining

the
sequence.

response

to a

conclusion
inputs

certain input about the internal


observing

behavior of a machine, we may, for instance, (next states and outputs) of a given Or we may be interestedin drawing some
of a

behavior

machine
has

by

applying

a series

of

and

state, the application


sequence.
with

the outputs. If a given of input

machine

a designated
in

starting
output

sequence results
a desired
and

unique

2. Synthesis: To design a machine having the statement of the desired response Consider the following example:

behavior,
a state

we start graph.
input

construct

Problem:Design

a sequential

machine

to respond

to

an

arbitrary

machine of 1 whenshould produce an output sequence of O's and 1's..The bits of value greater than 9 ever there appears a set of four consecutive input in a serial 8-4-2-1 BCD code (the bit comes to the machine least significant is 9 or less (i.e., 0000, 0001, Whenever the value of a four-bit sequence first). the be O. should 0010, output

. . . , 1001),

bits and Solution: The machine should store the last three consecutive with to the next bit. Therefore, we should start should examine and respond an eight-state (2 3 == 8) sequential machine. Let the eight states 000, 001,010,)))

SEC. 12-4)

SEQUENTIAL

SWITCHING

NETWORKS)

345)

011, 100,
respectively.

101, 110, and


The

111be designated
alphabet

by

A, B,

C, D,
the

E, F, G, and H,
output

input

consists of

also consists

of [0, I}.

[0, I}, and

alphabet

bit and When a new bit arrives at the left, the machine drops the rightmost stores the new bit together with the two old ones. For example, if the machine the next state is 101 (i.e., F) and the is in state C (i.e., 010)and a 1 arrives, is 1 (corresponding to 1010).The state table and the state graph of output constructed and are shown in Fig. 12-7.) such a sequential machine can be easily

Presen t
state')

Next 0

State/Output

I I I I I I I

A)

A/O A/O B/O

\302\243/0

B)

\302\243/0

C)

F/l
F/I

D)

B/O
C/O

\302\243)

G/I

F)
G)

C/O
D/O

G/I
H/I

H)

D/O

H/l)

B)

0,0)

D)

0,)

1,

I)

\302\243)

I, 1)

G)

Fig.

12-7

State table and state

graph.)

we just machine 3. State and reduction: The eight-state equivalence to perform the specified task. obtained is not necessarily the \"simplest\" one the state The next graph and see step, and a very important step, isto examine The reduction can be accomif it can be reduced to a \"simpler\" machine. plishedif we can determine whether or not two states in a given machine (i.e.,)))

346)
a pair

GRAPHS

IN SWITCHING AND CODING THEORY)

CHAP.

12)

state graph) are equivalent. If two states produce the next states for every input, go to a pair of equivalent considered as one state and they given the same label whereverthey in the state table. occur ]n the state graphs we can fuse the two equivalent verticesand remove any that may result from redundant weights) edges (parallel edges with identical the fusion. In Fig. ] 2-7 vertices A and B are equivalent, and therefore they can be fused. This fusing results in the seven-state machineshown in Fig. 12-8(a). The process of reduction in Fig. ] 2-8. When it yields is shown completed A in Fig. 12-8(e) is the replacement of A the state graph of Fig. 12-8(e). State E is for E, B in the original state graph, state state and C is for C and D, and F, G, and H. The three-state machine in Fig. 12-8(e) performs the same task sequential ] 2-7 did. This simple example as the original eight-state machine in Fig. illustrates the importance of the state-reduction process. 4. State assignment: The next step is the implementation of a sequential that machine from the reduced state graph. Assuming binary memory devices are used, an or switches) (i.e., two-state devices such as flip-flops toggle will n-state machine require q such devices, where)

of vertices

in

the

same

outputs can be

and also

2q-l The

<n

<

2q.)

these

q binary 2q states

memory devices to the n vertices

allow 2q
of the of

possible

states.

How
that

to assign
we

of

economical machine is the


I

problem

state graph such state assignment.

get the
same (

most

terms the state assignment problem is the of labeling the vertices of an n-vertex digraph with available 2q
n graph

theoretic

as that

> n)

labels,

with

certain

optimizing

criteria.)

the is an \"best\" Finding an efficient algorithm to obtain assignment important unsolved problem in the theory of sequential machines. Listing all for and then picking out the best is impractical even possible assignments with ] 0 states. However, for a very small machine, such as the machines in Fig. 12-8(e), it is possible three-state machine to look at all distinct and compare them. For n = 3 and q = 2, the number of distinct assignments table shows three distinct assignments (Y 1 and assignments is 3. The following Y 2 are the two memory devices).)

Assignmen

t I

Assignment II
Yl Y2

Assignment III
Yl 0
1 1 Y2

States

}'l
A

Y2

0
1

0
0
1

0
1
1

0
1 0)))

C
E

0
1

0,0)

1, I)

E)

I,
(a))

G)

D)

0,0)

1, 1)

1,
(b))

0,0)

I, I)))

E)

(c)

0,0) 0,0)

I,

I)

(d))

0,0)

c)

(e)

Fig. 12-8

Reduction

of a

state graph.)

347)

348)

GRAPHS

IN

SWITCHING

AND CODING THEORY)

CHAP.

12)

If you
using

are familar

with

logical

devices,

design
will

these machines
notice

completely,

flip-flops

(or delay

lines) and gates. You


but

that

one assignment
in

is decidedly superior to the other two. There are a number of very important
machine

difficult

problems
solving

sequential

theory.

Graph theory may have

potential for

many

of these

outstanding

problems.)
CUBE

12-5.

UNIT

AND

ITS GRAPH) x p X 2 ' . . . , Xm. Each Xi can take a m we can form 2 distinct Each of m-tuples. a vertex of the m-dimensional unit cube. by 3 are shown in Fig. 12-9. Th\037 extension to is to visualize.) difficult, simple enough
variables
10
11)

Consider a set of m switching value of either 0 or 1. Therefore,

these m-tuplescan be represented Unit cubes for m == 1, 2, and m > 4, although geometrically

.
o)

.
1)

QI)

00
Q2)

01

110

III)

010)
100)

101)

000)
Q))

001)

Fig. 12-9
The edges and vertices vertices. Each vertex is two

One-, two-,

and

three-dimensional

cubes.)

of an m-dimensionalunit labeled as a distinct binary


if and
is called
only

cube

form

sequence

a graph with of m bits such


in

that

vertices

are adjacent

exactly

by Qm. Once again, how we draw the m-cube is immaterial as long as we preserve the adjacency relationshipsof its vertices. For example, Q 3 is drawn in another in Fig. 12-10(a). The 4-cube is sketched in Fig. The m-cube is of 12-10(b). way
graph

one bit.

Such a

if they (i.e., their labels) differ an m-cube and will be designated

interest

in

studying

switching

functions

of m

binary

variables.

The

state-)))

SEC.

12-5)

UNIT

CUBE

AND ITS GRAPH)

349)

(a))

(b))

Fig. 12-10

Graphs of 3-cube and

4-cube.)

assignment

problem

discussed in the last section, can be looked upon problem, of selecting and labeling vertices of an m-cube. See Chapter
that

as

13 of

[12-2]. Someobservations
Q m' are)

can

be made

about the properties of

an

m-cube,

I. There

are exactly m
one

distinct

labels =

bits)

in

position.

Therefore,
n

Qm
2. The

is a

regular

graph of
\037(Vi'

that differ (rom a given label (of m each vertex in Qm is of degree m. Thus 2 m vertices and e = m. 2m 1 edges.

the number of edgesin a shortest path) v j in an m-cube is equal to the number of in in which the labels and v differ. For of Q3 positions example, Vi j in Fig. 12-9 the distance between (011) and is 2. This distance is (101) It is as the Hamming words. known distance between the two binary distance between two
v ) j

(i.e.,

vertices

Vi and

easy to
\037(Vi'

see that)
= number

j)

of

's in

mod 2

vector

sum

of the

labels of
in an

V,.

and

V j.)

3.

The

maximum

distance possible
m-bit

between two
can differ at

vertices

nz-cube is

m, becausetwo

sequences

most

in

m positions.)

A k-dimensional cube can be looked Subcubes: as a subcube of upon cubes.Similarly, higher-dimensional graph Qk may be regarded as a subgraph of of the 2k vertices (of Qm)' whose labels Qm (k < m) such that Qk consists k corresponding have identical m bits. For example, the vertices (011), a (001), (Ill), and (101) in Fig. 12-9 have the same last bit, and constitute subcube is a O-cube, and any is a I-cube. Q 2 in Q 3. Each vertex edge Minterms: A Boolean each of m variables x p x 2, . . . , product containing xm exactly once, either complemented or uncomplemented, is called a minterm of m variables. For example,the minterms of))) (or canonic product)

350)

GRAPHS

IN

SWITCHING

AND CODING THEORY)

CHAP.

12)

three

variables
and

==

a,

b, c

are (a' b' c'),


minterms

(a'b'

c),

(a' bc'),

(a' bc),
they

(ab' c'),
be put

(ab'c),
into a

(abc'),
There
(x'tX\037

(abc).

are 2 m

distinct

with one-to-one correspondence

the

of m variables, and vertices of an


the

can

m-cube. The
(x
1X

minterm

to (0 0 . . . 0 I) vertex, sponds to vertex (I


x
m)

. . . x\037) corresponds and


1

to (00. so on;

. .0) vertex, (X'lX\037


finally,

. . . x\037_ lX m )

corresponds

minterm

2 . . . X m ) corre-

. . . I)

of Qm.

2m

function J(x t' X 2 , . . . , Switching Functions on the m-Cube: Any switching as a Boolean sum of a subsetof of rn variables can be expresseduniquely minterms. This is termed as the canonic form off Clearly, the functionf
1

and only those vertices whose corresponding those minterms are in the canonic form At all other vertices the functionJ is O. The off 1 are to function of Qm at whichfis called true vertices with respect of Q m with vertices f, and the vertices at which f is 0 are called the false the function to function.,!: For example, consider of three following respect
at

is

present verticest

variables:)

J( xl'
The

X 2

' x 3

== X 1 X 2 X3
function

' , ,+

\" ' , X t X2 X 3 + X 1 X 2 X 3

X 1 X 2 X 3.)
in

'

true

vertices

for

this

on Q 3

are shown encircled

Fig.

12-11.)

x-i x

2 X\

\\ I

\\;x))

Fig. 12-11
x-jx-2X))

True

vertices

on

a Q3

for

given

function.)

the Thus function of nl variables uniquely every switching partItIons vertices of the graph Qm into two sets, one consistingof the true vertices and the other consisting of the false vertices. There are 22111such partitions,\037 each function of m variables. Thus the propcorresponding to a distinct switching the properties of erties of switching functions can be determined by studying the subgraph of Qm defined the true vertices with the to given by respect
function.)

tThose

familiar
in

with Karnaugh map


map. two extrenle

will

recognize

that a vertex

In

Qm corresponds

to

a square
\037This

Karnaugh

includes
false

cases

when

all

vertices are
have

(i.e.,

f = 0).

Usually,

partitions

2 m vertices are true (i.e., f do not have empty subsets,

=-

I), and all but here we

called these two

cases also partitions.)))

SEC.

12-6)

GRAPHS IN

CODING

THEORY)

351)

12-6.

GRAPHS Gray Codes:

IN

CODING

THEORY)
information

Often,

when

is converted
of

its

digital

equivalent,

one requires

list

distinct

one precedingit in just of a rotating the angles in adjacent shaft, angular position intervals are encoded into m-tuples (using m brushes on a comquantum that differ in just one place. Taking m == 3, for mutator) of binary digits 0 to 360\302\260, the code for angles from instance, as the angle increases binary
each

differs

from the

from analog form to m-tuples such that one coordinate. For example, to
binary

determine

the

might

go

through

the succession)

000 for
001
011

0-45\302\260 , 45-90\302\260,

for
for

90-1

35\302\260 ,

010,
110 111 101 100 and

for
for for for for

135-180\302\260, 180-225\302\260, 225-270\302\260, 270-315\302\260, 315-360\302\260,

back

to

000
Such

for

0-45\302\260 .)

called the
contrast when from

four

bit at a time, is which requires the changing of only one the or circuit code, code, code, Gray reflected binary cyclic code. In to the Gray code, other codes may of several bits changing require from one number the to next number. For going higher example,going 7 to 8 in 8-4-2-1 BCD (i.e., from 0 III to 1000) involves a change in all bits simultaneously. Because of variations in the construction of the a code,
multiple

equipment, such
during

changes

may

not

register simultaneously.

Thus,
code

the

change,
in

false code
in

combinations are

supplied.

Such

false

words
important An

are eliminated
m-bit

is why code, and this Gray Gray conversion of information. analog-to-digital in an m-cube. Gray code corresponds to a circuit a code

codes are

so

the 3-bit Gray


rotating

just

illustrated
by

shaft

is defined

the

in heavy
from

lines. The reason for


figure.

For instance, for measuring the angular position of the circuit in Q3 in Fig. 12-12 shown Hamiltonian the term cyclic or circuit code should be clear

this

An m-bit code that is called a uses all 2 m vertices code need not be a completecode.For example, when

complete code. A
4-bit

circuit

words

are used

to

represent decimal

digits,

we use

only 10 out

of 16vertices.)))

352)

GRAPHS

IN

SWITCHING

AND

CODING

THEORY)

CHAP.

12)

110
\037

111

010
1

100

101)

000)

.)

Fig. 12-12 In selecting an

Gray

code

on

Q3.)

m incomplete code from 2 available words, one would like to selecta code that has certain error-checking properties. One such codehas the desirable property that a singlebinary error (caused by malfunctioning of the equipment)in a word results in either (I) the next word, (2) the preceding or (3) a word that does not appear in the word, code at all. The last case indicates a detected error, and the first two cases introduce errors of relatively small magnitude. Such a code is calleda snakein-the-box code, or unit-distance error-checking code. (SIB) An SIB code corresponds to a circuit in Qm such that no two nonsuccessive vertices SIB code in Q 3 is shown on the circuit are adjacent. A 6-word, in Fig. 12-13.) Snake-in-the-Box

Codes:

110

oC)

I 1 1)

#)
010)
t)

101)
1)

f/)
000)
.)

Fig. 12-13
Q3.)

Snake-in-the-box

code

on

001)

The SIB codes can be generalized with additional error-checking to codes In graph properties, as follows: Qm' a circuit Cs is saidto be of spread s if a find a shortcut (i.e., a path with no edge from C s cannot person going around s edges of Qm. With Cs) between two vertices of C s consisting of fewer than this definition, every circuit in Qm is of spread I, and an SIB codecorresponds to a circuit of spread 2. For a given m and a specified s, one would like to find as large a circuit C s as possible. At present no relationship is known that gives the size of the on C s in a Qm for arbitrary m and s. For a survey of such problems largest in Qm' the reader is referred to a paper by Klee codes [12-8].

Huffman

Graph-Theoretic
entirely

Codes:
different

We

shall

now

briefly discuss the


A

applicacode is
a)))

tion of graphs to an

type of

coding.

binary

group

SEC. 12-6)

GRAPHS IN

CODING

THEORY)

353)

the property set of binary code words with that the modulo 2 sum of arty two code words in the set is also a code word in the set. t Binary group codesare of in information both for analytic and practical transmission, importance as well as reasons. The group structure facilitates their mathematical study details on group codes see [12-12]. their implementation. For more Sincethe ring sum of two cut-sets in a graph is another cut-set or an edgeand edgethat the set of all cut-sets union of cut-sets, it is evident disjoint a binary can be used to define of cut-sets group code. In other disjoint union words, the vectors (2 r of them, r being the rank of the graph) in the cut-set code. group subspace W s , over GF(2), constitute a binary cut-set matrix can be used to generate this The rows of a fundamental a Huffman graph-theoretic code. binary group code. Such a code is called C consider a graph and its fundamental cut-set matrix For example, f in the Fig. 12-14. The rows of C f , their modulo 2 sums, and the zero vector yield 5-bit, 8-word code shown in Fig. 12-14.)

B)

E)

o)

0
0)

10100) 11010) 01001)

\037=) o)

o
o
0)

01110)

(5.3.2)

Lode')
I

00 I I)

11101)

00111) 00000)

Fig. 12-14

Graph

and

its cut-set matrix

code.)

Analogously, the
binary

fundamental

circuit

of a graph

group

code.

Thus

we have two

graph-theoretic codesassociated

also generates a
with

every

graph.)
that

tNote
codes

we are

and

have

been

each code word consists a uniform binary code or a binary block examples of binary block codes.)))
in which

codes and only those binary discussing only binary of the same number of bits. Such a code is called code. Gray codes and binary group codes are

354)

GRAPHS

IN

SWITCHING

AND

CODING

THEORY)

CHAP.

12)

graph-theoretic

number
W

s or

zero code word.


the graph
Now in

of edges e W r (i.e., rank


Fig.

in

the r or

code is generally specified by the dimension of the graph,


nullity graph-theoretic

three

numbers-the l's in

Thus ] 2-14

the

is a

that

we know

graph, we can investigate

(5, 3, 2) code. how to generate a code (in fact


codes

p,), and the smallest number code generated

associated subspace,
of
by

a nonof

the

cut-sets

two

codes)

from any

corresponding

such as complete

to important
generate

kinds of graphs-

graphs, we

bipartite

graphs,
that

regular graphs, and


group

planar graphs.
with certain

Conversely,

can

look

and This is specified properties, such as efficiency error-correcting capability. an area of current research. Some relationshi ps between the properties of and the properties of the associated codeshave been graphs investigated by Huffman [12-7], Frazer [12-3],Hakimi and Bredeson [12-4], and Saltzer

for graphs

codes

[12-13].)

SUMMARY)

In this chapter automata circuits, graph theory was applied to switching of graphs to digital and theory, and coding theory. The applicability systems signals is not surprising, because both operate in G F(2). For lack of space, only in switching theory were selected applications discussed. Many related such as the study of series-parallel contact topics,

and regular expressions, networks, planar and nonplanar contact networks, were not even mentioned. Several other topics, such as the graphs of gate-type SIB codes, and properties of Huffman were also networks, codes, generalized left out. These are someof the areas of current research in switching theory. It is hoped that the serious reader will go to the references cited for a fuller account of this fascinating application of graph theory.)

REFERENCES)
with switching theory was assumed in this chapter. For introductory is still Caldwell [12-2], one of the earliest books in switching theory, one of the best, and Chapters 5, 8, 10, 12,and 13 are particularly relevant to the subject of this chapter. For a more abstract and formal treatment of switching theory, Harrison [12-5] is recommended. Chapter 5 of Miller [12-10] is excellent for graph-theoretic treatment the of contact networks. Chapter lOin Hill and Peterson [12-6] is good for understanding the classic book of Peterson of sequential circuits. For coding problems in synthesis theory, is recommended. be read for an appreciation of Birkhoff and Bartee [12-1] [12-12] may to switching theory and coding. Other why theory should be so readily graph applicable sources referred to in the text are included in the following list of references. 12-1. BIRKHOFF, G., and T. C. BARTEE, Modern Applied Algebra, McGraw-Hill Book

Certain

familiarity

switching

theory,

Company,

New

York,

1968.)))

CHAP.

12)

REFERENCES)

355)

12-2.

CALDWELL,

S.. H., York, W. D., S. L.,

Switching Circuits

and

Logical
to

Design,
Linear 1964,

John

Wiley

&

Sons,

Inc., 12-3. 12-4.


Annual

New

FRAZER,

1958. \"A Graph-Theoretic Coni

Approach
\"Graph

Allerton Trans.

on Circuit and System Theory,

Codes,\" Proc. 888-898.

Second Codes,\"

HAKIMI, IEEE

and J.

G. BREDESON,

Theoretic

Error-Correcting

1968, 584-591. Inform. Theory, Vol. IT-14,No.4, July and Automata M. A., Introduction to Switching 12-5. HARRISON, Theory, McGraw-Hili New York, 1965. BookCompany, to Switching Theory and Logical Introduction 12-6. HILL, F. J., and G. R. PETERSON, & Sons, Inc., New York, 1968. Design, John Wiley 12-7. HUFFMAN, D. A., \"A Graph-Theoretic Formulation of Binary Group Codes,\" at 1964 ICMCI, pt. 3, 29-30. summaries of papers presented 12-8. KLEE, V., \"The Use of Circuit Codes in Analog-to-Digital Conversion,\" in Graph

Theory and Its 1970, 121-131.

Applications

(B.

Harris,

ed.), Academic

Press, Inc., New

York,

of Switching Functions by Linear Graph Theory,\" \"Synthesis , Vol. 4, July 1960, 320--328. 12-10. MILLER, R. E., Switching Theory. Volume I: Combinational Circuits, John Wiley 1965. & Sons, Inc., New York, 12-11. MINTY, G. J., \"On the Axiomatic Foundations of the Theories of DirectedLinear J. Math. Mech., Vol. Electrical Networks, and Network Programming,\" Graphs,

12-9.

MAYEDA,

W.,

IBM J.

Res. Develop.

485-520. 15, 1966,

12-12.

PETERSON,

W. W., C.,

Error Correcting Codes,The M.I.T.Press, Codes,\"


York,
in

Cambridge,

Mass.,
ed.),

1961.

12-13.
12-14.

SALTZER,

\"Topological

Error

Correcting

Codes (H.

B. Mann,

John Wiley

& Sons, Inc., New

1968.
American

to the Theory of Matroids, TUITE,W. T., Introduction Company, Inc., New York, 1971. 12-15. WELSH, D. J. A., \"Matroids and Their Applications,\" of Michigan

Elsevier

Publishing
University

Seminar Notes,

(to

appear).)))

ELECTRICAL
13)

NETWORK
THEORY)

ANALYSIS

BY GRAPH

One

of the

reasons for the

recent revival
is the

of interest

in graph theory
graph

among
to

students of

electrical

engineering
idea

application of
(more

theory

the

analysis and design of electrical networks

commonly

known

as elec-

trical circuits). The


an

of using

graph theory for predicting the

behavior of

is not new. It originated with G. Kirchhoff in 1847 and was improved upon by J. C. Maxwell in 1892. However, for hand computations (which were limited to small networks), the application of necessarily to network real offered little over the more graph theory analysis advantage
electrical

network

elementary methods of node or The picture has changed and


digital

computer.

milestone
by

loop analysis. since the arrival in graph-theoretic analysis


is changing

of the high-speed
net-

works

was achieved

W.

S. Percival,
with

when he networks

of electrical extended the Kirchhoff


Computer

and

Maxwell

methods to networks
of

active

elements.

programs are

analysis [13-2] based on the graphlarge theoretic approach. More efficient and lessuser-orientedcomputer programs for analyzing In are in the offing. larger and more generaltypes of networks this chapter we shall present the underlying of principle graph-theoretic analysis of networks-whichis how to use spanning trees (or chord sets)for evaluating

now available for

determinants

of a

matrix.
disciplines

Reminder on Terminology:Different

using

graph

theory have
term

developed
branch

somewhat

different

terminology.

In electrical

engineering, the

is used

network
consistency,
throughout

for edge, node for vertex, and loop for circuit. An electrical is more commonly known as an electrical circuit. For the sake of the same however, graph theory terminology has been used
this

book.)
356)))

SEC. 13-1)

WHAT IS AN

ELECTRICAL

NElWORK?)

357)

13-1.

WHAT IS

AN

ELECTRICAL

NETWORK?)

network is a collection of interconnected electrical elements as such resistors, inductors, diodes, transistors, (or devices) capacitors, vacuum tubes, switches,storage batteries, transformers, lines, delay power as the response to a unit of sources, and the like. The behavior (such impulse) an electrical network is a function of two factors: the of characteristics (1) each of the electrical and (2) how they are connected that elements, together,
An electrical

is, their picture.


An

topology.

It is

the latter factor


can be)

that

brings

graph

theory

into the

electrical

element

1. Lumped

or distributed.
(i.e.,

2.
4. 5.

One-port

two-terminal)

or multiport.

3. Linear or
Time Passive

nonlinear.

invariant

or time

varying.

or active.
nonbilateral.)

6. Bilateralor
To

avoid

using

partial

differential

equations,

a distributed

element, such

as a transmission is either approximated elements or is conline, by lumped sidered separately.Thus an electrical network almost by definition a implies network consisting of lumped a device such as elements Also, only. multiport a transformer or a pentode can be replaced by a set of interconnected twoterminal such as resistors, inductors, and dependent power sources elements, of lumped, two(seeFig.13-7). Thus we can confine ourselves to a network
terminal elements.
A with

two-terminal each

edge
edge
two

calledthe
across the

edge
through

current

electrical element is represented by an edge eke Associated are two edge variables, vk(t) and ik(t). The variable vk(t) is it exists because variable, voltage and may be regardedasa cross end is vertices called the of the edge. The other variable ik(t) and it flows because variable, may be thought of as a through

variables are directional, every edge is assigned element The characteristics of each Fig. 13-1). are completely described in terms of these two variables. (The physics of an electrical element and its mathematical form another subject in description electrical and little us are of concern to engineering here.) Thus an electricalnetwork G in which for us is a connected directed graph each edge ek is assigned two variables vk(t) and ik(t). The edge variables of each a relationship edge satisfy imposed by the nature of the corresponding element. Let the directed 1, 2, 3, . . . , nand e edges))) graph G have n vertices
the

edge.

Since the

an

arbitrary

orientation

(see

358)

ELECTRICAL

NETWORK

ANALYSIS

BY GRAPH THEORY)

CHAP.

13)

. k th electrical branch

.
+

i k (t)

Vk(t)

Edge k

(a)
Fig.

(b))

13-1

a bl ,
given

directed

graph

Electrical element and its representation as an edge of at tail of current arrow).) (the voltage + is always

b 2 , . . . , be. Let the time be represented

values of currents these edges at a flowing through by a column vector (called the edge-current vector)
i 1(1 r
'2(t))

i(t), where)

i(t)

=)

fe(t))

Similarly,

vector

the edge voltages across the e (called the edge-voltage vector) vet),
-

edgesare represented
where)

by

another

V I (t)

v 2(t))

vet)

==)

ve(t))

13-2.

KIRCHHOFF'S
VOLTAGE

CURRENT

AND

LAWS)

mentioned that each element in an electrical network is governed its two specific relationship imposedupon edge variables. When the a network, is there any elements are interconnected to form additional The answer, as on these edge variables relationship imposed collectively? must also obey the every electricalengineer knows, is yes.The edge variables two laws of Kirchhoff's:
It was by a
Kirchhoff's

Current

Law

(KCL):

For

any

lumped orientations)

electrical

time

the

net sum
any

leaving

node

(taking into account the (or vertex) is zero. That


G,

is, at
0,

the

rth

at any the currents vertex of the correnetwork,


of all

sponding directed graph

we must

have)
( 13-1 ))))

arkik(t) = L: - I)

SEC. 13-3)

LOOP

CURRENTS

AND NODE

VOLTAGES)

359)

where

ark is the

rkth

entry flowing

in the through

amount of current
simultaneously

for r

= I,

2,

incidence matrix A of G, and ;k(t) is the the kth edge of G. SinceEq. (13-1) holds . . . , n, it can also be written in the matrix form) Ai(t) =
O.)

(13-2))

any

Kirchho.ff's time the

Voltage net sum

La\\v

(KVL):
into

For
account

any
the

(taking
have)

lumped electrical network, at of the voltages orientations)

around a loop (i.e.,circuit)


for

is zero.

In

terms of the

corresponding digraph,

the

rth

circuit

we must

l' k = 1)

L:

brkVk(t)

= 0,

(13-3))

where

b rk is

the

rkth

entry kth

in the edge.

circuit matrix B of G, and vk(t)

is the

amount
for

of voltage across the circuit in G, it can

Since Eq. (13-3) holds simultaneously be represented in the matrix form as)
Bv(t)

every

O.)

( I 3 -4 ))

13-3.

LOOP
Consider the

CURRENTS
the

AND NODE

VOLTAGES)

space WG (over the field of real numbers) associated G. of e edges and Here Gis a connecteddirected graph graph w n vertices, an electrical From network. Eq. (13-2),e see that the representing each of the row vectors in the vector is to orthogonal edge-current i{t) matrix A. Since the row vectors in A span the entire cut-set subspace incidence n - I), i(t) is orthogonal to Ws . Therefore, W s (of dimension i(t) lies in the circuit subspace W r (of dimension J.l = e - n + I) of G. Sincei(t) is contained in Wr , there must be a set of J.l vectors in W r whose linear combination will produce set of J.l i(t). An obvious choice for this W in is the rows of the fundamental circuit vectors r independent linearly in B.) to some spanning tree. (Clearly, Bf is contained matrix Bf with respect of i(t) in this basis formed by the rows Let the coordinates (or coefficients) In other b 1 , b 2 , . . ., b JJ of Bf be i L1 (t), i L2 (t), . .., words,) iLJJ(t).
vector
with

directed

i1(t);2(t))

i L1 (t)
;L2(t))

i(t)

=)

= [b;-b \037 .

. . b\037].)

(13-5))

_ie(t)
or)

; LJJ(t))))

i(t) =

B\037 iL(t).)

360)

ELECTRICAL

NETWORK

ANALYSIS

BY GRAPH THEORY)

CHAP.

13)

Thus

each of the
they

J.l quantities

can e edge currents i . . , (t),. L2 iL1(t), iLJJ(t).

These

as be expressed are called


in

a linear combination
loop currents (or
circuits
mesh

of

currents);

represent
Eq.

current

flowing

the

J.l

independent

corre-

sponding to the
Substituting

rows of Bf.
(13-5)

into Eq.

(13-2), we get)
== o.)

(AB\037)iL(t)

( 13-6))

Similarly,

from Eq.
Ws .

(13-4)we seethat
to the

the edge voltages


cut-set

is orthogonal

the

- 1 rows of the

subspace

Thus vet)
reduced

the column vector vet) representing circuit subspace W r and is, therefore, in as a linear combination can be expressed of matrix Af. That is,) incidence

VI (t)

VN1(t)

v 2(t)) vet)
==)

V N2 (t)) ==

[a;a\037...

a\037-l].)

V e (t))

VN(n-l

)(t))

(a))

N 2)

Nt)

N 3)

N 4)
(b))

Fig.

13-2

Electrical network and

its graph.)))

SEC. 13-3)

LOOP

CURRENTS

AND NODE

VOLTAGES)

361)

That

is,)

vet)

A1fv N(t).)

(13-7))

Thus n

each
1

of e

edge voltages
v Nt (t),
V N2

can

be expressed

quantities

(t),

. . . , vN(n- o(t).

and

they represent the voltage at each of n respect to the referencevertex. Substituting Eq. (13-7) into Eq. (13-4),we
(BA\037)VN(t)
Let

as a linear combination of These are called node voltages, - I vertices with


independent get)

= o.)

( 13-8))
voltages
respec-

us

now
they

illustrate
are

and how
tively.

obtained

with an example the loop currents and node from the edge currents and edge voltages,

Figure
the

13-2(a) shows an

electricalnetwork
graph
Af

with
in

edges. The
graph

corresponding

directed f' with

is shown
with

reduced

incidence matrix
B

respect

and seven Fig. 13-2(b ). For this to vertex N s and the


five vertices

fundamental
(shown in

circuit matrix heavy lines), are)


I

respect to the spanning

tree [I, 4,

5, 7}

Nt

1 0

-1
I

-1
0

0
0

0
1

0
-1
1

0
0
-1
1

N2
Af=
N3

0
0

0
0
1

0
]
0
1

0
-1
0
1 1

0
0
-1
0
1

N4
Lt
B

0
0
0
]

L2 L3 [i

0 0 expressed

0
in

;l
vector is

The

edge-current

vector

terms

of loop-current

i(t) =
;t(t) I
1

B\037iL(t),

] 0
1 I

0 0
0
1 1 1 I))) \302\267 i

i2(t) ;3(t) i4(t)

0 0

L2 (t)

is(t)
i6(t)
;7(1)

-1
0
0

0
0
0

i L3 (t) [Ll(!)]

362)

ELECTRICAL

NETWORK

ANALYSIS

BY GRAPH THEORY)

CHAP.

13)

The

edge voltages

in

terms

of the vet)

node voltages
A\037VN(t),)

(with

respect

to N

5) are)

=
o 1

Vt

(t)

V 2 (t)

-1

V 3(t)

-1

o o 1

VNt(t)
\302\267

v 4(t)
VS(t)

V 6 (t)

o o 1 o o -1
o) o)

-1
o

VN2 (t)

o 1

VN3 (t)
V N4

o
1)

(t))

V7 (t))

-1)

13-4.

RLC NETWORKS
SOURCES:

WITH

INDEPENDENT

NODAL ANALYSIS)
we shall

In

this

section

resistors,
very

inductors,
class

current sources. In
large by

spite of its inherent


Duffin

restrict ourselves to electrical networks and capacitors (RLC) with independent


simplicity,
in

containing voltage

the

of electrical
element

networks
that

practice.

and RLC network covers a In fact, it has been shown

Brune

and Bott and


electrical

any

time-invariant,
by

passive
(with without

can

be formed

a combination further

real

values of R, L, positive loss of any generality, that


RLC these

and C). A
the

two-terminal, linear, of R, L, and C may be made, stipulation

in series with in parallel with energy


sources.)

elements

sources either

sources may only be connected voltage be connected and that current sources may only all the elements. This stipulation allows us to convert or into a set of current into a set of voltage sources

Nodal
current
rth

have been converted


sources.
be
node

Analysis: Consider an
into

RLC network
sources.
from

in

which

all energy sources

sources
these

current

At each
the

node combine all


current
vector)

Let the net current entering - 1 independent jr(t). For the n


jt (t)

into the

nodes, let the column

j2(t))
j(t)

=)

jn-t(t))

The

linearly

independent

equations
Afi(t) ==

from KCL
jet),)

as) can be expressed

( 13-9))))

SEC. 13-4)

RLC

NETWORKS

WITH

INDEPENDENT

SOURCES)

363)

where

i(t) is the e by
Taking

Af is the
the

reduced incidence matrix of the vector of currents in each of Eq. (13-9),) transform Laplace
1 column
Afl(s)

corresponding graph, and of the e passive edges.

==

J(s).) kth

(13-10)) edge,

elements,

But the voltage-current is given by)

relation in
Ik(s) ==

the

consisting

only

of

RLC

Yk(S)Vk(s),)

(13-11))

where Ik(s) is the Laplace transform of Vk(s) is the Laplace transform the admittance (or self-admittance) the edges in matrix form,)
It (s)

the

of the current through the kth edge, voltage across the kth edge, and Yk(s) is of the kth edge. Writing for all Eq. (13-11)

Yt(s)

V t

(s)

I 2 (s))

Y 2(s))

o)

V 2 (s))

o) Ie
(s))

Ye(s)

Ve(s))

More

compactly,)

I(s) ==

Y(s)V(s),)

(13-12))

of the edge where I(s) is the Laplace-transformed column vector currents, of the edge voltages, and yes) vector column V(s) is the Laplace-transformed
is

the

edge

admittance
Eq.

matrix.
(13-12)

Substituting

into (13-10),)
Af

Y(s)V(s)

==

J(s).)

(13-13))

Eq. (13-7) provideda means


the

of

expressing

node-voltage

vector.

Taking
V(s)

the edge-voltage vector in terms the Laplace transform of Eq.(13-7),)


==
A\037V

of

N(S),)

(13-14))

and substituting

Eq. (13-14)into

(13-13),) ==

[A f Y(s)A\037]V
or)
The

N(S)

J(s)

(13-15))

Y N(S)V N(S) == J(s).)


(n

1) by
as

(n
Y

N(S).

1) matrix
Note

AfY(s)A\037

is called

and

is written

that in deriving

the node admittance matrix Eq. (13-15)it was assumed that

all)))

x( t)

Curren t

source)

L() v(t ) Voltage


source)

-=-

Ground)

(a))

x(t))

3)

L(

v{t)

\037

(b))

x(t)

v (t)
d) '\ R)

b'\

/
x(t))

\037

v(t) R)

(c))

Fig.

13-3

Passive RLC

network

and

its

graph.)

364)))

SEC. 13-4)

RLC

NETWORKS

WITH

INDEPENDENT

SOURCES)

365)

too implies no loss of generality, because in capacitors or inductors at time t == 0 can always be energy source and hence incorporated into jet). replaced by an appropriate an example. An RLC network with Let us illustrate these concepts with sources-one two source-is voltage source and one current independent

the initial
any

conditions were zero. This


stored

energy

given in Fig. 13-3(a). Figure current sources. A directed The reduced incidence matrix

13-3(b)shows an
graph
Ai

equivalent

network
in

with only
Fig.

of the network (with vertex 4 as


a)

is shown

13-3(c).

reference)is)
e

-I
I

0
I

0
1)

Af

2
3)

10.

\037

0)

-I

The

edge

admittance

matrix

is)

Y a( S)

(CIS
0
Yb(s)

+
L\037J

( Yc(s)
Yd(s)

C 2S

+
L\037J

yes)

==

c
0
Y e( s )

3s

L 3s
1
R)

The

node

admittance
Ya(s)

matrix
+ Yb(s)
Yb(s)

N(S)

Af

Y(s)A\037

is)

-Yb(s)
Yb(s)

N(S)

=
[

Yc(s) + Yd(s)

Yd(s)

Yd(s)

o
this

example
is)

Yd(s))

+ Ye(s)) ]

J(s) column vector for

-Xes)
J(s)

=)

Xes)

V(s)
R)

Network

problem
formally

that

on and focus Let us pause for a moment Problem: Analysis can we are solving. The general problem of network analysis a network whose structure determines))) stated as follows: Given

the
be

366)

ELECTRICAL

NETWORK

ANALYSIS

BY GRAPH THEORY)

CHAP.

13)

matrix

A, given its
find

edge admittance matrix


node

yes),

and

given the current and (13-12).]

source
are

vector J(s),
required,
matrix

the

voltages.
Eq.
matrix

[If edge
(13-15),
(which

they can

be readily obtained using

voltages or edge currents


(13-7)

Eqs.

This clearly requires solving Y N(S). Inversion of a


of

which
must

involves inversion
be nonsingular,
its

of the

of course)
The

requires computation
tional determinant
computing

its determinant

and of all
because

cofactors.

convenin

technique is inefficient

of extra

labor involved

in that eventually cancel out. Moreover, the entries form until Y N(S) consist of polynomials in s, and must be carried in literal after the matrix inversion. Therefore, the usual methods of matrix inversion
many

terms

are computationally difficult to implement. Both these problems are circumvented


the

by

determinant
A)

and
and

(Appendix
the

cofactors. For use the fact that matrix

this

we

using graph theory to the Binet-Cauchy invoke

evaluate
theorem

a major

determinant
only

reduced

incidence

spanning tree.
Determinant

Af is nonzero if and Admittance

(or simply major) of if it corresponds to a


the

of

the

Node

Matrix: Let us denote by


Y N(S).

\037N

determinant

of the

node admittance matrix


l!N =

That

is,)

det Y N(S)

det[AfY(s)A\037].)

Using

the

Binet-Cauchy
\037N

theorem,)
pairs
A\037.)

products of all and of majors [Af yes)]


sum of

of corresponding
(13-16))

be an would Had every branch in the network been a I-ohm resistor, yes) identity matrix and det Y N(S) would equal det (AfA\037), which is equal to the for an total number of the spanning trees in the network (Chapter 9). But matrix. It is, however, diagoRLC network, in general, yes) is not an identity nal, and therefore Af yes) has the same structure as Af except that the kth column in Af is multiplied by Y k(S). Every nonzero major determinant in to a spanning tree of the network. still corresponds Af Y(s), as well as Af' 1 edges If we call the product of all n of a specific spanning tree a tree admittance product, Eq. (13-16) becomes) =
all

\037N

\037

tree
trees)

admittance

product. hence is
as

(13-17))

spanning

Equation

formula.

(13-17) was proposed by Maxwell To calculate the node admittance


find

and

known

Maxwell's

determinant

one

must

admittances
illustrate

all the spanning trees of the network, the resulting products. add of each spanning tree, and then The formula for the network of Fig. 13-3. Maxwell's spanning

formula, by Maxwell's 1 edge n the multiply

Let us
trees)))

SEC. 13-4)

RLC

NETWORKS

WITH

INDEPENDENT

SOURCES)

367)

of this edge
nant

graph are

abd, abe, aed, ace, ade,

bcd,

bee,

and bde.
we

Multiplying

the

in each spanning tree and admittances matrix \037N:) of the node admittance
==

adding them,

get the

determi-

\037N

Ya(s)Yb(S)Yd(s) +

-f-

Ya(s)Yb(s)Ye(s)

-f- Ya(s)Yc(s)Yd(s)
Yb(s)YcCs)Ye(s)

--1-

Ya(s)Yc(s)Ye(s)

Ya(s)Yd(s)Ye(s)

+ Yb(s)Yc(s)Yd(s) +
+
L\037JL\037S

Yb(S)Yd(s)Ye(s)

(CIS +
-I-

+ L1IJ(Czs
-+
-1-

(CIS

L'IS)(Czs

+
L\037J\037

(CIS
2S

L'I Ji
I

:
c 3

-+

(CIS
2S

-+

C
L1IJ
I

}/ -+ (CIS+

L'IJRLs
I

--LI

(c

L 2s )

+ L3 (c

c 3S

L 2s )
S

If

+ (c

2S

L 2s )

RL 3 s

==

S2

li(
-1-

c 1c
\037

-t- C 1 C 3 -1
-f-

C 2 C 3)

r( 3

c 1C 2
L3

-1- C 1C 3 -1- C 2C 3)

C2
(

C 3

R
s2R

L1
I 1L

C1
I

--t-

C 3

L 2

'-1I

C1 + C2

)
I

\037

C2 +

C3

sL 3(

L1

C1

-t L 2

C3

-\037

--+-+(L
to

L2L3
\037N

L3Ll
we

.
write

s3LIL2L3)
Y N(S). The

Note
terms

that

compute
in

do not

need to
Y

are canceled

this

method

of computing

\037N.

reader

Also note that is urged


it

no

to
the

compute det Y N(S)


cancel

for \037N expression in the process


independent

depend on
Cofactors

that the large number of terms det Y N(S). Also note that \037N is the trees of a graph do not of the reference vertex chosen because the reference vertex in writing Af.)

from directly obtained. just

matrix
Observe
evaluating

N(S)

and

verify

that

equals

of

directly

of Y N(S) and
of than

2- Trees)
of the Y N(S). Let

Evaluation

cofactors det
Then

more

involved

node admittance matrix the cofactor of the ijth - 2) by


its

Y N(S)

entry

is slightly in Y N(S) be

designated
.. \037 IJ ==

by -

\037ij.

by definition)
of

(
==

),

.+ J.

determinant \302\267

(n

(n

- 2)
and jth
and

submatrix

of

Y N(S\302\273
)

) ( left
Y(s)A\037,

after deleting
deleting

ith

row

column.)
thejth

SinceY N(S)
A\037

Af

will

delete

the ith row

the ith row from At andjth column from Y N(S),


A\037

column
in

from
Af'

respectively.

Moreover,

deleting the jth column


Therefore,)
\037ij

from

is equivalent

to deleting the jth row

==

(-IY+j

det [Af-iY(sXAf_j)T],)

(13-18))
its ith row

where A
deleted.)))

f -i

denotes

the submatrix

of Af

remaining

after

has been

368)

ELECTRICAL

NETWORK

ANALYSIS

BY GRAPH THEORY)

CHAP.

13)

If Af

is the reduced

incidencematrix
the reduced

of

a graph

G,

what

does of

matrix the

represent?
obtained any

Matrix
from

f - i is

incidence matrix

Af-t

graph
removing

Gj

self-loop

Let us
(13-18) is)

first

G by fusing its ith vertex with the reference vertex and resulting from the fusion (Problem 13-14). evaluate cofactors according symmetric \037u, which
==
T

to

Eq.

\037u

det[Af_tY(s)(Af-J
equation

],)

and

the

tance

side of this right-hand prod ucts for the graph


\037u

is simply

the sum

of the

tree

admit-

Gt.

Therefore,)

== sum

of tree

spanning Now

admittance products for trees of Gj .)

all (13-19))

look at

This subgraph has n


consist

of may possibly be an isolated vertex). Sucha subgraph iscalleda 2-tree of G. For example, in Fig. 13-4the subgraph that G 3 is obtained of G 3 and is a 2-tree in G. (Note tree ad is a spanning by 4 and removing the resulting vertex self-loop fusing vertex 3 to the reference
of edge

a spanning tree of G j as - 2 edges, n vertices, two components (one of which

a subgraph of the original graph G. and no circuits. Therefore, it must

e.))

b)

2)

d)

3)

b)

2)

d)

4
G)

(3,4)

G J)
(b))
G3

(a))

Fig. 13-4 in this

Spanning tree of

is a

2-tree (3, 4) of G.)

Moreover, occur

2-tree of
two (i,

G, the

vertex

i and
fusing

in different

components;

otherwise,
in

the reference vertex r must would them yield a circuit.


in

Such 2-treesin
designated
by

which 2-tree

specified

vertices occur
Fig. as)

different

components

are

(3, 4). Thus

Eq.

(13-19)
== sum

r). For example, can be rewritten of admittance

13-4

subgraph

ad is a

2-tree

\037u

products of all
the

2-trees

(i,
of

r).)

( 13-20))

Let us now

use Eq. (13-20) to evaluate

cofactor

\03733

the

network

in)))

SEC. 13-4)

RLC

NETWORKS

WITH

INDEPENDENT

SOURCES)

369)

Fig.

] 3-3.

It has

five

2-trees

of (3,

4) type, and these

are, as seenfrom

Fig.

] 3-4(b),)

ab,
Therefore,) = =

ac,

ad,

be,

and

bd.)

L\\33

Ya(s)Yb(s) + S2(C t C
+
\037

Ya(s)Yc(s)+
tC

Ya(s)Yd(s)

Yb(s)Yc(s) +
+

Yb(S)Yd(s)

2 +

3 +
1

C 2C 3 ) +
+

C1
( i
2

C3

C]

Cz
i
3

Cz

C3
i
t )

S2( LtL2 +
L\\ij' the

\037

\037
L2 L 3))

LtL3

observe that in Eq. to 2-trees (i, r), wherer is reference The nonzero majors of Af- j correspond the node. to 2-trees (j, r). that contribute The terms to L\\ij in Eq. (13-18) must be due to both 2-trees of a 2-treehas only two components and vertex r must be in (i, r) and (j, r). Since must be in the other. Such a one of the components, both i and j vertices 2-tree is designated by a 2-tree (ij, r). Thus) To

evaluate

cofactor of an
of

off-diagonalentry,
correspond

(1.3-18)the nonzero majors

Af-iY(s)

= L\\.. IJ
(

sum of
) ( all

::1:( -I)'+J

admittance products Of
(ij, r).)
about )

2-trees

(13-21))

we did (13-20) because corresponding majors,

In Eq.

sign. The

situation

in

are different
the

matrices,

Eq. we

corresponding

majors

the sign of the nonzero T and had the same A majors f i (Af-J is different. Since and Af - j A (13-21), however, f i have no assurance that the signs of the products of will be positive. In fact, it can be shown (Problem not

have

to

worry

of both

13-15) that)
product

of corresponding

nonzero majors

of A

f -i

and A f - j

= (-I)i+j.

( 13-22))
Therefore,)
L\\ij

sum of

admittance products of all

2-trees

(ij,

r).)

( 13-23))

Returning
L\\3t

to the example
= sum

of Fig. 13-3, once

more)

of admittance productsof
Cz = +

all

2-trees

(31, 4)

=
L\\32

Yb(S)Yd(s)

L3

L 21

3S

'

Ya(S)Yd(s) -t- Yb(S )Yd(S) 1 1 C t + C2 . = + + L3 L2 L 3 S2))) LIL3S2

370)

ELECTRICAL

NETWORK

ANALYSIS

BY GRAPH THEORY)

CHAP.

13)

Node

Voltages:

Now we can
node

compute any
Fig. ] 3-3 is given
+

node by)

voltage

required.

For

example, the voltage at

3 in

V 3 (S) ==)

L\\31

X(s)

L\\32X(S) -I
\037N)

L\\33

V\037S)

Network

every cofactor was originally

expressed
open-circuit

(all

driving

Now that we have formulas for the determinant and node admittance matrix, any network that function in terms of node admittance matrix can now be expressed in terms of various tree-admittance the products. For example, transfer function of a three-terminal in Fig. ] 3-5(a) network 4 as the reference, is) currents zeroed except J I)' taking
Functions:
of \037ij

the

H(s)

3(S)

_ -

\03731(S) \037II(S)

_ -

\037

2-tree

(13,

4) admittance

VI(S)

1: 2-tree (1,4) admittance


formulas

product .
product)

Formulas

like these

are called topological

for

networks.)

J( (5) -----..

R.L.C
Elements I

.
+ t

r
Vi

(s) !

V3 (5)

J 1 (5)\"\"\"-

.
4

\037

4 (a))

r--------------------------l
I I I I I I I) I I I I I I I I I I I 3)

+1
Vi

(s)

i I

l_u_____u___)
j
4)

____________.J)

V3r)
4)))

(b))

Fig.

13-5

Three-terminal RLC network.)

SEC. 13-5)

RLC

NE1WORKS

WITH

INDEPENDENT

SOURCES)

371)

Applying the

this topological formula to the network same as the network in Fig. 13-3 with its driving
Yb(S)Yd(s)

in Fig.
sources

13-5(b),
removed,

which

is

we get)

H(s) -

Yb(S)Yd(s)+

Yb(s)Ye(s)

-f-

YcCs)Yd(s)
2 1

+ Yc(s)Ye(s)

Yd(s)Ye(s))

+ C3
C 2)

S3

L3
( Rt

L3C
C2 R

\037

L 2 C2

3
1)

+ S2

+ S \037

( RC

L3

1 + L 2C
2)

L 2C 2 R )

13-5.

RLC

NETWORKS
LOOP

WITH

INDEPENDENT

SOURCES:

ANALYSIS)
we

In Section
current

13-4,had

considered

KVL instead
loop

of KCL (converting
would

any

set of

source into an = e - n + I J.l

we equivalent voltage source),

have

obtained

simultaneous

equations,)
==

BfZ(s)B\037

IL(s)

E(s),)

( 13-24))

where Bf is the
some spanning

fundamental

circuit
B\037 is its

matrix

tree, and
is,)
V 1 (S)

impedancematrix,
network;

describing

transpose. the electrical

of the network with to respect The e by e matrix Z(s) is the edge property of each of e edgesin the

that

Z I(S) Z2(S)

1 1 (s) 0

V 2 (s)

12 (s)

Ve(s)

Ze(s)

le(s))

Note that for an of its edge admittance


current

RLC network the


matrix

yes).

is the inverse edge impedancematrix Z(s) is the transform of the loop Laplace IL(s)

vector

iL(t), and E(s) is the

Laplace transform
externally

of

the

voltage
J.l

sources

(or equivalent voltage


circuits.

sources)applied

in

the

fundamental

The step-by-step
and Eq. (13-15) The

is left
J.l

J.l by

matrix

matrix

and is

usually

is similar derivation of Eq. (13-24) to the derivation of as an exercise (Problem 13-9). BfZ(s)B\037 in Eq. (13-24) is called the loop inlpedance as) denoted by ZL(S). Thus Eq. (13-24)is rewritten

ZL(S )IL(s)

= E(s).)

( 13-25))))

372)

ELECTRICAL

NETWORK

ANALYSIS

BY GRAPH THEORY)

CHAP.

13)

L2

C2 =
1

L3
+

X(s)L

2s

VI

(S)

+ L 2 C2 S 2
C 3

L(

CI

0
(a))

V(s))

h)

d)

(b))

Fig.

13-6

Network of Fig.

for I3-3(a}

loop

analysis.)

network of Fig. 13-3(a), once again. example, consider the electrical the current source x(t) with an equivalent voltage source, we get in Fig. ] 3-6(a) and its graph the network as shown as in Fig. 13-6(b).)

F or

By

replacing

ZL(S)

==)

( 1 + CI L

LIS
IS

+
(-

Ls
2

1 +

C 2L 2S2

-.L
C 3s

)
(

l c 3 J)
L 3s

I c 3J
X(S)L2S

1
( C3 s
1 + L2 C 2S 2 [ - V(s)) ]
.

R)

IL

_ -

I L1 (S)
[ I L2
(s))

,
]

and)

E(s) =

The solution of

Eq.

(13-25) for

requires
\037L'

of ZL(S).The
Binet-Cauchy

expression

the
by)

obtaining the determinant and cofactors determinant of ZL(S), according to the

theorem
== det == sum

is given

\037L

ZL(S) == det(BfZ(s)B\037) of products of all of [8 fZ(s)]

pairs of
B\037.)

corresponding

( 13-26))))

majors

and

SEC.

13-6)

GENERAL

LUMPED,

LINEAR,

FIXED

NETWORKS)

373)

Since

a major

of Bf is nonzero if
===

and

only

if it corresponds

to a chordset,

becomes) Eq. (13-26)

\037L

sum

of chord trees

spanning

impedance products of the network.)

for all

( 13-27))

Equation

(13-27)
the

was
network

network. For
be,

for a purely resistive originally given by Kirchhoff of Fig. 13-6(b), all possible chord setsare cd,

ee,

bd, be,

ae, ae, and


\037L ===

ad. Therefore,)
-j--

ZcCs)Ze(s)

ZcCS)ZdCS) +-

ZbCS)Ze(s) + ZbCS)ZdCS) + ZaCS)ZdCS) +


+
1 ZaCs)ZcCs)

+
_ -

ZbCS)ZcCs)

ZaCs)ZeCs)

CJs
+

\037 +

LJ CJ +

RL2 s
1

C 2L 2S2
+ CJ(I

L2L JS2 2 + + C 2L 2S

RL 1 s
1

1L

1S

CJCI

L 1. + C 1L

1 s2)

L2 LIL J S2 . + 1 2) + C 1 L 1S + C 2 L 2S 2)
both

The

expressions

for the
in

cofactors of ZL(S)
a fashion

symmetrical

and

asym-

metrical can be obtained 13-11 and 13-12).

similar to

those for

V NCS)

CProblems

Note the

duality

between

the nodal

and loop analyses(Problem 13-16).)

13-6.

GENERAL

LUMPED,

LINEAR,

FIXED NETWORKS)

Topological formulas for \037N'


sections were dependent on
two

\037L' \037ij'

and

important

so on, derived restrictions on the

in

the

last

two

network:)

I. Existenceof edgeadmittance
Z(s)], and

which time

implied invariant.

matrix V(s) [or edge impedance matrix that the network elements were lumped, linear,

2. The
This

edge admittance
implied

matrix

V(s) [and
mutual

that

there
or

was no

network. Thus threebetween

four-terminal

therefore also Z(s)]was diagonal. between coupling edges of the devices (which produce couplings

two

vertex

gyrators,

could

pairs), not have

such as transformers,transistors, tubes,and been included.)

In
will

this

section

we shall

still retain restriction

I,

but

do

away

with 2.

This

allow

us to

handle a

general

linear

network

containing

lumped,

linear,
as)))

devices like transformers time-invariant, r-terminal (r > 2) elements-passive are (which are bilateral also) and (which nonbilateral), as well gyrators

374)

ELECTRICAL

NETWORK

ANALYSIS

BY GRAPH lHEORY)

CHAP.

13)

---)
a

\"

d)

L1
r)

L2

GL

(a))

// / I
a) b) I \\ \\ \\ \\

//

./ ./

.-------)

8 = L I L 2 - M 2)
...... \"\" \"\"\\

Cc
c)

\\ \\ \\) J I I d)

gb
\\ \\ \"\" \"

gc)

L 2 VI (5)
58)

gc

C e)

L. V2 (5)
58)

M Vi (5) __
58)

-)

./)

/ ./ /

/ G L)

+ G L \037) gm \037

Ref vertex)
(b))

a)

h)

c)

d)

Ref vertex)
(c))

Fig.

13-7

(a)

Network

with a transformer (c) Graph

equivalent

network;

and a transistor; (b) Its representation of (b).)

An example of such a network active devices,such as tubes and transistors. is in Fig. 13-7. shown In the network in Fig. 13-7 (which has six edges and five vertices), we 5 is but observe that the current through not also on V edge dependent only 5' 1 and 2 are on V 4' the voltage across edge 6. Similarly, the currents through 1 2 the on Thus and are acrosseachother. dependent mutually edges voltage coupled and so are 5 and 4. (Edges such as 3 and 6 that have no coupling with)))

SEC.

13-6)

GENERAL

LUMPED,

LINEAR,

FIXED

NETWORKS)

375)

any other

edge are called ordinary


the

edges.)

The
Y(s)V(s)

shown

in

following

equation,
Y 1

I(s)

\037

edge admittance matrix for the network:)

yes) is

(s) 11
/2(S) /3(S)

Y 12 : 0 I

0 -

VI

(s)

Y 12 - - --

o
0
0 0

- - - -- I - -

Y2

:0 I

0
-I : -1-

0
0
: I

0
0 0

V 2 (s)

0:
0
0 0

gb --

0 0 - -- ---- Y 4

V 3(s)
V 4 (s) Vs(S)
V 6 (s))

/4(S)
/ s(s)

o : I

/6(S)_ where) y
1

o : gm G L i 0 1-------- 1--0 0 0 :Y6


Y 12 =

;J

')

and

') S\037 Y 6

Y ==

_ -

L2
S\037

')

Y 4 == ge -t-

Ces,

gc +

Ccs.)

Clearly, yes) is not


Node

diagonal.)

Admittance

Matrix)
13-4,

Just as in Section form will yield) and therefore the

Kirchhoff's

current

law

in its

Laplace

transformed

AfY(s)A\037 VN(s)
node

= IN(s),)
is)

admittance

matrix Af

Y N(S) ==

Y(s)A\037.)

( 13-28))

The difference

between Eqs. (13-15) and

(13-28)

yes) was diagonal,

whereas it
and

is not

diagonal
in

is only that in in Eq. (13-28).


Fig.

(13-15)

matrix

For the

network

its graph shown


I

13-7,)

2 0
1

3 0
I

4 0
0
1

5 0
0
0
I

6 0
0
1

a
Af
\037

b 0
c 0

-1

0 0

-1

and the

node admittance matrix


Y1 Y N(S) = Y 12
Y 12
Y 2

Y N(S) \037 Af Y(s)A\037 is

0
gb gb

0
0
Y 6

-gb

0
0

-gb
0

+ gm

Y4 +

-Y
GL +

Y 6

Y 6)))

376)

ELECTRICAL

NETWORK

ANALYSIS

BY GRAPH THEORY)

CHAP.

13)

Determinant

\037N)

Again,

our

aim is to
Y

evaluate the determinant and cofactors of


Y N(S) == det

the

node

admittance

matrix

N(S

). We write)
== det Y(s)A\037.)

\037N

AI

Using
\037N

the Binet-Cauchy
== ==
\037

theorem,)
majors of
Af

products

of corresponding
[Aflx,

yes)

and

A\037

\037 det ot)

[A f Y(s)]ot. det

(13-29))

where

a set of the subscript rx denotes of A\037). Thus as a set of n - 1 rows rx

columns

of Af

yes) and
1

Af

(same

also

denotes not

a set

of n

edges

of the

corresponding

uct Af
again

yes)

the

is graph. In Eq. (13-29), yes) is not as simply relatedto Af as Binet-Cauchy theorem to evaluate

diagonal; it was in Eq.


det

therefore, the prod-

(13-15). So we

apply

[Af Y(s)]ot. And since)

[Af Y(s)]ot we
get)

Af[Y(s)]ot,) det

det

[Af Y(s)]ot

==

\037 P)

det

[Af]p.

[Y(s)]\037,

( 13-30))

where

[Af]p is a
n

set of

columns

set of

of Af
[Y(s)]\037

and
(n

[Y(s)]\037

is the (n

rows

of [Y(s)]ot.
Eq.

Thus

is an

- I) by
get)

corresponding -

1) submatrix

of yes). Substituting
AN

(13-30)

into (13-29), we

=
\037 == \037 ot,p)

det
(\037 det

[Af]fJ.det[Y(s)]\037)

det [Af ].
(13-31))

[Af]ot. det

[Af]p. det

[Y(s)]\037.

In
edges

Eq. (13-31) the of the graph, but

summation is over all


det[Af]ot the

possible

pairs

of sets
and

of
1

-I.

spond to spanning Therefore,)

trees of

det[Af]p are zero unless rx are in which case they network,


and

p correor

\037N

==

det \037 \342\202\254 otp ot,p)

[Y(rx)]ot,P

( 13-32))

summed

over all possible spanning tree pairs the signs of spanning trees rx and p. of product In general, rx and p can represent different

(rx,

P).

The

term
trees.

is the \342\202\254 otp

diagonal, det
(13-32)
But

[Y(s)]\037

==

0,

unless

rx

==

p.

But
tree

if

spanning rx ==

If yes)
and

is
Eq.

p,

= 1 \342\202\254 otp

reduces to (13-17). if yes) is not diagonal,

a spanning

rx, besides

making

a tree

pair)))

SEC. 13-6)

GENERAL

LUMPED,

LINEAR,

FIXED

NETWORKS)

377)

with itself, may be able to \"pair-up\" will be contributions terms to \037N

with due

some

to the

Pairs of Spanning
spanning

Trees:

The
which

following
det
[Y(s)]\037

trees

(ex, P)

for

trees. These between edges. method of picking out all pairs of on the fact that for =1= 0 depends
other

spanning

couplings

any

(lumped,

matrix yes)

can be expressed

linear, time-invariant)
as)

electrical network

the

edge

admittance

y :- - I(S) - - - -,
: ==)

- - --- 1
Y 2(S)
:)

o)

yes)

o)

1-----: Yh(s) , ______1) :

where

the

nonzero

submatrices
example,

Y 1 (s),

Y 2(S),

square matrices.See,for
in Fig.

the edge

. . . , Y h(S) are relatively small admittance matrix of the network

13-7.

the Assuming that we have the list of all spanning trees of the graph, a which tree with determines following principle given spanning P pairs =1= o. spanning tree ex, such that det[Y(s)]\037 The set of rows P must such that [Y(s)]\037 contains be selected no row or column zeros. if and column contains ex Therefore, entirely of p in yes) contains edge p, nonzero entries in rows x, y, . . . , then must contain one (or more) of the P . . . . if in Y column falls the submatrix x, y, Thus, edges p k(S) of yes), at least one of the rows must be in the submatrix Y k(S). also A corollary of the observation just made is that if spanning tree ex contains an ordinary must contain that also u. edge u, P ordinary edge Let us illustrate the selection principle by means of the example of the in Fig. network 13-7. The graph has eight spanning trees:)

(1,2, 3, 5), (I, 2,3,6),

(1,

2, 4,

5),

(1, 2, 4, 6), ( I, 2, 5,6),

(I, 3,
Since

4,

5),

(I,

3, 4,

6), (I, 3, 5, 6).)


five are
== 28

3 and

for possible

6 are ordinary edges,the following pairings out of the total of (8 X 7)/2


(I,

the only candidates pairs of spanning trees:)

1. r(l, 2,3,5) and

3,4,

2. r(I,2, 6) and 3. [(1,2,3,6) 4. [(1,2,3,6)


4, and and

(1,2,5,
(1,3,4,
(1,

have edge 3. 6)}: both have edge 6. 6)}: both have 3 and 6.
5)}: both

3, 5,

6)}: both
6)}:

with

3 and

6.
6.)))

5. r(I,

3,4,6)

and

(1,3,5,

both

with 3 and

378)

ELECTRICAL

NETWORK

ANALYSIS

BY GRAPH THEORY)

CHAP.

13)

not

of the same set of ordinary edges is only a necessary and condition for pairing. Let us now apply the tree-pair selection principle to nonordinary edges: I. IfY k(S) is a 2 by 2 square it corresponds to a transformer or submatrix, to \037N is) gyrator, and its contribution
The

existence

a sufficient

Yk(s) =

\037rowp
\037

c d
\037

row

(p

-t- I)

/
column

\037

column
or)

(p +

1))

or) Column
I

If

ex

Contains)

Column
I row)

p)

(p +
(p

I))

Both

p and
and

(p +
(p

I))

p must

contain
to

I I

(p

+ 1)

I I I

+ I)

Both p

+ 1)

Contribution

AN due

to

k(S) is)

I I

I I

ad

- be

or

or)

2.

If Y k(S)

vacuum

is a 2 by tube. In that

2 triangular case)

matrix,

it corresponds

to a transistor

or

o
Y

k(S)

\037rowp \037 row (p


r-\037

/
column

c d \037
p

+ 1)

column
or)

(p +

1))

or)

If

ex

Contains)

Column
I row)

p + I)

Column (p
(p +

+ 1)

Both

p and (p p and (p

+ I) + 1)

p must

contain
to

I I

(p

I)

Both

Contribution

AN due

to

k(S) is)

I I

ad

or) are light of these two tables, let us look at the five tree pairs that 13-7. network of in the candidates Fig. possible in Three of the five pairs, I, 3, and 4, do not form valid tree pairs, because 1 and both each of the three one spanning tree contains 2, while the edges In

other one contains

only

edge

I.)))

CHAP.

13)

SUMMARY)

379)

The
6)]

satisfy

two pairs [(I, 2, 5,6), remaining the tree-pair-solution criterion,


(Y t Y 2

(I, 2,

4, 6)] and [( I, 3, 5, 6), (I, 3, 4, and their contributions to \037N are)

YI2)gm

Y6

and

Y t g b g m Y 6 ,)

res pecti

vel y.
pairs

to

The criterion of selectionof 2 Y k(S) of sizes larger than

of spanning

trees can
tree

be easily extended
of ordinary
know

by 2

(see [13-7]).

Signsof Tree
edges
det
only,

Pairs:

In the

case of

a spanning
with

rx

consisting

the
1

spanning
or

tree pairs

only

itself,

and we

need not

if

= + [Af]ot

-1

because)
=

\342\202\254otot

det [Af]ot-det[Af]ot

= +1.)
edges
the

But rx in

tree pairs (rx, P) consisting of we must know the relative (not P),
for

nonordinary

(and

therefore
trees

absolute) signs of

spanning

each

pair.

According

to the method
Fig.

of sign

determination

discussed

in Chapter

9,

for the tree pair in

13-7,)

[(1,2,5,6),
and

(1,2,4,6)],)

= \342\202\254 otp

I ,)

for)

[(1,3,5,6),(1,3,4

6)],)

= \342\202\254 otp

+ I.)
rx

Thus
and

admittance products (rx, \037N as a sum of the eight spanning two additional terms due to (rx, P) pairings is expressed as)
=

pairings)

\037N

(Y t Y 2
-+-t--

Y72)gb

G L -t-

(Y

Y2

t Y 2

YI2)gb

Y6 +

(Y

Y2

Y72)Y

4G

(Y t Y 2

Yf2)Y 4 Y 6 +

(Y

YT2)GL Y 6 + Yf2)gm

Yt g b Y 4G L Y t g b g m Y 6 .)

Y t g b Y 4 Y 6 -t-

Y tgbG LY 6 +

(Y

Y2

Y6 +

Note

once The

similarly

again that there is no cancellation of terms. of cofactors \037ij for active networks derivation of the technique discussedin by a combination
pairs.)

can be
Section

carried on
the

13-4 and

use of spanning-tree

SUMMARY)

The technique developed in linear-system Roughly problem. form:) expressed in the following

this

chapter
any

can

be extended

to

solve

any

speaking,

linear-system

problem

can be

AX* == y* ,)))

380)

ELECTRICAL

NETWORK

ANALYSIS

BY GRAPH THEORY)

CHAP.

13)

where for

A is
standard

a linear operator, y* a known

vector,

and

X* an

unknown

vector

which
A

the solution is
method and
the

sought.
is to find

(assuming it exists both sides to obtain

of solving this equation is unique), the inverse vector) required

of A,

and

then

an operator A-I to premultiply

X*=A-IY*.) In an electrical network


devices,

consisting of lumped,
solving

linear,

time-invariant

the problem

consists of

set

of simultaneous,

linear, dif-

coefficients. of the Laplace ferential equations with constant Application linear transform convertsthese differential into equations algebraic equations. Thus the operator A is a matrix whose entries are functions of s, the Laplace variable, and y* is the vector of independent driving voltages (or currents). most Thus the electrical network (like linear-systemproblems) problem which is the same as finding the determinants and consists of matrix inversion,

cofactors.

And

all

that

has been
than

done

in

this

theory can be

used (rather
nonsingular

algebra)

is to show how graph chapter to evaluate determinants and

cofactors of
matrix

the

matrix

A, if A could

be expressed as

triple

product) A =
PMpT,)

reduced incidence (or fundamental where P is a unimodular (0, 1 )-matrix-a a of circuit cut-set or fundamental matrix) graph-describing the \"structure\" values the of the nonzero entries in A. of A; and M is a matrix describing of any lumped, linear, timeThe same approach can be used for solution a can be found. This has a direct invariant provided \"system graph\" system, in Section 12-5, as to when a on the discussed bearing realizability problem matrix of a graph. be the or circuit unimodular matrix P can cut-set given in Whether there is any computational using graph theory for advantage all one can on whether network analysis is totally generate dependent a and without and the of 2-trees, like, trees, rapidly large graph spanning 50 edges) could have A graph of moderate size (20 vertices and duplication. all trees in a computer Even the of the several million trees. storing spanning be such that a be The therefore can should problem. algorithm memory its and admittance trees are at a one time, spanning rapidly generated, the the cumulais on addedto or subtracted from sign) (depending product tree will be tive The that no sum. should guarantee spanning algorithm tree obtained one does not have to check every twice, so that newly generated must also the algorithm against all the trees previously generated. Moreover, tree in the graph is left out. guarantee that no spanning for generating all in Chapter of algorithms As discussed 11, a number in the literature. The best ones))) been proposed have spanning trees of a graph

CHAP.

13)

PROBLEMS)

381)

do generate
spanning
them

trees.
to

one spanning tree at a time without But the algorithms are still not

duplication
as efficient

and generate all


as one would like

be.)

REFERENCES)

The
chapter

bare

essentials

of topological
introducing

analysis of
the

networks

have

been

presented
graph

in

this

purpose of electrical network analysis.


for the

reader

to the application of

theory

to

the application for instance, was said about of graphs to the synthesis of electriNothing, cal networks. Nor did we discuss the extension of these techniques to nonlinear networks. to the frequency-domain analysis, We confined ourselves and did not consider the timedomain analysis via state-space techniques. Many other topics, such as the duality in electrical networks or stability of electrical networks, were also not covered. For these and more, the reader may go to one of several books and scores of research Seshu and Reed [1-13] is the classic and tutorial available on these specific papers subjects. is another excellent book. Chan's book and one of the best books. Kim and Chien [13-5] is not dealt with in Seshu and Reed or includes the state-space [13-3] approach, which in Kim and Chien. Some of the excellent survey papers are by Bryant [13-1], Dawson [13-4], and Kuo a large bibliography on the subject. [13-6]. These papers also include with active devices, Talbot's [13-7] For the sake of simplicity in the case of networks of dealing with two of a single graph was used rather than Mayeda's method approach different and current graphs. graphs-voltage A list of classical papers, such as those of Kirchhoff, Maxwell, Percival, Mayeda, in almost any of the references cited.) Bashkow, Bryant, and others, can be found

13-1.

BRYANT,

Graph York,

P. R., HGraph Theory Applied to Electrical (F. Harary, Theory and Theoretical Physics ed.), 1967. D. A., York,

Networks,\" Chapter 3 in Academic Press,Inc.,New


Edition\"

13-2.

CALAHAN,

Computer-Aided Network Design, Revised


N. Y.,

McGraw-Hill,

1972. 13-3. CHAN, S. P., Introductory TopologicalAnalysis of Electrical Networks, Holt, Rine1969. hart and Winston, Inc., New York, 13-4. DAWSON, to Computer-Aided D. F., uThe Topological Approach Analysis,\" Chapter 2 in Computer Oriented Circuit Design (F. F. Kuo and W. G. Magnuson,
Inc.,
New

13-5. 13-6.

eds.), Prentice-Hall, KIM, W. H., and


Networks,

1969. Inc., Englewood Cliffs, N.J., R. T. CHIEN, Analysis and Synthesis Topological

of Communication
Vol.

Columbia

13-7. TALBOT,
Circuit

Kuo, F. F., HNetwork 1966, 820-829.,


A., Theory,

University Press, New York, 1962. by Digital Computer,\" Proc. IEEE, Analysis
Networks,\"

54, June

Linear HTopological Analysis of General Vol. CT-I2, June 1965,170-180.)

IEEE Trans.

PROBLEMS)

13-1.

Show

that
Using

Kirchhoff's
Eqs.

voltage and current

laws

imply
\037k

\"conservation

of power.\"

[Hint:

(13-5) and

(J 3-7),show

that

= 1 Vk(t )ik(t)

0.])))

382)

ELECTRICAL

NETWORK

ANALYSIS

BY GRAPH THEORY)

CHAP.

13)

13-2.

13-3.

An electrical network with e edges has 2e unknowns (the current through and the 2e independent equations, and discuss the voltage acrosseach edge). Identify existence and uniqueness of the solutions. Kirchhoff's current law may be expressed in more general form as follows: The net sum (taking into account the orientations) of all currents flowing across a cut-set is zero. Using a cut-set matrix (instead of incidence and this form matrix) of KCL, develop equations parallel to Eqs. (J3-2), (J 3-7), (13-8), (13-15), and (13-17).
Fig. 13-2(b) list In Fig. 13-4(a) sketch Of Kirchhoff's and
In AN all

13-4.
13-5. 13-6.
13-7.

spanning all 2-trees

trees and (2, 4) and formulas,

all all

2-trees 2-trees

(N 3N., (23, 4).


will

s )'

Maxwell's

which one

you

prefer for evaluating

and

A L ? Why?

13-8.

13-9.

In Fig. 13-2, assume the resistance value R i or capacitance value Ci (as the case be) in the ith edge of the network. Let x(t) be the value of the independent source node. Convert x(t) into an voltage shown, and let N 5 be the reference current source in parallel with R 1. Use Maxwell's to evaluate formula equivalent evaluate the voltage at node N 3. AN and A3 1. Using these two quantities, In Problem 13-7,keep the voltage R 1. Write the loopsource in series with impedance matrix Z(s) of the network. Write ZL(S). Evaluate AL using Eq. (13-27). Evaluate the appropriate for obtaining V2(S).FinalJy, cofactor of ZL(S) required obtain 13-7. V2(S), and compare the result with that of Problen In a step-by-step fashion derive Eq. (13-24).
may an

13-10. For

RLC

network,

prove
=
\037:

that

Y\\(s) Y2(s) . .

. Ye(S).
in the

[Hint:

Yi(S)Zi(S) =
admittance impedance

1, and

therefore

product of product

spanning tree T spanning tree T chord sets with respect to T


of the

for each

network,

[Y 1(s). Y2 (s) . . . Ye(s).] 13-11. Similarly to Eq. (13-20), show that the (i, i) th cofactor of the loop impedance matrix G is equal to the sum of the chord impedance ZL(S) of an RLC network for all spanning trees of the network products G', obtained from G by deleting the ith chord. 13-12. Attempt an expression matrix ZL for the (i,j)th cofactor of the loop impedance of an RLC network. 13-13. In deriving expressions for AN and AL , we tacitly assumed the nonsingularities of YN(S) and ZL(S). Discuss the requirements imposed on an electrical network have because of the nonsingularity should [Hint: The network requirements. source (1) each voltage only in series with some passive element, (2) each current source coupled only in parallel with some passive element, and (3) no perfectly transformer; i.e., Ll L2 > MI2.] or 13-14.Let Af be the (n - 1) by e reduced incidence matrix of a connected (directed to some reference and e edges, with undirected) graph G of n vertices respect with vertex r. And let Gi be the graph obtained from G by fusing its ith vertex the reference vertex r, and removing any self-loops produced in the process. Prove
that

Af-i, the (n
incidence

- 2) by
matrix

reduced
[Hint:

In G i

the

obtained from Af by deleting its ith row, is the the fused vertex as the reference vertex) of Gi. - 2 vertices have exactly the same incidences as they had in G.)))
e matrix

(with

CHAP.

13)

PROBLEMS)

383)

13-15. 13-16.

Correspondingly, the n - 2 rows of Af are left intact in A f - i . The edges incident between rand i are gone, but the edges that were incident on either r or i but not on both have one end incident on the fused vertex.] In Problem 13-14, show that the product of any two corresponding nonzero majors of (n - 2) by e unimodular matrices Af-i and A f - j is equal to (-I)i+J, providing the rows and columns of both these matrices are arranged in the same order. a dual electrical network to the one in Fig. 13-2, and Draw then study the dual various relationship between quantities between the two networks, such as the loop in the other. equations in one being the node equation
one-port

13-17. For a

RLC

network,
\037 tree

shown

in

Fig.

13-8(a), show

that

the

driving

admittance at terminals (1, r)


\037 2-tree

is
admittance

point

product
product)

(1, r)

admittance

'. (s)

,( (s)

+
) \037 \037S

'2 (s)
RLC

+ V 2 (s )

RLC
: ,( (s)
I I

Vi

(s)

-.
(b)

--

(a)

Fig. 13-8

One-and

two-port

RLC networks.)
admittance

13-18.

two-port

network Fig.

topological formula vertex r shown in

for each

has four short-circuit in the two-port


13-8(b).)))

RLCnetwork

with

functions. Derive the common reference

GRAPH
14)

THEORY

IN

OPERATIONS

RESEARCH)

Graph

theory

tions research.In earlierchapters operations-research problems. The


finding

is a very

natural

and we

tool in combinatorial operapowerful have already applied graph theory to

traveling-salesman
in

the

shortest

spanning
vertices

tree

a weighted

an

optimal

matching

path between two


uses

of jobs and men (Chapter in a graph (Chapter

2), problem (Chapter graph (Chapter 3), obtaining 8), and locating the shortest

II) are some examplesof

the

research. of graph theory in operations This chapter will be devoted in research to using graph-theoretic entirely solving problems operations tools. We shall consider three related areas of operations research in which graph

theory

is used
networks,

most frequently
and

and

profitably.

They are

transport net-

works,activity
14-1.
TRANSPORT

the theory

of games.)

NETWORKS)

In Section 4-6 we saw how a graph can be used as a model for a network of pipelines through which is transported from one some commodity place to another. The general problem in such a transport network (also called a is to maximize the flow the cost of a prescribed flow or minimize network) This is an operations-research be solved flow. and can by linear problem but the has to be combeen found programming, graph-theoretic approach this we shall see how network-flow more efficient.In section putationally
problems

can

be formulated

and solved using


simple,

graphs.

Let us

first define some

terms.
Transport Net\302\273Jork:

transport

(or flo\037') net\302\273'ork if the

weighted, digraph G is called with associated directed edge) weight every


connected,
384)))

SEC. 14-1)

TRANSPORT

NETWORKS)

385)

in G is a nonnegative number. In a transport network this number represents the capacity of the edge and is designated as cij for the edge directed from vertex i to vertex j. A transport is shown in Fig. network 14-1, where the numbers written beside the edge are the edge capacities.)

b)

t) s)

Fig.

14-1

Transport network.)

The capacity cij of some commodity


bits of

of

(such

an edge (i, j) can be thought of as the maximal as water, gas, electrical energy, number

amount
of

cars,

the from station i toj, along information, etc.) that can be transported a natural of time in a steady state. Then edge (i, j), per unit question is: '\\That is the maximal amount of the commodity flow from a given vertex s to another specified the question vertex t via the entire network? Let us first formulate

mathematically.

Maximal flow:
is an assignment
that

In

a given

transport
number

network

of a nonnegative
conditions
directed

fij to every

the

following

are satisfied:)
(i, j)
J r.. iJ
in

G, a flow (or a static flow) directed edge (i,j) such

I. For every

edge

G)

< -

coO. IJ)

( 14-1 ))

2.

There

is a

specified vertex s in
\037fSi
i

G, called

the source, for w,

which)

\037fiS i)

( 14-

2 ))

where

called 3. There

the summations the value of the

are taken
flow.

over all
t in

vertices

in G.

Quantity

is

is another

specifiedvertex
\037fti
i

G, called the sink, -\"'.

for

which)

\037fit i)

( 14-3))))

386)

GRAPH THEORY
4.

IN OPERATIONS RESEARCH)

CHAP.

14)

All

other vertices are mediate vertexj,)

called intermediate
-

vertices.

For

each

inter-

LljI' i

Lfij i)

==

o.

( 14-4))

(14-1) states that the flow through any edge does not exceed its the net flow out of the source other three conditions state that capacity. is w, the net flow into the sink is w, and the flow is conserved at each intermediate vertex. This is why w is called the value of the flow fron1 s to t. Conand is therefore dition (14-3)can, in fact, be derived from (14-2) and (14-4), is no edge from vertex p to q, if there not independent. It is understood that f pq == O. An edge (i, j) for which lij == cij is said to be saturated. A set offlows.t:./s for all (i, j)'s in G is called aflow pattern. A flow pattern w is called a maximal flow pattern. The first that maximizes the quantity in a network is: Given G, s, and t, find a encounters one transport problem maximal flow pattern.
Condition
The Linear

Programming
will

ming (LP)

recognize Fig.

transport network in the 10 edges. Although

Formulation: Those familiar this as an LP problem. As 14-1. The variables are the
w == Isb

with an
flows

linear example,
through

programtake the
each

+ Isd

variable. Let the

- fes' we
by

of

can

regard

flow

pattern

be denoted
fsb

a column

vector

w as f:)

another

fsd

les

Ibe
fbt f==)

leb

fet

Idt

Ide
hd)

and

let)

f'=[;])

denote the variable vector

of

the

LP problem.

Let

denote

the

row vector)

(1,0 ,0, 0, 0, 0, 0, 0, 0, 0, 0).)))

SEC. 14-1)

TRANSPORT

NETWORKS)

387)

Then

the problem is to

maximize

h.1'

subject

to the constraints)

A/.1'
where

==

0,

< c,

and

1'>0 - , 0
0
1 1

-1

-1

0
1

0
-1

0
0
0

0 -1
A/==

0
0

0
I

0 0
-1
1

0 0
0
-1
1

-1

0
1

0 -1
0

0
0

0
0

0
-1
4 5 1 5

I 0 0 -1 -1

and

c==

4 2 1
1)

Observe

that
t

edge from
in

to s

A' is the incidence matrix in the transport network

of

Also of Fig. 14-1.

a digraph

obtained
note

by

adding

an

that

the edges
but,

f, c,

and A' must


maximal

appear
flow

in

the

Clearly, a
as

can

same order. be obtained by

solving

this
more

LP problem,
efficient.

mentioned

earlier,

the graph-theoretic

approach is

Using

cut

the graph-theoretic concept, we shall state and prove the max-flow minnow the in of transport networks. result the theory most theorem, important

Cut and Its


network,

Capacity:Ignoring

the

directions
respect

of edges

in

a
t,

transport
that

let us consider

a cut-set with

to vertices

sand

is, a

t. Such a set of edges in a transcut-set which the source s from sink separates The is called a cut. notation network (P, P) is used to denote a cut that port P contains sand P P and the vertices into two subsets P, where partitions defined to be the sum of is t. The capacity cut denoted contains a of by c(P, P) the vertices in set P to the vertices the capacities of those edges directed from in P; that is,)

I: cij iEP
jEP)))

==

c(P,

P).

388)

GRAPH

THEORY

IN OPERATIONS RESEARCH)

CHAP.

14)

For

example,
fe,

==

d, t}

in Fig. 14-1 the cut has a capacity of 5 +

(dashed line)
5 +

separating

P == [s,

2 == 12.)

b} from

THEOREM

14-1)
network

In a given transport less than or equal to the


Proof:

G, the

value of

flow

w from s from

source s to
t.)

sink

t is

capacity
an

of any cut
write

cut

separating

Let
sink

(P, P)
in

be

arbitrary

such that the


Eq.

source s is in

vertex

set P

and
in

the

t is

vertex

set P.

Let us
-

(14-4)

for all intermediate

vertices

P and

add them to

This Eq. (14-2).

yields)
==

pEP
iEG which

\037

[Pi

\037 pEP iEG)

J;P

W,

can be

rewritten
pEP iEP
\037

as)

fpi

\037 pEP

fpi

iEP

pEP

\037

J;P

iEP
==

pEP
iEP)

\037

== W.

But)

pEP
iEP Therefore,)

\037

fpi

\037 pEP iEP)

fiP

O.

pEP
iEP

\037

[pi

\037 pEP iEP)

== W.

( 14- 5))

Since

\037 pEP

is always

a nonnegative
W <
\037 pEP

quantity,

we
==

have
c(P,

iEP) [pi

<

\037

iEP

pEP

c(p,

i)

P).

.
is possible smallest

iEP)

In
value

the
of
t.)

the

theorem we shall prove that following flow which equals the capacity of the

it

to achieve

a
s

cut separating

from

THEOREM In

14-2

(MAX-FLOW

MIN-CUT
G, the

THEOREM)

a given
the t.)

transport
minimum

network

maximum

value of a
the

equal to
from

value

of the

capacities of all
need

cuts

from s to t is flow in G that separate s

Proof:

In view
in

of Theorem

14-1we

only
s
that

that the value of the flow of some cut (Po, Po) separating the capacity in G such Let there be someflow pattern is at its maximum value possible W00 Define

pattern

G such

Wo from

to prove s to from t.
the

that t

there is equal

exists

a flow to c(P 0, Po),


from

value

of the
in

flow

s to t

a vertex

set P

G recursively

as

follows:

(a) s
(b)

P.

If vertex

i E P and either fij


P.)))

<

Cij

or fji

> 0,

then

E P.

Any

vertex

not

in P

belongs to

SEC. 14-1)

TRANSPORT

NETWORKS)

389)

Now vertex from s to t, say, flow


Vj+ 1 fV}V}+l

cannot

s, Vh < CV}V j +t , or a forward

be in P. If it were, t'2, . . . , Vh Vj+h' .


fvj+tv}

there
. , Vk, t,
an Vj)

would be a for which


directed

path in

p (see every

edge

Fig. 14-2) either


Vj

>

O. In
an

path p
(Vj+ h

edge

is called

edge and

edge

(vj, Vj+l) from

directed from
Vj+ 1

to

to Vj is called

a backward

edge (Fig.

14-2).)
Forward

edge

BaCkward

edge

/
s\037-Fig.

v,)

-vi+ I

'e)

_ ... .- --)

et

14-2

Path p in the

proof of Theorem14-2.)

In

path

p let
\0372

\037 1

edges and
are

be

minimum of all the minimum of all flows


be

the

differences [cv}Vj+t
in

J;,jVj+J

in

forward
and
\037 2

backward

positive

quantities.
increasing

Let
by

\037 =

min(\037 1, \037 2)'


in

Then forward

1 edges. Both \037 the flow in the network

G can
flow

be increased by
in each
flow.

the flow
an

each
\037.

edge and
(14-1),
that

decreasing the

backward edge
satisfied.]

amount

[Conditions

(14-4)are still
Thus

This contradicts
the

the assumption
In

(14-2), (14-3), and Wo was the maximum

from

t must be in t. Furthermore,

vertex

set P.

other (b),

according to condition
[Pi

the cut words, for each vertex


=
O.)

(P, P) separates p in P and i

in P,

we

have)

Cpt

and

Therefore,

from

Eq. (14-5) we get


wo

the

value

of the flow:)

\037

pEP

fpi

iEP
iEP)

pEP iEP

\037

=
which
As

\037 Cpi pEP

c(P,

P),

proves the
an

theorem. .)
let us
3
network

example,

again. It has eight


vertex

set P)

consider the transport that separate s from and their capacities are)
(2

) cuts

t. These

of Fig. 14-1, once cuts (identified by

Vertex {sJ

Set

P)

c(P, 9

P))

Is,

b}

12

Is, c}

Is, dJ

19 7
cJ

Is, b, Is, b,

11

Is, b, dJ Is, c, dJ
c, dJ)

10

16
8)))

390)

GRAPH

THEORY

IN OPERATIONS RESEARCH)

CHAP.

14)

The

cut with

and P is [b, c, fore 7 units.


The

minimum capacity among


t}. The maximum does
flow

these possible

is the in s

one
t

in

which

P =

to

in the

network
actual

[s, d} is thereof

proof

the maximal flow mal flow. If we


algorithm

w max .

not include an Nor does it a minimal

algorithm for
give in

finding that

the

value
this

a flow finding

pattern
W

realizes

maxi-

were interested only code to


generate

max , we

would
Plisch

take some
[14-19]

for

generating

cut (see,
all

for instance,

an efficient computer

minimal

for cuts in a given transport

its capacity. network), and then compute a maximal flow an algorithm For those wanting to construct pattern, min-cut theorem is also availbased on the foregoing proof of the max-flow able. This is an efficient algorithm, and it uses a vertex-labeling process for this algorithm flow However, the proof that constructing a maximal pattern. in a finite terminates number of steps depends on the edge capacities being and its modifications, see For more on this labeling algorithm integers.

or [14-12].) [14-7], [14-9],


EXTENSIONS
THEOREM)

14-2.

OF MAX-FLOW

MIN-CUT

The network

max-flow (simple,

min-cut weighted,
many

There are, however,


solved
these

theorem as stated is applicable to a transport connected digraph) with one source and one sink. other types of network-flow problems that can be

by extending the max-flow are straightforward extensions


in

min-cut theorem appropriately. Someof Let us involved. and others are quite
several
from

consider them
1. and

increasing

order

of di fficulty. sources S1' S2, . . . , Sk source can be sent into a oneimmediately


any

to

s with a supersource source and one-sink problem as follows:Introduce . . a t with . and directed to unlimited S s S , supersink capacity) k edges (of l' 2' . . . shown in as unlimited directed from t t t of , (also r' capacity) p 2' edges all value of the flow from the total 14-3. The problem of maximizing Fig. s the value as that of maximizing of the flow from the same sources is then to t.

are Sources and Sinks: If there Multiple sinks t l' t 2' . . . , t r and if the flow several this problem can be converted then sink, any

However, if the restriction is made that


51 52

the

flow

from

a specified source)

II

12

Super source
Sk I,)

Fig.

14-3

Multi-source

multi-sink

transport

network.)))

SEC. 14-2)

EXTENSIONS

OF MAX-FLOW MIN-CUT

THEOREM)

391)

Si must be sent cult. Such a flow,


ly

to a specified
known

sink

as the

diffimore t i , the problem becomes much multicommodity flow, will be discussed short-

as

a separate

topic.
'rt'ith

that we have a transport Specified Capacity: Suppose The some (or all) vertices also have specified capacities. total flow into a vertex v must not exceed its capacity c(v), a real positive number. This network network by can be converted into an ordinary transport v' and v\" and an edge from v' each such vertex v with vertices two replacing to v\" with capacity c( v). All edges originally incident into v are made incident into incident out of v are made incident out of v\", v', and all edges originally as illustrated in Fig. 14-4.)

2. Vertices

network

in which

Origl nal)

Converted)
c(v))

Fig. 14-4
3. problem

Replacement

of a

vertex

with

v' and

v\".)

Networks

Containing

Undirected
through

of maximizing

flow

edges are undirected. I n such p and q of capacity cpq implies

Edges: Often one encounters the in which some or all of the a network an undirected edge between vertices and) that the flow can occur in either direction,
a network fpq fqp

< cpq ' < cpq .)


in

Moreover,

since

the

flow

is assumed

simultaneous to be in

flows
only

opposite

directions

cancel

each other,

one

direction.
qp

That

is,)

fpq Thus

-f
in

== O.)

the

maximum-flow

problem
each
a

a network

containing
a

undirected

edges

can be solved by replacing directed edges,each having

undirected edge with pair of the original edge. t) capacity

of oppositely

flow through tIn the case of a multicommodity flow, where two or more commodities is not valid. The productfpq-fqp the network simultaneously, this replacement * 0, because different can flow in opposite directions without commodities canceling each other. This is one of the major difficulties in multicommodity flow problems.)))

392)

GRAPH

THEORY

IN OPERATIONS RESEARCH)

CHAP.

14)

4. Lower Bound on Edge Flows: So far we have assumed that the lower bound on a flow through an edge in a transport network is zero. Occasionally, one encountersa practical situation that requires a minimum flow bi} through an edge (for instance, an oil pipeline in Alaska may needa specified minimum flow

to keep

it

from

freezing).

That
bi}

is, conditions)

< Ii}

<

cij)

( 14-6)) than pattern,

replace
F or

real number no larger (14-1), where bi} is a nonnegative some network there may not even exist a feasible flow
satisfies

cij\"

that

is,

For exam(14-2), (14-3), (14-4),and (14-6). all Ii} == 0 is not a feasible flow unlike in the case with no lower ple, pattern, bounds on the edge flows. Therefore, we have to first determine if indeed there is a flow pattern in G that satisfies all the upper and lower and bounds, if so how do we get a flow. It can be shown using the of Theorem 14-1 that w the value arguments for any feasible flow pattern must satisfy the following simultaneous requirements for -every cut (P, P) in G separating sand t:)
one
which

the constraints

w w

< >

c(P, P) b(P, P)

- b(P,P), - c(P,P),)
b(P, P)

where)

b(P,

P) =

jEP
Furthermore,

\037

and

=
\037 jEP)

bu.

analogous
pattern

existsa flow
can
quantity)

satisfying

be achieved,

and the

to Theorem 14-2, it can be shown that if there the lower and upper bounds, a maximum flow value of the flow equals the minimum value of the
c(P,

P)

- b(P,P))
sand
of)

taken

over

all cuts
flow

(P, P) separating vertices


the

t. Similarly,

the minimum

value of a

equals

maximum
b(Q,

value

Q)

- c(Q, Q))

taken

over all cuts (Q, Q) separating vertices sand t. The problem of determining under conditions which a flow pattern exists is slightly constraints (14-2), (14-3), (14-4),and (14-6) more insatisfying volved. The readeris referred to Liu [8-3], pages 270-275, or Chapter 2 of
Ford

and

Fulkerson

[4-3] for

further

discussions.

along

5. Lossy Net}i'orks: So far we have an edge. In many practical transport

assumed that
networks,

the

flow

however,

does not the flow

vary does)))

SEC. 14-3)

MINIMAL-COST

FLOWS)

393)

suffer
Such
A

loss
lossy

during

transmission,

due

to leakage,
networks

evaporation, and
(or lossy

so forth,
Au,

networks

are called lossy transport has an additional network

networks).
as-

directed edge(i, j). Foreachedge(i,j) there are two flows: the edge. These quantities are flow fu entering the edge and flow f,\037 leaving
sociated
related

parameter, called efficiency,

with each
follows:)

as

ftj
The
during improvement

==

Au .fu,)

for each

edge (i, j)
than

in

G.)

efficiency
transmission

Au

is a

and

positive number. is more than

It is less
unity

unity

if there

of there

is a gain

is a loss (for instance,

in the signal due to repeaters in a communication line). At each intermediatevertex the total flow must still be equated outgoing to the total incoming flow. The larger of the two quantities fij and ftj must still not exceed cij ' the capacity of the edge (i, j). As in the case of ordinary transport networks (in which Au == 1, for every edge), the goal is to maximize the flow arriving at the sink t. Moreover, for the same value of the flow at the sink, we may have different values of flow leaving the source. arriving that gives the maximum flow is to find a flow Therefore,another goal pattern the source. This is called at the sink for a minimum amount leaving arriving an flow in a lossy network. optimal has been extended to lossy networks. The min-cut theorem max-flow have been obtained, and algorithms Conditions for optimality for optimal For details, see the paper by Onaga [14-18] or pages flows have been devised.
in 277-288

[14-7].)

14-3.

MINIMAL-COST

FLOWS)

with each edge (i, j) in a transport G network Suppose that associated there is an additional number of as the cost of unit d ij , which may be thought a flow pattern flow through sending a specified (i, j). It is desired to construct value w from s t to sink source constraints (14-1), (14-2), (14-3), satisfying
and

(14-4),

which

minimizes

the total
\"
(i,j)EG)

flow

cost,)

\302\243..J IJ

.., d... JrIJ

( 14- 7))

over all
This

flows

that

send

is one

of the
in

classicproblem
problem.
transportation

w units from s to t. in most practical problems programming


in

network as

flows. the

It is

also a

linear

and is
research

known

transportation

Many problems
problem. pattern from

operations

can

be formulated
with

as a

To find a flow cost directed path

that s to t

minimizes

the cost,
this

we start
(i.e.,

a minimal-

and saturate

path

assign

flow

to

the)))

394)

GRAPH

THEORY

IN OPERATIONS RESEARCH)

CHAP.

14)

least one edgein the path reaches its capacity). Then by usthe minimal-cost flow pattheorem recursivelywe obtain for a given tern of desiredvalue. Let us call a path from s to t unsaturated in G if fij < backflow edge (i, j) and fj > 0 for every cij for every forward ward edge (see Fig. 14-2).)
path

such that at

ing

the following

THEOREM

14-3

pattern

Let .f be the minimal-cost f', obtained from


unsaturated
the

minimal-cost

edges of
This

path,

is a

of value w from s to t. Then the flow 0 to the flow in forward edges of a the flow in the backward path, and subtracting \037from flow of value w +- \037.) minimal-cost
flow

pattern

by

adding

\037<

theorem

is of
formal

central importance in
proof

constructing

minimal-cost

flow

obvious result, the reader is referred to Ford and Fulkerson [4-3], pages 121-122. Theorem 14-3states unit that at every of flow is to be sent stage of construction each additional the least-cost from s to tare available path. All unsaturated paths through and in computing the cost of an available available path p one takes paths, into account not only the cost of adding the flow to the forward edges in p but also the savings due to reduction of existing flows in the backward edges patterns.
of this

For a

intuitively

the application of the theorem with an example. us illustrate written In Fig. 14-5 we have a transport network. Of the pair of numbers is the capacity cij and the second one is the next to an edge, the first number flow from s to t, we flow. To find a minimal-cost maximal cost d ij of a unit
go through

of p. Let

the following steps.)

15.4 x 14,I
t)

12,4

0.00
t)

y)

z)

12,3
(b))

z)

(a)

At Step

I)

At Step 6) 6

S
16

14
I

0
8
(c)) z)

\037
Y

Final Fig.

Flow Pa t tern)

14-5

Minin1al-cost

flow.)))

SEC.

14-4)

MUL

TICOMMODITY

FLOW)

395)

1. The minimal-cost path a maximum possible flow

is syxt, and total path cost is 4. We


of

can

send

II units

through
II

this

path,

thus

saturating

edge (y, x)

in

this

path.
by

2. We modify the network of all edges in syxt. Set

subtracting

from

the current

capacities
The

dyx

00.

3. I n the modified cost is 5. We


which

sent

network, the minimal-cost path from s to t is sxt. the maximum possible flow of 3 units through
edge

sxt,
path

saturates update
setting

(x, t)

in

the

path.

4. We further sxt and

d xt

the network = 00.

by sending the

capacities

in

the

5.

n the

capacity

network the minimal-cost path is syzt of cost 6 resulting 5. Sending 5 units of flow through syzt saturates (s, y).
updating

and

6.

Appropriate

yields

the network

in

Fig.

I4-5(b).

7. In Fig. I4-5(b) the minimal..cost is sxyzt with a cost of 4 path 2 = 7. Sending3 units along this path saturates a cut-set and thus 3 + the algorithm terminates. The desired flow pattern is given obtained in Fig. The value of the flow from s to t is II + 3 + 5 + 3 = I4-5(c). 22 units, and the cost is 4 x II 5 x 3 + 6 x 5 + 7 x 3 = 110.)

- 2+

14-4.

MULTICOMMODITY FLOW)

I n some disto deal with several practical situations it becomes necessary tinct commodities flowing a given transport network. simultaneously through has its own source and its own sink. All flows share the Each commodity and as in the single-commodity case, the sum of all therefore, edge capacity,

flows

through

an
flow

edge
let

must

not exceed the


at every

capacity of

the

edge.

For

each

commodity the

is preserved

For illustration,
which

us consider

intermediate vertex. in Fig. the transport network


1

commodities and

from S1 to t 1
For

2 are flowing. Commodity 2 from S2 to t 2. commodity


I and

is

to

14-6 through be transported


1)

a two-commodity

case, let f;tj and ffj be the

flows

of commodities

12)

I,)

SI)

Fig.

14-6

Two-commodity

transport

network.)))

396)

GRAPH THEORY

IN

OPERATIONS

RESEARCH)

CHAP.

14)

and

2, respectively,

through

an

commodity case,the

constraints

edge (i, j) in Fig. f IJ. J +f

in

G.

Then,

analogous

to the single-

14-6 are)
c.. IJ) i ===St,

\037. < I J -

and)

Wt
\037 jEG

for

flj

==

-Wt
! o
W2

for i == (1'

for all other vertices,


for
2

=== ===

S2' (2'

jEG

\037

frj

===

-W ! o)

for for

all other

vertices.)

These constraints can be easily written down for a k-commodity flow. In such flows two problems are usually raised: (1) Construct patterns all for
k-commodities
W

such
network

that

the

total

sum of the
flow

flow

values
W 2,

Wt +

W2

...

k is maximized;

(2) Given the


G,

values

WI'

. . . , W k for
flows

modity and a
simultaneously.

find

out if these
amount
can

values of
of each
be seen

can

each combe achieved


will

Simply sending the


general

maximum

commodity
in W 2 W t

not

in

maximize the total


maximum

value. This
of
w t

even
and with
how

the

simple

case of

Fig. 14-6.Ifwe maximize

W t alone,

we get
W2

W t

== 15

== o. == 5

hand, the
Thus

value

is obtained know

On the other and W 2 === 20.

to maximize

the total

value, we must

to allocate

commo-

similar to the max-flow min-cut theorem for the multiG is in flow commodity general. Only in some special cases (such as when and there are only two commodities) has it been possible to get undirected a theorem to the max-flow min-cut theorem. analogous the interin this specialized and rather involved For further topic, reading 3 of ested reader is referred to Chapter 11of Hu's book [14-12], Chapter of Sakarovitch [14-20].) and the Ph.D. dissertation Frank and Frisch [14-7],

dities to each edge.

Thereis no result

14-5.
We

ADDITIONAL

APPLICATIONS)

have been
by

discussing how various types of


of network-flow

shipping

problems

can be
are

solved

means

techniques.
as

In addition
problems

to these, there
problems.
Section

a surprisingly large number of combinatorial can be formulated that solved) (and then

in operations

research

network-flow

Take
8-4.
known with)))

problem discussed in We have p men M p M2 ,. .., Mp and q jobsJ p J 2 ,. . . ,J q , and When is it possible to fill men are qualified for which which jobs.

for

instance

the

matching

or assignment

it is

all jobs

SEC. 14-6)

MORE

ON FLOW PROBLEMS)

397)

qualified

men or

when

is it

possible

to assign
as

each man

a job

he is qualified

for?

The problem can be formulated


Fig. J k)

a network-flow
network,

problem,
such

as shown
an edge
of one

in

14-7.

exists

Construct if and only


all

a p-source
if man

q-sink flow

that

(Mp
are con-

supersources and each (s, MJ and


made

sinks

to

each

M i is qualified for job to a supersink t. Assign (J i , t). The capacities of

J k' the

Join

all sources

capacities
remaining

to a unit to

edges of

infinite. Then the optimal assignment problem becomes that with maximum value from s to t.) structing a flow pattern
M})

s) t)

Fig. 14-7
Observe

Flow

network

for an

assignment problem.)

that

in such
M t

flow

pattern)

.f:

I,

if ith
otherwise,

man is

assigned to a job, been assigned, assigned to


the

==0 ,)
fltt

== I,

if kth
,) otherwise,

job has

==0
fM1h

= =0

I,) ,)

if ith

man is

kth

job,

otherwise.)

More in

terms

complicated personnel assignment of network flow. Numerous other


problems.

problems have been formulated


have types of problems the

also

been

solved as flow in the survey

For
Fulkerson

these the

reader is referred to

bibliography

paper

by

[14-9].)

14-6.
Flow

MORE ON FLOW PROBLEMS)


problems

may
in

be looked
4. The

upon as a generalization
in

of

connectivity

problems,
for

studied
between

Chapter

paths

pairs

of vertices

study of connectivity involves a graph. A path from a vertex

a search
x

to

a)))

398)

GRAPH

THEORY

IN OPERATIONS RESEARCH)

CHAP.

14)

vertex
how

much,

y implies that we have


the

The

x, y is equal to

some amount of flow can be sent from to consider the capacities of the edges maximum number of edge-disjoint between paths minimun1

x to
in

y. To
path.

find

the

a pair

of vertices
from the)

number

of edges

that

when

removed

I-source.I-sink
I-Commodity

___________
_______

Multiple sources and

sinks

Multicommodi

ty)

Vertex

capacities

unlimited)

Vertex capacities
Only directed

limited)

edges)

Mixed

edges)

Edge capacities

with

upper

bounds

only)

Edge

capacities

with lower bounds also)

Lossless

edges)

Lossy

edges)

Flow-cost

equal

for

all edges)

Flow-costs

different

for different

edges)

Capacities

deterministically

known)

Capacities

probabilistically

known)

Static

flow)

Dynamic
Fig.

flow)

14-8

Some types of

flow

networks.)))

SEC.

14-6)

MORE ON FLOW PROBLEMS)

399)

leave no path between x and y. This number is preciselythe number of graph when to x and y. This concept, edges in the smallest cut-set with respect apbecomes the max-flow min-cut theorem. plied to a graph with edge capacities, It equates the sum of maximum capacities of paths between x and y to the

capacity of the
It is
more

minimum

cut-set

natural to

seekresults as elegant
Some

with respect
as

to x and
max-flow

y.

general

networks.

generalization6
have networks

as for

of some

the multicommodity flow, common types of flow

min-cut theorem for are easily made.Others, such not been possible so far. A summary is given in Fig. 14-8.
the

It is interesting to comparetransport with electrical networks networks, studied in Chapter of as a special 13. A transport network can be thought that current law (KCL), but not the type of resistor network obeys Kirchhoff's have no resistance for currents voltage law (K VL). Moreover, the resistors (i.e.,flows) up to a certain value cij and then have an infinite resistance for current larger than that. In such a network no voltage (potential, or pressure, tension) exists across any branch. an electrical network problem can also be formulated as a Conversely, G with flow problem. Consider a resistornetwork current sources in which we wish to find currents (i.e., flows) lij flowing through every edge (i, j). The upper and lower bounds on the currents are)
= c.. IJ)
b..IJ) = The

00 , -00.
that

flow

pattern

must satisfy KCL;


\037/Ji i

is,) == 0

\037f,.J i)

( 14-4))

for every

vertex j
J.

in

G.

The

served by
the

C. Maxwell

flow pattern in 1893 that among

must also satisfy


all flow

KVL.
satisfying

It was

ob-

patterns

(14-4)

one that

minimizes the power dissipation)


\037 for all

rij.

Itj

( 14-8))

(i, j) EG)

is the
to

one

that

satisfies

Kirchhoff's
edge

trical resistance
satisfying

of the

(i, j).

KVL,
as

sources is left
which

assuming

is the elecvoltage law also. Quantity rif is equivalent [That minimization of (14-8) with current network KCL, in a resistive

an exercise.]

as a flow problem, Thus an electrical network problem can be viewed a quadratic conminimizes flow-cost function (14-8) subject to linear straints (14-4). Obviously, then, an electrical network problem (subjectto and is not an LP problem.))) KCL KVL)

400)

GRAPH

THEORY

IN OPERATIONS RESEARCH)

CHAP.

14)

14-7.

ACTIVITY
PLANNING)

NETWORKS

IN

PROJECT

One
operations

of the most
research
two

popular

and

successful and

applications scheduling
and

is in the
best-known

planning

of networks in of large complicated

projects. The
Path

names

in this
Evaluation

connection are
Review

CPM (Critical
Technique).
individual

Method) called

and PERT
into

(Program

project is divided
jobs,

many

well-defined

and

nonoverlapping

Due to technicalrestrictions,somejobs must be finished be started (such as washing before drying, putting foundation before erecting walls, etc.). In addition to this precedence relationship a certain time, called the also among the activities, each activity requires in a project, duration of the activity. Given the list of activities the list of immediate and the dura(i.e., predecessors) for each activity, prerequisites to depict the project, as follows: tions, a weighted digraph can be drawn an activity, and its weight the duration Each edgerepresents of the represents and endings of activities and are beginnings represent activity. The vertices called events or milestones in the project. An activity (i, j) cannot be started Each in before all activities event leading to the event i have been completed. the project is a well-definedoccurrence in time (such as walls erected, shipment Such a weighted, connected digraph activiarrived, representing etc.). network. ties in a project is called an activity that we have a project Let us take an extremelysimple example. Suppose consisting of six activities A, B, C, D, E, and F, with the restriction that A must precede C and D; Band D must E; and C must precede F. The precede and Fare the activities durations for 5, 7, 6, 4, 15,and 2 days, A, B, C, D, E,
activities. before

others can

respectively.

The

activity

network

of this

project is

shown

in

Fig.

14-9.)

C 6)

Project completed

/)

Project

starts)

Fig. 14-9 Observe

Activity

network.)

have

otherwise, we would directed circuit could be initiated-avicious Also observe that the vertex denoting the start cycle. of the project must have zero in-degree, since no activity precedes this vertex. Likewise,the vertex denoting the termination of the project must have zero as no activity this vertex.))) follows out-degree,
that

an

activity

network

must

an impossible

situation

in

which

no activity

be acyclic; in the

SEC.

14-7)

AC1IVITY

NETWORKS

IN PROJECT PLANNING)

401)

Dummy

Activity:
Band

In the example
had

of

the

activity
that

network
activity

Fig. 14-9, suppose we

an additional D were

restriction
vertex

considered F could

in

not

be started before
dence

completed.

relationship

by drawing an

edge from

We can incorporate this precex to y (Fig. 14-10). Such an)


Dummy

activity)

x)

Fig.

14-10

Dummy

activity

in a

network.)

in the job edge, which represents only a precedence relationship and not any activities become necessary when project, is called a dummy actoivity. Dummy the existing all precedence activities are not enough to portray relationships shown activities are of zero duration and are usually accurately. All dummy in broken lines. Two parallel edges(i.e., activities the same immediate predecessor having and the same immediate edge, comsuccessor) may be replaced by a single the activities are both activities into one [Fig. 14-11 bining (a)].If, however, a dummy event) then a dummy activity and to be kept track of separately,
x)

max =

.
x

[rx' ty

and y)

y) (a))

\037Dummyevent
\\ \037O \\

x
=)

\037

ty) .

Dummy

activity

(b))

Fig.

14-11

Replacement of

parallel

edges.)))

402)

GRAPH THEORY be created


An

IN OPERATIONS RESEARCH)

CHAP.

14)

must

[Fig. 14-11 (b)].And,


digraphs

as there

network,

we have only simple activity network can

can be for an activity

no self-loopin
network.

an

activity

be assumed to have

exactly

one

vertex

with zero

with If there is more than zero out-degree. in-degree and exactly one vertex one vertex selects one of these for the having zero in-degree, one arbitrarily start event and draws dummy activities this to the other vertices. The from vertices with zero out-degrees are handled similarly. I n brief, an activity of two aspectsof a project: network is a representation and (2) their durations. It (1) precedence relationships among the activities, is a connected, weighted, simple, acyclic digraph with exactly one vertex of zero in-degreeand exactly vertex one of zero out-degree.)

14-8.
A
circuit.

ANALYSIS

OF

AN

ACTIVITY
network

NETWORK) first be

newly

constructed

should

checked for
network,
finding

any

directed

A directed

circuit impliesinconsistency
gives an
a more

in the

which must be
whether

9-17 corrected. Although Theorem not a digraph has a directed circuit,


topological

algorithm for
efficient

or
by

sorting

of vertices,

defined as follows:

method is provided

The vertices of a digraph G are saidto be in topologiSorting: Topological n such cal order if they are labeled that every edge in G leads 1, 2, 3, . . from a smaller numbered vertex to a larger one. That is, for edge (i, j) every are in in G we have i < j. The process the vertices such that of relabeling they if a digraph contains a topological order is calledtopological sorting. Clearly, in a topological order. a directedcircuit, it is not possible to put its vertices

.,

The

following

construction
in

procedure
a topological

digraph G can be put


Start G, and in
with

shows order.

that

the

vertices

of every vertex

acyclic
1 from

a vertex

with zero digraph

in-degree and label it


(G

the

label it
every
tex

- 1) delete vertex vertex is labeled, or (2) we find


2.

remaining From (G

- I) find

1. Delete

a vertex

with zero

in-degree and

2 and

a subdigraph

with

zero in-degree.

In

view

of Theorem
we

(1) repeat the process, till either g in which there is no verif 9-15, case (2) is possible only

g contains

a directed

circuit. Thus

can

state)

THEOREM14-4
in a digraph The vertices the digraph is acyclic.)

can be arranged

in

a topological

order

if

and

only

if

in an activity functions two Topological sorting performs directed circuits, if any, in the network, and (2) it puts 1 is the start event and a topological order I, 2, 3, . . . , n, where pletion event of the project.))) it detects

network:

(I)

the events
n

in

is the

com-

SEC.

14-8)

ANALYSIS

OF AN

ACTIVITY

NETWORK)

403)

besides sorting is an important process in many problems Topological activity network analysis. For example, if we want to arrange the words in is used before it has been defined, we resort to a a glossary so that no term

topological
tant

process

sorting. We shall in a step-by-step


for Topological
l.

therefore
fashion.)

present

an algorithm

for this

impor-

Algorithm

Sorting)

l. Set i \037
2.

Find an unlabeled vertex with If no such vertex exists, go to


Set

zero

in-degree,

and

label

this

vertex

i.

3. 4. If

i \037 i
every

1;

step 4. and go to step 2.


has been
any

vertex

in G

labeled, stop. Otherwise,

go

to step

5.

5. If the out-degree of
edges

labeled so far is nonzero, remove all vertex every lab\037led vertex and go to 2. If there are some is vertices unlabeled vertices and the out-degree of each of the labeled in the network, zero, we have a directed circuit stop.)
incident

out of

Note
in have

that

there

a given more

acyclic
than

may be more than digraph, because at one vertex with zero

one

topological
the

ordering
algorithm

of the vertices
it is

step 2 in
in-degree.
the
having

possible to

Critical

Path: Having
and

made sure that


the process)

activity
placed

directed circuits
topological

(in

G network the vertices

contains no of Gin a

tion.

duraorder J, 2, . . . , n, our next task is to determine the project is equal to The minimum time required to complete the entire project of the longest directed path in the length sum of the activity (i.e., durations) 1 to n.) The longest directed G. (The longest directed path is, of course, from path (CP). The vertices and edges in a CP are called path is called a critical the critical events and the critical activities, because any delay in them will the entire project. In Fig. 14-9the critical delay path is A DE and the project duration is 5 + 4 + 15= 24 days. There may be more than one critical path in a given activity network. I to n, let us determine Instead of determining the longest path only from the longest paths frorr vertex 1 to every vertex k in G, where k == 2, 3, . . . , n. The length event time for of the longest path from 1 to k is called the earliest k can be event event k, because this is the earliest possible time at which

realized.
shortest from a Sincedigraph G is acyclic, the method of obtaining paths modified for given in Chapter II, can be easily specified vertex to all others, finding the longest paths. In fact, since the vertices are already topologically the task is even simpler. Let) ordered, tij

duration

of

activity

(i, j)

in

G,)))

404)

GRAPH

THEORY

IN OPERATIONS RESEARCH)

CHAP.

14)

and

let)

T(k) == length

(i.e.,

time)

of longest path
for

from 1 to
Clearly,

k,

==

I, 2,
from

3, .

. . , n.)
I (because

T( I)

==

O. Vertex

2 can

be reached only

vertex

of the

topological order), and therefore)


T(2) Vertex ==

T(I)
any

\037

1 12 == 1 12 .)

3 cannot

be reached from

vertex

except
13'

from
\037

and

2. Therefore,)

T(3) == max[T(I)
Similarly,

\037t

T(2)

t 23 ].)

vertex

4 can

possibly be reachedonly
\037

from

I, 2,

and 3.

Therefore,)

T(4) ==
And so

max[T(I)

t 14 ,

T(2) +

24 , T(3)

+ 134 ].)
as)

on. The

general

expression T(k)

can thus
== max[T(i)
i<k)

be written
\037

t ik ],

( 14- 9))

where

the

maximum
k.

is over all

verticesi from
Let us

which

there

is a

(i, k) to vertex
The

directed edge
and T( I),

T(2),. . . ,

solutions
T(n)

of these
obtained

equations can be performed

one

by one,

successively.

take a simpleexample:)

Fig.

14-12

Activity network.)
I dummy

An
activity

activity

network
in

is shown

circles representing the vertices.They are in topological order I, 2, 3, . . . , labels the vertices are identified and the digraph is simple, the activity (Since have been dispensed with.) The durations of activities (in some unit of time) are shown next event times T(i) for to the edges. Let us compute the earliest i == 1,2,3,...,8.)))

Fig.

of 8 events, 12 activities, and consisting 14-12. The event labels are shown inside

the

small

8.

SEC.

14-8)

ANALYSIS

OF AN ACTIVITY NETWORK)

405)

T( 1) T(2)

==

0,

== t 12 == 8,
10.)
we of Eq. (14-9),

T(3) ==
With

successive

application
T( 4)
==

get)

max[t

14' T(2)

+
9,

24]

==

max[7,

9]

==

T(5)

== max[T(2)
==

-f- t 25,

T(3) +
16.)

35 , T(4)

+ t 45]

max

[ 10, ] 6,

12] ==

Similarly,)

T(6) Thus
shown

==

21,)

T(7)

==

16,)

T(8)

== 28.)

the project duration T(8) == 28. in heavy lines in Fig. 14-12.


of

The

critical

path is I,

3, 5, 6, 8, and is
tracis

This computation

earliest

times
1

vertex ing the longest paths from referred to as forward calculation. Latest

to

of topological ordered events by vertices 2, 3, . . . , n, successively,

the project is finished at time T(n), we critical activities is delayed. There is, A a certain of latitude in scheduling noncritical activities. amount however, be save noncritical activity allowed to or nerves) may money slip (and thereby to a certain latest time extent without delaying the project completion. The an event k must be the duration which realized without by increasing project is called the latest event time T'(k). For example, in Fig. 14-12 event 7 may be realized without latest by time unit 22 (and no later) affecting the completion of the project. is given time to see that the latest event time It is not difficult by the relation)

Event

Time: To
that

ensure

that

have

to

make

sure

none

of the

T'(k)
If still

==

T(n)

- time taken

along longest path

from

vertex

k to

n.)

we reverse

2, 1.

be topologically
Starting

the direction of every in the network, the vertices will edge sorted, but the order would be reversed, n, n - 1, . . . , 1 and from vertex vertex n, one could move toward compute
longest
with

the times
reversed

taken along the


network.

paths,
relation)

using

Eq. (14-9)

successivelyin

the

Starting

T'(n)

==

T(n),)
the

we get the following

recursive relation for


T'(k) ==

latest

event

time for vertex


( 14-

k:)

min[T'(i)

kJ,)

10))))

406)

GRAPH

THEORY

IN OPERATIONS RESEARCH)

CHAP.

14)

where

the minimization

is over
in

verticesi to which
Fig.

there

is directed

from vertex k.

For example,
T'(7) == 28
T'(6) T'(5) == 28

edge (k, i)

14-12,)
22, 21,

- 6 ==
- 7 ==

== min[T'(7)
all
that

- 0, T'(6) T(i) ==

5]

== 16,)

and so network
critical

on. Table 14-1shows of Fig. 14-12.Note


path.)

earliest

and latest event times in the activity if and only if vertex i is in T'(i)

Event
1

i)

T(i)) o

T'(i))
o

2 3

12

4 5 6 7
8)

10 9

10

13

16 21 16
28)

16 21 22
28)

Table

14-1

Earliest and Latest

Event

Times)

Slacks:
activity, activity

let

As a measure of maximum us look at the following

latitude
quantity

available
called

in a slack

total

noncritical (or float) of


( 14- II
))

(i, j).)

So
Quantity is possible

==

T'(})

T(i)

ir)

So represents

when

i is

the maximum permissibledelay in activity (i, j), which realized as early as possible, and j is delayed as much
has two end vertices, to define four different
important

as

possi

ble.

Since each

activity

values,
important

it

is possible

considered

slack

only the most is the free

one,

each one of which has two time We have slacks for each activity. the total slack. The second most
as)

slack, v o '
V

defined

==

T(j)

- T(i)
Total
==

to.)

( 14- 12))

This

is- the

amount

by

which other

an activity activity.

the early start of any ities in the network

without (i, j) can be delayed slacks and free slacks for in

all

delaying activ-

of Fig.
total

14-12 are shown


0 if if (i,

Table

14-2.

Observe
whereas Vo
vij

that

the

may be
o.)))

zero even

slack So

and only if

(i, j) isa critical


Also

activity,

j) is not

a critical activity.

note

that

Sij >

>

SEC. 14-8)

ANALYSIS

OF AN ACTIVITY NETWORK)

407)

Activity)
(I, 2)

Total Slack)
4

Free

Slack)

(1, 3)

(1,4) (2,4) (2,5) (2,6) (3,5) (3, 7)


(4, 5)

o 6 4 6 4 o 8 4

o 2

6 4

o 2 4

(5, 6) (5, 7) (6, 8) (7, 8))


Table

o
6)

o o o
6)

14-2

Total and Free Slacksof Activities Network of Fig. 14-12)


a

in

In the foregoing

analysis of

network,

called

the critical path

method

(CPM),we

have

accomplished
directed
in

the following:)
circuits.
topological

1. Checked for
2. Arranged 3. Identified

events

order.
project

critical path (or paths) and computed the 4. Computed earliest event time for each event. T(k) 5. Computed latest event time T'(k) for each event.

duration.

6. Computed
Having
identified

slacks

for

each activity.) activities,


total

the

critical

we can
project

concentrate only
machines

on

these

and by expediting

them reduce the


reduce

duration.
certain

Second, the slacks


or

can be utilized
workers.)

to

the peak

demands for
we have

skilled

Project Cost Curve:


each

Although

assumed a

constant duration

for

get a job done money can usually faster. Givena fixed budget for the project, how should the money be allocated among the activities so that the project is completed at the earliest possible date?If for each activity the time-cost relation is linear, this problem can be shown to be a minimal-cost or flow (see pages 151-162 of [4-3] problem The solution of the problem will be a curve showing project cost [14-8]). versus comduration, and, depending on the budget (or the target project a point on this curve. Such a curve is known as pletion date), one would pick the project cost curve. in activity Often be))) to time and cost, there may networks, in addition

activity,

in

practice

allocation

of more

408)

GRAPH

THEORY

IN OPERATIONS RESEARCH)

CHAP.

14)

other such as personnel required, shop facilities parameters, so forth, associated with each edge. In CPM networks activity durations were assumed to be
If

necessary,

and

preciselyknown.

the

activity

durations

are random

variables

tributions,

the network

goes by

Review Technique). Whereas cost, PERT is more concerned


requirements,

acronym CPM focuses with

the

PERT

estimates
networks

and

so forth.

Activity

disprobability (Program Evaluation and on optimizing the total project of completion dates, scheduling of these two with variations
with

given

are also encountered.)


FURTHER
NETWORKS)

14-9.

COMMENTS

ON ACTIVITY

In

this

chapter
the

vertices were
vertices
will

used to represent events


representation

represent activities.There is another ture


in

often

and the edges to used in the litera-

which

precedence activities

relationships
two

denote activities and the edges represent only the among the activities. Obviously, for a given set of
yield

activities these
of Fig.

different
in

14-9 are shown

both

For example, the project in Fig. 14-13.) representations


graphs.

c) c)
A)

F)

B)

(a) Event-Vertex

Representation)
Two

(b) Activityfor the

Vertex

Representation)

Fig. 14-13
It

representations

same activities.)
into

is not

difficult

activity-vertex

representation
we

to transform the event-vertex representation In fact, and vice versa (see[14-5]).

the

the

activity-

vertex representation is the

edge digraph

vertex representation, if is no need of dummy

disregard in activities

types of
slight

are widely representations over the other, but there is no basic difference betweenthe advantage two as far as their analyses are concerned. have been in The activity and its application in project network planning has been spectacular.))) existence only since 1957. In these few years its success

Problem 9-16) of the event(see the dummy activities in the latter. There the activity-vertex representation. Both Each has its own used in the literature.

SEC.14-10)
Computer
standard

GRAPHS

IN GAME THEORY)

409)

programs
program

for
library

analyzing

CPM

and

PERT

of almost every

computing center.Large
of

networks are part

of the

networks

consisting Generally,

of thousands of activitiesare often analyzed. the network is constructed from a list


of

activities job

and

cedence table. Generation


tion

a precedence

table is

manual

because

a preit

in the project. The construcinvolves an intimate knowledge of the processes from the preof the activity the activities, network, including dummy cedencetable can be relegated to the computer, although it is still done mostly
manually. be

Construction

of a

composite

network from subnetworkscan also

programmed

[14-22].

A typical computer program for critical-path consists of three analysis and phases: (I) cycle-checking topological-sorting phase, (2) forward-timecalculation phase,and (3) backward-time-calculation phase. Shortcuts have been suggestedthat can complete the critical-path analysis in a single phase, and save computation time in the case of large networks [14-17]. We have the bare essentials of the activity network presented analysis. Much more can be done with graph in project planning.) theory

14-10.

GRAPHS

IN

GAME

THEORY)

The theory of games has becomean important field of mathematical research since the publication of the first book on the by John von subject Neumann and Oskar Morgenstern in 1944. Game theory is applied to probin engineering, lems and war science to find the optimal economics, way of environment. performing certain tasks in a competitive The general idea of game theory is the same as the one we associate with The distinction between and checkers. parlor games such as chess,bridge, a puzzle and a game is that in a game one plays against one or more human whereas a puzzle involves a solitary effort to solve a problem. opponents, A game may be played between two persons, such as chess,or among more than two persons, such as poker. The former is called a two-person game and the latter an n-person game. Another classificationof games is basedon whether or not an element of randomnessis introduced, such as by dice or cards. A third in categorizing a game is whether or not a playelement er has complete information on the position of a game at every move. A game such as chess, in which' each player knows exactly where the game stands is called a perfect-information in which one does not know what game.Bridge, cards the other players have, is an imperfect-information A game is game. called finite if each number of choices available at each player has a finite move and the game must end after a finite number of moves. An infinite game is one in which a player chooses a move from an infinite set of moves. We shall confine ourselvesto the study of two-person, perfect-informa-)))

410)
tion, tion

GRAPH

THEORY

IN OPERATIONS RESEARCH)

CHAP.

14)

finite games

without

chance vertices

moves.

of such a game. The the and the edges game vertex v j if and only to Vi
Vi to
V

represent

represent the

A digraph is a natural representathe positions (also called states) in moves. There is a directed edge from

let us look at
nim.)

j by a

if the game can be transformed from position (state) move permissible under the rules of the game. As an example, a very simple game. It is a simplified version of a game called

are given and players A and B take Simplified Nim: Two pilesof sticks number of sticks from turns, each taking any anyone pile.The player who takes the last stick wins, and since the finite quantity of sticks will eventually be exhusted, it is obvious that the game allows no draw. As a further simplifitwo sticks each. The complete cation, let us start with two piles containing is described by the digraph in Fig. 14-14. Each state of the game is game described by an ordered pair of labels (x, y), indicating the number of sticks in the first and the second pile, respectively.)

(2,2))

(0,

0))

(1,2)

Fig. 14-14
Let

Simplified game of nim.)

us observe

some properties
perfect-information,

of such a game
finite

digraph

(a digraph

senting

a two-person,
The

game

without

reprechance

moves) :)
1.

digraph
vertex.

has a unique vertex


starting

with

represents the
starting

position

in the
Fig. with

a zero This vertex in-degree. game and is thereforecalled the

Vertex

(2, 2) in
in the

14-14 zero

is the

starting

vertex.

2.

There

are one
closing

or more vertices
positions

out-degree. 14-14.
digraph.
indefinitely.

These correspond
closing

to the
Vertex

game, and are called the


A

vertices.

closing vertex in Fig. 3. A game digraph is a connected,acyclic


would imply that the game a game such as chess,where
could
the

(0, 0) is the

directed
(In

circuit
in
endless)))

go on
game

practice,
state,

may return

to a

SEC. 14-10)

GRAPHS IN are prevented


the means

GAME THEORY)

411)

matches

by

of repetitionsof

same

move,

of a rule that a certain after numbet the game is declared stalemated.)

4.

Each

directed

path
moves

from

sents

one complete

presentingthe
The

the starting vertex to path play of the game. This of the two players alternately.)
in

a closingvertex
consists

repre-

of edges

re-

most

important
question

question
moves

a game

can a

player choose his


this

so that

is the following: he is certain of winning


in

When

and

how

? We

shall first

answer it.
position

for

the specific

game

Fig.

14-14,

and then

generalize
this

Let us call
can

a position

\"won\" if the
game

force
brought

a victory.
the

player
ing

who
this

with

to be marked
tion

characterization as won, because

Conversely, a position is dubbed\"lost\" if the to this position can be forced to lose.In keepin Fig. 14-14 is of vertices, the closing vertex the player who brought the game to this posi-

player who brought the game to

this as won, let us use the following vertex as won vertices or lost. remaining are marked vertex won if all its successors lost, and vertex lost if at least one of its successors is marked won. an unmarked mark makes the and (This is becauseit is assumed that each player is intelligent in vertices and results best possible move at each stage.)This (0,0), (I, I), as won and the remaining as lost. And thus the player (2, 2) being marked since he can his has the winning force who makes the second move strategy, verticesmarked as move to the to opponent a winning let us the method of finding strategy, generalize foregoing introduce the concept of kernel in a digraph.

is the

winner.

Having marked

procedure to mark the Mark an unmarked

lost.

To

Kernel of a

Digraph:A
G
if) in

set

of vertices

in

a digraph

G is

called a kernel

(or nucleus)
I.

of

No
Every

two vertices
vertex

K are

2.

v not

in K

edge. has an edge directedfrom


joined

by an

v to

some

vertex

in

K.)

Conditions set and some

and

2 correspond
an

a dominating set in types of digraphs that

respectively to definitions of an independent graph (recall Chapter 8). What 14-5 characterizes have kernels? Theorem
undirected

are

one

such type.)
THEOREM

14-5)
digraph

Every acyclic

has

a unique be proved
will

kernel.)
by

Proof: The theorem


which

will

a constructive be

all vertices

forming the kernel

painted

procedure, at the end of red. Let G be the given acyclic)))

412)

GRAPH THEORY According

IN OPERATIONS RESEARCH)

CHAP.

14)

to Theorem 9-15,G must have at least one vertex with zero the set of all vertices in G with Since these zero out-degree. vertices must all be in the kernel of G, paint them red. Next, let WI be the set of all those verticesin G from which there is at least one directed edge to some vertex in VI' Clearly, no vertex in WI can be included in the kernel. Delete from G all vertices in W I (together with the edges incident on them, of course), and thus obtain subgraph (G - WI)' - WI) is also acyclic. V 2 be the set of all vertices with zero Let Subgraph (G out-degree in (G - WI). Since in the original digraph G no vertex in set V 2 had a zero out-degree, every vertex in V 2 had to have at least one edge going to some in WI' Moreover, vertex in digraph G no vertex in V 2 could have been adjacent to any vertex in VI' Nor could any vertex in V2 have been adjacentto any other vertex in V 2 , because the out-degree of each vertex in set V2 of (G - WI) is zero. Thus we conclude that every vertex in V 2 must also be included in the kernel of G and therefore be painted red. till every vertex in G is either deleted or painted This procedure is continued red. The unique s\037t of vertices of the digraph. the kernel painted red constitutes .)
digraph.

out-degree.

Let

VI

be

As an illustration, is easily seen that the kernel.


It

let us
the

find

set of

the kernel in the acyclic digraph in Fig. three vertices marked (0, 0), (I, I), and

14-14.
(2,2)

is

Let
player

be

the

player

who
the

makes
player

such that

who makes the first the second move. Assuming who is able to make the
we

move that last

in the the

game and B
rule of the move in the

be the

possible
result.)

game is game is

always the
THEOREM

winner,

have

the following

important

14-6

In the is assured

game digraph of a win, and

if the

starting
win

vertex is
always

not

in the

kernel K,
in

then

player

A can

by

selecting

vertices

K.)

is not in set K, player A can move the game vertex A is the winner. If not, vertex x is a closingvertex, the second is not in the kernel K. player B will have to move to some vertex y, which In his next move A can take the game to some vertex in K. The game continues, B forced to take it out of K and A bringing it back into K. Eventually, with the to a closing vertex by A, because all closing vertices are in K. play will be brought Thus A wins the game. .)

Since the starting Proof. to a vertex x in K. If this

COROLLARY It follows from the the second player kernel, vertices in the selecting
In
that

proof

of this

theorem

that

if the
and

starting
B can

vertex is
win
by

in

the

B has
kernel.)

the winning

strategy;

always

the
the

player

analysis the rules of the game foregoing who made the last possible move

were
was

always

assumed to be such the winner. In)))

SEC. 14-1 0)

GRAPHS

IN GAME THEORY)

413)

many
resent

games
a draw

(such as chess or and others a win.

tic-tac-toe)

some

In

such

a game

of the closing vertices repthe choosing vertices from


the

kernel

will only
the if

assure a

player

a win

Thereare alsogames to make


digraph,

in which

or a draw. the rule is such that


the

player

who is

forced

be converted move. In
moves are
that

move is the loser rather than we remove all edges corresponding to the type in which the winner
last words,

winner.
last

From
moves,

such a

game
can

to the
is

the game

the

player

making the last


second-to-the-Iast

other

made. For exam


forced kernel
in

the the game is decided at the time pIe, let us modify the ni m game

of Fig.
erasing

14-14 such
the

the

player the

to take the last stick is the

loser. Then

last
win-

moves from the digraph,


constitute this

we get
digraph.

Fig.

14-15.

The three

vertices marked won


the

Even in this

game player B has

ning strategy.)
Lost)

Won)

Won)

Won)

Lost)

Fig. 14-15
Thus,

Game

digraph.)

in theory, it is possible to construct the game for digraph perfect-information, finite game with no chance moves, and, is acyclic, it is also possible to obtain since the digraph its kernel. Therefore, if each player plays according to his best strategy, the outcome is predeterwin mined. It will be either a draw or a certain for the player who makes the move if the starting vertex is not in the kernel, first or for the player who vertex makes the second move if the starting is in the kernel. In this sense,

at least

any two-person,

every game of this I n reality the


games,
in

type
situation

is either
is

\"unfair\"

or

\"futile.\"

not

so bleak

as

such game
the

as checkers digraph)
memory

the

or chess, the number is so enormous that the


any

stored in

unit of

existing

or

most nontrivial (i.e., the vertices game digraph cannot even be contemplated computer.)))
it

appears.

In

of positions

414)
This

GRAPH

THEORY

IN OPERATIONS RESEARCH)

CHAP.

14)

is precisely

why

in

real

games provides an
graph

approach
only

rather
to

problems in operations research the theory than a complete analysis. Moreover,


a very

of

theory

is applicable

special

but

important

class

of games.)

SUMMARY)

We

have

considered

three important

classesof

problems

in combinatorial

and game operations research: transportation problems, networks, activity and solved as graphtheory. These problems can be expressed elegantly connected and weighted theory problems involving (mostly acyclic) digraphs. From a practical of view, all these problems are trivial so is any point (and combinatorial real-life situations, problem) if the network is small. Many consist of huge networks, and therefore it is important to look at however, these network in terms of them on problems solving computers.)

REFERENCES)
literature on the subject of flows in networks. Several books are to network-flow problems. Ford and Fulkerson's book [4-3], the first one to be written on the subject, is a classic. Following the publication of this book, a good deal of work has been reported in the literature, particularly on the problems of twoimpressive entirely
with and flows, probabilistic multicommodity and synthesis of flow networks. Hu queues, of these areas. Other on the subject

There is an

devoted

through lossy network, [14-12] and Frank and Frisch [14-7] covermuch books are Berge and Ghouila-Houri [14-4] and Iri [14-14].Of several and BeckenHu [14-13], excellent survey papers, Fulkerson [14-9], bach [14-2] referare particularly These papers provide a list of important recommended. ences. Chapters on flow problems in Berge [1-1], Busacker and Saaty [1-2], and Li u [8-3] are also recommended. for a typical flow As an example of a good computer program see [14-3], which the least-cost flow for a network with both upper determines problem and lower bounds on edge capacities. methods. books and hundreds of articles have been written on critical-path Many Some of the books recommended are by Battersby [14-1], Elmaghraby [14-6],and Moder and Phillips [14-16].Papers by Klein [14-15], Montalbano [14-17],and Schurmann [14-22] discuss computer algorithms and programs for activity networks. Busacker and Saaty [1-2] also contains a section (pages 128-135) on acti vi ty networks. or For a brief and succinct historical of nim-like games (also calleddisjunctive survey A lucid general article on games is [14-23].Two take-away games), see Gardner [14-10]. other Busacker and are also recommended. Berge [1-1], papers on games, [14-11] [14-21], and Saaty [1-2], Kaufmann a section dealing with graph [9-4], and Iri [14-14]each contain of games. representation 14-1. BATTERSBY, A., Network Analysis/or Planning and Scheduling, 2nd ed., St. Martins Press, Inc., New York, 1967. 14-2. BECKENBACH, E. F., \"Network Flow Problems,\" Chapter 12 in Applied Combinatorial Mathematics (E. F. Beckenbach, York, ed.), John Wiley & Sons, Inc., New

commodity

flows, flows

flows

1964.

14-3.

BRAY,

T. A.,

11, Sept.

336: Netflow,\" Comm. ACM, and C. WITZGALL, \"Algorithm 1968,631-632; corrected in Vol. 12, 1969.)))

Vol.

CHAP.

14) and
New

REFERENCES)

415)

14-4.

BERGE, Networks

C.,

A.

GHOUILA-HoURI,

(translated

& Sons,

Inc.,
B.,

by M. Merrington 1965. York,

Games and Programming, and C. Ramanujacharyula),

Transportation
John
Wiley

IBM Construction of Minimal Networks,\" Project 1963, 24-36. S. E., Some Network Models in Management 14-6. ELMAGHRABY, Science, SpringerNew York, Inc., New York, 1970. Also appeared as articles in Management Verlag Sci. , Vol. 17, Sept. and Oct. 1970. and Transportation 14-7. FRANK, H., and I. T. FRISCH, Communications, Transmission, 1971. Mass., Networks, Addison-Wesley Publishing Company, Inc., Reading, D. R., \"A Network Flow for Project Cost Curves,\" 14-8. FULKERSON, Computation Sci., Vol. 7, 1961,167-178. Management 14-9. FULKERSON, D. R., \"Flow Networks and Combinatorial Operations Research,\" Vol. 73,1966,115-138. Am. Math. Monthly, 14-10. GARDNER, Games,\" Sci. Am., Vol. 226, No. I, Jan. 1972, M., \"Mathematical 14-5.
DIMSDALE,

Systems J.,

Vol.

\"Computer 2, March

14-11.GRUNDIG,
14-12.

104-107.

P. M.,

and C. A.
Phil. Programming

SMITH,

Losing,\" Proc.

Cambridge

Hu, T. C., Integer

Games with the Last Player \"Disjunctive Soc., Vol. 52, part 2, 1956,527-533. and Network Flows, Addison-Wesley Publishing

14-13.

Inc., Reading, Mass., Company, T. C., \"The Development of Network Hu, M.R.C. ming,\" University of Wisconsin

1969.

also in the Proceedings of the at the Hague, Sept. 1970. sium 14-14. IRI, M., Network Flow, Transportation and 1969. York,

Flow and Related Areas in ProgramTechnical Report No. 1096,Aug. 1970; 7th International Mathematical Programming SympoScheduling,

Academic
Conlm.

Press, Inc., Vol. 10,


and

New

14-15.

KLEIN,

14-16.MODER,
14-17.

225-231.
MONTALBANO,

M. M.,

\"Scheduling Project

Networks,\"

ACM,

1967,

J. J., and C. R. PHILLIPS, Van Nostrand Reinhold Company, IBM

Management Project New York, 1970.

with CPM

PERT,

14-18.
14-19.

works,\"

Calculation of the Critical Paths of Large NetM., \"High-Speed Systems J., Vol. 6, 1967,163-191. Communication Networks,\" J. Franklin ONAGA, K., \"Optimal Flows in General 1967, 308-327. Inst., Vol. 283, No.4, April D. C., \"New Results Concerning Theory of Graphs,\" Ph.D. PLISCH, Separation

14-20. SAKAROvITCH,

Thesis, University
M.,

of Wisconsin,

Madison Wise.,

1970.

\"The Multicommodity Flow Ph.D. Dissertation, Problem,\" of California, Berkeley, 1966. Centre, University Operations Research 14-21. SMITH, C. A., \"Graphs and Composite Games,\" J. Combinatorial Theory, Vol. 1,

51-81. 1966,

14-22.

SCHURMANN,

14-23. WANG,
1965,

works,\"

and Analyzing Activity A., \"GAN, a System for Generating Comm. ACM, Vol. 11, No. 10, Oct. 1968,675-679. Sci. Am., Vol. 213, No.5, H., \"Games, Logic and Computers,'\037
I 06.)))

Net-

Nov.

98-

SURVEY
15)

OF OTHER

APPLICATIONS)

]n

the

last

three

chapters

we have

explored in

considerable

detail

the

application

of graph theory to three

disciplines,

electrical networks, and operations research. briefly describe how graph theory is used in are somewhat related. They all deal with representation first three sections of a system structure by means of a weighted, connected digraph and subsequent In Section of the system through an appropriate study of the digraph. analysis 15-1a Ii near system is modeled as a weighted digra ph, which has proved to be of a a convenient tool for analysis. Section 15-2 deals with representation Markov stochastic process (a discrete by a digraph and makes use of process) 15-1 for its analysis. Section 15-3uses for the analySection weighted digraphs A discrete sis of computer programs. Markov process is an appropriate model 15-3. and thus Section 15-2is made use of in Section for many programs, of for identification Section 15-4, in which theory is used as a tool graph an important chemical compounds, is an isolated section.It is, however, 15-5 lists some miscellaneous Section of graph theory. Finally, application

and coding theory, In this final we shall chapter a number of other areas. The
switching

applications, with
15-1.
Most

relevant

references.)

SIGNAL-FLOW
problems
solved

GRAPHS)

in analysis
simultaneous,

of a
linear

linear

system

are

eventually
via

solving a set of
usually

algebraic and,

equations. more

by matrix

methods,

can also be solved


faster,
416)))

reduced to This problem, theory. The graph


it

graph-theoretic approach is often

importantly,

displays)

SEC.

1 5-1)

SIGNAL-FLOW

GRAPHS)

417)

cause-effect in

relationships
two

between the variables-something

totally

obscured

the

matrix approach.
parts:

This

graph-theoretic

analysis

of

a linear variable

system
the

consists of

(I) constructing

a labeled, weighted
required

digraph

called

signal-flow graph, and (2) solving signal-flow graph.

for the

dependent

from the
so.
Xi

In a signal-flow
A directed
(but
weights

graph

each

vertex

represents a
that

variable and
x j depends

is labeled

edge from

Xi to x j

implies
the

variable the

on variable
the

not

the reverse). The of the edges such


where \302\273'ikXi' W ik is

coefficientsin
that

equations

are assigned
sum

as the
of
Xi. by

variable

products

the weight

Xk is equal to of the edge coming into


graph

all
As the

X k from

an example, set of three

let us construct

a signal-flow
+ + +
12 X 2 +

for

the system given

equations,)
C11X 1 1 1 C C

13 X 3

== ==
==

Y1' Y2'
Y3')

C21X C31X
which

C 22 C

X2 +

C 23 X 3

( 15-1 ))

32 X 2 +. C 33X 3

can

be rewritten
(C 11 +
C 21 X

as)

I)x

+ +

12 X 2 +

13 X 3

Y 1 Y2 Y3

==

Xl'
( 15-2))

t +

(C22
C

I)X 2 + C23 X 3
(C 33

== x ' 2 == x .) 3

C 31 X 1 +

32 X 2 +

+ l)x 3

The signal-flow graph

is given in Fig. 15-1. representing Eqs. (15-2) Clearly, the in-degree of a vertex v in a signal-flow graph is zero if

and)

Y2)

Y3)

C23)

Fig.

15-1

Signal-flow graph

for

Eqs.

(15-2).)))

418)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

note that a signal-flow only if v represents an independent variable. Also we have two uncoupled (unrelated) systems graph is connected;otherwise,
thrown

together.

to a signal graph can be compared which the vertices corresponding to the independent
A signal-flow

transmission

network,

in

variables
act

are

sources, and the


and
transmitting

other devices.

vertices The

are repeaters, signals

which

as receiving,

signal summing,

or attenuated) by the (amplified Xi of a vertex equals the sum of all incoming signals, and is the strength of the that the name signal in each outgoing edge from analogy Xi' It is from this For the same reason the edge weights are called comes. \"signal-flow graph\" are referred to as source vertices. vertices edge gains, and independentvariable that a signal-flow graph contains the Note same as the information it is derived; but there does not exist a one-to-one equations from which
From the correspondence between the system of equations and the digraph. same set of n equations we can obtain n! different (some of signal-flow graphs which be isomorphic), the variables may depending on the order in which on the right-hand side, say, in Eqs. (15-2). x/s are written Now, given a set of algebraic equations)
Cx ==

travel along the edgesand are multiplied of the edges traversed. The label weights

y,)

( 15-3))

how
having

do we obtain the weight to draw the digraph?


described

matrix by its

of the signal-flow
weighted

graph

without

first

(Like any

digraph,

the signal-flow

graph is completely
THEOREM

weight matrix.))

15-1

The

weight

matrix
by)

[wij] of

the

signal-flow

graph

corresponding

to Eqs.

(15-3) is given

(15-4))

W=[C;I where
the I

-\037T')

is the

identity
matrix.)

matrix of the

same

order

as C, and

the

superscript

T denotes

transposed

the

to prove The theorem is not difficult of all zeros in W correspond columns

and is left as an exercise.Note to the y vertices (i.e., independent


a

that

variables).

Although

signal-flow
in

equations,
signal-flow

many

graphs can always be constructed from particularly in electrical problems, physical


without

set

of

systems, are

graphs
signal-flow

are drawn directly


graph
writing

first

writing
the

the equations.
equations

Usually, a
formulated.
matter,

can
equations
X

be drawn
from

as easily as
a signal-flow

Also,
each

graph is a

simple
which)))

because

vertex

k represents

one equation

of the system in

SEC. 15-1)

SIGNAL-FLOW

GRAPHS)

419)

f)

YI)

Xs)

d)

g)

Fig. k is

15-2

Signal-flow graph.)

labels

equal to the of the initial

sum of the
vertices

products

of these

tions for the signal-flow gra ph of


as)

of all incoming .edgesand the For example, the system of equaed.ges.


of weights can

Fig. ] 5-2
+ax
1 2

be immediately
3,

written

down

Xl =YI X 2 = bX
X 3 X 4 Xs

+dx

+ Ix 2,
eX 2

= = =

eXt +

gx 4,

hX3 +jxs lX 4
.)

+Y4')

These

can

be rewritten

in

the

same
1

form

as Eq. -d

(15-3),where)
0

-a

-b
c==

1-1
-e

0
1

0
-g
1

0
0 ,
-J
1

-e

( 15-5))

0
0
Xl

0
0

-h
0

-I
Yl

X2

0
,

x=

X 3

and

y=

0
Y4 0)

x4
XS

Reduction
The

of Signal-Flow
signal-flow one only

Graphs)

solvefor

graph method of analysis is most unknown variable, say x j ' asa function

useful of

when one

we want

to

independent)))

420)
variable,

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

say
this

k' We

care that weights


exactly

elimination

of directed
to

solve by eliminating all other verticesone by one, taking does not alter the net product of the edge process paths from Yk to x r This graph reduction corresponds
all

the algebraic

substitution.
a .)

method of eliminating Some elementary reductions of


b)

other

variables

a signal-flow

by systematic graph are shown)


ab

.
XI)

. X2)

.)

.
X3)

=)

.
XI)

..)

.
X3)

a a+b

xl

: =>
b

X2

.
XI

..

.
X2

X2
X2

XI

X3

XI

X3

e
X4 X4)

.
xl

x2

.
X3

I 1 =

.
XI

- a

. X

0
.
xl

..
X

a
.
2\037

aed

d
3

.
X4

I =

.
XI

- ab ..

.
X4

: \037X
b

Fig.

15-3

Reductions of signal-flow

graphs.)))

SEC. 1 5-1)

SIGNAL-FLOW

GRAPHS)

421)

in Fig.
will

15-3. Repeated
lead

application of
to elimination
to

such

reduction
all

steps,

selected
vertices.

visually,

eventually
3 .)

of

intermediate

(Apply
t

these reduction
andx

steps successively
to

Fig.

15-2 to

eliminate all verticesexcept Y


by

our ability Although much to the power and

reduce
of

the

digraph

simple

inspection

adds

flexibility

signal-flow

graphs,

it is often

better to

that does not depend on visual technique inspection. method is provided by Mason's gain formula. Mason's Gain Formula: Let p be a directed path from a vertexa to b in a of all edges in this path signal-flow graph G. Then the product of the weights is called the path gain of p (same as path in Section 12-2 for defined product undirected the product of the weights of all edges in a graphs). Similarly, directed circuit (or cycle)r is called the cycle gain of r . Forexam pIe, a list of all directed circuits and their gains in Fig. 15-2 is)
methodical

use a more

And

such a

Directed

Circuit)

Cycle
f ab

Gain)

X2X2 (self-loop
XtX2Xt

at X2)

XtX3Xt

X3X4X3
X4XSX4

cd gh
ij

XtX2X3Xt)

bed)

Furthermore, t t == sum

for a given signal-flow graph

G let us define the

following:)

t2

==

sum

of cycle gains of all directed of cycle gains taken two at a time


of products

circuits

of all
all

vertex-disjoint

directed

circuits

t 3 == sum

of products

of cyclegains of

vertex-disjoint

directed

circuits

taken three at
tk
==

a time)

sum

of products
time.)

of cycle gains of all

vertex-disjoint

directed

circuits

taken k at a
Thus,

for t t == f
t 2 t 3

the signal-flow graph

of Fig.
ij +
+

15-2we

have)

+ ab

+ cd +
+ fij

gh

+
abgh

bed,
abij +

== ==

fcd fcdij,)

+ fgh

cdij + bedij,

and)

t4

==

t 5 ==

...

==

0,)))

422)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

as the
only

maximum

number of

vertex-disjoint

directed

circuits

in Fig.
which

15-2 is

three.

Now constitute THEOREM

we are ready to state the most important 15-2


signal-flow

and

illustrate

two theorems,

together

result concerning signal-flow

graphs.)

Let a
determinant

graph

G characterize
by)

a set

of equations

Cx

y; then

\037,

the

of matrix
\037

C, is given
= 1

- t1

t2 -

t 3 -t-

... + (- 1 )q t q,)
directed circuits
in G.)

(15-6))

where

q is

the

maximum

number

of vertex-disjoint

THEOREM

15-3
graph

Let a signal-flow cofactor of C, C ih is

G characterize
by)

a set

of equations Cx =

y;

then

the

ijth

given

Cij

\037 k)

Pk\037k'

(15-7))

where

P k is
Eq.

the

path

gain

of the
part
the

kth

directed

of
the

\037 in

(15-6) for that kth directed path, and

of the
summation

digraph

from vertex i to j, \037k is the value no vertices in common with is over all directed paths from i to j.)
path
having

Combining
gives

the

response

Theorems 15-2and 15-3, x j due to the forcing


X'J
Yi I all

we get function

Mason's gain formula,


Yi
')

which

as)

other y's= 0

CoO l)
\037

where

(15-6)

Cij and \037 and (15-7).

are

computed

from

the signal-flow

graph G,

using

Eqs.

of Besides the original proofs given by S. J. Mason, many different proofs 15-2 and 15-3 have been published. All are involved-some more in [13-5], is given than others. A particularly elegant proof, due to R. Ash, the of Mason's 102-109. We shall illustrate gain application pages simply formula by means of an example.

Theorems

For Fig. 15-2,)


\037==1-tl+t2-t3

ab

cd

gh

cdij

ij

+ fi}
That in

+ abgh +

abij +

- bed+ fcd + fgh - fcdij.) + bedij


corresponding

this

indeed

Eq.

(15-5) can

is the determinant of the be easily verified by direct

matrix

C as

given

computation.)))

SEC.15-1)
There

SIGNAL-FLOW

GRAPHS)

423)

are two directed


PI
\037 \037

paths from

Y I to with with

x 3 :) weight weight

Y IX I X 3 YI X t X 2X 3)

path path

PI P2

\037 C \037

and)

P2

be.)

Correspondingly,)
\037t \037 \037

1 1

and) according

\0372

- f - ij.)

ij + fij
cofactor
is)

Therefore,

to Theorem
C l3 \037 \037IPI
\037

(15-3), the (1, 3)th


\0372P2

(1

- f

- ij + fij)c + (1directly gain)

ij)be.)

This the

too matrix

can easily be verified by in Eq. (15-5). Thus the

computing

the (1,

3)th cofactor of

X3 Y I / Y2= 0
is obtained
verified

\037

C13
\037)

purely
inverting

by

by graph-theoretic the corresponding

computation. The result can be easily in Eq. (15-5).) matrix C as given

Remarks and References)


method signal-flow graphs (over substitution to highlight the cause-effect relationare indeed the shipsin the system. For example, the feedback edges shown feedbacks in the actual system. A signal-flow graph can also be used very for simplifying the system of equations before solving effectively through matrix reductions. methods. The simplification is accomplishedby flow-graph As can be seen from the literature cited in the next section, signal-flowgraphs have been of Markov widely systems. applied in the study For a computerized solution a general of problem, perhaps matrix be faster. For in using methods would Mason's gain formula, an important of all directed circuits in the signal-flow step is the generation graph; and as advantage

The chief

of using
their

or matrix

method)

lies

in

ability

we saw
this

in

Chapter

11, the

algorithms

(suitable for

available computers)

for

are not very

efficient.
of

graphs have been proposed and studied and Mason's pioneering papers, [15-4] [ 15-5]. For a survey of different see [15-1]. Some of these variations offer variations, may slight computational advantage, but they do so by sacrificing the cause-effect as presented))) relationship,which is so nicely brought out in signal-flow graphs,

Severalvariations
literature,

signal-flow

in

the

following

424)
here.

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

Consequently,

not much
Mason's
network

has come out

of

these

other

types of graph
used

representations, and
theory, electrical

original widely graphs electrical machine theory, analysis, structures. treatment of the

are

in

control

heat transfer,

and analysis of

mechanical

An elementary but thorough can be found in applications

[15-3],
Mason,

and

[15-6].

without

graphs with many three any following monographs: [15-1], All three use the original signal-flow graphs as proposed by the later variations.)
J. R.

of signal-flow

15-1. ABRAHAMS,
Inc.,Elmsford,

and G.
1965.

P.

COVERLEY,

Signal

Flow Analysis,

Pergamon Press,

N.Y., S. N.,

and P. K. GHOSH, \"Flow J. Graphs and Linear Systems,\"Intern. Vol. 14 No.5, Nov. 1971,961-975. 15-3. C. S., Flowgraphs: For the Modeling and Analysis of Linear LORENS, Systems, McGraw-Hill Book Company, New York, 1964. 15-4. MASON, S. J., \"Feedback Theory: Some Properties of Signal Flow Graphs,\" Proc. I.R.E., Vol. 41, No.9, Sept. 1953, ] 144-1156. 15-5. MASON, S. J., \"Feedback Theory: Further of Signal Flow Properties Graphs,\" Proc. I.R.E., Vol. 44, No.7, July 1956,920-926. 15-6. L. P. A., M. BOISVERT, and J. ROBERT, Flow Graphs and ROBICHAUD, Signal 15-2.
GHOSH,

Control,

Applications,Prentice-Hall, GRAPHS

Inc.,

Englewood

Cliffs,

N.J.,

1962.)

15-2.

IN

MARKOV

PROCESSES)

The simplest random process is one in which the outcomes of successive trials are independent of each other. In a coin-tossing experiment, for the outcome of the kth tossing is independent of the outcome of all example, M be described this cannot previous tossings. any phenomena, however, by model. There are in in random nature which the outcome simple processes of depends on the outcome of previous trials. For example, the probability an offspring inheriting a genetic feature does depend on the presence (or of this in his ancestors. feature absence) A Markov is the simplest generalizationthat permits the outcome process of any trial to be dependent on the outcome of the trial immediately preceding but powerful it, and on no other.t This simple generalization gives the Markov process an to describe random processes in such diverse areas ability as statistical information control control, theory, theory, genetics, inventory of computer proprams, and the study of social analysis mobility of different
classes, tThis

to name model

few.)

Andreivich Markov (in 1907) is a landmark in originated by Andrei who had modeled a random process theory. Unlike previous mathematicians, as a sequence of independent Markov saw the advantage of introducing trials, dependence of each trial on the outcome of its predecessor. have of course been made to Attempts study nlodels with more involved dependency of the present trial on the outcome of the have led to intractable results.))) past trials, but such studies generally probability

SEC. 15-2)

GRAPHS IN

MARKOV

PROCESSES)

425)

A Markov
states

depends only on the state of the (k - 1 )th instant and not on any of the previous states. In other words, in a successive sequence of trials the outcome of the kth trial depends only on the outcome of the - I )th trial, and not on any of the ones. t (k preceding

s l'

S2' . . . , Sn'
kth

process is a
and

stochastic system
states change
only

capable at

of assuming

one of

the

discrete

points

in time.

The

state at

the

instant

Transition

Probabilities:

To

describe

a Markov
the

process, we must
transition

specify

for each
n states.

state, Si' the probability The transition probability

of

making

next

to each

of the

Po

is the

state of the
must

process is Si' the


o

next

state

if the present probability that will be s r These probabilities, Po'


n

satisfy)

< Po

<

1)

and

j=l)

Pi)

==

1,

( 15-8))

sum of probabilities of transitions to all possible states must be unity. that we have assumed that the (Note are constants, and do not vary with time. Such a transition probabilities or a time-invariant process. t). process is called a stationary process

the latter
a

because the
state

from

given

Transition

Matrix:

The

n 2 transition

probabilities describing a
in

Markov

process

can

most

conveniently

be

given

the

form

of an

by

n transition

matrix P == [Pi}]' subject, of course, to the two conditions in Eq. (15-8). Any elements in which the sum of each row square matrix with real, nonnegative is 1 is called a stochastic matrix. Thus every matrix is the transition stochastic matrix of some Markov and vice versa. Let us look at some process, proP.) perties of a stochastic matrix
I.

If P is
for

k == 0,
rows

a stochastic matrix, ], 2, . . . (matrix


of P

its

kth
po

== I,

matrix, power pk is also a stochastic the identity matrix).

2. If all

are identical,
P == p2

then)

== p3

==

p4

==)

3.

Since

each row

of a stochastic matrix
the

adds

up to

1, only

1 columns
them.)

need be given:
In

remaining

column
matrix,

can be
we

derived from

addition

to the

transition

also

need to know the

initial

probabilities)

x(O)

==

[71 1 (0),

7l 2 (0),

. . . , 7l n (0)],)

is often called a Markov chain if the number of states is countable. t A Markov process A finite Markov chain is one in which the number of states is finite. In this book we are chains in which the time also changes in disconsidering only stationary, finite Markov crete steps (and not continuously). of confusion, such a process As there is no possibility will be referred to as a Markov hereafterwards.))) simply process

426)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

where

n j(O) is the
that

probability of the
the time
. . . ,
o
n,) instant

Markov

process

start,
satisfy

is,

at

o.

Clearly,

being in state s j at the the probabilities in x(O) must

the following conditions:


1, 2,
n \037 nlO) i= 0)

For i ==

< nlO)

< 1 and

== I.

( 15-9))

Any real-valued

the conditions in Eq. (15-9) vector whosecomponents satisfy the transivector. The initial probability vector x(O)and is called a probability are sufficient tion matrix completely determine a Markov process. They state at any time of the process being in any to predict the probability
instant

k.

an n-state Markov Graph: An alternative means of describing G. The vertices of G is an connected n-vertex, weighted, digraph process a and an with to the nonzero S states, weight Pu edge (Si' j) correspond a state Si to Sj\" Such from probability represents the nonzero transition a a not of value in called is transition visualizing only great graph, digraph, the process. Markov process, but is also a powerful analytic tool in studying in G must the the of the transition the satisfy edges graph weights Clearly, are in Eqs. (15-8). A digraph in which the edge weights conditions positive of edges and the sum of weights from a vertex is unity is emanating quantities Stochastic called

a stochastic

graph.)

Left

wall
1

Right
1/2

wall

(reflecting)

1/2

1/2

(absorbing)
1

C\037X\037\037X\037c\03751\0372s0
1/2

1/2

1/2

]/2)

5.
51

52

53

54

55

56

0 0 1/2 0 0 0
matrix

52

1/2 0

1/2
0

0
1/2

0 0 1/2 0
0

0 0 0 1/2

p=

5)

54

1/2
0 0

0
1/2
0

55

56

Fig. 15-4

Transition

and diagram for a

Markov process.)))

SEC. 15-2)

GRAPHS IN

MARKOV

PROCESSES)

427)

As an example of a Markov process, let us consider the following version of the classic problem of random walk: Suppose that a particle moves, according to a probabilistic mechanism, a straight line 11 = 2m units long between two walls. At each transition along the particle moves either one unit left or one unit right, each with the proba-

particle hits the left wall, it gets reflected; but if it hits the right absorbed into the wall. At a given time the process is in one of n = 2m states (i.e.,the particle is at one of the n points to what along the line). Only the present state is relevant the next state may be and not any of the previous states. This is an n-state Markov process. For n = 6, the transition matrix and the transition diagram
bility

t.

If the

wall,

it is

for

this

process

are given

in

Fig.

] 5-4.

similarities betweena Markov and a sequential machine, process discussedin Section 12-8. Both have a finite number the of states, and in both state transitions occur at discrete points in time. The main difference between the two is that in Markov we deal with are which processes probabilities, real-valued quantities instead of a set of symbols, as in the case of sequential machines. in a Markov process do not depend Transitions on any (externally but are governed distributions. Moreover, controlled) inputs, by probability
Note the
there

are

no

outputs

associated

with

a Markov

process.)

Multistep Transition Probabilities)


An

important

Given

that the
state
transition

being in
k-step
THEOREM

a Markov process is the following: question regarding in state process was initially Si' what is the probability of its called the S j after exactly k transitions? This probability cpij(k), from state Si to Sj' is given probability by)

15-4

In a
S j is

Markov processthe
the

k-step

transition
pk,

equal to

ljth

entry

in matrix

the

kth
The

probability cpij(k) from state Si matrix power of the transition


weight product)

to
P.)

Consider the transition digraph. Proof: probability of going from vertex Si to s} in at each step are stochasticaIly independent,

one

step.
the

Pi} of edge Since the transition

(SI,

s})

is the

probabilities

Pir.Prj)

gives
then going

the

probability
Sr

that

the process

will

go

from

state Si to

Sr

in the

first step and

from from

product of in exactly k
given

the probability of this argument, s} in the second step. Continuing of vertex Si to s} along a directed by the edgesequence length k is given of going from Si to Sj of these edges. But the probability the weights
to

steps is

the

sum

of the
length matrix

directed edge
by

sequencesof
ijth entry
.))) in

k in

the

from Si to Sj along all probabilities of going That this sum is the transition digraph. pk can be easily seen by used in arguments

Theorem 9-10.

428)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

0.6)

Fig. 15-5 To illustrate

Three-state

Markov

Process.)

Theorem 15-4,let
digraph

us

whose transition
of its powers
are)

is given in

consider a three-state Fig. 15-5. The transition

Markov process
matrix

and

some

.5
p =
.\037 .\037 \037 , p2

.5
.36

0
.4,

==

.24

[ .5

.5

O]

[ .2

.3
.3700

.5]
.4300

.2
P 3

.3
.416

.5
.24,

.2000

.344

p4 == .2864

.3696 .3440,
.3700

[ .37
pl0 ==

.43
.3841

.2 ]
.3038

[ .2720 .3580
.3076

]
.3076

.3099.3863
.3069

.3848
.3846

.3090,

P 15 ==
[

.3076

.3078

[ .3064 .3837 .3099 ]


.3077

.3076

.3845

.3079)]

.3846 .3077

pI7

== pI8

==

p19

== p20

==

.3077

[.3077)

.3846 .3077. .3846 .3077) ]

The ljth entry in p4, for example, is the probability that the process will go all from state Si to S j in exactly four steps. Let us, for instance, examine directed edge sequencesof length four from S3 to S 2 in Fig. 15-5. These are)
S3 S 2 S 2 S 2 S 2)
S3 S 2 S I S 3 S 2) S3 S I S 3 S 2 S 2) with

probability

of traversing

(.5)(.6)3 ==

.108,

with with

probability probability

(.5)2(.4)(1)== .1, == of traversing (.5)(1 )(.5)(.6)


the

of traversing

.15.)

The

sum

of their
example, Pk.)

probabilities, .358, is exactly


let us

entry

in the

(3, 2) position
properties

of P4.

For this
of
matrix

make some

further

observations

on the

I.

Beyond

a certain value
there

of k,

pk

contains

only

nonzero

entries. This
of every

implies that

is at

least one

of (and therefore a directed path every other vertex in Fig. 15-5.)))

directed edge sequence


length

k or

less) from

length vertex

k to

SEC.

15-2)

GRAPHS

IN MARKOV PROCESSES)

429)

2.

All rows of pk tend the k-step transition


large

to become
probability

identical as
cp;j(k)

increases.

This

means
the

that
of

becomes

independent

of i for
effect

k.
starting

This

result
state

the
3. As

s;

because should not come as a surprise, should wear off after sufficiently many

transitions.
P

a direct consequence of
that

item

2, the

higher

powers of

become

identical;

is,)
pk

p. pk

= p.

pk+

=)

because

P is
of

a stochastic matrix
Markov and try to

and

pk has

identical rows.)

Does
example stochastic

pk

every

process exhibit these


question,
them.)

a special digraphs,

case? To

answer this
classify

let us

properties, or is this take a closer look at

Classification

of States)

A set S of states if no state is said to be closed, trapping, or absorbing outside S can be reached from any state s; in S. In other words, there is no directed edgefrom any vertex s; in S to any vertex outside S. For example, [S4'sS, s 3} in Fig. 15-6 is a closedset of states. So is {s 4}' A single state Sk is an if and only if it has a self-loop state with weight one, absorbing or trapping such as S4 in Fig. 15-6. Clearly, the entire set of states in a Markov process a closed set. If there existsno other constitutes set of states closed trivially the entire set of of the Markov states the except process, process is called n a or irreducible.I other words, ergodic process is ergodic if and only if its)
A closed

but not

ergodic

set of

states

\037
52) I I I)

,-------------------,

0.3)

L___

I I I 1

___)

_______J)

,------I I I 1

157
: I

58

\"I I I I 1\"'---I :

\037 Closed sets

of states)

L_______\037

\037
Fig.

Ergodicset of states)

15-6

Nonergodic Markov

processshowing

closed

sets.)))

430)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

transition
of

going

graph is strongly from any state

connected;

that state.

to

any

other

is, there is a nonzero probability For example, in Fig. 15-5 the


con-

process is ergodic, but the process shown in Fig. ] 5-6 is not. A strongly nected closed set of states is calledan ergodic or irreducible set.

interest Markov processes are Regular Process: Of special among ergodic those in which there exists a directed edge sequence k (for of length exactly in G. Such a some positive integer k) from every vertex to every other vertex Markov process is called a regular process. Clearly, every regular process is ergodic, but the converse is not true. For example, in Fig. 15-7( a) the process is ergodic but not regular. of even For there is no directed edge sequence from s 1 to s 2 and no directed sequence of odd length from s 1 to s 3 ; thus length there exists no k for which there is a directed edge sequence from of k edges other vertex.) every vertex to every

0.5) 52) 53) \\\" J) S 4)

0.3) 0.5)

\\'2) 51) 54) (c))

S I)

(a))

(b)

Regular)

0.8)

0.7)

(d)

Regular)

(e) Regular)

(f)

Regular)

Fig. 15-7

Some ergodic stochastic


process

digraphs.)

The

integer
state
we

of a significance k there is a nonzero

regular Markov
probability

of going

can

in exactly k steps. In terms of the make the following statement: A some integer k

if for

every

entry

in

the

lies in the fact that for some from each state to every other k-step transition matrix pk == <I\302\273(k), Markov is regular if and only process is posik-step transition matrix <I\302\273(k) ergodic

tive.

Given the transition

digraph G of

an

process

(i.e., G is

strongly)))

SEC. 15-2)

GRAPHS IN

MARKOV

PROCESSES)

431)

connected),

let us
in

how can we tell if the process is regular ? To answer this question, introduce the following definition: A strongly connected g subdigraph if g has no proper subdigraph of two G is said to be a minimal or digraph vertices
15-5)

more

that is

strongly

connected.)

THEOREM

Let G be a strongly stochastic connected digraph, and let gl, g2, . gr be its n 1, n2, . . . , n r vertices, minimal strongly connected subdigraphs, having respecG represents a regular Markov processif and only if the greatest Then tively. common divisor of n h n2, . . . , n r is 1.) (g.c.d.)

..,

of this theorem, see Rosenblatt's paper [15-14]. Let us simply in Fig. some examples. The digraph 15-7(c) has two minimal with vertex sets {S3' connected strongly subdigraphs, S4}and {Sl'S2'S3'S4}. Since the g.c.d. (4, 2) == 2, the process is not regular. On the other hand, Fig. connected 15-7(f) also has two minimal, strongly subdigraphs, one with five and the other with Since the g.c.d. (5, 3) == I, the process vertices three. is
For illustrate

a proof it with

regular.
the

connected transition digraph contains a self-loop, The reader therefore, the process is regular [e.g.,Fig.15-7(d)]. the transition matrix P for each of the six is encouraged to write down in Fig. 15-7, and verify 15-5 by directly computing pk Theorem digraphs
Clearly,

if

a strongly

g.c.d.

is I;

(for

appropriate

k).

Periodic Markov
state
of

Process: An
certain two

ergodic

process

can

a cyclic
\037

only be entered at process is one with


are)

periodic states s 1 and

if every is said to be periodic The intervals. simplest example

in which

s1
for

\037 S \037 S2 1 S2 . . . are

possible.

The transition

only the transitions matrix P and its powers

this

process

p =
[\037 \037 J)

p2 ==

1 [o

p3 =
[\037 \037 J

\302\267) \302\267 \302\267 \302\267

l') J
in

As
trix

another
is

example,

consider the process

Fig.

15-7(c).

Its transition

ma-

0
p==

0
pk

0 0 1 0
0
1 \"2

1
==

0
t

! 0
0 0

0
0

0
1

1
0

t
0

0
1

! 0
!

for

k odd and very

large.)))

432

SURVEY

OF OTHER APPLICATIONS

CHAP.

15

0
pk

t 0
A
into

!
0)

for k even and

very

large.

Markov

process (q > I) transitions.


that

is periodic if and

only

q subsets consecutive q

such that
every

the

process

if its states dwells in each

can be partitioned of these q subsets in

It can
].) [15-11

be shown
Processes

ergodic

process is either

regular or periodic

Markov

with Transient

States: So far
in

ergodic Markov processes (i.e.,those


strongly

which

Let us now examine the connected). tion digraph is weakly connected. A weakly connected digraph G consists of two or more maximal connected fragments (i.e., strongly subdigraphs). Let us consider a fragment g of G (remember fragment g could be a single If there at least is no edge directed out of g, then g has to have one vertex). n we into and the can delete vertices in are that closed.I it, case, g edge going all edgesgoing into g, and then study g independentlyas an ergodic process [the edge weights will satisfy Eqs. (15-8)]. On the other hand, if there is an out of g, the vertices of g cannot constitute an ergodic process, edge going be because(g being maximal once exited, g cannot strongly connected) be entered and which reentered. once left cannot Such a set of states,which is called a transient set of are accessible from each other, themselves among states.Sets [s l' S2' S6} and [S3' S5}in Fig. 15-6 are transient sets. The vertices of a weakly connected stochastic digraph can be uniquely V V that T is the set of all transient into sets , T, t 2 , . . . , V q such partitioned that is, there is no edge(a, b) for a E Vi' states and each Vi is irreducible, For example, in Fig. 15-6) connected. b Ef. Vi' and the vertex set Vi is strongly

we have been considering the transition digraphs are processesfor which the transi-

T Clearly,

==

[Sp

S2' S6'

S3' S5}'

V t

==

[S7' S8}'

V 2

==

[S4}.)

a (weakly
must

digraph connected) stochastic

cannot

alone-there
all
ing

be

at least

one set

Vi.

In

other

words,

states
finite

of a

Markov process are transient


processes).
number

(remember

of set T consist it is not possible that we are only consider-

Markov

After a
states

large

will eventually

system has two or both: (1) the

transient a Markov process with of transitions, subsets. Such a settle down into one of its irreducible in either be interested of distinct behavior, and one may types set of an irreducible of the system before it enters behavior

states, and (2) the behavior Behavior 2 is no different

of the
from

system after
of an

it

enters

an

irreducible

set.

that

ergodic system. For once the

system)))

SEC.

15-2)

GRAPHS

IN MARKOV PROCESSES)

433)

enters

outside this 15-3 while

an irreducible set, it can set is immaterial.


analyzing

never

leave it,

and
be

thus

the

existence

Behavior
programs.

will

studied

briefly

of states in Section

computer

Thus as far

as the asymptotic behavior


only

of

Markov

processes
in

is concerned,

we needto study
the

ergodic

processes.

Among ergodic
Therefore,

regular

processes
the

are of

importance.t
behavior

processes,also,only
rest of this
process.)

the

section

we shall study
Asymptotic

asymptotic

of a

regular Markov

Behavior

of a Regular Markov

Process)

One of the most important questions about a Markov is what process the transients die happens to it after many many transitions? That is, after down, does the system reach a steady state, independent of the initial probabilities? If so, what is the steady-state probability vector x(00) and how do we of pk as k tends to infinity, and compute it? The answerlies in the behavior 15-6 provides it for a regular Markov process:) Theorem
THEOREM 15\0376)

If P

is a transition
infinity,

matrix

of a

regular

k tends to
and

approach

a stochastic

each

row w
of the

of

<I\302\273 is a

probability
first

Markov process, then its powers, = matrix <I\302\273 identical [cPij] having vector.)
that

pk, as

rows,

Outline

Proof:

We

note

since the
contains

some positive

integer

r such

that

vector y by on the elements of y. This averaging effect applied again and that may again would eventually smooth out differences have existed among of y. That the elements is, all components of vector Mhy = prhy = will have identical Pky elements, as h (and therefore k) becomes very let us observe that this condition is equivalent to pk approaching Finally, large. a limit <I\302\273 as k tends to infinity, and <I\302\273 a the rows of matrix are identical-each is encouraged to fill in the details. probability vector. The reader .)
premultiplying only

we observethat
positive

pr = M any column

process is regular
only

there

exists

positive entries. Second, a stochastic matrix having

entries has

an

averaging

effect

Theorem 15-6is perhaps the most important result in the Markov processes. Many and useful results for a regular interesting on the of this for as k \037 00. existence limit pk, process depend Since p= (which is a shorthand notation for lim pk as k \037 00) can express the steady-state probability)
x( 00)

theory
Markov

of

exists,

we

= x(O)Poo =

x(O)<I\302\273.)

(15-10))

whereas
It An

classification into persistent and transient states is fundamental, tTo quote Feller, ....The states concerns a technical detail. the classification into periodic and aperiodic to trivialities;\" W. Feller, a nuisance in that it requires constant reference represents Volume I, 3rd ed., John Wiley Introduction to Probability Theory and Its Applications,

& Sons, Inc., New

York,

1968,

387.)))

434)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

Writing

this equation
7l j(

in

terms
n

of its

elements,)
j == 1,

00)

==

i = I)

\037

7l i (O)4Jo'

2, .

. . , n.)
CPo is

( 1 5-11

))

Now,
W

since

all rows

J that

depends

of ware identical, each element only on the column indexj. Thus)


n

equal to

a value

7l j(

00)

==

\037 i = I)

7l,.{ 0) W j
n

== W j I: =

1)

7li(O)

(15-12))

==

wi\
the same limiting probability this final probability Moreover, as rows of matrix w.

Thus a regular Markov distribution w regardless vector, x( 00) == w, is the

processapproaches
of where one that
it started. appears

vector

this fixed how does one compute is also equal that makes up all the rows of wand matrix P to are available. to x( oo)? Several methods Raising the transition A a is but is method. it not obviously good higher and higher powers one, is the most used method following: frequently
given

For a
w,

regular

Markov

process,

that

is,

the

vector

Successivestate probability

vectors

must

satisfy)
(15-13))

x(k +
If the
then

1) ==
attained

x(k)P.)

state probability vector

has

its limiting

value x(00), it

must

satisfy)

x( 00)
and

==

x( 00 )P,)

(15-14
can

))

since

x(oo)

===

w,

according

to Eq.

(15-12), it

be rewritten

as)

w == wP.)
Equation

( 15-15))
which

(15-15)

implies

n simultaneous

equations,

can

be rewritten

as)

w(1
But

- P) === o.)

( 1 5-16))

zero. Therefore, I

- P is I the sum of rows of matrix a stochastic matrix, - P is a n the that is, equations in Eq. singular matrix; that It can be are not however, shown, any linearly independent. (15-16) we need one thus and n - 1 of these equations are linearly only independent, w. This is in vector n the row unknowns the solve for to more equation readily since P is provided by the
relation)

WI

W2

...

Wn

== 1.)

( 15-17))))

SEC.

15-2)

GRAPHS

IN

MARKOV

PROCESSES)

435)

Thus
I

in Eq.
we

P on the left-hand
side\037

hand

(15-16) if we replaceanyonecolumn\037 say the jth, of the matrix side and change the jth entry from 0 to 1 in the rightwould Let this new incorporate Eq. (15- 17) into Eq. (15-16).
w(1

equation be denoted by)


-

P)j =

j ') jth, the ] 5-

( 15-18))

where v j is

a row vector of
can

length be

n with all

I. Equation (15-] 8) (I P)j or by using


illustration,

solved

let

signal-flow us consider the


Eqs.

zero entries exceptthe either by directly inverting as shown in Section graphs,

which matrix

is

Fig. 15-5. Applying

(15-15)

three-state regular \037Iarkov process and (15-]7) directly, we get)


= (WI

I. For in given

(WI

M-'2

w 3)

.\037

.\037

\037 0) ]

W2

w 3 ),

[ .5
which
is) \\1' 1

.5

=
=

.4w 2 +
.6w
WI.) w 3 2

.5w3 ,
.5w 3,)

\"\"2

W3 = Hence)

= WI
combined

.8w 2,)

which

with)
WI

w2 +

W 3

I,)

immediately

yields
result

indeed is the of P.
Solving

the limiting probability we had obtained earlier problem

vector
by

= 17th

trying

(13 n !3-). This and higher powers

the

same

using the form


o

of Eq. (15-18) gives)


-I

P =

-.\037

.4

O.
1)

r -.5)
Replacing

-.5

]
all 1 's

anyone

of the

columns, say the second, with

we get)

(I
which

- P)! =

-.\037

:
I

-\037 1)]

[ -.5
on
inverting

yields

-2 (I

- P)!-I

/3

.\037

.5

4.
1.4)))

.1)

-1.5

436)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

Finally,)

==

(I

P)Tn

(0

0)

=
checks
Instead often

(11

-fJ))
of matrix (I to solve Eq. (15-20),

which

with
of

the value

of w obtained earlier.
by

solving
matrix

Eq. (15-18)
P is

algebraic
signal-flow

inveroon
graph

it

is more
when

efficient to
graph

use a

P)j,

particularly
from

The signal-flow
the

transition

graph

relatively sparse. to Eq. (15-18) is directly of the process by a simple modification:)


corresponding
w,.'s.

obtained

1. Replace the vertex


2.
3. 4.

labels s,.'swith

Remove
Put

all edges

edges

of

weight

s j\" incoming into the specifiedvertex - 1 from every other vertex to Sj\"

Reverse

the direction

of every edge. [Inverting


matrix-as

the

edge

direction

corre-

sponds to transposing the

required the

by Eq.

(15-4).]

5.
In will

Add unit

a new weight

vertex
from

with label 1 to this new vertex

digraph

and draw an edge

of

to Sj\
gain

this

give

signal-flow graph we the elements of w.)


WI)

can obtain the

from

v to

every vertex,which

v W3) -1)
W2)

Fig. 15-8

Signal-flow

graph

for

Markov system.)
Fig.

in

Fig.

Once again, modifying 15-8. For this


by)

15-5 we graph +1

signal-flow

get the appropriate digraph, as shown [using Eq. (15-5)] the determinant
2

is

given

L\\==

1-1 -

1 1

-1

3 +

...
==

=1-1
== 1

(.5

- .4 -

.4)

1.3,) are)

and the

three relevant cofactors neededin


L\\

Eq.

(15-6)

12

== =

.4, .5,

L\\22 L\\32

== .4,)

which

again

checks

with

the

results

obtained

earlier.)))

SEC.15-2)

GRAPHS

IN MARKOV PROCESSES)

437)

Medvedev method of obtaining vector w from the [15-12] has a different are he has shown that there some signal-flow graph, and through examples cases when graph-theoretic methods are superiorto algebraic ones. Another

computational

formula

using via

transition transition

digraphs graphs,

on computing

vector w
of

is given see [15-8].)

in

[15-7].

For

more

Transient

Analysis

a Markov

Process)
steady-state

distribution,

poo for a regular Markov process gives us the but it does not reveal the transient behavior of the does not tell us how fast pk converges to the limit W, nor does frequencies with which various states in the system were visited

Matrix

process.
before

It it give the
the
in

steady-state
the

behavior

closed-form
obtained

lies condition was reached. The answer to these questions of the sequence P, p2, P3, p4, . . . . The problem is then to find for matrix pk (as a function of k). This can expression
z-transforms:
know

be

using

From

Eq. (15- 13) we

that)

'It(k +
Taking

I) =

'It(k)P.)

the

z-transform

of both sides
n(z)

of this
==

equation,

we get)

z)

'It(0)

TI(z)P,

(15-19))

where

n(z)

is the z-transform

of 'It(k).Rearranging
'It(0)

Eq.

(15-19),

we get)

n(z) =
Application

(I

- ZP)-I.)

(15-20))

of

inverse
==

z-transform

to both sides

of Eq. (15-20) gives)


(I

'It(k)
Thus)

'It(0) [inverse

z-transform

of

matrix

- ZP)-I].

(15-21))
(15-22))

pk

inverse

z-transform

of

matrix

(I

- zP)-

1.)

have taken (15-21) gives the probability vector after k transitions = k . for and the value of as a func.,., I, 2, pk, place, Eq. (15-22) provides tion of k, in a closed form for any Markov (not process necessarily regular). - zp can be inverted Matrix 1 matrix direct but the flowmethods, by - P)* in Eq. (15-18), is often found to (I graph method, as used for inverting be more efficient. The weight of each edge Pu is now multiplied by z. Inforz is the transform of the unit and multiplying each mally speaking, delay,

Equation

transition

probability

by

z corresponds

transition.

For
via

a thorough
graphs,

process

signal-flow

to the delay associatedwith each treatment of transient of a Markov analysis see Chapters 3 and 4 of [15-9].)))

438)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

For

illustration,

let us consider the

Markov process depicted

in

Fig.

15-5.

we

have)

zp ==

-.:z
[ -.5z)

o 1 - .6z

-z
o 1)

-.5z)
\037

]
1

.6z
.4z
1

.5z

2)

z(1
2

= (I - Zp)-1
-

.6Z)

(I _ (1 z

Z)(1

.4z

.5z)

.5z

.IZ2)
[

.4z2
I

z( .5 -

.1
1

z)

- .6z) ] (15-23))

z)(l

0 I .174zXI + .574z) 1[ 0 0

\037]

-.6
+

0
0

I
0 +
Z2

0
0

.5
-.5
0)

.4

[
than in

.5

.5

-.6
inverse

]
(I

[ -.1
- ZP)-l
z,
by

:\037]!.) graph transition

Let us now compute the


algebraically. which

a signal-flow but

rather graph

The

signal-flow

graph is
by

nothing

the

each

reversed. SeeFig.15-9, which


51)

edge

is multiplied

and

the direction

is obtained

directly

of every edge is from Fig. 15-5.)

0.5z)

0.6z

Fig. 15-9 Signal-flow sponding to Fig. 15-5.) the cycle

graph

corre-

we From Fig. 15-9

immediately

obtain

product terms [as usedin

Eqs.

(15-6)

and (15-7)]

as follows:)
t 1

== .6z
==

2 + .5z + .2z3,

t2
determinant
\037

.3z3, I I

==
==

t 1

t2
2 - .5z

- .6z

.lz3.)

A cofactor)
\03713

== .5z(1 ==

- .6z) + - .Iz),)
entry

.2Z2

z(.5

which

is in

agreement

with the 3,1

in

Eq.

(15-23).)))

SEC.

15-3)

GRAPHS IN

COMPUTER

PROGRAMMING)

439)

Now taking the


iJ
pk

inverse z-transform of
n TI
5

both

sides

of Eq.
.500

(15-23), we get)

tJ TI
4

.673
(-.574)k-2 +

- 1.1
74

_ [

TI

cL

3.57

- .223
.426
.074)

- .170

.400

iJ n iJ]
(.174)k
20.35
- 2
.074

[ -.387 -.287)

.673) ]

- .500

- .070

.470 .400.
]

[ .013 -.087

Remarks and References)


As

the

brief

exposition
the
Markov

naturally into behavior of a

study

deal more
introductory
z-transforms

on

Markov

enter very in this section shows, weighted digraphs the asymptotic of finite Markov chains; in particular, A great its digraph. can be derived swiftly from chain Recommended chains remains unsaid in this section.

readings on Markov chains are and applications of signal-flow graphs


an

[15-11]and
to the study
list

[15-13].

For

of Markov
reading

is chains, [15-9]

excellent

source.

The following is a
processes
S. RINALDI, Graphs,\"

of

selected

for more on the

interaction of

Markov

and graph theory.) \"On the Analysis of Markovian Automation and Remote Control, in Markov

15-7.

BIONDI,

E.,

Discrete Vol.

G. GUARDABASSI, Systems by Means


G.,

and

of Stochastic
\"Two

15-8. GUARDABASSI,

28, No.2,

Feb. 1967,275-277.
and S.
RINALDI,

Problems

Chains:A

Topolo-

gical Approach,\" Operations Res., Vol. 18, No.2, March-April 1970, 324-333. 15-9. HOWARD, R. A., Dynamic Probabilistic Systems, Vol. I: Markov Models, John & Sons, Inc., New York, 1971. Wiley 15-10. HUGGINS, W. H., \"Signal Flow and Random Signals,\" Proc. I.R.E., Vol. Graphs
45,

15-11.

1957, 74-86. J. G. and J. New York, Company,


KEMENY, MEDVEDEV,

L. SNELL,
1960.

Finite

Markov

Chains,Van Nostrand
Systems

Reinhold

15-12.

15-13. PARZEN,
6.

Graphs,\"

G. A., \"Analysis of DiscreteMarkov Automation and Remote Control, Vol. E., Stochastic Processes, Holden-Day, D.,

by Means
Francisco,

26, No.3,

of Stochastic March 1965,481-485.


1965, Chapter

Inc., San

15-14.

ROSENBLATT, tion

Matrices

15-15.SITTLER,

4, 1957,151-161.

\"On the Graphs and Asymptotic Forms of Finite Boolean and Stochastic Matrices,\" Naval Research Logistics Quarterly,
Processes,\"

RelaVol.

R. W., \"System Analysis of Discrete Markov Circuit Theory, Vol. CT-3, No. I, 1956, 257.)

I.R.E.

Trans.

15-3.

GRAPHS

IN

COMPUTER

PROGRAMMING)
program

Analysis of
from

given

computer

has been an
purpose

the

early

days of computer
the

programming.The
time or

important problem of such an analy-

siscould be to estimate

running

storage requirement of a program,)))

440)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

a large program into a number of subprograms, to detect certain errors in the program, to document a program, or simply to a program written understand else. For all these purposes it is by someone to represent a program as a digraph. Each vertex represents very convenient a program that instructions the block, is, a sequence of computer having that each time in instruction the is executed all are property any sequence executed.Each program has one entry point (the first block instruction in the Each edge sequence) and one exit point (the last instruction in the sequence). V a transfer of control from the last instruction in the ) possible (Vi' j represents to block the first in instruction the block Such a program Vi program vj\" is a A called can be also digraph program digraph. program digraph thought of as an abstraction of a flow chart in which the boxes are shrunk to vertices and arrows become the edges. For example, Fig. 15-10 shows the program 11-9. of the chart in flow dashed line digraph Fig. [Ignore (v t4 , Vt) for now.])
to subdivide
types

of structural

// /
/ I I \037 I \\ \\ \\ \\ \\ \\

//

/'

./)

\\ \\ \" '\"

+V\\3
\"',,____

--1
Stop)

v,. 11-9.)
for a given Also observe
in

Fig.

15-10

Program digraph of Fig.


one be

Note
program,
that

that

there

because that

be more than may one progran1 block may modify


formats

program split and


in

digraph into several.


fashion.

programs

their
and

own

control

processing
this

instructions
(Declarative
in

the

course

of execution

cannot be

statements,
gram
digraphs.))))

such as

represented

dimension

statements,

are ignored

pro-

SEC. 15-3)

GRAPHS IN

COMPUTER

PROGRAMMING)

441)

Some
valid

obvious

but

important

properties

of a digraph

representing

any

computer

program
digraph

are)
must
vertex

I.

program

be connected.
of

2. It has precisely one


sponds
edges

zero

in-degree,
the

and

this

vertex

corre-

to the start of the


can be
drawn

program. (If
vertex

program

has

several
which

starting
directed

points, an additional start


to

can

be introduced
and out-degree,

from
this

all of

these vertices.)
vertex

3.

There

is precisely
the

. sponds to
care

end

one vertex of zero of the program.


one

corre-

(Existence of more than of as in item 2.)


Every

stopping

We shall caB it the stop vertex. point in the program can betaken
must

4. 5.

vertex

in the

program digraph

be

accessible

from the start

vertex.
The

stop

vertex

must

be accessible from every

vertex in

the

program

digraph.)

Detection of
To detect

Programming

Errors)

is an essential be checked by
in the
never
stop

and report certain types of structural in a source program errors most common of these errors can part of a compiler's job. The directed tracing paths from the start vertex to the stop vertex
Path

program digraph.

tracing

will
which
subroutine

detect
there

entered, or program blocks from or disjoint parts, such as a vertex,


of

are program blocks that is no exit leading to the is never called [15-33].) that

Estimation

Program

Running

Time)

Given a computer and the execution time for each of the program program we are often required to estimate time of the program. the running The situation a weight is represented ti by a program digraph having associated with each vertex Vi' where execution time of the corret,. is the If we can estimate the number of times block. each vertex sponding program is entered (i.e., the program blockis executed), time of the prothe running can be determined gram (for a particular computer, of course). In the program digraph let each directed edgeei be assigned a nonnegative is the number of times edge ei is traversed. The number of integer 1:.,where.l:. times a vertex is entered must equal the number of times it is exited, except for the start vertex and the stop vertex. These two exceptions can also be taken care of by adding an edge of unit weight directed from the stop vertex V n to the start vertex V I (see the dashed edge in Fig. Now the edge weights 15-10). in this modified digraph satisfy the Kirchhoff current law (KCL) at every vertex. (Quantity be looked upon as a flow the ith edge ei .))) through Ii may
blocks,

442)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

Recall

the electrical

networks

in

Chapter

13 and

the

flow

networks

in Chapter

14.)

If we apply and e KCL to a weighted, connected digraph of n vertices n in we 1 e the unknowns, edges, get linearly independent equations unknowns being the weights of (i.e., the flows through) the edges. Thus we can choose to independently only a set of J.l == e - n + 1 flows, corresponding the chords with respect to any spanning tree in the digraph. The remaining n 1 flows through the tree branches can be expressed in terms of these J.l For example, in the program digraph of Fig. 15-10, J.l == 18 - 14 + 1 flows. == 5. of five the flow through Therefore, every edge can be expressedin terms 14 boxes in the flow chart are unknowns. Thus the iteration counts through in be five can also terms of five These unknowns unknowns. expressed only 11-9 in we chosenconveniently tree. For a example, Fig. by picking spanning N is the numknow that the iteration count of the edge (v 4 , v 7 ) is N - 1,where ber of vertices 6 in the original was on which being Algorithm applied. graph in a more The flows through the remaining four chords are data dependent times of involved fashion. The minimum, and average running maximum, values of the program can be estimated probable appropriate by assuming the these four unknowns. At this point the problem of estimating running time becomes quite difficult. For some simple examples, the reader is referred to [15-25], and 95-102 and 364-369 of [11-39]. [15-26], pages In this connection an interesting question is as follows:
Given

a connected

program digraph such that and v n is the stop vertex? Some necessaryconditionsare of v I == 0 == obvious:Each f. must be a nonnegative integer. The in-degree vertex KCL at each V . must of the except at v I Also, out-degree satisfy n f.'s be equal v should and V n ' Moreover, out of the sum of weights of edges going I Are to V both to the sum of weights into of edges ' unity. being equal going n the following these conditions sufficient also? The answer, as given by construction, is yes. an unweighted From the given, weighted digraph G let us construct H e as follows: edges, digraph every edge Replace wherefj is j withfj parallel H will be the the G. of the e in the digraph Clearly, weight edge j digraph == is if KCL if and in vertex v balanced for only H] d-(v) every [i.e., d+(v) is balanced satisfied at every vertex in G. Now, from Theorem 9-1, a digraph exists a directed Euler walk if and only if it is an Euler digraph; that is, there if there exists a directed edge in if and V H. to This is from only possible n VI in it exactly in G V that vertex to such from every edge ek appears sequence n VI in directed this not and the does edge sequence. appear edge (v n , VI) fk times, v I as with The last statement to G being a program is equivalent digraph
that

having sufficient conditions v I is the start vertex

weights!l ,!2, . . . ,fe

digraph

with

vertices

1'-

V 2 ' . . . , Vn and
what

e edges,

associated

with

the edges,

are

necessary

and

G corresponds

to some

start

vertex

and

Vn

as

stop

vertex.

Thus we

have.)))

SEC. 15-3)

GRAPHS IN

COMPUTER

PROGRAMMING)

443)

THEOREM 15-7) with n vertices and e edges.Let all digraph connected, weighted and such that they satisfy integers, weights 11,/2, . . . ,Ie be nonnegative of VI = 0 let the in-degree KCL at each vertex, except v 1 and t'n. Furthermore, = out-degree of V m and the sum of the weights out of VI = the of the edges going Vn = 1. Then G corresponds to a prointo of the edges going sum of the weights in which v 1 is the start vertex, V n is the stop vertex, and the weight gram digraph that edge is traversed in the program.) J; of the ith edge is the number of times
the edge

Let G be a

Program

Segmentation)

so large that it cannot be accominto the working memory of the available computer. the In such a case the program must be segmented before execution. Then the slow bulk memory from segments (pieces) of the program are brought The size of each segment or tape) and executed one at a time. disk, (drum, the working must be small enough to be accommodatedinto memory and yet be large enough so that transfers between there not be too many must would Thus we have a problem the fast working memory and the slowbulk memory. of finding an optimal of the program digraph into subdigraphs partitioning such that the sum of weights of vertices (here the weight Si of vertex Vi is the amount of storage spacerequired by the ith program block) does not exceeda enviA similar problem arises in a multiaccess, value. time-sharing specified ronment, where each user is given a burst of service of fixed duration. The have to be chosen judiciously, not so large that its execuprogram segments tion will exceed the allotted time and yet not too short to require inefficient
modated

Sometimes one comesacrossa program


in

its entirety

transfers

between

memories.

If the program digraph is acyclic(i.e.,the program is has no loops, which rare for any nontrivial computer program), the partitioning is solved problem the first from easily. We sort the vertices in a topological order, and starting the into largest possible (topologically sorted) vertex, we partition sequence exceeds the that the total vertex weight such of no subsequence subsequences

specified value.
The

difficulty

in segmentation
the

arises because
program).

program
circuit

digraphs (i.e.., loops in


implies

fast causes

and

between interchanges slow memory. Thus one would vertices of one directed circuit to

in the of directedcircuits made across a directed the two segments, and hence between

A cut

like

to

avoid

belongto more than


is

a segmentation
one

that

segment.

The
maximal

simplest method
strongly

to accomplish this
requirement
largest

connected

subdigraphs)

compute

the

memory

of
then

all fragments (i.e., to identify in the program digraph. Then the weights of each fragment by adding
the

all its vertices.If the


the

of these

size of the working

memory,

memory requirements does not exceed is solved. For we need not))) problem

444)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

cut

a segment

any directed circuit, of reasonable


practice,

and small
size.

fragments

can

always

be combined is
usually

to yield
too

In
large

however,
in

it is found

that

the

largest

fragment
Fig.

to

fit

the

working

memory.

For example, in

] 5-10

almost

the

entire program digraph forms a fragment. In such a case, cutting across is unavoidable. The simplest approach suggested directed circuits in the a parti tion literature is to find that severs the least number of directed This is a difficult all strongly connected circuits. To enumerate problem. and then consider each as a possible subdigraphs in the program digraph as a solution in the literature segment, although suggested [15-32], is a horrendoustask. Even generation is extremely of all directed circuits in a digraph time consuming, as we observed in Chapter 11. Another method suggested for program segmentation is by first ordering the vertices in a certain fashion all involves more labor than finding [15-20]. This method of segmentation but less labor than all strongly connected subdigraphs fragments, generating

of the
We this

program

digraph.

of a Segmentation are quite far from


important

program is a very
having

difficult

found

a procedure
a partitioning

to say the least. problem, for an efficient solution for

and

interesting
obtain

graph-theoretic
solution
number

problem.
that minimized

Even if we were able to

the number
directed

of severeddirected circuits,
circuit

the

might
of

not be
times.

optimal. Every
Obviously,

is not

traversed the same


with

cutting

one with count is worse than cutting have the iteration count of each looplower iteration count. We must A information available ab initio, because of its data rarely dependence. it behaves as a Markov stochastic that analysis of the program, assuming system, is often the answer to this problem.) higher

directed circuit

iteration

Stochastic Modelof
One
different

a Program)

method
edges

used to
vertices
the

estimate

the

yelative
program V j)

frequencies
digraph

of traversal
to be

of

and

is to

digraph, in
that

which

the

program

weight execution

assumethe Po of edge (Vi'


will

is

a stochastic the conditional probabilityt


block
V

go

to

program

executed the program blockVi. Once the program reaches V n' the stop vertex, the the probability of its branching to any other vertex is zero. To satisfy in Eq. (15-8), we add a self-loop of weight conditions one at vertex V\". Thus V n is an absorbing in the system, and the state state, the only absorbing A very simple stochastic states. remaining vertices correspondto transient

J given

that

it has

program digraph and its


tNote
that

transition

matrix

P are shown

in

Fig.

] 5-11.)

these

weights
the

previous
Eq.

analysis of

program

Po's have nothing to do with weights f/s assigned in the digraph. While fk'S obey KCL at each vertex, Po's obey

(15-8).)))

SEC.

15-3

GRAPHS IN

COMPUTER

PROGRAMMING

445

vI

......- Start

vertex
Vs

vI

V2

V3

V4

VI

0 0 0 0

2/3 0 1/5 0

1/3
0 0

0
1/2 2/5

0 1/2 2/5

V2

p=
1/2

v3

v4

3/7
0

0
0
I I I

4/7
1

----------------,--Vs
0

/
I \\

Vs

\" \" Stop


\\

vertex

./
.......\037 1)

Fig. The

15-11

Stochastic progranl matrix P of


any

digraph

and

its transition program

matrix.)

transition
the

stochastic

digraph

can be

expressedin

form) p =
[\037+\037l)

(15-24))

where

Q is an (n
(n

states, T is an
zeros.

- I) by
I)
by I

(n

I)

submatrix

corresponding

to the

transient
1

col umn

vector,

and 0 is the row


the k-step

vector of n
transition

Let

us look at

matrix

pk,

which

represents

prob-

abilities.Clearly,)
pk

=
[\037k_

( 15-25))
:_\037})

(T' is a
The

matrix

that

(jth
k

entry
transitions

exactly
show
In

we need not com pute here.) in Qk is the probability of being in transient the starting state Vi (also from transient).

state

v j after Let us first

that
the

Qk becomes
stochastic

let Pi be the probain v n stop vertex reach bility starting program I n steps (or less). Since n there exists at least one directed path (of length or less) with a nonzero path product from I. V < Let be to ' p Vi n quantity Pi the Vn in n steps is less than of all p;'s. The probability of not reaching largest tend))) P, in 2n steps it is less than p2, and so on. Since P < 1,these probabilities
n vertices, that

0 as k becomes large. program digraph G with


Vi the

from vertex

will not

446)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

to zero.

zero,
write)

That is, the sum of the entries in the ith for i == ], 2, . . . , n - 1. Now since Qk
1

row == 0

of Qk as k \037 00 becomes for some large k, we can

Q +

Q2 +
by

... +

Qk-l

==

(I

Q)-l,)
1

( 15-26))
-

which

can

be easily

verified
I

multiplying

both

sides with

us denote brevity, (15-26) says that matrix == matrix (I Q)-l by R [ro]. v j from Vi in 1 step, 2 steps, 3 steps, The sum of probabilities of reaching ] the in (I - Q)-l,according is to to . . . , and k ijth entry steps equal rij' v number of times vertex Eq. (15-26). This is precisely the average j appears in a since we In the random always start from program, paths starting from Vi. us the iteration v the first counts of all V 1 and end at n ' row of R gives average ] That vertices. n transient is,)
let

- Q is

Q. Equation

nonsingular. For

r 1 j == the

typical

average number run.)


==

of times program blockV j

will be

executed

in

Matrix

(I

- Q)-l,
is a

besidesgiving
of a lot
stochastic

the of

of different
hij

vertices,

storehouse
the

number of occurences average other useful information about digraph.


will

the transient behavior of


denote
Vi.

program

the

probability

that the program

ever

For example, let v j having execute

executed
rij ==

Clearly,)

hij. (average

number of

times

vj

occurs,

given

that the system

started in

V j)

== h O \302\267 . '. Iii) J r

Therefore,)
h

ij

-\037. - r..

r.. ii)
from

( 15-27))

To extract
probability

another piece of
that

information starting

matrix

R, let
return

Pj denote the
to vi\" Now,

the program
through

from

v j will

never

to
then

pass r jj times
return

a vertex
I

there
it

r jj

times.
by)

Vj' the process must the probability Therefore,

reach

v j once
returning

and
to

of

v j after

leaving

once

is given

r..JJ

r.. iJ)

== 1 r. iJ).

Hence

the

probability,

P j'

of never
P

returning

to v j

after leaving

it

once

is)

j---. r..
]j)

( 15-28))))

SEC.

15-3)

GRAPHS

IN

COMPUTER

PROGRAMMING)

447)

Finally,
(starting

let

(1,

j denote

from

the

start

the probability vertex VI)' Then)


(1,j

that

viis

executed

exactly

k times

==

(h 1j )(1

- Pj)k-l(pj)')
with

(15-29))
of Fig.

For
matrix

illustration
is)

let us

continue
0

the

example

15-11. The Q

!
1 \"5

t
0

0
1 1\"

0 0 0
Q== 0 0

2
\"5

0
to

3
\"7)

and

matrix

==

(I

- Q)-1

comes out

be) 7

H
TI

\037

TI TT
7
7

R == (I

- Q)-1 ==

0 0

58 14

TT IT

TI

14

IT

0
Therefore,)

6 TI fr

14 IT

r 12 == H

is the 7
==

average number of times probability


that

vertex

V 2 gets

executed,

h 14 ==

11

TI

! is the

v 4 will

be executed,

P3
And

==

H is the probability that just been executed.)

V 3 will

never be

executed

given

that

it has

so

on.
number

Having computed the average can immediately get the expected

of executions
time

execution
n \037 . J=) 1

for

the

of each vertex Vi' one entire program as)


( 15-30))

't' ==

t J.r 1 J.,

where t j is the execution time assumes that there is no parallel

of

the

program
(i.e.,

processing

block V j\" Equation no two program

(15-30)

blocks are

executedsimultaneously).
For

the

purpose
the

can compute and check if


subfragments.

of segmenting a fragment g in the program digraph, we used in delete it the from g, edge fragment, frequently the size resulting digraph can be partitioned into appropriate If not, we remove the least frequently in the used edge
least
process

remaining digraph. This


into the required

is continued
This

till

subfragment

g is

segmented

size subfragments. proceduresuggestedin [15-33].)))

is

the

stochastic

segmentation

448)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

The

most di fficult

part
in

of stochastic
the

inaccuracies involved
the

evaluation

analysis of a program of the transition


sample

is the

labor and

matrix P,
however,

because
be

branching

probabilities

are

data

dependent. They can,


input

estimated
difficulty

by simulation methods using is that for many programs the

data

[15-33]. Another
the

being statistically
Remarks

independent is not

assumption about

weights

Pij's

valid.)

and References)
and

I n analysis are likely to


mathematics.

design

of application
theory

programs and
often

encounter graph
As

more

than

we have

just seen,

a weighted

digraph

software system you any other branch of is a natural and useful


aid

representation

of

a computer

program, and is of

immense

in

timing

certain analysis, segmentation, and in detecting I n addition, there are other errors. programming

common.
applications

types of

structural

that were not

discussed here. Someof


I. Program

these

are)

optimization, [15-16].
flow as

2. Automatic

charting,

[15-19] and

[11-4], page 245.


[15-23]. a

3.

Graphs

data

structures,

[15-34].
evaluation,

4. Parallel-processingdesign and
5. In

proving equivalence of
by transforming

program
The
utilization

of or proving validity two programs, the program digraph into canonical forms.)

following
of

list of papers in the art of graphs

is a sample

of

the

growing

literature

on

computer programming.)
Ann. Rev. Automatic Programming, C. J. SHAW (eds.), Press, Pergamon

15-16.

ALLEN, F.
Elmsford,

E., \"Program Optimization,\" M.I. HALPERN and 5, 1969,239-307.


N.Y., J. L., and

Vol. Inc.,

1969.

15-17.
15-18.

BAER,

R. CAUGHEY,

\"Segmentation

Proc. Cyclic Structure Analysis,\" BElZER, B., \"Analytic Techniques

from and Optimization of Programs 23-35. AFIPS Conf, Vol. 40, 1972,SJCC, of Program for the Statistical Evaluation

FJCC, 519-524. Running Time,\" AFIPS Conf, Vol. 37,1970, \"Directed A. T., and R. P. WATKINS, Graphs and Automatic FlowchartBERZTISS, Adelaide, 1969, 495-499. Conf ing,\" Proc. 4th Austral. Compllt. 15-20. EARNEST, C. P., K. G. BALK, and J. ANDERSON, \"Analysis of Graphs by Ordering of Nodes,\" J. ACM, Vol. 19, No. I, Jan. 1972, 23-42. 15-21. HAMBURGER, P., \"On an Automated Method of Symbolically Analyzing Times of Thompson Conference, Proceedings of the 21stACM National Computer Programs,\" Book Co., Washington, D.C., 1966, 321-330. to Digital Computer 15-22. KARP, R. M., \"\"A Note on Application of Graph Theory and Control, Vol. 3, 1960,179-190. Information Programming,\" ofa Model of Parallel 15-23. Computations: \"\"Properties KARP, R. M., and R. E. MILLER, J. Appl. Math., Vol. 14, 1966, SIAM Termination, Queueing,\" Determinancy,

15-19.

1390-1411.)))

SEC. 15-4)

GRAPHS IN

CHEMISTRY)

449)

of Graphs,\" J. ACM, Vol. B. W., \"Optimal Sequential Partitions 18, 1971, 34-40. Proc. IFIP Congress 71, 15-25. KNUTH, D. E., \"Mathematical Analysis of Algorithms,\" 1971, 1135-1143. Aug. Ljubljana, International Proc. 15-26. KNUTH, D. E., \"The Analysis of Algorithms,\" Congress of Mathematics, Nice, Sept. 1970. Comm. of Jumps in a Program,\" 15-27. KRAL, J., \"One Way of Estimating Frequencies

15-24.

KERNIGHAN,

No.1,

ACM, Vol.
15-28.
15-29.
KREIDER,

11, 1968,475-480.
L.\037\"A

Flow Analysis

Algorithm,\"

J. ACM,

Vol. 11, No.4,

Oct.1964,
Based

429-436.
LOWE,

Structures T. C., \"Automatic Segmentation of CyclicProgram Comm. ACM, Vol. 13, No.1, Connectivity and Processor Timing,\"

on

3-9.

Jan. 1970,

15--:JO.

MARl MONT,
Programming,\"

R. B., \"Applications SIAM Rev., Vol.

15-31. MARTIN,
of
15-32.
Vertex PROSSER,

and Boolean of Graphs 2, 1960,259-268.

Matrices to Computer

D., and G. ESTRIN, in Probabilities

of Computations and Systems-Evaluation \"Models J. ACM, Vol. 14, Graph Models of Computations,\"

No.2, April
Diagrams,\"
Spartan

1967, 281-299. R. T., \"Applications

of Boolean Matrices
Joint

to

the

Proceedings of the Eastern New York, 133-138. Books,

Conlputer

Conference,

Analysis of Flow Dec. 1959,

15-33.

RAMAMOORTHY,

Program
the

21st

and and Addressing Schemes,\" J. Computer A. L., \"Data Graphs Sci., Vol. 5, No.3, June 1971,193-238. of to the Analysis of Distribution 15-35. A., \"The Application of Graphs SCHURMANN, and Control, Vol. 7, 1964,275-282. Loops in a Program,\" Information 15-36. VERHOFF, E. W., '\037Automatic Program Segmentation Based on BooleanConnecSJCC Proc., Vol. 38, 1971,491-495.) tivity,\"
15-34.

1966,229-239.

and of a Dynamic Look Ahead C. V., \"The Analytic Design Proceedings of Computers,\" Segmenting Scheme for Multiprogrammed Book ACM National Conference, Thompson Co., Washington, D.C.,

ROSENBERG,

System

15-4.

GRAPHS

IN

CHEMISTRY)

of organic Arthur Cayley used trees to represent the structures Although of the early interest in the study molecules 100 years ago (and, indeed,much that graphit is only of trees was motivated by this representation), recently and identificause for characterization theoretic techniques are coming into of the electronic of chemical tion This is due to (1) the advent compounds. need computer with its a'bility to handle graphs, and (2) the ever-intensifying a mechanized retrieval system capable of of the chemist to have information with the millions of organic compounds known today. dealing Given a chemical substance and some of its properties (such as molecular
weight,

chemical

to find
this

out if

this

compound,

compound, or if

like spectrum, etc.), the chemist would known compound. If he is able to identify of the he may like to know some additional properties he would like to know its structure,))) the compound is \"new\"

composition,
substance

mass

is a

450)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

and

then

therefore,
tion.

include it to have
must

in

the

dictionary

of known compounds. I t
for

is

essential,

a standard
be

representation

compound,

and the
classifica-

representation
It was

compact,

unambiguous,

and amenable

to

3-6 how a chemical compound can be represented shown in Section of a connected graph, with the atoms as the vertices and the bonds between them as edges. For compactness the hydrogen atoms are omitted from the representation, as they are implied by every unused valence of the other atoms. For example, the structural C 3 H 7 NO, of aminoacetone graph with its H atoms strippedoff, is shown in Fig. 15-12. [Recallthat the valence for carbon (C) is 4, for nitrogen it is 2.]) (N) it is 3, and for oxygen (0)
by

means

o)

Fig. 15-12 c)
The

Structural

graph

of amino-

c) graph of
than

c)

acetone.)

in general, contains much formula does. For example, the molecular C 1oH 22 can denote the formula any of its 75 isomers (75 being number of unlabeled trees with 10 vertices five and with no vertex of degree or more), while the graph specifies the exact isomer. It must be kept in mind, conhowever, that a structural graph does not contain all the information tained in the three-dimensional model of the chemical The compound. structural graph does not specify the bond distances or the bond angles of the molecule. Since these are known for a small number of organic only molecules this is not much of a handicap.A slightly more serious anyway, to distinguish between stereoisomers shortcoming of a graph is its inability the structural graph gives [15-40].Thus, exceptfor stereochemistry purposes,

structural

a chemical

compound,

more

information

the

molecular

a reasonably adequate description of


Canonical Representation
As pointed

a chemical

compound.)

of a

Molecule)

out above,
a

a standard representation
information

a precondition for
structural

point

computerized of view, organic

molecules can
ring

be divided

is of chemical structures retrieval system. From the


into

two

classes:
of

(I) the aliphatic

compounds, and (2) the


compound

compounds.

The

structural
by

graph of an
length edges,

aliphatic

has

no circuit,
which

except possibly circuits


are represented
ring

two arising out as shown in Fig.

of

multiple

bonds,

parallel

15-] 2.
three

The graph
or more.

of a

compound

contains

at

least one circuit of length Since the graph of an

aliphatic compound is a tree (if

we

ignore

parallel)))

SEC. 15-4)

GRAPHS IN

CHEMISTRY)

451)

edges),
tree

it can

easily be

given

canonical
centroids

representation
(parallel

as follows:
edges are

Every

has a

unique centroid

or a pair of

considered

as singleedgesfor the purposes of locating the centroid). The centroid can be used as the root of the tree (recall Section 10-3), and each subtree attached to the root is a radical. The subtrees can be ordered by the number of vertices is further contain in a nondecreasing order. Each radical subdivided into they in the same fashion. This process a are ordered subradicals, which produces linear code for each tree-a string. For example, the code for the tree unique 15-12 is C(C) (=O)(C(N\302\273. in details on coding of aliphatic For more Fig.
compounds,

see [15-42].

because no unique centroid (or pair Cyclic compounds are lesstractable, of centroids) with circuits. Fortunately, the chemist can be defined in a graph need not be concerned with the general problem of codinga graph (a very difficult problem, as discussed in Chapter 11). The structural graph of

almost every
and

ring

compound

is (I)

pl\037nar,

(2)

a regular
very

graph of
difficult

degree three,

a unique linear code for such a graph. There an n-sided polygon in such a graph exists of n vertices, and a description of the graph requires only for notation some the remaining nl2 edges. These edgesmay be represented by a sequence of n scheme numbers of their end vertices. For details on this coding consisting for most ring compounds, see [15-42].)
(3)

contains

a Hamiltonian

circuit. It is not

to find

Matching of
The
(having

ChemicalStructure)
of determining whether chemical formula) are

problem the same

or not two chemical compounds identical is the same as the graph

of the vertices. isomorphism problem, considerably simplified by the labels a code for a the the solution of Finding unique graph implies isomorphism two graphs would be isomorphic if and only if their problem as well, because easier codes were the same. For chemical structures, however, it is generally than a to perform a direct vertex-by-vertex to first find code matching unique describe one such algorithm for matching of for each graph. We shall chemical structures based on Sussenguth's paper [11-59]. The this algorithm is to use various idea behind underlying properties in the two graphs to as labels, degrees, adjacencies, etc.) of vertices (such must if the graphs are to be of vertex subsets, which match generate pairs An number are of used to partition vertices increasing properties isomorphic. either vertex in one into smaller and smaller subsets. Eventually, every graph is uniquely off with a vertex in the other paired graph, or two subsets of vertices characterized by identical properties in the two graphs do not have than the same number of vertices. more one (A third case arises when the two The can be best exists between isomorphism graphs.) process
explained

with

an example:)))

452)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

C @) c
CD)

0)

G)) Fig. 15-13


Structural

graphs

of two

molecules.)

Let us determine whether or not the two molecules in Fig. 15-13 are identical (H atoms are not shown, as usual). The vertices are arbitrarily named (1), (2), . . . , (8) in G and (a), (b), . . . , (h) in J. The process of generating matching subsets with common properties is ] 5-] . For instance, in outlined in Table vertices representing carbon atoms G must correspond in J. Of these, the to those representing carbon atoms in J, and so in G must correspond to pendant C vertices pendant C vertices on. (Note that Table 15-1 shows only a part of the subsets that are actually G and J are) and matched.) From Table ]5-1, we conclude that generated
Criteria

for

Corresponding

Subsets

in

Subset

Subset

Formation
Vertex

G C
0
N

Number

label:

1, 2, 4, 7
3, 6, 8
5

b,e,f,h
a, c, g d

2
3
4

Degree:

One
Two

1,3,5,6
8

a,d,g,h
c

5
6

Three
Four

2,4
7

e,f
b

Bond:
Intersection

Single Double
of

1, 2, 3, 4, 5, 6, 7 7,8 1
2

a,b,d,e,f,g,h

b,c
h

9
10

subsets 1 and 4 Vertices adjacent to


11h

I 1

51d
71b Intersection

4
4,6,8 of

e
a, c,

12 13 14 15

subsets
Remaining

4 and
vertex

13

6
3

a
g
of Chemical
Structures)))

Table 15-1

Matching

SEC.

15-4)

GRAPHS IN

CHEMISTRY)

453)

isomorphic

and the vertex


1 ( h

correspondenceis)
2

6 7 8
C)

dab)
one

similar

procedure

can be

used to identify

given

graph

as a

subgraph of

another.)

Computerized

Chemical

Identification)

Given the chemical formula

one can generate


graph

the

list

and the valence rules, of a \"new\" substance of all distinct chemical structures possible, using
course,
structural

perform
that

techniques. Computer this operation. (It is necessary, of a unique representation for a provides

enumeration

to programs have been written to have a coding scheme graph.)

This

method

of

as the producing an exhaustive list of all possible isomers gets out of hand number of atoms in the molecule. are over increases. For example, there t million structures possible for C2o H 41 OH. It is therefore necessaryto provide additional chemical information (such as the type of radicals ruled out as to a the list size. A computer program can be to unstable) keep manageable written to compare each of the structures in the list against various sets of

mass spectra. data, particularly As a part of the continuing identificaeffort toward a system of automated tion of chemical compounds, a computer language, has called DENDRAL, been developed at Stanford Uni versity. See [15-38] and [15-39]. One of the in DENDRAL programs generates the list of all tree-type potential isomers from an input The written of molecular formula and mass spectrum. program, in LISP language, consists of 40,000 run a PDP-6 timeis and on words, at Stanford. One such an is to of the of effort sharing system goals long-term a tool for of the automated chemical develop exploration planets [15-42].)
analytical Remarks

and

References)

and Feigenbaum and their Lederberg done the pioneering work in computerized of technical theory. A number reports and [15-44]) describe various aspects of the

team at
chemical

Stanford

University them

have in

identification
of

via graph
referenced

papers (four
DENDRAL

program.
paper

See also

[15-37].For a very
paper

readable

description

of the

see essentials of DENDRAL,


by Lederberg of

the

by Feigenbaum

and Lederberg

Another [15-38].

used for
ring

[15-40] is recommended
representing

as a well-written
and

exposition

how

graphs can

be

structures

of organic thesis
in

molecules-both
a subsequent

tree type
[11-59]

and

type.

Sussenguth

in

his

doctoral

paper

has)))

454)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

structures. He reports that the comof only as the square of the number his computer program when run on an IBM 7090 took 6 to 7 secondsfor matching a few thousandths 50-vertex of a graphs and only second to detect if the graphs were not matched. A survey is available of computer chemical structures methods in handling in which 1966. includes most of the relevant references through [15-44], Other The search for a and [11-59]. papers recommended are [15-38], [15-43], is far from over. Papers proposing alternative notational good codingsystem continue to appear in the Journal of Chemical Documentation.) systems given
chemical

an algorithm

for matching

time in vertices; and that


putation

his

algorithm

varies

15-37. BUCHANAN,

E. A. FEIGENBAUM, G. L. SUTHERLAND, and \"HEURISTIC A Program for Generating Hypotheses in Organic Explanatory Chemistry,\" Machine Intelligence, Vol. 4 (Meltzer and D. Michie, eds.), Edinburgh 1969. Press, Edinburgh, University of Inductive Inference 15-38. FEIGENBAUM, E. A., and J. LEDERBERG, \"Mechanization in Organic in Formal Representationof Human Judgement (B. KleinChemistry,\" muntz, ed.), John Wiley & Sons, Inc., New York, 1968, 187-218. and Search System Developed at 15-39. GLUCK, D. J., \"A Chemical Structure Storage Du Pont,\" J. Chem. Doc., Vol. 5, No. I, Feb. 1965,43-51. 15-40. LEDERBERG, J., \"Topology of Molecules,\" in The Mathematical Sciences, The
B. G.,

DENDRAL:

M.I.T. Press, Cambridge,


15-41.
LYNCH,

Mass.,

1969,37-51.
and
Publishing

M. F.,

of

Chemical

W. G. TOWN, J. M. HARRISON, Structure Information, Elsevier

J. E. ASH, Computer Handling Amsterdam, Company, and

1971.

15-42.
15-43. 15-44.

MEETHAM, in

A. R.,

Tree-Line

PENNY,

1968. Organic Molecules,\" Proc. IFIP Congress, R. H., \"A Connectivity Code for Use in Describing Chemical Structures,\"

\"Partial Isomorphisms

in

Graphs

Structural

Similarities

J.

TATE,

Doc., Vol. 5, No.2, May 1965,113-117. Systems,\" Ann. \"llandling Chemical Compounds in Information 2 (C. A. Cuadra, ed.), John & Sons, Inc., New Rev. Inf, Sci. Tech. Vol. Wiley
Chem.
F. A.,

York,

1967,285-309.)

15-5.

MISCELLANEOUS APPLICATIONS)
virtually

There is
graph

no

end

to the

list

of

problems

that
the

can be
last

solved with

theory. trees
5),

In addition for
file

to applications covered in
in

many applications were mentioned


search
(Chapter problem

earlier

dimers

(Chapter

3), design of printed-circuitboard (Chapter in crystal physics (Chapter 8), teleprinter's problem are following 9), and ranking problem (Chapter 9). The
organization

chapters,

chapters, for example.. binary

four

examples of applications. In a modern information retrieval system each Retrieval: Information The index of index terms (also called descriptors). document carries a number terms are represented as vertices,and if two index terms Vi and V j are closely an edge and related (such as \"graph\" \"tree\,") they are joined with (Vi' v j ).)))
some additional

SEC. 15-5)

MISCELLANEOUS

APPLICATIONS)

455)

The simple,

undirected (and possibly disconnected)


similarity

large

graph

thus produced

is called the

graph.

Components

(i.e., some

maximally

connected subof documents

graphs) of

this

graph
retrieval,

produce
one

a very
specifies

natural

classification

in

terms, and the maximal that includes the corresponding vertices will complete subgraph terms which specify the needed documents. give the complete list of index is needed in a situation such as an informaEstablishing graph isomorphism tion retrieval for chemical compounds. The reader is referred to system Reference Salton [15-60] for more on the subject. [11-1] is also recommended. a system o.f Lumped Analysis Physical Systems: In Chapter 13we saw how of two-terminal electrical componentswas (and consisting represented analyzed) by means of a graph. In that case the graph looked very much like the network This approach can be generalized a so that schematic diagram. built graph (called the system graph) is used to model any physical system from a finite number of interconnected components, given the model of each of of course. The system graph is a convenienttool in analysis component, the entire physical system. SeeTrent or Koenig, Tokad, and Kesavan [15-61]
the system. relevant index
for-more [IS-57]

For

details. a large

Matrix
by

a computer,

Inversion: For inverting the straightforward


inefficient,

(say, 100

by

100)

sparse

matrix
elimination

application of the
to poor

Gaussian

method
problems.

is

is

susceptible

The

following

graph-theoretic

accuracy, and method has been found

causes storage
to

be better:)

I. Replace each nonzero in the given matrix M with aI, and permute entry the rows and the correspondingcolumns the of resulting binary matrix

to make all diagonal entries as 1 's.


matrix

2. The

is now regarded as the adjacency X so obtained to l's along the G (the self-loopscorresponding digraph

matrix diagonal

of a are

deleted).

3. The resulting

digraph

is partitioned

into its fragments.


further

4.

fragment,

if too

removing

an appropriate
matrices

large, is \"torn\" edge.


are

into

smaller

fragments
inverse

by

5. The smaller

-1 original matrix M is
details of

inverted,

and from

them

the

of the

obtained.)
[IS-54] and Iyer showed
that

For further
Graphs

see Harary

[IS-56].
of order n group of n vertices, in which carry the
different can

Groups:
strongly

Cayley

every

be each

represented by a vertex corresponds


of

connected

digraph

the

group

(originally,

and to a group element edges Cayley used edgesof graph

label of a generator
colors

to show difis a directed)))

ferent generators).

Thus the

of a

cyclic group

of order n

456)

SURVEY

OF OTHER APPLICATIONS)

CHAP.

15)

circuit

of n vertices
uniquely

in

which

group

defines

of a every edge has the same label. The digraph the group by specifying how every product of elements

corresponds

to a
useful

diagram, is
details
Linguistics:

directed edge sequence. This


in

visualizing

and

on graphs

of groups,
Graphs

see [15-52].
been used words and between
forming

as the Cayley known abstract studying groups. For more


digraph,
in to depict parsing dialinguistics word strings and the edgesrepresent them. A set of words (vocabulary)

have

grams. The
certain

vertices

represent relationships

syntactical

and

a set

of rules (grammar) for

strings

(sentences)

characterize

then is a set of all legal so language. In other words,the language strings have defied generated. (Natural languages, becauseof their complexity, One in computational attempts at such complete specifications.) problem whether or not a given string to a language, linguistics is to identify belongs whose vocabulary and grammar are given. For more on graphs in computationallinguistics,

see [15-55].
name

the Sociological Structures: Digraphsunder used to representrelationships individuals among


Members

sociograms in a society

have been

(or group).

are

represented
etc.)

association, influence,
given

size complete subdigraphs,

immediate

significance.

and the relationship (admiration, by directed edges. Connectedness, separability, of fragments, and so forth, in a sociogram can be A number of tribes have been studied by
by
according

vertices

anthropologists
more

and are
topic,
has

classified

to their

kinship structures.
and

For
8 of

on

this

see Flament
also

[15-51],Harary
used
in

[15-53],

Chapter

Anderson [15-45].

Graph theory
fault

been

economics

[15-46], genetics,

netics, artificial intelligence,pattern


diagnosis

recognition,

logistics, cyberreliability theory,


model

in computers,

studying the structure


mathematical with

of computer memory,
of disarma-

and

the

study

of Martian

structure of Mozart'sopera, Cosi fan tutte [15-53]. And thus goes the ever-increasing list of applications of graph theory. Admittedly, in some of these applications a graph is used only as a means of visual itself. representation, and no more than a trivial use is made of graph theory and not-so-obvious results There are many cases, however, where important are obtained through a deeper use of graph theory.
the

ment [1-2]has beenattempted


Middle

A canals [15-63].

graph

theory

and so have the

conflictin

East and the

Further Reading: Although throughout the text we have selected readings, the number of published paperson graph theory available, larger (over 3000). There are several good bibliographies where most of the published material on the subject is listed. The best known Turner and Kautz [15-63], Turner [15-62], and among these are Zykov [15-64], An informative article containing a systematic Deo list of definitions [15-49]. and a bibliography of graph as applied to physics is [15-50]. Some))) theory

Bibliographies an\037

provided is much

SEC. 15-5)

MISCELLANEOUS

APPLICATIONS)

457)

additional

books recommended
Behzad

are

[IS-58], and

and

Chartrand
sufficiently

has been aroused theory literature on your own.)


15-45.
ANDERSON,

Chen [IS-59], [15-48], Marshall [15-47]. I hope your interest in graph so that in the cited you will go exploring
Mayeda

S.,

Company, Chicago,1970.
15-46.

Graph

Theory and

Finite

Combinatorics,

Markham of Graphs,

Publishing

AVONDO-BoDINO, Breach,

15-47.
15-48.

BEHZAD,

G., Economic Applicationsof the Theory Science Publishers, Inc., New York, 1962. Introduction to the M., and G. CHARTRAND,

Gordon

and

Theory of

Graphs,

Allyn

and Bacon,
CHEN,

Inc.,

Boston,

1972.

dam, 1971.
N.,

W.,

Applied

Graph

Theory, North-Holland

Publishing

Company,

Amster-

15-49.

DEo,

Its Applications,\"
Institute
April

HAn Extensive English Language Bibliography on Graph Theory and National Aeronautics and Space AdministrationjJPL (California of Technology) Technical Report October 1969; Supplement 1, 32-1413,

1971. J. W.,

\"Some Basic Definitions in Graph FISHER, Theory,\" 42, No.2, April 1970, 272-288. 15-51. FLAMENT, C., Applications of Graph Theory to Group Structure, Prentice-Hall, Inc., Englewood Cliffs, N.J., 1963. 15-52. GROSSMAN, and Their Graphs, The Random I., and W. MAGNUS, Groups Housel 1964. Singer School Division, New York, 15-53. HARARY, in the Social Sciences,\" Model in F., HGraph Theory as a Structural

15-50.

ESSAM,

and M. E.
Vol.

Rev. Mod. Phys.,

15-59.
15-60.

ed.), Academic Press, Inc., New (B. Harris, Theory and Its Applications 1970, 1-16. 15-54. HARARY, Matrices and Graph Theory,\" in Large F., \"Sparse Sparse Sets of Linear 139-150. (J. K. Reid, ed.),Academic Equations Press, Inc., New York, 1971, 15-55. John Wiley & Sons, Inc. (InterHARRIS, Z., Mathematical Structure of Language, science New York, 1968. Division), 15-56. IYER, C., \"Computer Analysis of Large-Scale Ph.D. Thesis, Department Systen1s,\" of Electrical Engineering, University of Hawaii, Honolulu, May 197 I. 15-57. KOENIG, H. E., Y. TOKAD, and H. K. KESAVAN, of Discrete Physical Analysis McGraw-Hill Book Company, New York, 1967. Systems, 15-58. MARSHALL, C. W., Applied Graph John Wiley & Sons, Inc., (Interscience Theory, New York, 1971. Division),
Graph
York,
MAYEDA,

W., G.,

Graph

Theory, John

Wiley

& Sons,

Inc., (Interscience

Division),

New

York,

1972.
Automatic
New

Information Organization and Retrieval, McGraw-Hill 1968. 15-61. TRENT, H. M., \"Isomorphism Between Oriented and Lumped Linear Graphs J. Acoust. Soc. Am., Vol. 27, 1955, 500-527. Physical Systems,\" 15-62. TURNER, J., \"Key-Word Indexed Bibliography of Graph Theory,\" in Proof Techin Graph Theory (F. Harary, niques Press, Inc., 1969,189-330. ed.), Academic 15-63. \"A Survey of Progress in Graph TURNER, J., and W. H. KAUTZ, Theory in the Soviet Union,\" SIAM Rev., Supplement Issue, Vol. 12, 1970, 1-68. 15-64. ZYKOV, A. A., \"Bibliography of Graph in Theory of Graphs and Its Theory,\" Applications (M. Fiedler, ed.), Academic Press, Inc., New York, 1964.)))
SALTON,

Book Company,

York,

Appendix)

A)

BINET-CAUCHY

THEOREM)

The in

following

classical the

calculating
by

result, known as of the product determinant respectively,


with

the

Binet-Cauchy

theorem,

is useful
Rare

of two
k <

by m and m

k matrices,

matrices: If Q and m, then the determinant

of the

product)

det(QR) =

the major

sum

of the
determinants

products of corresponding of Q and R.)


major)

The largest
out

term

major

determinant

(or

simply

means

the determinant
k columns

of

the

submatrix of Q (or R) formed by taking any square if columns; that of m. The term corresponding implies
particular

h ;2, .

chosen for a
i 10i 2,

major,

the corresponding

major of
product
with

Q must

. . , ;k
consist

(or rows) of Q are of rows

. . . , ik

of

Q. Clearly,
the

there are

(k)

such

terms.
an

Before proving
Let)

theorem,

let us

illustrate
-

example:

Q =

G
and R =
-\037

= \037
-\037

\037l

; ]

-2

det(QR)=de{\037 =\037ldet[_\037
_det

-\037J+de{\037

-\037J

l [3

-I
-2

-3
det

-2
-det \302\260

-2

= 2-(-2)

+ 4-1 +

(-2)-4 = -8.)
458)))

-1

-2 J

APP.

A)

BINET-CAUCHY

THEOREM)

459)

To evaluate det(QR),let us devise and Proof: partitioned matrices:)


Ik

multiply

two (m

+ k) by

(m

+ k)

Q [ -1m

=
[

1m. J [ \302\260 where


1m

RJ

-1m)
and

\037R})

and

I k are

identity

matrices of
=
[\037m \037J

order m

k, respectively.

Therefore,)

det
That
is,) ==

de{_\037m

QRR})

Q
det

O R)J

det(QR)

(A-I))

[ -1m Let us
and

now

observe

principal
of R

these together.

side of Eq. (A-I), method to the right-hand expansion in matrix -1m are its the only nonzero minors of any order of that order. We thus find that the Cauchy expansion consists minors minors of order m - k multiplied of order k in Q and by their cofactors
apply

Cauchy's

that

.)))

Appendix)

NULLITY
B)

OF A MATRIX
LAW)

AND

SYLVESTER'S

solution x * 0 if and x that satisfy Qx = 0 forms a vector null Q. rank of the null space called the of matrix The space space is called the nullity of Q. Furthermore, it can be shown that)
If Q only if 0

is an n by is singular;

n matrix,
that

then Qx =

0 has

a nontrivial all

is, det Q =

O.Theset of

vectors

rank

of Q

nullity

of

Q =

n.)

(B-1 )) a k

These

definitions

and Eq.
result

(B-1) alsohold
nullity

when

Q is matrices

not square but

by n matrix,
of nullity,

k < n.
An

important

involving

of

is Sylvester's

law

which can
Sylvester's
nullity

be statedas follows:
Law: If Q the product

of

is a k by n matrix and R is an n by p matrix, then the that is,) cannot exceed the sum of the nullities of the factors;
of QR

nullity

<

nullity

of

Q +

nullity

of

R.)

(B-2))

Proof:

Since every

vector x
nullity

that

satisfies

Rx =

0 must
R >

certainly

satisfy

QRx =

0,

we have)
of QR

>

nullity

of

O.)

(B-3))

Let s be vectors)

the

nullity

of matrix

R. Then there

exists a set of

s linearly

independent

{Xl,

X2, . . . , xs})

forming

a basis

of

the

null

space
= 0,)

of R. Thus)
for

RXi

i =

1, 2, . . . , s.)

(B-4 ))

460)))

APP.

B)

NULLITY

OF A MATRIX AND SYLVESTER'S

LAW)

461)

Now let
linearly

s+

be

the

nullity

of

matrix

QR.

Then

there must exist

a set of

independent

vectors)
{X S +l,

x s +2,

. . . , x s + t })
Xs+2,. .

such

that

the set)
[XI,

X2,'

. . , Xs, Xs+h

. , X S + t })

forms

a basis

for

the

null

space
for

of matrix
i =

QR. Thus)

QRx;

0,)

1, 2, . . . , s, s +

1,s + 2,. . . ,

t.)

(B- 5))

In other
the

first

(i =

s + 1,s + 2,. . . , s +

s vectors

words, of the are

s +
sent

t vectors
to t)

zero

a basis of the null space of QR, Xi forming by matrix R and the remaining nonzero Rx;'s Q. Vectors) are sent to zero by matrix
s + h RXs+2' . . . , RX s + t)

Rx

are

linearly

independent;
o = =

for

if)

alRxs+l
R(alX s +
1

+
+

a2Rxs+2

...

+ atRx s+ t
atx

a2 x s+2 +
atx

... +

s + t ),)
null

then

vector

(alX s+ 1

a2xs+2

= o. is possible only if at that Thus we have found there are at least t are sent to zero by matrix Q, and therefore) nullity But

al = a2

... =

... +

s + t ) must

be the

space

of

R, which

linearly

independent

vectors which

of Q

>

t.)

since)

t =

(s +
nullity

t)

of

s
QR

=
Eq.

nullity

of

R,)

(B-2) follows.

Substituting Eq.

(B-1)into

Eq.

(B-2),
rank

we
of

find

that)

rank Furthermore,

of QR >
the

Q +

rank of
QR is
R <

n.)

(B-6))

in Eq.

(B-6) if
rank

matrix

product
rank

zero, .)

then)

of Q

of

7)))) (B-

SUBJECT

INDEX)

A)

Algorithms,

268-327
number, and

Abelian
Abelian

group,
monoid, 113

114, 116
114

bridge-finding, 323
chromatic

313 components, 284

Abelian semigroup:
definition,

circuit generation, 287


connectedness

274

with identity
Absorbing

element, 114
429

cu t-verticesand definition, 269


efficiency

blocks,

state, 203

Abstract graph, 88-89


Accessible,

of, 269 vertex-set, 304

feedback edge-set, 313


feedback

313

Activities:

critical, 403
defini

fundamental circuits, 280


fragment-finding,

tion,

400
of, 400 representation,

dummy, 401
duration

generating
Hamiltonian

all directed circuits, 287 313 circuit,

Activity network, 400


Activity-vertex

isomorphism, 310 minimal cu t, 312


408
minimal minimal shortest

Acyclic digraph, 230, 410


Acyclic

edge

spanning

cover, 313 tree (see tree)

network,

400

Algorithms,

spanning

Adjacency matrix, 157-161,220-227 as data structure in algorithms, 270 of, 159, 222 powers

maximal clique, 312 ma tching, 312 maximal


planarity-testing,

304

properties of,
relationship

158,
with

220
other

matrices,

161

shortest-path,

290
between

shortest path
shortest

all pairs of

Adjacent:
definition,

vertices, 297
7

edges, 177

Algebra (see Algebraic Algebraic system:


definition,

system)

113

with one
with

operation, 114
operations,
118)

specified vertex to 292 shortest pa th from specified vertex to all others, 292 shortest spanning tree, 62, 279
path from another vertex,

smallest dominating
spanning-tree, 277) 463)))

set,

313

two

464

SUBJECT

INDEX)

Steiner
transitive

tree, 313
closure,

c)
300
313
Canonic Canonic

traveling salesmanproblem, topological sorting, 403

form form

of switching Junction, 350 of program digraph, 448

AMBIT/G,317
Arbitrarily

Canonical representation of molecules 29


Cayley diagram,
Cayley's

456
54, 164

' 450

traceable of, 223, point (see

graphs,

Arborescence, 206
number

theorem, 45

238
(see Cut-vertex)

Center of tree,

root of, 206


Articulation

Assignment problem,
Automata

178, 396
448

Central tree, 60 Centroidal tree, 248 Chain (see Walk)


Characteristic

polynomial,

311
451,

Sequential
charting,

machines)

Automatic flow

Automorphism, 267)

Chemical identification, Chord, 56,212,278


Chord-set,

453

56

Chromatic
Chromatic B)

number, 166, 171,313 169, 171 partitioning,


174,

Chromatic polynomial, Circuit, 20


288, 301
197
directed,

177

Backtrack,

202

Balanced digraph,
Bases of circuit

fundamental,
Hamiltonian,

57
30

Bases of cut-set
344 BCDcode,

subspace, 126
subspace,

127
cut-sets)

subspace,
Circuit

126, 130
between graphs, 84

Basic cut-set (see Basis vectors, 124


Bicen ters,

Fundamental

correspondence matrix,

Circuit-generation algorithms, 284


Circuit

141-145,216-217,337,

47
248

Bicentroidal trees,
Bichromatic
Binary

359,380 Circuit-path decomposition, 306


Circuit

graph,

166
113

vector,

125
according

Binary
Binary

group code, 352


matrix, tree,

operation,

Classification of graphs connectivity, 85


Clique,

to

138 49
458

32,

312
Cut-set)

Binary relation, 198


Binary

Closed state, 429


(see Cocycle

Binet-cauchy theorem, 219, 366,373, Bipartite, complete, 192


Bipartite

Coding a graph,

311
stability

Coefficient of internal
Coloring

(see

graph,

168
form,

Independence number)
problem, dual,

Block, 80,
Block-diagonal

284
274 328 329
330

165 104, 106 (see Abstract


graph)

Combina to rial
Combinatorial
Commutative

Boolean
Boolean

addition, 330
algebra,

Combinatorial graph
Commutative group,
Commutative

Boolean arithmetic, 170, 173


Boolean

optimization field, 117

problem, 396

function,
multiplication,

114

Boolean
Branch,
Branch
Breadth-first

ring, graph,
matching,

117

3 (see also Edge) of tree, 56


search,

Commutative semigroup, 113


Complete

32
178

302

Complete
Completely
Completely

Bridge, 286)

regular graph, 111


specified

machine,

342)))

SUBJECT

INDEX

465)

Component,
Computation Computer

21,55,202,274, 275, 278 time of algorithms, 270


of, partitioning programs as digraphs, 203, 230

D)

logic,

165

Data
Decan

structure
ting

Computer
Condensation,

194, 439

problem,
232

in graph algorithms, 270-273 13

Decision tree, 41
Decyclization,

Configura tions:
counting

series,

257

Deficiency,

181

definition, 257 Connectedness:


definition,

Degree:
139, 164 of a permutation,
matrix,

21

251
shortest
spanning

in digraph,
minimal,

202, 221
42

of a vertex,

7 tree,

strong,
Connectedness

202
and

Degree-constrained 63 components

weak, 202 274)


Connection

Deletion of edge, 27 algorithm,


Deletion

of vertex,

27

matrix

(see Adjacency matrix)


329 316

DENDRAL,453 Depth-first search, 301-304


Deterministic Diameter:)

Contact network,

sequential

machine,

342

Cook-Karp class of algorithms, Cotree (see Chord-set)


Counting

of a graph,

163

series,

243, 257

of a tree, 48)
Digraph,

of trees) Counting trees (see Enumeration, Covering (see Edge-covering) Covering subgraph (see Edge-covering)
Covering

194-237

acyclic, 301,410
adjacency

number, variable,

183

matrix 1 97 194

Critical path method (CPM), 400-408


Cross

of, 220

asymmetric, 197
balanced,

357

Cut, 387
Cut-node

complete, 197
(see Cut-vertex)
definition,

Cut-set, 68-71
capaci

disconnected,

202

ty, 80 68
of,

edge, 236
Euler,

minimal, 68
proper,

203

game, 410
69-71

properties simple, 68

irreflexive, 199
kernel

of, 411

subspace, 130
Cut-set

pseudosymmetric,
reflexive,

197

199

matrix,

151, 153,220,380
125

Cut-set vector,
Cut-vertex,

regular, simple,

197
251

76, 284
Directed

representation of permutations,
197
connected, tive, ted,

Cycle (seeCircuit,
Cycle
gain,

circuits)

strongly

202

421

Cycle index,

253-254
252

symmetric, 197, 199


transi

200 400
of vector

Cycle structure,
Cyclic code,

351
59

weakly connected, 202


weigh

Cyclicexchange,
Cyclic

Cyclic interchange representation


number

(seeCyclic exchange)
of permutation, (see Nullity))

Dihedral group, 266


Dimension

251

space, 124

Dimer

problem,
317)))

185-186

Cyclomatic

DIP,

466

SUBJECT

INDEX)

Directed

circuits,

202, 212, 230, 232,287,

Edge isomorphism, 87 Edge train, 20 (seealsoWalk) Edge variables, 357

291,421,443

Directed

graph (see Digraph)


circuits

Edge listing,

271

Directed Hamiltonian
Directed path,
Disconnected

, 312
423

231, 288,403,

graph, 21, Distance matrix, 61, 273 ma trix)

139, 159, 161 (see also Weight


trees

Edge voltage,
Edge-curren
Edge-disjoint

357

t vector,

358
circuits,
17 115,

Hamiltonian

32
212

Distance between two spanning Distinct representatives, 179


Division

' 59

Edge-disjointsubgraphs,
Edge-disjoint

union of circuits,
union

ring,

117 173

Edge-disjoint
Electrical

Dominating set, 172-173


Domination

Edge-voltagevector,
network: application of graph

of cut-sets, 358

71

Dummy

number, 401 activity,

theory

to, 356-383

Dual of graph,

103, 105, 190)

as flow problems, use of computers use of incidence


Elementary

399 in, 268


matrices

in, 271
(see Cyclic

E)

reduction,

99

Eccentricity 1 Edge,

of vertex,

46

Elementary tree transformation exchange)

adjacent,
capacity

177
of, 79, 357

backward, 389
385

Embedding: of graph, 90 on sphere, 94


Enumeration:

covering, 182-183
current,

of digraphs,

263

directed,

195
358

of multigraphs, 262 of simple graphs, 260

edge-current vector,
edge digraph,
forward,

of trees,
Equivalence

52,

240-250

236, 408

En umera tor,

243
classes,

389

201

gain, 418

Equivalence relation, 239


Ergodic

incident into a vertex, 195 out of a vertex, 195 initial vertex of, 195
incident

Error-checking code, 352, 354 Euler 23, 115, 210 graph,


Euler

process,

429

isomorphism, 87
listing,

lines:

271

directed,
number in

parallel,

of, 205,

pendant, 183

spanning

203, 210, 225, 227 226, 238 210 arborescence,


96

sequencesof, 160,222,333
series,

Euler's formula,
Events:

train,

terminal vertex of, 195 20 (see also Walk)


357
of, 61)

critical, 403
in

projects,

400

variables,

voltage, 357
weight

Event-vertex representation, 408 Execution time (see Computation time)

Exterior region,

94)

Edge

Edge, connectivity, 75 182-183 covering,

F)

Edge current,
Edge

357
408
Faces (see Regions) False veJtices, 350)))

Edge gain,

digraph, 236, 418)

SUBJECT

INDEX

467)

Fary's
Field,

theorem,
11 7

93
258 (see Sequential

G)

Figure counting series, Finite fields, 119


Finite-state

\"Galois field:

modulo m,
modulo

118-119
with

machines

2, 138

machines)
First

Game, 409-413
comparison digraph

Betti of

Five-color
Float Flow,

(see Nullity) theorem, 188 activity, 406

number

puzzle, 409

of, 410 409 409

finite, 409
perfect-information,

385

Flow chart,
Flow Flow

269
384, 398 384-399

states in,
two-person,

410
functions, 241
graph,

network, problem,

matching problem, as, 182,396


use

Generating

of computers Extended
Language

in, 268
Graph Theoretic 317 10, 187-190

Geometric dual of a Geometric representation

103
of a graph, Language

89

Forest, 55
Fortran

(FGRAAL), conjecture, 202

Graph Information Retrieval (GIRL), 317 Software Graph Algorithm

Package

(GASP);

Forward calculation, 405


Four-color Graph Graphs:

316
Extended

Algol (GEA),

317

Fragments:
definition,

arbitrarily

traceable,
structures, 166

29
448

finding all, 312


in

as data
443
bichromatic,

program

segmentation,
48

bipartite, 168
circuit-free, 55 in coding theory,
complement

Free trees:
definition,

number
Fronds,

of unlabeled,
303

248

351-353
76
192

of, 56,

Full symmetric
Function:

group, 253
256

complete, 32
complete

bipartite,

definition,

256 circuits:)

connected, 21
tion decomposi

equivalence classesof,
Fundamental

of, 26

definition, 1

algorithm, 280-284
and

directed (seeDigraph)
disconnected,

cut-sets, digraph,

73 212
in electrical of,

21
200

definition, 57, 71
for

drawing of, 2
equivalence,

matrix, 144
application deriving for

Euler, 23,

28

networks , 359

finite,

digraph,

144 219

in game
general,

theory, 409-413
2

Fundamental cut-sets:
definition,

infinite,
Kuratowski,

isomorphic, 14,
90,

139
93

71

for digraph,

212
with other matrices, 153 of contact networks, 336-

matrix, 153
relationship in

labeled,53 linear, 1 nonplanar, 90


nonseparable,

339
Fusion

synthesis

151

null, 9

of vertices,

28, 274)

nullity of, 57, 60)))

468

SUBJECT

INDEX)

HI NT, 31 7
opera
oriented,

tions on,
195

26
(see also
Digraph)

Homeomorphicgraphs,
Huffman

100

planar,

90
8 Identification
Identity Identity

graph-theoretic codes, 352)

rank of, 57
regular,

\"rigid\", 209 sum of, 26 ring

of chemical I} 3,

separable, 142

element, permutation, matrix,

compounds, 449 116

selfdual,
similari

107

252 371
137-140

signal-flow,

416-423

Immedia te successors,272
Impedance

ty, 455 426


of,

simple, 2
stochastic,

Incidence, 7

Incidence matrix,
133

subspaces transition,

for digraph,
in

214
networks,

426
83

electrical

tree, 60
two-connected,

as input in algorithms, rank of, 140


reduced,

359 271

union of, 26

141,214 161

unicursal, 24
uniquely

colorable, 53

172

universal, 32
unlabeled,

In-degree, 195, 287,400


Independence

with other matrices, relationship in synthesis of contact networks,


number,

336

170-171

number

of, 239
34, 61-63 270

vertex, 9
weighted,

Graph-theoretic algorithms, 269-316


performance,

Independent circuits, 144 set of vertices, 169-170 Independent set of edges, 193 Independent
Infinite

graph,

7
retrieval, 18

Infini te
Information

region, 94
449, 454
Insanity,

Graph-theoretic
GRASPE,

languages, 316-317

317

Instant
Internal

Gray codes,
Group:

351

Intermediate
states,

vertices, 386
342 set, 169
26

abelian,

114
250

Internal vertices, 49
Internally

definition, 113
permutation,

stable

Intersection of graph,
Intersection
Language
In-tree, In-valence

of subgraphs, (GTPL),316)

115

Graph Theoretic Programming

of subspaces, 131 207 (see also Arborescence) (see In-degree)

H)

311 Invariant of a graph, Inward demidegree (see In-degree) (see Balanced digraph) Isograph

Isolated vertex,
Hamiltonian

circuit,

30-34

number of,
origin

268 30-34
312
Traveling

Isomorphic
Isomorphic

graphs,
digraphs,

14, 139
196
239,

of,

10
in a graph,

Hamiltonian path,
finding,

209, Isomorphism, 14, 53, 159, 284,310,451)

274,

also shortest, 63 (see

salesman
J)

problem)
Hamming

distance,

349
Join,

Height of a tree, 50
Heuristic

132
curve method

Jordan
310)

procedure,

Jordan's

theorem, 91, 189 of elimination,

337)))

SUBJECT

INDEX

469)

K)

transient
tic
graph, graph,

analysis,

437

with transient
K-chroma 166 78
Marriage

states, 432
180 421-422

problem,

k -connected

Kernel, 411
Kirchhoff

Mason's gain formula, Matching, 177-182


in

matrix,

223

bipartite

graphs,
178

182

Kirchhoffs current law, 358, 441 Kirchhoffs voltage law, 359 Konigsberg bridge problem, 3, 23 Kruskal's algorithm, 62, 280 Kuratowski graphs, 90, 93,341
Kuratowski's

definition, 177
maximal,

perfect,
Matching

186
number,

178

Matching problem (seeAssignment


problem)

theorem,

100)

Matrix:

adjacency, 157-159
circuit, L)

142-143

cut-set,
incidence,

151, 153
137, 201

139

Labeled

graph, 53

inversion, 455
relation,

La beled trees, 240 Latin square, 193 Level of Nertex, 49 Line digraph, 236

represen ting a
stochastic,

graph, 137

425

Line:
Euler,

transition,
weight,

425

23

transmission, 332
61

(See also Edge)


Linear
Linear

unicursal,

24

Max-flow
Maximal Maximal Maximal Maximal Maximal

Linear

123 combination, 3 (see also Graphs) complex, 123 dependence,


independent,

Linear programming, 216, 386


Linearly

min-cut theorem, 86, 387-388 subgraph, 312 flow, 312, 385-386 1 78, 312 matching, planar graph, 111
complete strongly

connected

su bgraphs

123,216
456

Linguistics, graphs in, Link (see Chord)


Longest-path

(see
Meshes

Fragments)
(see

Maxwel1's formula, 366


Regions) 227

analysis, 1, 21 matrix,

301

Loop:
definition,

in electrical networks, 360

Method of paired comparisons, Minimal cost flow, 393-395 Minimal covering, 184, 328
Minimal Minimal

Loop impedance
Lower

371

decyc1ization, spanning

Lossy networks, 392 on edge capacity, bound Lumped systems, 455) physical

232, 313 tree, 61, 277-279


arcs,

392

Minimum-feedback

232 395-396 390)

Monoid, 113
MuIticommodity

flow,

Multiple sources and


M) N)

sinks,

Map

coloring,

187
304 Network
Network:

Map-constructionapproach, Markov chain, 425


Markov

analysis problem, 400-409


5, 356-381 and scheduling,

305

process, 424

424-439

activity,

asymptotic behavior, 433


definition,

contact, 329-341
electrical,

periodic,

431)

in

planning

400)))

470

SUBJECT

INDEX)

synthesis
Network

of, 334
flows,

Parallel

Parallel edges,2, 271,401 processing design, 448


(see Polish

transport, 384-389
79

Parenthesis-freenotation
notation)

Network functions, 370

p-partite, 168
Partitioning

Nim,410
Nodal

algorithm, problem, edges,

analysis,

362

Partitioning

31 3 165

Node (see Vertex)


Node

Partitions, 243 matrix, 363


334
Passive

admittance

363

Node-removal

method,

Pa th:

Node voltages, 361, 370 Nonplanar 90, 306, 341 graph,


Nonpolynomial

critical, 403 compared with


directed,

walk

and circuit,

21

algorithms,

315

201

Nonseparable graph, 76, 284 Null 9, 122 graph, of a graph, 57, 60 Nullity Number of different arborescences, 238 Number of different directed Euler lines ,

length

31 Hamiltonian, of, 20
matrix, product,

Path length, 51
Path Path

156, 336 330 281

238

Path-finding algorithm, 273


Paton's

Number Number

of free

unlabeled trees, 248


\037raphs,

algorithm,

of labeled

239

Pendant vertex, 9,43,196


Performance

Number
Number Number Number

of labeled
of rooted of

trees, 240

of graph-theoretic 250-255

algorithms,

labeled trees, 241 rooted unlabeled trees, 243


graphs,
239)

314
Permutation,

of unlabeled

degree of, 253 Permutation group, 250, Persistent state, 344

253, 256

o)

PERT, 232, 268,400-409 Planar graph, 90, 108, 165


Planarity Plane

I-connected graph, 78 I-factor (see Matching, perfect) 81 I-isomorphic, One simplex, 3 (seealso Edge) Opera tion on graphs, 26 research, Operations graphs in, 384-414
Optimal-policy

testing
and

representation,

Planning
Point

algorithm, 99, 304-310 90, \0375, 97, 273 of networks, scheduling

400-409
(see

Vertex)

Polish notation,
Polya's

208
theorem,

matrix, of graph,

298

Ordered trees, 209


Orientation

264

counting

238, 250, 257314

195-196
132

Polynomial-bounded

algorithms, 400

Orthogonal complements,
Orthogonal

Precedence matrix, 220

vectors, 130
249

Precedence relationship,
Predecessor
Preference

Otter's

formula,

matrix, 220
graph,

Ou\037degree, 195,287,343,400 Outer region (see Infinite region)

227
332

also Arborescence) Out-tree, 207 (see Out-valence (see Out-degree) Outward

Primitive connection matrix, Prim's algorithm, 62, 279


Probability

vector,

426
in, 441

demidegree

(see Out-degree))

Program:

error detection
p) segmentation

optimiza tion of, 448


of, 443 digraph,

Program block, 440


Pair
Palm

group,
tree,

255
303)

Program

440, 445
406)))

Project cost curve,

SUBJECT INDEX
Proper
definition,

471)

coloring,
165 186)

165-168

.Ring sum,

26
115,

of edges, 177

of circuits,
of cut-sets,

212

of regions,

72
362

RLC network,
Rooted
number

tree, 48,
time,

241, 243
243

of unlabeled,

Q)

Running

439,441)

Quadratic

flow-cost

function, 399)
s)

R)

s-field
Search

Scaffolding Radius
Random

of a tree,
digraph,

48
296 424

(see Skew field) (see Spanning 271 techniques,

tree)

Seating problem, 6,
Second-shortest

32

Random graph, 278, 321


Random

path, 1, 195,271 113

301

Self-dual graphs, 107


Self-Ioop,

Random
Randomly
Rando Rank:)

processes, 427 walk, m graph)

Semicircuits, 202, 212


Semigroup,

generated graph (see

Semipath,
Separable

201
graph,

Semiwalk,201
57, 60
214 matrix, Hamiltonian path, 76, 284
342

of graph,

of incidence
Ranking
Ranking Ranking Reachability by

Sequential circuits,
228

by score, 228 with minimum algorithm, vertex, matrix,

Sequential machines, Series edges, 99

165, 194,342,344

violations, 229
300

Set: of basic
empty,

circuits, 112

107

Reachability matrix, 235


Reachable

definition, 112
null, 112
with with Shift

203 341

Realizability:

of a circuit
of matrices,

162 of a single-contact function, 335, 340 Reduced incidence matrix, 153, 339 Referencevertex, 214 Reflected binary code, 351
Regions,

operation, operations, 205 register,


two tree,

one

112-116 116-119

Shortest-distance arborescence, 294


Shortest-distance

294

93

adjacent,
Regular

187
92
of planar of, 220

Shortest-path algorithms, 290 194, 416-423, 436 Signal-flow graph, transmission Signal network, 418

coloring, 187
graph,

Single-contactnetwork,
Sink, 385 graph, 189

335

Regular Markov process, 430


Regularization

Skeleton of graph Skew field, 11 7


Slack:

(see

Spanning

tree)

Relation, 198-201
digraph

free, 406
total,

equivalence, 200
matrix

406

of, 201 199

Snake-in-the-box
Sociograms,

code, 352

reflexive, 199
symmetric,

456

Source, Spanning
Spanning

385
418

transitive,
Relay

200
329

Source vertices,
forest,

contact,

arborescence, 209,
55,146,277)))

303

Ring, 117)

472

SUBJECT INDEX)
tree: Subgraph,

Spanning
all,

16,21, 141,273
408

algorithm for,
in a graph, application

to

359

277-279 55, 58, 238,277, 280,376 electrical networks, 356,


time, use
in

Submatrix,141
Subnetworks,

Subsequence,
increasing,

largest
44

monotonically

computer

running

estimating,

442

Subset, 112
Subspace,

125

definition, 55,
degree-constrained
minimal,

73, 209,277
shortest,

Successor

63

listing, 272
390

Supersink,

61,

279

number of,
root

218
spanning

Supersource,
Switching Switching

390
function, network, law,

of, 281

shortest (see Minimal sign of, 218, 376


weight

184, 329 146, 271,

328

tree)

Sylvester's System

of., 61 164 T)

graph,

146, 152, 380, 455)

460

Spanning tree matrix, Sparse graph, 300

Sparse matrix,
Star graph,

271

184
441

Teleprinter's
Terminal Thickness,

Start vertex,
Starting

vertex

problem, 204-205 of path, 20


373

state, 344

1 09

Sta

te :

absorbing (see 429 closed,

Closed state)

Three- terminal devices, 357 Through variable, Tie (see Chord-set)


Time-invariant

ergodic, 429
persistent,

344

432 state) trapping (see Closed State assignment problem, 346 State (see State graph) diagram
transient,

Topological order, 402, 443 sorting, 231, 313, 402 Topological


Tournament,

process,

425

197, function,

227-230 342

Transien t vertices, 446


Transition

State equivalence,
State graph:

345

Transition matrix, 220, 425, 444 Transition 425, 427 probabilities,

definition, 342
properties,

multistep, 427
Transitive Transitivity

343

closure (see

reduction

of, 347
342

of digraph, Relation) 332

300

State table,
Static flow,
Stationary

Transmission, 331
Transmission

385
425

matrix,

Steady-state probabilities, 434


Steiner

process,

Transport network,
Transportation

384-389
393

problem,

tree,

313
graph,

Trapping 426 445 t transition


Tree,

Stereographic projection, 95
Stochastic

Traveling 39-54

state (see Closed state) salesman problem, 34,

280, 313

Stochastic matrix, 425


Stochastic

program-digraph, independen

Stochastic system, 425


Stochastically

48 cen ters in a, 45 central, 60


binary,
decision,

41

probabilities, 427

Stopvertex,
Structural

441 439 of program, 202, 203, 222,312

diameter of, 48 in digraphs, 206-211

Storage requirement Strongly connected,


isomers,

external free, 48)))

path

length

of,

51

family, 41

53)

SUBJECT

INDEX

473)

Vertex,
height
la

1
of, 7 of, 46

of, 50 beled, 54
of, 238 51

closing, 410
degree

null, 39
number

eccen tricity end, 9

ordered, 209
pa th length of, radius of, 48

even, 22
forbidden,

288

Vertex, internal,

fusion of,
20

28

rooted, 48

intermediate,

sorting (seeDecision
shortest-distance,

tree)

49
8

294

isolated,

spanning, 55
unlabeled,54

label of, 15 level of, 49

Tree

admittance
60 379
pairs,

Treegraph,
Tree
True

product, 366

merged (see Vertex, odd, 22 9, 43, 196 pendant,

fusion

00

Tree-felling
vertices,

procedure, 280
350
, 108

reference, 141
starting,

410

Tutte's map-constructionmethod Two-connected graphs, 83

Vertex
Vertex

coloring, 165-169,187 connectivity, 75, 78


graph,

Two-chromaticgraph,
Two-isomorphic
Two-person

166-167

Vertex cover, 193


Vertex

graphs, games, 409

1'04, 143, 336


334

9 (see

also Null
17
matrix

graph)

Vertex-disjoint

subgraphs,

Two-terminal contact
Two-tree,
368)

network,

Vertex-edgeincidence

(see

Incidence matrix) Vertex-labeting process, 390 Violation in ranking, 229


Vulnerability,

u)

77,

284)

Unicursal
Unimodular Union Unique Unique

graph,

24

Unicursaltine,

24
matrix,

.w)
214, 380
Walk,

of graphs, 26 code for graph, embedding,

19-21 path and circuit, of, 35

451

closed, 20

98

compared with
different

21

172 Uniquely colorable graphs, Uniqueness of dual graphs, 103


Universal

types

graph,

32
of, 239

open,20
Weigh

directed, 201
t:

Unlabeled graphs, number Utilities problem, 4, 88)

of edge,

61
tree,

of spanning
of subtree,

61

248
248

v)

of vertex,
(see Degree)
120 120-121
in Weighted

Weight matrix, Valency


Vector:

61,273,418
61-63 98, 106

graph, theorem,

complete, 34
Whitney's

definition,

orthogonal, 130
Vector

Windows (see Regions))))


of networks

space,

application

of graph,

analysis 121-122)

, 359

AUTHOR

INDEX)

A)

Boisvert,

van Aardenne-Ehrenfest, J. R., 424 Abrahams,

T., 234

Boothroyd, J., 318


Batt,

M., 424

Aitken, A. C., 162 Al1en, F. E., 448


Amoia,

V., 64 S., 457

Brooks, R. L., 192


deBruijn, Bruno,

R., 225 Bray, T. A., 414 J. G., 354, Bredeson, N. G., J.,

355

Anderson, J., 448


Anderson,

206, 234

11 0

Ash, J.
Auguston,

E., 454

Bryant, P. R.,
Buchanan,

381
454

J. G.,

318

B. G.,

Avondo-Bodino,G.,457)

Busacker, R. G., 11,414)


c)

B)

Baer,

Balk, K. G., 448 T. C., 354 Basili, V. R., 318


Bartee, Battersby,

J. L., 448

D. A., 381 S. H., 354 Cartwright, D., 234


Calahan,
Caldwell, Caughey,

R., 448

Cayley, A.,
Chan,

10,11,52,54,164,238,248,
381 318

A., 414 M., 457 R., 318

Beckenbach, E. F., 265,414


Behzad,

449,456
S. P.,

Beizer, B., 448


Bellman,

Chartrand, G., 457


Chase,

S. M.,

Berge,C., 11,415
Berkowitz,

Bellmore, M., 36 C. P., 110 Benedict,


S., 318

Chen, W. K., 135, 457 Chen, Y. C., 234 Chien, R. T., 86,381
Collins,

448 Berztiss, A. T., 318, Biondi, E., 439 Birkhoff, G., 354)

Cook, S. A.,
Cooke,

N. L., 65 316

Corneil, D. G.,318,319
Cottafava,

K. L., 318
G., 64)))

475)

476

AUTHOR

INDEX)

C (cont.:))

G)

Coverley, G. P., 424 S., 318 Reghizzi, Crespi-

Gardner,
Ghosh,

M., 415
S. N., 424

Ghosh, P. K., 424


Ghouila-Houri, A., 415 N. E., 319 Gibbs,

Cummins, R. L., 65)

D)

Gluck, D. J., 454


Goldman,

J., 135

Dantzig,
Dawson,

G. B., 319 D. F., 381


135

Good, I. G.,204, 234 Gotlieb, C. C., 318, 319


Gould,

Dean, R. A.,
Deo,N.,
Dickson,

36,65, 110,457
D. C.,

Graham, G. D., 319


Grossman,

R.,

135
I., 457 G., 439)

319
292, 319

Dijkstra, E. W., 280, Dimsdale, B.,415


Dirac,

Grundig, P. M., 415


Guardabassi,

G. A.,

36
H)

Dreyfus, S. E., 319)

E)

Hakimi,
Halmos,

Earnest,
Edmonds,

C. P., 448 J., 319


S. E.,

Hamburger,P., 448
Hamilton, Harary,

S. L., P. R.,

36, 354, 355 135 10,30,31,63,

W. R., F.,

165,312

Elias, P. A., 86
Elmaghraby,

11,36,162,234,265,457

415

Harris, Z., 457


Harrison,

Essam, J. W., 457 Estrin, G., 449


Euler,

J. M.,

454
355

L., 3,11,23,96,115,203,210,226

Harrison, M. A., Hart, R., 319


Held,

Even, S., 319)

M., 319

F)

F ary , I.,
Feigenbaum,

93, 110
E. A., 86

454

Henderson, D. A., JI., 320 Herstein, I. N., 135 Hill, F. J., 355 A. M., 110 Hobbs, Hahn, F. E., 162 R. C., 319 Holt,

Feinstein, A.,
Fisher,
Flament,

Hopcroft, J. E., 319

M. E., 457 C., 457

Flores, B., 320 R. W., 297, 319 Floyd,


Frank,

R. A., 439 Howard, Hu, T. C., 65,319,415 D. A., 65, 352, 354, 355 Huffman,
Huggins,

W. H., 439)

H., 415

Fraser, J.
Frazer, Friedman, Frisch,

J., 319
415
265 Iri,M.,415

W. D., 319, 355 D. P., 319, 320 I. T.,

Ford, G. W.,
Ford,
Fulkerson,

L. R.,

86
86, 415)

Isaacson,
Iyer,

J. D., 320

D. R.,

C., 457)))

AUTHOR

INDEX

477)

K)

Mason,
Matula,

Karl,

J., 449
M., 316, P. W.,

S. J., 421, 422, D. W., 320

424 382

Karp, R.
Kasteleyn, Kaufmann,

319, 448 192

Maxwell, Maxwell, Mayberry,

J. C., 356, 366, L. M., 9, 135 J. P., 225

A., 234

Kautz, W. H., 457 J. G.) 439 Kendall, M. G., 234 B. W., 319, 320, 449 Kernighan, H. K., 457 Kesavan, 381 Kim, W. H., 86, 192, King, C. A., 320 Kirchhoff, G., 10, 11,58,223,356,358,
Kemeny,

Mayeda, W., 355,457 M. D., 320 McIlroy,

Medvedev,G. A., 439 Meetham, A. R., 454


Menger,

K., 86 D., 65

Mesztenyi, C. K., 318


Michie,

359,381,383,441 Klee, V., 355


Klein,
M.

Miller, K. S., 135 R. E., 355,448 Miller,

Minker, J., 318


G. J., L., 192

Minty, Mirsky,

M., 415

280, 320, 355

Konig, D., 11
Kreider,

Knoedel, W., 320 D. E., 65, 320, 449 Knuth, H. E., 457 Koenig,
L., 449

Moder, J.
Montalbano,

J., 415
M., 415
W.,

Moon, J.
Morpurgo,
Mulligan,

65,

234

Kruskal, J.
Kuo,

B.J r.,
381

62, 65,

280
341)

R., 318 G. D., 320

Munro, J. I., 320)


N)

F. F.,

Kuratowski,K., 90, 93,100,304,

L)

Lederberg,

J., 454
A., 234

G. L., 36 Norman, R. Z., 234, 320)


Nemhauser,

Lehmer, D. H., 320


Lempel,

o)

Lietzmann, W., 11 Lin, S., 36, 320 C. L., 192 Liu,

Onaga, K., 415

Ore, 0.,
Otter,

Lockett, J. A.,

11,36
249)

318

R.,

Lorens, C. S., 424 T. C., 449 Lowe,


Lynch,

Lukasiewicz,J., 208
M. F., 454)

p)

Palmer,

E. M., 265
E., 439

Parson, T.
M) Parzen,

D., 110

MacLane,
Magnus,

S., 107, W., 457

110, 304

Paton, K., 281,287, 320 R. H., 454 Penny, W. S., 356 Percival,

Marble, G.,
Marimont,

320
R. B., A.,

Perfect, H., 192


Peterson,

Markov,A.
433,437

449 423, 424, 425,

G. R.,

355

431, 432,

Peterson, W. W., 355 Phillips, C. R., 415


Plisch,

Marshall,
Martin,

C. W., 457
D., 449)))

D. C.,

415

Pohl, I., 320)

478

SUBJECT

INDEX)

P (cont.:)

TaDan,R.

287,301,
454

319,321

P61ya, G., 238, 248,250, M., 320 Pratt, T. W., 319, 320 Prim, R. C., 62,65, 280 Prosser, R. T., 449)
Prabhaker,

Tate, F. A.,
257

Tiernan,
Tokad,

J. C., 288, 321

Y., 457

Torres, W. T.,
Town,

319
454

W. G.,

Trent, H. M., 457


Tucker,

A. C., 65

R)

Turner, J., 457 W. T., 36,108,110,225,234,341, Tutte,


M. 0.,

Rabin,

320
449

355)

Ramamoorthy, C. V.,

Reingold, E. M., 319, 320


Rinaldi,

Read, R. C., 192, 265, Reed, M. B., 9, 12, 381 W. C., 318 Reinboldt,
S., 439 J., 424

318,320
Unger,

u)

Uhlenbeck,

G. E., 265

S. H., 321)

Riordan, J., 65
Robert,

Roberts, S. M., 288, 320 L. P. A., 424 Robichaud,

v)

Robinson, R. W., 265 Rosenberg, A. L., 449


Rosenblatt,

Verhoff,

E. W.,

449)

D., 439 w)

Rota, G. C., 135 Rouse Ball, W., 12

Rovner, P. D., 320)


s) Saaty,

Wang, H.,
Warshall,

415
S., 297,

321 Watkins, R. P., 448 Weinberg, L., 110, 321


T. L., 11
G., 457 A., 415, S., 12,
Weinblatt,

H., 321

Sakarovitch,M., 415
Salton,

Welch, J.
Wells,

T. Jr., 321

Saltzer, C., 354, 355


Schurmann,

449

Sepp.aenen,J.
Seshu,

J., 320
381

M. B., 321 Welsh, D. J. A., 355 Whitney, H., 86, 98,106,110,304 V. K. M., 321 Whitney,

Shannon, C. E., 86,328


Shirey,

Wilkov, R.
Williams, Wing,

Wilcox,G. W., 36 S., 192


T. W., 0.,

R. W., 110
439

135

Smith, C. A. B., 36, 415 J. L., 439 Snell,

Sittler, R. W.,

234
M. S., 321)

Witzgall, C., 414


Wolfberg,

Steiglitz, K., 110


Steiner,

J., 313 y) G. L., 454)

Sussenguth, E. H. Jr., 321


Sutherland,

Yen, J.

Y., 321)

T)

Tabourier,
Talbot,

Y., 321

z)

A., 381)

Zykov, A. A.,

457)))

You might also like