You are on page 1of 493
Pete CHETAN TRARY CeO RSA Engineering and Computer Science cr PRENTICE-HALL GRAPH THEORY with Applications to Engineering and Computer Science NARSINGH DEO Computer Science Department Washington State University PRENTICE-HALL, INC. ENGLEWOOD CLIFFS, N.J. Library of Congress Cataloging in Publication Data Deo, Narsinon ‘Graph theory with applications to engineering and computer science. Includes bibliographies. TGraph theory, TAI38.G7D460 SL ISBN 0-13-36347: 73-1566 © 1974 by Prentice-Hall, Inc., Englewood Cliffs, N. J. All rights reserved, No part of this book may be reproduced in any form, by mimeograph or any other means, without permission in writing from the publisher. 020827: Printed in the United States of America PRENTICE-HALL INTERNATIONAL, INC., London PRENTICE-HALL OF AUSTRALIA, PTY. LTD., Sydney PRENTICE-HALL OF CANADA, LTD., Toronto PRENTICE-HALL OF INDIA PRIVATE LiMiTED, New Delhi PRENTICE-HALL OF JAPAN, INC., Tokyo To the memory of my father, who did not live to realize his greatest ambition— that of witnessing his eldest son matriculate. PREFACE CONTENTS 1 INTRODUCTION What isa Graph? I Application of Graphs 3 Finite and Infinite Graphs 6 Incidence and Degree 7 Isolated Vertex, Pendant Vertex, and Null Graph 8 Brief History of Graph Theory 10 Summary 11 References 11 Problems 12 2 PATHS AND CIRCUITS 24 22 23 24 25 2-6 27 28 29 Isomorphism 14 Subgraphs 16 A Puzzle With Multicolored Cubes 17 Walks, Paths, and Circuits 19 Connected Graphs, Disconnected Graphs, and Components Euler Gtaphs 23 Operations On Graphs 26 More on Euler Graphs 28 Hamiltonian Paths and Circuits 30 2-10 The Traveling Salesman Problem 34 Summary 35 References 35 Problems 36 2 xv 14 x CONTENTS 3 TREES AND FUNDAMENTAL CIRCUITS 39 31 Trees 39 3-2 Some Properties of Trees 41 3-3 Pendant Vertices ina Tree 43, 3-4 Distance and Centers ina Tree 45 35 Rooted and Binary Trees 48 3-6 OnCounting Trees 52 3-7. Spanning Trees 55 3-8 Fundamental Circ 37 3-9 Finding All Spanning Trees of aGraph 58 3-10 Spanning Trees ina Weighted Graph 61 Summary 64 References 64 Problems 65 4 CUT-SETS AND CUT-VERTICES 68 4-1 CutSets 68 4-2 Some Properties of a Cut-Set 69 4-3 AllCut-SetsinaGraph 71 4-4 Fundamental Circuits and Cut-Sets 73 4-5 Connectivity and Separability 75, 4-6 Network Flows 79 4-7 1-lsomorphism 80 4-8 2-Isomorphism 82 Summary 85 References 86 Problems 86 5 PLANAR AND DUAL GRAPHS 88 5-1 Combinatorial Vs. Geometric Graphs 88 5-2. Planar Graphs 90 5-3 Kuratowski’s Two Graphs 90 5-4 Different Representations of a Planar Graph 93 5-5 Detection of Planarity 99 5-6 Geometric Dual 102 $-7 Combinatorial Dual 104 5-8 More on Criteria of Planarity 107 5-9 Thickness and Crossings 108 Summary 109 References 110 Problems 110 6 VECTOR SPACES OF A GRAPH 6-1 Sets with One Operation 112 6-2 Sets with Two Operations 116 6-3 Modular Arithmetic and Galois Fields 118 6-4 Vectors and Vector Spaces 120 6-5 Vector Space Associated with aGraph 121 66 Basis Vectors of aGraph 123 6-7 Circuit and Cut-Set Subspaces 125 6-8 Orthogonal Vectors and Spaces 129 6-9 Intersection and Join of Wand Ws 131 Summary 134 References 135 Problems 135 7 MATRIX REPRESENTATION OF GRAPHS 7-1 Incidence Matrix 137 7-2. Submatrices of A(G) 141 7-3. Circuit Matrix 142 7-4 Fundamental Circuit Matrix and Rank of B 7-5 An Application to a Switching Network 146 7-6 Cut-Set Matrix 151 7-7 Relationships among Ay, By, and Cy 153 7-8 Path Matrix 156 7-9 Adjacency Matrix 157 Summary 162 References 162 Problems — 162 8 COLORING, COVERING, AND PARTITIONING 8-1 Chromatic Number 165 8-2 Chromatic Partitioning 169 83 Chromatic Polynomial 174 84 Matchings 177 8-5 Coverings 182 8-6 The Four Color Problem 186 Summary 190 References 190 Problems 192 CONTENTS xi 112 137 165 xii CONTENTS 9 DIRECTED GRAPHS 194 9-1 What Isa Directed Graph? 194 9-2 Some Types of Digraphs 197 9-3 Digraphs and Binary Relations 198 9-4 Directed Paths and Connectedness 201 9-5 Euler Digraphs 203 9-6 Trees with Directed Edges 206 9-7 Fundamental Circuits in Digraphs 212 9-8 Matrices A,B, and C of Digraphs 213 9-9 Adjacency Matrix of a Digraph 220 9-10 Paired Comparisons and Tournaments 227 9-11 Acyclic Digraphs and Decyclization 230 Summary 233 References 234 Problems 234 10 ENUMERATION OF GRAPHS 238 10-1 Types of Enumeration 238 10-2 Counting Labeled Trees 240 10-3. Counting Unlabeled Trees 241 10-4 Pélya’s Counting Theorem 250 10-5 Graph Enumeration With Pélya’s Theorem 260 Summary 264 References 264 Problems 265 GRAPH THEORETIC ALGORITHMS AND ll COMPUTER PROGRAMS 268 Mel 11-2 11-3 1-4 Algorithms 269 Input: Computer Representation of aGraph 270 The Output 273 Some Basic Algorithms 274 Algorithm 1: Connectedness and Components 274 Algorithm 2: A Spanning Tree 277 Algorithm 3: A Set of Fundamental Circuits 280 Algorithm 4: Cut-Vertices and Separability 284 Algorithm 5: Directed Circuits 287 Shortest-Path Algorithms 290 Algorithm 6: Shortest Path from a Specified Vertex to Another Specified Vertex 292 Algorithm 7: Shortest Path between All Pairs of Vertices 297 Depth-First Search on a Graph 301 Algorithm 8: Planarity Testing 304 Algorithm 9: Isomorphism 310 12 13 14 CONTENTS xiii 11-8 Other Graph-Theoretic Algorithms 312 11-9 Performance of Graph-Theoretic Algorithms 314 11-10 Graph-Theoretic Computer Languages 316 Summary 317 References 318 Problems 321 Appendix of Programs 323 GRAPHS IN SWITCHING AND CODING THEORY 12-1 Contact Networks 329 12-2 Analysis of Contact Networks 330 12-3 Synthesis of Contact Networks 334 12-4 Sequential Switching Networks 342 12-5 Unit Cube and Its Graph 348 12-6 Graphs in Coding Theory 351 Summary 354 References 354 ELECTRICAL NETWORK ANALYSIS BY GRAPH THEORY 13-1 What Is an Electrical Network? 357 13-2. Kirchhoff’s Current and Voltage Laws 358 13-3 Loop Currents and Node Voltages 359 13-4 RLC Networks with Independent Sources: Nodal Analysis 13-5 RLC Networks with Independent Sources: Loop Analysis 13-6 General Lumped, Linear, Fixed Networks 373 Summary 379 References 381 Problems 381 GRAPH THEORY IN OPERATIONS RESEARCH 14-1 Transport Networks 384 14-2 Extensions of Max-Flow Min-Cut Theorem 390 14-3. Minimal Cost Flows 393 14-4 The Multicommodity Flow 395 14-5 Further Applications 396 14-6 More on Flow Problems 397 14-7 Activity Networks in Project Planning 400 14-8 Analysis of an Activity Network 402 14-9 Further Comments on Activity Networks 408 14-10 Graphs in Game Theory 409 Summary 414 References 414 328 356 362 311 384 xiv. CONTENTS 15 SURVEY OF OTHER APPLICATIONS 15-1 15-2 15-3 15-4 15-5 Appendix A Appendix B INDEX Signal-Flow Graphs 416 Graphs in Markov Processes 424 Graphs in Computer Programming 439 Graphs in Chemistry 449 Miscellaneous Applications 454 BINET-CAUCHY THEOREM NULLITY OF A MATRIX AND SYLVESTER’S LAW a6 458 460 463 PREFACE The last two decades have witnessed an upsurge of interest and activity in graph theory, particularly among applied mathematicians and engineers. Clear evidence of this is to be found in an unprecedented growth in the number of papers and books being published in the field. In 1957 there was exactly one book on the subject (namely, Kénig’s Théorie der Endlichen und Unendlichen Graphen). Now, sixteen years later, there are over two dozen textbooks on graph theory, and almost an equal number of proceedings of various seminars and conferences. Each book has its own strength and points of emphasis, depending on the axe (or the pen) the author has to grind. | have emphasized the com- putational and algorithmic aspects of graphs. This emphasis arises from the experience and conviction that whenever graph theory is applied to solving any practical problem (be it in electrical network analysis, in circuit layout, in data structures, in operations research, or in social sciences), it almost always leads to large graphs—graphs that are virtually impossible to analyze without the aid of the computer. An engineer often finds that those real-life problems that can be modeled into graphs small enough to be worked on by hand are also small enough to be solved by means other than graph theory. (In this respect graph theory is different from college algebra, elementary calculus, or complex variables.) In fact, the high-speed digital computer is one of the reasons for the recent growth of interest in graph theory. Convinced that a student of applied graph theory must learn to enlist the help of a digital computer for handling large graphs, I have emphasized algorithms and their efficiencies. In proving theorems, constructive proofs have been given preference over nonconstructive existence proofs. Chapter 11, the largest in the book, is devoted entirely to computational aspects of graph theory, including graph-theoretic algorithms and samples of several tested computer programs for solving problems on graphs. I believe this xv xvi PREFACE approach has not been used in any of the earlier books on graph theory. The material covered in Chapter I| and in many sections from other chapters is appearing for the first time in any textbook. Yet the applied and algorithmic aspect of this book has not been allowed to spoil the rigor and mathematical elegance of graph theory. Indeed, the book contains enough material for a course in “pure” graph theory. The book has been made as much self-contained as was possible. The level of presentation is appropriate for advanced undergraduate and first-year graduate students in all disciplines requiring graph theory. The book is organized so that the first half (Chapters | through 9) serves as essential and introductory material on graph theory. This portion requires no special background, except some clementary concepts from set theory and matrix algebra and, of course, a certain amount of mathematical matu- rity. Although the illustrations of applications are interwoven with the theory even in this portion, the examples selected are short and mostly of the nature of puzzles and games. This is done so that a student in almost any field can read and grasp the first half. The second half of the book is more advanced, and different chapters require different backgrounds as they deal with applications to nontrivial, real-world, complex problems in different fields. Keeping this in mind, Chapters 10 through 15 have been made independent of each other. One could study a later chapter without going through the earlier ones, provided the first nine chapters have been covered. Since there is more material here than what can be covered in a one- semester course, it is suggested that the contents be tailored to suit the requirements of the students in different disciplines, for example: 1. Electrical Engineering: Chapters 1-9, and 11, 12, and 13. 2. Computer Science: Chapters 1-9, 11, 12, and parts of 10 and 15. 3. Operations Research: Chapters 1-9, and 11, 14, and parts of 15. 4. Applied Mathematics: Chapters I-11 and parts of 15. 5. Introductory “pure” graph theory: Chapters 1-10. In fact, the book grew out of a number of such courses and lecture-series given by the author at the Jet Propulsion Laboratory, California State University at Los Angeles, the Indian Institute of Technology at Kanpur, and the University of Illinois at Urbana-Champaign. ACKNOWLEDGMENTS It is a pleasure to acknowledge the help I have received from different individuals and institutions. I am particularly indebted to Mr. David K. Rubin, a dear friend and former colleague at the Jet Propulsion Laboratory; Mr. Mateti Prabhaker, a former graduate student of mine at the Indian PREFACE — xvii Institute of Technology, Kanpur; and Professor Jurg Nievergelt of the University of Illinois at Urbana-Champaign for having read the entire manuscript and made numerous suggestions for improvements throughout the book. Other friends, colleagues, and students who read parts of the manuscript and made helpful suggestions are: Professor Harry Lass and Mr. Marvin Perlman of the Jet Propulsion Laboratory, Professor Nandlal Jhunjhunwala of California State University at Los Angeles, Dr. George Shuraym of Texas Instruments, Mr. Jean A. DeBeule of Xerox Data Systems, Mr. Nicholas Karpov of Bell & Howell, Professor C. L. Liu of the University of Illinois at Urbana-Champaign, Messrs. M. S. Krishnamoorthy, K. G. Ramakrishnan, and Professors C. R. Muthukrishnan and S. K. Basu of the Indian Institute of Technology at Kanpur. Lam also grateful to the late Professor George E. Forsythe of Stanford University for his encouragement at the very outset of this project. Support in writing this book was received from the Jet Propulsion Laboratory, the Indian Institute of Technology at Kanpur, and the Com- puter Science Department of the University of Illinois at Urbana-Champaign. Just as one does not thank himself, expressing gratitude to one’s wife in public is not a Hindu custom. For the wife is considered a part of the hus- band, and her coauthorship is tacitly assumed in any book her husband writes. There is little doubt that without Kiran’s help this book would not have been possible. NARSINGH DEO Kanpur 1 INTRODUCTION 1-1, WHAT IS A GRAPH? A lineart graph (or simply a graph) G = (V, E) consists of a set of objects V ={v,, v,,...} called vertices, and another set E = {e,, €,,...}, whose elements are called edges, such that each edge e, is identified with an unorder- ed pair (v,, v,) of vertices. The vertices v,, v, associated with edge e, are called the end vertices of e,. The most common representation of a graph is by means of a diagram, in which the vertices are represented as points and each edge as a line segment joining its end vertices. Often this diagram itself is referred to as the graph. The object shown in Fig. 1-1, for instance, is a graph. Observe that this definition permits an edge to be associated with a vertex pair (v, ¥,). Such an edge having the same vertex as both its end ver- tices is called a self-loop (or simply a loop. The word loop, however, has a different meaning in electrical network theory; we shall therefore use the term self-loop to avoid confusion). Edge e, in Fig. 1-1 is a self-loop. Also note that Fig. 1-1 Graph with five vertices and seven edges. +The adjective “linear” is dropped as redundant in our discussions, because by a graph we always mean a linear graph. There is no such thing as a nonlinear graph. 1 2 INTRODUCTION cHap. 1 the definition allows more than one edge associated with a given pair of vertices, for example, edges e, and e, in Fig. 1-1. Such edges are referred to as parallel edges. A graph that has neither self-loops nor parallel edges is called a simple graph. In some graph-theory literature, a graph is defined to be only a simple graph, but in most engineering applications it is necessary that parallel edges and self-loops be allowed; this is why our definition includes graphs with self- loops and/or parallel edges. Some authors use the term general graph to emphasize that parallel edges and self-loops are allowed. It should also be noted that, in drawing a graph, it is immaterial whether the lines are drawn straight or curved, long or short: what is important is the incidence between the edges and vertices. For example, the two graphs drawn in Figs. 1-2(a) and (b) are the same, because incidence between edges and vertices is the same in both cases. Fig. 1-2. Same graph drawn differently. In a diagram of a graph, sometimes two edges may seem to intersect at a point that does not represent a vertex, for example, edges ¢ and fin Fig. 1-3. Such edges should be thought of as being in different planes and thus having no common point. (Some authors break one of the two edges at such a crossing to emphasize this fact.) a d| b caw Fig.1-3. Edgeseand f havenocommon © point. sec, 1-2 APPLICATIONS OF GRAPHS 3 A graph is also called a linear complex, a I-complex, or a one-dimensional complex. A vertex is also referred to as a node, a junction, a point, 0-cell, or an O-simplex. Other terms used for an edge are a branch, a line, an element, a I-cell, an arc, and a 1-simplex. In this book we shall generally use the terms graph, vertex, and edge. 1-2, APPLICATIONS OF GRAPHS Because of its inherent simplicity, graph theory has a very wide range of applications in engineering, in physical, social, and biological sciences, in linguistics, and in numerous other areas. A graph can be used to represent almost any physical situation involving discrete objects and a relationship among them. The following are four examples from among hundreds of such applications. Kénigsberg Bridge Problem: The Kénigsberg bridge problem is perhaps the best-known example 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 theory and thus became the origina- tor of the theory of graphs as well as of the rest of topology. The problem is depicted in Fig. 1-4. Two islands, C and D, formed by the Pregel River in Kénigsberg (then the capital of East Prussia but now renamed Kaliningrad and in West Soviet Russia) were connected to each other and to the banks A and B with seven bridges, as shown in Fig. 1-4. The problem was to start at any of the four land areas of the city, A, B, C, or D, walk over each of the seven bridges exactly once, and return to the starting point (without swimming across the river, of course), Euler represented this situation by means of a graph, as shown in Fig. 1-5. The vertices represent the land areas and the edges represent the bridges. ‘As we shall see in Chapter 2, Euler proved that a solution for this problem does not exist. A % A = Fig. 1-4 Kénigsberg bridge problem.

You might also like