NET THEORY AND
ITS
APPLICATIONS FLOWS
1 N • N E T W O R KS
Wai-Kai Chen
Imperial College ib-J'-fi
NET THEORY A N D ITS
APPLICATIONS FLOWS
IN
NETWORKS
This page is intentionally left blank
SERIES IN C O M P U T E R
ELECTRICAL AND E N G I N E E R I N G
NET THEORY A N D ITS
APPLICATIONS FLOWS
IN
NETWORKS
Wai-Kai Chen University of Illinois, Chicago
Published by Imperial College Press 57 Shelton Street Covent Garden London WC2H 9HE Distributed by World Scientific Publishing Co. Pte. Ltd. 5 Toh Tuck Link, Singapore 596224 USA office: Suite 202, 1060 Main Street, River Edge, NJ 07661 UK office: 57 Shelton Street, Covent Garden, London WC2H 9HE
British Library Cataloguing-in-Publication Data A catalogue record for this book is available from the British Library.
NET THEORY AND ITS APPLICATIONS Flows in Networks Series in Electrical and Computer Engineering — Vol. 1 Copyright © 2003 by Imperial College Press All rights reserved. This book, or parts thereof, may not be reproduced in any form or by any means, electronic or mechanical, including photocopying, recording or any information storage and retrieval system now known or to be invented, without written permission from the Publisher.
For photocopying of material in this volume, please pay a copying fee through the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, USA. In this case permission to photocopy is not required from the publisher.
ISBN 1-86094-226-1
Printed in Singapore by World Scientific Printers (S) Pte Ltd
PREFACE
Flow net theory has developed considerably since beginning in the 1950's. It has been used widely in electrical engineering, computer science, social science, and in the solution of economic problems. The fact is that any system involving a binary relation can be represented by a network. The book presents a unified treatment of the fundamental theory of networks such as the telephone network, the pipeline network, the power grid, and the airline network involving the communication, transmission, transportation, flow, or movement of commodities through a network. It discusses the underlying problems, properties common to all these networks, and techniques for their solution. The guiding principle throughout the book has been mathematical precision. Thus, nearly all the assertions are rigorously proved; many of these proofs are believed to be new and novel. Furthermore, algorithms that are computationally efficient are included. All basic concepts are defined and many examples are included to illustrate them. Hence, no prior background in networks is required. There are eight chapters in the book. Chapter 1 establishes the basic vocabulary for describing graphs and networks and provides a number of results that are needed in the subsequent analysis. Thus, the reader is urged to study the convention of this chapter carefully before proceeding to the other chapters. Chapter 2 gives a fairly complete exposition of the shortest directed path problem. Chapter 3 studies the problem of maximizing flow from one point to another in a capacity-constrained network. From our viewpoint, this is the most fundamental problem dealt with in the book. v
vi
PREFACE
Its solution provides answers to many other feasibility and combinatorial questions. Chapter 4 considers the minimum tree problem and extends the terminal pair flow to multiterminal flow. The applications of the flow theorems to feasibility and subgraph problems are taken up in Chapters 5 and 6. Chapter 7 discusses the basic relationships between determinant and the cofactors and the corresponding subgraphs in the associated signal-flow graphs, and their application to the solutions of a system of simultaneous linear algebraic equations. Finally, Chapter 8 presents other useful net applications such as the switching nets, the matching problem and the hybrid electrical network analysis. The material presented in the book has been classroom-tested at the University of Illinois at Chicago for the past dozen years. There is little difficulty in fitting the book into a one-semester course. For example, the Chapters 1-5 and 7 contain material suitable for a one-semester course, whereas the first four chapters are suitable for a one-quarter course. The presentation and organization of the book are such that it is also suitable for individual study by practicing engineers and computer scientists. Since the publication of the early edition, many people have been kind enough to give me the benefit of their comments and suggestions, often at the expense of a very considerable amount of their time and energy. I wish to thank them all. Finally, I express my appreciation to my wife, Shiao-Ling, for her patience and understanding during the preparation of the book. WAI-KAI CHEN
Fremont, California August 1, 2002
CONTENTS
Preface
v
1 Graphs and Networks
1
1.1 1.2 1.3 1.4 1.5 1.6 1.7
Basic Definitions of Abstract Graphs, 1 Operations on Graphs, 10 Nonseparable Graphs and Bipartite Graphs, 14 Planar Graphs, 18 Dual Graphs, 36 2-Isomorphism, 48 Matrices Associated with a Graph, 52 1.7.1 Incidence Matrix, 53 1.7.2 Circuit Matrix, 57 1.7.3 Cut Matrix, 63 1.7.4 Interrelationships Among the Matrices A, Bf and Qf, 70 1.7.5 Node-to-Datum Path Matrix, 71 1.8 Directed Graphs, 74 1.8.1 Matrices Associated with a Directed Graph, 81 1.8.2 Interrelationships Among the Matrices, 89 1.8.3 Some Important Classes of Directed Graphs, 91 1.9 The Circuit Matrix Associated with a Planar Graph or Directed Graph, 93 1.10 Summary and Suggested Reading, 96 References, 97 vii
viii
CONTENTS
2 The Shortest Directed Path Problem
99
2.1 2.2
Shortest Directed Paths, 100 Shortest Directed Path Algorithms, 103 2.2.1 Dijkstra Algorithm, 103 2.2.2 Ford-Moore-Bellman Algorithm,113 2.2.3 Yen Algorithm, 122 2.2.4 Ford-Fulkerson Algorithm, 130 2.3 Multiterminal Shortest Directed Paths, 139 2.3.1 Matrix Algorithm, 139 2.3.2 Floyd-Warshall Algorithm, 146 2.4 Enumeration of the Shortest Directed Paths by Decomposition, 153 2.5 Summary and Suggested Reading, 160 References, 162 3 Maximum Flows in Networks
167
3.1 3.2 3.3 3.4
Flows, 167 s-t Cuts, 170 Maximum Flow, 177 Ford-Fulkerson Algorithm, 184 3.4.1 Integrity Theorem, 191 3.4.2 Irrational Arc Capacities, 192 3.5 Layered Nets, 197 3.6 A Blocking Flow Algorithm, 205 3.7 Variants of the Ford-Fulkerson Algorithm, 215 3.7.1 Edmonds-Karp Algorithm, 216 3.7.2 Dinic Algorithm, 220 3.7.3 Other Variations, 221 3.8 Karzanov Algorithm, 223 3.9 Flows in Undirected and Mixed Nets, 229 3.10 Flows in Node-and-Arc Capacitated Nets, 231 3.11 Summary and Suggested Reading, 233 References, 236
4 Minimum Trees and Communication Nets 4.1 4.2 4.3
4.4
Forests, Subtrees and Trees, 241 Minimum and Maximum Trees, 246 Minimum and Maximum Tree Algorithms, 252 4.3.1 Boruvka Algorithm, 254 4.3.2 Kruskal Algorithm, 259 4.3.3 Prim Algorithm, 261 4.3.4 General Remarks, 265 Terminal Capacity Matrix, 266
240
CONTENTS
ix
4.5
Synthesis of a Flow-Equivalent Tree, 275 4.5.1 Gomory-Hu Algorithm, 280 4.5.2 Proof of the Gomory-Hu Algorithm, 290 4.6 Synthesis of Optimum Undirected Communication Nets, 293 4.6.1 Gomory-Hu Procedure, 297 4.6.2 Dominant Row Realization, 303 4.7 Oriented Communication Nets, 308 4.8 Summary and Suggested Reading, 314 References, 315 5 Feasibility Theorems and Their Applications
318
5.1 A Supply-Demand Theorem, 318 5.2 An Extended Supply-Demand Theorem, 335 5.3 Circulation Theorem, 345 5.4 Feasible Circulation Algorithm, 357 5.5 Flows in Nets with Lower Bounds on Arcs, 366 5.6 Feasible Flows in Node-and-Arc Capacitated Nets, 372 5.7 Summary and Suggested Reading, 383 References, 385 6 Applications of Flow Theorems to Subgraph Problems
386
6.1 The Subgraph Problem of a Directed Graph, 386 6.2 Digraphic Sequences, 413 6.3 The Subgraph Problem of a Graph, 432 6.4 Graphical Sequences, 441 6.5 The (p, s)-Matrix, 449 6.6 Realization of the 1-Matrix and the (1, 0)-Matrix, 463 6.7 Minimal Transformations, 469 6.8 Summary and Suggested Reading, 480 References, 482 7 Signal-Flow Graphs 7.1 7.2 7.3 7.4 7.5 7.6 7.7
The Signal-Flow Graph, 485 Topological Evaluation of Determinants, 490 Topological Evaluation of Cofactors, 498 Topological Solutions of Linear Algebraic Equations, 502 Equivalence and Transformation, 508 7.5.1 Elimination of Nodes, 509 7.5.2 Inversion, 518 The Matrix Inversion, 522 Signal-Flow Graph Formulation of Feedback Amplifier Theory, 525
484
x
CONTENTS
7.7.1 Ideal Feedback Model, 525 7.7.2 Signal-Flow Graph Formulation of Single-Loop Feedback Amplifier Theory, 528 7.7.3 Noise and Feedback, 534 7.8 Matrix Signal-Flow Graph, 536 7.8.1 Basic Reduction Rules, 538 7.8.2 Topological Procedure, 543 7.9 The Multiple-Loop Feedback Amplifier Theory, 545 7.9.1 The Return Difference Matrix, 551 7.9.2 The Null Return Difference Matrix, 553 7.9.3 The Transfer-Function Matrix and Feedback, 556 7.10 Summary and Suggested Reading, 562 References, 564 8 Other Net Applications
566
8.1
Boolean Matrices and Switching Nets, 567 8.1.1 Boolean Matrices, 567 8.1.2 Switching Matrices and Matrices Associated with Combinational Circuits, 573 8.1.3 The Analysis and Synthesis of Combinational Circuits, 575 8.2 Tellegen's Theorem, 579 8.3 Generalized Signal-Flow Graphs, 586 8.3.1 Generalized Signal Flow Graph and Tellegen's Theorem, 587 8.3.2 Operators for Two Isomorphic Signal-Flow Graph, 590 8.3.3 Operators for Two Non-Isomorphic Signal-Flow Graph, 597 8.3.4 Applications of the SFG Operator, 601 8.4 Permutations by Spaghetti Amida, 611 8.4.1 Spaghetti Amida with Undirected Bridges, 613 8.4.2 Spaghetti Amida with Directed Bridges, 615 8.5 The Amida Graph, 618 8.6 Graph Decomposition and Hybrid Analysis of Electrical Networks, 621 8.6.1 Topological Degree of Freedom, 625 8.6.2 Second Topological Degree of Freedom, 632 8.6.3 Central Tree, 634 8.7 Summary and Suggested Reading, 638 References, 639
Index
645
1 GRAPHS AND NETWORKS
Many physical networks such as the telephone network, the pipeline network, the power grid, and the airline network involving the communication, transmission, transportation, flow, or the movement of commodities through a network can be modeled by an intuitive diagrammatic representation called a graph. The graphs that we are about to discuss are simple geometrical figures consisting of nodes or points and edges or lines that connect some of these nodes. They are sometimes called linear graphs. The purpose of this chapter is to establish the basic vocabulary for describing graphs and provide a number of basic results that are needed in the subsequent analysis.
1.1
BASIC DEFINITIONS OF ABSTRACT GRAPHS
An abstract graph G(V, E) or simply a graph G consists of a set V of elements called nodes and a set E of unordered pairs of the form (i, j) or (/, i), i,jeV, called edges. Other names commonly used for a node are vertex, point, junction, 0-simplex, O-cell, and element; and for an edge line, branch, arc, 1-simplex, and element. We say that the edge (/', /) is connected between the nodes i and j , and that (i, j) is incident with the nodes i and j , or conversely that i and / are incident with (i, j). In applications, a graph is usually represented equivalently by a geometric diagram in which the nodes are indicated by small circles or dots, while any two of them, i and /, are joined by a continuous curve, or even a straight line, between i a n d / , if and only if (i, j) is in E. In many situations, it is convenient to permit a pair of nodes to be 1
2
GRAPHS AND NETWORKS
connected by several distinct edges called parallel edges. The parallel edges between the nodes i and /" are denoted by the symbols (i> j)i> (iy j)i> • • •> 0> j)k> k = 2. If no particular edge is specified, the symbol (i, j) is used to denote any one of them connected between / and j . Nodes i and / are called the endpoints of (i,j). We also admit edges for which the two endpoints are identical. Such an edge (i, i) is called a self-loop. If there are two or more self-loops at a node, they are also referred to as the parallel edges. In a geometric diagram, the parallel edges may be represented by continuous lines connected between the same pair of nodes, and a self-loop (i, i) may be introduced as a circular arc returning to the node i and passing through no other nodes. As an example, consider the graph G(V, E) in which V = {1, 2, 3, 4, 5, 6, 7, 8}
(1.1)
E = {(1, 2), (3, 4), (3, 5), (3, 6), (4, 5), (4, 6) 1 ; (4, 6) 2 , (3, 3)i, (3, 3) 2 , (6, 6), (7, 8)„ (7, 8) 2 , (7, 8)3}
(1.2)
The corresponding geometric graph is shown in Fig. 1.1, in which there is a self-loop at node 6, two self-loops at node 3, two parallel edges between nodes 4 and 6, and three parallel edges between nodes 7 and 8. We emphasize that in a graph the order of the nodes i and /' in (/, j) is immaterial. We consider (i, j) = (j, i), e.g. (1,2) = (2,1) and (7,8)i = (8,7)!. A graph G(V, E) is said to be finite if both V and E are finite sets. In this book, we deal only with finite graphs. Infinite graphs have some very interesting properties. For interested readers, we refer to Konig (1950) and Ore (1962). A subgraph of a graph G(V, E) is a graph Gs(Vs, Es) in which Vs and Es are subsets of V and E, respectively. If Vs or Es is a proper subset, the subgraph is called a proper subgraph. If Vs = V, the subgraph is said to be a
Fig. 1.1. The geometric representation of an abstract graph.
1.1 BASIC DEFINITIONS OF ABSTRACT GRAPHS
3
/ Fig. 1.2(a). A subgraph of the graph in Fig. 1.1 containing an isolated node, node 5.
Fig. 1.2(b). A spanning subgraph of the graph of Fig. 1.1. spanning subgraph of G. If Vs or Es is empty, the subgraph is the null graph and is denoted by the symbol 0 . The null graph is considered as a subgraph of every graph. An isolated node is a node not incident with any edge. Some examples of subgraphs of the graph of Fig. 1.1 are presented in Fig. 1.2. Fig. 1.2(a) is a subgraph containing an isolated node 5, and Fig. 1.2(b) is a spanning subgraph since it contains all the nodes of the given graph. Both subgraphs in Fig. 1.2 are examples of proper subgraphs. We say that two subgraphs are edge-disjoint if they have no edges in common, and node-disjoint if they have no nodes in common. Thus, two subgraphs are node-disjoint only if they are edge-disjoint, but the converse is not always true. For our purposes, a subgraph will be represented by the juxtaposition of its edges if it does not contain any isolated nodes. For example, in Fig. 1.1 the subgraphs G, = (1, 2)(3, 3M3, 6)(6, 6)
(1.3a)
G2 = (4,5)(7,8M7,8) 2
(1.3ft)
as shown in Fig. 1.3 are node-disjoint, and thus they are also edge-disjoint. On the other hand, the subgraphs of Figs. 1.2(a) and 1.3(b) are edgedisjoint but they are not node-disjoint. In a graph G we say that the nodes i and / are adjacent if (i, j) is an edge of G. All the nodes adjacent to a node i are the neighboring nodes of i. If Gs
4
GRAPHS AND NETWORKS
0
9
/
©
©
M
0
Fig. 1.3. Two node-disjoint subgraphs of the graph of Fig. 1.1: (a) Gx; (b) G2. is a subgraph of G, by the complement Gs of Gs in G we mean the subgraph of G consisting of all the edges Es that do not belong to Gs and all the nodes of G except those that are in Gs but not in Es. Clearly, Gs and Gs are edge-disjoint but not necessarily node-disjoint, and their node sets may not be complementary. Thus, the complement of the null graph in G is the graph G itself, and the complement of G in G is the null graph. We say that Gs and Gs are the complementary subgraphs of G. For example, the subgraphs shown in Fig. 1.4 are complementary subgraphs of the graph of Fig. 1.1. In the above discussion, we indicated that a graph can be represented by a geometric diagram. However, in drawing the diagram, we have a great deal of freedom in the choice of the location of the nodes and in the form of the lines joining them. This may make the diagrams of the same graph look entirely different. In such situations we would like to have a precise way of saying that two graph diagrams are really the same even though they are drawn or labeled differently. The following term provides the necessary terminology for this purpose.
DEFINITION 1.1 Isomorphism. Two graphs Gx and G2 are said to be isomorphic, written as G1 = G2, if there exists a one-to-one correspondence between the elements of their node sets and a one-to-one correspondence between the elements of their edge sets and such that the corresponding edges are incident with the corresponding nodes.
1.1 BASIC DEFINITIONS OF ABSTRACT GRAPHS
5
Fig. 1.4. Two complementary subgraphs of the graph of Fig. 1.1.
Thus, in two isomorphic graphs the corresponding nodes are connected by the edges in one if and only if they are also connected by the same number of edges in the other. The definition places two requirements on isomorphism of two graphs. First, they must have the same number of nodes and edges. Second, the incidence relationships must be preserved. The latter is usually difficult to establish. The two graphs Gi(V\, EY) and G2(V2, E2) shown in Fig. 1.5 look quite different, but they are isomorphic. The isomorphism of these two graphs
6
GRAPHS AND NETWORKS
Fig. 1.6. Two nonisomorphic graphs. can be established by considering the nodes i e Vx and i' eV2 (i = 1, 2, 3, 4, 5, 6) to be the corresponding elements of their node sets. It is straightforward to verify that the corresponding edges are incident with the corresponding nodes. In other words, the incidence relationships are preserved. However, the two graphs of Fig. 1.6 are not isomorphic even though there exists a one-to-one correspondence between their node sets which preserves adjacency. A labeled graph is a graph in which the nodes or edges of the graph are properly labeled. In this book, the terms graph and labeled graph are used as synonyms. The graphs that we have witnessed so far are all labeled graphs, the nodes being labeled by the integers 1 , 2 , . . . , or 1 ' , 2 ' , . . . . A weighted graph is a graph in which either the edges or the nodes or both are assigned weights. The graph of Fig. 1.7 is an example of a labeled weighted graph, where the nodes are labeled by the integers 1, 2, 3, 4, 5 and the edges are assigned weights which may represent, for example, distances between the nodes. DEFINITION 1.2 Edge Sequence. An edge sequence of length k — 1 in a graph G is a finite sequence of edges of the form Oi, i2), (h, h), • • • , (ik-i,
4)
Fig. 1.7. A labeled weighted graph.
(1-4)
1.1
BASIC DEFINITIONS OF ABSTRACT GRAPHS
7
k ^ 2 , in G. The edge sequence is said to be closed if i\ = ik, and open otherwise. In an open edge sequence, the node ix is called the initial node, and the node ik is the terminal node; together they are called the endpoints. All the other nodes are the internal nodes. In an edge sequence, not all the nodes are necessarily distinct and the same edge may appear several times. In Fig. 1.7, for example, the sequence of edges (1, 2), (2,4), (4, 2), (2, 3), (3, 5), (5, 3), (3, 4)
(1.5)
is an open edge sequence of length 7. Node 1 is the initial node and node 4 is the terminal node of the edge sequence. Likewise, the edge sequence (5, 2), (2,4), (4, 3), (3,4), (4,1), (1, 5)
(1.6)
is a closed edge sequence of length 6. We say that the edge sequence (1.4) is connected between its initial and terminal nodes or between the nodes ^ and ik, and that for k > 2 , (i x _i, ix) and (ix, ix+i), Kx
DEFINITION 1.3 Edge Train. If all the edges appearing in an edge sequence are distinct, the edge sequence is called an edge train. Thus, an edge train can go through a node more than once but cannot retrace parts of itself, as an edge sequence can. An example of an edge train in Fig. 1.7 is given by (1,2), (2, 4), (4, 3), (3, 5), (5,4)
(1.7)
The edge train is open and is of length 5. If, in addition, all the nodes in an edge train are distinct except the initial and the terminal nodes, we have the usual concepts of a path and a circuit.
DEFINITION 1.4 Path. An open edge train as shown in (1.4) is called a path of length Ac — 1 if all the nodes ix, i2, . . . , ik are distinct. An isolated node is considered as a path of zero length.
DEFINITION 1.5 Circuit. A closed edge train as shown in (1.4) is called a circuit of length k — 1 if /j = ik and all the nodes i'i, i2, . . . , ik-\ are distinct.
8
GRAPHS AND NETWORKS
Therefore, a self-loop is a circuit of length 1. In the literature, the term circuit is also frequently referred to as a cycle or loop. In Fig. 1.7, the open edge train (1,2), (2,4), (4, 5), (5,3)
(1.8)
is a path of length 4, and the closed edge train (1,2), (2,4), (4, 5), (5,3), (3,1)
(1.9)
is a circuit of length 5.
DEFINITION 1.6 Connectedness. A graph is said to be connected if there is a path between every pair of its nodes. Intuitively speaking, a graph is connected if it has only one piece. The graphs in Figs. 1.5(a), 1.5(b) and 1.7 are examples of connected graphs, and the one shown in Fig. 1.1 is not connected.
DEFINITION 1.7 Component. A component of a graph is a connected subgraph containing the maximal number of edges. An isolated node is a component. As a result, if components. One isolated node. For one of which is an
a graph is not connected it must contain a number of or many of these components may each consist of an example, in Fig. 1.2(a) the graph has three components, isolated node.
DEFINITION 1.8 Rank. The rank r of a graph with n nodes and c components is defined as the number r = n — c. The rank of the null graph is zero.
DEFINITION 1.9 Nullity. The nullity m of a graph with b edges, n nodes, and c components is defined as the number m = b —n + c (=b — r). The nullity of the null graph is zero. Rank and nullity are two numbers that are frequently encountered in graph theory. The term nullity is also known by the names of circuit rank,
1.1 BASIC DEFINITIONS OF ABSTRACT GRAPHS
9
cyclomatic number, cycle rank, connectivity, and first Betti number. We notice that all these numbers are nonnegative, as can be seen from the following theorem. THEOREM 1.1 The rank and nullity of a graph are both nonnegative. A graph is of nullity 0 if and only if it contains no circuits, and is of nullity 1 if and only if it contains a single circuit. It is straightforward to verify that the rank and nullity of an unconnected graph are simply the sums of the ranks and nullities of its components, respectively. DEFINITION 1.10 Degree. The degree of a node i of a graph, denoted by d(i), is the number of edges incident with the node i. Thus, an isolated node is a node of zero degree. Because each edge is incident with two nodes, it contributes 2 to the sum of the degrees of the nodes, giving n
JJd{i) = 2b
(1.10)
THEOREM 1.2 The sum of the degrees of the nodes of a graph is twice the number of its edges. If Vt and V2 are the sets of nodes having odd and even degrees of a graph, then the left-hand side of the equation
£ « * ( ' ) - 2 <*(/)= 2 d{k) is always even. This establishes the following result. COROLLARY 1.1 The number of nodes of odd degree of a graph is always even.
(i.ii)
10
GRAPHS AND NETWORKS
Fig. 1.8. A graph used to illustrate rank, nullity, and degree.
The graph G of Fig. 1.8 is of rank 5 ( = 7 - 2 ) and of nullity 6 (=11 — 7 + 2). The degrees of its nodes are given as follows: d(\) = 2,
d(2) = 2,
d(5) = 3,
d(6) = 3,
d(3) = 2, rf(7)
d(4) = 6,
=4
(1.12)
showing that 7
2 d(i) = 2 + 2 + 2 + 6 + 3 + 3 + 4 = 22 = 2 x 1 1
(1.13)
1=1
The nodes of odd degree are nodes 5 and 6, confirming that the number of nodes of odd degree is even, being 2.
1.2 OPERATIONS ON GRAPHS In this section, we define a number of operations on graphs that are useful in expressing the structure of a given graph in terms of smaller or simpler graphs. We already have introduced the notion of the complement of a subgraph. By the removal of a node i from a graph G we mean the operation that results in the subgraph consisting of all the nodes of G except i and all the edges not incident with i. In other words, it is the subgraph containing all the nodes and edges not incident with i. Likewise, the removal of an edge (i, j) from G yields the subgraph containing all the nodes and edges of G except the edge (i, j). The removal of a set of nodes or edges is a series of operations that remove the single elements of the set in succession. Four set-theoretic binary operations union, intersection, difference, and ring sum represented by U, D, —, and ©, respectively, will be defined. They are used in two slightly different contexts. For example, if 5X and 52 are two sets, then 5! U 52 denotes the set consisting of all the elements which
1.2 OPERATIONS ON GRAPHS
11
(a)
Fig. 1.9. Two subgraphs of the graph G of Fig. 1.8: (a) G,; (b) G2.
are either in S1 or in S2 or in both. If Gi(Vu £ t ) and G2(V2, E2) are two subgraphs of a graph G(V, E), then Gx U G2 represents the subgraph of G with node set V, U V2 and edge set E^U E2. The set 5X U S2 is the set union of 5, and S2, whereas G t U G2 is called the sum graph of Gx and G2Likewise, the intersection Sx f) S2 of Si and S2 is the set consisting of all the elements which are in both 5 t and S2. The intersection graph G t D G2 of Gi and G2 is the subgraph of G with the node set V, n V2 and the edge set Ei n E2. Clearly, these operations can be extended to an arbitrary family of subgraphs. Two subgraphs Gi and G2 of the graph G of Fig. 1.8 are shown in Fig. 1.9. The sum graph Gj U G2 of Gj and G2 is presented in Fig. 1.10, whereas the intersection graph G t D G2 is as indicated in Fig. 1.11. The difference 5, — 5 2 of the sets 5, and 5 2 is the set consisting of all the elements that are in Sx but not in 5 2 . The ring sum Sx © S2 of the sets 5\ and S2 is the set consisting of all the elements that are either in 5, or in S2 but not in both. The ring sum is also known as the symmetric difference, because it is the difference between the union and intersection of Si and S2: Si © S2 = (5, U S2) - (5, n 52) For example, the ring sum of the sets St = {a, b, c, d, e,f}
(1.14) and S2 =
12
GRAPHS AND NETWORKS
Fig. 1.10. The sum graph G, U G2 of the subgraphs of Fig. 1.9.
{a, c, e, h} is given by 5 1 © S 2 = {fe,d,/,/ I }
(1.15)
Si-S2 = {6,d,/}
(1.16a)
S 2 - S J = {/I}
(1.166)
and their differences are
Observe that the order in performing the difference operation is important. Likewise, if Gx and G2 are two subgraphs of G not containing any isolated nodes, then by G t — G2 we mean the subgraph consisting of all the edges of G t that are not in G2, and Gt © G2 is the subgraph consisting of all the edges that are either in G t or in G2 but not in both. In particular, we have G1®0
= 0<£>G1 = G1
(1.17)
Consider, for example, two subgraphs Gx and G2 of the labeled graph G of Fig. 1.8. The subgraphs are denoted by the juxtaposition of their edge labels
J®
~
©
^
d Fig. 1.11. The intersection graph G, f~l G2 of the subgraphs of Fig. 1.9.
1.2 OPERATIONS ON GRAPHS
13
as d = e1e2e3e4e6e1o G2 = e2e3e6e7esen
(1.18a) (1.186)
d - G2 = eie2e3e4e6e10 - e 2 e 3 e 6 e 7 e 8 e u = eie^io
(1- 19a)
G2-Gl = e2e3e6e7esen -eie 2 e 3 e 4 e 6 e 10 = e7eseu
(1.196)
d © G2 = G2 © Gx = e1e4e7e8e10e11
(1.19c)
giving
We emphasize that the difference and ring-sum operations of two subgraphs are denned only for those subgraphs containing no isolated nodes. In terms of the difference operation, the removal of an edge e, from a graph G is equivalent to the operation G — et, which may involve an ambiguity of an isolated node. THEOREM 1.3 The ring sum of two circuits is a circuit or an edge-disjoint union of circuits. THEOREM 1.4 The set of circuits and edge-disjoint unions of circuits of a graph is an abelian group under the ring-sum operation. The proofs of these two theorems are straightforward, and are omitted. Let (i, j) be an edge of a graph G. By shorting the edge (i, j) of G we mean the operation that first removes the edge (i, j) and then identifies the nodes i and j in the resulting graph. The operation may result in additional self-loops. In particular, the removal of a self-loop from G is equivalent to the operation of shorting the self-loop. In Fig. 1.8 the shorting of the edge e4 = (4, 7)j results in the graph shown in Fig. 1.12 containing two self-loops.
Fig. 1.12. The resulting graph after shorting the edge (4, 7), in the graph of Fig. 1.8.
14
GRAPHS AND NETWORKS
DEFINITION 1.11 Sectional Subgraph. The sectional subgraph induced by a subset Vs of the node set of a graph, denoted by G[KS], is the subgraph whose node set is Vs and whose edge set consists of all those edges of G connecting two nodes of Vs. The term sectional subgraph is frequently referred to as the induced subgraph. It is the maximal subgraph of G with the node set Vs, and can be obtained from G by the removal of all the nodes that are not in Vs. Thus, two nodes of Vs in G[VS] are adjacent if and only if they are adjacent in G. When VS=V, the node set of G, the sectional subgraph is G itself, i.e. G[V] = G. For a single node Vs = {/}, G[VS] is either the null graph or the subgraph consisting of all the self-loops at node i. For the graph G of Fig. 1.8, the sectional subgraph G[VS] induced by the subset Vs= { 1 , 2 , 3 , 4 , 7 } is presented in Fig. 1.13. In terms of edgedesignation symbols, we have G[VS] = e^e2e3e4e5e1Qeu
(1.20)
On the other hand, the subgraph G1 of Fig. 1.9(a) is not the sectional subgraph induced by Vs = {1, 2, 3,4, 5, 7} because it is not the maximal subgraph with node set Vs.
1.3
NONSEPARABLE GRAPHS AND BIPARTITE GRAPHS
Graphs can be classified in many different ways depending upon their structures. For example, we have already classified graphs on the basis of their connectivity. In this section, we introduce two important classes of graphs.
Fig. 1.13. The sectional subgraph G[{1,2,3,4,7}] induced by the subset {1, 2, 3,4, 7} of the node set of the graph of Fig. 1.8.
1.3 NONSEPARABLE GRAPHS AND BIPARTITE GRAPHS
15
Fig. 1.14. A separable graph with outpoints 3, 4, 6, 7 and 8.
DEFINITION 1.12 Cutpoint. In a connected graph G, if there is a proper nonnull subgraph Gs such that Gs and its complement have only node i in common, then the node i is called a cutpoint of G. A node of an unconnected graph is a cutpoint if the node is a cutpoint in one of its components. The term cutpoint is sometimes referred to as an articulation point. In the graph G of Fig. 1.14, the nodes 3, 4, 6, 7 and 8 are cutpoints, but the nodes 2 and 5 are not. If G has no self-loops, a cutpoint may also be defined as a node whose removal will increase the number of components at least by one. If G has self-loops, the statement, however, is not generally true. For example, node 4 in the graph of Fig. 1.14 is a cutpoint, but its removal will not increase the number of components at least by one.
THEOREM 1.5 A node j of a graph that contains no self-loops is a cutpoint if and only if there are two nodes i and k distinct from j such that every path connecting the nodes i and k contains the node j . The theorem is intuitively true. Its proof is straightforward and is omitted.
DEFINITION 1.13 Nonseparable Graph. A connected nonnull graph is said to be nonseparable if it contains no cutpoints. All other nonnull graphs are considered as separable. Thus, an unconnected nonnull graph is a trivial example of a separable graph. The graphs of Figs. 1.12-1.14 are other examples of separable
16
GRAPHS AND NETWORKS
Fig. 1.15. Examples of nonseparable graphs.
graphs. Examples of nonseparable graphs follows from the definition that a connected cutpoint, and such a graph must contain which has only one node in common with following result.
are presented in Fig. 1.15. It separable graph must contain a at least one nonnull subgraph its complement. This gives the
THEOREM 1.6 A necessary and sufficient condition that a graph containing at least two edges be nonseparable is that every proper nonnull subgraph of the graph have at least two nodes in common with its complement. In the graph of Fig. 1.14, node 6 is a cutpoint because there exist two nodes, say, 1 and 10 such that every path connecting these two nodes contains node 6. In Fig. 1.15(a), the graph is nonseparable because for each proper nonnull subgraph, say, exe2e^ it has at least two nodes in common with its complement e 4 e 5 . A graph containing at least two edges, one of them being a self-loop, is separable. A single edge is a nonseparable graph.
DEFINITION 1.14 Block. A block of a graph is a nonseparable subgraph containing the maximal number of edges. If a connected graph G is separable, we can separate G into blocks by splitting off the cutpoints. This process is called the decomposition of a separable graph into blocks. For example, the decomposition of the graph of Fig. 1.14 is presented in Fig. 1.16. Clearly, the decomposition is unique. In addition to nonseparable graphs, there is another class of graphs occurring frequently in matching theorems. They are defined below.
1.3 NONSEPARABLE GRAPHS AND BIPARTITE GRAPHS
17
Fig. 1.16. The unique decomposition of the graph of Fig. 1.14.
DEFINITION 1.15 Bipartite Graph. A graph G(V, E) is said to be bipartite if its node set V can be partitioned into two disjoint subsets Vt and V2 such that each of its edges has one endpoint in V^ and the other in V2. As a result, a nonnull subgraph of a bipartite graph is bipartite. All the paths connecting two nodes of Vi or V2 are of even length, and all paths are of odd length if one of the endpoints is in Vt and the other in V2. The graph of Fig. 1.17 is an example of a bipartite graph with node sets V^ = {1, 2, 3, 4, 5} and V2 = {6, 7, 8, 9}. All the paths connecting the nodes, say, 2 and 4 are of even length, and all paths connecting nodes 1 and 8 are of odd length. A complete characterization of a bipartite graph is given below.
THEOREM 1.7 A nonnull graph is bipartite if and only if either it has no circuits or each of its circuits is of even length.
Fig. 1.17. An example of a bipartite graph K54.
18
GRAPHS AND NETWORKS
Proof. The necessary part is obvious. To prove sufficiency, assume that a graph G(V, E) has this property. Without loss of generality, we may further assume that G is connected; for if not we can consider the components of G separately. Also, we can assume that G has no self-loops. Let i be a node of G, and let V2 be the set consisting of all the nodes / such that the length of a shortest path from i to j is even with i being included in V2. Let Vl = V -V2. Then each node k e V1 has the property that the length of a shortest path from i to k is odd. To show that every edge (u, v) of G is connected between a node u e V1 and a node v e V2, we first assume that both u and v are in V2. Let Piu and P*v be the shortest paths of even lengths from i to u and v, respectively. Starting from the nodes u and v, let j be the first common node in Piu and P*v. Then the shortest paths from j to u and from / to v are either both even or both odd. This would imply that the sum graph, formed by the edge (u, v) and the shortest paths from / to u and / to v, is a circuit of odd length, which would contradict the assumption that every circuit of G is of even length. In a similar manner, we can show that no two nodes in Vi are connected by an edge. Thus, G is bipartite and the proof is completed. 1.4
PLANAR GRAPHS
Our discussions so far have been entirely in terms of the abstract graph. The geometric diagram has served only for illustrative purposes. On the other hand, planar graphs can be defined in terms of their geometric diagrams. DEFINITION 1.16 Planar Graph. A graph is said to be planar if its geometric diagram can be drawn on a plane such that no two edges have an intersection that is not a node. We recognize that the geometric diagram of a graph can be drawn on a plane without intersections if and only if it can be drawn on a sphere without intersections. As a matter of fact, using stereographic projection, we can establish a one-to-one correspondence between these two drawings as follows: Let a sphere be kept on a plane such that the point of contact (south pole) is the origin of the coordinate system in the plane. Let z be the intersection (north pole) of the sphere and the line which is perpendicular to the plane and passes through the origin of the plane. Joining z to any point p of the sphere by a straight line and extending the line to meet the plane at p', we establish a one-to-one correspondence between points on the plane and points on the sphere. This procedure is referred to as a mapping between the sphere and the plane. Thus, the geometric diagram of a graph on a plane can always be mapped onto a sphere and vice versa, provided that z is chosen not on the diagram.
1.4 PLANAR GRAPHS
19
Fig. 1.18. A planar graph with its six regions.
DEFINITION 1.17 Region (Window). The areas into which the geometric diagram of a planar graph divides the plane, when it is drawn on a plane without intersections, are called the regions (windows) of the planar graph. The unbounded region is called the outside region. A region is characterized by the edges on its boundary. In electrical network theory, the circuit formed by the boundary edges of a region is known as a mesh because it has the appearance of mesh of a fishing net. We remark that the graph corresponding to an electrical network usually does not contain any self-loops, so there is no ambiguity in defining the mesh of a region. In Fig. 1.18 the graph is planar and it has six regions A, B, C, D, E and F, the outside region being F. These regions are bounded by the meshes e 1 e 2 e 3 e 5 , e3e4e9ew, e5e6e7e8, e7e9ene12, e10e12e13e15 and e 1 e 2 e 4 e 6 e 8 e 11 e 13 e 15 , respectively. The graphs of Figs. 1.5 and 1.7 are examples of nonplanar graphs. THEOREM 1.8 Any region of a planar graph can be the outside region of the planar graph. Proof. First draw the geometric diagram of a planar graph on a sphere without intersections. Rotate the sphere so that the point z discussed above is inside the given region. Map the geometric diagram back onto the plane, and we obtain the desired result. For example, the region D bounded by the mesh e7egeue12 of the planar graph of Fig. 1.18 can be made the outside region as shown in Fig. 1.19. Planar graphs are useful in practical applications. For example, in printed circuits an electrical network can be printed on a single plane surface if and
20
GRAPHS AND NETWORKS
Fig. 1.19. The interior region D of the planar graph of Fig. 1.18 being made the outside region. only if it corresponds to a planar graph. The notion of duality in electrical network theory is also closely related to planar graphs. The classical Euler formula for polyhedra relates the number of regions of a planar graph to the numbers of edges and nodes.
THEOREM 1.9 For an n-node connected planar graph with b edges and q regions (including the outside region) n -b + q=2
(1.21)
Proof. We prove this theorem by induction over the number b of edges of a connected planar graph G. For b - \ , the theorem is seen to be true. Assume that the assertion is true for any b-l, b^2. We show that it is also true for any b. If G has no circuit, then G has n - 1 edges, and equality (1.21) is satisfied. So let us assume that G has at least one circuit. If G' is the graph obtained from G by the removal of a boundary edge e of the outside region of G, then G' has n nodes, b-l edges, and q - 1 regions. By induction hypothesis, we have n-(b-i) + (q-l)
=2
(1.22)
and the theorem follows. An easy consequence of Euler's formula is the following that establishes an upper bound for the number of edges in a planar graph not containing parallel edges and self-loops.
1.4 PLANAR GRAPHS
21
COROLLARY 1.2 The number b of edges in an n-node planar graph, n i S 3 , that does not contain any parallel edges and self-loops is bounded above by 3n — 6, or b^3n-6
(1.23)
Proof. The maximum number of edges that can occur in an n-node planar graph G' is when every edge of G' is contained in at least one of the circuits formed by the boundary edges of the regions of G' and when each of these circuits is of length 3. If b' and q' are the numbers of edges and regions of G', respectively, then 2b' = 3q' because each edge of G' is contained in exactly two such circuits. Using this in conjunction with (1.21) gives b' = 3n — 6. This establishes an upper bound for the number of edges in any planar graph that does not contain any parallel edges and self-loops. So the corollary is proved. Using this result, it is easy to confirm that the graph of Fig. 1.7 is nonplanar because b = 10 > 9 = 3n — 6, a violation of (1.23). A similar result for a planar graph not containing any circuits of length 3 is given below.
COROLLARY 1.3 The number b of edges in an n-node nonseparable planar graph, n = 3 , that does not contain any parallel edges, self-loops, and circuits of length 3, is bounded above by In — 4, or b^2n-4
(1.24)
The bipartite graph Gx of Fig. 1.5(a) is not planar, because it violates condition (1.24): b=9^2n - 4 = 2 x 6 - 4 = 8.
COROLLARY 1.4 Every planar graph that contains at least four nodes and that does not contain any parallel edges and self-loops has at least four nodes of degree not exceeding 5. Proof. Let G be an n-node planar graph containing no parallel edges and self-loops. Without loss of generality, assume that in G there is no node of degree 1; for otherwise the corollary follows by induction over the number of nodes of G. Let the nodes of G be labeled such that if i<j then d{i)tkd{j). If G
22
GRAPHS AND NETWORKS
contains at most three nodes of degree not exceeding 5, from (1.10) we have n
2b = d(\) + d{2) + d(3) + 2 d(i) ^ d(l) + d(2) + d(3) + 6(n - 3)
(1.25)
or
»B"q>+"<2>+'p>-«+3._6S3._6
( ^
Combining this with (1.23) shows that (1.26) must hold with the equality sign. This is possible only if nodes 1, 2, and 3 are of degree 2. If nodes 1, 2 and 3 are of degree 2, then not every circuit formed by the boundary edges of a region is of length 3 and (1-23) holds only for the strict inequality: b<3n-6
(1.27)
showing that (1.26) is not possible. The corollary follows. It is quite obvious that a graph is planar if and only if each of its components is planar. It is less obvious that a graph is planar if and only if each of its blocks is planar. It was shown by Whitney (1932) that in studying planarity, it is sufficient to consider only nonseparable graphs.
THEOREM 1.10 A graph is planar if and only if each of its blocks is planar. The theorem follows directly from the fact that a separable graph can be decomposed into blocks and that the decomposition is unique. Thus, if each block is planar, the reconnection of these blocks at the cutpoints results in a planar graph. A planar graph is a graph that can be drawn on a plane without intersection. Very often the question arises as to whether or not a planar graph can be drawn on a plane with straight lines. One obvious restriction is that the graph cannot have any parallel edges or self-loops. It was shown by Wagner (1936), Fary (1948) and Stein (1951) independently that every planar graph containing no parallel edges and self-loops can be embedded in the plane with straight line edges.
THEOREM 1.11 Every planar graph that does not contain any parallel edges and self-loops can be drawn on a plane without intersection using only straight lines as edges.
1.4
PLANAR GRAPHS
23
Proof. Let G be a planar graph that does not contain any parallel edges and self-loops. Let G* be the graph obtained from G by adding as many edges as possible between any two nonadjacent nodes of a mesh without introducing any parallel edges and self-loops. The added edges lie interior to the regions. Clearly, G is a subgraph of G* and each mesh of G* is of length 3; for, otherwise, additional edges can be inserted. It is sufficient to show that G* can be drawn on a plane without intersection using only straight lines as edges, or to show that G* has a straight-line representation. We prove the theorem by induction over the number of nodes of G*. Certainly, if G* has less than four nodes, it has a straight-line representation. Assume that the assertion is true for any G* with k nodes, 3 ^ k ^i n. We show that it is also true for any G* with n + 1 nodes. If all the nodes of G* lie on the circuit formed by the boundary edges of the outside region called the outside mesh, G* has a straight-line representation. Thus, we assume that there is a node i of G* lying interior to the outside mesh. Let G' be the graph obtained from G* by the removal of the node i and all edges (/, j \ ) , (i, j 2 ) , • • • , (i, ju) incident on i and by adding edges 0i> ji)> 0i> i*)> • • • , 0'i> ju-i)> u = 4. For u = 3, no additional edges will be inserted. Clearly, the edges (juj2), (y'2,/3), • • • , Uu,]\) are in G' and G*, and form a circuit Lx that separates i from the other nodes of G*. The graph G' is identical with G* outside the circuit L1. If G' does not contain any parallel edges, by induction hypothesis G' possesses a straight-line representation. Now, we remove the edges (71,73), (71,74), • • • , (;'i,/ u -i) from G' and then insert a node i inside the circuit Lx and connect it to each of the nodes j \ , j 2 , • • • , ju with edges. The resulting graph is a straight-line representation of G*. If G' contains parallel edges, they are introduced when new edges (71,73), (71,74), • • • , (7i,7«-i) are added and when there are edges lying exterior to L, connecting jx and some of the nodes 73,74, . . . ,7„-i in G*. Let one of these exterior edges be (y\, j v ) , 3 = v ^ u — 1. Then the circuit L2 formed by the edges (7,, i), (i, jv) and (jv, j\) separates j2 from j„ in G*. Let the circuit L2 and that part of G* which is exterior to L 2 form a graph Gu and let L2 and its interior in G* form a graph G2. Since G, and G2 have at most n nodes, by induction hypothesis, they have straight-line representations. Putting these straight-line representations together shows that G* possesses a straight-line representation, so does its subgraph G. This completes the proof of the theorem. The planar graph of Fig. 1.20(a) can be drawn on a plane without intersection using only straight lines as edges as shown in Fig. 1.20(b). A more complicated planar graph is presented in Fig. 1.21. This graph possesses a straight-line representation as illustrated in Fig. 1.22. We now proceed to the characterization of a planar graph in terms of certain forbidden subgraphs. These subgraphs are special kinds of graphs defined below.
24
GRAPHS AND NETWORKS
Fig. 1.20. A planar graph (a) and its straight-line representation (b).
Fig. 1.21. A planar graph.
1.4 PLANAR GRAPHS
25
Fig. 1.22. A straight-line representation of the planar graph of Fig. 1.21. DEFINITION 1.18 Complete Graph. A self-loopless graph is said to be complete and of order k if for every pair of nodes there are k and only k edges connected between them. A complete graph of order 1 is simply called a complete graph. The n-node complete graph of order 1 is denoted by Kn. The 5-node complete graph of order 2 is shown in Fig. 1.23. Fig. 1.24(a) is the 5-node complete graph K5 and Fig. 1.24(b) is the 6-node complete graph K6.
DEFINITION 1.19 Complete Bipartite Graph. A bipartite graph whose node set is partitioned into the subsets Vi and V2 is said to be complete and of order k if for every pair of nodes i and j , i e V^ and / e V2, there are k and only k edges connected between them. A complete bipartite graph of order 1 is simply called a complete bipartite graph. If Vx and V2 have m and n nodes, the complete bipartite graph of order 1 is denoted by Km „.
26
GRAPHS AND NETWORKS
Fig. 1.23. The 5-node complete graph of order 2.
Fig. 1.24. The complete graphs K5 (a) and K6 (b). The graph of Fig. 1.25 is a complete bipartite graph of order 2. The complete bipartite graphs K33 and K3A are shown in Fig. 1.26. An edge of a graph is said to be subdivided if it is replaced by a path of length at least 2 as shown in Fig. 1.27. The forbidden subgraphs used to characterize a planar graph are K3 3 and K5 of Fig. 1.28 and their variants. The variants of K33 and K5 are defined below.
Fig. 1.25. A complete bipartite graph of order 2.
1.4 PLANAR GRAPHS
27
Fig. 1.26. The complete bipartite graphs K33 (a) and K34 (b).
0 ^=>
0 Fig. 1.27. The replacement of an edge by a path of length at least 2.
(b)
Fig. 1.28. The forbidden subgraphs K5 (a) and K33 (b) used to characterize a planar graph.
28
GRAPHS AND NETWORKS
Fig. 1.29. Two homeomorphic graphs: (a) G,; (b) G2.
DEFINITION 1.20 Homeomorphism. Two graphs are said to be homeomorphic if both can be obtained from the same graph by a sequence of subdivisions of the edges. The graphs G1 and G2 of Fig. 1.29 are homeomorphic because both can be obtained from the graph K5 of Fig. 1.28(a) by a sequence of subdivisions of edges. For example, if we subdivide the edges (1,5) and (1,3) of K5 twice and three times, respectively, we obtain Gx. Likewise, if we subdivide (1,4) and (2,3) of Ks, we obtain G2. Two circuits of different lengths are homeomorphic because the longer circuit can be obtained from the shorter one by a sequence of subdivisions. An alternative way to describe homeomorphism of two graphs is to use the operation of shorting an edge. Two graphs are homeomorphic if both can be reduced to the same graph by a sequence of operations that short edges incident to nodes of degree 2. The forbidden subgraphs used to characterize a planar graph are those homeomorphic to K33 or Ks. The following basic theorem on planar graphs is due to Kuratowski (1930), the proof of which depends on many point-set topological ideas that have not been developed here. We follow the proof of Dirac and Schuster (1954).
1.4 PLANAR GRAPHS
29
THEOREM 1.12 A graph is planar if and only if it has no subgraph homeomorphic to K5 or ^3,3-
Proof. Necessity. The necessity follows from Corollaries 1.2 and 1.3 in that since K5 and K33 are nonplanar, a graph containing a subgraph homeomorphic to either of these is also nonplanar. Sufficiency. We prove the theorem by induction over the number of edges. The theorem is certainly true for any graph having less than four edges. Assume that the condition is sufficient for any graph having less than b edges. We show that the assertion is valid for any graph G having b edges. Since by Theorem 1.10 a graph is planar if and only if each of its blocks is planar, without loss of generality it is sufficient to consider only nonseparable graphs G. To complete the proof, assume that the assertion is false, i.e. G is a b-edge nonseparable nonplanar graph that does not contain a subgraph homeomorphic to either K5 or K33. Let (x, y) be an arbitrary edge of G. Let G' be the graph obtained from G by the removal of (x, y). We first show that there is a circuit in G' containing the nodes x and y. Since G is nonseparable, G' is connected. Moreover, since G' contains b — 1 edges, it is also planar. Assume that there is no circuit in G' containing the nodes x and y. Then x and y must lie in different blocks of G'. Hence, by Theorem 1.5 there exists a cutpoint z such that every path connecting the nodes x and y contains the node z. We construct the graph G" by adding to G' the edges (x, z) and (y, z) if they are not already present in G'. Observe that in G" the nodes x and y still lie in different blocks. Let G" be decomposed into the subgraphs G'[ and G\ by splitting off the cutpoint z. Certainly, G" and G'{ each contain at most b — 1 edges. By induction hypothesis, G" and G"2 are planar graphs. According to Theorem 1.8, both G'[ and G\ can be drawn in the plane so that the edges (x, z) and (y, z) appear in the circuits formed by the boundary edges of the outside regions. Connecting G'[ and G\ back at z to form G" and inserting the edge (x, y) to G" results in a planar graph, for which G is a subgraph. This requires that G be planar, contradicting the assumption. Therefore, there is a circuit in G' containing x and y. There may be many circuits containing x and y in G'. Let L be a circuit of G' containing x and y such that it encloses the maximum number of regions interior to it. Orient the edges of L in a cyclic fashion, so that Luv denotes the path from utov along L. If v does not immediately follow u on L, we use the symbol L(u, v) to denote the subpath of Luv obtained by the removal of u and v. The circuit L also serves to specify a node, an edge, or a region which is inside L and one which is outside. By the exterior of L, we mean the subgraph of G' induced by the nodes lying outside L, and the components of this subgraph are called the exterior components of L. By an outer piece of L, we mean an exterior component together with all the edges
30
GRAPHS AND NETWORKS
incident with it or an edge exterior to L meeting two nodes of L. Likewise, we define the interior of L, an interior component, and an inner piece. An outer or inner piece is said to be u-v separating if it meets L(u, v) and L(v, u). Clearly, if u and v are adjacent on L, an outer or inner piece cannot be u-v separating. Since G' is connected, each outer piece must meet L. Furthermore, G' has no cutpoints, for otherwise G = G' U (x, y) would contain a cutpoint. By splitting off the cutpoint and by induction hypothesis, this would imply that G is planar, a contradiction. Thus, G' has no cutpoints. By Theorem 1.6, we conclude that each outer piece must have at least two nodes in common with L. An outer piece cannot meet L(x, y) or L(y, x) in more than one node. If it did so we could find another circuit enclosing more regions than L. For the same reason, no outer piece can meet x or y. Therefore, every outer piece meets L in exactly two nodes and is x-y separating. In addition, there is at least one inner piece that is x-y separating. If this were not so we could introduce the edge (x, y) in such a way that G would be planar, contrary to the assumption. Let / t be an x-y separating inner piece that is nearest to x in the sense of encountering nodes of this inner piece on moving along L from x. Continuing out from x along L, we can index the other x-y separating inner pieces as I2, / 3 , and so forth. We order these inner pieces for the purpose of relocating them in the plane later. Let x2 and x3 be the first and last nodes of /a meeting L(x, y ) , and y2 and y3 be the first and last nodes of It meeting L(y, x), as indicated in Fig. 1.30. We show that there exists an x-y separating outer piece Q meeting L(x, y), say, at xu and L{y, x), say, at yu such that there is an inner piece that is
Fig. 1.30. Figure used to prove sufficiency of Theorem 1.12.
1.4
PLANAR GRAPHS
31
both x-y separating and x1-y1 separating. Suppose that the assertion is false. Then every x-y separating outer piece, which has exactly two nodes in common with L, must have these common nodes on either L(y3, x2) or L(x3,y2), for otherwise the assertion is true. Without loss of generality, assume that xt and ya lie on L(y3, x2), as shown in Fig. 1.30. As a result, we can draw a curve C connecting y3 and x2 in the exterior of L so that it does not meet any edges of C , as depicted in Fig. 1.30. Now, the inner piece Ix can be transferred outside of C in a planar manner. If the remaining x-y separating inner pieces I2, I3, and so forth could all be so transferred, in order, the resulting graph is such that we can draw a line from x to y without meeting any edges of G'. Since G' contains b — \ edges, by induction hypothesis G' is planar. The above argument shows that G, which can be obtained from G' by connecting an edge between x and y inside L, is also planar, a contradiction. Thus, there is an x-y separating outer piece Q meeting L(x, y) at xx and L(y, x) at y1 such that there exists an inner piece / which is both x-y separating and xl-y1 separating. For this choice of outer piece Q and inner piece / , there are four potential nodes at which I meets L that are of particular interest. We denote by w0, w'0, wx and w[ the nodes at which / meets L(x, y), L(y, x), L(xlt y,), and L(y,,jCi), respectively. Four cases are distinguished, depending on the relative position on L of these four nodes.
Case 1 wx or w[ is on L(x, y) and the other is on L(y, x). Then we can take, say, w0 = Wj and w'Q = w[, as indicated in Fig. 1.31. In this case, G contains a subgraph homeomorphic to K33 with the two sets of nodes identified in Fig. 1.31 by the solid and open dots.
Fig. 1.31. Figure used in Case 1 in the proof of sufficiency of Theorem 1.12.
32
GRAPHS AND NETWORKS
Fig. 1.32. Figures used in Case 2 in the proof of sufficiency of Theorem 1.12. Case 2
Both w1 and w[ are on either L(x, y) or L(y, x). Without loss of generality, assume that both lie on L(x, y). If w'0J=yl7 then G contains a subgraph homeomorphic to K3?3, as shown in Fig. 1.32(a) or (b), depending on whether w0 lies on L{xx, yx) or L(yx, xj, respectively. On the other hand, if w0 = }>i, then there is a node p in I from which there are disjoint paths to wlt w[ and yly all of whose nodes except wx, w[ and yx belong to /. Again, in this case G contains a subgraph homeomorphic to X3 3, as depicted in Fig. 1.32(c). Case 3 wx=y and w[¥=x. Without loss of generality, assume that w[ lies on L(x, y). If WQ is on L{y, yx), then G contains a subgraph homeomorphic
1.4 PLANAR GRAPHS
33
Fig. 1.33. Figures used in Case 3 in the proof of sufficiency of Theorem 1.12. to K33, as shown in Fig. 1.33(a). If w'0 is on L(yl, x), there exists a node p in I from which there are disjoint paths to wt = y, w[ and w'0, all of whose nodes except wlt w[ and w'0 belong to /. In this case, G contains a subgraph homeomorphic to K33, as depicted in Fig. 1.33(b). Finally, if w'0 = yi, we have the situation shown in Fig. 1.33(c), and G again contains a subgraph homeomorphic to K33. Case 4 wx=y and w[=x. In the present situation, we assume that w0 = ^i and w = o yi> f° r otherwise we are in one of the situations covered in Case 1, 2 or 3 above. To facilitate our discussion, two subcases are distinguished. If Pxy and Pxm denote the shortest paths in / between x and y and xt and yu
34
GRAPHS AND NETWORKS
(a)
w0=y
Xi=W0
y = wl
w0=yl
= w0
y = w,
Fig. 1.34. Figures used in Case 4 in the proof of sufficiency of Theorem 1.12.
respectively, then they must intersect since / is planar. If they have more than one node in common, as depicted in Fig. 1.34(a), then G contains a subgraph homeomorphic to K3 3 . Otherwise, G contains a subgraph homeomorphic to ^ 5 , as shown in Fig. 1.34(b). Since these are all the possibilities, it follows that G must be a planar graph. This completes the proof of the theorem. As an illustration, consider the Petersen graph of Fig. 1.35. The graph is nonplanar because it contains a subgraph as shown in Fig. 1.36(a) which is homeomorphic to K33 of Fig. 1.36(b). Observe that since every node of the Petersen graph is of degree 3, none of its subgraphs can be homeomorphic
toK5.
1.4
PLANAR GRAPHS
35
Fig. 1.36. A subgraph of the Petersen graph which is homeomorphic to K, 3. In addition to the above characterization of a planar graph, a dual form of Kuratowski's theorem in terms of graph contractions was independently given by Wagner (1937) and Harary and Tutte (1965).
DEFINITION 1.21 Graph Contraction. A graph G t is said to be contractible to a graph G2 if G2 can be obtained from Gx by a sequence of edge shorting operations. For example, the Petersen graph is contractible to K5 of Fig. 1.37 by shorting the edges (1, 6), (2,7), (3, 8), (4, 9), and (5,10). An alternative form to Kuratowski's result is stated below.
THEOREM 1.13 A graph is planar if and only if it does not contain a subgraph contractible to K5 or K33.
36
GRAPHS AND NETWORKS
Fig. 1.37. The complete graph K5. Since the Petersen graph is contractible to K5, it satisfies the condition of Theorem 1.13, confirming an earlier assertion that the Petersen graph is nonplanar. In a related paper, Tutte (1963) gives an algorithm on the drawing of a graph in the plane, so that whenever his procedure fails to draw the entire graph, it must contain a subgraph homeomorphic to K5 or K33. The algorithm, in addition to being able to show how to draw a planar graph in a plane without intersection, provides another proof of Kuratowski's theorem (Theorem 1.12).
1.5
DUAL GRAPHS
In the preceding section, we showed that a planar graph can be characterized in terms of certain forbidden subgraphs. In this section, we demonstrate that planarity can also be expressed in terms of the existence of dual graphs. We first review the notion of a geometric dual of a planar graph, give an algebraic definition of duality due to Whitney (1932, 1933a), and then show that these two concepts are consistent and coincide.
DEFINITION 1.22 Geometric Dual. Given a planar graph, its geometric dual is constructed as follows: Place a node in each region of the planar graph including the outside region, and, if two regions have an edge e in common, connect the nodes inside the two adjacent regions by an edge e' crossing only e. Consider, for example, the planar graph G of Fig. 1.38. Its geometric dual G' is constructed as shown in Fig. 1.39, and is redrawn in Fig. 1.40. Suppose that we construct the geometric dual G" of G' again as depicted in Fig. 1.41. We find that G" is isomorphic to the original graph G. Thus, the dual of the dual of the planar graph G of Fig. 1.38 is the original graph G.
1.5 DUAL GRAPHS
Fig. 1.38. A planar graph used to construct its geometric dual. a'
Fig. 1.39. The construction of a geometric dual graph.
Fig. 1.40. A geometric dual of the graph of Fig. 1.38.
Fig. 1.41. A dual of a dual of the graph of Fig. 1.38.
37
38
GRAPHS AND NETWORKS
Fig. 1.42. A planar graph.
As another example, consider the graph G of Fig. 1.42, whose geometric dual G' is constructed in Fig. 1.43 and is redrawn in Fig. 1.44, for clarity. This dual G' is isomorphic to G. Thus, the planar graph G of Fig. 1.42 is self-dual.
DEFINITION 1.23 Combinatorial Dual. A graph G2 is said to be a combinatorial dual of another graph G t if there exists a one-to-one correspondence between the edges of G1 and G2 such that if g t is a subgraph of Gx and g2 is the complement of the corresponding subgraph of G2, then
r2 =
R2-ml
(1.28)
Fig. 1.43. The construction of a geometric dual of the planar graph of Fig. 1.42.
1.5
DUAL GRAPHS
39
Fig. 1.44. The dual graph of the planar graph of Fig. 1.42. where r2 and R2 are the ranks of g2 and G2, respectively, and mx is the nullity of gx. In the late part of this section, we shall demonstrate that the two concepts are consistent and one implies the other. For illustrative purposes, we use the graph G, of Fig. 1.45(a) and its geometric dual G2 of Fig. 1.45(b) to clarify the notion of combinatorial dual. First, the edges are labeled as in Fig. 1.45 such that a corresponds to a', b to b', etc. Let g, = abeg. Then the corresponding subgraph of gx in G2 is a'b'e'g', so that its complement is g2 = c'd'f. These two subgraphs gx and g2 are presented in Fig. 1.46. Then from Fig. 1.45(b) and Fig. 1.46 we have r2 = 2,
R2 = 3,
mi = l
(1.29)
r2 = 2 = 7 ? 2 - m , = 3 - l = 2
(1.30)
giving
For another example, choose gl = defg, so that ml = l. Then g2 = a'b'c' with r2 = 2. Again, this gives r2 = 2 = i ? 2 - / n 1 = 3 - l = 2 (a)
(b)
(1.31)
b'
Fig. 1.45. A planar graph G, (a) and its geometric dual G2 (b).
40
GRAPHS AND NETWORKS (b)
(a)
Fig. 1.46. The subgraphs g, (a) and g2 (b) of the graphs G, and G2 of Fig. 1.45.
THEOREM 1.14 If G2 is a combinatorial dual of a graph Gu then the rank of G2 equals the nullity of Gj and the rank of Gx equals the nullity of G2. Proof. Let g1 = Gx be the improper subgraph of Gj. Then the corresponding subgraph of g t = Gj in G2 is G2 itself, so that its complement g2 is the null graph 0 . Hence, the rank r2 of g2 is 0 and the nullity ml of gx equals that oi GY or ml = Mx. Since G2 is a combinatorial dual of Gt, from (1.28) we have r2 = 0 = R2 — m^ = R2 — Mx
(1.32)
where R2 is the rank of G2, or R2 = M1
(1.33)
This shows that the rank of G2 equals the nullity of G t . The second part of the theorem follows immediately from the facts that since Gx and G2 contain the same number of edges and since the sum of rank and nullity equals the number of edges, we have from (1.33) R1 + M1 = R2 + M2 = Mi+M2
(1.34)
where Rx and M2 denote the rank and nullity of Gx and G 2 , respectively, or Ri = M2
(1.35)
THEOREM 1.15 If G2 is a combinatorial dual of a graph Gu then Gj is a combinatorial dual of G2.
1.5 DUAL GRAPHS
41
Proof. Let g 2 be a subgraph of G2 and let g1 be the complement of the corresponding subgraph of g 2 in Gx. As before, denote by rh Rt, m, and M, the ranks and nullities of g, and G,, respectively. Then since G2 is a combinatorial dual of Glt r2 = R2-mx
(1.36)
If bx, b2 and B denote the numbers of edges in gly g2 and Gr (or G 2 ), respectively, we have bl + b2 = B
(1.37)
From Theorem 1.14, R2 = MU giving from (1.36) and (1.37) r1 = b1-m1
= b1- (R2 - r2) = b1-M1
= B-M1~m2
+ (b2 - m2)
= Rl-m2
(1.38)
This shows that G t is a combinatorial dual of G2, and the proof of the theorem is completed. As a result, it is not necessary to say that Gx is a dual of G 2 or G2 is a dual of Gx. It is meaningful and sufficient to state that Gj and G2 are dual graphs. Before we prove the main results of this section, we need the following two theorems of Whitney (1932).
THEOREM 1.16 The combinatorial dual of a nonseparable graph is nonseparable.
THEOREM 1.17 Let Gi and G 2 be the combinatorial dual graphs, and (/?!, fi2) be their corresponding edges. If G[ = Gx — (aly graph obtained from G2 by shorting the edge (jSj, B2), are duals having the same corresponding edges as in G\
let (alt a2) and a2) and G2 is the then Gi and G2 and G 2 .
Proof. To show that G[ and G2 are duals, let g[ be any subgraph of G[ and let g2 be the complement of the corresponding subgraph of g[ in G 2 . If gi is the subgraph of Gj corresponding to gi in Gi, then the nullities mx and m[ of gi and gi are equal or mi — m[
(1.39)
42
GRAPHS AND NETWORKS
Furthermore, if g2 is the complement of the subgraph corresponding to g, in G2, then since Gr and G2 are duals, r2 = R2-mx
(1.40)
where r2 and R2 are the ranks of g2 and G2, respectively. Observe that g2 can be obtained from g2 by shorting the edge (/31( /J2). In doing so, the number of components remains unaltered, whereas the number of nodes is reduced by one if fix ¥= /?2 and remains the same if fil = /32: r2 = r 2 - l ,
if/8,*/3 2
(1.41a)
r2 = r2,
if ySa = >32
(1.416)
R2 = R2-1,
if/3i^/8 2
(1.42a)
R2 = R2,
HPi = p2
(1.42b)
and, in particular, if g2 = G2
where r2 and R2 are the ranks of g2 and G2, respectively. Combining these equations (1.39)-(1.42) yields r2 = R2-m[
(1.43)
showing that G2 is a dual of G[. This completes the proof of the theorem. Instead of characterizing a planar graph in terms of certain forbidden subgraphs, Whitney (1932,1933a) showed that planarity can be stated in terms of combinatorial duals.
THEOREM 1.18 A graph is planar if and only if it has a combinatorial dual. Proof. Necessity. Let Gx be a planar graph. Without loss of generality, assume that G\ is connected. Since Gx is planar, it can be mapped onto a sphere. Then by Theorem 1.9, Gx divides the sphere into Mx + 1 regions, where M, is the nullity of Gx. Let G2 be the geometric dual of Gx constructed in accordance with Definition 1.22. Then G2 contains Mx + 1 nodes. It remains to be shown that G2 is a combinatorial dual of Gx. Let gi be a subgraph of G t , and let g2 be the complement of the corresponding subgraph of g a in G2. To establish necessity, we show that r2 =
R2-ml
(1.44)
1.5 DUAL GRAPHS
43
where r2 and R2 are the ranks of g2 and G2, respectively, and m t the nullity of g t . To this end, we present a scheme for simultaneously constructing gt and g2, as follows: Draw G2 on the sphere and put all the nodes of Gi inside the appropriate regions of G2. Each time an edge of gl is inserted, delete the corresponding edge of G2 but leave the endpoints behind. Thus, when g, is constructed, g2 is also formed. We next demonstrate that in the above construction process, each time the nullity of the subgraph of Gx is increased by one after adding an edge, the number of components in the subgraph of G2 is also increased by one after deleting the corresponding edge of G2. Furthermore, if the nullity of the subgraph of G\ is unaltered, the number of components in the subgraph of G2 remains unaltered. We remark that some of the components may consist of isolated nodes. Observe that the nullity of the Gx-subgraph is increased only when an edge is inserted between two nodes in the same component. Let (ar1} a2) be such an edge, and let (fil, j82) be its corresponding edge in G2. Since ax and a2 belong to the same component, there is a path connecting at and oc2 in the constructed subgraph of Gl. This path together with (a-i, a2) forms a circuit L. When (/Jj, /32) is removed, the nodes / ^ and j32 cannot be in the same component; for, otherwise, there is a path PPlp2 connecting jSt and /32 in the G 2 -subgraph. Since fix and j82 are on opposite sides of the circuit L, Pptp2 must cross L, showing an edge of Pptp2 crosses an edge of L. But by construction process such an edge of Pp^2 was removed when the corresponding edge of L was inserted. Thus, when the nullity of the G t -subgraph is increased by one after adding an edge, the number of components in the G2-subgraph is also increased by one after the deletion of the corresponding edge in G 2 . To verify the second part of our assertion, suppose that we construct the whole of the graph G t by this process, resulting in the increase in nullity by M l5 the nullity of G t . This implies that the number of components of the G2-subgraph is at least A/j + 1 , because G2 initially contains at least one component and each increase in nullity of the Gr -subgraph is accompanied by an increase in the number of components of the associated G 2 -subgraph. But once Gt is constructed, what is left of G2 is the null graph consisting only of N2 nodes. Since by construction N2 = M t + 1, the number of components in the G2-subgraph is exactly Mx + 1 instead of at least A^ + 1. Thus, G2 is connected and the number of components increases only when the nullity of the Gi-subgraph increases. Return to gi and g2 and observe that g2 is a spanning subgraph of G2. Then the increase in the number of components when g2 is constructed from G2 is nti. Since G2 is connected, its rank is R2 = N2 — 1. Hence the rank r2 of g2 is given by r2 = N2—\-m1 = R2-ml showing that G2 is a combinatorial dual of Gx.
(1-45)
44
GRAPHS AND NETWORKS
Fig. 1.47. The geometric duals of graphs containing one edge. Sufficiency. To prove sufficiency, we show that if G 2 is a combinatorial dual of a graph Gu then Gr is planar. This also establishes the equivalency of the geometric dual and the combinatorial dual. The result is sufficiently important to be stated separately as a theorem.
THEOREM 1.19 A graph has a geometric dual if and only if it has a combinatorial dual. Proof. We have already established that if a graph has a geometric dual, then it has a combinatorial dual. Thus, from Theorem 1.10 it is sufficient to consider a nonseparable graph Gl possessing a combinatorial dual G2. We show that G2 is a geometric dual of G a . We prove this theorem by induction over the number of edges of Gx and G2. If the graphs G1 and G2 contain only one edge each, they can be mapped as shown in Fig. 1.47. Assume that the theorem is true for all Gl and G2 with B — 1 edges or less, B^2. We show that the assertion is true for any Gi and G2 with B edges. To facilitate our discussion, two cases are distinguished. Case 1 Gi contains a node of degree 2. Let j be a node of Gx of degree 2, and let (i,j) and (/', k) be the two edges incident a t / . From Theorem 1.6, we see that since G1 is nonseparable, every edge of G, is contained in a circuit. In particular, there is a circuit containing (i, j) and (/, k). Thus, removing either (/,;') or (/', k) alone will not alter the rank of G l5 but the removal of both of them reduces the rank of Gi by one. Since G2 is a combinatorial dual of Gx, by Theorem 1.15 Gi is a combinatorial dual of G2. Let (/?!, /32) and (fi3, f34) be the two edges in G2 corresponding to (i, j) and (/, k) in Gj, respectively. From Definition 1.23, if g2 = (Pi, )82) or (/?3, (54), then gi = G1- (/, /) or Gt - (y, k) and the ranks rx and Rx of gx and Gj, respectively, and the nullity m2 of g2 are related by rl=Rl-m2 = Rl
(1.46)
1.5 DUAL GRAPHS
45
implying that the nullity m2 of g2 is zero. If, on the other hand, g2 = (Px, P2KP3, Pd, then g1 = G1- (i, /)(/, k) and r1 = R1-m2
= R1-l
(1.47)
or ra2=l. The conclusion is that the subgraph composed of either (Pi> Pz) o r (Ps> P*) D U t n o t D O t n ' s °f nullity zero, and that the subgraph (Pi> Pz)(P3> /34) is of nullity one. This is possible only if (pt, j82) and (P3, p4) are connected in parallel. Without loss of generality, let pi = p3 and p2 = pA and write (fiu p2) = (jB„ j82), and (j83, 0 4 ) = (Pi, 0 2 ) 2 , whose corresponding edges in Gx are (i, j) and (/, A:), respectively. Let G[ be the graph obtained from G t by shorting the edge (/', k), and let G2 = G2-(pt, p2)2- By Theorem 1.17, G[ and G 2 are combinatorial duals and preserve the same corresponding edges as in G t and G2. Since these graphs contain B — 1 edges, by induction hypothesis they are also geometric duals and can be mapped together onto the sphere as described in Definition 1.22. In particular, edge (px, p2)i crosses (i, k), the edge connecting i and k in G[ after shorting (j, k) in Gj. Mark a point on the edge (i, k) of G[ between the node k and the point at which the edge (Plt p2)x of G 2 crosses it. Let this point be the node j , dividing the edge (i, k) into the two edges (/, j) and (j, k). Draw the edge (Pi> ^2)2 crossing the edge (/, k). This reconstructs the graphs G^ and G2 such that they map together onto the sphere in accordance with Definition 1.22. Thus, G2 is a geometric dual of G^ Case 2 Each node of Gx is of at least degree 3. In this case, there is an edge (i, j) in Gj whose removal results in a graph G[ = Gl — (i, j) that is still nonseparable. Let (Plt p2) be the edge in G2 corresponding to (/, j) in Gx. Since G2 is nonseparable, Pi¥=p2 and the two endpoints of (pu p2) are distinct. Let G 2 be the graph obtained from G2 by shorting the edge (Piy Pi)- By Theorem 1.17, G[ and G 2 are combinatorial duals and preserve the same corresponding edges as in Gi and G2. Notice that at this point, G[ and G 2 are both nonseparable. Therefore, there are no cutpoints in G[ and G 2 . We next show that edges incident with a node in either G[ or G 2 correspond to a circuit in the other. Let Q'i be the subgraph of G 2 composed of all the edges incident at node i. Let g[ be the complement of the subgraph g[ in G[ corresponding to the edges of Q\ in G 2 . From Definition 1.23, the ranks f2 and R2 of Ql = G'2 — Q'i, the complement of Q\ in G 2 and G 2 , and the nullity m\ of g[ are related by r2 = ^ 2 - ^ ; = ^ 2 - l
(1-48)
where r2 = R2— 1, giving m\ = 1. Thus, g[ is a subgraph of nullity 1.
46
GRAPHS AND NETWORKS
Furthermore, since G[ and G 2 contain B -1 edges, by induction hypothesis they can be mapped together onto the sphere in accordance with Definition 1.22 or G[ and G 2 are also geometric duals. Let node i of G 2 lie inside the circuit L' of g[ in G[. If g[ ± L', the subgraph g[ - V of G[ must lie inside L' because every edge of g[ must be crossed by an edge of Q\. This is possible only if G[ contains a cutpoint, contradicting the fact that G[ is nonseparable. This shows that the edges of G[ corresponding to those of Q\ in G 2 constitute a circuit or g[ = L'. By the same argument, we can show that edges incident with a node in either Gx or G2 correspond to a subgraph of nullity 1 in the other, because G, and G2 are also nonseparable. Furthermore, this subgraph of nullity 1 must be a circuit. To see this, let Qt be the subgraph composed of the edges incident at node i in G2. Let gi be the complement of the subgraph gt in Gx corresponding to the edges of g, in G2. Then gx is of nullity 1 and contains a circuit L such that g t — L¥=0, the null graph. This implies that the complement g2 of the subgraph g2 in G2 corresponding to the edges of L in Gx is a spanning subgraph of G2 because g2 is a proper subgraph of Qi, and is, therefore, connected. From Definition 1.23, the ranks f2 and R2 of g2 and G2 and the nullity ml of gi are related by r2 = R2-ml=R2
(1.49)
or mi = 0, a contradiction. Thus, the edges incident with a node in either Gx or G2 correspond to a circuit in the other. Return to (i,j) in Gx and (f5x, j82) in G2. Let QPt and Qp2 be the subgraphs of G2 composed of the edges incident at nodes fix and /3 2 , respectively. Let Li and L 2 be the circuits in Gx corresponding to the edges of Qpt and Qp2 in G 2 , respectively. One of these edges in Lx and L2 is (/, / ) . Write L1 = P1U(i,j)
(1.50a)
L 2 = P 2 U (/,;)
(1.506)
where / \ and P 2 are paths in G2 with endpoints i and / . Recall that GJ = Gx - (i, j) and G 2 is obtained from G2 by shorting the edge (/? t , /32) with the combined node being denoted by fi'. If Q^ is the subgraph composed of the edges incident at node fi' in G2, the circuit L'p in G[ corresponding to the edges of Qp. in G 2 is formed by the edges of the paths P1 and P2, because they correspond to edges incident at nodes j8x and fi2 except the edge (/Si, /32). Now, as before, G[ and G 2 can be mapped onto the sphere in accordance with Definition 1.22. On the map, the node fi' lies inside a region within the circuit L^ of G[. Each edge of L'p is crossed by an edge incident at fi'. There are no other edges of G 2 crossing L^. No other part of G 2 other than the node fi' can lie inside L'p; for otherwise such a part can only have the node fi' in common with its complement, indicating the existence of a cutpoint in
1.5
DUAL GRAPHS
47
Fig. 1.48. The mapping of L'p in G[ and Qp- in G2, where L'p is the circuit composed of the paths P, and P2.
G'2- This is impossible for a nonseparable G 2 . Likewise, there is no part of G[ lying inside L'p, because any such edge must be crossed by an edge of G 2 , resulting in a cutpoint in G[, whereas G[ is nonseparable. Thus, the mapping of L'p in G\ and Q^ in G'2 is of the form shown in Fig. 1.48, where the circuit L'p is composed of the paths P, and P2. Observe that all the edges incident at node /3, in G2 except the edge (Pi> Pi) cross individually the edges of the path P1, and that all the edges incident at node /32 except (/?!, /32) cross the edges of P2. Thus, we can separate the node /?' into two nodes )3, and f)2 in such a way that no two edges of G2 — (j6i,/32) cross each other. We now connect an edge between nodes / and/' to form G t , crossing none of the other edges. This edge (/,;) divides the circuit L'p into two parts, with f}r in one part and /?2 in the other, as depicted in Fig. 1.49. Now we join an edge (/3i, f52) between /?i and /? 2 , crossing only (i, /') in G,, and obtain G2. The graphs Gx and G2 are now mapped onto the sphere in accordance with Definition 1.22, as required. This shows that G2 is a geometric dual of G\, and our proof is complete. In Definition 1.23 and the various theorems following it, we state that G2 is a dual of Gx or G t is a dual of G2. One may ask whether or not a planar graph can have more than one dual. We can conceive of a simple way to construct two nonisomorphic graphs to be the duals of a planar graph, as follows: We begin by constructing a geometric dual G2 of an unconnected planar graph Gj by the procedure of Definition 1.22. Then G2 is connected. We next use the same procedure to construct a geometric dual G3 of G2. Then G3 is also connected. Thus, Gj and G3 are both duals of G2 and they are not isomorphic, since one is connected and the other is not. As a result of Theorem 1.19, it is not necessary to say that the graphs Gx
48
GRAPHS AND NETWORKS
Fig. 1.49. The mapping of the graphs G, and G2 onto the sphere. and G2 are geometric duals or combinatorial duals. It suffices to say that G1 and G2 are dual graphs. As an illustration, consider the planar graph Gx of Fig. 1.50(a) whose dual G2 as constructed by the procedure of Definition 1.22 is shown in Fig. 1.50(b). We next use the same procedure to construct a dual G3 of G2 as given in Fig. 1.50(c). Then Gj and G3 are duals of G2. The graphs Gx and G3 are not isomorphic because G t is unconnected whereas G3 is connected. One natural question is that if the duals of a planar graph are not unique, how are they related? The answer to the question can be stated in terms of the notion of 2-isomorphism. 1.6
2-ISOMORPHISM
In Section 1.1, we introduced the notion of isomorphism to mean that two graphs are identical or the same. If a graph is separable, we can decompose it into blocks by splitting off the cutpoints. Now, if we like, we can reconnect the two blocks by coalescing any node i of one block with any node j of the other. The graph of Fig. 1.51(a) can be decomposed by splitting off the cutpoint k into k' and k". Now, suppose that we reconnect the blocks at the nodes i a n d / . The resulting graph is shown in Fig. 1.51(b). In the present section, we consider the interchange of series-connected subgraphs. The resulting class of equivalent graphs is said to be 2isomorphic, and was first studied by Whitney (1933fo). The 2-isomorphic graphs are of great interest in electrical network theory. DEFINITION 1.24 2-Isomorphism. Two graphs G t and G 2 are said to be 2-isomorphic if one can be made isomorphic to the other by a series of the following
1.6 2-ISOMORPHISM
49
Fig. 1.50. The graph G2 possessing two nonisomorphic duals Gj and G3: (a) G,; (b) G2; (c) G3.
SO
GRAPHS AND NETWORKS
Fig. 1.51. The splitting and reconnecting of subgraphs at a cutpoint.
operations: (a) Decompose a separable graph into blocks and then reconnect them at the single nodes to form a cutpoint. (b) If g is a proper nonnull subgraph of G] or G2 such that it has only two nodes i and / in common with its complement g, decompose G] or G2 into g and g by splitting off the nodes i and / and then reconnect at the same nodes after turning around at these nodes for either g or g. To illustrate the concept of 2-isomorphism, we consider the two graphs Gi and G2 of Fig. 1.52. To show that these two graphs are 2-isomorphic, we choose the subgraph g = abcdefghij and its complement g = kmnpqrt in Gj. Next decompose G] into g and g by splitting off the nodes i and j and then reconnect at the same nodes after turning around at these nodes for g. The resulting graph G 3 is shown in Fig. 1.53(a). In G 3 , let g = abcdefghijkmn. Then g = pqrt. Turning around and reconnecting at the nodes u and / for g yields the graph G4 as shown in Fig. 1.53(b). Finally, let g = kmn. Then g = abcdefghijpqrt. Turning around and reconnecting at the nodes / and u for g gives the desired graph G2 of Fig. 1.52(b). Thus, G^ and G2 are 2-isomorphic. The most important result in characterizing 2-isomorphic graphs is given by Whitney (19336), and is stated as a theorem.
Fig. 1.52. Graphs used to illustrate the concept of 2-isomorphism: (a) Gx; (b) G2.
Fig. 1.53. Graphs used to illustrate the concept of 2-isomorphism: (a) G3; (b) G4. 51
52
GRAPHS AND NETWORKS
THEOREM 1.20 Two graphs are 2-isomorphic if and only if there is a one-to-one correspondence between their edges such that circuits in one correspond to circuits formed by the corresponding edges in the other. The necessary part of the theorem is fairly evident. The proof of the sufficient part is too long to be given here. For the interested reader, we refer to the original paper of Whitney (19336). As an example, consider the 2-isomorphic graphs Gj and G2 of Fig. 1.52, where the corresponding edges are designated by the same labels. If we pick, for instance, the circuit L = ieakmptr in G 1; the subgraph formed by the corresponding edges in G2 is also a circuit. This holds for all such circuits and we say that circuits correspond to circuits. To answer an earlier question on the relations of the duals of a planar graph, we state the following theorem of Whitney (1933a, b).
THEOREM 1.21 The duals of a planar graph are unique within a 2-isomorphism. Proof. Let Ga and Gp be two duals of a planar graph G. Take any circuit La of Ga. Then following a proof similar to that for Theorem 1.19, we can show that the subgraph C of G corresponding to the edges of La is a minimal subgraph (cutset) whose removal from G reduces the rank by one. Likewise, we can show that the subgraph Lp of Gp corresponding to the edges of C is a circuit. Thus, circuits of Ga correspond to circuits of Gp, and by Theorem 1.20, the graphs Ga and Gp are 2-isomorphic. This completes the proof of the theorem. The theorem states that if Gj and G2 are two duals of a planar graph G, then Gi and G2 are 2-isomorphic.
1.7
MATRICES ASSOCIATED WITH A GRAPH
The most convenient algebra used in the study of graphs is the algebra of the residue class modulo 2, which consists of two elements denoted by the symbols 1 and 0. Two operations, addition " + " and multiplication " • " , are defined in this algebra by the rules 0 + 0 = 0,
0 + 1 = 1 + 0 = 1,
1+ 1= 0
(1.51a)
0 - 0 = 0,
0 - 1 = 1-0 = 0,
1-1 = 1
(1.516)
1.7 MATRICES ASSOCIATED WITH A GRAPH
53
Except for the addition rule 1 + 1 = 0, the others are the same for the real numbers zero and one in the real field. 1.7.1
Incidence Matrix
A graph is completely specified by its edge and node incidence relations. These relations are most conveniently expressed by means of a matrix.
DEFINITION 1.25 Node-Edge Incidence Matrix or Incidence Matrix. The node-edge incidence matrix or simply the incidence matrix A a of an n-node, fc-edge graph G without self-loops is a matrix of order n x b such that if A a = [a,y], then a/; = 1 if edge es is incident at node i
(1.52a)
a,, = 0
(1.526)
otherwise
Thus, the incidence matrix A a of a graph G is a matrix, each of whose rows corresponds to a node and each of whose columns corresponds to an edge. For the graph G of Fig. 1.54, the incidence matrix is found to be ex
e2
e3
e4
es
e6
e7
1 1 1 0 0 1 0 0 2 0 1 1 0 0 1 0 Aa = 3 1 0 0 1 0 0 0 4 0 0 1 1 0 0 1 5 . 0 0 0 0 1 1 1 1
e8
0" 0 1 0
Fig. 1.54. A graph used to illustrate the incidence matrix.
(1.53)
54
GRAPHS AND NETWORKS
Observe that each column of A a contains exactly two ones. Hence, the sum of all the rows of A a over the algebra of the residue class modulo 2 is a row of zeros, showing that not all the rows of A a are linearly independent.
THEOREM 1.22 The rank of the incidence matrix of a graph is equal to the rank of the graph. Proof. Let A a be the incidence matrix of an n-node graph G. We shall only prove the case where G is connected, leaving the unconnected case as an obvious simple extension. Since the sum of all the rows of A a is a row of zeros, the rank of A a over the modulo 2 algebra is at most n — 1. To complete the proof, we demonstrate that the rank of A a is at least r = n - 1, the rank of G. We claim that the sum of any k rows of A a , k
0
• ;
]
(i.54)
A 22 J
where the rows of A n correspond to the first k rows of A a , and the columns correspond to those where the first k rows contain both ones. Therefore, the nodes of G corresponding to the first k rows of A a have no edges connecting to the nodes corresponding to the last n — k rows. Hence, the graph G is not connected, contradicting the assumption. The assertion follows. Let AltA2, • • • , A„ be the rows of A a . Since the sum of any k rows of A a , k
(1.55)
where c,{j = 1, 2, . . . , n) are scalars from the field modulo 2, has only one nonzero solution for c,-s with Ci = c 2 = . . . =c„ = l
(1.56)
1.7
MATRICES ASSOCIATED WITH A GRAPH
55
showing that any n — 1 rows of A a are linearly independent. The theorem follows. This completes the proof of the theorem. This property was first established by Kirchhoff (1847). As a result, all the information contained in A a is contained in the submatrix of order r x b and of rank r, the rank of the graph G.
DEFINITION 1.26 Basis Incidence Matrix. A basis incidence matrix A of a fo-edge graph G of rank r is a submatrix of order r x b and of rank r of the incidence matrix A a of G. In the literature, the incidence matrix is frequently referred to as the complete incidence matrix because it contains rows corresponding to all the nodes of the graph G. In forming a basis incidence matrix A from A a , the nodes in G corresponding to the deleted rows of A a are called the reference nodes of the components of G because they correspond to the potentialreference points in the associated electrical network. For the graph G of Fig. 1.54, its complete incidence matrix A a was obtained in (1.53). If we delete row 5, we obtain a basis incidence matrix
•"
1 2 3i 4
e\ 1 0 11 0
e-i
1 1 n0 0
e3 0 1 n0 1
i
e4 0 0 1 1
e5 1 0 0n 0
e6 0 1 n0 0
e7 0 0 n 0i 1
e» 0' 0 1 0
(.l-- 5 ')
of G. This matrix is of rank r = 4, being equal to the rank of G.
DEFINITION 1.27 Tree. A spanning subgraph of a graph is said to be a tree if and only if it is connected and contains no circuits. For the graph of Fig. 1.55, its trees are presented in Fig. 1.56. Observe that a tree contains n — 1 edges, n being the number of nodes of the graph.
DEFINITION 1.28 Branch. An edge of a tree is called a branch.
56
GRAPHS AND NETWORKS
Fig. 1.55. A graph used to illustrate the concept of a tree.
DEFINITION 1.29 Major Submatrix. For a matrix F of order p x q and of rank p, a major submatrix of F is a nonsingular submatrix of order p. The edges in each of the trees of Fig. 1.56 are the branches of the tree. For the basis incident matrix A of (1.57), a major submatrix is given by
M=
1
1
1
0
1
2
0
1
1
0
3
1
0
0
0
4 .0
0
1
0
(1.58)
which is nonsingular over the field modulo 2. THEOREM 1.23 A square submatrix of a basis incidence matrix of a connected graph is a major submatrix if and only if the columns of this submatrix correspond to the branches of a tree of the graph.
Fig. 1.56. Trees of the graph of Fig. 1.55.
1.7 MATRICES ASSOCIATED WITH A GRAPH
57
Proof. Let M be the submatrix of a basis incidence matrix A of a connected graph G in question. If the columns of M correspond to the branches of a tree, then by Theorem 1.22 M is nonsingular because M is a basis incidence matrix of the tree. To prove necessity, we first demonstrate that if M is nonsingular, the subgraph g corresponding to its columns cannot contain any circuits. Suppose that the assertion is false. Let L be a circuit of length k in g and let Mx be the submatrix of M formed by the columns corresponding to the edges of L. Relabel G if necessary so that the columns and the leading rows (corresponding to the nodes in L) of Mi are arranged in the orders of the edges and nodes appearing in L, respectively. In Mi it is not difficult to see that if the reference node of G is contained in L, the number of nonzero rows in Mi is k — 1. Thus, the columns of Mi are linearly dependent. On the other hand, if the reference node is not contained in L, the number of nonzero rows in Mx is k. Since, in this case, each of these columns contains two ones, the rank of Mi is at most k — 1. This shows that the columns of Mi and hence M are linearly dependent, contradicting the hypothesis that M is nonsingular so that its columns are linearly independent. Our conclusion is that if M is nonsingular, the subgraph g of G corresponding to its columns cannot contain any circuit. This together with the fact that g contains n — 1 edges implies that the subgraph g is a tree of G, completing the proof of the theorem.
COROLLARY 1.5 There exists a one-to-one correspondence between the trees of a graph and the major submatrices of its basis incidence matrix. A basis incidence matrix A of the graph G of Fig. 1.55 is found to be e2 1
e3 0
e4 0
e5 0"
0
1
1
0
1
3 _0
0
1
1
0.
ei
1 ~1 A= 2
(1.59)
It is straightforward to verify that the only major submatrices of A are those whose columns correspond to the branches of the trees of Fig. 1.56. 1.7.2
Circuit Matrix
In addition to the node-edge incidence matrix, we can define the circuit-edge incidence matrix.
58
GRAPHS AND NETWORKS
Fig. 1.57. A graph used to illustrate the orthogonal property of the incidence and circuit matrices.
DEFINITION 1.30 Circuit-Edge Incidence Matrix (Circuit Matrix). The circuit-edge incidence matrix or simply the circuit matrix Ba of a b -edge graph is a matrix of order p x b, where p is the number of circuits of the graph, such that if Ba = [bv], then btj = 1 if edge e, is in circuit /
(1.60a)
bij = 0
(1.606)
otherwise
For the graph G of Fig. 1.57, there are three circuits: L1 = e1e2e5,
L2 = e3e4e5,
L3 = ele2e3e4
(1.61)
The circuit matrix Ba is found to be
1 3
ex e 2 e3 1 1 0 0
0
1
1
e4 0
e
1
1 1 1 1
1
(1.62)
0
DEFINITION 1.31 Cotree. The complement of a tree in a connected graph is called a cotree.
DEFINITION 1.32 Chord (Link). An edge in a cotree is called a chord or a link. Therefore, a cotree of a connected n-node, b-edge graph contains m = b — n + 1 chords. Because a tree is connected and contains no circuit,
1.7 MATRICES ASSOCIATED WITH A GRAPH
59
there is a unique path connecting any two of its nodes. The addition of any chord to the tree produces a unique circuit in the resulting graph. There are a total m such circuits, one corresponding to each chord. This leads to the following definition.
DEFINITION 1.33 Fundamental Circuits (/-Circuits). The fundamental circuits or simply the f-circuits of a connected graph of nullity m with respect to a tree are the m circuits, each being formed by a chord and the unique tree path connecting the two endpoints of the chord in the tree. The submatrix B{ of the circuit matrix Ba corresponding to a set of f-circuits of a graph G has a very special form. For example, if the f-circuits are labeled in some manner from Lj to Lm, and if the chord that appears in circuit / is numbered as edge e, for i = \, 2, ...,m, then Bt can be partitioned as Bt=[Um
Bfl2]
(1.63)
where Um is the identity matrix of order m. For the graph G of Fig. 1.54, if we choose the tree composed of the branches es, e6, e 7 and e8, the f-circuits, labeled as Li, L2> L3 and L4, of G corresponding to the chords gj, e2, £3 and e4 are found to be Li = exe5e%,
L2 = e2e5e6,
L3 = e3e6e7,
L4 = e4e7e8
(1.64)
respectively. The submatrix Bt of Ba formed by these f-circuits is given by e3 0
e4 0
es 1
e6
"l
e2 0
0
1
0
0
1
1
0
0
0
0
1
0
0
1
1
0
.0
0
0
1
0
0
1
1
ei
0
e-, e8 0 l " (1.65)
which is partitioned in accordance with (1.63)
DEFINITION 1.34 Fundamental Circuit Matrix (f-Circuit Matrix) For a connected graph G of nullity m, the submatrix of the circuit matrix of G corresponding to a set of m f-circuits in G is called a fundamental circuit matrix or simply an f-circuit matrix Bf of G.
60
GRAPHS AND NETWORKS
The f-circuit matrix Bt obviously has rank m because it contains the identity matrix of order m, as shown in (1.63). Therefore, the rank of Ba is at least m. To show that m is also an upper bound for the rank of Ba, we need the following theorem. Apart from establishing the rank of Ba, the result is extremely important in its own right and was first established by Veblen (1931). It is also fundamental to electrical network theory.
THEOREM 1.24 If the columns of the matrices A a and Ba of a graph are arranged in the same edge order, then AaB'a = 0
and
BaA' = 0
(1.66)
where the prime denotes the matrix transpose. Proof. We only prove the first identity; the second one follows immediately after taking transpose on both sides of the first. Consider the ith row of A a and the y'th column of B'a or the y'th row of Ba. The entries in the corresponding positions in the ith row of A a and the yth row of Ba are nonzero if and only if the corresponding edge is incident at node i and is also contained in circuit j . If node i is not contained in circuit /, then there is no such edge and the product is zero, giving the required result. If circuit / does include node i, there will be precisely two edges of the circuit / incident at node i, meaning that there are only two nonzero entries in the ith row of Aa with the property that the corresponding entries in the y'th row of Ba are also nonzero. Therefore, the product of the ith row of A a and the ;'th column of B'a will be zero over the modulo 2 algebra. This completes the proof of the theorem. As an example of the theorem, consider the graph G of Fig. 1.57. The product of the incidence matrix A a and the transpose of the circuit matrix Ba is computed as 1 1 0 A„fl: =
0
0
1 1 0
0
0
1 0
0 1
1 1 0 0
1 1
"1
0
l"
1
0
1
0
1 1
0
1 1
_i confirming (1.66).
i
o_
0
0
0
0 0
0 0
0 0
0
0
0
(1.67)
1.7 MATRICES ASSOCIATED WITH A GRAPH
61
THEOREM 1.25 The rank of the circuit matrix of a graph is equal to the nullity of the graph. Proof. We have already established that the rank of the circuit matrix Ba of a connected graph G is at least m, the nullity of G. If G is not connected, by partitioning Ba in accordance with the nodes and edges in the components of G, it is easy to confirm that the assertion remains valid in general. To complete our proof, we show that m is also an upper bound for the rank of Ba. From Theorem 1.24, we see that since AaB'a = 0, the columns of B'a are in the null-space of Aa. By Theorem 1.22, the rank of Aa is r, the rank of G, showing that the dimension of the null-space of Aais b — r = m, where b is the number of edges of G. Thus, the maximum number of linearly independent rows of Ba is m, and the theorem follows. This completes the proof of the theorem. As a result of Theorem 1.25, there is really no need to write down all the rows of Ba. Only m linearly independent ones are sufficient.
DEFINITION 1.35 Basis Circuit Matrix. A basis circuit matrix B of a b-edge graph G of nullity m is a submatrix of order m x b and of rank m of the circuit matrix fla of G. Thus, a basis circuit matrix B contains all the information that is contained in Ba, which is also frequently referred to as the complete circuit matrix because all the circuits of the graph are represented by the rows of Ba. Evidently, the f-circuit matrix is a basis circuit matrix.
THEOREM 1.26 A square submatrix of a basis circuit matrix of a connected graph is a major submatrix if and only if the columns of this submatrix correspond to the chords of a cotree in the graph. Proof. Necessity. Let B be a basis circuit matrix of a connected graph G of nullity m. By permuting the columns of B if necessary, we may assume that the leading columns of B form a major submatrix. Let B be partitioned as B - [B\i
B12]
(1.68)
62
GRAPHS AND NETWORKS
where Bn is nonsingular and of order m. Since there are r columns in B12, it is sufficient to show that the subgraph corresponding to these columns does not contain any circuits. Assume otherwise, and let Bt be the row of Ba corresponding to such a circuit. Consider the submatrix of Ba consisting of the rows of B and Bt. Then the submatrix can be partitioned as
Then there is at least one nonzero element in B12. Since Bu is nonsingular, the rank of the matrix (1.69) is m + 1. But this matrix is also a submatrix of Ba, which by Theorem 1.25 is of rank m. This is impossible and the assertion follows. Sufficiency. Assume that the columns of a submatrix of B correspond to the chords of a cotree in G. Let Bt be the f-circuit matrix formed by the chords of this cotree in G. By permuting the columns of B and Bf if necessary, the matrices B and B{ can be partitioned as B = [BU
Bl2]
(1.70a)
Bt=[Um
Btl2]
(1.706)
Since the rows of B and Bt are the two bases for the vector space spanned by the rows of Ba, there exists a nonsingular matrix D of order m such that B = DBf
(1.71)
B u = Dt/m=D
(1.72)
giving
Hence Bu is nonsingular. This completes the proof of the theorem.
COROLLARY 1.6 There exists a one-to-one correspondence between the cotrees of a graph and the major submatrices of a basis circuit matrix of the graph. As an illustration, consider the graph G of Fig. 1.57. The graph G is of nullity 2. A basis circuit matrix B of G is, therefore, of order 2 X 5. It is easy to verify that the submatrix of B3 of (1.62) formed by any two of its rows is a basis circuit matrix of G. The basis circuit matrix B formed by the first two rows of Ba corresponding to the meshes formed by the boundary edges of
1.7 MATRICES ASSOCIATED WITH A GRAPH
e2
o
63
e2
—o
o e\
«3
0
o
o
O
O-
o
e-i
9
«4
Fig. 1.58. Cotrees of the graph of Fig. 1.57. the two interior regions of G is given by
B =
ex
e2
e3
e4
e5
1
1
0
0
l"
[0
0
1
1
lj
(1.73)
The set of cotrees of G is shown in Fig. 1.58, and is given by f = {e^s, e2es, e3e5, e4e5, ele4, e2e3, exe3, e2e4}
(1-74)
each of whose elements corresponds to the complement of a tree shown in Fig. 1.56. The submatrix formed by the columns corresponding to the chords of a cotree in T is a major submatrix of B, and these are the only major submatrices of B. 1.7.3
Cut Matrix
Another important class of subgraphs is called the cutset, which finds extensive use in electrical network theory because it generalizes the Kirchhoff's current law. The concept of cutsets was originally introduced by Whitney (1933a) and systematically developed by Seshu and Reed (1956). Our discussion here is to show that cutsets bear the same relationships to circuits that circuits bear to incidence relationships. Thus, we will find the duals of a number of theorems proved earlier for the circuits.
DEFINITION 1.36 Cutset. A cutset of a graph is a subgraph consisting of a minimal collection of edges whose removal reduces the rank of the graph by one.
64
GRAPHS AND NETWORKS
Fig. 1.59. The broken lines showing the cutsets. The definition implies that if a graph G has more than one component, a cutset can only be formed from the edges of one of its components; for otherwise, the collection will not be minimal. Intuitively, if we "cut" the edges of a cutset, one of the components of G will be cut into two pieces. The name cutset has its origin in this interpretation. Note that a component of G may consist of an isolated node. For the graph G of Fig. 1.59, the subgraphs eie3e5, e2e4e5, exe4e5, and e6es are examples of cutsets. The broken lines shown in Fig. 1.59 indicate how these cutsets "cut" the graph. However, the subgraph e^e3e5ebe-i is not a cutset because if we remove these edges from G, the rank of G is reduced from 5 t o 3 ( = 6 — 3),a reduction of two instead of one as required. For the subgraph e3e4e6, although its removal from G will reduce the rank of G by one, it is not a cutset because the removal of e3e4 from G will also reduce the rank of G by one, showing that e3e4e6 is not a minimal collection of edges.
DEFINITION 1.37 Incidence Cut. The subgraph formed by the edges incident at a node of a graph is called an incidence cut of the graph. Thus, an incidence cut may either be a cutset or an edge-disjoint union of cutsets. For the graph G of Fig. 1.59, the subgraphs ete4e5 and e3e4e6es are examples of incidence cuts. The former is also a cutset and the latter is an edge-disjoint union of two cutsets e3e4 and e6e$. DEFINITION 1.38 Cut. A cutset or an edge-disjoint union of cutsets of a graph is called a cut. A cut can also be interpreted in another useful fashion. Let V^ be a nonempty proper subset of the node set V of a graph G, and let
1.7 MATRICES ASSOCIATED WITH A GRAPH
65
Fig. 1.60. A graph and its seven cuts denoted by the broken lines. V2 = V — Vl. Then the set of edges of G each of which is incident with one of its two endpoints in Vx and the other in V2 is a cut of G. In particular, if the removal of these edges from G increases the number of components of G by one, then the cut is also a cutset. For the graph G of Fig. 1.59, let ^ = {1,2,5}. Then V2= {3,4,6}, and a cut is formed by the edges ey, e3, e5, e6 and e7. Of course, the cutsets and incidence cuts are special types of cuts.
DEFINITION 1.39 Cut-Edge Incidence Matrix (Cut Matrix). The cut-edge incidence matrix or simply the cut matrix Qa of a fo-edge graph is a matrix of order qX-b, where q is the number of nonempty cuts in the graph, such that if 6a = [<7,y]>then qtj = 1 if edge e, is in cut i
(1.75a)
qij = 0
(1.756)
otherwise
The graph G of Fig. 1.60 contains seven cuts, as indicated by the broken lines drawn across the edges. The cut matrix is found to be
1 "l
e2 1
e3 0
e4 0
2
0
1
1
0
1
3
0
0
1
1
0
fia 4
1
0
0
1
1
5
0
1
0
1
1
6
1
0
1
0
1
7
1
1
1
1
0
ey
es 0
(1.76)
66
GRAPHS AND NETWORKS
Clearly, not all the rows of Qa are linearly independent. Then what is the rank of Qa? Since Qa contains the incidence matrix Aa as a submatrix, we know right away that the rank of Qa is at least r, the rank of G. For example, in (1.76) the submatrix formed by the first four rows of Qa is the incidence matrix of G. To show that r is also an upper bound, we need to establish a relationship between Ba and Qa similar to that between Ba and A a of (1.66). This relationship follows immediately from the observation that the number of edges common to a cut and a circuit is always even, giving a zero entry in the product of a row of Qa, which corresponds to a cut, and a column of the transpose of Ba, which corresponds to a circuit, over the modulo 2 algebra.
THEOREM 1.27 If the columns of the matrices Ba and Qa of a graph are arranged in the same edge order, then 0 a f l a = O and
BaQ'a = 0
(1.77)
where the prime denotes the matrix transpose. Since the rank of Ba is m, the nullity of the graph G, and since BaQ'a = 0, it follows that the dimension of the null space of Ba is r (=b — m), where b is the number of edges of G. Thus, there are at most r linearly independent rows in Qa, and we obtain the following theorem.
THEOREM 1.28 The rank of the cut matrix of a graph is equal to the rank of the graph. Therefore, there is no need to write down all the rows of Qa; only r linearly independent ones are sufficient.
DEFINITION 1.40 Basis Cut Matrix. A basis cut matrix Q of a b -edge graph G of rank r is a submatrix of order r x b and of rank r of the cut matrix Qa of G. Like the basis circuit matrix, a basis cut matrix contains all the information that is contained in Qa. Earlier, we indicated how a cut of G can be used to partition its node set. In the following, we demonstrate how this partitioning of nodes of G can be done by means of a tree.
1.7 MATRICES ASSOCIATED WITH A GRAPH
67
Let t be a tree of a connected graph G, and let e be a branch of t. Since t is connected and contains no circuits, the removal of e from t results in a subgraph consisting of two components. If V^ and V2 are the node sets of these two components, then Vx and V2 are mutually exclusive and together include all the nodes of G. Hence, the branch e of t defines a partition of the nodes of G in a unique way. The subgraph composed of all the edges each of which is incident with one of its two endpoints in Vt and the other in V2 is a cutset of G. This cutset contains only one branch of t, namely e, and some chords of the cotree t (with respect to t). Clearly, there are r such cutsets.
DEFINITION 1.41 Fundamental Cutsets (f-Cutsets). The fundamental cutsets or simply the f-cutsets of a connected graph of rank r with respect to a tree t are the r cutsets in which each cutset includes only one branch of t.
DEFINITION 1.42 Fundamental Cutset Matrix (f-Cutset Matrix). For a connected graph G of rank r, the submatrix of its cut matrix corresponding to a set of r f-cutsets in G is called a fundamental cutset matrix or simply an f-cutset matrix Qf of G. Like the f-circuit matrix, if the edges of G are numbered in such a way that the last r columns of Qf correspond to the branches of t and if the f-cutsets are numbered correspondingly, the f-cutset matrix Qf can be partitioned as Qt=[Qm
Ur]
(1.78)
where Ur is the identity matrix of order r. Thus, the f-cutset matrix is also a basis cut matrix. We illustrate the above results by the following example. Example 1.1 For the complete graph K4 of Fig. 1.61, let us choose a tree f = e 1 e 3 e 4 . The three f-cutsets C\, C 2 and C 3 with respect to the branches ex, e3 and e 4 are found to be C1 = ele2e6,
C2 = e2e4e5e6,
C3 = e2e3e5
(1-79)
and are shown in Fig. 1.62, respectively, where the thick edges represent
68
GRAPHS AND NETWORKS
Fig. 1.61. A graph used to illustrate the concept of f-cutsets and f-circuits.
Fig. 1.62. The three f-cutsets defined for the tree t = e^e3e4: (a) C^ (b) C2; (c) C3.
the defining tree branches. The f-cutset matrix is given by
Q
e2 ~1
e5 0
e6 1
ev 1
e4 0
e3 0
Qf=c2
1
1
1
0
1
0
c3
_1
1
0
0
0
1
(1.80)
For each chord in i = e2ese6, the complement of t in G, there is an f-circuit. The three f-circuits L1 = e1e2e3e4,
L2 = e3e4e5,
L3 = e1e4e(>
(1.81)
are shown in Fig. 1.63 with the heavy lines denoting the defining chords. The f-circuit matrix is obtained as
Bf
e5 0
e6 0
e\ 1
e4 1
e3
L,
e2 "1
L2
0
1
0
0
1
1
L,
_0
0
1
1
1
0.
r (1.82)
1.7 MATRICES ASSOCIATED WITH A GRAPH
69
^r-® 0-s—E Fig. 1.63. The three f-circuits defined for the cotree t = e2e5e6: (a) L,; (b) L2; (c) L3.
Using (1.80) and (1.82) in (1.77) yields
1 0 1 1 0 0" 1 1 1 0 10 1 1 0 0 0 1
"1 0 0 1
0 1 0 0
0" 0 1 = 1
1 1 1 _i
0
0 0'
0 0 0
(1.83)
0 0 0
i o_
confirming (1.77). Finally, we mention that since the rows of Q and Q{ are the two bases of the vector space spanned by the rows of Qa, it follows that one can be obtained from the other by a nonsingular transformation: Q = MQf
(1.84)
where M is a nonsingular matrix of order r over the modulo 2 algebra. This leads directly to the following theorem.
THEOREM 1.29 A square submatrix of a basis cut matrix of a connected graph is a major submatrix if and only if the columns of this submatrix correspond to the branches of a tree of the graph.
COROLLARY 1.7 There exists a one-to-one correspondence between trees of a connected graph and the major submatrices of a basis cut matrix of the graph.
70
GRAPHS AND NETWORKS
For the graph G of Fig. 1.61, the set of trees is given by T = {ere2e3, ele2e4, ele3e4, e2e3e4, e1e2e6, e2e3e5,
e3e4e6,
ere4e5, e2e4e5, e2e4e6, e2ese6, e3e5e6, e4ese6, e x e 5 e 6 , exe3e5, exe3e6)
(1.85)
It is straightforward to verify that each of the major submatrices of Q{ of (1.80) is composed of the columns corresponding to a term in T. 1.7.4
Interrelationships Among the Matrices A, Bf and Q,
Recall that a basis incidence matrix A of a graph G completely characterizes the graph in that if A is given the graph itself can be drawn in a straightforward manner. It is logical to expect that the matrices B{ and Qf be expressible in terms of the submatrices of A.
THEOREM 1.30 If the columns of a basis incidence matrix A, an f-circuit matrix Bf and an f-cutset matrix Qt of a graph of rank r and nullity m are arranged in the order of chords and branches for the tree defining Bt and Qt such that, in partitioned forms A = [AU
A 12 ]
(1.86a)
Bf=[Um
Bn2]
(1.86b)
Qf=[Qm
Ur]
(1.86c)
then Bf=[Um gf =
A1-21A
A'nA'xz1] 1
= [Ar 2 A n
(l-87a) Ur)
(1.87b)
where the prime denotes the matrix transpose, and Um and Ur are identity matrices of orders m and r, respectively. Proof. The identities (1.87) follow immediately by substituting (1.86) in (1.66) and (1.77).
COROLLARY 1.8 Let t be a tree of a connected graph G, and let e be a branch of t. Then the f-cutset determined by e contains exactly those chords of G for which e is in each of the f-circuits determined by these chords.
1.7
MATRICES ASSOCIATED WITH A GRAPH
71
In the graph G of Fig. 1.61, let t = exe3e4. Also let e = e4. The f-circuits defined by the chords e2, es and e6 and containing e4 are e1e2e3e4, e3e4e5, and eie 4 e 6 . Thus, the f-cutset determined by the branch e4 contains exactly those chords e2, e5 and e6 in e1e2e3^4, £ 3 ^ 5 , and exe4e6, respectively, so the f-cutset is composed of the branch e4 and chords e2, e5 and e6. Example 1.2 We verify formulas (1.87) for the graph G of Fig. 1.61. A basis incidence matrix of G is found to be e2 1 "1
e5 0
e6 1
ei
1
e4 0
e3 0"
2
1
1
0
0
0
1
3 _0
0
1
0
1
1
(1.88)
from which we calculate
Al2^11 =
1 0 0 0 0 1 0 1 1_ 1 0 (f 0 1 1 0 1 0
-1
1 0 I 1 1 0 _0 0 1_
~i o r 1 1 0 = () 0 1
~1 0 1 1 1 1 1 1 0
(1.89)
From (1.87) we obtain
af = [u3
I 0 0 A; 1 A; 2 - ] = 0 1 0 _0 0 1
1 1 1 0 1 1 1 1 0
(1.90)
"l 0 1 U3] = 1 1 1 _1 1 0
1 0 0 0 1 0 0 0 1
(1.91)
Q,=[ATMU
1
confirming (1.82) and (1.80). 1.7.5
Node-to-Datum Path Matrix
Formulas (1.87) require the inversion of a major submatrix Al2 of A. For higher order matrices, it is a time-consuming process. To circumvent this difficulty, in the following we give a useful interpretation of the inverse of Ai2.
72
GRAPHS AND NETWORKS
0
© 3
&
e*.
Fig. 1.64. The tree used to compute the node-to-datum path matrix (1.93).
DEFINITION 1.43 Node-to-Datum Path Matrix. For an n-node tree, the node-to-datum path matrix P of the tree with reference node n is a matrix of order n — 1 such that if P = [p^] then Pii = 1 if branch e, is contained in the unique path connecting the nodes / and n
(1.92a)
ptj = 0 otherwise
(1.92b)
As an illustration, consider the tree t = ete3e4 of the graph of Fig. 1.61 used in partitioning the incidence matrix A of (1.88). The tree is redrawn in Fig. 1.64. Then the node-to-datum path matrix P of t with reference node 4 is obtained as 1 2
3
ei "1
0
0"
0
1
1
e4
e3 _0
(1.93)
1 0_
THEOREM 1.31 The inverse of a major submatrix of the basis incidence matrix of a connected graph with reference node n is equal to the node-to-datum path matrix of the tree corresponding to the columns of the major submatrix with n used as the reference node of the tree. Proof. Let A be the basis incidence matrix of a connected graph G with reference node n. Let A12 be the major submatrix of A corresponding to a tree t in G. Also let P be the node-to-datum matrix of t with reference node
1.7
MATRICES ASSOCIATED WITH A GRAPH
73
n. We show that (1.94)
P = A^ or 2 Ptfijk = <>ik,
i, k = l,2, . . .
,n-l
(1.95)
y'=i
where 6ik is the Kronecker delta, and P = [pn]
and
A 12 = [fl,y]
(1.96)
If nodes x and y are the two endpoints of a branch ek of t, then (1.95) can be simplified to (1.97)
Pix^xk + Piydyk = &ik
Observe that the branch ek partitions the nodes of / into two mutually exclusive subsets Vx and V2. If i¥^k, then pu and piy are both one or both zero since the two endpoints of the branch e, are both in V^ or in V2Furthermore, if both p« and piy are 1, both axk and ayk are also 1 and (1.97) becomes Pix
= Q,
i^k
(1.98)
If i = k, two cases are distinguished: pkx = 0 and p^ = 1. For p t o = 0, then pky - 1 and ayk = 1. For p ^ = 1, then pky = 0 and axk = l. In either situation, we have Pkxaxk
+ PkyQyk ~ 1
(1.99)
This completes the proof of the theorem. For the graph G of Fig. 1.61, the basis incidence matrix A with reference node 4 is shown in (1.88). Consider the submatrix A 12 of A formed by the last three columns corresponding to the tree t = e^e^ej in G. This submatrix A12 is nonsingular and is given by
A„ = 2
et
c4
e3
"1
0
0'
0
0
1
0
1
1
(1.100)
The node-to-datum path matrix P of the tree t = exeAe2, of Fig. 1.64 with
74
GRAPHS AND NETWORKS
reference node 4 was computed earlier in (1.93) as 1 2
3
e\ "1 0 0" = e4 0 1 1 e3 _0
(1.101)
1 0_
It is straightforward to verify that P = A\
(1.102)
So far we have considered the problem of expressing B( and Qf in terms of the submatrices of A. The reverse process of expressing A in terms of the submatrices of Bt and Qf is much more difficult; it amounts to realizing a graph with a prescribed f-circuit or f-cutset matrix. A complete solution to this problem was first given by Tutte (1958, 1959).
1.8
DIRECTED GRAPHS
In many applications, it is necessary to associate with each edge of a graph an orientation or direction. For some the orientation of the edges is a "true" orientation in the sense that the system represented by the graph exhibits some unilateral property. For example, the directions of the one-way streets of a city and the orientations representing the unilateral property of a communication network are true orientations of the physical systems. In others, the orientation employed is a "pseudo"-orientation, used in lieu of an elaborate reference system such as in electrical network theory where the edges of a graph are assigned arbitrary orientations to represent the references of the branch currents and voltages. In this section, we introduce the basic concepts and terms associated with directed graphs. Since most of the concepts are directly analogous to those presented for undirected graphs, they will be mentioned only briefly. Terms that have no undirected counterpart will be discussed in detail.
DEFINITION 1.44 Abstract Directed Graph. An abstract directed graph Gd(V, E), or simply a directed graph or digraph Gd consists of a set V of elements called nodes together with a set E of ordered pairs of the form (i, j), i, j e V, called the arcs or directed edges of G d . Node i is called the initial node and node j the terminal node of (i, j). Together they are the endpoints of (i, j).
1.8 DIRECTED GRAPHS
75
Thus, the only difference between a graph and a directed graph is that the arcs of a directed graph are ordered pairs of nodes while the edges of a graph are not. For simplicity, we shall use the term arc instead of directed edge in the remainder of this book. We say that the arc (i, j) is directed or oriented from node i to node / , and that (i, j) is incident with the nodes i and j or alternatively that (i, j) is directed away or outgoing from i and directed toward or terminating at /'. A directed graph can also be represented equivalently by a geometric diagram in which the nodes are indicated by small circles or dots, while any two of them, i and /, are joined by an arrowheaded continuous curve, or even a straight line, from i to / if and only if (i, j) is in E. We extend the directed graph concept by permitting several distinct edges with the same initial and terminal nodes; they are called the parallel arcs of G d . As before, the parallel arcs directed from node i to node / are denoted by the symbols (/, j)lt (i, j)2, • • • , (i, /)*, k ^ 2. If no particular arc is specified, (i, j) denotes any, but otherwise fixed, arc from i to j . Also, we admit arcs with the same endpoints; they are called the self-loops of G d . The terms subgraph, sectional subgraph, rank, nullity, the complement of a subgraph, and the other graph operations outlined in Section 1.2 can similarly be defined for G d , and there is hardly any point going through the same ground all over again. As an illustration, consider the directed graph Gd(V, E) of Fig. 1.65, which is obtained from the graph of Fig. 1.1 by assigning orientations to the edges. Thus, we have V= {1,2, 3, 4, 5, 6, 7, 8} E = {(1, 2), (3, 3) 1 ; (3, 3) 2 , (3, 6), (6, 6), (6, 4)„ (6, 4) 2 , (4, 5), (4, 3), (5, 3), (7, 8) 1( (7, 8) 2 , (8, 7)}
(1.103)
The directed graph has two parallel arcs from node 6 to node 4 and two from 7 to 8. There are two self-loops at node 3 and one at node 6. The
Fig. 1.65. A directed graph used for illustration.
76
GRAPHS AND NETWORKS
Fig. 1.66. The sectional subgraph G d [3, 4, 6] of the directed graph of Fig. 1.65.
sectional subgraph G d [3,4,6] induced by the nodes 3, 4 and 6 is shown in Fig. 1.66.
DEFINITION 1.45 Associated Undirected Graph. To every directed graph Gd there is an associated undirected graph Gu whose node and edge sets are the same as those in Gd except that the directions of the arcs or the orders in the pairs (i, j) of Gd are removed. Intuitively, the associated undirected graph Gu of Gd is obtained by simply omitting the arrowheads in G d . For example, the associated undirected graph of the directed graph shown in Fig. 1.65 is presented in Fig. 1.1. By the same token, sometimes it is desirable to change an undirected graph into a directed one by the process of duplication: We replace each edge of the graph by a pair of arcs with the same endpoints but with opposite directions. For example, in Fig. 1.67, Gd is the directed graph obtained from G by the procedure just outlined.
(a)
(b)
Fig. 1.67. The conversion of a graph into a directed graph: (a) G; (b) Gd.
1.8 DIRECTED GRAPHS (a)
(b)
77
(c)
Fig. 1.68. Directed graphs used to illustrate the concept of isomorphism: (a) Gd (b) Gd; (c) Gd.
DEFINITION 1.46 Isomorphism. Two directed graphs are said to be isomorphic if (1) their associated undirected graphs are isomorphic, and (2) the directions of their corresponding arcs are preserved for some correspondences of (1). In other words, if Gd and G d are two isomorphic n-node directed graphs, then we can label their nodes 1, 2, . . . , n and 1 ' , 2 ' , . . . , « ' , respectively, so that for any i and j , the arc (i, j) is in Gd if and only if the corresponding arc (i't j') is in G d , containing the same number of parallel arcs if they exist. As an example, consider the directed graphs G d , G d and G d of Fig. 1.68. It is easy to verify that Gd and G d are isomorphic, but Gd and G d are not even though their associated undirected graphs are isomorphic. A directed graph Gd is said to be connected if its associated undirected graph Gu is connected. This is similarly valid for Gd to be planar, separable, or nonseparable. A subgraph Gs of Gd is an arc sequence if the associated undirected graph of Gs is an edge sequence of G u . Similarly, in Gd we define arc train, path, circuit, tree, branch, cotree, chord and component. Also, in Gd we speak of circuit arcs, noncircuit arcs, cutpoints, blocks, length of an arc sequence. They are again defined in terms of G u . In the directed graph Gd of Fig. 1.69, the arc set £ s =
Fig. 1.69. A directed graph used for illustration.
78
GRAPHS AND NETWORKS
e1e2e3e4e5e6e7e4e8e2 is an arc sequence of length 10. If we delete the last three arcs from £ s , we obtain an arc train Et = e1e2e3e4e5e6e7. The arc train becomes a path P after the removal of the arcs e5, e6 and e7 from Et, or P = e1e2e3e4. Gd has one component, and the nodes 3 and 6 are the cutpoints. The blocks are ew, e9, and e1e2e3e4e5e6e1e8. Finally, the subgraph e 1 e 8 e 4 e 5 e 6 is a circuit of length 5, and all the arcs of Gd except e9 are circuit arcs, while e9 is the only noncircuit arc. In addition to the terms defined above, we also need special subclasses of the class of arc sequences.
DEFINITION 1.47 Directed-Arc Sequence. A directed-arc sequence of length k — \ in a directed graph is an arc sequence in which the arcs along the arc sequence are of the form (h, i2), (*2, * 3 ), • • • , ( 4 - i , *'*)
(1.104)
k ^ 2 . The directed-arc sequence is said to be closed if i1 = ik, and open otherwise. In an open directed-arc sequence, the node I'J is called the initial node, and node ik the terminal node. Intuitively speaking, a directed-arc sequence is simply an arc sequence in which all the arcs are oriented in the same direction. For example, in Fig. 1.69, the arc sequence (1,2), (2, 4), (4, 3), (3,1), (1, 5), (5, 3), (3, 2), (2,4), (4, 3)
(1.105)
constitutes an open directed-arc sequence with initial node 1 and terminal node 3. The directed-arc sequence is directed from node 1 to node 3.
DEFINITION 1.48 Directed-Arc Train. If all the arcs appearing in a directed-arc sequence are distinct, the directed-arc sequence is called a directed-arc train. Like the concepts of a path and a circuit, if in addition we require that all the nodes in a directed-arc train except the initial and terminal nodes be distinct, we have the concepts of a directed path and a directed circuit.
DEFINITION 1.49 Directed Path. An open directed-arc train as shown in (1.104) in which all the nodes ilti2, . . . ,ik are distinct is called a directed path of length k-l.
1.8 DIRECTED GRAPHS
79
DEFINITION 1.50 Directed Circuit. A closed directed-arc train as shown in (1.104), in which all the nodes ilt i2, • • • , 4 - i a r e distinct with il = ik, is called a directed circuit of length k — \. Thus, a self-loop is a directed circuit of length 1. For our purposes, it is convenient to define an isolated node as a directed path of zero length. For the directed graph Gd of Fig. 1.69, the arc sequence (1,2), (2,4), (4, 3), (3,1), (1, 5), (5, 3), (3, 6), (6, 6)
(1.106)
is an open directed-arc train of length 8, directing from node 1 to node 6. The open directed-arc train (1,2), (2, 4), (4, 3), (3, 6)
(1.107)
is a directed path of length 4, and the closed directed-arc train (1,2), (2, 4), (4, 5), (5, 3), (3,1)
(1.108)
is a directed circuit of length 5. The local structure of a directed graph is described by the degrees of its nodes. Another term which is useful for describing certain structural features of a directed graph and which has no undirected counterpart is known as strong connectedness.
DEFINITION 1.51 Strong Connectedness. A directed graph is said to be strongly connected if, for every pair of distinct nodes i and j , there is a directed path from i to / as well as one from j to i. A strongly connected directed graph implies the connectedness of the directed graph, but the converse is not generally true. The directed graph Gd of Fig. 1.70 is strongly connected, but the connected directed graph of
Fig. 1.70. A strongly connected directed graph.
80
GRAPHS AND NETWORKS
Fig. 1.71. A connected but not strongly connected directed graph.
Fig. 1.71 is not. Observe that strong connectedness does not depend on the number of arcs that a directed graph possesses, but rather their strategic locations.
DEFINITION 1.52 Strong Component. A strong component or a strongly connected component of a directed graph is a strongly connected subgraph containing the maximal number of arcs. An isolated node is a strong component.
In Fig. 1.71, the sectional subgraphs G d [l,4] and G d [2,3,5] are strong components of G d , and are shown in Fig. 1.72. The characterization of a strongly connected directed graph is given below.
Fig. 1.72. Strongly connected sectional subgraphs of the directed graph of Fig. 1.71: (a) Gd [1, 4]; (b) Gd [2, 3, 5].
1.8 DIRECTED GRAPHS
81
THEOREM 1.32 A necessary and sufficient condition for a directed graph to be strongly connected is that there exists a closed directed-arc sequence containing all of its nodes. The proof of the theorem is straightforward, and is omitted. In the theorem, if we replace the word nodes by arcs, we find that the theorem remains valid. 1.8.1
Matrices Associated with a Directed Graph
As in the case for an undirected graph, a directed graph can be conveniently described by a number of matrices. Since the results are very similar and since their proofs can be carried out in exactly the same manner, we will review only the highlights and concentrate our discussions on the differences, leaving the details as obvious.
DEFINITION 1.53 Incidence Matrix. The incidence matrix A a of an n-node fo-arc directed graph is a matrix of order n X b such that if A a = \_a(l\, then a(j = 1 if arc ey is incident at node i and is directed away from node i
(1.109a)
ait = — 1 if arc ey is incident at node i and is directed toward node/ a,y = 0 if arc ey is not incident at node i
(1.10%) (1.109c)
We remark that the entries in A a are now treated as real integers. The choice of symbolism here, as in the case of circuit and cut matrices to follow, is guided by the fact that the essential structure of the matrix A a is the same for directed and undirected graphs. In fact, the properties of these matrices, and to a large extent the methods of proving them, are identical to those in the undirected case. Hence, the proofs in this section are given in outlined form only and are often omitted.
THEOREM 1.33 The rank of the incidence matrix of a directed graph is equal to the rank of the directed graph.
82
GRAPHS AND NETWORKS
A basis incidence matrix A of a fe-arc directed graph Gd of rank r is a submatrix of order rxb and of rank r of its incidence matrix A a . The submatrix obtained from A a by deleting any of its rows is a basis incidence matrix. The node corresponding to the deleted row of A a is referred to as the reference node of G d .
THEOREM 1.34 A square submatrix of a basis incidence matrix A of a connected directed graph is a major submatrix if and only if the columns of this submatrix correspond to the branches of a tree in the directed graph. Likewise, we define the circuit matrix. Since we are dealing with a directed graph, it is natural to orient the circuits.
DEFINITION 1.54 Oriented Circuit. A circuit of a directed graph with an orientation assigned by a cyclic ordering of nodes along the circuit is called an oriented circuit. As an illustration, consider the directed graph Gd of Fig. 1.73. The circuit Li = eie2e5 composed of the arcs e,, e2 and e5 can be oriented either as (1, 2, 4) or as (1, 4, 2). These orientations can be represented pictorially by an arrowhead. For the orientation (1,2,4), it can be represented by a clockwise arrowhead as shown in Fig. 1.73. Likewise, the circuits L 2 = e3e4e5 and L3 = e1e2e3e4 with orientations (2,3,4) and ( 1 , 2 , 3 , 4 ) are depicted pictorially in Fig. 1.73 by clockwise arrowheads. We shall say that the orientations of an arc of a circuit and the circuit coincide if the nodes of the arc appear in the same order both in the ordered-pair representation of the arc and in the ordered-node representation of the circuit. Otherwise, they are opposite. Pictorially, the meaning is obvious. For example, the arc (1,2) coincides with the circuit (1, 2, 4), and (4,2) is opposite to the circuit. Note that a circuit of a directed graph need not be a directed circuit.
Fig. 1.73. Three oriented circuits in a directed graph.
1.8 DIRECTED GRAPHS
83
DEFINITION 1.55 Circuit Matrix. The circuit matrix Ba of a fe-arc directed graph is a matrix of order p x b, where p is the number of circuits in the directed graph, such thatif JBa = [6,y], then ba = 1 if arc e, is in circuit i and the orientations of the circuit and the arc coincide
(1.110a)
bq = — 1 if arc ey is in circuit i and the orientations of the circuit and the arc are opposite
(1.1106)
bij = 0 if the arc e, is not in circuit i
(1.110c)
As in the case for an undirected graph, a basis circuit matrix B of a b-arc directed graph Gd of nullity m is a submatrix of order mx b and of rank m of its circuit matrix Ba. This matrix contains all the essential information that is contained in Ba. Similarly we define the fundamental circuits or simply the f-circuits with respect to a tree t of a directed graph Gd and the fundamental circuit matrix or the f-circuit matrix Bf. The orientation of an f-circuit is chosen to agree with that of the defining chord. As before, an f-circuit matrix can be partitioned as in (1.63), and the orthogonal relations (1.66) remain valid.
THEOREM 1.35 If the columns of the incidence matrix A a and the circuit matrix Ba of a directed graph are arranged in the same arc order, then AaB'a = 0
and
BaAa = 0
(1111)
THEOREM 1.36 The rank of the circuit matrix of a directed graph is equal to the nullity of the directed graph.
THEOREM 1.37 A square submatrix of a basis circuit matrix of a connected directed graph is a major submatrix if and only if the columns of this submatrix correspond to the chords of a cotree in the directed graph. We illustrate the above results by the following example.
84
GRAPHS AND NETWORKS
Example 1.3 Consider the directed graph Gd of Fig. 1.73. The incidence matrix Aa of Gd is found to be ex
e2
e3
e4
es
-1
1
0
0
0"
0 - 1
1
0
0
. 1
-
0
0 - 1 1
1
(1.112)
0
0 - 1
1
By deleting row 4 from A a , we obtain a basis incidence matrix 1 "-1
1
0
0
0
=2
0
-1
1
0
-1
3
0
0
-1
1
0
(1.113)
with node 4 serving as the reference node. Observe that each column of Aa contains two nonzero elements, a plus 1 and a minus 1. Thus, if A is given, Aa can be recovered completely. Refer to the three oriented circuits Llt L2 and L3, as shown in Fig. 1.73. The circuit matrix B~ is obtained as
U
"1
e2 1
Ba = L2
0
0
1
1
1
_1
1
1
1
0
ei
L3
e3 0
e4 0
e5 -1 (1.114)
A basis circuit matrix B is found by deleting the third row from Ba: LAI
"do
1
0
0
-11
o i
i
j
Each major submatrix of A corresponds to a tree in G d , and each major submatrix of B to a cotree of G d . The sets T and T of trees and cotrees are found to be T= {e2e3e4, exe3e4, e^e^,
e^e^,
e2e3e5, e2e4e5, exeAe5, e,e 3 e 5 } (1.116)
t= {exes, e2e5, e3e5, e4e5, exe4, ere3, e2e3, e2e4}
(1-117)
From (1.112) and (1.114), it is straightforward to verify (1.111), as
1.8 DIRECTED GRAPHS
85
follows:
aBa
—
~-l
1
0
0
0
0
-1
1
0
-1
0 1
0 0
-1 0
1 -1
0 1
1 0
1"
1 0
1
0
1 1
0
1 1
1
1 0.
"0 0 0" 0 0 0 =
0
0 0
0
0 0 (1.118)
Suppose that we pick a tree, say, t = e2e4e5 in G d . The f-circuit matrix B( with respect to t is identical to that of (1.115). If the columns of B( are arranged in the order of chords ex and e3 and the branches e 2 , e 4 and e 5 , then Bt can be partitioned as
Bt =
oi
e4 0
-1
1 j
1
1
e3
exe2e5
e\ ~\
e3e4e5
.0
e2
(1.119)
which contains the identity matrix of order 2 formed by the first two columns corresponding to the chords ex and e 3 . Like the oriented circuit, we next define the orientation of a cut.
DEFINITION 1.56 Cut Orientation. For a directed graph G d , let V] and V2 be the sets of nodes partitioned by a cut of G d . The cut is said to be oriented if the sets Vx and V2 are ordered either as (Vi, V2) or as (V2, Vi). In most cases, the orientation of a cut may be represented by an arrow. For example, we can place an arrow near the broken line defining the cut. In Fig. 1.74, the orientations of the cuts of the directed graph Gd are as indicated by the arrows. However, the cutset C 7 =^xe2e3e4 cannot be represented in this way unless we redraw Gd such as by interchanging the positions of the nodes 3 and 4. Let a cut C be ordered as (Vi, V2). We say that the orientations of the arc (i, j) and the cut C coincide if i is in Vi and j in V2. Otherwise, they are opposite. Pictorially, the meaning is obvious. In Fig. 1.74 the orientations of the arc e 2 = (1, 2) and the cutsets C 4 and C 6 coincide, and the orientations of e2 and the cutset Ci are opposite.
86
GRAPHS AND NETWORKS
Fig. 1.74. A directed graph and its oriented cutsets denoted by the broken lines.
DEFINITION 1.57 Cut Matrix. The cut matrix Qa of a b -arc directed graph is a matrix of order qxb, where q is the number of nonempty cuts in the directed graph, such that if Qa = [q^], then qtj = 1 if arc e; is in cut i and the orientations of the cut and the arc coincide
(1.120a)
qtj = — 1 if arc e; is in cut i and the orientations of the cut and the arc are opposite
(1.1206)
qij = 0 if the arc ey is not in cut i
(1.120c)
A result similar to that given in (1.77) follows from the observation that since the number of arcs common to a cut and a circuit is always even, say, 2k, then k of these arcs have the same relative orientation in the cut and in the circuit and the other k arcs have one orientation in the cut and the oposite orientation in the circuit.
THEOREM 1.38 If the columns of the cut matrix Qa and the circuit matrix Ba of a directed graph are arranged in the same arc order, then QaB'a = 0
and
BaQ'a = 0
(1.121)
THEOREM 1.39 The rank of the cut matrix of a directed graph is equal to the rank of the directed graph.
1.8 DIRECTED GRAPHS
87
A basis cut matrix Q of a b -arc directed graph Gd of rank r is a submatrix of order r x d and of rank r of its cut matrix Qa. This matrix contains all the essential information that is contained in Qa. Likewise, we define the fundamental cutsets or simply the f-cutsets with respect to a tree t of Gd and the fundamental cutset matrix or the f-cutset matrix Qt. The orientation of an f-cutset is chosen to agree with that of the defining branch. As before, an f-cutset matrix Qf can be partitioned as in (1.78).
THEOREM 1.40 A square submatrix of a basis cut matrix of a connected directed graph is a major submatrix if and only if the columns of this submatrix correspond to the branches of a tree of the directed graph. We illustrate the above results by the following example. Example 1.4 Consider the directed graph Gd of Fig. 1.74. Except the cutset C 7 = ele2e3eA, the other six oriented cutsets are as indicated in Fig. 1.74. The cut matrix is obtained as
1
e2 -1
e3 0
e4 0
es 0
e6 -1
c2 c3
-1
0
0
1
-1
0
0
0
1
-1
0
1
6a=C4
0
1
-1
0
1
0
c5 c6 c7
-1
0
1
0
-1
1
0
1
0
-1
1
1
_-l
1
-1
1
0
0
ei
Ci
(1.122)
Suppose that we pick the tree t = e2e4e6 in G d . The f-cutset matrix Qf corresponding to the three f-cutsets C fl , Ca and C 0 as depicted in Fig. 1.75 is given by ei
c„
~ 0
Qf = Cn
-1
C„
_-l
e3 -1
e5 1
e2 1
e6 0
e4 0"
1 -1
0
1
0
0
0
0
1_
-1
(1.123)
the last three columns of which correspond to the branches of t. Thus, Qf
88
GRAPHS AND NETWORKS
Fig. 1.75. Three f-cutsets with respect to the tree t = e2e4e6. is a basis cut matrix, each of whose major submatrices corresponds to a tree in G d . These trees are found to be T = {ele2e3, e2e3e4, exe3e4, exezea„ exe2eb, e2e3e5,
e3e4e6,
eie4e5, e2e4e5, exe3e5, e2e4e6, exe3eb, eie 5 e 6 , e2e5e6, e3e5e6, e4e5e6}
(1.124)
Finally, with respect to the same tree t = e2e4e6 the f-circuit matrix Bf for the three f-circuits Ln = exe4e6, Lf2 = e2e3e6 and Lf3 = e2e4e5e6 is obtained as
Lf3
e2
e6
e4
e3
e5
1
0
0
0
1
1"
0
1
0
1
-1
0
Lo
0
1
-1
1
1
(1.125)
giving from (1.123) and (1.125)
0 - 1 Q(Bi =
1
1
0
- 1 1 - 1 0 -
1
confirming (1.121).
0
-
1
o" 1 0
0
0
1
.
1
0
0
0
1
0
0
0
1
0
1
-1
1
-1
1
1
0
1
=0
(1.126)
1.8 DIRECTED GRAPHS
1.8.2
89
Interrelationships among the Matrices
As in the case for an undirected graph, the basis incidence matrix, the f-circuit matrix and the f-cutset matrix are related in a similar fashion.
THEOREM 1.41 If the columns of a basis incidence matrix A, an f-circuit matrix Bf and an f-cutset matrix Qf of a directed graph of rank r and nullity m are arranged in the order of chords and branches for the tree defining B f and Qt such that, in partitioned forms, A = [An
Al2]
(1.127a)
Bt = [Um
Bn2]
(1.1276)
Qt=[Qtn
Ur]
(1.127c)
-A'uA',21]
(1.128a)
then Bt=[Um Q( = A^A
= [-B'fl2
Ur]
(1.1286)
To avoid the calculation of the inverse of A12 in (1.128), we define the node-to-datum path matrix for a directed graph.
DEFINITION 1.58 Node-to-Datum Path Matrix. For an «-node tree in a directed graph, the node-to-datum path matrix P of the tree with reference node n is a matrix of order n — 1 such that if P = [ptj] then Ptj = 1 if branch e, is contained in the unique path connecting the nodes / and n, and is directed toward the node n in the path
(1.129a)
Pi, = — 1 if the branch e, is contained in the unique path connecting the nodes j and n, and is directed away from the node n in the path
(1.12%)
Pii = 0 if branch e, is not contained in the unique path connecting the nodes j and n
(1.129c)
In the directed graph Gd of Fig. 1.75, choose the tree t = e2e4e6 as shown
90
GRAPHS AND NETWORKS
Fig. 1.76. A tree used to calculate the node-to-datum path matrix.
in Fig. 1.76. The node-to-datum path matrix P of this tree with reference node 4 is found to be
=
1
2
3
e2 "0 ?6 1
-1
0
1
0
e4 _1
1
1
(1.130)
THEOREM 1.42 The inverse of a major submatrix of the basis incidence matrix of a connected directed graph with reference node n is equal to the node-to-datum path matrix of the tree corresponding to the columns of the major submatrix with n used as the reference node of the tree. Example 1.5 Consider the directed graph Gd of Fig. 1.75, the basis incidence matrix A of which with reference node 4 is given by
0
e5 0
e2 1
e6 1
e4 0
0
1
-1
-1
0
0
3 _ 0
-1
0
0
-1
1
ei
3
1 "-1 =2
(1.131)
Choose the tree t = e2e4e6. The submatrix A 1 2 formed by the last three columns of A corresponding to the branches of t is a major submatrix, whose inverse is the node-to-datum path matrix P of t with reference
1.8 DIRECTED GRAPHS
91
node 4:
A^
1
2
3
e 2 "0 = P = e6 1
-1
0
1
0
e4 _1
1
1
(1.132)
obtaining from (1.128) the f-circuit matrix Bt and the f-cutset matrix Qf as 0 1 1
1
Q, = An A-
0 -1 -1
-
-1 1 1
1 1 1-1 0 - 1
Bt=[U3
-1 0 0
0~| 0
lj 1
1 0
-Q'm]
0 -1 0
1 1 -1 0 0 -1
0 0 1
0~ 0 1_
0 0 0
0 1 -1
~1 0 0
(1.133)
0 1 0
0 0 1
0 1 -1
1 -1 1
1 0 1
(1.134)
confirming (1.123) and (1.125). 1.8.3
Some Important Classes of Directed Graphs
We have already seen graphs and directed graphs classified on the basis of whether they are planar or nonplanar, and separable or nonseparable. In the present section, we introduce three other useful classifications.
DEFINITION 1.59 Symmetric Directed Graph. A directed graph Gd is said to be symmetric if, for every arc (i,;') of G d , it is matched by an arc (/', i) of Gd with the same number of parallel arcs in each direction if they exist. The definition implies that if there are k arcs directed from i to j then there are k arcs directed from j to i. We remark that the number of self-loops at a node has no effect on its symmetry. Thus, if Gd is symmetric then the number of arcs outgoing from a node must be equal to the number of arcs terminating at the node. The converse, however, is not generally true. Fig. 1.77 is an example of a symmetric directed graph.
92
GRAPHS AND NETWORKS
Fig. 1.77. A symmetric directed graph.
DEFINITION 1.60 Acyclic Directed Graph. A directed graph is said to be acyclic if it contains no directed circuits.
DEFINITION 1.61 Complete Directed Graph. A directed graph having no self-loops is said to be complete and of order k if, for each pair of nodes, there are k and only k parallel arcs in each direction. A complete directed graph of order 1 is simply called a complete directed graph.
DEFINITION 1.62 Directed Bipartite Graph. A directed graph G(V, E) is said to be bipartite if its node set V can be partitioned into two disjoint subsets V^ and V2 such that each of the arcs has its initial node in Vl and the terminal node in V2. The directed graph of Fig. 1.78 is acyclic, because it does not contain any
Fig. 1.78. An acyclic directed graph.
1.9 CIRCUIT MATRIX
93
Fig. 1.79. The four-node complete directed graph.
Fig. 1.80. A directed bipartite graph K3A. directed circuits. Fig. 1.79 is the four-node complete directed graph. Fig. 1.80 is an example of a directed bipartite graph.
1.9 THE CIRCUIT MATRIX ASSOCIATED WITH A PLANAR GRAPH OR DIRECTED GRAPH In Sections 1.4 and 1.5, a planar graph is characterized in terms of certain forbidden subgraphs or its dual graph. In the present section, we give another criterion for planarity due to MacLane (1937) in terms of the existence of a certain basis circuit matrix. As before, we use the modulo 2 algebra for undirected graphs and the real number system for directed graphs. Recall that in a planar graph, a mesh is a circuit formed by the boundary edges of a region because of its appearance as mesh in a fishing net. For the planar graph G of Fig. 1.81, the circuit matrix Bp corresponding to the
94
GRAPHS AND NETWORKS
Fig. 1.81. A planar graph.
meshes of the regions Ru R2, R3 and R4 of G is found to be
Ri
B
-*2 R4
ex e 2 "1 1
e3 1
e4 1
e5 0
e6 0
e7 0
e8 0"
0
0
1
0
1
1
0
0
0
0
0
1
0
1
1
1
1
1
0
0
1
0
1
1
(1.135)
Observe that since each edge is traversed by exactly two meshes, each column of Bp contains exactly two ones. Thus, by the Euler formula (1.21) the rank of Bp is at most q — 1= 6 — n +
l=m
(1.136)
the nullity of G. Likewise, for the directed graph Gd of Fig. 1.82, if all the interior meshes are oriented clockwise and the exterior mesh counterclockwise, as indicated, the circuit matrix Bp becomes
~ 1
e2 1
e3 -1
e4 -1
e5 0
e6 0
e7 0
e& 0
0
0
1
0
1
1
0
0
0
0
0
1
0
-1
1
1
R4 _ - l
-1
0
0
-1
0
-1
-1
ei Ri
B-*2
(1.137)
Again, each arc of Gd is traversed by exactly two meshes oriented in opposite directions. Thus, each column of Bv contains exactly two nonzero elements, a + 1 and a —1, again showing that the rank of this matrix is at most m. By induction over the number of edges over G or arcs over G d , we can show that m is also the minimum rank of BD.
1.9 CIRCUIT MATRIX
95
Fig. 1.82. A directed planar graph with oriented meshes.
THEOREM 1.43 The circuit matrix corresponding to the interior meshes of a planar graph or a planar directed graph is a basis circuit matrix. In fact, the above properties can also be used to characterize planarity of a graph.
THEOREM 1.44 A graph is planar if and only if every block of the graph with at least three nodes has a basis circuit matrix B and one additional row corresponding to a circuit such that the augmented matrix formed by B and this additional row contains exactly two ones in each column. We only indicate the necessity. Since by Theorem 1.10 a graph is planar if and only if each of its blocks is planar, it suffices to consider a planar nonseparable graph G of nullity m with at least three nodes. Then there are m interior meshes and one exterior mesh. By Theorem 1.43, the circuit matrix of these m interior meshes is a basis circuit matrix B of G. This together with the row corresponding to the exterior mesh constitutes the desired augmented matrix, each of whose columns contains exactly two ones. To prove sufficiency, it is necessary to construct a plane embedding of G with the stipulated properties. We refer to MacLane (1937) for its proof.
96
GRAPHS AND NETWORKS
1.10 SUMMARY AND SUGGESTED READING We began the chapter by introducing basic definitions of abstract graphs in order to establish the vocabulary for describing graphs and to provide a number of results that are needed in the subsequent analysis. We then defined a number of operations on graphs that are useful in expressing the structure of a given graph in terms of smaller or simpler graphs. Depending upon the structure, graphs are classified in many different ways such as nonseparable and separable graphs, bipartite graphs, and planar graphs. Our discussions on the planar graphs were rather detailed. We showed that a graph is planar if and only if it does not contain certain forbidden subgraphs. These forbidden graphs are subgraphs homeomorphic to either K5 or K33. Alternatively, a planar graph can be characterized in terms of its dual graphs. Two types of dual graphs were defined: a geometric dual and a combinatorial dual. We showed that a graph is planar if and only if it has a combinatorial dual. Furthermore, a graph has a combinatorial dual if and only if it has a geometric dual, thereby establishing the equivalency of the geometric dual and the combinatorial dual. As a result, it is not necessary to say that two graphs are either geometric duals or combinatorial duals. It suffices to say that they are dual graphs. In addition, we demonstrated that every planar graph that does not contain any parallel edges and self-loops can be drawn on a plane without intersection using only straight lines as edges. For the purposes of interchanging of series-connected subgraphs, we introduced the notion of 2-isomorphism of two graphs, that is of great interest in electrical network theory. Specifically, we showed that two graphs are 2-isomorphic if and only if there is a one-to-one correspondence between their edges such that circuits in one correspond to circuits formed by the corresponding edges in the other. The most convenient way to study the properties of a graph is to express the incidence relations between the edges and nodes, circuits, cuts or paths by means of a matrix. For this we defined the incidence matrix, the circuit matrix, the cut matrix, and the node-to-datum path matrix. We showed that over the modulo 2 algebra the rank of the incidence matrix or the cut matrix of a graph is equal to the rank of the graph, whereas the rank of the circuit matrix of a graph is equal to the nullity of the graph. As a result, the basis incidence matrix, the basis circuit matrix and the basis cut matrix contain all the essential information that is contained in the original matrices. Furthermore, we established that there is a one-to-one correspondence between trees or cotrees of a graph and the major submatrices of these basis matrices. A simple and systematic way to construct a basis circuit or cut matrix is the use of the fundamental circuits or cutsets. For this we introduced the notion of f-circuits and f-cutsets with respect to a chosen tree of a graph. The basis matrices formed by these f-circuits and f-cutsets are the f-circuit matrix and the f-cutset matrix. If the columns of these matrices
REFERENCES
97
are arranged in the order of chords and branches for the defining tree, the matrices, in partitioned forms, contain the identity matrix, thereby making it possible for them to be expressible in terms of the submatrices of a basis incidence matrix. However, these expressions require the inversion of a major submatrix of the basis incidence matrix. To circumvent this difficulty, we introduced the node-to-datum path matrix of a tree, and showed that the inverse of a major submatrix of the basis incidence matrix of a connected graph with reference node n is equal to the node-to-datum path matrix of the tree corresponding to the columns of the major submatrix with n used as the reference node of the tree. In many applications, it is necessary to associate with each edge of a graph an orientation or direction. For this we studied the basic concepts and terms associated with directed graphs. Since most of the concepts are directly analogous to those presented for undirected graphs, they were mentioned only briefly. Terms that have no undirected counterparts were discussed in detail. These are directed-arc sequence, directed-arc train, directed path, directed circuit, strong connectedness and strong component. As in the case for an undirected graph, a directed graph can be conveniently described by the incidence matrix, the circuit matrix, the cut matrix and the node-to-datum path matrix. Their properties are identical to those for the undirected graphs except that we now use the real numbers instead of the modulo 2 algebra and that we deal with the oriented circuits and cuts. Finally, we introduced some important classes of directed graphs such as the symmetric directed graph, the acyclic directed graph, the complete directed graph, and the directed bipartite graph, and gave another criterion for planarity in terms of the existence of a certain basis circuit matrix. Specifically, we demonstrated that the circuit matrix corresponding to the interior meshes of a planar graph or a planar directed graph is a basis circuit matrix, and that a graph is planar if and only if every block of the graph with at least three nodes has a basis circuit matrix and one additional row corresponding to a circuit such that the augmented matrix formed by the basis circuit matrix and this additional row contains exactly two ones in each column. For general information and other aspects of graph theory, we refer to the well written books of Berge (1962) and Harary (1969). For applications of graphs to electrical network theory, we refer to Chen (1976). For algorithms related to graph problems, see Nijenhuis and Wilf (1975) and Hu (1982).
REFERENCES Berge, C. (1962), Theory of Graphs and its Applications, London, England: Methuen.
98
GRAPHS AND NETWORKS
Branin, F. H. Jr (1962), "The relation between Kron's method and the classical methods of network analysis," Matrix Tensor Quart., vol. 13, pp. 69-105. Chen, W. K. (1976), Applied Graph Theory: Graphs and Electrical Networks, Amsterdam, The Netherlands: North-Holland, 2nd revised edition. Dirac, G. A. and Schuster, S. (1954), "A theorem of Kuratowski," Nederl. Akad. Wetensch. Proc, Ser. A., vol. 57, pp. 343-348. Fary, I. (1948), "On straight line representation of planar graphs," Acta Sci. Math. Szeged., vol. 11, pp. 229-233. Harary, F. (1969), Graph Theory, Reading, Mass.: Addison-Wesley. Harary, F. and Tutte, W. T. (1965), "A dual form of Kuratowski's theorem," Can. Math. Bull., vol. 8, pp. 17-20, and p. 373. Hu, T. C. (1982), Combinatorial Algorithms, Reading, Mass.: Addison-Wesley. Kirchhoff, G. (1847), "Uber die Auflosung der Gleichungen, auf welche man bei der Untersuchungen der linearen Verteilung galvanischer Strome gefuhrt wird, Ann. Phys. Chem., vol. 72, pp. 497-508. Konig, D. (1950), Theorie der endlichen und unendlichen Graphen, New York: Chelsea. Kuratowski, K. (1930), "Sur le probleme des courbes gauches en topologie," Fund. Math., vol. 15, pp. 271-283. MacLane, S. (1937), "A structural characterization of planar combinatorial graphs," Duke Math. J., vol. 3, pp. 460-472. Nijenhuis, A. and Wilf, H. S. (1975), Combinatorial Algorithms, New York: Academic Press. Ore, O. (1962), Theory of Graphs, Providence, Rhode Island: Amer. Math. Soc. Colloq. Publ. 38. Seshu, S. and Reed, M. B. (1956), "On the cut sets of electrical networks," Proc. 2nd Midwest Symposium on Circuit Theory, Michigan State University, East Lansing, Michigan, pp. 1.1-1.13. Stein, S. K. (1951), "Convex maps," Proc. Amer. Math. Soc, vol. 2, pp. 464-466. Tutte, W. T. (1958), "A homotopy theorem for matroids," Trans. Amer. Math. Soc, vol. 88, pp. 144-174. Tutte, W. T. (1959), "Matroids and graphs," Trans. Amer. Math. Soc, vol. 90, pp. 527-552. Tutte, W. T. (1963), "How to draw a graph," Proc. London Math. Soc, vol. 13, pp. 743-767. Veblen, O. (1931), Analysis Situs, Providence, Rhode Island: Amer. Math. Soc. Colloq. Publ. 5. Wagner, K. (1936), "Bemerkungen zum Vierfarbenproblem," Jber. Deutsch. Math.-Verein., vol. 46, pp. 26-32. Wagner, K. (1937), "Uber eine Eigenschaft der ebenen Komplexe," Math. Ann., vol. 114, pp. 570-590. Whitney, H. (1932), "Non-separable and planar graphs," Trans. Amer. Math. Soc, vol. 34, pp. 339-362. Whitney, H. (1933«), "Planar graphs," Fund. Math., vol. 21, pp. 73-84. Whitney, H. (19336), "2-isomorphic graphs," Amer. J. Math., vol. 55, pp. 245-254.
2 THE SHORTEST DIRECTED PATH PROBLEM
A weighted directed graph is called a directed network or simply a net. The real numbers assigned to the arcs of the net may be positive, negative, or zero, and may be considered as the 'lengths' of the arcs. For example, if the streets of a city are represented by a net, where the nodes denote the intersections of the one-way and/or two-way streets and the arcs denote the streets, then the lengths associated with the arcs represent the true lengths of the streets from one intersection to the next. Likewise, an electrical system may be modeled by a net whose nodes denote the various states of the system and whose arcs represent all permissible transitions among the states. The length associated with an arc (i, j) is then the energy required in transforming the state i to the state j with positive length indicating energy absorption and negative length indicating energy release. The length of a directed edge train is the sum of lengths of all the arcs in the directed edge train. In general, there are many directed edge trains from a specified node s to another t in a given net. A directed edge train with minimum length from s to t is called a shortest directed edge train from s to t in the net. The length of a directed circuit is the sum of lengths of all the arcs in the directed circuit. If the length of a directed circuit is negative, we say that the directed circuit is negative and the net contains a negative directed circuit. The problem of finding a shortest directed edge train in a net is not always well defined if the net contains a negative directed circuit. To see this, let C be such a negative directed circuit and let i be a node on C. If i is also on a directed edge train from node s to node t, then by proceeding from s to i, traversing the directed circuit C a sufficient number of times, and finally following the directed edge train from i to t, we obtain a directed edge train with arbitrarily small length, which may approach — oo. 99
100
THE SHORTEST DIRECTED PATH PROBLEM
Thus, in such a situation the problem is not well defined. For our purposes, we shall restrict ourselves to the class of nets that do not contain any negative directed circuits. Then the problem of finding a shortest directed edge train from s to t is equivalent to that of finding a shortest directed path from s to t. This follows from the fact that a shortest directed path from s to t is as short as any shortest directed edge train from s to t provided that the net does not contain any negative directed circuits. Under this assumption, it is sufficient to consider the shortest directed path problem in a net that does not contain any negative directed circuits. The shortest directed path problem is important in that it often occurs as a subproblem of other optimization problems. For instance, a minimal cost flow problem to be discussed in Chapter 5 can be formulated as a shortest directed path problem in a net in which the lengths of the arcs denote the costs in establishing the flows in the arcs. Or, in setting up a distribution system, it is frequently required to choose a minimal cost route among many alternate shipping routes. Cartaino and Dreyfus (1957) have shown that the problem of determining the least time for an airplane to climb to a given altitude can be formulated, in its discrete form, as a shortest directed path problem. Furthermore, the shortest directed path problem can usually be modified to solve other optimum path problems such as the longest directed path problem. The purpose of this chapter is to describe a number of combinatorial algorithms for the shortest directed path problem in a net that does not contain any negative directed circuits.
2.1
SHORTEST DIRECTED PATHS
Given a net G(V, E) with node set V and arc set E, suppose that each arc (i, j) e E is associated with a real number /(/', j) called the length of the arc (i, j). The function / from the arc set E to the reals is the length function. Sometimes, it is convenient to consider arcs not in E to be arcs of infinite length in G. Therefore, a net is a triplet and can be compactly written as G(V, E, I). To simplify the notation, we adopt the following convention for any nonempty subgraph g(Va, Ea) of G:
i(g)-
2
KUi)
(2-i)
Thus, if Pst is a directed path from node s to node t in G, then l(Psl) is the length of the directed path Pst. This length is different from that defined in Definition 1.49. To distinguish, sometimes the length in Definition 1.49 is referred to as the arc length. This should not create any confusion as the context will reveal. This leads to the notion of distance.
2.1 SHORTEST DIRECTED PATHS
101
Fig. 2.1. A net G(V, E, I) used to illustrate the length function. DEFINITION 2.1 Distance. The length of a shortest directed path from a node s to a node t in a net is called the distance from 5 to t in the net. Fig. 2.1 is a net G(V, E, I) with node set V and arc set E given as (2.2a)
V = {1,2, 3, 4, 5} E = {(1, 2), (1, 3), (1, 5), (2, 4), (2, 5), (3, 2), (3, 5),
(2.2b)
(4, 1), (4, 3), (4, 5), (5, 4)} The length function / from E to the reals is denned as 1(1, 2) = 1,
/(1,3) = 4,
/(1,5) = 4,
/(2,4) = - l ,
/(2,5) = 2,
1(3, 2) = 2,
/(3, 5) = 3,
1(4,1) = 2,
1(4, 3) = -1,
1(4, 5) = - 1 ,
/(5,4) = 2
(2.3)
There are seven direc ted paths P$ (k = 1, 2, . . . , 7) from node 1 to node 5, and they are found to be
PiV = (l,2)(2,5)
(2.4a)
P<25>
= (1,2)(2,4)(4,5)
(2-46)
Pg> = (l,2)(2,4)(4,3)(3,5)
(2.4c)
Pi? = (1,5)
(2.4d)
P<55>
= (1,3)(3,2)(2,5)
(2.4e)
Pi? = (l,3)(3,2)(2,4)(4,5)
(2-4/)
P # = (l,3)(3,5)
(2-4g)
102
THE SHORTEST DIRECTED PATH PROBLEM
the lengths of which are computed as /(Pi?) = 1(1, 2) +1(2, 5) = 1 + 2 = 3
(2.5a)
/(Pi?) = 1(1, 2) +1(2, 4) + 1(4, 5) = 1 - 1 - 1 = - 1
(2.56)
/(Pi?) = 1(1, 2) +1(2, 4) + 1(4, 3) +1(3, 5) = 1 - 1-1- + 3 = 2 (2.5c) /(Pg>) = /(1,5) = 4
(2.5d)
/(Pi?) = 1(1, 3) + /(3, 2) + /(2, 5) = 4 + 2 + 2 = 8
(2.5e)
/(Pi?) = 1(1, 3) + /(3, 2) + /(2, 4) +1(4, 5) =4+2-1-1=4 /(P$?) = /(l,3) + /(3,5) = 4 + 3 = 7
(2.5/) (2-5g)
Thus, the directed path Pi? of length —1 is the shortest path from node 1 to node 5 in G. There is one directed path Pi? of length 2, one Pi? of length 3, two Pi? and Pi? of length 4, one Pi? of length 7, and one Pi? of length 8. Consider the directed subpath P ( # = (1, 3)(3, 2) of the directed path Pi?. The length of the subpath P ^ is 6 whereas the length of Pi? is 4. Thus, the length of a directed path need not always be longer than that of its subpath. However, if all the arcs are of positive length, then the length of a directed path is always longer than that of any of its subpaths. Let Pst be a shortest directed path from s to t in G(V, E, I). Then any of its subpaths must itself be a shortest directed path in G. To see this, suppose that Pj. is a subpath of Ps, from node i to node /. If there is a shorter directed path Py from i to / in G, then by proceeding from 5 to i on Pst, following the shorter directed path Pijt and finally proceeding from ; to t on Ps„ we produce a directed path from s to t which is shorter than Pst, contradicting the assumption that Pst is the shortest directed path from s to t. Thus, any subpath of a shortest directed path must itself be a shortest directed path. Since any path in a directed graph of n nodes contains at most n — 1 arcs, any shortest directed path in an rc-node net contains at most n — 1 arcs. Note that in most applications, we can replace an undirected edge between nodes i and j by two arcs of the same length, one from i to j and the other from / to i, denoted by (i, j) and (/, i). Thus, any undirected graph or mixed graph can be converted into a directed graph. In this sense, an undirected edge with negative length in an undirected or mixed graph is equivalent to a negative directed circuit in its associated directed graph. As in other methods for solving the shortest directed path problem, the algorithms described in this chapter also yield, on one application, the shortest directed paths from a given node to all other nodes of the net that can be reached from the given node. Therefore, we shall discuss the problem of finding the shortest directed paths from one node, called the source node, to all other nodes in a net. A more general problem is that of finding the shortest
2.2 SHORTEST DIRECTED PATH ALGORITHMS
103
directed paths between all pairs of nodes. These and other related problems will be treated in the following.
2.2
SHORTEST DIRECTED PATH ALGORITHMS
In this section, we describe several simple and efficient combinatorial algorithms for finding the shortest directed paths from a given node to all other nodes of a net that does not contain any negative directed circuits. The first algorithm is valid for the special situation where the arc lengths of a net are all nonnegative. The remainder of the algorithms are general and can be used in any nets with positive, zero or negative arc lengths as long as they do not contain any negative directed circuits. The special situation is considered first because it occurs most frequently in practice and the algorithm is most efficient in relation to the more complicated general algorithms. It is sufficiently important to be considered separately. 2.2.1
Dijkstra Algorithm
The most efficient algorithm for finding the shortest directed paths from a given node s to all other nodes in a net G(V, E, I) with nonnegative arc lengths /(i,;)^0
for all (i,/) e E
(2.6)
was first given by Dijkstra (1959). The algorithm is based on assigning labels to the nodes. The labels are continuously updated by an iterative procedure. At each stage, the number assigned to each node represents an upper bound on the directed path length from s to that node. At the end of the procedure, the node label becomes the exact length of a shortest directed path from s to that node in question. To proceed, let each node i of G be assigned a nonnegative real number l(i) called the label of i. Initially, all the labels are temporary. At each iteration, one of the temporary labels is made permanent, say /(/). To distinguish a temporary label from a permanent one, we use /*(/) to indicate that node / has received the permanent label /*(/'). The details of the algorithm are described as follows: Arcs not in E are considered as arcs of infinite length. Step 1. Set l*(s) = 0 and /(/) = l(s, i) for i ¥= s and i e V, where l{s, i) = °° for i ¥= s and (s, i) $ E. Step 2. Among all temporary labels l(i), pick l(k) = min /(/) Change l(k) to l*(k). Stop if there is no temporary label left.
(2.7)
104
THE SHORTEST DIRECTED PATH PROBLEM
Step 3. Update all temporary labels of the nodes i with (k, i) e E for all i by /(/) = min [l(i), l*(k) + l(k, i)]
(2.8)
Return to Step 2. To show that the algorithm indeed produces the shortest directed paths from the source node s to all other nodes, assume that all the shortest directed paths Psi from s to i (i = 1, 2, . . . , n — 1) in the n-node net G(V, E, I) have been ordered in accordance with their lengths. Without loss of generality, we assume that all arc lengths are positive and write l(Psl) Si l(Ps2) ^i
Si l(Psk) Si. . . Si /(?,(„_!>)
(2.9)
since we can always rename the nodes, if necessary. If Psl contains more than one arc, then it contains a subpath which is shorter than Psl, contradicting our assumption that Psl is the shortest among all the shortest directed paths Psi (i = 1, 2, . . . , n — 1). Thus, Psl contains only one arc. We claim that Psk contains at most k arcs. Assume to the contrary that Psk contains more than k arcs. Then there are at least k nodes ; on Psk other than s and k. Since all the arc lengths are positive, each of the subpaths from 5 to j in Psk must be shorter than Psk, and we would have k shortest directed paths shorter than Psk, a contradiction. Thus, Psk contains at most k arcs. We next demonstrate that the above algorithm will calculate l(Psi) first, l(Ps2) second,. . . , until /(/ , j(n _ 1) ) is found. Clearly, at the end of the first iteration in Step 2 we generate l(Psl) = /*(1). To find Ps2 we need consider only one-arc or two-arc directed paths, the minimum length of which must be Ps2. If Ps2 is a two-arc directed path with the last arc being (/', 2), j ¥= 1, the subpath (s, j) of Ps2 is shorter than Ps2, a contradiction. Thus, Ps2 can be either a one-arc directed path or a two-arc directed path with the last arc being (1,2). In other words, l(Ps2) is generated by means of the operation (2.8) from the permanent labels l*(s) and /*(1), yielding /*(2) = l(Ps2) at the end of the second iteration in Step 2. To complete the proof by induction, we assume that at the end of the Arth iteration l(Psk) can be generated by means of (2.8) from the permanent labels l*(s), /*(1), l*(2), . . . , l*(k - 1), Kk
2.2 SHORTEST DIRECTED PATH ALGORITHMS
105
of arcs whose endpoints are all permanently labeled followed by one arc reaching a temporary labeled node, the minimum length of which is Ps(k+1). If (q, k + 1) is the last arc in Ps{k+i)t then I(P,ik+i)) = l*(q) + Kq, k + 1)
(2.10)
where q = s, 1, 2, . . . , k — 1 or k, and the operation (2.8) will yield a temporary label equal to /(P j ( t + 1 ) ). A node with this temporary label is identified at the end of the (k + l)th iteration in Step 2, and its label is changed to l*(k + 1). In the case where a net contains arcs with zero length, we can first modify the net as follows: For each arc (i, j) of zero length, remove the arc (i, j) and then identify the nodes i and / with the combined node being designated as i. The shortest directed path from s to ; in the original net can be obtained from that from s to i in the modified net by the insertion of the zero length arc (i, j). In fact, the algorithm remains valid even with the inclusion of zero length arcs. Observe that in ordering the shortest directed paths Psk (k = 1, 2, . . . , « — 1) in accordance with (2.9), we use one arc to reach node 1, one or two arcs to reach node 2, and at most k arcs to reach node k. By the very nature of our search process, the union of all these shortest directed paths Psk (k = 1, 2, . . . , n — 1) is a tree of the net. The algorithm consists of operations of comparisons and additions. We shall count these numbers. In Step 2, the first time there are n — 2 comparisons; the second time, n — 3 comparisons; so that there are a total (n - 2) + (n - 3) + (n - 4) + . . . + 2 + 1 = | ( n - l)(n - 2)
(2.11)
comparisons. Likewise, in Step 3 there are n — 2 additions and the same number of comparisons the first time, and n — 3 additions and the same number of comparisons the second time, and so forth. Thus, there are \{n — l)(n — 2) additions and comparisons in Step 3. As a result, the algorithm requires (n — l)(n — 2) comparisons and \(n ~ !)(« ~ 2) additions for an n-node net, and therefore its computational complexity is 0 ( n 2 ) . After we have determined the lengths of the shortest directed paths from node s to all other nodes / (/' = 1, 2, . . . , n — 1) in the net, we have not yet identified the shortest directed paths themselves that will give the desired lengths. One way to track down these paths is as follows: Suppose that we wish to identify a shortest directed path from s to ;'. If node /' is not permanently labeled, then there is no directed path from s to ;'. If j is permanently labeled, we look for all arcs (i,;') € £ to determine a node i such that
l*(i) + l(i,j) = l*(j)
(2.12)
106
THE SHORTEST DIRECTED PATH PROBLEM
We then repeat the process for node i. In this way, we can track back from node / to node s, and identify a shortest directed path from s to j . Another approach is to modify the algorithm by assigning two numbers to each node / as a label of the form [i, /(/)], as follows: Step 1. Set l*(s) = 0 and l(i) = l(s, i) for i ¥= s and i e V, where l(s, i) = °° for / =£ 5 and (s, i) $ E, and node i is labeled as [s, /(/)] Step 2. Among all temporary labels l{i), pick l{k) = min /(i)
(2.13)
Change l(k) to l*(k). Stop if there is no temporary label left. Step 3. Update all temporary labels of the nodes i with (k, i) e E for all i by l(i) = min [/(i), /*(*) + l(k, i)]
(2.14)
Change the label on node i to [k, /(/)] if l(i) is decreased. Otherwise, keep the same label. Return to Step 2. We illustrate the above results by the following examples. Example 2.1 Consider the 7-node net G(V, E) of Fig. 2.2, in which each undirected edge between nodes i and / denotes a pair of arcs of the same length, one from i to / and the other from j to i. We shall apply the algorithm to generate the shortest paths from node s to all other nodes 1,2, 3, 4, 5, 6, as follows. For simplicity, only updated temporary labels are listed. The others remain the same. /(1)=4
/(2)=6
/(4) = oo
/(5) = oo
Fig. 2.2. A 7-node net G(V, E) in which each undirected edge between nodes / and /' denotes a pair of arcs of the same length, one from i to ;' and the other from ;' to i.
2.2 SHORTEST DIRECTED PATH ALGORITHMS
107
Step 1. Node s receives the permanent label l*(s) = 0, and all other nodes receive the temporary labels indicated in Fig. 2.2. First iteration Step 2. Pick 1(1) = min [1(1), 1(2), 1(3), 1(4), 1(5), 1(6)] = min [4, 6, °°, <*>, oo, oo] = 4
(2.15)
Thus, k = 1. Change 1(1) to /*(1) = 4 for node 1. Step 3. l(i) = min [/(/), /*(1) +1(1, i)\,
i = 2, 3, 4, 5, 6
(2.16)
This gives 1(2) = min [1(2), l*(l) +1(1, 2)] = min [6, 4 + 1] = 5
(2.17a)
/(3) = min [1(3), l*(l) +1(1, 3)] = min [», 4 + 2] = 6
(2.176)
1(4) = min [/(4), /*(1) +1(1, 4)] = min [», 4 + 5] = 9
(2.17c)
The labels of the resulting net are shown in Fig. 2.3. Second iteration Step 2. Pick 1(2) = min [1(2), 1(3), 1(4), 1(5), 1(6)] = min [5, 6,9,00, °°] = 5
(2.18)
Thus, k = 2. Change /(2) to /*(2) = 5 for node 2. /(4)=9
/%s)=0
6)/(6)=oo
Z(2) = 5
Z ( 5 ) = OD
Fig. 2.3. The labeled net of Fig. 2.2 at the end of the first iteration of the Dijkstra algorithm.
108
THE SHORTEST DIRECTED PATH PROBLEM (*(1)=4
/(4)=9
/*(2) = 5
/(5) = 11
Fig. 2.4. The labeled net of Fig. 2.2 at the end of the second iteration of the Dijkstra algorithm.
Step 3. l(i) = min [/(/), /*(2) + 1(2, i)],
i = 3, 4, 5, 6
(2.19)
This gives /(3) = min [/(3), /*(2) +1(2, 3)] = min [6, 5 + 7] = 6
(2.20a)
/(5) = min [/(5), l*(2) + 1(2, 5)] = min [«., 5 + 6] = 11
(2.20b)
The labels of the resulting net are shown in Fig. 2.4. Third iteration Step 2. Pick /(3) = min[/(3),/(4),/(5),/(6)] = min [6,9,11, oo] = 6
(2.21)
Thus, k = 3. Change /(3) to /*(3) = 6 for node 3. Step 3. l(i) = min [/(/), /*(3) + /(3, i)],
i = 4, 5, 6
(2.22)
This gives 1(4) = min [/(4), /*(3) + /(3, 4)] = min [9, 6 + 8] = 9
(2.23a)
/(5) = min [/(5), /*(3) +1(3, 5)] = min [11, 6 + 4] = 10
(2.236)
2.2 SHORTEST DIRECTED PATH ALGORITHMS
109
Fourth iteration Step 2. Pick 1(4) = min [/(4), /(5), /(6)] = min [9,10, °o] = 9
(2.24)
Thus, k = 4. Change /(4) to /*(4) = 9 for node 4. Step 3. /(/) = min [/(i), /*(4) +1(4, i)],
i = 5, 6
(2.25)
This gives /(5) = min [/(5), /*(4) +1(4, 5)] = min [10, 9 + 5] = 10
(2.26a)
/(6) = min [/(6), l*(4) +1(4, 6)] = min [oo, 9 + 5] = 14
(2.266)
Fifth iteration Step 2. Pick 1(5) = min [/(5), /(6)] = min [10,14] = 10
(2.27)
Thus, k = 5. Change /(5) to /*(5) = 10 for node 5. Step 3. 1(6) = min [/(6), /*(5) + /(5, 6)] = min [14,10 + 4] = 14
(2.28)
Sixth iteration Step 2. Pick /(6) = min /(6) = 14. Thus, k = 6. Change /(6) to /*(6) = 14. Stop. The final labels of the nodes are shown in Fig. 2.5. Suppose that we wish to track down a shortest directed path Ps6 from s to 6. We first look at all arcs (i, 6) e E to determine a node i such that /*(i) + /(i,6) = /*(6) = 14
(2.29)
/*(4) +1(4, 6) = 9 + 5 = 14 = /*(6)
(2.30a)
/*(5) + /(5, 6) = 10 + 4 = 14 = /*(6)
(2.306)
For i = 4 and 5 we have
110
THE SHORTEST DIRECTED PATH PROBLEM /*(1)=4
/*(4) = 9
/*(2)=5
/*(5)=10
Fig. 2.5. The final labeled net of Fig. 2.2 after the application of the Dijkstra algorithm. Thus, we can choose either i = 4 or i = 5. Let i = 4. We next consider all arcs (i, 4) e E to determine a node i such that /•(i) + l(i, 4) = /*(4) = 9,
i = 1,3,5
(2.31)
identifying i = 1. We repeat this for node 1 with /*(/) + /(/, 1) = /*(1) = 4,
i = 5, 2, 3
(2.32)
giving / = s. Thus, a desired shortest directed path Ps6 consists of the node sequence s, 1, 4, 6 or P s6 = (s, 1)(1,4)(4,6)
(2.33)
Had we picked / = 5 in (2.306), we would have generated the shortest directed path P, 6 = ( s , l ) ( l , 3 ) ( 3 , 5 ) ( 5 , 6 )
(2.34)
Repeating this for all other nodes identifies all other shortest directed paths. The union of these paths forms a tree rooted at node s as shown in Fig. 2.6. Alternatively, if we follow the modified procedure by assigning two numbers to a node, the final labeled net is shown in Fig. 2.7. To identify, for example, Ps6 we first check the label of node 6, which is [4,14*], showing that arc (4, 6) is in Ps6. We next check the label of node 4 which is [1, 9*], indicating that arc (1,4) is in Ps6. Finally, the label of node 1 is [s, 4*], and we include (s, 1) in Ps6. Likewise, we can identify other directed paths, the union of which is a rooted tree shown in Fig. 2.6.
2.2
SHORTEST DIRECTED PATH ALGORITHMS
Z*(l)=4
111
/*(4)=9
T
i'(j)=e(s
/*(3)=6
6)/*(6)=14
.4
5J /*(2)=5
/*(5)=10
Fig. 2.6. A tree rooted at node s of the net of Fig. 2.2.
Example 2.2 Consider the net G(V, E) of Fig. 2.8. We apply the modified algorithm to generate all the shortest directed paths Psk (k = 1, 2, . . . , 13) from s to k. Initially, node 5 is permanently labeled as l*(s) = 0, node 1 is labeled by [s, 1], node 4 by [s, 2], and all other nodes are labeled by [s, °°], where /(!) = !, /(4) = 2 and /(/) = °° for j¥=s, 1 and 4.
l*(s)=0
Fig. 2.7. The final labeled net of Fig. 2.2 after the application of the modified Dijkstra algorithm by assigning two numbers to a node.
112
THE SHORTEST DIRECTED PATH PROBLEM
l*(s)=0
[s,m]
Fig. 2.8. A net G(V, E) used to illustrate the modified Dijkstra algorithm with the labels showing the first six iterations.
First iteration Step 2. Pick 1(1) = min l(i) = 1
(2.35)
i
Change 1(1) in [s, 1(1)] to [s, /*(!)] or [s, 1*]. Step 3. l(i) = min [/(/), /*(1) +1(1, i)],
i = 2, 4, 5
(2.36)
This gives 1(2) = 6, 1(4) = 2 and /(5) = 5. The labels of nodes 2, 4, and 5 are changed to [1,6], [s, 2], and [1,5], respectively. Second iteration Step 2. Pick 1(4) = min l(i) = 2 Change 1(4) in [s, 1(4)] to [s, l*(4)] or [s, 2*].
(2.37)
2.2 SHORTEST DIRECTED PATH ALGORITHMS
113
Step 3. l(i) = min [l(i), Z*(4) +1(4, i)],
i = 5, 8
(2.38)
This gives /(5) = 4 and /(8) = 6. The labels of nodes 5 and 8 are changed to [4,4] and [4,6], respectively. These steps will now be repeated for the nodes in the following order: 5, 2, 8, 6, 3, 9, 10, 13, 12, 11, and 7. The details of the operations of the algorithm are described in Table 2.1, where the underlined entry in the ith row signifies that the label of the node corresponding to the entry is changed from a temporary label to a permanent one at the ith iteration. The first six iterations are indicated in Fig. 2.8, and the last seven are given in Fig. 2.9. The tree formed by the 13 shortest directed paths Psj (/' = 1, 2, . . . , 13) from s to j in the net is shown in Fig. 2.10. 2.2.2
Ford-Moore-Bellman Algorithm
The Dijkstra algorithm described in the preceding section is valid only for those nets whose arc lengths are nonnegative. In this section, we consider the general situation where the arc lengths may be positive, zero or negative. As mentioned before, in order for the shortest directed path problem to be meaningfully defined, we assume that the nets do not contain any negative directed circuits. The algorithm was originally proposed by Ford (1956), Moore (1957) and Bellman (1958), and is based on the notion that a shortest directed path from node s to node ;' containing at most k + 1 arcs can be obtained from those from s to j containing at most k arcs. Thus, at the end of the kth iteration the labels of the nodes represent the lengths of those shortest directed paths from s containing k + 1 or fewer arcs. Let /}* ) denote the length of a shortest directed path pW from s to j in a given n-node net G(V, E, I) using at most k arcs. To initialize the algorithm, set ls = l(sk) = 0 and /}*> = /(*,/),
j = l,2,...,n-l
(2.39)
It is convenient to define /(/, /) = °° for (i,j)$E, i¥=j. When ljk) (j = +1) 1, 2, . . . , n — 1) are all known, /}* can be calculated by the following recurrence relation: For all (i, j) e E If+1> = min {/}*>, min [/J*> + l(i, j)]},
i*j,s;
j = 1, 2, . . . , n - 1 (2.40)
Observe that a shortest directed path P(sf+1) from s to j using at most k + 1 arcs may consist of k + 1 arcs or less. If it uses exactly k + 1 arcs, let
114
CQ
T3 O
<
o
^
^
^
s
i
(
i
^
1
r*
N N M M i—I T—I r*
0\
0\
* * *
N l , ^H ^_J
0\
^ ) e o c n c n c n s o t n c n c ^ « n ^
0\
in in in ""T >o'
oo oo oo oo oo
vcT ^o" vo" vo"
*? o," in in in in
8 8 8 °° °° °° °°
snsn
trt^^
£
«j 'f "t •*" Tt" •*" •*" •*" r f Tf Tl-"
n
0 0 0 0 0 0 oo oo oo oo oo oo &T ts" ts" tS rJ rf of ts" r-f ts"
't-trtfTt'i-^'tt'*
^ • t f ^ ^ ^ t t ' * ' *
in in in in in in in
8 8 r- r- JL»r- r- r- t— r~ P~ r-
f 3 < 0 0 3 & 5 ^ ^ t ^ ^ = 0 < > ) < > ! < ' a ^
8
«n <>i
8 m
&n
\c\o\o^c^c^oo^^
3:.:.;-;.:-:.^-:-^
2.2 SHORTEST DIRECTED PATH ALGORITHMS
I**** [12,15*]
[8,12*]
115
U^e} [9,11*]
Fig. 2.9. The net used to indicate the labels of the last seven iterations after applying the modified Dijkstra algorithm to the net of Fig. 2.8.
Fig. 2.10. The tree formed by the 13 shortest directed paths Psj from 5 to / in the net of Fig. 2.8.
116
THE SHORTEST DIRECTED PATH PROBLEM
(/, j) be the last arc in P%+1). Then, P** +1) can be viewed as a A>arc shortest directed path P = /(P<*+1>) = min [/{*> + l{i, j)}
(2.41)
On the other hand, if P^+1) contains k arcs or less, then /(*+» = /}*>
(2.42)
Thus, by picking the smaller of (2.41) and (2.42) we arrive at equation (2.40). It is easy to see that the algorithm terminates when /}*+» = /<*>,
y= 1,2,..., n - 1
(2.43)
for k ^ n - 1. If lf+V) ¥= ljk) for some /' when k = n - 1, then the net must contain a negative directed circuit. Thus, the existence of a negative directed circuit will be detected by the failure of the algorithm to terminate at the (n — l)th iteration. Observe that the algorithm consists of comparisons and additions. We shall count the numbers. After initialization, for each ; with a fixed k, (2.40) requires at most n — 2 additions and the same number of comparisons. Since there are n - 1 nodes to be examined, for each iteration the algorithm needs to perform at most (n - l)(n — 2) additions and the same number of comparisons. Finally, there are at most n — 1 iterations, and therefore the computational complexity of the algorithm is 0 ( n 3 ) . This is to be compared with the computational complexity required for the Dijkstra algorithm, which is 0(n 2 ). Thus, the Dijkstra algorithm is most efficient in relation to the Ford-Moore-Bellman algorithm. However, the Dijkstra algorithm is valid only for nets with nonnegative arc lengths, whereas the Ford-MooreBellman algorithm is more general and is applicable to any nets with positive, negative or zero arc lengths. In the latter case, no negative directed circuit is allowed. The above counting of additions and comparisons required for the algorithm considers the worst case where the directed graph is nearly complete. In many practical situations, the nets are sparse with missing arcs. Also, as the above example demonstrated, the algorithm may terminate before k = n — 1 is reached. Thus, if b is the number of arcs of a net, and q is the number of iterations required for termination or the maximum number of arcs contained in any shortest directed path, then for each iteration the algorithm requires at most b additions and the same number of comparisons. Therefore, the computational complexity of the algorithm can also be written as 0(qb). For problems with b « n2 and q « n, the required computation 0(qb) can be less than the 0(n2) requirement of the Dijkstra algorithm.
2.2 SHORTEST DIRECTED PATH ALGORITHMS
117
Fig. 2.11. A 7-node net G(V, E) containing negative arc lengths used to illustrate the Ford-Moore-Bellman algorithm.
Example 2.3 Consider the 7-node net G(V, E) of Fig. 2.11 where some of the arcs are of negative length. We apply the algorithm to generate the shortest directed paths Psj (/ = 1, 2, . . . , 6) from s to /, as follows: Initialization /CD = 4,
#> = 6,
/J 1 '= »
fori = 3 , 4 , 5 , 6
(2.44)
First iteration (k = 1) /i 2) = min {/«, min [#> + 1(2, 1), #> +1(3, 1)]} = min{4,min[6+l,oo + 2]}=4 2)
£ = min {#>} = #> = 6
(2.45a) (2.456)
/?> = min {/«, min [#> +7(2, 3), /?> + /(4, 3)]} = min {oo, min [6 + 7, oo + 8]} = 13
(2.45c)
/1 2) = min {/«, min [tf> + 1(1, 4), /<» + /(5, 4)]} = min {oo, min [4+ 5, oo-5]} = 9
(2A5d)
/?> = min {/«, min [#> + /(2, 5), #> + /(3, 5)]} = min {oo, min [6 - 6, oo + 4]} = 0
(2.45e)
/?> = min {#>, min [/« + '(4, 6), /£> + /(5, 6)]} = min {oo, min[oo + 5,oo + 4]} = oo
(2.45/)
118
THE SHORTEST DIRECTED PATH PROBLEM
Second iteration (k = 2) /<3) = min {l\ min [/?> +1(2, 1), lf> + /(3, 1)]} = min {4, min [ 6 + 1 , 1 3 + 2]} = 4
(2.46a)
3)
£ = min {/?)} = /?> = 6
(2.466)
/?> = min {/?>, min [Z?> + 1(2, 3), Z?> + /(4, 3)]} = min {13, min [6 + 7, 9 + 8]} = 13 lf> = min {lf\
(2.46c)
2
min [fl > + /(l, 4), Z?> + /(5, 4)]}
= min {9, min [4+ 5, 0 - 5 ] } = - 5
(2.46d)
3)
/< = min {/?>, min [Z?> + Z(2, 5), Z?> + Z(3, 5)]} = min {0, min [6 - 6,13 + 4]} = 0
(2.46c)
2
Z?> = min {Z?>, min [/< > + 1(4, 6), Z?> + Z(5, 6)]} = min {oo, min [9+ 5,0 + 4]} = 4
(2.46/)
77u'rd iteration (k = 3) /(!4) = min {l?\ min [Z?> + Z(2, 1), Z?> +1(3, 1)]} = 4
(2.47a)
Z£4) = min {Z?>} = Z?> = 6
(2.476)
4)
3)
3)
4 = min {4 , min [Z?> + Z(2, 3), Zi + Z(4, 3)]} = min {13, min [6+ 7 , - 5 + 8]} = 3 4)
3)
3)
(2.47c)
3)
/
3)
(2.47d)
3
#> = min {/< , min [/< + Z(2, 5), /< > + 1(3, 5)]} = min {0, min [6 - 6,13 + 4]} = 0
(2.47e)
3)
#> = min {lg\ min [/< +1(4, 6), Z?> + Z(5, 6)]} = min {4, min [-5 + 5, 0 + 4]} = 0
(2.47/)
Fourth iteration (k = 4) If > = min {lf\
min [Z{4) + /(/,/)]} = /j 4 ) ,
; = 1,2, . . . . 6 (2.48)
The algorithm terminates at the end of the fourth iteration with it = 4 S / ! - 1 = 6. The length of each shortest directed path is as indicated in Fig. 2.11 without the slashes. To identify a shortest directed path Psj from s to j , we follow (2.12). For example, to find Ps6 we first
2.2 SHORTEST DIRECTED PATH ALGORITHMS
119
look for all arcs (i, 6) e E so that #> -/J 4 > =/(i, 6),
i = 4,5
(2.49)
or /W - /W = 0 - ( - 5 ) = 5 = 1(4, 6) /W _ /w = 0 _ 0 = 0 # / ( 5 j 6 ) = 4
(2.50a) ( 2 50fo)
Thus, the arc (4,6) is in Ps6. We next consider the node 4 with /$*> - /,<4> = /(,-, 4),
i = 1, 5
(2.51)
or /W - /W = - 5 - 4 = - 9 # /(l, 4) = 5
(2.52a)
/ W - / ( 4 ) = - 5 - 0 = - 5 = /(5,4)
(2.52b)
This shows that the arc (5, 4) is in Ps6. We then consider node 5 with #>-/J 4 > = /(/, 5),
i = 2,3
(2.53)
or /W - / W = 0 - 6 = - 6 = / ( 2 , 5)
(2.54a)
/W - /(") = o - 3 = - 3 # /(3, 5) = 4
(2.54b)
Thus, arc (2, 5) is in P j6 . Finally, we consider node 2 with 4 4 ) - / s = 6 - 0 = 6 = /(s, 2)
(2.55)
and identifies the arc (5, 2). A desired shortest directed path Ps6 from s to 6 is found to be P,6 = (s,2)(2,5)(5,4)(4,6)
(2.56)
Note that if more than one node satisfies the equation (2.49), (2.51) or (2.53), then either node is permitted. The resulting solution is not unique, and more than one shortest directed path exists. For the net of Fig. 2.11, only one shortest directed path exists from s to any particular node. The tree formed by the shortest directed paths Psj (j = 1, 2, . . . , 6) from s to / with root 5 is shown in Fig. 2.12. Example 2.4 The net G(V, E, I) of Fig. 2.13 is a weighted mixed graph. We use the algorithm to generate all the shortest directed paths Psj (;" = 1, 2, . . . , 13)
120
THE SHORTEST DIRECTED PATH PROBLEM
M-5
from s to j , as follows: Initialization (k = 0) /CD = 2,
/J" = «,
*'#4
(2.57)
Firrf iteration (k = l) /(2) = 5, /(2) = 6,
/<2> = 2, /p> = oo,
/<2) = 0,
/<2) = 4
j = 2, 3, 6, 9, 10, 11, 12, 13
(2.58)
.v = 0
Fig. 2.13. A weighted mixed graph used to illustrate the Ford-Moore-Bellman algorithm.
2.2 SHORTEST DIRECTED PATH ALGORITHMS
121
TABLE 2.2 Nodes fc + i X .
T
/f> if [(.*) If [((•) /f> /(8)
1
2
3
4
5
2 2 2 2 2 2 2 2
CO
00
00
5 5 5 5 5 5 5
00
00
00
00
00
00
00
8 4 4 4
6 2 2
10
11
12
CO
CO
CO
CO
00
CO
CO
CO
CO
oo
CO
4
12 7 4 4 4 4
00
6
7
8
CO
CO
CO
CO
0 0 0 0 0 0 0
CO
4 4 4 4 4 4 4
6 3 3 3 3 3 3
4 0 0 0 0 0
3 3 3 3 3 3
9
5 1 1 1 1
13
7 3 2 2 2
Second iteration (k = 2) /f» = 5,
Z?> = 2,
^3) = 0,
/<3> = 3
/?> = 4,
/<3> = 3,
/<3> = 4,
/<3> = 4
© = 12,
/P> = »,
i = 2,3,10,13
(2.59)
The results of other iterations together with the first two are shown in Table 2.2 where the columns represent nodes j and the rows represent
ZJ*+1>.
Observe from Table 2.2 that for k = 7 we have lf> = iy\
y = l,2,. ..,13
(2.60)
Thus, the algorithm terminates at the end of the seventh iteration, and the entries in the last row or next to the last row give the lengths of the shortest directed paths Psj (j = 1, 2, . . . , 13) from s to /'. To find the shortest directed paths Psj, we need to identify the node i of the last arc (i, j) in Psj. The results are presented in Table 2.3, from which a shortest TABLE 2.3 Nodes
Length from s toy Last node i
1
2
3
4
5
6
7
8
9
10
11
12
13
5 4
2 3
4 10
2 s
0 4
3 5
4 4
3 5
0 6
1 9
1 8
4 9 or 11
2 12
122
THE SHORTEST DIRECTED PATH PROBLEM
directed path Psj can be tracked back to s from j . For example, to find Psl3 the table shows that its next to last node 13 is node 12. For node 12, its next to last node 12 is node 9 or 11. Continuing this process yields one of the following node sequences: 13,12,9,6,5,4,5
or
13,12,11,8,5,4,5
(2.61a)
which correspond to the shortest directed path Psi3 = (s, 4)(4, 5)(5, 6)(6, 9)(9, 12)(12, 13)
(2.616)
P,is = (s, 4)(4, 5)(5, 8)(8, 11)(11, 12)(12, 13)
(2.61c)
or
The final labels of the nodes and all the shortest directed paths Psj indicated in Fig. 2.14, where the tree formed by Psj is denoted by heavy lines. Each label consists of two real numbers except node s, first of which represents the last node i to node j and the second length of Psj. 2.2.3
are the the the
Yen Algorithm
The Yen algorithm is the same as the Ford-Moore-Bellman algorithm except that it has a different interpretation of the symbol ljk\ and requires roughly half the computations. [4,5]
[8,1]
[3,2]
[9,4] or [11,4]
[10,4]
[12,2]
Fig. 2.14. The final labels of the nodes and all the shortest directed paths Psj from s to / in the net of Fig. 2.13.
2.2 SHORTEST DIRECTED PATH ALGORITHMS
123
In a given net G(V, E, I), let the source node s be designated as node 0, and the other n — 1 nodes be assigned the integers 1,2,... ,n — 1. Consider a k-aic directed path Psiw= (0, *'i)(/i, i 2 )- • • (ip-u ip)(iP, ip+i)- • • (iq-\, *,)• • • 0'»-i, D
(2.62)
from node 0 to node iw in G. This path can also be expressed as a sequence of nodes from 0 to iw along the directed path as {U, l1, l2, • • • , l p - \ , lp, lp + \> • • • , l q - \ , lq, • • • , Iwf
(2.63)
A subsequence of this sequence is called a block if it is maximal and is either monotonically increasing or decreasing. For example, the subsequence {0, ix, i2, . • • , ip) is a block if ix_l < ix (x = 2, 3, . . . , p) and ip>ip+l. Likewise, the subsequence {ip, ip+l, . . . , iq) is a block if ix-i> ix (x =p + 1, p + 2, . . . , q) and iq < iq+1. Thus, the sequence (2.62) can be decomposed into, say, m overlapping blocks. We say that the directed path Psiw consists of m blocks. The sequence {0,2,3,7,4,1,5,6,9}
(2.64)
for example, is uniquely decomposable into three blocks: { 0 , 2 , 3 , 7 } , {7,4,1}, and { 1 , 5 , 6 , 9 } . With the notion of block, we can now attach a new interpretation to the symbol ljk\ Recall that in the preceding section the symbol /}*' denotes the length of a shortest directed path from s to j in G using at most k arcs. We now use the same symbol ljk) to mean the length of a shortest directed path from node 0 to node j in G with at most k blocks. Since a block may contain any number of nodes, a directed path pW from 0 to / with at most k blocks may contain as many as n — 1 arcs. In fact, /} x ) may represent the length of a shortest directed path from 0 to j containing n — 1 arcs. In this case, the nodes of the directed path increase from 0 to /. On the other hand, a directed path in an n-node net can at most contain n — 1 blocks. With these preliminaries, we now proceed to describe a modified Ford-Moore-Bellman algorithm, first proposed by Yen (1970). Define lf = l(0,j),
j = l,2,...,n-l
(2.65)
and use {Pl^} to denote the set of all directed paths pW from 0 to / with at most k blocks. Then for / = 1 and 4 = 1 we have /(i) = /(°> = i(Qt l)
(2.66)
and {P?i} consists only of one element P^ = (0, 1). F o r ; = 2 and k = l two single blocks can be formed from the nonnegative integers 0, 1 and 2. They
124
THE SHORTEST DIRECTED PATH PROBLEM
are 0, 2 and 0, 1, 2. For the block 0, 2, the corresponding directed path is the arc (0, 2). For the block 0, 1, 2, the corresponding directed path consists of the arcs (0,1) and (1,2). The shorter of these two path lengths is l^p or l^ = min {1(0, 2), 1^ + 1(1, 2)} = min {lf\ min [/J1* + l(i, 2)]}
(2.67)
;<2
where {Pm = {(0, 2), (0, 1)(1, 2)} (2.68) For 7 = 3, k — \, the single blocks that can be formed from 0, 1, 2, 3 are 0, 3; 0, 1, 3; 0, 2, 3; and 0, 1, 2, 3. We can write from (2.65) and (2.67) #> = min {1(0, 3), tf> +1(1, 3), 1(0, 2) +1(2, 3), l[» +1(1, 2) + 1(2, 3)} = min{/f ( / ( 1 1) + /(l,3),/i 1 ) + /(2,3)} = min {lf\ min [/jx> + l(i, 3)]}
(2.69)
where {P$} = {(0, 3), (0, 1)(1, 3), (0, 2)(2, 3), (0, 1)(1, 2)(2, 3)}
(2.70)
Thus, knowing / ^ we can calculate / ^ \ and knowing /2X) we can calculate $\ The above procedure can be generalized to yield the expression /j 1 '= min {/j°\ min [/,<x>+ /(*,/)]},
/ = 2, 3, . . . , n - 1
(2.71)
Likewise, for j = n — 1 and k = 2 define
a. =
ft
(2-72)
and for / = n — 2 and A: = 2, a two-block sequence consists of an increasing sequence from 0 to n — 1 followed by the decreasing sequence n — 1, n — 2. Since /^2i denotes the length of a shortest directed path from 0 to n — 1 in G with at most one block, /J,222 can be written as /1222 = min {/W2, /»», + / ( / t - 1, n - 2)} = min {/«2, min [/}2> + /(/, n - 2)]}
(2.73)
On-2
For / = n — 3 and & = 2, a two-block sequence consists of an increasing sequence from 0 to n — 1 followed by a decreasing sequence n — 1, n — 2, « — 3 or n — 1, « — 3; or from 0 to n — 2 followed by n — 2, n — 3. In either
2.2 SHORTEST DIRECTED PATH ALGORITHMS
125
case, we can write from (2.72) and (2.73) /<223 = min {li%, /J 1 ', + l(n - 1, n - 3), # 2 2 + /(/» - 2, n - 3), /£>! + / ( n - 1, n - 2) + /(« - 2, n - 3)} = min {/« 3 , /?2! + /(« - 1, n - 3), /<222 + /(« - 2, n - 3)} = min {f£U, min [/}2> + /(i, n - 3)]}
(2.74)
l>n-3
This shows that knowing /^22i = l£lu we can calculate ffl2, and from /*,222 we can calculate /*,223. These equations can be generalized to yield /f > = min {/}", min [/P> + /(/,/)]}, '>/
/ = n -2, n - 3 , . . . , 1
(2.75)
In general, for any k the expressions corresponding to (2.71) and (2.75) are given by If > = min {/f-1*, min [/<*> + /(i, /)]}
(2.76)
for odd k and / = 2, 3, . . . , « — 1, where / ^ = / ( i* _1) ; and /f' = min {/j*-1*, min [/J*> + /(i, /)]} '>/
(2.77)
for even k and j = n — 2, n — 3, . . . , 1, where l^lx = Z ^ 1 ' . Therefore, we can find all the distances from 0 to j using successive approximations with A:th-order approximations giving the lengths of the shortest directed paths from 0 to ;' (j = 1, 2, . . . , n — 1) using at most k blocks. Since there are at most n — 1 blocks, the algorithm should terminate if /(*+!> = /<*> for ally
(2.78)
If /}* + 1 ) =#= /)*' for some / when k = n — 1, this indicates that the net contains a negative directed circuit. Observe that from (2.76) and (2.77) we either try those indices i which are less than / or those which are greater than j . Thus, we perform roughly half the work of the Ford-Moore-Bellman algorithm. The computational complexity in this case remains to be 0 ( n 3 ) . However, an additional advantage of the Yen algorithm is that we can erase /}*' as soon as /}* + 1 ) is generated, thereby reducing the storage requirement of the program. Example 2.5 We use the Yen algorithm to generate the distances from node 0 to node j (j = 1, 2, 3, 4, 5) in the net G{V, E, I) of Fig. 2.15.
126
THE SHORTEST DIRECTED PATH PROBLEM
-1
Fig. 2.15. A net G(V, E, I) used to illustrate the Yen algorithm for the calculation of the distances from node 0 to nodes j {j = 1, 2, 3, 4, 5).
Initialization (k = 0) /f> = 4,
/<°> = 6,
/}°> = oo,
,- = 3 , 4 , 5
(2.79)
; = 2, 3, 4, 5
(2.80)
First iteration (k = 1) IV = min {/j°>, min [/?> + /(/, /)]},
where / ^ = /(!0) = 4. We need only consider those i <j such that (i, j) e E, obtaining 4 1) = min{4 0 ) } = 6
(2.81a)
#> = min{4°U 1 > + / ( l , 3 ) } = min {°°, 4 + 5} = 9
(2.816)
/?> = min {/f, min [#> + /(l, 4), #> + /(3, 4)]} = min {oo, min [4 - 2,9 - 1]} = 2
(2.81c)
#>>== min {/§»>, min [#> + /(3, 5), tf> + /(4, 5)]} = m i n {oo, /oo m in T Q+ + 5, S 2? + 4- 4]} 4H = = 6 ft min [9 = min
(2.8W)
Second iteration (k = 2) If = min {/f>, min [/{*> + /(/, /)]},
/ = 4, 3, 2, 1
(2.82)
where /£2) = /^1) = 6. We need only consider those i >j such that (i, j) e E,
2.2 SHORTEST DIRECTED PATH ALGORITHMS
127
giving /i 2) = min {/?>} = 2
(2.83a)
2)
4 = min {#>} = 9 2
(2.836) 2
/< > = min {#>, min [/< > + /(3, 2), /?> + /(4, 2)]} = min {6, min [9 + 2 , 2 + 6]} = 6 2)
(2.83c)
2
/< = min {#>, /< > + /(2, 1)} = min {4,6 - 3} = 3
(2.83d)
77»>d iteration (k = 3) /P) = min{/)2>,miii[/P> + /(i,/)]}, '<>
7= 2,3,4,5
(2.84)
where /(!3) = /^2) = 3. It is sufficient to consider only those i<j such that (i, j) e E, yielding 4 3) = min {/?>} = 6
(2.85a)
3)
/?> = min {/?>, /i + / ( l , 3)} = min {9,3 + 5} = 8
(2.856)
/i 3) = min {lf\ min [A3) + 1(1, 4), /<3> + /(3, 4)]} = min{2,min[3-2,8-l]} = l
(2.85c)
/<3> = min {lf\ min [/?> + 1(3, 5), /<3> + /(4, 5)]} = min {6, min [8 + 5,1 + 4]} = 5
(2.85d)
Fourth iteration (k = 4) If = min {lf\ min [/<4) + /(/, /)]},
/ = 4, 3, 2, 1
(2.86)
where /^4) = 4 3 ) = 5. We need only consider those i >j such that (i, j) e E, obtaining /i 4) = min {/13)} = 1
(2.87a)
#> = min {/?>}= 8 4)
3
(2.876) 4
4
/< = min {/< >, min [/< > + /(3, 2), /< > + /(4, 2)]} = min {6, min [8 + 2 , 1 + 6]} = 6 4)
/< = min {lf\ #> + /(2, 1)} = 3
(2.87c) (2.87d)
The algorithm terminates at the end of the fourth iteration, since for
128
THE SHORTEST DIRECTED PATH PROBLEM
Fig. 2.16. A net used to show the distances from 0 to / (;' = 1, 2, 3, 4, 5) in the net of Fig. 2.15 with the tree formed by the shortest directed paths being denoted by the heavy lines.
fc = 4 w e have /} 4) = /} 3)
for 7 = 1 , 2 , 3 , 4 , 5
(2.88)
The distances from 0 to j (/ = 1, 2, 3, 4, 5) in the net are as indicated in Fig. 2.16 with the tree formed by the shortest directed paths being denoted by the heavy lines. Example 2.6 Consider the net G(V, E, /) of Fig. 2.17. We use the Yen algorithm to calculate the distances from node 0 to nodes / (/ = 1, 2, . . . , 13). Initialization (k = 0) /» = - 1 , /i°> = 2,
/<0) = oo,
i = 2, 3, 5, 6, . . . , 13
(2.89)
The results of first three iterations are shown in Table 2.4. Observe from the table that for k = 3 we have l?> = f \
/ = 1 , 2 , . . . , 13
(2.90)
Thus, the algorithm terminates at the end of the third iteration or k = 3, which is considerably less than n — 1 = 13 as required for a general net. The distances together with the tree formed by the shortest directed paths are as indicated in Fig. 2.18 with the heavy lines denoting the tree branches.
(12)
Fig. 2.17. A net G(V, E, I) used to illustrate the Yen algorithm for the calculation of the distances from node 0 to nodes / (j = 1,2, ... , 13). TABLE 2.4 Nodes j k
I? If /f>
1
2
3
4
5
6
7
8
9
10
11
12
13
-1 -1 -1
4 4 4
2 2 2
2 2 2
0 0 0
3 3 3
00
6 2 2
0 0 0
1 1 1
00
12 1 1
3 3 3
8 8
4 4
[11,8]
[9,3] or [10,3]
Fig. 2.18. A net used to show the distances from 0 to / (;' = 1, 2, . . ., 13) in the net of Fig. 2.17 with the tree formed by the shortest directed paths being denoted by the heavy lines. 129
130
THE SHORTEST DIRECTED PATH PROBLEM
Fig. 2.19. A weighted mixed graph used to illustrate the Yen algorithm for the calculation of the distances from node 0 to nodes ;' (/ = 1, 2, . . . , 13).
Example 2.7 We use the Yen algorithm to calculate the distances from node 0 to nodes / (;' = 1, 2, . . . , 13) in the net G(V, E, /) of Fig. 2.19. The details of the procedure are shown in Table 2.5. The algorithm terminates at the end of the third iteration and the resulting distances and the tree rooted at node 0 are indicated in Fig. 2.20 with the heavy lines denoting the tree branches. 2.2.4
Ford-Fulkerson Algorithm
The present algorithm is applicable to any nets that do not contain any negative directed circuits, but the nets are allowed to have negative or zero arc lengths. The procedure is due to Ford and Fulkerson (1962), and is very
TABLE 2.5 Nodes i k If If If If
l
2
3
4
5
6
7
8
9
10
11
12
13
00
00
CO
CO
CO
CO
CO
00
CO
00
00
CO
CO
5 5
2 2
4 4
2 2 2 2
CO
00
0 0 0
3 3 3
4 4 4
3 3 3
0 0 0
1 1 1
4 4 4
2 2 2
1 1 1
2.2 SHORTEST DIRECTED PATH ALGORITHMS
131
similar to the Ford-Moore-Bellman algorithm in that it sequentially reduces the labels on the nodes by examining arcs. The final labels on the nodes will also permit us to trace back from every node the shortest directed path from the origin to that node. Let G(V, E, I) be an n-node net, in which a node is designated as the origin or source s = 0 and the other nodes are denoted by the integers 1,2,... ,n — I. Each node i of G will be assigned a label consisting of an ordered pair of real numbers of the form [x, /(j)]. The first number indicates a node designation of G, and the second the conditional distance from s to i. These labels will be updated sequentially until the conditional distances from s become the true distances. The details of the Ford-Fulkerson algorithm are described below: Step 1. Set l(s) = 0 and l(i) = °° for i =£s. Assign each node i a label [•, /(/)]. Step 2. Find an arc (i, j) e E such that l(i) + l(i,j)
(2.91)
and change the label on node /' to [i, l(i) + l(i, / ) ] , and repeat. If no such arc is found, terminate. After termination of the algorithm, the second number of the label on a node j shows the distance from s to j in the net, and the first number is the initial node q of the last arc (q, j) to j in a shortest directed path from s to /'.
132
THE SHORTEST DIRECTED PATH PROBLEM
[•,o]U
5 ) [•, oo]
[•,00]
[••oo]
Fig. 2.21. A net G(V, E, I) used to illustrate the Ford-Fulkerson algorithm for the generation of the shortest directed paths.
Thus, to identify the sequence of nodes of a shortest directed path from s to j , we follow the steps below: Step 1. Set i = j . Step 2. Identify k from the label [k, /(/')] on node i. If i is not labeled, there is no such directed path. Step 3. Set / = k. If i = s, terminate. Otherwise, return to Step 2. Example 2.8 We use the Ford-Fulkerson algorithm to generate the shortest directed paths from node s to node j (j = 1, 2, 3, 4, 5) in the net G(V, E, I) of Fig. 2.21, as follows: Step 1. Assign the label [•, 0] to node s, and the label [•, °°] to all other nodes j (;' = 1, 2, 3, 4, 5) as indicated in Fig. 2.21. Step 2. 1(1) = oo > l(s) + l(s, l) = 0 + 4 = 4. Change the label [•.»] on node 1 to [s, 4]. /(2) = oo > / ( 5 ) + / ( 5 , 2) = 0 + 6 = 6. Change the label [•,»] on node 2 to [s, 6]. /(3) = oo > l(l) +1(1, 3) = 4 + 5 = 9. Change the label [•,»] on node 3 to [1,9]. /(4) = oo>/(l) + /(i, 4) = 4 - 2 = 2. Change the label ["> °°1 on node 4 to [1,2]. /(5) = oo >/(4) + / ( 4 , 5) = 2 + 4 = 6. Change the label [•,»] on node 5 to [4,6]. /(l) = 4 > / ( 2 ) + /(2, l) = 6 - 3 = 3. Change the label [s, 4] on node 1 to [2,3].
2.2 SHORTEST DIRECTED PATH ALGORITHMS
133
[•,0]
Fig. 2.22. The final labels of the nodes of the net of Fig. 2.21 after the application of the Ford-Fulkerson algorithm.
/(3) = 9 > / ( l ) node 3 to /(4) = 2 > / ( l ) node 4 to /(5) = 6 > / ( 4 ) node 5 to
+ /(l, 3) = 3 + 5 = 8. Change the label [1,9] on [1,8]. + / ( l , 4 ) = 3 - 2 = l. Change the label [1,2] on [1,1]. + /(4,5) = l + 4 = 5. Change the label [4,6] on [4,5].
At the end of the above operations, no more arcs (i, j) e E can be found such that l(i) + l(i, j) < l(j). The algorithm terminates and the final labels of the nodes are shown in Fig. 2.22. To identify the sequence of nodes of a shortest directed path from 5 to, say, / = 5, we follow the steps below: Step Step Step Step Step Step Step Step Step
1. 2. 3. 2. 3. 2. 3. 2. 3.
Set i = 5. Identify node 4 from the label Set i = 4. Return to Step 2. Identify node 1 from the label Set i = 1. Return to Step 2. Identify node 2 from the label Set i = 2. Return to Step 2. Identify node 5 from the label Set i = s. Terminate.
[4, 5] on node i = 5. [1,1] on node i = 4. [2, 3] on node i = 1. [s, 6] on node i = 2.
Thus, we can trace back the nodes from node 5 to node s as 4, 1, 2, and 5. The node sequence from * to 5 is therefore {s, 2, 1, 4, 5}, and the
134
THE SHORTEST DIRECTED PATH PROBLEM
Fig. 2.23. A net G(V, E, I) used to illustrate the Ford-Fulkerson algorithm for the generation of the shortest directed paths.
corresponding shortest directed path Ps5 is found to be P, 5 = (*,2)(2,l)(l,4)(4,5)
(2.92)
This directed path together with others are shown in Fig. 2.22 with the heavy lines. Example 2.9 We use the Ford-Fulkerson algorithm to generate the shortest directed paths from node s to nodes y" (y = 1, 2, . . . , 13) in the net G(V, E, I) of Fig. 2.23, as follows: Step 1. Assign the label [-,0] to node s, and the label [s 0 0 ] to all nodes y (y = 1, 2, . . . , 13). Step 2. 1(4) = oo > l(s) + l(s, 4) = 0 + 2 = 2. Label node 4 as [s, 2]. /(5) = oo > /(4) + /(4, 5) = 2 - 2 = 0. Label node 5 as [4, 0]. /(6) = oo > /(5) + /(5, 6) = 0 + 3 = 3. Label node 6 as [5, 3]. 1(1) = oo > /(4) + /(4, 7) = 2 + 2 = 4. Label node 7 as [4, 4]. /(8) = oo > /(4) + /(4, 8) > /(5) + /(5, 8) = 3. Label node 8 as /(9) = oo > /(8) + /(8, 9) > /(5) + /(5, 9) > /(6) +1(6, 9) = 0. node 9 as [6,0]. /(10) = oo > /(6) + 1(6, 10) > /(9) + 1(9, 10) = 1. Label node
P,l].
other
[5, 3]. Label 10 as
2.2 SHORTEST DIRECTED PATH ALGORITHMS
135
Fig. 2.24. The final labels of the nodes of the net of Fig. 2.23 after the application of the Ford-Fulkerson algorithm.
/ ( l l ) = oo>/(7) + /(7, l l ) > / ( 8 ) + /(8, 11) = 1. Label node 11 as [8,1]. /(12) = oo > /(8) + /(8, 12) > /(9) + /(9, 12) = Z(ll) + / ( l l , 12) = 4. Label node 12 either as [9,4] or as [11,4]. /(I) = oo > /(4) +1(4, 1) = 5. Label node 1 as [4, 5]. /(3) = oo > /(10) + /(10, 3) = 4. Label node 3 as [10,4]. 1(2) = oo > /(3) +1(3, 2) = 2. Label node 2 as [3,2]. /(13) = oo > 1(9) +1(9, 13) = 1(10) +1(10, 13) > /(12) + /(12, 13) = 2. Label node 13 as [12, 2]. The algorithm terminates and the final labels of the nodes are as shown in Fig. 2.24 with the heavy lines denoting the tree formed by all the shortest directed paths from s to / (/ = 1, 2, . . . , 13). Example 2.10 We use the Ford-Fulkerson algorithm to generate the shortest directed paths from node s to nodes / (/ = 1, 2, . . . , 13) in the net G(V, E, I) of Fig. 2.25, as follows: Step 1. Assign the label [-,0] to node s, and the label [s 0 0 ] to all other nodes /' (j = 1,2, ... , 13). Step 2. 1(1) = oo > l(s) + l(s, 1) = - 1 . Label node 1 as [s, - 1 ] . 1(2) = oc > l(i) + l(i, 2) = 4. Label node 2 as [1, 4]. /(3) = a. > 1(2) + 1(2, 3) = 2. Label node 3 as [2, 2].
136
THE SHORTEST DIRECTED PATH PROBLEM i=0 (0
(12)
(13)
Fig. 2.25. A net G(V, E, I) containing negative arc lengths used to illustrate the Ford-Fulkerson algorithm for the generation of the shortest directed paths.
1(4) = oo > l(s) + l(s, 4) = 1(1) +1(1, 4) = 2. Label node 4 as [s, 2] or [1,2]. /(5) = oo > 1(A) + 1(4, 5) = 0. Label node 5 as [4,0]. /(6) = oo > /(5) + /(5, 6) = 3. Label node 6 as [5, 3]. /(8) = oo > /(4) + /(4, 8) = 6. Label node 8 as [4,6]. /(9) = oo > /(6) + /(6, 9) = 0. Label node 9 as [6,0]. /(10) = oo > 1(9) +1(9, 10) = 1. Label node 10 as [9,1]. /(12) = oo > /(8) + /(8, 12) = 12. Label node 12 as [8,12]. /(13) = oo > /(9) +1(9, 13) = /(10) +1(10, 13) = 3. Label node 13 as [9, 3] or [10, 3]. /(12) = oo > /(13) + /(13, 12) = 1. Label node 12 as [13,1]. /(11) = oo > /(12) + /(12, 11) = 4. Label node 11 as [12, 4]. /(8) = 6 > /(ll) + /(ll, 8) = 2. Label node 8 as [11, 2]. /(7) = oo > /(ll) + /(ll, 7) = 8. Label node 7 as [11, 8]. The algorithm terminates and the final labels of the nodes are as shown in Fig. 2.26 with the heavy lines denoting the tree formed by all the shortest directed paths from s to / (/' = 1, 2, . . . , 13). We now proceed to justify the algorithm by showing that under the assumption that the net does not contain any negative directed circuits, the algorithm will terminate. At termination, the node labels give the distances from s to the nodes, and the shortest directed paths can be identified from these labels. After initialization in Step 1 and at any stage of the iteration in Step 2, if
2.2 SHORTEST DIRECTED PATH ALGORITHMS
[12,4]
JW^t
[93] or
137
[10 , 3 ]
[13,1]
Fig. 2.26. The final labels of the nodes of the net of Fig. 2.25 after the application of the Ford-Fulkerson algorithm.
/(/) < oo for / # s , then node /' has a label [ilr l(j)] such that /(iO+ /(/!, 7 ) ^ / ( 7 )
(2-93)
showing that /(i 1 )<°°. Notice that the existence of the label [il, I (J)] on j indicates that at some early stage we have l{it) + l(it, j) = /(/). It is possible that the label [i2, l(i\)] on i1 may be changed again at a later stage to produce an inequality in (2.93). Now the existence of a label [i2, l(ii)] on ix signifies that /(/2) + / ( / 2 ) i 1 ) ^ / ( / 1 )
(2.94)
showing l(i2) < °°. It follows that if we start at any stage at a node / with /(/) < oo and follow the labels as outlined above, we generate a sequence of nodes/, ilt i2, • • • , which either terminates at s or continues indefinitely. If it continues indefinitely, the nodes of the sequence will have to be repeated and a directed circuit can be identified. Suppose that the sequence of nodes h>J2, • • • ,ik=h
(2-95)
represents a directed circuit yielded by the labels as outlined above. If j m was the last node of the directed circuit to receive a label from its predecessor, then at the time immediately before j m was labeled from ]m_x
138
THE SHORTEST DIRECTED PATH PROBLEM
we had Kjm)
> KJm-l)
+ Kjm-U
jm)
(2.96)
/(/ m + 1 ) i= /(;„) + l{jm, jm+1)
(2.97)
Observe that immediately after j m received a label from / m _ i , l{jm) is reduced to Kim-i) + Kim-\,jm) to produce an inequality in (2.97). Thus, if the primes are used to denote the node numbers after j m received a label from/„,_,, we have l'(L
+ l)
> I'dm) + KL, j m + l)
(2-98)
For other arcs around the directed circuit, we have l'(jp+i)^l'(Jp)
+ l(Jp,JP+i),
P^rn,
p = l,2,...,k-l
(2.99)
Summing (2.98) and (2.99) around the directed circuit and noting the strict inequality of (2.98) results in the strict inequality 2'0W.-+i)<0
(2.100)
contradicting our assumption that the net does not contain any negative directed circuits. Thus, at every stage of the iterations in Step 2, the sequence of nodes generated from the labels of any node j with /(/) < oo eventually arrives at s and terminates with l(s) = 0; for otherwise s would be labeled from some node and a negative directed circuit is identified. After termination in Step 2, let s = 7i, 72- • • • , iq-x, jq = )
(2-101)
be a directed path from s to / yielded by the labels as outlined above. Then we have l(jp+i) = KiP) + Kip, jp+x),
p = l,2,...,q-l
(2.102)
for otherwise the algorithm would not have been terminated in Step 2. Summing (2.102) along the directed path gives /0) = / ( 5 ) + S ' ( / „ y , + i )
(2-103)
1=1
Since l(s) — 0, (2.103) becomes Ki) = qtKh,h+i) i=i
(2.104)
2.3 MULTITERMINAL SHORTEST DIRECTED PATHS
139
Suppose that there were a shorter directed path from s to /' other than the one shown in (2.101) yielded by the labels, say s = ii,i2,
. . . ,i„=j
(2.105)
Then along this directed path we have as in (2.102) l(ix+1) = l(ix) + l(ix, ix+1),
x = l,2,...,w-l
(2.106)
the sum of which is
/(/) = 2 /&, *,+i)
(2.107)
x= l
Combining (2.104) and (2.107) gives q—1
w—1
2 Kit, ji+l) = X /&, *',+,) 1=1
(2.108)
X=l
This shows that the two directed paths (2.101) and (2.105) are of the same length, contradicting the assumption that the latter is shorter than the former. Thus, if the net does not contain any negative directed circuits, the algorithm terminates and the resulting node labels give the distances and the shortest directed paths from s to all other nodes of the net that can be reached from 5 by directed paths.
2.3
MULTITERMINAL SHORTEST DIRECTED PATHS
In the foregoing, we discussed procedures for finding all shortest directed paths from a preassigned source node s to all other nodes. In the present section, we shall look for shortest directed paths between all pairs of nodes in a net. One obvious way for obtaining the solution is to apply the single source algorithms of Section 2.2 n times, each time with a different node chosen as the source node s. Since for each choice of s the computational complexity is 0 ( « 3 ) for a general n-node net, the resulting procedure would require 0 ( n 4 ) . In the following, we describe several other more efficient algorithms for solving this problem. The methods are applicable to general nets without negative directed circuits.
2.3.1
Matrix Algorithm
Consider an w-node net G{V, E, I) in which the nodes have been designated as 1, 2 , . . . , n. For our purposes, we introduce two matrices based on G.
140
THE SHORTEST DIRECTED PATH PROBLEM
DEFINITION 2.2 Connection Matrix. The connection matrix C = [c,y] of an n-node net G(V, E, I) is an n X n matrix whose ith row and yth column element c,y is the length of the arc (i, j) or c,-, = l(i, j), where c„ = 0 for all i and c,y = °° for all (i, j)
DEFINITION 2.3 Distance Matrix. The distance matrix D = [dit] of an n-node net G(V, E, I) is an n xn matrix whose ith row and ;"th column element d^ is the distance from node i to node j in G, where du = 0 for all i. We first define a special matrix binary operation, denoted by the symbol <8>, called the minaddition. Given two square matrices of order n A = K]
(2.109)
B = [bv]
(2.110)
the minaddition of A and B is a matrix W = A®B
= [wij]
(2.111)
of the same order whose ith row and yth column element Wy is determined by the equation Wtj = min (aik + bkj)
(2.112)
k
Recall that in the ordinary matrix product, the element w^ is defined by Wij = ^<*ikbkj
(2.113)
If in (2.113) the summation is replaced by the minimum operation, and the product aikbkj is changed to addition, we obtain the minaddition operation (2.112). It is straightforward to verify that minaddition is associative, but is not commutative. In what follows, we shall use power, product and similar terms in the sense of minaddition. Thus, we write C 2 = C<8>C
(2.114)
and C3 is the third power of C in the sense of minaddition. Also, we shall use the symbol c$° to denote the ith row and y'th column element of Ck: Ck = [£#>]
(2.115)
2.3 MULTITERMINAL SHORTEST DIRECTED PATHS
141
It is not difficult to see that the entry c)2' gives the length of a shortest directed path from i to j in G using at most two arcs, because in this case cf = min (cik + ckJ)
(2.116)
k
and we have tried every node k as a possible intermediate node of a two-arc or one-arc directed path from i to j , where the one-arc path corresponds to k = i or k =j. The entries c\p of C 3 = C ® C <8> C represent the lengths of the shortest directed paths from i toy using at most three arcs. By induction, we can show that the entries c\k) of Ck gives the lengths of the shortest directed paths from i to / using at most k arcs. Since we have already calculated C2, there is no need to calculate C 3 first in order to calculate C 4 . We can calculate C 4 directly from C2 by virtue of the fact that the minaddition is associative: C 4 = C ® C <8> C ® C = (C ® C) ® (C ® C) = C2 <8> C 2
(2.117)
Once we obtain C 4 , we can use it to calculate C 8 . This squaring process can be continued until Ck, k = 2", is obtained, where a is the least integer greater than or equal to log2 (n - 1). This follows from the fact that the number of arcs in any path in an n-node net is at most n — 1. Therefore, we have D = Ck = C""1
for all k ^ n - 1
(2.118)
Example 2.11 Consider the net G(V, E, I) of Fig. 2.21, which is redrawn in Fig. 2.27.
Fig. 2.27. A net G(V, E, I) used to illustrate the construction of the connection matrix and the matrix binary operation called the minaddition.
142
THE SHORTEST DIRECTED PATH PROBLEM
The connection matrix of the net is found to be
1 1 "0 2 00 C = 3 00 4 00 5 00 6 00
2 4 0 -3
5
4
6
3 6
00
00
00
5
-2
00
00
00
00
0
00
0 2 6
00
-1 0
00
00
00
00
00
oo~
(2.119)
5 4 0.
the square of which in the sense of minaddition is given by
1 1 "0 2 00 2
C = C® C =3
00
4 5 6
00 00
_00
2 3 0 -3 -1 3
3 6 4 0 2 6
00
5 2 -2 -5 -1 0
00
00
00
00
4 9 5 2 0
6 00~
2 00
(2.120)
3 4 0.
This matrix can again be squared to yield
1 1 "0 2 00 3 00 4 00 5 00 6 00
2 3 0 -3 -1 3
3 6 4 0 2 6
4 8 5 2 0 8
00
00
00
6 5 1 5 -2 2 -5 -1 1 -3 4 0 00 0
(2.121)
It is straightforward to verify that D = Ck = C* for all A: ^ 4
(2.122)
We now count the number of additions and comparisons in (2.118). For each entry c]?2) of C 2 , (2.116) requires n additions and n — 1 comparisons. For C 2 we require a total of n3 additions and n2(n - 1) comparisons. Therefore, the computational complexity of the algorithm is 0(cm 3 ). In calculating Ck, if instead of using the minaddition operation we use
2.3 MULTITERMINAL SHORTEST DIRECTED PATHS
143
the ordinary matrix multiplication and addition, the ith row and/th column element c\P of Ck can be written explicitly as
4*
) =
i
£•••
i
c * < * i v •<*-,>
(2-123)
where c,y = c\p for all i and j . This shows that each product %/:•••%-,;
(2-124)
in the sum represents a directed edge sequence (i,ii)Uuh)---(ik-i,i)
(2-125)
from i to / using exactly k arcs in the rc-node complete directed graph with c,y = (/, /'). Equation (2.123) gives all the directed edge sequences from i to j using exactly k arcs. It follows that if C is the connection matrix of G(V, E, I) and if the summations in (2.123) are replaced by the minimum operations and the products are changed to additions, c\p is the length of a shortest directed path from i to / in G using at most k arcs. The reason for this is that using the minaddition operation and setting cxx = 0 for all x, for any term in (2.123) corresponding to a directed edge sequence containing a directed circuit, there is a term corresponding to a directed path not longer than the directed edge sequence, because the net does not contain any negative directed circuits. To reduce the number of operations in (2.118), Narahari Pandit (1961) proposed a revised matrix algorithm. The idea is that an entry of the 'product' matrix in the sense of minaddition, once calculated, immediately replaces the corresponding entries in the two matrices that form the product before the next entry of the product matrix is calculated. Clearly, in such a process, the order of the computation is important in that the entry calculated last uses the entries calculated earlier in the minaddition operations. We call the minaddition procedure the forward process if the calculations of the matrix product start from top row and from left to right in forming the minadditions. Let C (f) = [ c f |
(2.126)
be the matrix calculated by this process, written as C(t) = C®tC
(2.127)
where f signifies the forward process, and C = C<1> = [41>] = [c,y]
(2.128)
144
THE SHORTEST DIRECTED PATH PROBLEM
The elements c^f) of C (f) can be expressed explicitly as 4« = m i n [ c ^ + 4 f ]
(2.129)
k
where P=h
i^k
(2.130a)
P=f,
}>k
(2.130b)
q = l,
i^k
(2.130c)
q = f,
i>k
(2.130d)
After obtaining C (f) , the calculations of the matrix 'product' of C (f) by itself start from bottom row and from right to left, reversing the order of the first matrix multiplication of (2.127) using the operation <8>f. This reverse procedure is referred to as the backward process: C (b) = [<#>] = C (f) <8>b C (f)
(2.131)
The elements c(b) of C (b) can be written explicitly as <#> = min [<#> + <#>]
(2.132)
k
where p = f,
itS;
(2.133a)
p=b,
k>j
(2.1336)
<7=f,
k^i
(2.133c)
a = b,
A:>«
(2.133d)
In the case where all the arcs of a net G(V, E, I) are nonnegative, Farbey, Land and Murchland (1967) showed that one forward process followed by one backward process is sufficient to generate all the distances between all pairs of nodes. On the other hand, Hu (1967) proved that while two forward processes are not enough, three are always sufficient. More recently, Yang and Chen (1989) demonstrated that one forward process followed by one backward process, three forward processes, one backward process followed by one forward process, or three backward processes are sufficient to generate all the distances between all pairs of nodes in a net with negative arcs but with no negative directed circuits. We illustrate the above results by the following example.
2.3 MULTITERMINAL SHORTEST DIRECTED PATHS
145
Fig. 2.28. A net G{V, E, I) used to illustrate the forward and backward processes in the matrix calculation of the distances between all pairs of nodes.
Example 2.12 Consider the net G(V, E, I) of Fig. 2.28, the connection matrix of which is found to be
1 1 "0 2 00 C = 3 00 4 00 5 2
2 1 0
3 00
5
4 3
00
00
00
4 3 0
00
2 0
4
00
1 0
00
00
00
(2.134)
In the forward process, we calculate e g = min {0 + 1,1 + 0, oo + oo, 3 + 4, oo + oo} = l
(2.135a)
e g = min {0 + oo, l + 2, oo + 0, 3 + oo, oo + oo} = 3
(2.1356)
At this point, the original entry c 13 = oo in C is replaced by e g = 3 before continuing the calculation. Note that in machine computation, the replacement operation is automatic, and there is no need to check to see if c\p = c,y. To continue, we calculate ciV = min {0 + 3,1 + oo, 3 + 1, 3 + 0, oo + oo} = 3
(2.136a)
e g = min {0 + oo, 1 + oo, 3 + 4, 3 + 3, oo + 0} = 6
(2.1366)
At this stage, we replace the entry c 15 = oo by e g = 6 before proceeding to
146
THE SHORTEST DIRECTED PATH PROBLEM
the computation of the next element. The final result at the end of the forward process is given by
(f)
c = cc
1
2
3
4
5
1 "0
1
3
3
6
2
00
0
2
3
6
C=3
6
5
0
1
4
4
5
4
6
0
3
5
2
3
5
5
0
(2.137)
This matrix is used to form C ( b ) by the backward process, as follows: c(£> = min {2 + 3, 3 + 3, 5 + 1, 5 + 0, 0 + 5} = 5
(2.138a)
cg } = min {2 + 3, 3 + 2, 5 + 0, 5 + 6,0 + 5} = 5
(2.1386)
eg? = min {oo + 3, 0 + 2, 2 + 0, 3 + 6,6 + 5} = 2
(2.138c)
c8> = min {oo + 0,0 + oo, 2 + 6, 3 + 5, 6 + 2} = 8
(2.138rf)
At this point, we replace the entry c$ = oo by c^i = 8 before proceeding to calculate C&. At the end of the backward process, the matrix becomes 1 2 1 "0 2 C
(b)
=C
(f)
®b C
(f)
4
1 3 3
8 0
=3 6
2
5 0
5 4
5 2
3 4
3
5 6"
3 6 1 4 = D
6 0
(2.139)
3
5 5 0
the distance matrix, the elements of which are the distances between all pairs of nodes in the net G(V, E, I) of Fig. 2.28.
2.3.2
Floyd-Warshall Algorithm
Recall that a subpath of a shortest directed path in a net G(V, E, I) is itself a shortest directed path. In particular, each arc of a shortest directed path is itself a shortest directed path. An arc (i, j) is termed a basic arc if it is the shortest directed path from i to ;'. Thus, arcs belonging to shortest directed paths are all basic arcs. If there is a pair of nodes i and j not connected directly by a basic arc (i, j), we can replace such a nonbasic arc by a basic
2.3 MULTITERMINAL SHORTEST DIRECTED PATHS
147
Fig. 2.29. Symbolic representation of the triple operation. arc whose length is equal to the shortest distance from i to ;' in G, assuming that arcs not in G are arcs of infinite length in G. The present algorithm describes a simple procedure of creating basic arcs between each pair of nodes not connected by a basic arc, and was first proposed by Floyd (1962) and Warshall (1962). In a given net G(V, E, I), perform the following operation for a fixed k and all i, j =£k: l(i, j) <- min [l(i, j), l(i, k) + l(k, /)]
(2.140)
As depicted in Fig. 2.29, the operation compares the length of an arc (i, /') with that of a two-arc directed path (i, k)(k, j), the smaller of which is used to replace the length of arc (i, j), and is called the triple operation. We begin by setting k = 1 and apply the triple operation (2.140) for all i, j = 2,3,...,n. Then we set k = 2, and perform the triple operation for all i, j = 1, 3, . . . , n. Notice that in performing the triple operation for k = 2, we use all the new arcs created when k = \. We continue in this way until the triple operation is performed for k = n. We claim that at the end of the triple operation for k = n, the resulting net G' consists only of basic arcs. In other words, the arc length l(i, j) in G' represents the shortest distance from i to / in G(V, E, I). We now proceed to justify this assertion. Consider an arbitrary shortest directed path, say, (2, 5)(5, 3)(3, 4)(4, 6) as shown in Fig. 2.30(a). We show that the triple operation will create an arc (2,6), the length of which is equal to the sum of all the basic arcs in (2,5)(5,3)(3,4)(4,6). Once we verify the assertion for this particular directed path, the procedure can be generalized to any arbitrary shortest directed path, from which a formal proof can be stated. However, we do not find it necessary; only the verification of this arbitrarily chosen path is provided here. When k = 2, the triple operation does not create any new arcs for the directed path of Fig. 2.30(a). When k = 3, the triple operation creates a new arc (5,4) with /(5, 4) = /(5, 3) + 1(3, 4)
(2.141)
148
THE SHORTEST DIRECTED PATH PROBLEM
(a)
0—^-0—^^y^-^y^-^
Fig. 2.30. A graph used to illustrate the triple operation: (a) the original graph and k = 2, (b) k = 3, (c) k = 4, (d) k = 5.
as shown in Fig. 2.30(b). When k = 4, two more arcs (3,6) and (5,6) as shown in Fig. 2.30(c) are created with /(3, 6) = /(3, 4) + 1(4, 6)
(2.142a)
/(5, 6) = /(5, 4) + 1(4, 6) = /(5, 3) + /(3, 4) +1(4, 6)
(2.1426)
When k - 5, three more arcs (2, 3), (2, 4) and (2, 6) are created as indicated
2.3 MULTITERMINAL SHORTEST DIRECTED PATHS
149
in Fig. 2.30(d) with 1(2, 3) = 1(2, 5) + /(5, 3)
(2.143a)
1(2, 4) = 1(2, 5) + /(5, 4) = 1(2, 5) + /(5, 3) + 1(3, 4)
(2.1436)
1(2, 6) = 1(2, 5) + /(5, 6) = 1(2, 5) + 1(5, 3) + /(3, 4) +1(4, 6) (2.143c) confirming that (2, 6) is a basic arc. The Floyd-Warshall algorithm is applicable to any net G(V, E, I) that does not contain any negative directed circuits. For our purposes, we assume that l(i, i) = 0 (i = 1, 2, . . . , n) and l(i, j) = oo for (i, j) $ E. Step 1. Set k = 0. Step 2. fc = k + 1. Step 3. For all i =£ k, l(i, k) ¥= °° and all / =£ A:, l(k, j) ¥= °°, perform the triple operation l(i, j) <-min [l(i, j), l(i, k) + l(k, /)]
(2.144)
Step 4. If /(*', i) ^ 0 (i = 1, 2, . . . , n) and k < n, return to Step 2. If l(i, i) < 0 for some i, there is no solution. Stop. If l(i, i) i? 0 (i = 1, 2, . . . , n) and k = n, stop. We remark that in Step 4 if /(j, /) < 0 for some i, then a negative directed circuit containing the node i exists in G, and no meaningful solution can be found. If /(/, i) = 0 for all i and k = n, the solution is found and the arc length l(i, j) in the resulting net G' gives the distance from i to ;' in G for all i and /. Once the distances between all pairs of nodes are calculated, the shortest directed paths themselves can be determined by using a recursive relation similar to that of (2.12). Alternatively, we can use a bookkeeping mechanism to record information about the directed paths themselves, as follows. When we perform the triple operation, we keep track of the internal nodes of the directed paths. We use a n n x n matrix P=[PiI]
(2.145)
for storage and updating purposes. The /th row and ;'th column entry p,7 gives the first internal node on the directed path from i to ;'. If p / ; = x, then the first arc of the shortest directed path from i to /' is (i, x). Likewise, if Pxj ~ y, then the first arc of the shortest directed path from x to ;' is (x, y). In this way, we can trace back to any of the other nodes. Initially, we assume that in going from i to / the first arc is (i, j). Thus, we set pn —j for all i and /. When we perform the triple operation, we also update the information in
150
THE SHORTEST DIRECTED PATH PROBLEM
P with its entries being changed in accordance with the following rule: pv=pik, = Pij,
if l(i,j)>l(i,k) + l(k,j)
(2.146a)
if l(i,j)^l(i,k)
(2.146ft)
+ l(k,j)
We recognize that the triple operation performed on the net G can easily be performed on the connection matrix C = [c,y] of G. When k = \, we compare every entry ct) (i¥= l,j¥= 1) with cn + cv. If c y is greater than c w e replace the entry c y by cn + cy. Otherwise, the entry remains unaltered. For k = 2, we compare every entry ctj (i ¥= 2, / =£ 2) with c,2 + c 2/ . If c,y is greater than c,2 + c2y, we replace c,y by c,-2 + c2y. Otherwise, the entry remains the same. Notice that in computing for k = 2, we have already used the results for k = \. We continue in this way until k = n is computed. Observe that each entry is compared with the sum of two other entries, one in the same row and one in the same column. For each entry, we have to check (n — l ) 2 entries. Since there are n nodes to consider, the computational complexity of the Floyd-Warshall algorithm is 0(n3). Example 2.13 We use the Floyd-Warshall algorithm to find the distances between all pairs of nodes in the net G(V, E, I) of Fig. 2.31. Initially, we set l(i, i) = 0 for all i and l(i, j) = °° for (/, j) $ E. Step 1. Set k = 0. Step 2. Setk = k + lork Step 3.
= l. 1(4, 2) ±- min [°°, 2 + 1] = 3
(2.147a)
1(4, 3 ) ^ m i n [ - l , 2 + 4] = - l
(2.1476)
1(4,5)*-min[-l,2 + 4] = - l (2.147c) At the end of this step, an arc (4, 2) is created with 1(4, 2) = 3.
Fig. 2.31. A net G(V, E, I) used to illustrate the Floyd-Warshall algorithm for the calculation of the distances between all pairs of nodes.
2.3 MULTITERMINAL SHORTEST DIRECTED PATHS
151
Step 4. Return to Step 2. Step 2. k = 2. Step 3. From here on we list only those arcs whose lengths will be changed after performing the triple operation. 1(1, 4) *-min [», 1 - 1] = 0
(2.148a)
1(3, 4) ^ m i n [«>, 2 - 1] = 1
(2.148b)
1(1, 5) <- min [4,1 + 2] = 3
(2.148c)
At the end of this step, two new arcs (1,4) and (3, 4) are created with 1(1, 4) = 0 and 1(3, 4) = 1, and the arc length of (1,5) is changed from 4 to 3. Step 4. Return to Step 2. Step 2. k = 3 Step 3. 1(4, 2 ) ^ m i n [ 3 , - 1 + 2] = 1
(2.149)
At the end of this step, the arc length 1(4, 2) is changed from 3 to 1. Step 4. Return to Step 2. Step 2. k = 4 Step 3. 1(2, l ) < - m i n [ o o , - l + 2] = l
(2.150a)
1(3, 1)*-min [oo, 1 + 2 ] = 3
(2.1506)
1(1, 3 ) ^ - m i n [ 4 , 0 - l ] = - l
(2.150c)
7(5, l)<-min[oo,2 + 2] = 4
(2.150a1)
1(2, 3) ^min[oo, - 1 - 1] = - 2
(2.150c)
/(5, 2 ) ^ m i n [ o o , 2 + l] = 3
(2.150/)
1(2, 5)<-min[2, - 1 - 1 ] = - 2
(2.150g)
1(3, 5 ) ^ m i n [ 3 , l - l ] = 0
(2.150/J)
/(5, 3) ^ m i n [ o o , 2 - l ] = 1
(2.150/)
1(1, 5 ) ^ m i n [ 3 , 0 - l ] = - l
(2.150/)
At the end of this step, the resulting net is shown in Fig. 2.32. Step 4. Return to Step 2. Step 2. k = 5.
152
THE SHORTEST DIRECTED PATH PROBLEM
Fig. 2.32. The final net after the application of the Floyd-Warshall algorithm to the net of Fig. 2.31.
Step 3. Nothing is changed. Step 4. Stop. The final net is shown in Fig. 2.32. Each of its arcs (i, j) is a basic arc, meaning that its length is the distance from i to / in the net of Fig. 2.31 or 2.32. Having found the distances between all pairs of nodes, we need to ascertain the internal nodes along a shortest directed path. For this we define a 5 x 5 matrix P of (2.145). Initially, we let ptj =;" for all / and ;" or 1 2
3 4
5
1 "1 2 3
4
5"
2
1 2
3
4
5
P =3
1 2
3
4
5
4
1 2
3
4 5
5
1 2
3 4
(2.151) = [Pa]
5
In (2.147a), when we set /(4, 2) to 1(4, 1) +1(1, 2) = 2 + 1 = 3, we also set P42=P41 = 1Likewise, in (2.148) when we set 1(1, 4) = 1(1, 2) + 1(2, 4) = 1 - 1 = 0
(2.152a)
/(3, 4) = 1(3, 2) + 1(2, 4) = 2 - 1 = 1
(2.152ft)
1(1, 5) = 1(1, 2) + 1(2, 5) = 1 + 2 = 3
(2.152c)
2.4
ENUMERATION OF T H E SHORTEST DIRECTED PATHS
153
we also set Pu=Pi2 = 2
(2.153a)
P34=P32
= 2
(2.1536)
/>15=/>12 = 2
(2.153c)
respectively. At the end of computation, the resulting matrix becomes
P=
(2.154)
To find a shortest directed path from 1 to 5, we first look at the entry pl5 and find the first arc (1, x). Since p15 = 2, x = 2. We next look at the entry p25 = 4. The second arc of the shortest directed path from 1 to 5 is (2, 4). We then look at the entry p45 = 5, giving the third arc (4,5). Thus, a shortest directed path from 1 to 5 in the net of Fig. 2.31 is (1, 2)(2,4)(4, 5), whose length is - 1 as indicated in Fig. 2.32.
2.4 ENUMERATION OF THE SHORTEST DIRECTED PATHS BY DECOMPOSITION In many applications, a net G(V, E, I) is sparse in that many of its node pairs are not connected directly by arcs. In such situations, we can regard the net as being composed of two overlapping nets Ga{Va, Ea, I) and GpiVp, Ep, I), as depicted symbolically in Fig. 2.33 with V = Va U Vp
(2.155a)
Y=vanvp
(2.1556)
E = EaUEp
(2.156a)
Ev — E„ D E, P
(2.1566)
where Y denotes the set of overlapping nodes and EY denotes the set of arcs {i, j) with i, j € Y. The net G{V, E, I) of Fig. 2.34, for example, may be decomposed into two overlapping nets Ga(Va, Ea, I) and Gp(Vp, Ep, I) as shown in Fig. 2.35 with Y = {2, 6} and EY= {(6, 2)}. The nets Ga and Gp are the sectional directed graphs of G defined by the node sets Va and Vp, and denoted by Ga = G[Va] and Gp = G[V^], respectively.
154
THE SHORTEST DIRECTED PATH PROBLEM
Fig. 2.33. Symbolic representation of a net as being composed of two overlapping nets.
Fig. 2.34. A net G(V, E, I) used to illustrate the decomposition of a net into two overlapping nets. (a)
Fig. 2.35. A decomposition of the net of Fig. 2.34 into two overlapping nets: (a) G.(ya, Ea, I), (b) GpiVp, E„ I).
Let the node set V be partitioned into three subsets Y, X and Z : V = XUYVZ
(2.157)
where X=Va-Y
(2.158a)
Z=VP-Y
(2.158fe)
2.4 ENUMERATION OF THE SHORTEST DIRECTED PATHS
155
If D is the distance matrix of G(V, E, I), it can be partitioned in accordance with (2.157), as follows: X
Dxx Kl = Y DYX z _DZX X
D
=
Y
Z
DXY
Dxz DYZ Dzz_
DYY
DZY
(2.159)
To simplify our notation, we shall use the symbol dtj{W) to denote the length of a shortest directed path from i to j in G subject to the restriction that all the nodes of the directed path belong to a subset W of the node set V. Thus, dij = dtj(V). Also, we use the symbol DXy(W) = [diJ(W)]
(2.160)
to denote the matrix of distances rf,y(W) with i e X and /' e Y with DXY = DXY(V). Recall that the original net G(V, E, I) is composed of two nets Ga(Va, Ea, I) and GP(VP, Ep, I) overlapping at the nodes of Y. First, we apply the Floyd-Warshall algorithm to the net Ga, and obtain the matrix D \ID - •xx{Va) Yx{Va)
DXy(Va)
(2.161)
DYAVC
of distances dy(Va) between each pair of nodes in Ga. We then replace the lengths of the arcs between each pair of nodes of Y in Gp by those of Dyy(V a ). Note that arcs not in Ep are considered as arcs in Ep with infinite length. Let the resulting net be designated as G'p(Vp, E'p, / ' ) . We shall now apply the Floyd-Warshall algorithm to G'p again. At the end of the triple operations, we claim that we obtain the matrix Dyy(V) DZY(V)
DYZ(V) DZZ(V)
(2.162)
of distances d^V) = dtj between each pair of nodes of Vp in G, the original net. To verify our assertion, let Pif be a shortest directed path from i to / in G with i,jeVp. If all the nodes of Ptj lie in Z, then d,y(V) = dtj{Z) and the triple operations on G'p will yield the correct distance. Thus, assume that Ptj contains nodes in X and/or Y. Such a path Ptj is symbolically shown in Fig. 2.36. Since i and / are in Vp and Y is the set of overlapping nodes, the subpaths of Ptj that contain the nodes of X must begin and end in the set Y. The subpath Pyiy2 from j ^ to v2 and the subpath Py3y4 from y3 to y4 in Fig. 2.36 are two typical such subpaths. They may be the shortest directed paths
156
THE SHORTEST DIRECTED PATH PROBLEM
Fig. 2.36. A symbolic representation of a path Pv containing nodes in X and/or Y.
from yx to y2 and from y3 to y4 in Ga, respectively. Knowing dyiy2(Va) and dyiyi(Va) from (2.161), we effectively created two arcs (ylt y2) and (v 3 , y4) in G'p with l'(ylt y2) = dyiy2(Va) and l'(y3, y4) = dny4(Va), as shown in Fig. 2.37. The shortest directed path Ptj from i to / can be replaced by another directed path of the same length in G'p consisting of the subpath Piyi, (y 1; y2), the subpath P^y,, (^3, y 4 ), and the subpath Pytj. This means that the triple operations performed on G'p will give the correct distance from i to j in G. Having obtained the distances between each pair of nodes in Vp, we now replace the distances between each pair nodes of Y in Ga by those of DYY(V) of (2.162), and denote the resulting net by G'a(Va, E'a, I'). We apply the Floyd-Warshall algorithm again to G'a. At the end of the triple operations, we obtain the matrix DXX{V)
DxyiV)]
(2.163)
of distances d,y(V) = dtj between each pair of nodes of Va in G, the original net. Finally, to calculate the elements in DXz = DXZ(V) and Dzx = DZX{V),
Fig. 2.37. A symbolic representation of the creation of two arcs (ylt y2) and (_y3, y4) of equivalent lengths.
2.4 ENUMERATION OF THE SHORTEST DIRECTED PATHS
157
we use the formulas d,j = dy(V) = min [diy(V) + dyi(V)]
(2.164a)
yeY
dj, = dn(V) = min [djy(V) + dyi(V)]
(2.1646)
yeY
for i e X and / e Z. This follows directly from the observation that any directed path from i e X to j e Z or from / to i must pass at least one node y in Y, the minimum of which is certainly the minimum distance in G. We now demonstrate the reduction in the number of operations required when distances are calculated by the decomposition procedure. Recall that the Floyd-Warshall algorithm requires approximately n3 operations to find the distances between every pair of nodes in an n-node net. If the node set is decomposed as in (2.157) with \X\ = n1, \Y\ = n2 and |Z| = n 3 , then we need approximately (n1 + n2)3 operations in calculating (2.161), (n2 + n3)3 operations in calculating (2.162), (n1 + n2)3 in recalculating (2.163), and 2nin2n3 operations in applying (2.164). Thus, the total number of operations required is 2(«i + n2f + (n2 + n3)3 + 2n 1 « 2 « 3
(2.165)
As a specific example, let /i 1 = n 3 = 20 and n2 = 5. The decomposition algorithm requires approximately 50875 operations, whereas the direct application of the Floyd-Warshall algorithm will need 91125 operations, showing that decomposition can reduce the number of operations by a factor 1.8. We illustrate the decomposition procedure by the following examples. Example 2.14 Consider the sparse net G{V, E, I) of Fig. 2.38 which can be decomposed into two nets Ga(Va, Ea, I) and Gp{Vp, Ep,l) as shown in Fig. 2.39.
Fig. 2.38. A sparse net G(V, E, I) used to illustrate the decomposition procedure.
158
THE SHORTEST DIRECTED PATH PROBLEM
(a)
(b)
Fig. 2.39. The net of Fig. 2.38 decomposed into two overlapping nets: (a) Ga(Va, E„, /), (b) GpiVp, E„, I). Following (2.157) and (2.158), we can make the following identifications: A - = {1,2},
y={3,4},
Va = {1, 2, 3, 4},
Z = {5,6}
V„ = {3, 4, 5, 6}
(2.166a) (2.1666)
Applying the Floyd-Warshall algorithm to Ga, we obtain the net of Fig. 2.40, whose distance matrix is given by 1 2
1 ro 2 3 3 6 4 _5
3
4
2 3"| 5 0 -1 0 0 1 3 1 0_ 2
\DXX(ya) lDYX(Va)
DXY(Va) Dyy{Va)
}
(2.167)
Fig. 2.40. The resulting net after the application of the Floyd-Warshall algorithm to
2.4 ENUMERATION OF THE SHORTEST DIRECTED PATHS
159
Fig. 2.41. (a) The net G'p(Vp, E'p, /') obtained from G„ after the insertion of an arc (4,3) of length 1. (b) The resulting net after the application of the Floyd-Warshall algorithm to G'p.
We next 2.41(a), resulting found to
insert an arc (4, 3) of length 1 in Gp to yield the net G'p of Fig. and then apply the Floyd-Warshall algorithm to G'p. The net is shown in Fig. 2.41(b), the distance matrix of which is be
3 4 5 3 ro 1 : 0 4 I 0 : -1 5 6 5; 0 6 4 3! 2
6 2 1 2 0
\Dyy{V) lDZY(V)
DYZ(V)1 DZZ(V)\
(2.168)
We now insert an arc (4, 3) of length 1 in Ga to yield the net G'a of Fig. 2.42(a), and then apply the Floyd-Warshall algorithm to G'a. The
(a)
Fig. 2.42. (a) The net G'JVa, E'a, I') obtained from Ga after the insertion of an arc (4,3) of length 1. (b) The resulting net after the application of the Floyd-Warshall algorithm to G'a.
160
THE SHORTEST DIRECTED PATH PROBLEM
resulting net is shown in Fig. 2.42(b), the distance matrix of which is obtained as 1 2 1 ro 2 3 3 6 4 _5
5 0 3 2
3 4 2 31 -1 0 0 1 1 0_
DXX(V) ID YX(V)
DMVy Dyy(V)-
(2.169)
Finally, we use (2.164) to calculate the elements of Dxz and Dzx, follows:
as
[2 + 0, 3 - 1] = 2
(2.170a)
d16 = min [d13 + d36, d14 + d^] = min[2 + 2, 3 + 1] = 4
(2.170&)
d25 = min [d23 + d35, d24 + d4s] = min[ - l + 0 , 0 - l ] = - l
(2.170c)
d26 = min [d23 + d36, d24 + d^\ = min[ - l + 2,0 + l] = l
(2.170a*)
d5l = min [d53 + d31, dS4 + d41] = min[6 + 6, 5 + 5] = 10
(2.171a)
d61 = min [d63 + d3l, dM + d4l] = min[4 + 6, 3 + 5] = 8
(2.1716)
d52 = min [d53 + d32, d54 + d42] = min [6 + 3, 5 + 2] = 7
(2.171c)
d62 = min [d63 + d32, dM + d42] = min[4 + 3, 3 + 2] = 5
(2.171d)
Combining (2.168)-(2.170) gives the complete distance matrix of G: 1 2 1 " 0 5
D=
3 4
5
6
2
3
2
4"
2
3 0
-1
0
-1
1
3
6
3
0
1
0
2
4
5 2
1 0
-1
1
5
10 7
6 5
0
2
4
2
0.
6 . 8 5
3
Ar*
DXY
Dxz
# y *
DYY
DYZ Dzz
VDzx DZY
(2.172)
each of whose elements d,y is the distance from i to / in the original net G(V, E, I) of Fig. 2.38. 2.5 SUMMARY AND SUGGESTED READING In this chapter, we discussed the problem of finding the shortest directed paths from one node to all the other nodes and between all pairs of nodes in
2.5 SUMMARY AND SUGGESTED READING
161
a weighted directed network called a net. The weights of the arcs of the net are real numbers that can be positive, zero or negative. However, for the problem to be meaningful, we assume that all the nets under consideration do not contain any negative directed circuits. The shortest directed path problem is fundamental in that it often occurs as a subproblem of other optimization problems. For the problem of finding the shortest directed paths from one node to all other nodes, we presented four algorithms. The Dijkstra algorithm is most efficient because the required computation for an n-node net is 0 ( « 2 ) . However, the algorithm is applicable only to those nets whose arc lengths are nonnegative. The basic idea of the Dijkstra algorithm is that it iterates on the length of the shortest directed paths. Initially, the shortest among the shortest directed paths is identified. At each iteration, the next shortest among the shortest directed paths is generated. The algorithm terminates at the end of the (n — l)th iteration. The Ford-Moore-Bellman algorithm is general and is applicable to nets with negative arc lengths. The algorithm iterates on the number of arcs in a directed path. At the end of the kth iteration, the labels on the nodes represent the lengths of those shortest directed paths from the source node containing k +1 or fewer arcs. The algorithm terminates with at most n — 1 iterations, and requires 0 ( n 3 ) rather than 0 ( « 2 ) as in the Dijkstra algorithm. The Yen algorithm is basically the same as the Ford-Moore-Bellman algorithm except that it iterates on the number of blocks in a directed path. At the end of the kth iteration, it gives the lengths of all the shortest directed paths using at most k blocks. The algorithm terminates with at most n — 1 iterations, and requires roughly half the work of the Ford-Moore-Bell^ian algorithm. An additional advantage of the Yen algorithm is that the storage requirement of the program is also reduced. Finally, the Ford-Fulkerson algorithm is very similar to the Ford-Moore-Bellman algorithm in that it sequentially reduces the labels on the nodes by examining the arcs until the conditional distances become the true distances. For the problem of finding the shortest directed paths between all pairs of nodes, we presented two algorithms. The matrix algorithm uses the binary operation minaddition. The elements of the kth power of the connection matrix of a net in the sense of minaddition represent the lengths of the shortest directed paths in the net using at most k arcs. The algorithm terminates with at most a iterations, where a is the least integer greater than or equal to log2 (n — 1), and requires 0(an3) computations. To reduce the number of operations, we introduced two minaddition procedures known as the forward process and the reverse process. It can be shown that for a net with nonnegative arc lengths one forward process followed by one backward process is sufficient to generate all the distances between all pairs of nodes, and that while two forward processes are not enough, three are always sufficient. The Floyd-Warshall algorithm iterates on a set of nodes and uses the triple operation to create basic arcs between each pair of nodes
162
THE SHORTEST DIRECTED PATH PROBLEM
not connected by a basic arc. At the end of the triple operation, the resulting net consists only of basic arcs. The computational complexity of the algorithm is 0 ( n 3 ) , the same as if the Dijkstra algorithm was repeated for each node chosen as the source node. In many applications, the nets are sparse in that many of the node pairs are not connected directly by arcs. In such cases, we can decompose a net into two overlapping nets. We showed that the distances between all pairs of nodes in the original net can be calculated from those of the component nets, and that the resulting reduction in the number of operations may be considerable. Finally, we mention an intuitive way of solving the shortest path problem suggested by Minty (1957) for the case of undirected nets. One simply builds a physical model of the net using strings to connect the nodes, the lengths of which are proportional to the given arc lengths. By taking the source in one hand and the sink in the other, one solves the shortest path problem by stretching the source and the sink. For general information and other aspects of the shortest directed path problem, see Dreyfus (1969) and Yen (1975). Yen's extensive survey article is 169 pages long and contains a bibliography of 300 papers on the subject. For the algorithms discussed in this chapter, we refer the reader to the original papers cited in the text. For the matrix algorithm, see Pollack and Wiebenson (1960), Narahari Pandit (1961), and Hu (1967). For decomposition of a sparse net, see Land and Stairs (1967), Hu (1968), Hu and Torres (1969), Yen (1971a), and Blewett and Hu (1977).
REFERENCES Beardwood, J., Halton, J. H. and Hammersley, J. M. (1959), "The shortest path through many points," Proc. Cambridge Phil. Soc, vol. 55, pp. 299-327. Bellman, R. E. (1958), "On a routing problem," Quart. Appl. Math., vol. 16, pp. 87-90. Bilde, O. and Krarup, J. (1969), "A modified cascade algorithm for shortest paths," Metra, vol. 8, pp. 231-241. Blewett, W. J. and Hu, T. C. (1977), "Tree decomposition algorithm for large networks," Networks, vol. 7, pp. 289-296. Butas, L. F. (1968), "A directionally oriented shortest path algorithm," Transportation Res., vol. 2, pp. 253-268. Carson, J. S. and Law, A. M. (1977), "A note on Spira's algorithm for all-pairs shortest paths problem," SIAM J. Computing, vol. 6, pp. 696-699. Cartaino, T. F. and Dreyfus, S. E. (1957), "Application of dynamic programming to the airplane minimum time-to-climb problem," Aero Engr. Rev., vol. 16, pp. 74-77. Chen, W. K. (1966a), "Boolean matrices and switching nets," Math. Mag., vol. 39, pp. 1-8.
REFERENCES
163
Chen, W. K. (1966ft), "On directed trees and directed &-trees of a digraph and their generation," SIAM J. Applied Math., vol. 14, pp. 550-559. Cooke, K. L. and Halsey, E. (1966), "The shortest route through a network with t i m e s , " / . Math. Anal. andAppl., vol. 14, pp. 493-498. Dantzig, G. B. (1967), "All shortest routes in a graph," in Theory of Graphs, International Symposium. New York: Gordon and Breach, pp. 91-92. Dial, R. B. (1969), "Algorithm 360: Shortest path forest with topological ordering," Comm. ACM, vol. 12, pp. 632-633. Dial, R. B., Glover, F., Karney, D. and Klingman, D. (1979), "A computational analysis of alternative algorithms for finding shortest path trees," Networks, vol. 9, pp. 215-248. Dijkstra, E. W. (1959), "A note on two problems in connexion with graphs," Numerische Math., vol. 1, pp. 269-271. Dreyfus, S. E. (1969), "An appraisal of some shortest path algorithms," Operations Res., vol. 17, pp. 395-412. Farbey, B. A., Land, A. H. and Murchland, J. D. (1967), "The cascade algorithm for finding all shortest distances in a directed graph," Mangement Sci., vol. 14, pp. 19-28. Floyd, R. W. (1962), "Algorithm 97, shortest path," Comm. ACM, vol. 5, p. 345. Ford, L. R. Jr (1956), "Network flow theory," The RAND Corp., P-923, Santa Monica, Calif. Ford, L. R. Jr and Fulkerson, D. R. (1962), Flows in Networks, Chapter 3, Princeton, N.J.: Princeton University Press. Frederickson, G. N. (1987), "Fast algorithms for shortest paths in planar graphs, with applications," SIAM J. Computing, vol. 16, pp. 1004-1022. Fredman, M. L. (1976), "New bounds on the complexity of the shortest path problem," SIAM J. Computing, vol. 5, pp. 83-89. Glover, F., Klingman, D. and Napier, A. (1974), " A note on finding all shortest paths," Transportation Sci., vol. 8, pp. 3-12. Hakimi, S. L. and Yau, S. S. (1965), "Distance matrix of a graph and its realizability," Quart. Appl. Math., vol. 22, pp. 305-317. Hesse, R. (1972), "Solution of the shortest route problem using the assignment technique," Decision Sci., vol. 3, pp. 1-13. Hoffman, W. and Pavley, R. (1959), "A method for the solution of the Nth best path problem," / . ACM, vol. 6, pp. 506-514. Hoffman, A. J. and Winograd, S. (1972), "Finding all shortest distances in a directed network," IBM J. Res. Develop., vol. 16, pp. 412-414. Hu, T. C. (1967), "Revised matrix algorithms for shortest paths," SIAM J. Applied Math., vol. 15, pp. 207-218. Hu, T. C. (1968), "A decomposition algorithm for shortest paths in a network," Operations Res., vol. 16, pp. 91-102. Hu, T. C. (1982), Combinatorial Algorithms, Chapter 1, Reading, Mass.: AddisonWesley. Hu, T. C. and Torres, W. T. (1969), "Shortcut in the decomposition algorithm for shortest paths in a network," IBM J. Res. Develop., vol. 13, pp. 387-390.
164
THE SHORTEST DIRECTED PATH PROBLEM
Ibaraki, T. (1970), "Shortest path problems visiting specified nodes," Trans. Inst. Elec. Comm. Engr Japan, vol. 53-A, pp. 639-646. Johnson, D. B. (1973), " A note on Dijkstra's shortest path algorithm," / . ACM, vol. 20, pp. 385-388. Johnson, D. B. (1977), "Effcient algorithms for shortest paths in sparse networks," / . ACM, vol. 24, pp. 1-13. Kershenbaum, A. (1981), "A note on finding shortest path trees," Networks, vol. 11, pp. 399-400. Knuth, D. E. (1977), "A generalization of Dijkstra's algorithm," Inf. Process. Lett., vol. 6, pp. 1-5. Land, A. H. and Stairs, S. W. (1967), "The extension of the cascade algorithm to large graphs," Management Sci., vol. 14, pp. 29-33. Lawler, E. L. (1972), "A procedure for computing the K best solutions to discrete optimization problems and its application to the shortest path problem," Management Sci., vol. 18, pp. 401-405. Mills, G. (1966), "A decomposition algorithm for the shortest-route problem," Operations Res., vol. 14, pp. 279-291. Mills, G. (1968), "A heuristic approach to some shortest route problems," Can. Operational Res. Soc. J., vol. 6, pp. 20-25. Minieka, E. (1974), "On computing sets of shortest paths in a graph," Comm. ACM, vol. 17, pp. 351-353. Minty, G. J. (1957), "A comment on the shortest-route problem," Operations Res., vol. 5, p. 724. Minty, G. J. (1958), "A variant on the shortest-route problem," Operations Res., vol. 6, pp. 882-883. Moffat, A. and Takaoka, T. (1987), "An all pairs shortest path algorithm with expected time 0 ( n 2 l o g « ) , " SI AM J. Computing, vol. 16, pp. 1023-1031. Moore, E. F. (1957), "The shortest path through a maze," Proc. Int. Symp. on the Theory of Switching, Part II, April 2-5, p. 285. The Annals of the Computation Laboratory of Harvard University, vol. 30, Cambridge, Mass.: Harvard University Press. Mori, M. and Nishimura, T. (1968), "Solution of the routing problem through a network by matrix method with auxiliary nodes," Transportation Res., vol. 1, pp. 165-180. Murchland, J. D. (1969), "Bibliography of the shortest route problem," London School of Business Studies, Report LBS-TNT-6.2 (revised 1969). Nakamori, M. (1972), "A note on the optimality of some all-shortest-path algorithms," / . Operations Res. Soc. Japan, vol. 15, pp. 201-204. Narahari Pandit, S. N. (1961), "The shortest-route problem—an addendum," Operations Res., vol. 9, pp. 129-132. Nemhauser, G. L. (1972), "A generalized permanent label setting algorithm for the shortest path between specified nodes," / . Math. Anal, and Appl., vol. 38, pp. 328-334. Nicholson, T. A. J. (1966), "Finding the shortest route between two points in a network," Computer J., vol. 9, pp. 275-280.
REFERENCES
165
Pape, U. (1974), "Implementation and efficiency of Moore-algorithms for the shortest route problem," Math. Programming, vol. 7, pp. 212-222. Peart, R. M., Randolph, P. H. and Bartlett, T. E. (1960), "The shortest-route problem," Operations Res., vol. 8, pp. 866-867. Perko, A. (1965), "Some computational notes on the shortest route problem," Computer J., vol. 8, pp. 19-20. Petitfrere, M. (1972), "Sur l'Algorithme de Dijkstra l'Obtention des plus Courts Chemins dans un Graphe," Cahiers du Centre cTEtudes de Recherche Operationelle (Belgium), vol. 13, pp. 111-123. Pollack, M. and Wiebenson, W. (1960), "Solution of the shortest-route problem—a review," Operations Res., vol. 8, pp. 224-230. Shier, D. R. (1973), "A decomposition algorithm for optimality problems in tree-structured networks," Discrete Math., vol. 6, pp. 175-189. Shimbel, A. (1951), "Application of matrix algebra to communication nets," Bull. Math. Biophysics, vol. 13, pp. 165-178. Spira, P. M. (1973), "A new algorithm for finding all shortest paths in a graph of positive arcs in average time 0 ( n 2 l o g 2 f t ) , " SIAM J. Computing, vol. 2, pp. 28-32. Tabourier, Y. (1973), "All shortest distances in a graph: An improvement to Dantzig's inductive algorithm," Discrete Math., vol. 4, pp. 83-87. Tarjan, R. E. (1981), "A unified approach to path problems," / . ACM, vol. 28, pp. 577-593. Wagner, R. A. (1976), "A shortest path algorithm for edge-sparse graphs," J. ACM, vol. 23, pp. 50-57. Warshall, S. (1962), "A theorem on Boolean matrices," J. ACM, vol. 9, pp. 11-12. Weimer, D. L. (1963), "A serial technique to determine minimum paths," Comm. ACM, vol. 6, p. 664. Whiting, P. D. and Hillier, J. A. (1960), "A method for finding the shortest route through a road network," Operational Res. Quart., vol. 11, pp. 37-40. Williams, T. A. and White, G. P. (1973), "A note on Yen's algorithm for finding the length of all shortest paths in JV-node nonnegative-distance networks," J. ACM, vol. 20, pp. 389-390. Yang, L. and Chen, W. K. (1989), "An extension of the revised matrix algorithm," IEEE Proc. Int. Symp. on Circuits and Systems, Portland, Oregon, May 8-11, pp. 1996-1999. Yen, J. Y. (1970), "An algorithm for finding shortest routes from all source nodes to a given destination in general networks," Quart. Appl. Math., vol. 27, pp. 526-530. Yen, J. Y. (1971a), "On Hu's decomposition algorithm for shortest paths in a network," Operations Res., vol. 19, pp. 983-985. Yen, J. Y. (19716), "On the efficiencies of algorithms for detecting negative loops in networks," Santa Clara Business Rev., pp. 52-58. Yen, J. Y. (1972a), "Finding the lengths of all shortest paths in JV-node
166
THE SHORTEST DIRECTED PATH PROBLEM
nonnegative-distance complete networks using ^N3 additions and N3 comparisons," J. ACM, vol. 19, pp. 423-425. Yen, J. Y. (1972fc), "On the efficiency of a direct search method to locate negative cycles in a network," Management Sci., vol. 19, pp. 333-335. Yen, J. Y. (1975), "Shortest path network problems," Math. Systems in Economics, vol. 18, pp. 1-169.
3 MAXIMUM FLOWS IN NETWORKS
In Chapter 2, we discussed the shortest directed path problem. There, a network or simply a net is a weighted directed graph G(V, E) in which each arc is associated with a real number called the length of the arc. The length may be positive, negative or zero. In the case of positive length, it may represent the physical length of a street or highway, or the energy absorption property of a system when it is changed from one state to another. On the other hand, a negative length may signify the release of energy when the system is transformed from one state to another. If we think of the network as an interconnection of pipelines or communication wires, the nodes represent the junctions of the pipelines or the communication centers and the arcs denote the pipelines or wires themselves. Then the nonnegative real number of an arc may represent the cross-sectional area of the corresponding pipeline or the message-carrying capacity of the corresponding wire. Such a problem comes up naturally in the study of transportation or communication networks. For this reason, we introduce a new concept of flows in a network and use nonnegative real numbers to indicate the maximum flow that can transfer through the arc. The nonnegative real number is called the arc capacity. In this chapter, we discuss various problems associated with the flows in a capacitated network.
3.1
FLOWS
A net is a directed graph G(V, E) in which each arc (i, j) is assigned a nonnegative weight c(i, j) called the capacity of the arc. The capacities of arcs of G(V, E) can be considered as a function c from the arc set E to the 167
168
MAXIMUM FLOWS IN NETWORKS
nonnegative reals. Sometimes, it is convenient to allow infinite arc capacities. Also, to each arc (i, j) e E we assign a nonnegative weight f(i, j) called the flow in arc (i,j). Thus, the flows in G(V, E) are a function / from E to the nonnegative reals. More precisely, the net considered in this chapter is a quadruplet G(V, E, c, / ) with node set V, arc set E, capacity function c and flow function /. The set of flows associated with E denoted by {f(i, /)} is called a flow pattern. A flow pattern {/(/, /')} is said to be feasible in G(V, E, c, / ) and of value fst from node 5 to node t if it satisfies the following constraints: For each ieV,
2/(w)-2/(/>0=/», i
t=s
(3-ia)
= 0,
i*s,t
(3.16)
= -/„,
i=t
(3.1c)
)
c(i,j)
(i,j)eE
(3.2)
Thus, to define a feasible flow pattern, two nodes s and t are distinguished. We call node s the source and node t the sink. All other nodes are referred to as the intermediate nodes. If the net flow out of node i is defined to be
2/0W)-2/(/,0 /
(3-3)
i
then equation (3.1) states that the net flow out of the source s isfst, the net flow into the sink t is fs, or the net flow out of the sink t is -f s „ and the net flow out of an intermediate node is zero. Equation (3.16) is called a conservation equation, similar to Kirchhoff's current law equation for electrical networks. Our objective here is to determine a maximum possible feasible flow pattern, the value fst of which is called the maximum flow. We remark that since / = 0 and fst = 0 are permitted, there is no question about the existence of a feasible flow pattern. While the arc set £ is a subset of all the ordered pairs (/,/), i¥=j and i,jeV, with capacity function c nonnegative on E, we could assume the net G to be a complete directed graph by taking c = 0 for arcs not originally in E, or we could assume strict positivity of the capacity function c by deleting from E arcs having zero capacity. Notice that not all the equations of (3.1) are linearly independent. To see this, let Aa be the complete incidence matrix of G, and let F be the column vector of the arc flows of E, arranged in the same arc order as the columns of Aa. Now row-partition the matrix Aa in accordance with the source s, intermediate nodes i and sink t: ~AS At
A,.
(3.4)
3.1 FLOWS
169
Equation (3.1) can be rewritten as ~A~ A„F
A,- F =
LA J
[/»] 0 _
(3.5)
1st _
Observe that by adding all the equations of (3.5) we produce a row of zeros, implying that not all the equations are linearly independent. Therefore, we could omit any one of them without loss of generality. We prefer, however, to retain the one-to-one correspondence between the equations and nodes. Finally, we mention that by adding an arc (t, s) in G with capacity c(t, s) =fst, all equations in the resulting net can be taken as conservative equations. We illustrate the above result by the following example. Example 3.1 Consider the net G(V, E, c, f) of Fig. 3.1, where node s is the source, t is the sink, and a, b, c and d are the intermediate nodes. The capacities of the arcs are given by c(s, a) = 2,
c(a, s) = 1,
c(s, b) = 3
c(a, b) = 3,
c(a, c) = 1,
c(b, c) = 1
c(b,d) = 4,
c{d, a) = 2,
c(d, c) = 1
c(c, t) = 2,
c(d, t) = 4,
c(t, d) = \
(3.6)
These are given as the first members of the pairs of numbers written adjacent to the arcs of the net of Fig. 3.1. A feasible flow pattern given as the second members of the pairs of numbers written adjacent to the arcs
Fig. 3.1. A net G(V, E, c, f) used to illustrate the flow problem.
170
MAXIMUM FLOWS IN NETWORKS
of Fig. 3.1 is found to be f(s, a) = 1,
f(a, s) = 1,
f(s, b) = 1
f(a, b) = 0,
f(a,c)
= l,
/(ft,c)=0
f{b,d)
f{d,a)
= \,
f(d,c)
= l,
f(c, t) = 1,
f(d, t) = 1,
=0 (3.7)
f{t, d) = 1
The constraints corresponding to (3.5) are obtained from Fig. 3.1 as
(s,a) s
'
.
(a,s)
(s,b)
(a, b)
(a, c)
(b,c)
(b, d)
(d, a)
(d, c)
(c,t)
(d, t)
(t, d)
-1
1
0
0
0
0
0
0
0
0
o"
-1
1
0
1
1
0
0
-1
0
0
0
0
0
0
-1
-1
0
1
1
0
0
0
0
0
0
0
0
0
-1
-1
0
0
-1
1
0
0
0
0
0
0
0
0
-1
1
1
0
1
-1
0
0
0
0
0
0
0
0
0
-1
-1
1
s
r
a
0
=b
0
c
0
d
0
t
1.
(3.8)
_-!_
showing that the value fst of this feasible flow pattern is 1. 3.2
s-t
CUTS
A cutset of a directed graph or a net G(V, E, c,f) is a subgraph consisting of a minimal collection of arcs whose removal reduces the rank of G by one. Intuitively, if we "cut" the arcs of a cutset, one of the components of G will be cut into two pieces. The name cutset has its origin in this interpretation. As examples of cutsets, consider the net G(V, E, c,f) of Fig. 3.1. The subgraphs (a, c)(d, a)(a, b)(s, b), (a, c){d, a)(b, c)(b, d), and (c, t)(t, d)(d, t) are examples of cutsets. The broken lines of Fig. 3.2 show how these cutsets "cut" G. The subgraph
3.2 s-t CUTS
171
Fig. 3.2. A graph used to illustrate the concepts of a cut and a cutset. (a, c)(d, a)(a, b)(s, b)(c, t)(t, d)(d, t) is not a cutset because the removal of these arcs from G reduces the rank of G from 5 to 3, a reduction of two instead of one as required. This brings out the concept of a cut. A cut of G is either a cutset or an arc-disjoint union of cutsets of G. The subgraph (a, c)(d, a)(a, b)(s, b)(c, t)(t, d)(d, t) is a cut but not a cutset. A cut can also be interpreted in another useful fashion. Let X be a nonempty proper subset of the node set V of G, and write X = V - X. Then the set of arcs of G each of which is incident with one of its two endpoints in X and the other in X is a cut of G. In particular, if the removal of these arcs from G increases the number of components of G by one, then the cut is also a cutset. In Fig. 3.2, let X = {s, a} and X = {b, c, d, t}. Then the set of arcs (a, c), (a, b), (s, b) and (d, a) forms a cut of G. It is also a cutset of G. On the other hand, if we let X= {s, a, t} and X= {b, c, d}, the set of arcs (a, c), (d, a), (a, b), (s, b), (c, t), (t, d) and (d, t) forms a cut but not a cutset.
DEFINITION 3.1 s-t Cutset. For two distinguished nodes s and t of a directed graph, an s-t cutset is a minimal set of arcs, the removal of which breaks all the directed paths from s to t in the directed graph. The term minimal in the definition needs some clarification. A set S or a subgraph W is said to be minimal with respect to property P if no proper subset of S or no proper subgraph of W has property P. To simplify the notation, we adopt the following conventions. Let X and Y be two subsets of the node set V of a net G(V, E, c , / ) . We use the symbol (X, Y) to denote the set of all arcs (x, v) directed from x eX to v e Y. For any function g from the arc set E to the reals, write
g(X,Y)=
2
g(x,y)
(3.9)
172
MAXIMUM FLOWS IN NETWORKS
Likewise, when we deal with a function h from the node set V to the reals, we write h{X)=^dh{x)
(3.10)
where h(x) is the weight assigned to node x. For simplicity, we denote a set consisting only of one element by its single element. Thus, if X contains only a single node x, we write (x, Y), g(x, Y) or h(x) instead of ({*}, Y), g({x}, Y) or h({x}).
DEFINITION 3.2 s-t Cut. For two distinguished nodes s and t of a directed graph G(V, E), an s-t cut is the set of arcs (X, X) of G with s eX and t eX, where Xis a subset of VandX=V-X. We remark that an s-t cut may not be an s-t cutset. Consider, for example, the directed graph G(V, E) of Fig. 3.3. Let X = {s, b}. Then (X,X)
= {(s,a),(b,a),(b,t)}
(3.11)
where X= {a, t), is an s-t cut, but it is not an s-t cutset, because {(b, t)} is a proper subset of (X, X) and the removal of (b, t) from G will also break all directed paths from s to t. However, we can show that every s-t cutset is an s-t cut. To see this, let Q be an s-t cutset of a directed graph G(V, E). Define the subset X of V recursively as follows: (1) s e X. (2) If x e X and (x, y)eE-Q,
then
yeX.
Then t e X = V - X. We first show that every arc (x, y)e(X, X), x eX and y eX, is in Q. Suppose that (x, y) is not in Q. Then in E — Q there is a directed path from s to y formed by a directed path from s to x followed by
Fig. 3.3. An example of an s-t cut that is not an s-t cutset.
3.2 s-t CUTS
173
(x, y). This would imply that y e X, a contradiction. Conversely, if there is an arc (x, y)eQ which is not in (X, X), then Q is not an s-t cutset because the removal of (X, X), a proper subset of Q, will also break all directed paths from s to t. Thus, every s-t cutset is an s-t cut. In Fig. 3.3, (b, t) is an s-t cutset. Using the procedure outlined above yields the subset X = {s, a, b}. The corresponding s-t cut is found to be (X,X)
= ({s,a,b},t)
= {(b,t)}
(3.12)
The capacity of an s-t cut (X, X) in a net G(V, E, c, / ) is defined to be <X,X)
=
2
c(x,y)
(3.13)
A minimum s-t cut C min is an s-t cut with minimum capacity among all the s-t cuts: c(Cmin) = min {c(Xh X,)}
(3.14)
i
where (A!,-, A",-) is an s-t cut of G. Likewise, the capacity of an s-f cutset <2 in G is defined by c(G)=
2
c(*,y)
(3.15)
(jr.y)eQ
A minimum s-f cutset <2min is an s-t cutset with minimum capacity among all the s-t cutsets: c(Gmin) = min {c(Qk)}
(3.16)
where Qk is an s-t cutset of G. We show that if all arc capacities are positive, then c(Cmin) = min {c(X„ X,)} = min {c(Qk)} = c(Qmin) /'
(3.17)
k
To justify (3.17), we use the fact that since every s-t cutset is an s-t cut, it is clear that c(Cmin)^c(Gmin)
(3.18)
To complete the proof, we show that the reverse inequality is also true and hence the equality must hold. Since C min is a minimum s—t cut and since all the arc capacities are positive by assumption, no proper subset of C min can be an s—t cut; for, otherwise, the s—t cut formed by the proper subset would
174
MAXIMUM FLOWS IN NETWORKS
(Xt, X<)
(X2, X2)
Fig. 3.4. An example showing that nonnegative arc capacities are necessary for identity (3.17) to hold.
have a smaller capacity than C min . This means that no proper subset of C min can break all directed paths from s to t in G. Consequently, C min is a minimal set of arcs, the removal of which breaks all the directed paths from 5 to t in G; and, by definition, it is also an s-t cutset. This implies c(Cmin)§=c(Gmin)
(3.19)
Combining this with (3.18) gives (3.17). The proof is completed. To see that the hypothesis that all arc capacities be nonnegative is necessary for (3.17) to hold, consider the net G(V, E, c,f) of Fig. 3.4. There are four s-t cuts, as follows: (Xlt X,) = (s, {a, b, t}) = {(s, a), (s, b)}
(3.20a)
(X2, X2) = ({s, a}, {b, t}) = {(s, b)}
(3.206)
(X3, X3) = ({s, b}, {a, t}) = {(b, t), (b, a), (s, a)}
(3.20c)
(X4, X4) = ({s, a, b), t) = {(b, t)}
(3.20d)
whose capacities are c(Xu Zj) = c(s, a) + c(s, b) = - 3 + 4 = 1
(3.21a)
c(X2, X2) = c(s, b) = A
(3.216)
c(X3, X3) = c(b, t) + c(b, a) + c(s, a) = 2 + 1 - 3 = 0
(3.21c)
c(X4, X4) = c(b, r) = 2
(3.21d)
On the other hand, there are two s-t cutsets Qx = {{s, b)} and Q2 = {{b, t)}
3.2 s-t CUTS
175
Fig. 3.5. An example showing that the zero arc capacity is permitted for identity (3.17) to hold.
whose capacities are c(Qx) - 4 and c(Q2) = 2. This gives C min = 0 and Gmin = 2 and (3.17) fails to hold. The reason is that the net contains an arc (s, a) with negative arc capacity c(s, a) = —3. In passing, we mention that 2 i = (X2, X2) and Q2 = (X4, X4), confirming an earlier assertion that every s-t cutset is also an s-t cut. With the exclusion of nets with negative arc capacity, (3.17) remains valid for nets with nonnegative arc capacities, zero included. Fig. 3.5 is a net containing a zero capacity arc (s, a). Since the nets of Figs. 3.4 and 3.5 are isomorphic, they possess the same s-t cuts and s-t cutsets. However, their capacities are different and are given below:
c(X3,X3)
c(Xu Xx) = c(s, a) + c(s, b) = 4,
c(X2, X2) = c(s, b) = 4
= c(b,t) + c(b,a) + c(s,a) = 3,
c(X4, X4) = c(b, t) = 2
c(Q1) = c(s,b) = 4,
c(Q2) = c(b,t) = 2
(3.22a) (3.22b)
showing that Cmjn = Qmin = 2 and (3.17) holds. To justify this extension, we observe that if an s-t cut is not an s-t cutset, then a proper subset of the s-t cut is an s-t cutset. Since all arc capacities are nonnegative, the capacity of this s-t cut is at least as large as that of the proper subset. Hence, the s-t cutsets determine the minimum s-t cut. Finally, we mention that a directed circuit L of G contains an equal number of arcs in common with the s-t cut (X, X) and t-s cut (X, X). This follows from the observation that a directed circuit L and a cut (X, X) U (X, X) have an even number of arcs in common, zero included, that in traversing along L the common arcs will alternately appear in (X, X) and (X, X) because starting from a node x on L, eventually it has to return to x to complete the circuit. Since an s-t cut (X, X) breaks all directed paths from s to t, it is intuitively clear that the value fst of a flow / in a net G(V, E, c, f) cannot exceed the capacity of any s-t cut. Before we prove this, we rewrite the
176
MAXIMUM FLOWS IN NETWORKS
constraints (3.1) in terms of the simplified notation of (3.9): For each i e V, f(s,V)-f(V,s)=f„ /(«'. V) -f(V,
(3.23a) i) = 0,
f(t,V)-f(V,t)
i±s,t
(3.236)
= -f„
(3.23c)
These together with the capacity constraints c(i,j)^f(i,j)^0,
(i,j)eE
(3.24)
define a feasible flow pattern {/(/,;')}. THEOREM 3.1 Let (X, X) be an s-t cut of a net G(V, E, c, / ) . Then the flow value fst from s to t in G is given by U = f{X, X) -f(X,
X) ^ c(X, X)
(3.25)
Proof. S i n c e / i s a flow of G, it satisfies the equations (3.23). Summing these equations over x eX gives U = 2 [/(*> V) -f(V,
x)] =f{X, V) -f(V,
X)
(3.26)
Writing V = X U X in (3.26) and expanding the resulting terms yields fst = f{X, =f(X,
XUX)-f(XUX,X) X) +f(X, X) -f{X,
X) -fiX,
X)
= fiX,X)-fiX,X)
(3.27)
Since f(X, X)^0 and f(X, X) ^ c ( X , X) by virtue of (3.24), (3.25) follows immediately. This completes the proof of the theorem. The theorem states that the value of a flow from s to t is equal to the net flow across any s-t cut. In the net G(Vr, E, c,f) of Fig. 3.1, which is redrawn in Fig. 3.6, the first member of a pair of numbers written adjacent to an arc denotes the arc capacity, and the second member denotes the flow in the arc. Three cuts are indicated in Fig. 3.6, the net flows of which are found to be fiX„
Xx) -fiX,,
X,) = / ( « , c) +/(«,, b) +f(s, b) -fid,
a)
= 1 + 0 + 1 - 1 = 1^c(X l t XJ = 1 + 3 + 3 = 7
(3.28a)
3.3 MAXIMUM FLOW
177
Fig. 3.6. A labeled net with a pair of numbers written adjacent to an arc, the first number denoting the arc capacity and the second number denoting the flow in the arc.
f(X2, X2) -f(X2,
X2) =f(a, c) +f(b, c) +f(b, d) -f{d,
a)
= 1 + 0 + 1 - 1 = 1 ^ c(X2, X2) = 1 + 1 + 4 = 6 f(X3, X3) -f(X3,
X3) = / ( c , t) +f(d, t) -f(t,
(3.28b)
d)
= 1 + 1 - 1 = 1 ^ 0 ( ^ 3 , X3) = 2 + 4 = 6
(3.28c)
The value of this flow from s to t is 1, being equal to the net flow across any one of the three s-t cuts.
3.3
MAXIMUM FLOW
A basic problem in flows is to find a feasible flow pattern that maximizes the value fst of a flow in a given net G(V, E, c, / ) . In this section, we state and prove the fundamental result concerning the maximum flow known as the max-flow min-cut theorem. The theorem was independently discovered by Ford and Fulkerson (1956) and Elias, Feinstein and Shannon (1956). Ford and Fulkerson (1956) gave a combinatorial proof which constructs a maximum flow and locates a minimum s-t cut. Their proof shows that there always exists a flow with value equal to the capacity of a minimum s-t cut. The proof will also serve as a basis for a number of other algorithms in this chapter. Elias, Feinstein and Shannon (1956) used an ingenious graphtheoretic approach by breaking a net into simpler nets until a solution for the simpler nets become evident. A third proof was given by Dantzig and Fulkerson (1956) using the Duality Theorem of linear programming.
178
MAXIMUM FLOWS IN NETWORKS
THEOREM 3.2 (Max-flow min-cut theorem). The maximum flow value/ m a x from s to t in a net G(V, E, c,f) is equal to the capacity of a minimum s-t cut, i.e. / m a x = max {/„} = min {c(Xt, * , ) }
(3.29)
i
where (Xh Xt) is an s-t cut, and max {fst} is taken over all feasible flow patterns in G. Proof. Let {X, X) be an arbitrary s-t cut. Then from Theorem 3.1 the value fst of any flow / is bounded above by the capacity of any s-t cut: fsl^f(X,X)^c(X,X)
(3.30)
In particular, the maximum flow value / m a x is bounded above by the capacity of a minimum s-t cut, or / m a x = max {/„} ^ min {c(Xt, X,)}
(3.31)
i
Thus, to prove the theorem, it suffices to establish the existence of a flow / and an s-t cut (X, X) such that the flow value equals the capacity of this s-t cut (X, X) or f(X,X)
= c(X,X)
f(X,X)
=0
(3.32a) (3.32b)
which is equivalent to stating that / m a x = max {/„} =f(X, X) -f{X, = c(X,X)
X) =f(X,
= mm{c(X„Xi)}
X) (3.33)
and the equality holds throughout (3.25). We now proceed to establish such a flow and to locate the desired s-t cut (X, X). Let / be a maximum flow in G(V, E, c, / ) . Using / , define a subset X of the node set V recursively as follows: (1) seX. (2) If x e X and f(x, y) < c(x, y), then yeX. (3) If x e X and f(y, x) > 0, then yeX. We assert that t e X = V - X; for, if not, there exists a path, not
3.3 MAXIMUM FLOW
179
necessarily a directed path, between nodes 5 and t, J ^ (M2X12, « 3 )-••(«*-!, 0
(3-34)
such that all forward arcs (ia, ia+1) of Pst are not saturated, f(L,
i«+i) < c(ia, ia+1)
(3.35)
and all reverse arcs (ia+i, ia) of Pst are not flowless, f(ia+i,ia)>0
(3.36)
Here, an arc (ia, ia+t) of Ps, is said to be a. forward arc of Pst if in traversing from 5 to t on Pst the arc (ia, ia+i) is directed from ia to ia+1. Otherwise, it is a reverse arc of Pst. Thus, an arc is a forward arc from s to t on Ps/ and becomes a reverse arc from t to s on Pst. We say that an arc (i, j) is saturated with respect to a flow / if f(i, j) = c(i, j) and is flowless with respect to / if f(i, j) = 0. Thus, an arc that is both saturated and flowless can only have zero capacity. Let w1 = min {c(ia, ia+l) - / ( / ' „ , ia+1)}
(3.37)
taken over all forward arcs (ia, ia+i) of Pst, w2 = min {f(ia+1,
ia)}
(3.38)
taken over all reverse arcs (ia+1, ia) of Psl, and w = min (wi, w2)
(3.39)
We now define a new flow/* based on the original flow/, as follows: f*(ia,
i«+i) =/(»«, ««+i) + w
(3.40a)
for all forward arcs (i a , i a + i ) of Ps„ f*(ia+i,
ia) =f(i*+i,
ia) ~ w
(3.40b)
for all reverse arcs (ia+1, ia) of Ps„ and f*(i,j)=f(i,j)
(3.40c)
for all other arcs (i, j) of G. It is straightforward to verify that the new flow function / * thus defined is a feasible flow pattern having value fs, + w from s to t, where / , is the value of the original flow / . This shows that / is not a
180
MAXIMUM FLOWS IN NETWORKS
maximum flow, contrary to our assumption. Thus, t must be in X, and (X, X) is an s-t cut. By construction, we see that f(i,j) = c{i,j)
(3.41a)
for (i, j) e (X, X), i e X and / e X, and /0". 0 = 0
(3.416)
for (/, /) e (X, X), j eX and i €X; for otherwise /' would be in X. Hence f(X,X)
= c(X,X)
(3.42a)
f(X,X)
=0
(3.426)
This completes the proof of the theorem. DEFINITION 3.3 Flow Augmenting Path. A path Pst, not necessarily a directed path, between nodes s and t in a given net G{V, E, c,f) is said to be a flow augmenting path with respect to / if all forward arcs (i, j) of Ps, are not saturated, /(/, /') < c(i, j), and all reverse arcs (/, i) are not flowless, / ( / , i) > 0, in traversing from s to t on Pst. The path Pst defined in (3.34) is a flow augmenting path. Thus, a flow/is maximum if and only if there is no flow augmenting path with respect to /. The result is useful in that in order to increase the value of a flow, it suffices to look for flow augmenting paths. In a similar way, we see that an s-t cut (X, X) is minimum if and only if for every maximum flow /, all arcs of (X, X) are saturated and all arcs (X, X) are flowless. Example 3.2 In the net G(V, E, c, f) of Fig. 3.7, a feasible flow pattern is shown in the figure. The s-t cut (X, X) = (s, {a, b, c, d, t}) = {(s, a), (s, b)}
(3.43)
has minimum capacity c(X, X) = c(s, a) + c(s, b) = 2 + 3 = 5
(3.44)
among all the s-t cuts. Thus, by Theorem 3.2 the maximum flow from s
3.3 MAXIMUM FLOW
181
(X,X)
Fig. 3.7. A net showing a feasible flow pattern. to t in G is equal to c(X, X) or fmax = c(X,X)
=5
(3.45)
Observe that all arcs in (X, X) are saturated and the arc in (X, X) = {(a, s)} is flowless. The s-t cut (Y, Y) = ({s, a, b), {c, d, t}) = {(a, c), (b, c), (b, d)}
(3.46)
is not minimum because not all arcs in (Y, Y) are saturated. Also, it is easy to check that there is no flow augmenting path in G. We now state and prove other properties of the minimum s-t cuts.
THEOREM 3.3 Let (X, X) and (Y, Y) be two minimum s-t cuts in a net G(V, E, c,f). Then (X DY,X U Y) and (X n Y, X n Y) are also minimum s-t cuts of r
G, whereiuy=y-iuyandA ny=v-iny.
Proof. If X is contained in Y, then X U Y = Y and X n Y = X, giving (X U Y, XUY)
= (Y, Y)
(X n Y, i n y ) = (x, x)
(3.47a)
(3.476)
Likewise, if Y is contained in Jf, similar results are obtained, and the theorem is trivial. Thus, we assume that the intersections A=XCiY,
B=XC\Y . .
C = XHY,
D=XHY
(3.48)
182
MAXIMUM FLOWS IN NETWORKS (X,X)
Fig. 3.8. A symbolic representation of the partition of the nodes of a net by the two minimum s-t cuts (X, X) and (Y, Y).
are not empty, as depicted in Fig. 3.8, where s eA and t e D. Since (X, X) and (Y, Y) are minimum s-t cuts and (A U B U C, D) and (A, BUCUD) are s-t cuts, we must have the following inequalities: c(A U B U C, D ) + c(A, B U C U D ) ^ c ( J V , ^ ) + c(Y, Y)
(3.49)
each of which can be expanded as c(AUBU
C, D) = c(A, D) + c(B, D) + c(C, D)
c(A, BUCUD) c(X, X) = c(AUC,BUD)
= c(A, B) + c(A, C) + c(A, D)
(3.50a) (3.50b)
= c(A, B) + c(A, D) + c(C, B) + c(C, D) (3.51a)
c(Y, Y) = c(AUB,CUD)
= c(A, C) + c(A, D) + c(B, C) + c(B, D) (3.516)
Substituting these in (3.49) yields c(C, B) + c(B, C ) ^ 0
(3.52)
Since c(C, B) and c(B, C) are both nonnegative, (3.52) can only be satisfied
3.3 MAXIMUM FLOW
183
with the equality. Using this in (3.49) obtains c(AUBU
C, D) + c(A, BUCUD)
= c(X, X) + c(Y, Y)
(3.53)
= c(X, X) + c(Y, Y)
(3.54)
which can be rewritten as c(XUY,X\JY)
+ c(XnY,XnY)
Since c(X, X) and (Y, Y) are minimum s-t cuts, it is necessary that c(X U Y, XUY)
^ c(X, X) = c(Y, Y)
(3.55a)
c(X n Y, Xr\Y)
^ c(X, X) = c(Y, Y)
(3.55b)
These in conjunction with (3.54) shows that the equality must hold in (3.55), and (X U Y, X U Y) and (X n Y, X D Y) are minimum s-t cuts. This completes the proof of the theorem. In words, Theorem 3.3 states that if there are two minimum s-t cuts that cross each other as in (3.48), then there are two more minimum s-t cuts that do not cross each other. Example 3.3 A maximum feasible flow pattern is shown in Fig. 3.9 for the net G(V, E, c, / ) . Two minimum s-t cuts are found to be (X, X) = ({s, b, c}, {a, t}) = {(s, a), (s, t), (b, t)}
(3.56a)
(Y, Y) = ({s, a}, {b, c, t}) = {(a, t), (s, t), (s, c)}
(3.56b)
(Y,Y)
Fig. 3.9. A net with a maximum feasible flow pattern.
184
MAXIMUM FLOWS IN NETWORKS
whose capacity is given by c(X, X) = c(Y, Y) = 6
(3.57)
Then according to Theorem 3.3 the s-t cuts (XU Y, XU Y) = ({s, a, b, c), t) = {(a, t), (s, t), (b, t)}
(3.58a)
(X n Y, XHY)
(3.58b)
= (s, {a, b, c, t}) = {(s, a), (s, t), (s, c)}
are also minimum. It is easy to confirm that the capacity of the s-t cuts in (3.58) is 6, being equal to the minimum s-t cut capacity.
3.4
FORD-FULKERSON ALGORITHM
The proof of the max-flow min-cut theorem given as Theorem 3.2 provides a simple and efficient algorithm for constructing a maximum flow and locating a minimum s-t cut in a given net G(V, E, c, / ) . The Ford-Fulkerson algorithm is a procedure which systematically searches for a flow augmenting path, and then increases the flow along this path. It can be carried out by two routines: The Labeling Routine and the Augmentation Routine. The labeling routine searches for a flow augmenting path and the augmentation routine increases the flow along the flow augmenting path. The algorithm may start with zero flow, and terminates when the maximum flow is generated. With rare exception where the arc capacities are irrational, the algorithm terminates after a finite iteration. The algorithm assigns labels to the nodes of a given net G(V, E, c,f). The label assigned to a node is represented by an ordered triplet (x, +, w) or (x, —, w), where x e V and w is a positive number or °°. During the labeling process, a node is always considered to be in one of the following three states: (i) Unlabeled node. A node is unlabeled if it receives no label. At the beginning of the labeling process, every node is unlabeled, (ii) Labeled and unscanned node. A node x is said to be labeled and unscanned if it has a label and if its neighboring nodes y, (x, y) e E, have not all been labeled, (iii) Labeled and scanned node. A node x is labeled and scanned if it has a label and if all of its neighboring nodes y, (x, y) e E, have also been labeled. We now describe Ford-Fulkerson's labeling routine and augmentation routine.
3.4 FORD-FULKERSON ALGORITHM
185
Labeling Routine Step 1. Label s by (s, + , °°). Now s is labeled and unscanned and all other nodes are unlabeled and unscanned. Step 2. Select any labeled and unscanned node x, and perform the following operations: (a) For all nodes y, (x, y) e E, that are unlabeled such that f{x, y) < c(x, y), label y by (x, + , w(y)) where w{y) = min [w(x), c(x, y) -f(x,
y)]
(3.59)
Then y is labeled and unscanned. (b) For all nodes y, {y, x) e E, that are unlabeled such that f(y, x) > 0, label y by (x, — , w(y)) where w(y) = mm[w(x),f(y,x)]
(3.60)
Now change the label on x by circling the + or — entry. Then x is now labeled and scanned. Step 3. Repeat Step 2 until either t is labeled or until no more labels can be assigned and t is unlabeled. In the former case, go to the Augmentation Routine; in the latter case, terminate. Augmentation Routine Step 1. Let z = t and go to Step 2 below. Step 2. If the label on z is (q, +, w{z)), increase the flow f(q, z) by w{t). If the label on z is (q, — , w{z)), decrease the flow/(z, q) by w(t). Step 3. If q = s, discard all labels and return to Step 1 of the Labeling Routine. Otherwise, let z = q and return to Step 2 of the Augmentation Routine. We illustrate the Ford-Fulkerson algorithm by the following examples. Example 3.4 Consider the net G(V, E, c,f) of Fig. 3.1 which is redrawn in Fig. 3.10. The flow shown in the net G is not maximum and we shall apply the Ford-Fulkerson algorithm to generate a maximum flow, as follows: First iteration Labeling routine Step 1. Label s by (s, + , »). Step 2. Node a is labeled by (s, +, 1), and node b by (s, +, 2). Circle the + in (s, + , °°), giving (s, © , °°).
186
MAXIMUM FLOWS IN NETWORKS
^^
4,1
^-s
Fig. 3.10. A net used to illustrate the Ford-Fulkerson algorithm for the calculation of a maximum flow. Step 3. Return to Step 2. Step 2. Node c is labeled by (b, +, 1) and change (s, +, 2) to (s, ©, 2). Node d is labeled by (a, - , 1) and change (s, +, 1) to (s, 0 , 1). Step 3. Return to Step 2. Step 2. Node t is labeled by (c, + , 1), and change (b, +, 1) to (6, ©, 1). Step 3. Go to Augmentation Routine. Augmentation Step Step Step Step Step Step Step
1. 2. 3. 2. 3. 2. 3.
routine
Let z = t. Increase the flow f(c, Set z = c. Increase the flow/(fc, Set z = b. Increase the flow/(s, Discard all labels and
t) by w(t) = l. c) by 1. b) by 1. return to Step 1 of the Labeling Routine.
The details of the first iteration are indicated in Fig. 3.11. Second iteration Labeling routine Step 1. Label s by (s, +, °°). Step 2. Node a is labeled by (s, - , 1), and node b by (s, +, 1). Change (S, +, oo) tO (S, © , oo).
Step 3. Return to Step 2. Step 2. Node d is labeled by (a, - , 1). Change (s, - , 1) to (5, 0 , 1). Step 3. Return to Step 2.
3.4 FORD-FULKERSON ALGORITHM
187
(*,©,!) 2,1 + 1
(s, e,oo)
I )(c, + , l )
(a.-,l) (s, ©,2) Fig. 3.11. The resulting net after the completion of the first iteration of the Ford-Fulkerson algorithm.
Step 2. Nodes c and t are labeled by (d, +, 1). Change (a, —, 1) to
(a, e, i). Step 3. Go to Augmentation Routine. Augmentation Step Step Step Step Step Step Step
1. 2. 3. 2. 3. 2. 3.
routine
Let z = t. Increase the flow f(d, Set z = d. Decrease the flow/(d, Set z = a. Decrease the flow/(a, Discard all labels and
t) by w(t) = 1. a) by 1. s) by 1. return to Step 1 of the Labeling Routine.
The details of the second iteration are illustrated in Fig. 3.12. The third, fourth and fifth iterations are shown in Figs. 3.13, 3.14 and 3.15, respectively. At the end of the fifth iteration, the algorithm terminates and the flow pattern shown in Fig. 3.15 is maximum. The
u,e,D
t)(d,+,\)
(S, ffi, ° o ) ( j
4,1 + 1 (s, + A) (a,Q,l) Fig. 3.12. The resulting net after the completion of the second iteration of the Ford-Fulkerson algorithm.
188
MAXIMUM FLOWS IN NETWORKS
(s, ©,oo)
' W.+.D
4 1+1 '
(s, 0,1)
(b, ©,1)
Fig. 3.13. The resulting net after the completion of the third iteration of the Ford-Fulkerson algorithm.
2,1 +
t)(d,+,\)
(s, ®, °°)U 4,3 + 1 ^
,
4,2 + 1
Fig. 3.14. The resulting net after the completion of the fourth iteration of the Ford-Fulkerson algorithm.
(X,X)
(s, ©, oo)
Fig. 3.15. The resulting maximum flow pattern after the application of the Ford-Fulkerson algorithm to the net of Fig. 3.10.
3.4 FORD-FULKERSON ALGORITHM
189
Fig. 3.16. A net used to illustrate the Ford-Fulkerson algorithm for the generation of a maximum flow pattern.
desired minimum s-t cut (X, X) is found to be (X, X) = (s, {a, b, c, d, t}) = {(s, a), (s, b)}
(3.61)
the capacity of which is c(X, X) = c(s, a) + c(s, b) = 5. The s-t (X, X) is indicated in Fig. 3.15.
cut
Example 3.5 We use the Ford-Fulkerson algorithm to generate a maximum flow in the net G(V, E, c,f) of Fig. 3.16 from node s to node t. Initially, the flow/is set to zero. The algorithm proceeds as follows: First iteration Labeling routine. The routine finds an augmentation path Pst = (s, 4)(4, 8)(8, 9)(9, 0
(3.62)
Augmentation routine. Since there is no reverse arc in Pst, the flow in each forward arc is increased by w(t) = 2. The details of the first iteration are shown in Fig. 3.17. Second iteration Labeling routine. The routine finds an augmentation path Pst = (s, 1)(1, 5)(5, 9)(9, 0
(3.63)
190
MAXIMUM FLOWS IN NETWORKS
Augmentation routine. Since there is no reverse arc in Psl, the flow in each forward arc is increased by w(t) = 1. The details of the second iteration are shown in Fig. 3.18. Third iteration Labeling routine. Node s is labeled by (s, +, °°), but no more labels can be assigned to other nodes. The program terminates.
Fig. 3.18. The resulting net after the completion of the second iteration of the Ford-Fulkerson algorithm.
3.4 FORD-FULKERSON ALGORITHM
191
(X,X)
Fig. 3.19. The resulting maximum flow pattern after the application of the Ford-Fulkerson algorithm to the net of Fig. 3.16.
A maximum flow pattern is shown in Fig. 3.19. The desired minimum s-t cut (X, X) shown in the figure is found to be (X, X) = (s, s) = {(s, 1), (s, 4)}
(3.64)
whose capacity is c(X, X) = 3. 3.4.1
Integrity Theorem
The Ford-Fulkerson algorithm is used not only to prove the max-flow min-cut theorem, but also to solve the maximum flow problem. The speed of the algorithm depends on the arc capacities in the net as well as on the numbers of nodes and arcs of the net. Indeed, in certain cases where the arc capacities are irrational, the algorithm might not converge at all. This will be elaborated in Section 3.4.2. To ensure the termination of the algorithm, it will be necessary to assume that the capacity function c is integral valued. In the case of rational capacities for the arcs, they can always be converted to a problem with integral capacities by clearing fractions. Therefore, confining our attention to rational numbers is really no restriction for computational purposes. If the flow is integral and if the labeling routine identifies a flow augmenting path, then the maximum allowable flow change w(t) of the augmentation routine, being the minimum of positive integers or the difference of two
192
MAXIMUM FLOWS IN NETWORKS
positive integers, is a positive integer, provided that the computation is initiated with an integral flow. For each flow augmenting path, the flow value is increased by at least one unit. Upon termination, a maximum integral flow has been generated. As a result, the Ford-Fulkerson algorithm must terminate in a finite number of iterations, provided of course that the capacity function c is integral valued. This leads to the following theorem.
THEOREM 3.4 (Integrity theorem) If the capacity function of a net is integral valued, then there exists a maximum integral valued flow in the net. In the search for a flow augmenting path using the labeling routine, the first time we need to check at most n — 1 nodes in an «-node net and the second time at most n — 2 nodes, so there are at most (n — 1) + (n — 2) + . . . + 1 = n(n — l)/2 nodes to be checked before a flow augmenting path is identified. If all arc capacities are integers, the maximum flow value fst from s to t, being equal to the minimum s-t cut capacity, is also an integer. Since the flow value is increased by at least 1 unit per flow augmenting path, the Ford-Fulkerson algorithm requires at most 0(fstn2) steps. Since the flow value fst is really an unknown quantity at the beginning, we do not have a bound in terms of the numbers of nodes and arcs of a net. In fact, it is possible to assign arc capacities to a very small net, so the algorithm will take a very long time to run. This will be shown by an example in the following section.
3.4.2 Irrational Arc Capacities The Ford-Fulkerson algorithm is very popular because it is simple to understand and easy to implement. For many problems in practice, the algorithm terminates fairly quickly. However, in the case where the arc capacities are allowed to be irrational, it is possible to construct a net so that the algorithm not only will not terminate but also will converge to a wrong limit. In the following, we describe the steps of the algorithm for such a net due to Ford and Fulkerson (1962). Before proceeding, we introduce a few terms that will be needed in the discussion. In a given net G(V, E, c,f) with capacity function c and flow function / from 5 to t, the term [c(x, y) — f(x, y)] is called the residual capacity of arc (x, y) e E with respect to /. Now consider the recursion a
k+2 — ak~
a
k +\
(3.65)
3.4 FORD-FULKERSON ALGORITHM
193
Fig. 3.20. The construction of a 10-node net, in which an undirected edge represents a pair of oppositely directed arcs, each having capacity equal to that of the undirected edge. for all k ^ 0, which has the solution (3.66) where
A-=I±^
(3.67)
Thus, we have the following convergent series: (3.68) We construct a 10-node net G(V, E, c, / ) as shown in Fig. 3.20, where an undirected edge represents a pair of oppositely directed arcs, each having capacity equal to that of the undirected edge. Four arcs (xlt yx), (x2, y 2 ), (*3> ^3) a n d (x4, y4) are distinguished, and are referred to as the special arcs. To every arc of E except the four special arcs we assign the capacity S. The special arcs are given the capacities (3.69a)
c(*i,y!) = l c(x2, y2) = A 2
(3.6%)
c(x3, y3) = A
(3.69c)
c(x4, y4) = A2
(3.69d)
For the first iteration using the labeling routine, we find the flow
194
MAXIMUM FLOWS IN NETWORKS
(5>—**—© Fig. 3.21. A net showing the residual capacities of the arcs after augmenting the flow on the flow-augmenting path (3.70) by A2 units. augmenting path (s, JCi)(*i, yi)(yu 0- W e then increase the flow by 1 unit, the maximum permissible amount, along this path. The four special arcs will then have residual capacities 0, A, A2, A2, respectively. For the second iteration, we choose the flow augmenting path P«\ = (s, x2)(x2, y2)(y2, x3)(x3, y3)(y3, t)
(3.70)
The only special arcs that are on this path are (x2, y2) and (x3,y3). Augmenting the flow on this path by A2, the maximum permissible amount, yields a flow pattern, the residual capacities of which are shown in Fig. 3.21. All other undisplayed arcs have residual capacity 5. The residual capacities of the four special arcs now become 0, A —A2 = A3, 0, A2, respectively, where we have used the fact that A*+2 = A*-A* + 1
(3.71)
for all nonnegative integer k. Next, we choose the flow augmenting path
Pst2 = (s, x2)(x2, y2)(y2, y^ixu yi)(xu y3)(x3, y3)(x3, yjiy*, t) (3.72) Observe that only the special arcs {xlt yr) and (JC3, y3) are reverse arcs in this path, and all other arcs are forward arcs. Now augment the flow along this path by A3 units, again the maximum permissible amount. The residual capacities of the resulting arcs are shown in Fig. 3.22, where all the undisplayed arcs have residual capacity 5 except the arcs (y2, x3) and (y3, t), which have residual capacity 5 — A2. The two augmentation steps together have increased the flow value by A2 + A3 = A units. Observe that the residual capacities of the four special arcs are now changed to A3, 0, A3, A2. By relabeling the nodes of the special arcs, the special arcs have the residual capacities 0, A2, A3, A3, respectively.
3.4 FORD-FULKERSON ALGORITHM
195
Fig. 3.22. A net showing the residual capacities of the arcs after augmenting the flow on the flow-augmenting path (3.72) by A3 units.
To complete our construction, we use the inductive process. Suppose that at the end of the kth iteration, the four special arcs (x[, y[), {x'2> y2), C*3, y'3), (*4> y'4), after relabeling if necessary, have residual capacities 0, kk, kk+\ kk+x
(3.73)
and the augmentation steps have increased the flow value by A* + A*+1 = kk~l units. We show that if the above procedure of using two flow augmentation steps is repeated, the special arcs of the resulting net will have residual capacities 0, kk+l, kk+2, kk+2, respectively. This is considered to be the (k + l)th iteration. First, we choose the flow augmenting path P'sn = (s, x'2){x'2> y2)(y2, * 3 )(* 3 , y'3)(y3, t)
(3.74)
as shown in Fig. 3.23. Augment the flow along this path by the maximum amount of kk+1 units. The resulting residual capacities of the four special arcs are as indicated in Fig. 3.23. Next, select the flow augmenting path P'sa = (s, x'2)(x'2, y'2){y'2, y[)(x[, y[){x[, y3)(x3, y 3 )(* 3 , y'4)(y'4, t) (3.75) As before, the special arcs (x[, y[) and (^3, v3) are reverse arcs in P'st2, and all others are forward arcs. Augment the flow along this path by kk+2 units. The residual capacities of the four special arcs in the resulting net are shown in Fig. 3.24, and are given by kk+2, 0, kk+2, kk+1, respectively. By relabeling the nodes of the special arcs, the residual capacities of the four special arcs at the end of the (k + l)th iteration are given by 0, kk+1, kk+2, kk+2
(3.76)
196
MAXIMUM FLOWS IN NETWORKS
Fig. 3.23. A net showing the residual capacities of the four special arcs after augmenting the flow on the flow-augmenting path (3.74) by A*+1 units.
The two augmentation steps together have increased the flow value by kk+l + Xk+2 = A*
(3.77)
We now determine the flow value at the end of the (k + l)th iteration. Recall that at the end of the first iteration, the flow value is increased by 1 unit. At the end of the second iteration, the flow value is increased by A units; at the end of the kth iteration, by A* -1 units, and at the end of the (k + l)th iteration, by A* units. Therefore, the total flow value at the end of the (k + l)th iteration is given by
1 + A + . . . + A*"1 + A* = 2 V
(3.78)
0 + \* + 2 = \* + 2
Fig. 3.24. A net showing the residual capacities of the four special arcs after augmenting the flow on theflow-augmentingpath (3.75) by kk+2 units.
3.5 LAYERED NETS
197
showing from (3.68) that no non-special arc is ever required to carry more than 5 = 2 A"
(3.79)
units of flow in repeating the inductive step. The process converges to a flow having value S, whereas the maximum flow value from s to t in the net of Fig. 3.20 is 45, being equal to the minimum s-t cut. The conclusion is that if we allow irrational arc capacities, it is possible to construct a net with finite arc capacities, so that the Ford-Fulkerson algorithm will never terminate and the sequence of flow values will converge to a number that is not the maximum flow in the net. Because of this difficulty, many new algorithms have been proposed. They are guaranteed to terminate within a time bound that is independent of the arc capacities, and depends only on the numbers of nodes and arcs of the net. We now turn our attention to the discussion of other algorithms. Many of these algorithms are based on the concept of the layered net, and are much more efficient than the Ford-Fulkerson algorithm.
3.5
LAYERED NETS
Given a net G(V, E, c, / ) , we discuss how to induce a layered net N(G) or simply N from G. An arc (i, j) of G is said to be useful from i to j if either (/, j) is not saturated, f(i, j) < c(i, j), or (/, i) e E is not flowless, /(;', i) > 0. The layered net N will be constructed one layer at a time from the nodes of G, using the flow/as a guide. By definition, the source s is at the 0th layer. Then a node / is at layer 1 if there is a useful arc (s, j) e E. We include arc (s, j) in N for each / and assign a capacity c'(s, j) = c(s, j) -f(s,
j) +f(J, s)
(3.80)
to (s, j). The set of all such / forms layer 1 nodes of N. To construct layer 2, we pick a node i in layer 1 and look for a useful arc (i, u) e E, where u is not a node in layer 1 or H # S . We then include arc (i, u) in N for each i and u and assign a capacity c'(i, u) = c(i, u) - / ( / , u) + / ( u , i)
(3.81)
to (/, u). The set of all such u forms layer 2 nodes of N. In general, a node y is in layer k if there is a useful arc {x, y) e E, where x is a layer k — 1 node and y does not belong to any of the previous layers 1,2,... ,k —1 or y¥=s. We then include arc (x, y) in N for each x and y and assign a capacity c'(x, y) = c(x, y) -f(x,
y) + / ( y , x)
(3.82)
198
MAXIMUM FLOWS IN NETWORKS
Note that the new capacity function c' represents the total residual or unused flow-carrying capacity of the arcs in both directions between their endpoints. The layering process continues until we reach a layer where there is a useful arc (v, t) from some node v of this layer to the sink t, or else until no additional layers can be created by the above procedure. In the former case, we include arc (v, t) in N for each v and assign a capacity c'(v, t) = c(v, t) -f(v,
t) +f(t, v)
(3.83)
to (v, i), and the layering process is complete. In the latter case where no additional layers can be created but the sink has not been reached, the present flow function / in G is maximum and the maximum flow problem has been solved. Observe that not all the nodes of G need appear in N, and that in N all the arcs are directed from layer k — 1 to layer k regardless of the direction of the useful arcs in G. In addition, even after an arc (x, y) is included in N, additional arcs (w, y) are included in N for all such layer k — 1 nodes w. Finally, we remove all arcs that do not belong to any directed path from s to t in the resulting net. Fig. 3.25 shows the typical appearance of a layered net. In contrast to a general net, in a layered net N every directed path from the source s to some fixed node y in layer k contains exactly k arcs. These properties of layered nets are extremely useful in devising ways of finding their flows. We summarize the above by presenting an algorithm for generating a layered net N(V, E', c',f) from a given net G(V, E, c,f), as follows: Let Ui0}.
x e Uh y $ U0 U f/x U • • • U {/„ and c(x, y) -
Fig. 3.25. The typical appearance of a layered net.
3.5 LAYERED NETS
Step Step Step Step
3. 4. 5. 6.
If t e Ui+l, set k = i + 1 and stop. Go to Step 5. Set i = i + l. Return to Step 2. Vk = {t}. Set j = k. Vi_1 = {x\(x,y)eE, yeVj, i e ( / H , and c(x, y)-f(x, f(y,x)>0}. Step 7. If j = 1, stop.
199
y) +
Step & Set;' =y" - 1. Return to Step 6. The layered net N(V,
E', c',f)
is a net defined by the sets
V' = V 0 UV,U ••• U n £ ' = {(*, 3 0 | * e V } , y e V, +1 and c'(x,y)
for
(3.84a)
; = 0 , 1, . . . , k - 1,
(*, y) e £
c(x,y)-f(x,y)+f(y,x)>0}
= c(x,y)-f(x,y)+f(y,x),
(3.84b) (x,y)eE'
(3.84c)
a n d / ' is initially set to zero. The algorithm consists of two parts. The first part from Step 1 to Step 4 generates the subsets Ut, in which Uk may contain nodes other than the sink t. The second part from Step 5 to Step 8 identifies the layers V^ from Uiy so that Vk contains only the sink t. Fig. 3.26 shows the typical appearance of
layer 4
layer 0 Fig. 3.26. The typical appearance of the node sets U, and VJ.
200
MAXIMUM FLOWS IN NETWORKS
Fig. 3.27. A net used to illustrate the construction of a layered net.
the node sets Uj and Vt. The net consists of both the solid and broken lines. The layered net N is the subnet and consists only of the solid lines. Example 3.6 Consider the net G(V, E, c,f) shown in Fig. 3.1, which is redrawn in Fig. 3.27. To construct a layered net TV of G, we proceed as follows: The source s is at the layer 0. Nodes a and ft are at layer 1 because arcs (s, a) and (s, ft) are useful arcs. Thus, they belong to N with capacities c'(s,
a) = c(s, a) -f(s,
a) +f(a,
s) = 2 - 1
+ 1= 2
c'(s, b) = c(s, b) -f(s, ft) = 3 - 1 = 2
(3.85A)
(3.85b)
Thus, layer 1 consists of the nodes a and b. For layer 2, we consider arcs (a, c), (a, d), (b, c) and (b, d). Only the last three (a, d), (b, c) and (b, d) are useful arcs with capacities c'(a,d)=f(d,a) = l
(3.86a)
c'(b, c) = c(b, c) -f(b,
c) = 1 - 0 = 1
(3.86ft)
c'(b, d) = c(b, d) -f(b,
d) = 4 - 1 = 3
(3.86c)
Thus, nodes c and d belong to layer 2 and arcs (a, d), (b, c) and (b, d) are included in N. Finally, for layer 3, we consider arcs (c, t) and (d, t). They are useful arcs with capacities c'(c, t) = c(c, t) -f(c, c'(d, t) = c{d, t) -f{d,
0 = 2-1 = 1
(3.87a)
t) +f(t, d) = 4 - 1 + 1 = 4
(3.87ft)
Therefore, node t is at layer 3 and arcs (c, t) and (d, t) are in N. The layered net N that results from the net G of Fig. 3.27 for the flow pattern shown therein is presented in Fig. 3.28.
3.5
layer 0
layer 1
layer 2
LAYERED NETS
201
layer 3
Fig. 3.28. The layered net that results from the net of Fig. 3.27.
Once the layered net N of G is found with respect to a flow /, we then look for a maximum flow in the layered net N. A flow function / ' is said to be a blocking flow in N if every directed path from s to t contains at least one saturated arc. In the next section, we shall discuss an elegant procedure for finding a blocking flow in a layered net. We now describe a general procedure for finding a maximum flow in a given net G(V, E, c, / ) . We start with the zero flow in G, construct a layered net N from G u s i n g / a s a guide, find a blocking flow in N, and then augment the flow in G. With a new flow/* in G, we construct a new layered net N' from G(V, E, c,/*) using/* as a guide, find a new blocking flow in N', and then augment the flow in G(V, E, c, / * ) , etc. We call the part of the procedure that (i) constructs a layered net (ii) finds a blocking flow (iii) augments the flow in G a phase. The procedure consists of a sequence of these phases with increasing height so that there are at most n — 1 phases for an n-node net G. By the height of a layered net N, we mean the number of arcs in any directed path from s to t in N. The layered net N of Fig. 3.28, for example, is of height 3. In the following, we show that the heights of the layered nets increase with the phases.
THEOREM 3.5 The heights of the layered nets constructed during the phase-to-phase computation in the solution of a net flow problem form a strictly increasing sequence of positive integers.
202
MAXIMUM FLOWS IN NETWORKS
Proof. Let A^ be the layered net constructed during the /cth phase of the computation and let hk denote the height of Nk. We first prove that if Pi = (v0, f i ) O i , v2). . . (vw_u is a directed path from s = v0 to vw in Nk+1, 1, 2, . . . , w) of P1 is also contained in Nk, then j^aj,
vw)
(3.88)
and if each node f, (i =
y' = 0, 1,2, . . . , w
(3.89)
where node t»y was contained in layer a, of A^, and is in layer j of Nk+l. We shall prove the above assertion by induction. The result (3.89) is obviously true for / = 0, since v0 = s was in layer a0 = 0 of Nk and remains in layer ;' = 0 of Nk+i, giving j = ao = 0. Assume that (3.89) holds for any j ^ u < w. We show that for ;' = u + 1 it is true that if node vu+x was in layer £ of Nk, then w + 1^/3
(3.90)
Suppose otherwise that u + 1 < /?. Consider node vu which, by induction hypothesis, was contained in a layer p of A^ such that p^u. It follows that the arc (vu, vu+1) cannot be in A^ because, for vu in layer p ^ u and vu+1 in layer /? > u + 1, nodes vu and vu+l were not in two consecutive layers. As a result, the flow in the original net G from vu to vu+l could not have been affected by the augmentation procedure of phase k. On the other hand, arc (vu> vu+\) is in Nfc+i» meaning that it was a useful arc from vu to vu+l in G at the beginning of phase k + 1, and its flow in G was unaffected by phase k. Therefore, (vu, vu + 1) must be a useful arc from vu to vu+t at the beginning of phase k. Since u„ was in A^, (vu, vu+l) must be in A^. This contradicts an earlier assertion that (vu, vu + l) is not in A^. Hence, (3.89) holds for ally. We now proceed to complete the proof of the theorem. Let P2=(s, Vi)(vu v2). . .(vp-2,
u p _,)(u p _,, t)
(3.91)
where p = hk+1, be a directed path from s to t in Nk+l. To facilitate our proof, two cases are distinguished. Case 1 All the nodes of P2 are in A^. Then appealing to (3.89) by letting vw = t with w =p = hk+l in (3.88) shows that j^aj,
j = 0,l,...,P=hk+1
(3.92)
where s — v0 and u, was in layer OCJ of Nk. In particular, for j = p = hk+^
3.5 LAYERED NETS
we have p^ap.
203
This is equivalent to saying that hk+1*hk
(3.93)
If hk+1 = hk or p = ap, then / = ay,
j = 0,l,...,p
(3.94)
This is possible if the directed path P2 is in both A^ and Nk+1. As a result, all the arcs of P2 in the original net G were useful arcs both before and after the augmentation procedure of phase k. This contradicts the fact that the blocking flow used in the augmentation stage of phase k saturated some arcs of P2. Therefore, in this case we have hk+1>hk
(3.95)
Case 2 Not all the nodes of P2 are in Nk. Let (vu, vu+l) be the first arc of P2 such that vu+l was not in Nk. Then the flow in (vu, vu+l) in G was unaffected by flow augmentation in phase k. Because (vu, vu+1) is in Nk+1, it was a useful arc at the beginning of phase k + 1, but it was unaffected by phase k, yet it was not in A^. This is possible only if vu is in layer hk_1 of Nk and vu+i¥=t. In other words, vu+1 would have entered into Nk in layer hk, had all such nodes been included in A^. But layer hk is special in that it contains only sink t. Thus, if vu was in layer ocu of A^, then au + 1 = hk. Since all the nodes of the subpath from s to u in P2 are also in Nk, we obtain from (3.89) that u^au
(3.96a)
or u + l^au
+ l = hk
(3.96b)
Now vu+1=£t and t is in the layer hk+1 > u + 1 of Nk+1. We conclude that hk+l>hk
(3.97)
This completes the proof of the theorem. The novel idea of layering nets is due to Dinic (1970). Because the height of the layered net is increased from one phase to the next, there are at most n — 1 phases for an rc-node net G. The labor involved in constructing a layered net is obviously O(m), so is the labor in augmenting the flow in G with a blocking flow, where m is the number of arcs of G. In the following
204
MAXIMUM FLOWS IN NETWORKS
2,1 1,1
2,2 3,1
Fig. 3.29. A blocking flow for the layered net of Fig. 3.28 with respect to the flow/. section, we show that a blocking flow can be found in 0 ( « 2 ) time in a layered net. Then the whole maximum flow problem can be solved in 0(mn2) or 0 ( n 4 ) , since m < n2. Example 3.7 Consider the net G(V, E, c,f) of Fig. 3.27. The layered net N(G) of G with respect to the flow / was shown in Fig. 3.28. A blocking flow of N(G) is presented in Fig. 3.29. Observe that each directed path from s to ( i n iV(G) contains at least one saturated arc. No additional flow can be added from s to tin N(G). Since each directed path from s to t in N(G) is composed of three arcs, the height of N(G) is 3 or ht = 3
(3.98)
Using the flow pattern of Fig. 3.29, additional flows can be added to the arcs of G. The resulting net G*(V, E, c, / * ) is shown in Fig. 3.30. Using the new flow/* as a guide, the layered net N(G*) of G* is given in Fig. 3.31. This layered net is clearly of height 4 or A, = 4
(3.99)
Fig. 3.30. The resulting net after additional flows are added to the arcs of the net of Fig. 3.27.
3.6 A BLOCKING FLOW ALGORITHM
205
Fig. 3.31. The layered net that results from the net of Fig. 3.30, using the flow/* as a guide.
Thus, in solving the network flow problem by the layered net approach, two phases of the computations are required. In going from phase 1 to phase 2, the heights of the layered nets are increased from 3 to 4. The five partitioned layers and a blocking flow for the layered net N(G*) are also indicated in Fig. 3.31. Using this flow in N(G*) to augment the flow/* in G* yields the final maximum flow as shown in Fig. 3.32.
3.6
A BLOCKING FLOW ALGORITHM
In the preceding section, we showed how to construct a layered net N(V, E', c',f) from a given net G(V, E, c,f), using f l o w / a s a guide. In the present section, we give a procedure for finding a blocking flow in N. The procedure known as the MPM algorithm is due to Malhotra, PramodhKumar and Maheshwari (1978), and is a very clever modification of the algorithm proposed by Karzanov (1974).
Fig. 3.32. The final maximum flow that results from the net of Fig. 3.27 by means of the layered net approach.
206
MAXIMUM FLOWS IN NETWORKS
For each node y in the layered net N(V, E', c', / ' ) , the in-flow potential Pin(y) of y is the sum of the capacities of all arcs (x, y) directed towards y: Pi«(y)= 2
c'(x,y)
(3.100)
(x.y)eE'
The out-flow potential PoM(y) of y is the sum of the capacities of all arcs (y, x) directed away from y: PoM=
E
c'(y,x)
(3.101)
(y,x)eE'
The flow potential P(y) of y is the smaller of either the in-potential or the out-potential: P(y) = min [Pin(y), Pout(y)]
(3.102)
In other words, the flow potential of a node is the minimum of either the total incoming arc capacities or the total outgoing arc capacities of the node. Clearly, the flow potential of a node is the maximum amount of flow that can be forced through the node, and the maximum amount of flow that can pass through all the nodes cannot exceed the smallest flow potential among all the nodes with nonzero flow potential. MPM algorithm Step 1. Find a node x + s, t of smallest flow potential P min = min {/>(/)}
(3.103)
i
in N(V',E',c',f). Step 2. Send P min units of flow along the outgoing arcs (x, y), (x, y) e E', of TV by saturating as many of them as possible in some order. Step 3. Follow the flow f'(x, y) ¥= 0, (x, y) e E', to the next higher layer for each y, and repeat Step 2 by sending f'(x, y) units of flow along the outgoing arcs of y. Repeat for the next higher layer until the sink t is reached. Step 4. Assign P min units of flow to the incoming arcs (y, x), (y, x) e E', of N by saturating as many of them as possible in some order. Step 5. Follow the flow/'(_y, JC) # 0 , (y, x) e E', to the next lower layer for each y, and repeat Step 4 by assigning f'(y, x) units of flow along the incoming arcs of y. Repeat for the next lower layer until the source s is reached.
3.6 A BLOCKING FLOW ALGORITHM
207
Step 6. Augment the flow f{x, y), (x,y)eE, of G by the flow f'(x, y), (x, y) e E', of N by replacing each f(x, y) by f(x, y) +f'(x, y). At the same time, update each arc capacity of N from c'(x, y) to
c'(x,y)-f'(x,y). Step 7. Remove all arcs of zero residual capacity and all nodes other than s and t of zero flow potential together with all their incident arcs from the resulting net obtained in Step 6. If the source s and sink t are still connected by a directed path, return to Step 1 and repeat all the steps. Otherwise, stop. Notice that the node of minimum flow potential in Step 1 will become a node of zero flow potential at the end of Step 6, and, therefore, this node together with all its incident arcs will be removed in Step 7. We now estimate the number of operations required in establishing a blocking flow. First of all, to find a node of minimum flow potential in Step 1, we need n — 3 comparisons the first time for an n-node layered net, and at most n — 4 comparisons the second time, so that there are at most (n — 3) + (n — 4) + . . . + 1 = (n - 2)(n - 3)/2 comparisons, and we need at most 0 ( n 2 ) comparisons in Step 1. In Steps 2-6, since each arc can be saturated only once, the time of saturating all arcs of G is at most O(m), where m is the number of arcs in G. For each minimum flow potential node, we visit at most n — 1 other nodes and there are at most n minimum flow potential nodes altogether. So the amount of work required to update the arc capacities is at most 0 ( n 2 ) . As a result, the work required for the MPM algorithm to find a blocking flow in a layered net is 0(n 2 ) + O(m) + 0 ( n 2 ) = 0(n2)
(3.104)
where m
208
MAXIMUM FLOWS IN NETWORKS
4,2
v_y
4,2
Fig. 3.33. A net used to illustrate the MPM algorithm. nodes. The flow potentials of the nodes of JVX are found to be P(a) = min [Pin(a), Pout(a)] = min [2,1] = 1
(3.105a)
P(b) = min [Pin(b), Pout(b)] = min [3, 5] = 3
(3.1056)
P(c) = min [Pin(c), P out (c)] = min [2,2] = 2
(3.105c)
P{d) = min [Pin(d), PoM(d)] = min [4, 4] = 4
(3A05d)
the minimum of which is P min = min {P(a), P{b), P(c), P(d)} = min {1, 3, 2,4} = 1 (3.106) We now follow the seven steps of the MPM algorithm to find a blocking flow in Nlt as follows: Stepl. Pmin = P(a) = l. Step 2. Send 1 unit of flow along (a, c) or f'(a, c) = 1. Step 3. Follow / ' ( « , c) and send f'(a, c) = 1 unit of flow along (c, t), obtaining f'(c, t) = 1.
Fig. 3.34. The layered net that results from the net of Fig. 3.33 with respect to the flow / = 0, where flow potentials of the nodes are indicated by numbers adjacent to the nodes.
3.6 A BLOCKING FLOW ALGORITHM
209
Fig. 3.35. The resulting net after the completion of the first iteration of the MPM algorithm. Step 4. Assign 1 unit of flow to the incoming arc (s, a), giving f'(s, a) = 1. Step 5. It is not needed. Step 6. Change the flow / of G to f(s,a)
= l,
f(a,c)=l,
f(c,t)
=l
(3.107)
All others remain to be zero. Update the capacities of the arcs (s, a), (a, c) and (c, t) from 2, 1 and 2 to
Step 7.
Step Step Step Step Step Step
1. 2. 3. 4. 5. 6.
c'(s,a)-f'(s,a) = 2-l = l
(3.108a)
c'(a, c) -f'(a,
c) = 1 - 1 = 0
(3.1086)
c'(c,t)-f'(c, 0 = 2-1 = 1
(3.108c)
respectively. Remove node a and all arcs (s, a) and (a, c) incident at a. The resulting net N[ is shown in Fig. 3.35 with flow function / ' . Return to Step 1. Pmin = P(c) = linN[. Send 1 unit of flow along (c, t) or f'(c, t) = 1 in N[. It is not needed. Assign 1 unit of flow to (b, c) or f'(b, c) = 1 in N[. Assign 1 unit of flow to (s, b) or f'(s, b) = 1 in N[. Augment the flow / of G as follows: f(s, b) = 0 + 1 = 1
(3.109a)
/(ft, c) = 0 + 1 = 1
(3.10%)
/(c, 0 = 1 + 1 = 2
(3.109c)
210
MAXIMUM FLOWS IN NETWORKS
Fig. 3.36. The resulting net after the completion of the second iteration of the MPM algorithm.
Step
Step Step Step Step Step Step Step
f(s, a) = 1, f(a, c) = 1, and all others are zero. Update the arc capacities of arcs (s, b), (b, c) and (c, t) from 3, 1 and 1 to 3 — 1 = 2, 1 — 1 = 0 and 1 — 1 = 0, respectively. 7. Remove node c and all arcs (b, c) and (c, t) incident at c. The resulting net N" is shown in Fig. 3.36 with flow function /". Return to Step 1. 1. P min = P(b) = 2 in N';. 2. Send 2 units of flow along (b, d) or f"(b, d) = 2'm N". 3. Send 2 units of flow along (d, t) or f"(d, t) = 2 in N". 4. Assign 2 units of flow to (s, b) or f"(s, b) = 2'm N". 5. It is not needed. 6. Augment the flow of G and the result is shown in Fig. 3.33. 7. Stop.
A blocking flow of Nx is obtained by superimposing the flow patterns of Figs. 3.34-3.36, and is shown in Fig. 3.37. Observe that every directed path from s to t in Nx of Fig. 3.37 contains at least one saturated arc. This completes the first phase of operations for finding a maximum flow in G using the layered-net approach. A feasible flow pattern is presented in Fig. 3.33.
Fig. 3.37. A blocking flow of JV, obtained by superimposing the flow patterns of Figs 3.34-3.36.
3.6
A BLOCKING FLOW ALGORITHM
211
1,1
Fig. 3.38. The layered net that results from the net of Fig. 3.33 with respect to the flow pattern of Fig. 3.33.
To continue with phase 2, we construct a layered net N2 of G using the flow pattern of Fig. 3.33. The layered net N2 is shown in Fig. 3.38. We again follow the seven steps of the MPM algorithm to find a blocking flow, as follows: Step I. Pmin = P(a) = l. Step 2. Send 1 unit of flow along (a, b) o r / ' ( a , b) = 1. Step 3. Send 1 unit of flow along (b, d) and (d, t) or f'(b, d) =f'(d,t) = 1. Step 4. Assign 1 unit of flow to (s, a) or f'(s, a) = 1. Step 5. It is not needed. Step 6. Augment the flow of G of Fig. 3.33 and the result is shown in Fig. 3.39. Step 7. Stop. The algorithm terminates with two iterations, and a desired maximum (X,X)
Fig. 3.39. The final maximum flow that results from the net of Fig. 3.33 after the completion of the MPM algorithm.
212
MAXIMUM FLOWS IN NETWORKS
Fig. 3.40. A net used to illustrate the MPM algorithm.
flow is shown in Fig. 3.39 with maximum flow value 5. The corresponding minimum s-t cut is found to be (X, X) = (s, {a, b, c, d, t}), as indicated in Fig. 3.39. Example 3.9 We use the layered-net approach in conjunction with the MPM algorithm to find a maximum flow in the net G(V, E, c, / ) of Fig. 3.40. Initially, set
/ = o. First, we follow the layering process of Section 3.5 to construct a net A^ of G u s i n g / = 0 as a guide. The result is shown in Fig. 3.41 with flow potentials of the nodes indicated by numbers adjacent to the nodes. To introduce the layered net N[ of G, we remove all arcs that do not belong to any directed path from s to t in AV The resulting layered net N[ of G with respect to / = 0 is shown in Fig. 3.42 with nodal flow potential written adjacent to the node. The layered net N[ is of height 4.
Stepl. Step 2. Step 3. Step 4. Step 5. Step 6.
P min = P(u 1 ) = l i n A f ; . Send 1 unit of flow along the arc (v,, v5). Send 1 unit of flow along the arcs (v5, v9) and (vg, t). Assign 1 unit of flow to arc (s, v^. It is not needed. Augment the flow of G and record the result in Fig. 3.40. Update the arc capacities of arcs (s, v^, (vlt v5), (v5, vg) and (vg, t) from 1, 4, 4, 3 to 0, 3, 3 and 2, respectively.
3.6 A BLOCKING FLOW ALGORITHM
213
Fig. 3.41. The layered net that results from the net of Fig. 3.40 with respect to the flow/ = 0, where flow potentials of the nodes are indicated by numbers adjacent to the nodes.
Fig. 3.42. The resulting layered net N[ obtained from N, by removing all arcs that do not belong to any directed paths from s to t in N,.
214
MAXIMUM FLOWS IN NETWORKS
Fig. 3.43. The resulting net after the completion of the first iteration of the MPM algorithm.
Step 7. Remove node v1 and arcs (s, vt) and (u,, v5) incident at vt. The resulting net N" is presented in Fig. 3.43. Return to Step 1. Step 1. ^min = P(v*) = P(v5) = P(vg) = 2 in N". Choose, say, node u 4 . Step 2. Send 2 units of flow along the arc (v4, v8). Step 3. Send 2 units of flow along the arcs (vs, v9) and (v9, t). Step 4. Assign 2 units of flow to arc (s, v4). Step 5. It is not needed. Step 6. Augment the flow of G and record the result in Fig. 3.40. Update the arc capacities of arcs (s, vA), (v4, v8), (v8, v9) and (v9, t) from 2, 4, 5, 2 to 0, 2, 3 and 0, respectively. Step 7. Stop. By superimposing the flow patterns of Figs. 3.42 and 3.43, we obtain a desired blocking flow of the layered net N[, and the result is presented in Fig. 3.44. Observe that every directed path from s to (in N[ contains at least one saturated arc, and that, although the maximum number of phases required for the net G is n — 1 = 13, the algorithm terminates in only one phase. The final flow pattern is shown in Fig. 3.45 with maximum flow value 3. The corresponding minimum s-t cut is found to be (X, X) = (s, {vu v2, . . . , v12, v13 = t}) as indicated in Fig. 3.45.
(3.110)
3.7 VARIANTS OF THE FORD-FULKERSON ALGORITHM
215
Fig. 3.44. A blocking flow of the layered net NJ obtained by superimposing the flow patterns of Figs 3.42 and 3.43. 3.7
VARIANTS OF THE FORD-FULKERSON ALGORITHM
Recall that the Ford-Fulkerson algorithm is carried out in two steps using two routines—the labeling routine and the augmentation routine. The labeling routine searches for a flow augmenting path and, after the flow augmenting path is found, the augmentation routine increases the flow along the flow augmenting path. However, in searching for a flow (X,X)
application of the MPM algorithm.
216
MAXIMUM FLOWS IN NETWORKS
augmenting path, the labeling routine does not specify the order with which the nodes are labeled or with which the labeled nodes are scanned. If the nodes are labeled and scanned in a certain order, a significant improvement in computational efficiency of the Ford-Fulkerson algorithm results. In the following, we present several refinements and modifications of the FordFulkerson approach. 3.7.1
Edmonds-Karp Algorithm
Edmonds and Karp (1972) suggested that the labeling routine of the Ford-Fulkerson algorithm be implemented on a first-labeled-first-scanned basis. The approach is commonly known as the breadth-first search in computer science. Let G(V, E, c,f) be an n-node net. In labeling the nodes of V using the labeling routine, let * be a node that has been labeled but not yet scanned. To scan x, we assign labels to all the unlabeled nodes y e V such that (x, y) e E is a useful arc. The nodes y are then scanned in the order that they are labeled. The flow augmenting path obtained in this way always contains the minimum number of arcs from the source 5 to the sink t. For our purposes, we say that a flow augmenting path is of arc length k if it contains k arcs. This should not be confused with the length of a path or directed path discussed in the preceding chapter, where the length of a path or directed path is defined as the sum of lengths of the arcs in the path or directed path. The two concepts coincide when each arc in the path or directed path is of length 1. The Edmonds-Karp algorithm proceeds as follows: We first use a flow augmenting path of arc length 1 and augment flow along this path. When there are no flow augmenting paths of arc length 1, we use a flow augmenting path of arc length 2 and augment flow along this path. This is repeated until the shortest flow augmenting path is of arc length n — 1. Thus, there are a total n — \ phases, and each phase consists of finding a flow augmenting path of arc length k(k = 1,2, . . . , n — 1) using the breadth-first search and augmenting flow along this path. At the end of each phase, we construct a residue net induced by the existing flow and composed of the useful arcs of G. The crux of the procedure is that the shortest augmenting path increases in arc length from phase to phase. Given a flow / in G(V, E, c,f), the residue net M(V, E', c'.f) of G induced by the existing flow / is the net with the same node set V such that (x, y) e E' if and only if (x, y) e E is a useful arc in G with c'(x, y) = c(x, y) -f(x,
y) +f(y,
x)
(3.111)
It is straightforward to verify that for each directed path from s to t m M, there corresponds a flow augmenting path from s to t in G. We now divide all the nodes of the residue net M into different layers. By definition, the
3.7 VARIANTS OF THE FORD-FULKERSON ALGORITHM
217
source s is in layer 0. Then a node x is in layer k if the shortest directed path from s to x in M is of arc length k. In other words, the shortest directed path consists of k useful arcs in M. The subnet Nr of M consisting only of the arcs (x, y) e E' connecting nodes in layer / to nodes in layer i + 1 for i = 0, 1, 2, . . . , n — 1 is called the layered residue net of G induced by the flow /, and has the typical appearance as that shown in Fig. 3.26. We call the part of the algorithm that (1) finds the residue net M, (2) partitions the nodes of M into layers and constructs the layered residue net NT, and (3) finds a blocking flow from s to t in NT, a phase. The algorithm consists of a sequence of these phases with increasing arc lengths of the shortest flow augmenting paths, as required by Theorem 3.5. Thus, the algorithm terminates with at most n — 1 phases. In constructing the residue net, we look at each arc at most twice, once in each direction, so the total amount of work is O(m), where m is the number of arcs in G. In searching for a flow augmenting path by breadth-first search, it takes at most O(ra) steps. This is also the labor involved in constructing the layered residue net. To find a blocking flow, we increase the flow along each flow augmenting path. There are at most m flow augmenting paths in each phase, and each flow augmenting path requires at most 0{m) steps. Thus, the work in each phase is bounded by 0 ( m 2 ) . Since there are at most n — 1 phases, the total work is bounded by 0(nm2). With m < n2, the Edmonds-Karp algorithm has a worst-case bound 0(nm2) = 0(n5). This is in contrast to the layered-net approach using the MPM algorithm that requires at most 0 ( n 3 ) . Example 3.10 Consider the net G(V, E, c, f) of Fig. 3.33, which is redrawn in Fig. 3.46. We use the Edmonds-Karp algorithm to calculate a maximum flow. Using the flow / of Fig. 3.46, we construct the residue net M(V, E', c',f) of G such that (x, y) e E' if and only if (x, y) e E is a useful arc in G with c'(x, y) being determined by (3.111). For example,
Fig. 3.46. A net used to illustrate the Edmonds-Karp algorithm. I
218
MAXIMUM FLOWS IN NETWORKS
layer 0
layer 1 /
layer 2
j
layer 3
'
layer 4
Fig. 3.47. The residue net M of the net of Fig. 3.46 with respect to the flow /.
arc (b, d) is in M because it is a useful arc in G with capacity c'(b, d) = c(b, d) -f(b,
d) +f(d, b) = 4 - 2 + 0 = 2
(3.112a)
Likewise, arc (d, b) is in M because c'(d, b) = c(d, b) -f(d,
b) +f(b, d) = 0 - 0 + 2 = 2
(3.112&)
We remark that arcs not in G may be regarded as arcs with zero capacity. The residue net M of G with respect t o / i s presented in Fig. 3.47. We next partition the nodes of M into different layers. A node x is in layer k if the shortest directed path from s to x in M is of arc length k. Thus, nodes s, a, b and d are in layers 0, 1, 2 and 3, respectively. Nodes c and t are in layer 4. The shortest directed paths used to partition the nodes of M are shown in Fig. 3.48. Finally, the layered residue net NT of
(s, e,oo)
layer 0 ' layer 1
(a, ©,1) layer 2
I
(b, ©,1) layer 3 \
layer 4
Fig. 3.48. The shortest directed paths used to partition the nodes of the residue net M of Fig. 3.47.
3.7 VARIANTS OF THE FORD-FULKERSON ALGORITHM
219
Fig. 3.49. The net showing the assignment of a unit of flow to the directed path (3.113).
G with respect to the flow / is the subnet of M consisting only of the arcs (x, y) e E' connecting nodes in layer i to nodes in layer i + 1 for *' = 0, 1, 2, 3: (s, a), (a, b), (b, d), (d, c) and (d, t). This layered residue net NT of G is presented in Fig. 3.48. Applying Ford-Fulkerson's labeling routine on a first-labeled-first-scanned basis, the labels are also given in Fig. 3.48, yielding a directed path Pst = (s,a)(a,b)(b,d)(d,t)
(3.113)
A unit of flow can be assigned to this path as indicated in Fig. 3.49. Augmenting the flow of G in Fig. 3.46 with this flow results in the final feasible flow pattern of Fig. 3.50. Since the algorithm terminates at the end of this phase, the flow shown in Fig. 3.50 is maximum with the minimum s-t cut (X, X) as indicated.
(X,X)
Fig. 3.50. The final maximum flow pattern obtained from the net of Fig. 3.46 after the application of the Edmonds-Karp algorithm.
220
MAXIMUM FLOWS IN NETWORKS
3.7.2
Dink Algorithm
The Edmonds-Karp algorithm has a worst-case bound 0(nm2) = 0 ( n 5 ) by assuming that we search each flow augmenting path independently in the residue net M of a given net G(V, E, c, f) induced by the flow/. This bound can be improved to 0{n2m) = 0 ( « 4 ) if we coordinate the search for flow augmenting paths of a given arc length in a phase. This improvement was suggested by Dinic (1970) and is known as the Dinic algorithm. The Dinic algorithm is very similar to the Edmonds-Karp algorithm in that it consists of a sequence of phases with increasing arc lengths of the shortest flow augmenting paths so that the algorithm terminates in at most n — 1 phases. Each phase includes (1) the construction of the residue net of G, (2) the construction of a layered net, and (3) finding a blocking flow in the layered net. The residue net M and the layered residue net Nr of G induced by the current flow / are constructed in the same way as before. The layered net N of G induced by the flow / is the subnet of NT consisting of all the directed paths from s to t. The layered net N constructed in this way is identical to that obtained in Section 3.5. Once the layered net N is constructed, we apply the labeling and scanning processes of the labeling routine to N, using the depth-first search to reach t. In the depth-first search, nodes of N are visited on a last-labeled-first-scanned basis. In general, suppose x is the most recently labeled node. We immediately scan x by searching for an unlabeled node v such that (x, v) is a useful arc of N. Node v is then labeled and the search starts anew at v. If no such y can be found, the search returns to w, the node from which x was reached. When we have to "back-up" from a node x during the search, we can delete all the arcs incident at x in N. If we reach sink t, a flow augmenting path is found. Then we increase flow along this path, update the residue capacities, remove arcs with zero residue capacity from N, and repeat the search for a new flow augmenting path. After all flow augmentations have been made in N corresponding to a blocking flow, the layered net N is destroyed and we proceed to the next phase. On the other hand, if a layered net cannot be successfully constructed using the current flow, the current flow is maximum and the algorithm terminates. As before, the construction of a layered net N requires O(m) steps. The depth-first search for an augmenting path in N takes at most 0(n) time, because we look at a node at most once during the search. In general, there are at most m augmenting paths in a phase, so the total amount of work in a phase is 0(nm). Since there are at most n — 1 phases, the total work required for the Dinic algorithm in the worst case is 0(n2m) = 0 ( « 4 ) with
m
Example 3.11 In the net G(V, E, c, f) of Fig. 3.51, assume initially that the flow is zero, / = 0. The layered net N of G with respect to this zero flow is shown in
3.7 VARIANTS OF THE FORD-FULKERSON ALGORITHM
221
Fig. 3.51. A net used to illustrate the Dinic algorithm.
Fig. 3.52. After applying the labeling routine to N using the depth-first search, the resulting labels are indicated in Fig. 3.52. Thus, a unit flow can be assigned to the directed path (s, b)(b, c)(c, t). We now update the residue capacities and remove arcs with zero capacity in N. This yields the flow augmenting paths (s, a)(a, c){c, t) and (s, b){b, d)(d, t) as shown in Fig. 3.53(a) and (b), respectively. Superimposing the flow patterns of Figs. 3.52 and 3.53 gives the flow pattern of Fig. 3.46. Repeating the above procedure for the net of Fig. 3.46 yields the corresponding nets of Figs. 3.48 and 3.49. The final maximum flow is shown in the net of Fig. 3.50. 3.7.3
Other Variations
In addition to the above two variants of the Ford-Fulkerson algorithm, other refinements and modifications of the Ford-Fulkerson algorithm are possible. They will be briefly described below. Recall that the order in which the nodes are labeled and scanned is crucial to the efficiency of the Ford-Fulkerson algorithm. However, no such order is explicitly known for optimum efficiency. Two particular ordering
(s, ©,3)
Fig. 3.52. The layered net of the net of Fig. 3.51 with respect to the flow/ = 0.
222
MAXIMUM FLOWS IN NETWORKS
Fig. 3.53. Theflow-augmentingpaths P„ obtained from the net of Fig. 3.52 after updating the residue capacities and removing arcs with zero capacity: (a) P„ = (s, a)(a, c)(c, t), (b) P„ = (s, b)(b, d)(d, t).
methods, known as the breadth-first search used in the Edmonds-Karp algorithm and the depth-first search used in the Dinic algorithm, have been widely used for solving the maximum flow problem. In fact, a computer program based on the breadth-first search technique is given by Bayer (1968). In applying the Ford-Fulkerson algorithm, in general only a small portion of the large number of labeled nodes is included in a flow augmenting path. Lin and Leon (1974) proposed a "two-end" labeling algorithm in which labeling and scanning start from both the source s and the sink / and advance from both directions. Thus, instead of a large-sized tree rooted at the source, their technique generates two relatively smaller ones rooted at the source and the sink. They used two small-sized nets with one containing 49 nodes and 196 arcs and the other 48 nodes and 72 arcs with certain special structures to demonstrate their approach, and showed that the technique is better performed than the "one-end" approach. Edmonds and Karp (1972) also suggested another improvement. Their idea is to determine, at each phase of the labeling process, a flow augmenting path that allows the largest possible flow augmentation. If U denotes the set of nodes already labeled but not including the sink t, and if W is the set of unlabeled nodes w adjacent to a node u eU such that (u, w)
3.8
KARZANOV ALGORITHM
223
is a useful arc in G(V, E, c, / ) , if W is empty the current flow is maximum. Otherwise, we look for an arc (u, w), u e U and w e W, with largest possible residue arc capacity c'(u, w) = max {c(u, w) -f(u,
w) +f(w, u) \ u e U, w e W}
(3.114)
and label the node w. If w = t, the program terminates and we find a flow augmenting path from s to t that allows the largest possible flow augmentation. If w ¥=t, then U=UU{w},
W = W-{w}
(3.115)
and the process is repeated. Edmonds and Karp (1972) showed that if the net has integral capacities, then a maximum flow will be obtained within at most l + log^M-!)/,,
(3.116)
augmentations, where fs, is the value of the maximum flow and M is the maximum number of arcs across an s-t cut. In addition, Johnson (1966) proposed the use of triple labels, and Srinivasan and Thompson (1972) introduced the notion of the predecessor and distance labels. Finally, Cheung (1980) combined many of the above approaches, and suggested the layer-updating method. The main idea is to maintain by updating without destruction a two-way layered subnet throughout the whole process. In constructing the layered net, instead of starting from the source and advancing in one direction, his method starts the construction from both the source and the sink and advances, alternately, in both directions. When two front layers meet, a flow augmenting path is found through which the flow is immediately augmented. After each flow augmentation, instead of destroying the whole two-way layered subnet and starting all over again, only a small portion of it is reconstructed by relinking some of the nodes.
3.8
KARZANOV ALGORITHM
There are two distinct characteristics associated with the Ford-Fulkerson algorithm. First, flow is augmented through a flow augmenting path from the source to the sink. Secondly, throughout the solution process, the flow pattern is always conservative for all the nodes except the source and the sink. The present algorithm, first suggested by Karzanov (1974), has two contrasting features. Instead of using the flow augmenting paths, flow is augmented, level by level, through layers. During the solution process, the flow conservation property may not hold at some of the nodes. However,
224
MAXIMUM FLOWS IN NETWORKS
flow conservation is achieved by flow elimination. The Karzanov algorithm is important in that it provides a new approach substantially different from the classical approach of Ford and Fulkerson, and has an upper bound 0(n3). Given a net G(V, E, c,f), a function g from the arc set E to the nonnegative reals is said to be a preflow of G if for each arc (x, y) e E, g(x,y)^c(x,y)
(3.117)
and for each node y eV
I,g(x,y)^Ilg(y,z) X
(3-ii8)
Z
A node y satisfying (3.118) with a strict inequality is called an unbalanced node. Otherwise, it is balanced. If every node is balanced, then the preflow g becomes a flow / of G. The Karzanov algorithm consists of many phases and each phase involves two stages: Advance of preflow and balance of preflow. The general setup is very similar to that of the Dinic algorithm in that both use layered nets to find a maximum flow in G. However, the major difference is that in the Dinic algorithm we find the maximum flow in a layered net of G by saturating one arc at a time, while in the Karzanov algorithm we find the maximum flow in a layered net by saturating one node at a time. We start each phase by pushing the preflow from the source s and then from layer to layer until the sink t is reached. Then we balance the preflow at each node until every node is balanced. The former is called the advance of preflow and the latter the balance of preflow. These two operations are iterated until the flow becomes maximum in the layered net. Let N be a layered net of G and Vt (i = 0, 1, 2, . . . , k) be the layers of N. A layer j is said to be unbalanced if
2
2 s ( * - > 0 * 2 2 g(y,z)
xeVj^yeVj
(3.H9)
y<EVjZeVj+1
for j = 1, 2, . . . , k — 1. In finding a maximum flow in N, we say that an arc (x, v) is closed if the current flow g(x, y) cannot be changed. Otherwise, it is open. Initially, all the arcs in N are open until some of them are declared closed. The flows in the closed arcs remain the same for the remainder of the phase. For our purposes, we assume that all the outgoing arcs (x, y) of node x are ordered in a certain way, say, in increasing order of the index y. This ordering of arcs is fixed during the phase. The incoming arcs (w, x) of node x are not ordered at first, but we keep track of the order in which the preflow g(w, x) are added to the node x.
3.8 KARZANOV ALGORITHM
225
Stage 1. Advance of Preflow We begin at the source s at the layer 0 by pushing as much preflow as possible into nodes x at the layer 1 by setting g(s, x) = c(s, x) for all x e V\. We have moved the preflow from layer 0 to layer 1. In general, during an advance of preflow operation at layer i, we consider an unbalanced node x e Vt and increase the preflow in each of the outgoing arcs (x, y) from x to all y e Vi+1 until either the arc is saturated or the node x is balanced. The increases follow the preassigned arc order by first pushing as much flow as possible in the first open arc which is not saturated, and then as much as possible in the second open arc, etc. Thus, the outgoing arcs (x, y) of x are much like a queue. The advance operation stops when it is not possible to push any preflow forward from any node x e Vt. This occurs when the outgoing arcs (x, y) of x are either closed or saturated. Stage 2. Balance of Preflow We start from an unbalanced node y in the highest layer /, and reduce the incoming flows to y in the last-in-first-out fashion until the node y is balanced. Recall that we keep track of the order of the incoming arcs (x, y), x e Vj-x, to y when g(x, y) is added to node y. When we reduce the incoming flow to y, we reduce the latest addition first in a last-in-first-out fashion, so it is like a stack. In general, during a balance operation at layer i, we consider an unbalanced node y e Vh and reduce the preflow in the arcs (x, y) incoming from all x e V,_! to y in a last-in-first-out fashion until node y is balanced. Then all the arcs (x, y) to the newly balanced node y ai declared closed. Thus, all the arcs incident at node y can be deleted from the layered net N. If all unbalanced nodes are balanced in this layer, return to Stage 1 even though there may be unbalanced nodes in lower layers. Observe that in balancing the nodes in layer i we may create unbalanced nodes in layer i — 1. Since all nodes in layers i — 2, i — 3, . . . , 0 have not been disturbed, when we return to Stage 1 we can start from layer i — 1 and push as much preflow as possible to the higher layers until sink t is reached. We summarize the above by stating the following steps for the Karzanov algorithm. Let N(V, E', c',f) be the layered net of G(V, E, c,f). Karzanov Algorithm Step 1. Set / = 0. Step 2. Based on current flow /, construct a layered net N of G with the layered node sets V( (i = 0, 1, 2, . . . , k). If t $ Vk, stop. Step 3. Set i = 1 and f'(s, y) = c'(s, y), (s, y) € E'. Step 4. Perform the preflow advance operations at the layers i, i + 1, . . . , k — 1 consecutively.
226
MAXIMUM FLOWS IN NETWORKS
Step 5. Search for an unbalanced node y in the highest layer/, 1 g / ^ k - 1, and perform a preflow balance operation for each y eVj. If / = 1 or if all the nodes are balanced except 5 and t, return to Step 2. If / > 1, set i =j - 1 and return to Step 4. We now show that the Karzanov algorithm indeed will generate a maximum flow in a layered net N of G induced by the current flow /, and requires at most 0(n 2 ) operations. A node x of N is said to be blocked if every directed path from ^ to r contains at least one saturated arc. Thus, once a node is blocked, no more flow can be pushed through that node. We first show that an unbalanced node x becomes blocked after the application of the preflow advance operations, and this node remains blocked during the whole phase of operations. We prove this assertion by induction over the number of preflow balance operations. Initially, during the first stage of preflow advancement, the source and all the unbalanced nodes are blocked because every outgoing arc from these nodes is saturated. A blocked node y at the highest layer / cannot become unblocked because no arc flow g( v, 2), z e Vj+X, is reduced after the preflow balance operation, and, therefore, each directed path from y to t contains at least a saturated arc. Assume that the assertion is true after the application of q or less preflow balance operations. We show that it is true for q + 1 preflow balance operations. Let y be a blocked node at the highest layer / after the gth preflow balance operation. By induction hypothesis, every directed path from y to t contains at least a saturated arc. During the preflow balance operation, the incoming flow of every such node y is reduced and this reduction in turn reduces the outgoing arc flows of some of the nodes at the layer/ — 1. Let x be a node at layer / — 1 that was originally blocked before the reduction of its outgoing arc flow. Since every directed path from x to t must pass through a blocked node y, node x remains blocked after the preflow balance operation. If node x becomes unbalanced after the flow reduction of its outgoing arcs, and if it is processed in the next preflow balance operation, node x will become balanced and each of its outgoing arcs is either saturated or closed. Therefore, each directed path from 1 to / contains either a saturated arc or a closed arc that must pass through the blocked node y. As a result, node x remains blocked and the assertion follows. Recall that once a node is balanced, it can be removed from the layered net. Thus, every node is balanced at most once. This in conjunction with the facts that each unbalanced node can be processed at most once to become a blocked node and that it will remain blocked during the whole phase shows that the source s, which is blocked after the first iteration, remains blocked at the end of the phase. Hence, the induced flow is maximum. We now determine the maximum number of operations needed to find a maximum flow in a layered net. During the stage of a preflow balance
3.8 KARZANOV ALGORITHM
227
operation, if the flow in an arc is decreased, the arc is then declared closed. The number of flow reductions is, therefore, bounded by the number of arcs or O(m) time. During the stage of a preflow advance operation, if the flow in an arc is increased, the arc is either saturated or unsaturated. Since any decrease in flow in an arc will close that arc, saturation can occur at most once for any arc. Thus, the number of saturations during a phase is also bounded by O(m). On the other hand, if an arc flow is increased but not to saturation, this can occur at most n — 1 times in the initial preflow advance operation, and at most n — 2 times during the second preflow advance operation, etc., so that there are at most (n - 1) + (n - 2) + . . . + 2 + 1 = \n(n - 1)
(3.120)
occurrences at each phase. Thus, to find a maximum flow in a layered net we require an upper bound of O(m) + O(m) + 0 ( n 2 ) = 0(n2),
m^n2
(3.121)
Since there are at most n — \ phases, the Karzanov algorithm is bounded by 0(« 3 ). Finally, we mention that using a similar approach, Kinariwala and Rao (1977) proposed a flow switching algorithm and reported computational improvements over the breadth-first search approach. Like the Karzanov algorithm, their method can start with an arbitrary flow pattern. The flow pattern is then augmented through layers and the flow conservation property at the nodes is achieved by eliminating the surplus flow. Example 3.12 Consider the net G(V, E, c,f), of Fig. 3.51, which is redrawn in Fig. 3.54. Initially, assume t h a t / = 0. Based on this zero flow, the layered net N(V, E', c',f) of G is obtained in Fig. 3.55 containing four layers. We
Fig. 3.54. A net used to illustrate the Karzanov algorithm.
228
MAXIMUM FLOWS IN NETWORKS 1,1 2,2. 1,1-
3,3* 4,2 layer 0
layer 1
4,2 layer 2
layer 3
Fig. 3.55. The layered net of the net of Fig. 3.54 with respect to zero flow.
follow the five steps of the Karzanov algorithm: Step 1. S e t / = 0. Step 2. Construct N of G as shown in Fig. 3.55 with V0={s}, Vl = {a, b}, V2 = {c, d), and V3 = {t}. Then k = 3 Step 3. Set i = 1, f'(s, a) = c'(s, a) = 2, and f'(s, b) = c'(s, b) = 3. Step 4. Perform preflow advance operations at layers 1 and 2. The results are shown in Fig. 3.55. Step 5. Node a is the unbalanced node in the highest layer 1. Perform a preflow balance operation for node a. This is equivalent to reducing the arc flow/'(s, a) from 2 to 1. The final flow pattern is shown in Fig. 3.56. Return to Step 2. Step 2. Based on the flow pattern of Fig. 3.56, construct a layered net N of G as shown in Fig. 3.57 with nodes s, a, b, d and t belonging to layers 0, 1, 2, 3, and 4, respectively. Then k = 4. Step 3. Set i = l and f'(s, a) = 1. Step 4. Perform preflow advance operations at layers 1, 2 and 3. The results are shown in Fig. 3.57.
Fig. 3.56. The resulting flow pattern after performing a preflow balance operation for node a in the net of Fig. 3.55.
3.9 FLOWS IN UNDIRECTED AND MIXED NETS
229
Fig. 3.57. A layered net constructed from the net of Fig. 3.56.
Step 5. Since nodes a, b and d are all balanced, return to Step 2. Step 2. Stop. Combining the feasible flow patterns of Figs. 3.56 and 3.57 yields a desired maximum flow of Fig. 3.58.
3.9
FLOWS IN UNDIRECTED AND MIXED NETS
So far we have considered a net G(V, E, c,f) as a weighted directed graph with two real functions c and / defined from the arc set E to the nonnegative reals. In the case where the weighted graph is undirected or mixed, the maximum flow problem can be solved in a similar manner. If an edge (x, y) = (y, JC) is undirected with capacity c(x, v) = c(y, x), we interpret this to mean that f(x,y)^c(x,y)
(3.122a)
f(y,x)^c(x,y)
(3.1226)
Fig. 3.58. A maximum flow obtained by combining the feasible flow patterns of Figs 3.56 and 3.57.
230
MAXIMUM FLOWS IN NETWORKS
where f(x, y) is the flow from x to y in (x, y), and that the flow is permitted in only one of the two directions or f(x,y)f(y,x) = 0
(3.122c)
In other words, the arc {x, y) has a flow capacity c(x, y) in either direction but the flow can only move in one of the two directions. To find a maximum flow in such a net G'(V, E', c',f), we first replace each undirected edge (x, y) by a pair of oppositely directed edges (JC, y) and (y, x), each having the capacity equal to that of the original undirected edge. We now apply any of the existing techniques to find a maximum flow in the resulting directed net G(V, E, c,f). Once a solution / is found with flow value fs„ we can construct a feasible flow pattern / ' in the original net G'(V, E', c',f) with the same flow value £, by taking f'(x,
y) = max [0,/(x, y) -f(y, x)]
(3.123)
yielding /'(*,y)/'(y,*) = 0
(3.124)
The operation (3.123) is equivalent to canceling flows in opposite directions. Since the maximum flow value for any specific orientation of the given net is no greater than the maximum flow value obtained by the above procedure of replacing each undirected edge by a pair of oppositely directed edges, the maximum flow problem in an undirected or mixed net can always be solved in this way. One of the applications of this consideration is that one might think of a network of city streets, each street having a traffic flow capacity. If one is asked to put up one-way signs on streets not already oriented in order to permit the largest traffic flow from some points to the others, the procedure outlined above provides a convenient solution. Example 3.13 Consider the mixed net G'(V, E', c',f) of Fig. 3.59. By replacing each of the three undirected edges (a, c), (a, d) and {b, d) by a pair of oppositely directed edges, we obtain the directed net G(V, E, c, / ) of Fig. 3.60. Using any of the techniques described in the foregoing results in a maximum feasible flow pattern as shown in Fig. 3.60, the first number adjacent to an arc being the arc capacity and the second number the arc flow. To construct a feasible flow pattern in the original mixed net G', we
3.10 FLOWS IN NODE-AND-ARC CAPACITATED NETS
Fig. 3.59. A mixed net G'(V, E', c',f) problem.
231
used to illustrate the maximum flow
apply (3.123) and obtain f'(a,
c) = max [0,/(a, c) -f(c,
a)] = max [0,1 - 1] = 0
(3.125a)
f'(a,
d) = max [0,/(a, d) -f(d,
a)] = max [0,1 - 0] = 1
(3.125ft)
/'(ft, d) = max [0,/(ft, d) -f(d, ft)] = max [0,4 - 0] = 4
(3.125c)
and the flow in all other arcs (x, y) remains unaltered, i.e. f'(x, y) = f(x, y). The result is shown in Fig. 3.59. Note that f'(c, a) =f'(d, a) =
f'(d,b) 3.10
= 0.
FLOWS IN NODE-AND-ARC CAPACITATED NETS
Given a net G(V, E, c,f), suppose that in addition to the arc capacity c, each node i e V is associated with a nonnegative real number h(i) called the node capacity of i. The node capacity h is, therefore, a function from the node set V to the nonnegative reals. Our objective is to find a maximum l.i
Fig. 3.60. The conversion of the mixed net of Fig. 3.59 into a directed net.
232
MAXIMUM FLOWS IN NETWORKS
flow from the source s to the sink t in G subject to both arc and node capacities: For each i e V f(s,V)-f(V,s)=fsl f(i, V) -f(V, i) = 0,
i*s,t
f(t,V)-f(V,t) = -f„ c(i, j) g / ( i , / ) ^ 0, /(i,V)^A(i),
(3.126a) (3.1266) (3.126c)
(i, j) e E
(3.126rf)
i#r
(3.126e)
f(V,t)^h(t)
(3.126/)
This problem can be converted to the arc capacity case by the following procedure. Let G*(V*, E*, c*,f*) be the net derived from G(V, E, c,f, h) in accordance with the following rules: To each node i e V, there correspond two nodes / ' , i"eV* such that if (i,j)eE, then (i',j")eE*. In addition, for each i e V, there is an (/", i')e E*. The arc capacity c* defined on E* is given by c*(i',j") = c(i,j), c*(i",i') = h(i),
(i,j)eE ieV
(3.127a) (3.127&)
In the net G(V, E, c,f, h) of Fig. 3.61, the numbers adjacent to the arcs are the arc capacities, and those adjacent to the nodes are the node capacities. The net G*(V*, E*, c*,f*) derived from G is shown in Fig. 3.62. Observe that there are twice as many nodes in G* than in G. The operation is equivalent to splitting each node i into two nodes, a left node i" and a right node /', so that all arcs terminating at i now terminate at i", whereas all arcs outgoing from i now outgo from i'. The node capacity h(i) is then imposed as an arc capacity for the arc (i", i') directed from i" to /'.
Fig. 3.61. A node-and-arc-capacitated net, in which the numbers adjacent to the arcs are the arc capacities and those adjacent to the nodes are the node capacities.
3.11 SUMMARY AND SUGGESTED READING
233
Fig. 3.62. The conversion of a node-and-arc-capacitated net into an arc-capacitated net.
With this representation, it is clear that for any flow from s to t in G that does not exceed the node capacities, there corresponds an equivalent flow / * from s" to t' in G* by taking f*(i',j")=f(i,i), f*(i",i')=f{i,
V),
(},j)eE
(3.128a)
i*t
(3.128ft)
r
(3.128c)
and vice versa. Example 3.14 Consider the net G(V, E, c,f, h) of Fig. 3.61, which has both arc and node capacities. The net can be converted into an equivalent arc capacity net G*(V*, E*,c*,f*) of Fig. 3.62. Using any of the techniques discussed in this chapter, a maximum flow from s" to t' is as indicated in Fig. 3.62. Applying (3.128) yields a feasible flow pattern for the original net G as shown in Fig. 3.63. It is interesting to observe that without nodal capacity constraints, the maximum flow value from s to t in G is 5, whereas with nodal capacity the maximum flow value is reduced to 4.
3.11
SUMMARY AND SUGGESTED READING
We began this chapter by defining a flow pattern for a net. A flow pattern is feasible if it satisfies the arc capacity constraints and the conservation
234
MAXIMUM FLOWS IN NETWORKS
Fig. 3.63. A feasible flow pattern for the node-and-arc-capacitated net of Fig. 3.61.
equation for all the intermediate nodes. Our objective is to find a maximum feasible flow pattern for a general net. For this we introduced the notion of an s-t cut, which is different from the usual concepts of a cutset or a cut. We then showed that the maximum flow value from the source to the sink in a net is equal to the capacity of a minimum s-t cut separating the source and the sink. This is known as the max-flow min-cut theorem in the literature. The remainder of the chapter is primarily concerned with the various algorithms for finding a maximum flow in a net. We first introduced the classical Ford-Fulkerson algorithm, which is a systematical procedure searching for a flow augmenting path and then increasing the flow along this path. The algorithm can be carried out by two routines known as the labeling routine and the augmentation routine. It is popular because it is simple to understand and easy to implement. For many practical problems, the algorithm terminates fairly quickly. However, we demonstrated by an example that in the case where the arc capacities are irrational, it is possible to construct a net so that the algorithm not only will not terminate but also will converge to a wrong limit. Because of this, many new algorithms have been proposed. Some are simple modifications of the Ford-Fulkerson algorithm, and others are completely different. There are many variants of the Ford-Fulkerson algorithm. Recall that in searching for a flow augmenting path, the labeling routine does not specify the order with which the nodes are labeled or the order with which the labeled nodes are scanned. If the nodes are labeled and scanned on a breadth-first search basis, we essentially have the Edmonds-Karp algorithm. On the other hand, if the nodes are labeled and scanned on a depth-first search basis, we obtain the Dinic algorithm which also uses the layered net. The concept of the layered net was due to Dinic, and is extremely useful in devising ways to find its flows. A layered net is a directed net in which every arc is directed from one layer to the next adjacent one, and is derived from a given net using the current flow as a guide. The significance of the layered nets is that their heights form a strictly
3.11
SUMMARY AND SUGGESTED READING
235
increasing sequence of positive integers when they are constructed during the phase-to-phase computation in the solution of a net flow problem. To find a blocking flow in a layered net, we presented a procedure known as the MPM algorithm, which is a clever modification of the Karzanov algorithm, and uses the notion of flow potential. In contrast to the Ford-Fulkerson algorithm, the Karzanov algorithm provides a substantially different approach. We start each phase by pushing the preflow from the source to the sink, layer by layer. Then we balance the preflow at each node until every node is balanced. The former is called the advance of preflow and the latter the balance of preflow. These two operations constitute a phase and are iterated until the flow becomes maximum in the layered net. Finally, we discussed the situations where a given net contains either undirected edges or nodes with flow capacities. In the former, the mixed net can be converted into an equivalent directed net that provides a solution. In the latter, the problem can be changed to the arc capacity case and a solution follows. The speed of the Ford-Fulkerson algorithm depends not only on the number n of nodes and the number m of arcs but also on the arc capacities in the net. Indeed, for certain irrational arc capacities, the algorithm might not converge at all. For integral arc capacities, the Ford-Fulkerson algorithm runs in time 0(fstn2) where fst is the maximum flow value or the minimum s-t cut capacity. Since then many algorithms have been proposed, the speeds of which are bounded by a polynomial function of m and n only; they provide a steady procession of improvements in computational efficiency. The chronology is presented in Table 3.1. We remark that for an rc-node net, the maximum number of arcs in the net is bounded by 0 ( « 2 ) . Thus, for a complete or nearly complete directed graph, all of the computational complexities in Table 3.1 starting from the Karzanov algorithm are in the neighborhood of 0 ( « 3 ) . On the other hand, for a sparse net with relatively few arcs, the later algorithms result in a significant improvement in performance. There is no clear winner among the algorithms in the table that are based on Dinic's approach. The Karzanov, MPM, Shiloach and Vishkin, and Tarjan algorithms are suitable for the dense nets, whereas the Cherkasky, Galil, Galil and Naamad, Shiloach, Sleator and Tarj an, and Gabow algorithms are designed for the sparse nets. For a small range of densities, GalA's bound of 0(n 5 / 3 m 2 / 3 ) seems to be the best. For sparse nets with integer arc capacities of moderate size, Gabow's scaling algorithm is the best. Finally, among the algorithms based on Dinic's approach, the only parallel algorithm is that of Shiloach and Vishkin, which has a parallel running time of 0 ( n 2 l o g n ) with n processors but requires 0(mn) space. The standard book for the network flow problem and its variants is Ford and Fulkerson (1962). For a lucid exposition, we refer to Wilf (1986). For a concise presentation on the subject matter, we recommend Hu (1982). For
236
MAXIMUM FLOWS IN NETWORKS
TABLE 3.1 Author(s)
Year
Computational Complexityt
Ford and Fulkerson Edmonds and Karp Dinic Karzanov Cherkasky Malhotra, Pramodh-Kumar and Maheshwari Galii Galil and Naamad; Shiloach Sleator and Tarj an Shiloach and Vishkin Gabow Tarj an Goldberg Goldberg and Tarj an Ahuja and Orlin
1956 1969 1970 1974 1977
0(fs,n2), integral capacities 0(m2n) 0(mn 2 ) 0(n 3 ) 0(m 1 / 2 n 2 )
1978 1978 1978 1980 1982 1983 1984 1985 1986 1986
0(« 3 )
OCm^n5'3) 0(mn log 2 n) 0(mn logn) 0(« 3 ) 0(nm log U) 0(n3)
o(«3)
0(nm log (n2/m)) 0(nm + n2 log U)
t Where U denotes an upper bound on the arc capacities.
further study on the various algorithms, the reader is referred to the original papers listed in the references. A computational comparison of eight methods for the maximum network flow problem with networks up to 1500 nodes and 7960 arcs tested can be found in Cheung (1980).
REFERENCES Ahuja, R. K. and Orlin, J. B. (1987), "A fast and simple algorithm for the maximum flow problem," Tech. Rept 1905-87, Sloan School of Management, Massachusetts Institute of Technology, Cambridge, Mass. Bayer, G. (1968), "Algorithm 324. Maxflow," Comm. ACM, vol. 11, pp. 117-118. Chen, W. K. (1976), Applied Graph Theory: Graphs and Electrical Networks, Amsterdam, The Netherlands: North-Holland, 2nd revised edition. Chen, W. K. (1983), "Recent advances in the application of graph theory to networks," Circuits and Systems Mag., vol. 5, pp. 12-21. Cherkasky, R. V. (1977), "An algorithm for constructing maximal flows in networks with complexity of 0(V2VE) operations," Akad. Nauk USSR, Mathematical Methods for the Solution of Economical Problems, vol. 7, pp. 112-125. Cheung, T. Y. (1980), "Computational comparison of eight methods for the maximum network flow problem," ACM Trans. Math. Software, vol. 6, pp. 1-16. Dantzig, G. B. and Fulkerson, D. R. (1956), "On the max-flow min-cut theorem of
REFERENCES
237
networks," in Linear Inequalities and Related Systems, Ann. Math. Studies, vol. 38, pp. 215-221. Dinic, E. A. (1970), "Algorithm for solution of a problem of maximal flow in networks with power estimation," Soviet Math. Dokl., vol. 11, pp. 1277-1280. Edmonds, J. and Karp, R. M. (1972), "Theoretical improvements in algorithmic efficiency for network flow problems," J. ACM, vol. 19, pp. 248-264. Elias, P., Feinstein, A. and Shannon, C. E. (1956), "A note on the maximum flow through a network," IRE Trans. Inform. Theory, vol. IT-2, pp. 117-119. Even, S. and Tarjan, R. (1975), "Network flow and testing graph connectivity," SIAM J. Computing, vol. 4, pp. 507-518. Ford, L. R. Jr and Fulkerson, D. R. (1956), "Maximal flow through a network," Can. J. Math., vol. 8, pp. 399-404. Ford, L. R. Jr and Fulkerson, D. R. (1957), "A simple algorithm for finding maximal network flows and an application to the Hitchcock problem," Can. J. Math., vol. 9, pp. 210-218. Ford, L. R. Jr and Fulkerson, D. R. (1962), Flows in Networks, Princeton, N.J.: Princeton University Press. Gabow, H. N. (1985), "Scaling algorithms for network problems," / . Comput. Sci., vol. 31, pp. 148-168. Galil, Z. (1978), "A new algorithm for the maximal flow problem," Proc. 19th IEEE Symp. on the Foundations of Computer Sci., October. Michigan: Ann Arbor, pp. 231-245. Galil, Z. (1980), "An 0(V 5 / 3 £ 2 / 3 ) algorithm for the maximal flow problem," Acta Inf., vol, 14, pp. 221-242. Galil, Z. and Naamad, A. (1979), "Network flow and generalized path compression," Proc. 11th ACM Symp. on Theory of Computing, Atlanta, Georgia, pp. 13-26. Galil, Z. and Naamad, A. (1980), "An 0(EV log2 V) algorithm for the maximal flow problem," / . Comput. System Sci., vol. 21, pp. 203-217. Goldberg, A. V. (1985), "A new max-flow algorithm," Tech. Rept MIT/LCS/TM291, Laboratory for Computer Science, Massachusetts Institute of Technology, Cambridge, Mass. Goldberg, A. V. and Tarjan, R. E. (1986), "A new approach to the maximum flow problem," Proc. 18th ACM Symp. on Theory of Computing, New York, pp. 136-146. Goldberg, A. V. and Tarjan, R. E. (1988), "A new approach to the maximum-flow problem," / . ACM, vol. 35, pp. 921-940. Gusfield, D., Martel, C. and Fernandez-Baca, D. (1987), "Fast algorithms for bipartite network flow," SIAM J. Computing, vol. 16, pp. 237-251. Hassin, R. (1981), "Maximum flow in (s, <)-planar networks," Inf. Process. Lett., vol. 13, p. 107. Hassin, R. and Johnson, D. B. (1985), "An 0(n log2w) algorithm for maximum flow in undirected planar networks," SIAM J. Computing, vol. 14, pp. 612-624. Hu, T. C. (1982), Combinatorial Algorithms, Reading, Mass.: Addison-Wesley. Itai, A. and Shiloach, Y. (1979), "Maximum flow in planar networks," SIAM J. Computing, vol. 8, pp. 135-150.
238
MAXIMUM FLOWS IN NETWORKS
Janiga, L. and Koubek, V. (1985), "A note on finding minimum cuts in directed planar networks by parallel computation," Inf. Process. Lett., vol. 21, pp. 75-78. Johnson, D. B. (1987), "Parallel algorithms for minimum cuts and maximum flows in planar networks," / . ACM, vol. 34, pp. 950-967. Johnson, D. B. and Venkatesan, S. (1982), "Using divide and conquer to find flows in directed planar networks on 0(n 3 ' 2 log n) time," Proc. 20th Annual Allerton Conf. on Communication, Control, and Computing, Urbana-Champaign, 111., October, pp. 899-905. Johnson, E. L. (1966), "Networks and basic solutions," Operations Res., vol. 14, pp. 619-623. Karzanov, A. V. (1974), "Determining the maximal flow in a network by the method of preflows," Soviet Math. Dokl., vol. 15, pp. 434-437. Kinariwala, B. and Rao, A. G. (1977), "Flow switching approach to the maximum flow problem: I," J. ACM, vol. 24, pp. 630-645. Lin, P. M. and Leon, B. J. (1974), "Improving the efficiency of labeling algorithms for maximum flow in networks," Proc. IEEE Int. Symp. on Circuits and Systems, San Francisco, Calif., April, pp. 162-166. Malhotra, V. M., Pramodh-Kumar, M. and Maheshwari, S. N. (1978), "An 0(V3) algorithm for finding maximum flows in networks," Inf. Process. Lett., vol. 7, pp. 277-278. Picard, J. C. and Ratliff, H. D. (1975), "Minimum cuts and related problems," Networks, vol. 5, pp. 357-370. Queyranne, M. (1980), "Theoretical efficiency of the algorithm 'capacity' for the maximum flow problem," Math. Oper. Res., vol. 5, pp. 258-266. Reif, J. H. (1983), "Minimum s-t cut of a planar undirected network in 0 ( n l o g 2 ( n ) ) t i m e , " S M M / . Computing, vol. 12, pp. 71-81. Shiloach, Y. (1978), "An 0 ( n / l o g 2 / ) maximum flow algorithm," Tech. Rept STAN-CS-78-802, Computer Science Dept, Stanford Univ., Stanford, Calif. Shiloach, Y. and Vishkin, U. (1982), "An 0 ( n 2 l o g n ) parallel max-flow algorithm," J. Algorithms, vol. 3, pp. 128-146. Sleator, D. D. (1980), "An O ( n m l o g n ) algorithm for maximum network flow," Tech. Rept STAN-CS-80-831, Computer Science Dept, Stanford Univ., Stanford, Calif. Sleator, D. D. and Tarjan, R. E. (1983), "A data structure for dynamic trees," J. Comput. System Sci., vol. 26, pp. 362-391. Srinivasan, V. and Thompson, G. L. (1972), "Accelerated algorithms for labeling and relabeling trees, with applications to distribution problems," / . ACM, vol. 19, pp. 712-726. Tarjan, R. E. (1983), Data Structures and Network Algorithms, Philadelphia, Penn.: Society for Industrial and Applied Mathematics. Tarjan, R. E. (1984), "A simple version of Karzanov's blocking flow algorithm," Operations Res. Lett., vol. 2, pp. 265-268. Wilf, H. S. (1986), Algorithms and Complexity, Englewood Cliffs, N.J.: PrenticeHall.
REFERENCES
239
Zadeh, N. (1972), "Theoretical efficiency of the Edmonds-Karp algorithm for computational maximal flows," J. ACM, vol. 19, pp. 184-192. Zadeh, N. (1973a), "More pathological examples for network flow problems," Math. Programming, vol. 5, pp. 217-224. Zadeh, N. (19736), "A bad network problem for the simplex method and other minimum cost flow algorithms," Math. Programming, vol. 5, pp. 255-266.
4 MINIMUM TREES AND COMMUNICATION NETS
In the preceding chapter, we considered the problem of determining the maximum flow from the source to the sink in a net G{V, E, c,f) with node set V, arc set E, and capacity function c and flow function / both from E to the nonnegative reals. In the present chapter, instead of focusing on the value of a maximum flow from one specified node to another, we are primarily concerned with the problem of finding the maximum flows between all pairs of nodes when each of these flows is to be sent through the net G(V, E, c,f) separately and the corresponding synthesis problem of constructing a net to satisfy all the flow requirements individually. Such a system, known as a communication net, occurs naturally in practice. For example, the nodes of a net may represent communication centers that can communicate to each other through the communication channels of limited capacity denoted by weighted arcs. The arc capacity then represents the maximum amount of information that can be transferred through the arc. In reality, all the centers are communicating simultaneously, and the resulting maximum flow problem is known as the simultaneous maximum flow problem. To simplify our study here, we shall concentrate on one pair of nodes at a time. In other words, at any given time, only one pair of nodes serves as the source and the sink while all other nodes serve as intermediate nodes. Even with this simplification, many questions arise. Does one have to solve the maximum flow problem for each of the (") pairs of nodes in an rc-node communication net or will something simpler suffice? What are the necessary and sufficient conditions for a given set of real nonnegative numbers to represent maximum flow values between pairs of nodes in some communication net? If the flow requirement between each pair of nodes is 240
4.1 FORESTS, SUBTREES AND TREES
241
specified, we certainly can construct a communication net, whose maximum flow value between each pair of nodes exceeds the flow requirement. This can easily be achieved by assigning sufficiently large arc capacities between each pair of nodes. The problem is then to synthesize a communication net that meets specified lower bounds on all maximum flow values at a minimum total arc capacity. In this chapter, we shall answer these and other related questions. However, before we do this, we need to introduce the notions of forest, subtree and tree of a graph that will be used in the remainder of this chapter.
4.1
FORESTS, SUBTREES AND TREES
The tree is perhaps one of the most important subgraphs in graph theory insofar as engineering applications are concerned. Many of the fundamental relations such as the number of independent Kirchhoff's equations in electrical network theory, the formulation of the state equation, the scheduling and distributing problems, and a variety of other applications can all be stated in terms of the single concept of a tree. Since this concept is equally valid for both directed graphs and undirected graphs, in this section we shall only deal with the undirected graph.
DEFINITION 4.1 Tree. A spanning subgraph of a graph is said to be a tree if and only if it is connected and contains no circuits. An edge of a tree is called a branch. The definition differs slighly from the conventional mathematical usage in that the term "spanning" is usually omitted. The alternative is to use the term spanning tree for the concept we need. However, in most practical applications, the terminology is in accordance with Definition 4.1. As an illustration, consider the graph G of Fig. 4.1, all the trees of which are shown in Fig. 4.2.
Fig. 4.1. A graph used to illustrate various subgraphs.
242
MINIMUM TREES AND COMMUNICATION NETS
-0
2
0
Q
2
Q
Q
Q
e-b
e-s
0-
-O
6(b)
-o
6
6
(c)
O
(d)
Q
o
a
Fig. 4.2. Trees of the graph of Fig. 4.1.
DEFINITION 4.2 Cotree. The complement of a tree in a graph is called a cotree. An edge in a cotree is called a chord or fi/ifc. For an rc-node, fr-edge connected graph G, a tree contains n — \ branches and a cotree contains b — n + 1 chords. Since there is a unique path connected between any two nodes in a tree, the addition of a chord to the tree produces a unique circuit in the resulting graph. Thus, each chord in a cotree defines a circuit with respect to the chosen tree in the graph in a unique way. These circuits are referred to as the fundamental circuits or f-circuits for short. For the graph of Fig. 4.1, the cotrees associated with the trees of Fig. 4.2 are shown in Fig. 4.3. The f-circuits formed by the chords e, and e 5 with respect to the tree t = e2e3e4 of Fig. 4.2(a) are given by eAe2ej,eA and e3e4e5, respectively, and are depicted in Fig. 4.4.
O
o
o
O
O-
0
0
O
6
6
O
e2
-O
e3
o-
e4
(e)
-O
o
(0 (g) Fig. 4.3. Cotrees of the graph of Fig. 4.1.
e4 (h)
O
4.1 FORESTS, SUBTREES AND TREES
(a)
r
*2
(b)
O-
243
7?
y\
«3
-o
«^4
o
Fig. 4.4. The fundamental circuits in the graph of Fig. 4.1 with respect to the tree t=
e2e3e4.
DEFINITION 4.3 Forest. A spanning subgraph of a graph is said to be a forest if it does not contain any circuits. One or many of its components may each consist of an isolated node.
DEFINITION 4.4 Subtree. A component of a forest of a graph is called a subtree. The subgraphs of Fig. 4.5 are some examples of forests of the graph of Fig. 4.1. The forests in Fig. 4.5(a) and (b) each contain two components, whereas the forest in (c) contains three components. Each component of the forests of Fig. 4.5 is a subtree. Thus, an isolated node may be considered as a subtree. As simple consequences of the definition, trees can be characterized in many other ways, and we shall in the future make use of these equivalences given in the following theorem.
(b)
9
9 e
3
o
o
Fig. 4.5. Forests of the graph of Fig. 4.1. THEOREM 4.1 An M-node graph G is a tree if and only if any one of the following properties is true: (1) G is connected and does not contain any circuits, (2) G has n — \ edges and does not contain any circuits,
244
MINIMUM TREES AND COMMUNICATION NETS
(3) (4) (5) (6)
G is connected and has n — 1 edges, G is connected and is of zero nullity, G is connected but loses this property if any edge is removed, there exists a unique path between any two of its nodes.
As a consequence, a subgraph can be made part of a tree if and only if it contains no circuits. Likewise, a subgraph can be made part of a cotree if and only if it contains no cuts of the graph. Then what are the necessary and sufficient conditions for a subgraph to be part of a tree and another subgraph to be part of the corresponding cotree? The characterization of this problem is given below.
THEOREM 4.2 Let g! and g2 be two edge-disjoint subgraphs of a connected graph G. Let tx be a tree of G containing g,, and let t2 be a cotree of G with respect to the tree t2 and containing g 2 . Then there exists a tree t for which g t is a subgraph of t and g2 is a subgraph of the cotree t with respect to t. Proof. Let G* be the graph obtained from G by removing all the edges of g2. Because the tree t2 is contained in G*, G* is connected and contains all the nodes of G. Since gx and g2 are edge-disjoint, gi is also contained in G*. Hence, the subgraph g l 5 being part of tl7 is circuitless, and can be made part of a tree of G*. Let this tree be t. Then t is the desired tree of G. Q.E.D. A different version of the theorem is the following.
COROLLARY 4.1 Let gi and g2 be two edge-disjoint subgraphs of a connected graph G. Then there exists a tree t of G for which g] is a subgraph of t and g2 is a subgraph of the cotree t with respect to t if, and only if, g1 contains no circuits and g2 contains no cuts of G.
DEFINITION 4.5 Distance between Two Trees. The distance between two trees of a graph is the number of edges contained in one but not in the other. For example, consider the trees tx — e2e3e4, t2 = eie 3 e 4 and t3 = e2e3e5 of Fig. 4.2. The trees tx and t2 are of distance 1 because ft contains only one
4.1
FORESTS, SUBTREES AND TREES
245
edge e2 that is not contained in t2, or t2 contains only one edge ex that is not contained in tl. Likewise, tl and t3 are of distance 1 but t2 and t3 are of distance 2. We next introduce a useful operation called the elementary tree transformation. DEFINITION 4.6 Elementary Tree Transformation. Let t be a tree of a graph G and let e, be an edge of G but not in t. Then the operation
e^t-e2
(4.1)
= t*
is called an elementary tree transformation \it* is a tree of G, where e2 is an edge of t. The following result, originally due to Whitney (1935), is stated as a theorem. THEOREM 4.3 Every tree of a connected graph can be obtained from any other one by a finite sequence of elementary tree transformations. Proof. Let t1 and t2 be any two trees of a connected graph G. If tl ^t2, there exists a branch e2 in t2 but not in t1. Since not all the edges of the f-circuit L in ^ U e2 defined by the chord e2 of ^ can be in t2, there is a branch e, of tx in L but not in t2. Consider the tree t* = e2 U f, - e,, which is closer to t2 than tx. Thus, if t* ¥=t2, the process may be repeated. Since t2 contains a finite number of edges, we will eventually arrive at t2 by a finite sequence of elementary tree transformations. Q.E.D. We illustrate the above results by the following example. Example 4.1 Two of the trees of the graph of Fig. 4.1 are shown in Fig. 4.6 as ti — ele3e4, (a)
O
Q
e4
(4.2)
h = e2e3e5 (b) o
^
-O 6 Fig. 4.6. Two trees of the graph of Fig. 4.1: (a) t,; (b) t2
246
MINIMUM TREES AND COMMUNICATION NETS
(a)
Q
Q
(b)
-6
o — ——o e-s
e3
«3
6
(c)
-Q
o-
«4
o—
o
«4
O
Fig. 4.7. An elementary tree transformation converting tx to t*\ (a) t,; (b) (,Uc 2 ; (c) /•.
We show that f2 can be obtained from tx by two elementary tree transformations. Edge e2 is in t2 but not in ft. The elementary tree transformation e 2 Ut1 - ^ = e2e3e4
(4.3)
results in a tree t* = e2e3e4 of G, which is of distance 1 to t2, whereas tx is of distance 2 to t2. Thus, t* is closer to t2 than ^ . Now observe that es is an edge of t2 not contained in t*. The second elementary tree transformation e,Uf*
CoC-ies
(4.4)
yields the desired tree t2- These operations are depicted in Figs. 4.7 and 4.8. (c)
(a) —U
o—
e3
o—
eA
—O
Fig. 4.8. An elementary tree transformation converting t* to r2: (a) t*; (b) <* U e5; (c) t2.
4.2
MINIMUM AND MAXIMUM TREES
An undirected net is a weighted undirected graph with node set V and edge set E. Each edge (i, j) e E has associated with it a real number l(i, j) called the length of the edge (/,/), as previously defined in Section 2.1. The function / from the edge set E to the reals is the length function. Edges not in E are considered to be edges of infinite length in the undirected net. Therefore, an undirected net is a triplet and can be compactly written as G(V, E, I). We remark that edge length can be positive, negative or zero,
4.2 MINIMUM AND MAXIMUM TREES
247
and that since G(V, E, I) is undirected, (i, j) = (j, i) and the length function is symmetric with /(/, /) = /(/, i) for all (/, ;') e E. The length of a tree t of G(V, E, I) is the sum of the lengths of its branches:
1(0= 2 '(',/)
(4-5)
(U)e'
Among all the trees t of G(V, E, / ) , there is a "longest" one called a maximum tree of G: ' ( U = max l{t)
(4.6)
Likewise, among all the trees t of G, a "shortest" one is referred to as a minimum tree: l(tmin) = min l(t)
(4.7)
t
In studying communication nets, maximum trees of G are of considerable use. We shall therefore state and prove a maximality criterion for a maximum tree, and then describe several simple algorithms that have been devised for constructing maximum or minimum trees.
THEOREM 4.4 A tree of an undirected net G(V, E, I) is maximum if and only if the inequality l(xlt xk)=^min[l(xu
x2), l(x2,x3),
. . . , /(**_,, xk)\
(4.8)
holds for each chord (xuxk) with respect to the tree, where (*i< x2)(x2, x3). . . (xk_u xk) is the unique path between the nodes JC, and xk in the tree. Proof. Necessity. Let t be a maximum tree of G. If (4.8) is not satisfied, then there is a branch (xh x, + 1 ), 1 = i = k — 1, in the unique tree path such that l(xuxk)>l(xitxi+l)
(4.9)
Then the elementary tree transformation (xuxk)Ut-(x„xi+l)
= t*
(4.10)
248
MINIMUM TREES AND COMMUNICATION NETS
would result in a tree t* which is longer than t, contradicting the assumption that t is a maximum tree. Thus, the inequality (4.8) holds for every chord (xlt xk) with respect to the tree t. Sufficiency. We first show that if tl and t2 are two trees of G, each satisfying the inequality (4.8), then ^ and t2 are of the same length. To this end, we divide the edges of tx and t2 into three classes: Edges belonging to tx only are called the tx-edges, edges belonging to t2 only are called the t2-edges, and those belonging to both tx and t2 are called the common edges. Suppose that ft and t2 are distinct. Let (xlt xk) be a f2-edge and consider the f-circuit (*!, xk)(xu
x2)(x2, x3). . . (**_!, xk)
(4.11)
formed by the chord (xt,xk) and the unique tree path Plk{tx) — (*!, x2)(x2, x3). . . (jtfc_i, xk) between nodes xx and xk in tly not all of which can be the common edges; for, otherwise, (4.11) will be a circuit of t2, not possible for a tree. Thus, there are fi-edges in P\k{t\). Appealing to (4.8) shows that each (xa, xa+1) of these fledges has length of at least /(*,, xk). We next demonstrate that at least one of them is of length l(xl, xk). Suppose that each (xa, xa+l) of these ^-edges had length longer than l(x1, xk). Then the f-circuit formed by the chord (xa, Jt a+1 ) and the unique tree path Pa(a+\)(t2) between the nodes xa and xa+1 in t2 cannot contain the edge (x1,xk), since t2 satisfies the inequality (4.8). It follows that if we replace each (xa, xa+1) of these f r edges in (4.11) by its unique tree path Pa(a+1)(t2) in t2, we obtain a subgraph of t2 containing a circuit, a contradiction. Therefore, at least one of these fledges in (4.11) has length equal to l(xlt xk), as asserted. Let {xa, xa+1) be such a tredge with l(xa, xa+1) = l(xx, xk). Then the elementary tree transformation (xu xk) Utt-
(xa, xa+1) = t*
(4.12)
would yield a tree t* that has the same length as tx. Furthermore, the distance between t* and t2 is one shorter than that between tx and t2, and the hypothesis (4.8) is again satisfied for t*, as is readily verified. Hence, we can repeat the argument and show that tx can be transformed to t2 by a finite sequence of elementary tree transformations, having a succession of equal length trees, the last of which is t2. This shows that if tx and t2 satisfy (4.8), then fx and t2 have the same length. In particular, we can let t2 be a maximum tree, because every maximum tree satisfies the condition (4.8). This implies that every tree fx satisfying the inequality (4.8) must be a maximum tree, and the theorem follows. Q.E.D. We illustrate this result by the following example.
4.2 MINIMUM AND MAXIMUM TREES
249
Fig. 4.9. An undirected net with edge lengths given by the numbers adjacent to the edges.
Example 4.2 Consider the undirected net G(V, E, I) of Fig. 4.9, where the nodes are labeled by the integers 1, 2, 3, 4, 5, 6 and the edge lengths are given by the numbers adjacent to the edges. It is claimed that the tree shown in Fig. 4.10 is a maximum tree tmm. To verify this assertion by Theorem 4.4, we apply condition (4.8) to each chord of the cotree: Lax = (1,2)(1, 3)(1, 5)(1, 6)(2, 3)(2, 4)(3, 4)(3,6)(4, 5)(5, 6) (4.13) For the chord (1,2), the inequality (4.8) becomes 1(1, 2) = 1 Si min [1(1, 4), 1(4, 6), 1(6, 2)] = min [12,13,15] = 12
Fig. 4.10. A maximum tree of the undirected net of Fig. 4.9.
(4.14)
250
MINIMUM TREES AND COMMUNICATION NETS
For the chord (1, 3), we have the inequality 1(1, 3) = 9 ^ min [/(3, 5), /(5, 2), 1(2, 6), 1(6, 4), 1(4, 1)] = min[14,11,15,13,12] = 11
(4.15)
Likewise, the inequalities for the remainder of the chords are as follows: 1(1, 5) = 8 ^ min [12,13,15,11] = 11
(4.16a)
1(1, 6) = 7 ^ min [12,13] = 12
(4.166)
1(2, 3) = 2 ^ min [14,11] = 11
(4.16c)
/(2, 4) = 4 ^ min [13, 15] = 13
(4.16a")
1(3, 4) = 3 ^ min [13, 15, 11, 14] = 11
(4.16e)
/(3, 6) = 1 0 ^ min [15, 11, 14] = 11
(4-16/)
1(4, 5) = 5 ^ min [11, 15, 13] = 11
(4.16g)
/(5, 6) = 6 ^ min [15, 11] = 11
(4.16ft)
Thus, condition (4.8) is satisfied for each chord, and the tree fmax of Fig. 4.10 is a maximum tree. It is important to note that since the edge lengths are allowed to be negative, when we can solve the maximum tree problem, we can also solve the minimum tree problem. All we have to do is to multiply each edge length by —1 and solve the corresponding maximum tree problem. Thus, we will only state the algorithms for solving the minimum tree problem, leaving the maximum tree problem as obvious, or vice versa. We remark that the shortest tree found in Section 2.2 by the shortest path algorithms is different from the minimum tree that we shall construct in this chapter. Consider, for example, the undirected net G(V, E, I) of Fig. 4.11(a). The tree formed by the shortest paths from node 1 to nodes 2, 3, and 4 is presented in Fig. 4.11(b), whereas the minimum tree of G is shown in Fig. 4.11(c). The former has total length 10, and the latter has length 7. In addition, if all edge lengths are positive then a minimum tree will be a minimum spanning subgraph of G. In this case, the problem of finding a minimum tree is the (b)
(a)
1
-02
1Q
40 '"
1
-03 ~-
(c)
02
10
46"~
1
03
Fig. 4.11. A net (a) containing a tree formed by the shortest paths (b) and a minimum tree (c).
4.2 MINIMUM AND MAXIMUM TREES
251
Fig. 4.12. A net (a) containing a minimum tree (b) and a minimum spanning subgraph (c). same as that of finding a minimum connecting subgraph. These are not generally valid if G contains negative edge lengths. In the net G(V, E, I) of Fig. 4.12(a), a minimum tree fmin is shown in (b). This minimum tree is not a minimum spanning subgraph of G because the subgraph of Fig. 4.12(c) is shorter than the minimum tree. The minimum tree tmin is of length —6, whereas the minimum spanning subgraph is of length —9. Example 4.3 The undirected net G(V, E, I) of Fig. 4.13 contains edges of negative lengths, a minimum tree of which is shown in Fig. 4.14. To verify that the tree tmin of Fig. 4.14 is indeed minimum, we multiply each edge length of Figs 4.13 and 4.14 by —1 and apply Theorem 4.4 for a maximum tree. This is equivalent to reversing the inequality sign in (4.8), changing min operation to max operation and then applying the resulting condition to the original net G and the minimum tree tmin of Figs. 4.13 and 4.14. The cotree with respect to tmin is given by fmin = (1, 3)(2, 5)(3, 4)(4, 5)(4, 6)(5,7)
(4.17)
For the chord (4, 5), we have the inequality 1(4, 5) = 8 ^ max [/(5, 6), 1(6, 3), /(3, 2), 1(2, 4)] = max[-5, - 6 , 1 , - 2 ] = 1
Fig. 4.13. An undirected net containing edges of negative lengths.
(4.18)
252
MINIMUM TREES AND COMMUNICATION NETS
Fig. 4.14. A minimum tree of the undirected net of Fig. 4.13.
Likewise, the inequalities corresponding to other chords are obtained as follows: 1(1, 3) = 6 ^ m a x [ 4 , 1] = 4
(4.19a)
1(2, 5) = 5 ^ max [ - 5 , - 6 , 1] = 1
(4.1%)
1(3, 4) = 7 ^ m a x [ l , - 2 ] = 1
(4.19c)
1(4, 6) = 4 ^ max [-6, 1, - 2 ] = 1
(4.19d)
/(5, 7) = 5 ^ max [4, - 5 ] = 4
(4.19e)
Since all the conditions are satisfied, fmin of Fig. 4.14 is indeed a minimum tree of G. In fact, it is the only minimum tree of G.
4.3
MINIMUM AND MAXIMUM TREE ALGORITHMS
In this section, we study the minimum tree and maximum tree enumeration algorithms. Since the algorithms for finding a minimum tree in an undirected net G(V, E, I) are equally valid for finding a maximum tree, mutatis mutandis, in the following we shall only focus our attention on the development of algorithms for the minimum tree problem. We use a simple incremental technique known as the greedy method, which builds up a minimum tree edge by edge by including appropriate short edges and excluding appropriate long edges until a minimum tree is constructed. The method, due to Tarjan (1981), is sufficiently general to include all known efficient algorithms for the minimum tree problem. Given an undirected net G(V, E, I), an edge coloring process is described as follows: Initially all edges of G are uncolored. We color one edge at a time either blue or red in accordance with the following rules: Blue rule. Select a cut that is devoid of any blue edges. Among the uncolored edges in the cut, select one of minimum length and color it blue.
4.3 MINIMUM AND MAXIMUM TREE ALGORITHMS
253
Red rule. Select a circuit that is devoid of any red edges. Among the uncolored edges on the circuit, select one of maximum length and color it red. The method is nondeterministic in that we are free to apply either rule at any time and in arbitrary order until all edges of G are colored. As will be shown, the greedy method will color all the edges of G, and when all the edges are colored, the blue ones form a minimum tree. Thus, the blue color signifies the acceptance of an edge, and the red color means rejection. DEFINITION 4.7 Color Invariant. In applying the blue rule and the red rule in coloring the edges of an undirected net, if at every stage of the process there is a minimum tree containing all of the blue edges and none of the red ones, then the process is said to maintain color invariant. The significance of the edge-coloring process is contained in the following theorem. THEOREM 4.5 The greedy method colors all the edges of a connected undirected net, and maintains the color invariant. Proof. Let G{V, E, I) be a connected undirected net. Initially, none of the edges of G is colored, and since G is connected there exists at least one minimum tree satisfying the color invariant property. Suppose that the color invariant is true before the application of the blue rule. We show that it remains to be true after the application of the blue rule. Let (X, X) = (X, X), X = V - X, be the cut to which the blue rule is applied to color the edge (x, y)e (X, X), and let t be a minimum tree satisfying the color invariant before the edge (x, y) is colored. If (x, y) is in t, then t satisfies the color invariant after (x, y) is colored. Assume that (x, y) is not in t and consider the f-circuit formed by the chord (JC, y) and the unique path connected between the nodes x and y in t. Since a cut and a circuit have an even number of edges in common, let (x, y) and (u, v) be two of these edges that belong to both the f-circuit and the cut (X, X). By construction, none of the edges of t is red, and by the blue rule the edge (u, v) is uncolored with /(w, t>) = /(*, y). Applying the elementary tree transformation (x,y)Ut-(u,v)
= t*
(4.20)
yields a minimum tree t* of G that maintains the color invariant after the edge (x, y) is colored.
254
MINIMUM TREES AND COMMUNICATION NETS
We next show that the red rule also maintains the color invariant. To this end, let L be the circuit to which the red rule is applied to color the edge (x, y) e L, and let t be a minimum tree satisfying the color invariant before the edge (x, y) is colored. If (x, y) is not in t, then t satisfies the color invariant after (x, y) is colored red. Thus, we assume that (JC, y) is in t. Then the removal of (x, y) from t partitions the node set V of G into subsets X and X = V — X. Since the cut (X, X) = (X, X) must contain an even number of edges in common with the circuit L, let (x, y) and (u, v) be two of these edges that belong to both the circuit L and the cut (X, X). By construction, none of the edges of t is red, and by the red rule the edge (u, v) is uncolored with l(u, v)^l(x, y). Applying the elementary tree transformation (u,v)Ut-(x,y)
= t*
(4.21)
produces a minimum tree t * of G that maintains the color invariant after the edge (x, y) is colored. Finally, we must show that the process will not terminate prematurely, and all the edges of G will be colored. Suppose otherwise that some of the edges are not colored and neither the blue rule nor the red rule applies. By color invariant, there is a minimum tree f in G containing all the blue edges and none of the red ones. If we remove all the uncolored edges from this tree t, we obtain a forest, each of whose subtrees consists of either all blue edges or an isolated node. Let (x, y) be an uncolored edge of G. If both nodes x and y are in a nontrivial subtree, the red rule applies to the circuit formed by (x, y) and the unique path of blue edges connected between the nodes x and y of the subtree. If the nodes x and y are in two different subtrees ta and tp, the blue rule applies to either of the two cuts (Xa, Xa) = (Xa, Xa) and (Xp, Xp) = (Xp, Xp), where Xa and_ Xp are the node sets of ta and tp, respectively, and Xa = V — Xa and Xp = V — Xp. Consequently, all the edges of G are guaranteed to be colored, and the process maintains the color invariant. Q.E.D. The greedy method is applicable to a wide variety of problems besides the minimum tree problem. In the following, we shall examine three well-known minimum tree algorithms that are variants of the greedy method. 4.3.1
Boruvka Algorithm
Boriivka (1926) was the first to develop a fully realized minimum tree algorithm. The same algorithm was rediscovered by Choquet (1938), Lukasziewicz, Florek, Perkal, Steinhaus and Zubrzycki (1951), and Sollin [see Berge and Ghouila-Houri (1965)]. In applying the coloring process to the edges of G(V, E, I), the blue
4.3 MINIMUM AND MAXIMUM TREE ALGORITHMS
255
edges always form subtrees of a forest. We shall consider the forest consisting of the blue subtrees and a number of trivial subtrees of isolated nodes. These trivial subtrees of isolated nodes are considered trivial blue subtrees of the forest. Thus, at each stage during the coloring process, there is a forest composed only of the blue subtrees, trivial blue subtrees included. The Boruvka algorithm combines these blue subtrees two at a time until finally only one blue tree, a minimum tree, remains. Boruvka Algorithm Step 1. Let / 0 be the initial blue forest composed of n blue subtrees, each of which is an isolated node, where n is the number of nodes in G. Set i=0. Step 2. For each blue subtree ta o f / , find a minimum-length edge (xa, ya) incident to ta, where xa is in ta but ya is not. Color all these selected edges (xa, ya) blue. Step 3. Let fi+i=fiU
U (xa, ya)
(4.22)
Step 4. Set i = i + 1. Step 5. If £ is a tree, stop. Otherwise, return to Step 2. The Boruvka algorithm starts initially with n blue subtrees, each of which is an isolated node and contains no edges, and then applies the blue rule to build up a minimum tree. Since every edge has two endpoints, an edge may be selected twice in Step 2, once for each endpoint. Such an edge, however, is colored only once. The algorithm is guaranteed to work correctly only if all the edge lengths are distinct, because in this case the edges can be ordered so that the blue rule will color them one at a time. In the case where the edge lengths are nondistinct, we can distinguish them by assigning numbers to the edges and ordering edges lexicographically by length and number. The Boruvka algorithm can be implemented in several ways and is well suited for parallel computation. We illustrate the algorithm by the following examples. Example 4.4 We apply the Boruvka algorithm to find a minimum tree for the undirected net G(V, E, I) of Fig. 4.15. We follow the above five steps of the algorithm. Step 1. /o is a forest of G consisting of the isolated nodes 1, 2, 3, 4, 5, 6, 7 and set i = 0.
256
MINIMUM TREES AND COMMUNICATION NETS
Fig. 4.15. An undirected net used to illustrate the Boruvka algorithm. Step 2. For node 1, the minimum-length edge incident at this node is (1,2) with /(l, 2) = —4. For node 2, the minimum-length edge incident at this node is also (1,2) = (2,1) with 1(1, 2) = 1(2, 1) = —4. The minimum-length edges incident at nodes 3, 4, 5, 6 and 7 are (3,6), (2,4), (5,7), (3,6) and (5,7), respectively, with 1(3, 6) = - 6 , 1(2, 4) = - 2 and /(5, 7) = - 5 . Color the edges (1, 2), (2, 4), (3,6) and (5, 7) blue. Step 3. Let the resulting forest be /i = / o U ( l , 2)(2, 4)(3, 6)(5, 7) = (1, 2)(2, 4)(3, 6)(5, 7)
(4.23)
as shown in Fig. 4.16. Step 4. Set i = 1. Step 5. Return to Step 2. Step 2. For the blue subtree (1,2)(2,4), the minimum-length edge incident to this subtree is (2,3) with 1(2, 3) = 1. For the blue subtree (3,6), the minimum-length edge incident to this subtree is also (2, 3). Finally, the minimum-length edge incident to the blue subtree (5, 7) is (5, 6) with /(5, 6) = 2. Color the edges (2, 3) and (5,6) blue.
©
"
©
Fig. 4.16. A forest generated by the Boruvka algorithm.
4.3 MINIMUM AND MAXIMUM TREE ALGORITHMS
257
Fig. 4.17. A minimum tree of the undirected net of Fig. 4.15 generated by the Boruvka algorithm. Step 3. Let the resulting forest be /2 = / 1 U ( 2 , 3 ) ( 5 , 6 ) = (1, 2)(2, 3)(2, 4)(3, 6)(5, 6)(5, 7)
(4.24)
as shown in Fig. 4.17. Step 4. Set i = 2. Step 5. Since f2 is a tree of G, stop. The desired minimum tree is shown in Fig. 4.17 with total length - 1 4 . Example 4.5 Consider the net G(V, E, I) of Fig. 4.18, where the edge lengths are not all distinct. We demonstrate that if the edges of the same length are not properly distinguished, the Boruvka algorithm may result in an incorrect solution. Therefore, if not all the edge lengths are distinct, care should be taken by first ordering the edges of the same length before the algorithm is applied.
Fig. 4.18. An undirected net in which the edge lengths are not all distinct.
258
MINIMUM TREES AND COMMUNICATION NETS
Fig. 4.19. A subgraph generated by the Boruvka algorithm without prior ordering of the edges of the same length.
Suppose that we apply the algorithm directly to the net G of Fig. 4.18 without prior ordering of the edges of the same length. Initially, the forest /o consists of seven isolated nodes. In Step 2 the minimum-length edges incident to nodes 1, 2, 3, 4, 5, 6, and 7 may be selected as (1,2), (2,3), (3,1), (4,2), (5,6), (6,3) and (6,7), respectively. The corresponding subgraph^ of these edges is shown in Fig. 4.19. Clearly, it is not a tree. Alternatively, the minimum-length edges incident to nodes 1, 2, 3, 4, 5, 6 and 7 may be chosen to be (1, 2), (1, 2), (3, 6), (2, 4), (5, 6), (3, 6) and (6, 7), respectively. The corresponding forest /i of these edges is presented in Fig. 4.20. Observe now that the minimum-length edge incident to the blue subtree (1, 2)(2, 4) of Fig. 4.20 may be either (2, 3) or (1, 3). Likewise, the minimum-length edge incident to the blue subtree (3, 6)(5, 6)(6, 7) may also be (2, 3) or (1, 3). If we pick (2, 3) for one and (1, 3) for the other, the resulting subgraph f2 is shown in Fig. 4.19 and is not a tree. To avoid this difficulty, we shall order the edges of G lexicographically
Fig. 4.20. A forest generated by the Boruvka algorithm without prior ordering of the edges of the same length.
4.3 MINIMUM AND MAXIMUM TREE ALGORITHMS
259
Fig. 4.21. A minimum tree of the undirected net of Fig. 4.18 generated by the Boriivka algorithm.
by length and by assigning numbers to the edges, as follows: (3, 6), (5, 6), (1, 2), (1, 3), (2, 3), (2,4), (4, 6), (6,7), (2, 5), (5, 7), (3,4), (4, 5)
(4.25)
Using this in Step 2, the minimum-length edges incident to nodes 1, 2, 3, 4, 5, 6 and 7 can now be uniquely selected to be (1,2), (1,2), (1,3), (2,4), (5,6), (3,6) and (6,7), respectively. The corresponding subgraph fi formed by these edges is a desired minimum tree as shown in Fig. 4.21. 4.3.2
Kruskal Algorithm
The algorithm was first suggested by Kruskal (1956), and is a variant of the greedy method. To implement the algorithm, we must first order the edges of G(V, E, I) in nondecreasing order by length, and represent the blue subtrees of the forest so that we can test whether two nodes are in the same blue subtree. The Kruskal algorithm consists of applying the following steps to the edges already arranged in nondecreasing order by length. Kruskal Algorithm Step 1. Select a shortest edge of G(V, E, I) and color it blue. Set i = 0. Step 2. Among the edges not yet chosen, select a shortest edge (x, y). If nodes x and y belong to the same blue subtree, color (x, y) red; otherwise, color it blue. Step 3. Set i = i + 1. Step 4. If i = m — 1, stop, where m is the number of edges of G. Otherwise, return to Step 2. In words, it states that we begin the algorithm by selecting a shortest
260
MINIMUM TREES AND COMMUNICATION NETS
edge of G. At each successive stage, we select a shortest edge among the edges that have not yet been selected and that does not form a circuit with those edges already selected. By changing the word shortest to longest, the algorithm also finds a maximum tree of G. Alternatively, we can start with a complete graph and remove the edges one at a time. Among the edges not yet removed, we remove a longest edge that will not disconnect the graph. The total running time for the Kruskal algorithm is 0{m logn), where m is the number of edges and n is the number of nodes of G. The algorithm is best in situations where the edges are given in sorted order or can be sorted fast. We illustrate this algorithm by the following example. Example 4.6 We apply the Kruskal algorithm to find a minimum tree in the net G(V, E, I) of Fig. 4.18. First, we arrange the edges of G in nondecreasing order by edge length, as shown in (4.25). We then follow the four steps to build up a minimum tree. Step 1. Step 2. Step 3. Step 4. Step 2. Step 3. Step 4. Step 2. Step 3. Step 4. Step 2. Step 3. Step 4. Step 2. Step 3. Step 4. Step 2. Step 3. Step 4. Step 2. Step 3. Step 4. Step 2.
Select edge (3, 6) and color it blue. Set i = 0. Select edge (5, 6) and color it blue. Set i = 1. Return to Step 2. Select edge (1, 2) and color it blue. Set i = 2. Return to Step 2. Select edge (1, 3) and color it blue. Set i = 3. Return to Step 2. Select edge (2, 3) and color it red. Set i = 4. Return to Step 2. Select edge (2, 4) and color it blue. Set i = 5. Return to Step 2. Select edge (4,6) and color it red. Set i = 6. Return to Step 2. Select edge (6, 7) and color it blue. Set i = 7. Return to Step 2. Select edge (2, 5) and color it red.
4.3 MINIMUM AND MAXIMUM TREE ALGORITHMS
Step Step Step Step Step Step Step Step Step Step Step
3. 4. 2. 3. 4. 2. 3. 4. 2. 3. 4.
261
Set i = 8. Return to Step 2. Select edge (5,7) and color it red. Set i = 9. Return to Step 2. Select edge (3,4) and color it red. Set i = 10. Return to Step 2. Select edge (4,5) and color it red. Set i = 11. Stop.
After the termination of the coloring process, the final colored net is presented in Fig. 4.22, where the solid lines denote the blue edges and the broken lines the red edges.
Fig. 4.22. The final colored net of the undirected net of Fig. 4.18 generated by the Kruskal algorithm.
4.3.3
Prim Algorithm
The Prim algorithm was originally proposed by Jarnik (1930), and rediscovered by Prim (1957) and Dijkstra (1959). The procedure is commonly known as the Prim algorithm, and is a variant of the greedy method. It uses an arbitrary starting node and builds only one nontrivial blue subtree. Let s be an arbitrary starting node of an undirected connected net G(V, E, I). Let ta be the blue subtree containing s. A node y is said to border ta if y is not in ta and if there is a node x in ta such that the edge (x,y)eE. For each node y bordering ta, let (i, y) be a minimum-length edge incident to y and ta: l(i, y) = min l(x, y) rel.
(4.26)
262
MINIMUM TREES AND COMMUNICATION NETS
For our purposes, we color the edge (i, y) light blue. Thus, we associate every node bordering ta a light blue edge. These light blue edges are candidates to become blue, and they together with the blue edges form a subtree spanning ta and its bordering nodes. To proceed with the coloring process, we select a light blue edge (i, y) that is of minimum length among all the light blue edges and color it blue. This adds the edge (i, y) to the blue subtree ta and yields a new blue subtree t*a=taV(i,y)
(4.27)
We next examine each edge (y, u) incident at y. If node u is not in t*a and has no incident light blue edge, we color (y, u) light blue. If node u is not in t*a but has an incident light blue edge (x, u), x in t*a, of greater length than l{y, w), we color (x, u) red and color (y, u) light blue. The process is repeated until a minimum tree is constructed. Prim Algorithm Step 1. Pick an arbitrary node of G(V, E, I) as the initial blue subtree tQ and set i = 0. For each node y bordering t0, color a minimum-length edge incident to y and t0 with light blue. Step 2. Select a minimum-length light blue edge (x, y), x in th and color it blue. Let tt+i = tLKx, y)
(4.28)
Step 3. For each edge (y, z), z not in ti+1, if there is no light blue edge incident at z, color (y, z) light blue; and if there is an incident light blue edge (w, z) at z with l(w, z)>l(y, z), color (w, z) red and (y, z) light blue. Otherwise, no operation is required. Step 4. Set i + 1. Step 5. If i = n — 1, stop. If i < n — 1, return to Step 2. The Prim algorithm described above has a running time of 0(n2), 0(n) time per coloring phase, where n is the number of nodes of G. We illustrate this algorithm by the following example. Example 4.7 Consider the net G(V, E, I) of Fig. 4.18, which is redrawn in Fig. 4.23. We use the Prim algorithm to generate a minimum tree, as follows: Step 1. Pick node 1 as the initial blue subtree t0 and set i = 0. Edges (1, 2) and (1, 3) are colored light blue. Step 2. Select edge (1,2) and color it blue and let tx = (1, 2). Step 3. Color edges (2, 5) and (2, 4) light blue.
4.3 MINIMUM AND MAXIMUM TREE ALGORITHMS
263
Fig. 4.23. An undirected net used to illustrate the Prim algorithm. Step 4. Set i = 1. Step 5. Return to Step 2. The resulting net at the end of Step 5 is presented in Fig. 4.24, where the solid line denotes the blue edge, and the dashed lines the light blue edges. Step Step Step Step
2. 3. 4. 5.
Color edge (2,4) blue and let t2 = (1, 2)(2, 4). Color edge (4, 6) light blue. Set i = 2. Return to Step 2.
At the end of Step 5, the resulting net is shown in Fig. 4.25. Step Step Step Step
2. 3. 4. 5.
Color edge (1, 3) blue and let t3 = (1, 2)(1, 3)(2, 4). Color (4, 6) red and (3, 6) light blue. Set i = 3. Return to Step 2.
—2--^®
© ® Fig. 4.24. A colored subnet generated by the Prim algorithm at the end of the first cycle.
264
MINIMUM TREES AND COMMUNICATION NETS
®
Fig. 4.25. A colored subnet generated by the Prim algorithm at the end of the second cycle. At the end of this phase, the resulting net is shown in Fig. 4.26 with the heavy line denoting the red edge. Step Step Step Step
2. 3. 4. 5.
Color edge (3,6) blue and let t4 = (1, 2)(1, 3)(2, 4)(3, 6). Color edges (6, 5) and (6,7) light blue, and edge (2, 5) red. Set i = 4. Return to Step 2.
At the end of this phase, the resulting net is shown in Fig. 4.27. Step Step Step Step
2. 3. 4. 5.
Color edge (6,5) blue and let t5 = (1, 2)(1, 3)(2,4)(3, 6)(6, 5). No operation is required. Set i = 5. Return to Step 2.
At the end of this phase, the resulting net is presented in Fig. 4.28.
©
Fig. 4.26. A colored subnet generated by the Prim algorithm at the end of the third cycle.
4.3 MINIMUM AND MAXIMUM TREE ALGORITHMS
265
Fig. 4.27. A colored subnet generated by the Prim algorithm at the end of the fourth cycle. Step 2. Color edge (6,7) blue and let t6 = (1, 2)(1, 3)(2, 4)(3,6)(6, 5)(6,7)
(4.29)
Step 3. No operation is required. Step 4. Set i = 6. Step 5. Stop. The tree t6 of (4.29) is a desired minimum tree with total length - 6 and is indicated in Fig. 4.29 by the thin solid lines.
Fig. 4.28. A colored subnet generated by the Prim algorithm at the end of the fifth cycle.
4.3.4
General Remarks
All three algorithms presented in the foregoing use maninly the blue rule. It should be possible to find the dual algorithms using mainly the red rule, but such procedures seem to be less efficient.
266
MINIMUM TREES AND COMMUNICATION NETS
Fig. 4.29. A colored subnet of the undirected net of Fig. 4.23 generated by the Prim algorithm.
The Kruskal algorithm generates blue subtrees in an irregular fashion dictated solely by the edge lengths, and the Prim algorithm grows the blue subtree from a single root. The Boriivka algorithm, on the other hand, builds up blue subtrees uniformly throughout the net, and is therefore well suited for parallel computation. In fact, Yao (1975) proposed a Boruvkalike algorithm using the appropriate data structures, which runs in O(mloglogn) time but needs a linear-time selection algorithm [see, for example, Blum, Floyd, Pratt, Rivest and Tarjan (1973) and Schonhage, Paterson and Pippenger (1976)], and is therefore not very practical. However, a similar but more practical algorithm with O(mloglogrc) time was proposed by Cheriton and Tarjan (1976). More recently, Tarjan (1981) proposed a general blue rule algorithm using two data structures for each blue subtree. The algorithm is called the round robin algorithm. For sparse nets, the round robin algorithm is asymptotically faster than any of the other three algorithms. However, for dense nets, it is slower by a factor of O(loglogra) than the Prim algorithm. Other results on the minimum tree problem may be found in the survey paper by Maffioli (1981). 4.4
TERMINAL CAPACITY MATRIX
In this section and the remainder of the chapter, we study the maximum flows for all pairs of nodes in a communication net G(V, E, c, / ) . To simplify the problem, we assume that at any given time, only one pair of nodes serves as the source and the sink while all other nodes serve as intermediate nodes. DEFINITION 4.8 Terminal Capacity. Given a pair of nodes i and / of a communication net G(V, E, c,f), the terminal capacity T(7 from i to / is the value of the minimum i-j cut.
4.4 TERMINAL CAPACITY MATRIX
267
The concept of terminal capacity has a number of physical significances. For example, if all arc capacities are unity, the terminal capacity T/yrepresents the minimum number of arcs that must be removed to break all directed paths from i to / in G. In a communication system, the terminal capacity T,7 may actually represent the capacity available for communication from i to / at any given time when all other nodes serve as intermediate or relaying nodes. The communication capability between all pairs of nodes in G is best described by a matrix called the terminal capacity matrix.
DEFINITION 4.9 Terminal Capacity Matrix. The terminal capacity matrix T = [T,7] of an n-node communication net G(V, E, c,f) is a square matrix of order n, whose z'th row and y'th column element r,y, i¥=j, is the terminal capacity from i to ;' and whose diagonal elements T„ are defined to be infinite. We illustrate the above result by the following example. Example 4.8 We compute the terminal capacity matrix for the communication net G(V, E, c,f) of Fig. 4.30. Since G is a 5-node net, the terminal capacity matrix T is of order 5 with one row and one column corresponding to each node of the net. Consider, for example, the element T n which is the value of a minimum 1-3 cut (X, X) = ({1, 5}, {2, 3, 4}) or (X, X) = ({1, 5}, {2, 3, 4}) = (1, 2)(4, 5)(3, 5)
(4.30)
giving T13 = C(X,X)
= C({1,5},
{2,3,4})
= c(l, 2) + c(4, 5) + c(3, 5) = 2 + 2 + 1 = 5
(4.31)
Likewise, for the element r23 the corresponding minimum 2-3 cut is
Fig. 4.30. A communication net used to illustrate the terminal capacity matrix.
268
MINIMUM TREES AND COMMUNICATION NETS
found to be (Y, Y) = ({1, 2, 4, 5}, 3) = (2, 3)(3, 5)(3, 4)
(4.32)
yielding T23 = c ( y , Y ) = c ( { l , 2 , 4 , 5 } , 3 ) = c(2, 3) + c(3, 5) + c(3, 4) = 4 + 1 + 3 = 8
(4.33)
The other elements can be computed in a similar manner. The terminal capacity matrix of the net of Fig. 4.30 is obtained as 1
2
3
4
5
1
"00
5
5
5
6_
2
5
8
11
5
3
5
8
00
8
5
4
5
11
8
5 .6
5
5
00
00
5
5 00 _
So far the communication nets that we are concerned with can either be directed or undirected. A basic question arises naturally at this point: 'What are the necessary and sufficient conditions for a given matrix of real nonnegative elements with infinity along the main diagonal to be the terminal capacity matrix of a communication net?' The general characterization for such a matrix is not known. However, necessary and sufficient conditions for such a matrix to be the terminal capacity matrix of an undirected communication net are available. They provide concise and elegant answers to the question posted above. Therefore, we will focus on the undirected communication nets first, leaving the discussion on oriented or directed communication nets until later.
THEOREM 4.6 A symmetric real matrix T = [T,7] of nonnegative elements with infinity along its main diagonal is the terminal capacity matrix of an undirected communication net if and only if for all i, j and k, T„;^ min [xik, rkj]
(4.35)
Proof. Necessity. Let G(V, E, c,f) be the undirected communicaton net. Let (X, X) be a minimum i-j cut of G. Then r^ = c(X, X). If node keX,
4.4 TERMINAL CAPACITY MATRIX
269
then (X, X) is also a k-j cut and T,y = c ( Z , X ) ^ T f c y
(4.36)
and the inequality (4.35) holds. If node k eX, then (X, X) is also an i-k cut and Tu = c(X,X)^rik
(4.37)
and condition (4.35) holds. Sufficiency. Construct the n-node complete undirected graph G(V, E) and associate with each of its edges («', /) the number T,y, which is considered as the length of the edge. Let i max be a maximum tree in the resulting net G(V, E, I) with l{i,j) = xij. It follows from Theorem 4.4 that if (i, x1){xl, x2) • • • (xu-i, xu)(xu,j) is the unique path between the nodes i and j in tmax, then /(/,;') ^ min [/(*', xx), l(xu x2), . . . , l(xu_u xu), l(xu, j)]
(4.38)
or T,y ^ min [riXl,
TX%X2,
. . . , rXu_tXu, rxJ
(4.39)
Since by assumption (4.35) holds for all i, j and k e V, it follows that Tij^mmlr^^
rXlj]
= min[r t a ] , rXxX2, rX2J] ^ m i n [ T / X ] , TXlX2y TX2X3, TXzj\
^ m i n [riXl, rXlX2, . . . , TXU^XU, TXJ]
(4.40)
Combining (4.39) and (4.40) shows that Xy = min [riXl, rX]X2, . . . , rx»_w
TXJ]
(4.41)
Hence, if each branch (x, y) of fmax is now assigned the capacity c(x,y) = l(x,y)
(4.42)
and if each chord of the cotree fmax is removed from G(V, E, I), we obtain an undirected communication net tmax(V, E„ c), the terminal capacity of which is T. This completes the proof of the theorem. Q.E.D. An important consequence of the proof is that if T is realizable, it is realizable by a tree. Since an «-node tree contains n — \ branches, the
270
MINIMUM TREES AND COMMUNICATION NETS
matrix T can have at most n -1 numerically different elements. We summarize these results as a corollary. However, before we do this, we introduce the notion of flow equivalency.
DEFINITION 4.10 Flow Equivalency. Two n-node communication nets are said to be flow equivalent, or briefly, equivalent, if they have the same terminal capacity matrix. With this term, we can now state the corollary.
COROLLARY 4.2 Every n-node undirected communication net is equivalent to a tree and there are at most n — 1 numerically distinct terminal capacities. In Section 4.5 we will demonstrate that it is possible to construct an equivalent tree by solving precisely n — \ maximum flow problems instead of first determining the terminal capacity matrix by solving a large number of maximum flow problems and then constructing a T-maximum tree, as discussed in the proof of Theorem 4.6. We remark that condition (4.35) is a kind of triangle inequality, and imposes severe limitations on the elements of the terminal capacity matrix. For example, by applying (4.35) to each side of the triangle, it is straightforward to verify that, among the three terminal capacities appearing in (4.35), two of them must be equal and the third must be no smaller than their common value. As a consequence, there are at most n — 1 numerically distinct values. We illustrate the above by the following example. Example 4.9 The terminal capacity matrix T of the communication net G(V, E, of Fig. 4.30 was obtained earlier in (4.34), and is given by "00
5 5 5 .6
5 00
8 11 5
5 5 8 11 00 8 8 00 5 5
6" 5 5 5 00 _
c,f)
4.4
TERMINAL CAPACITY MATRIX
271
Fig. 4.31. A weighted five-node complete graph. For / = 1, j = 2 and k = 3, we have the inequality T 12 = 5 ^ min [T 1 3 , T 32 ] = min [5, 8] = 5
(4.44)
Likewise, we can verify inequality (4.35) for all other values of i, j and k. To construct a flow-equivalent tree of the net of Fig. 4.30, we associate with each edge (x, y) of the 5-node complete graph the length l(x, y) = rxy, the jcth row and yth column element of T, to obtain a weighted graph of Fig. 4.31. Applying any of the algorithms outlined in Section 4.3 yields a maximum tree Jmax as shown in Fig. 4.32. This tree is flow-equivalent to the communication net of Fig. 4.30, as can easily be verified by computing its terminal capacity matrix. Observe that since tmax contains four numerically distinct branch capacities, its terminal capacity matrix has four numerically different entries, excluding the infinity.
DEFINITION 4.11 Principal Partition. A real symmetric matrix T is said to be principally partitionable if after possibly permuting rows and the corresponding
Fig. 4.32. A flow-equivalent tree of the net of Fig. 4.30.
272
MINIMUM TREES AND COMMUNICATION NETS
columns, it can be partitioned into the form T
. . IT' Tb.
(4.45)
where (i) every element in Tc is identical and is the smallest number in T, (ii) Ta and Tb are symmetric submatrices, and (iii) every diagonal element in T is 0°. Ta and Tb are referred to as the resultant main submatrices by a principal partition. The significance of the principal partition is contained in the following theorem.
THEOREM 4.7 A real symmetric matrix of nonnegative elements with °° along its main diagonal is the terminal capacity matrix of an undirected communication net if, and only if, the matrix and all of its resultant main submatrices can be principally partitioned until all the final resultant main submatrices are of order 1. Proof. Necessity. Let T be the terminal capacity matrix of an «-node undirected communication net G(V, E, c,f). By Corollary 4.2, there is an n-node tree t that is flow-equivalent to G. Let the branches (x,, JC, +1 ) (i = 1, 2, . . . , n - 1) of t be arranged in nondecreasing order by capacity: c(x1,x2)^c(x2,x3)^.
. .^c(xn_uxn)
(4.46)
Since T is also the terminal capacity matrix of tree t, the removal of the branch (xx, x2) from t partitions the node set V into the subset X and X = V - X. By permuting the rows and the corresponding columns if necessary, the matrix T can be partitioned as X X X Ta Tc X T' Ty,.
(4.47)
Since (X, X) = (xlr x2) is the minimum i-j cut for all i e X and j e X, every element in Tc is identical and is the smallest number in T. In addition, Ta and Tb are symmetric, the diagonal elements of which are all °°. We complete the proof of necessity by induction over the number of tree branches removed from t. Assume that the above partitioning process is valid for all the resultant main submatrices Tk after the removal of the &th
4.4 TERMINAL CAPACITY MATRIX
273
branch (xk,xk+i), l^k
Xk
xk
xk
Tkst
Tkc
A
T kc
Tkb
Tk=
Y
k
(4.48)
where every element in Tkc is identical and is the smallest number in Tk. In addition, Tka and Tkb are symmetric, the diagonal elements of which are all oo. Thus, the principal partition is applicable to T and all of its resultant main submatrices. Sufficiency. Suppose that the matrix T is principally partitioned as in (4.47), where every element Tc is identical and is the smallest number in T. Let Ga and Gb be two nets composed of the nodes corresponding to the node sets X and X, respectively. The structures of the nets Ga and Gb have not been ascertained at this point. Let an edge (xi,x2) be connected between the nets Ga and Gb with JCX in Ga and x2 in Gb and assign the edge capacity c(xlt x2) equal to the common element value in Tc, as depicted in Fig. 4.33. Since by hypothesis the resultant main submatrices Ta and Tb can further
c(xi,x2)
Fig. 4.33. The structures of the nets Ga and Gb connected by the an edge (x^Xj) having capacity equal to the common element value in Tc.
274
MINIMUM TREES AND COMMUNICATION NETS
c(xi,x2)
Fig. 4.34. The construction of the subnets G,a and G2ll. be principally partitioned, for our purposes we consider only J a and write
Ta =
^la
-^la
-^la
r ia
Tlc-
(4.49)
*1.
where every element in J l c is identical and is the smallest number in Ta. Let the node set X of Ga be partitioned in accordance with the node sets Xia and Xla, respectively, and let the resulting subnets be denoted by G l a and G2a- We next connect an edge (x3, xA) between G la and G2a with x3 in Gi a and x4 in G2a and assign the edge capacity c(x3, x4) equal to the common element value in Tlc, as depicted in Fig. 4.34. The process can be continued until every resultant main submatrix is composed only of one element °°. The resulting net is a tree, the branch capacities of which are the terminal capacities of T. This completes the proof of the theorem. Q.E.D. The result was first given by Mayeda (1960). The proof of sufficiency also serves as a basis for realizing an undirected communication net having a preassigned realizable terminal capacity matrix. Example 4.10 Consider the real symmetric matrix 1
2
3
4
5
5
5
5
6
8
11
5
8
5
1
00
2
5
= 3
5
8
00
4
5
11
8
5
6
5
5
00
00
5
(4.50)
5 00
discussed in Example 4.9. After permuting the rows and the correspond-
4.5 SYNTHESIS OF A FLOW-EQUIVALENT TREE
275
ing columns, the matrix T can be principally partitioned as 5
3
2
4
1
00 !
1
6
5
5
5
5
6~i
00
5
5
5
3
5
5
00
8
8
2
5
5
8
00
11
4
5
5
8
11
00
(4.51)
Thus, according to Theorem 4.7, the matrix T is realizable because the principal partition is applicable to T and all of its resultant main submatrices To construct an undirected communication net G(V, E, c, / ) having terminal capacity matrix T, we first partition the node set of G into the subsets X= {1, 5} and X = {2, 3, 4} in accordance with the partition of (4.51), and then connect an edge (xlt x2) between the net Ga of node set X and the net Gb of node set X with capacity c(xly x2) = 5, as depeicted in Fig. 4.35(a) in which we arbitrarily set x1 = 5 and x2 = 4. We next partition the node set X of Gb into the subsets Xib = {3} and Xlb = {2, 4} in accordance with the partition of (4.51) and then insert an edge (x3, x4) between the net G l b of node set Xlb and the net G2b of node set Xlb with capacity c(x3, x4) = 8, as shown in Fig. 4.35(b) where x3 = 3 and x4 is arbitrarily chosen to be node 4. Finally, we insert edges (1, 5) and (2, 4) of capacities c(l, 5) = 6 and c(2, 4) = 11 in the net of Fig. 4.35(b), and obtain the tree structure of Fig. 4.35(c). Had node 2 been chosen as x4, we would have obtained the linear tree of Fig. 4.35(d).
4.5
SYNTHESIS OF A FLOW-EQUIVALENT TREE
In the foregoing, we demonstrated that every undirected communication net is flow-equivalent to a tree, and there are at most n — 1 numerically distinct terminal capacity values in an n-node net. Is there a better way of constructing an equivalent tree other than by first obtaining the terminal capacity matrix, and then principally partitioning it? Gomory and Hu (1961) have answered the question decidedly in the affirmative. They devised a procedure that involves the successive solution of precisely n — 1 maximum flow problems. Moreover, many of these problems are solved in smaller and more simplified nets than the original one. In this section, we describe their procedure in detail. To begin our discussion, let G(V, E, c,f) be an n-node undirected communication net. Let us pick two arbitrary nodes JCX and x2 as the source and the sink, respectively, and apply any one of the algorithms discussed in
276
MINIMUM TREES AND COMMUNICATION NETS (a)
(b)
(c)
Q
"©-
©
11
© (d)
(b
Qy^y^y^y^®
Fig. 4.35. The construction of an undirected communication net having terminal capacity matrix (4.51): (a) Ga and Gb; (b) Ga, Glb, and G2b; (c) tree structure; and (d) linear tree.
Chapter 3 to locate a minimum cut (X, X) with xxeX and x2eX, as depicted in Fig. 4.36. Suppose that we wish to determine the maximum flow from x3 to x 4 in G, where x3 and x4 both belong to the subnet Gx or the subnet G2 of Fig. 4.36. Without loss of generality, assume that both x3 and x4 are in X. We now show that in computing the maximum flow from x3 to x4, nodes in X can be "condensed" into a single node to which all the edges of the minimum cut (X, X) are attached, as depicted in Fig. 4.37, where the parallel edges are combined and represented by a single edge, whose capacity is equal to the sum of the capacities of the individual edges. The resulting net is referred to as the condensed net.
4.5
SYNTHESIS OF A FLOW-EQUIVALENT TREE
277
Fig. 4.36. A symbolic representation of a minimum cut.
Fig. 4.37. The condensation of the subnet G2 into a single node to which all the edges of the minimum cut in Fig. 4.36 are attached.
THEOREM 4.8 The maximum flow value between any two nodes of a condensed net is equal to the maximum flow value between the corresponding pair of nodes in the original net. Proof. Let xl and x2 be any two nodes of an undirected communication net G(V, E, c, / ) , and let (X, X) be a minimum x^-x2 cut in G. Let G*(V*, E*, c*,f*) be the condensed net obtained from G by condensing the nodes of X into a single node. Choose any two nodes x3 and xA in G* and let (Y, Y) be a minimum JC3-JC4 cut in the original net G. Define A = XDY,
A=XP
(4.52a)
B = XHY,
B = XHY
(4.52b)
where A denotes the complement of A in X, and B denotes the complement of B in X, as depicted symbolically in Fig. 4.38. Without loss of generality, we may assume that xxeA, x3eA and x4 e A. Two cases are distinguished.
278
MINIMUM TREES AND COMMUNICATION NETS •(XX)
t (1-,F)
Fig. 4.38. A symbolic representation of an undirected communication net partitioned by a minimum xx-x2 cut and a minimum x3-x4 cut.
Case 1 x2 e B. Then we have the following expansions: c(X, X) = c(AUA,BUB) + c(A,B)
+ c(A,B)
c(Y, Y) = c(AUB,AUB) + c(A,B)
= c(A, B) + c(A,B)
(4.53a)
= c(A, A)
+ c(B,A)
+ c(B,B)
(4.53b)
Since from Fig. 4.38, (A U B U B, A) is an x3-x4 cut and since (Y, Y) is a minimum x3-x4 cut, it follows that c(Y, Y) - c(AU B U B, A) = c(A, B) + c(B, B)-c(B,A)^0 Likewise, since (AUADB, B) is an xx-x2 minimum xx-x2 cut, we have
(4.54)
cut and since (X, X) is a
c(X, X) - c(A U A U B, £ ) = c ( ^ , £ ) + c ( ^ , B) - c(B, B)^0
(4.55)
Adding (4.54) and (4.55) and invoking the fact that since G is undirected, c(B, B) = c(B, B) and c(A, B) = c(B, A), we obtain c(B,A)
= c(A, B)^0
(4.56)
Because all the edge capacities of G are nonnegative, it follows that c{B, A) = c(A, B) = 0
(4.57)
4.5 SYNTHESIS OF A FLOW-EQUIVALENT TREE
279
and the sum of (4.54) and (4.55) becomes [c(Y, Y) - c(A U B U B, A)] + [c(X, X)-c(AUAU
B, B)] = 0
(4.58)
This shows that if either term inside the brackets is negative, the other term will be positive, violating either (4.54) or (4.55). Therefore, they must be identically zero or c(Y,Y) = c(ADBUB,A)
(4.59a)
c(X,X) = c(AUAUB,B)
(4.596)
In other words, if (Y, Y) is a minimum x3-x4 cut of G, then ( A U B U B , A) is also a minimum x3-x4 cut of G. Consequently, condensing i t o a single node does not affect the value of a maximum flow from x3 to x4, and we can use the condensed net G* to calculate this maximum flow. Case 2 x2€B. Following a similar argument as in Case 1, we can show that (A, A U B U B) is also a minimum x3-xA cut of G, and condensing X to a single node does not affect the value of a maximum flow from x3 to x4. Thus, we again can use the condensed net G* to calculate this maximum flow. This completes the proof of the theorem. Q.E.D. This theorem is fundamental to the Gomory-Hu procedure for constructing a flow-equivalent tree by solving precisely n — \ maximum flow problems. Before we proceed to describe their algorithm, we mention that not only every undirected communication net is flow-equivalent to a tree, but is also equivalent to a path called a linear tree.
COROLLARY 4.3 Every undirected communication net is flow-equivalent to a linear tree. Proof. Let T = [ru]
(4.60)
be the terminal capacity matrix of an n-node undirected communication net G(V, E, c,f). Then according to Theorem 4.7, T can be principally partitioned until all the resultant main submatrices are of order 1. The principally partitioned matrix T is realizable as the linear tree shown in Fig. 4.39. Q.E.D.
280
MINIMUM TREES AND COMMUNICATION NETS
Fig. 4.39. A linear tree realization of a principally partitioned matrix.
This procedure in realizing a flow-equivalent tree from a given net G is ineffective in that in general it requires to solve n{n — l ) / 2 maximum flow problems in order to ascertain the terminal capacities xtj of T. In the following, we present the Gomory-Hu algorithm which reduces the number of maximum flow problems to be solved from n(n — l ) / 2 to n — 1, a substantial saving in computation. 4.5.1
Gomory-Hu Algorithm
The algorithm was first proposed by Gomory and Hu (1961) for constructing a flow-equivalent tree by solving precisely n — 1 maximum flow problems. Gomory-Hu Algorithm Step 1. Set i = 1. Select two nodes x1 and y1 arbitrarily in G(V, E, c, f) and locate a minimum xx-yi cut (Xlt X2) where X2 = V — Xl. Represent the node sets Xl and X2 by two nodes and connect them by an edge of capacity c(Xly X2), as depicted in Fig. 4.40. The resulting tree is denoted by tY. Step 2. Select a node set Xk (1 ^ k ^ i + 1) of at least two elements from the sets Xx, X2, . . . , Xi+1, and pick two nodes y and z arbitrarily in Xk. Removing the node Xk and all of its incident edges from tt results in a forest containing many subtrees. Construct a condensed net G*(V*, E*, c*,f*) from G by condensing the nodes contained in each subtree. A typical tt is shown in Fig. 4.41. Step 3. Locate a minimum y-z cut (Y, Z) of G*, which partitions the node set Xk into Xkl and Xk2 with y € Xkl and z € Xk2. Connect Xkl and Xk2 by an edge having capacity c*(Y, Z). The other nodes of the tree t, are attached to Xkl if they are in the Xkl part of the cut (Y, Z), and to Xk2 otherwise. The new tree is denoted by f,+1, as indicated in Fig. 4.42. Step 4. Set Xk = Xkl and Xi+2 = Xk2. Set i = i + 1. Step 5. If / = n — 1, stop. Otherwise, return to Step 2.
CM)
(£)
Fig. 4.40. A symbolic representation of the node sets X, and X2 connected by an edge of capacity c(Xlt X2).
4.5 SYNTHESIS OF A FLOW-EQUIVALENT TREE
281
Fig. 4.41. The construction of a cut-tree by the Gomory-Hu algorithm.
The beauty of the algorithm is that not only is a flow-equivalent tree constructed with a minimum effort by solving precisely n — \ maximum flow problems, but also it is the kind of tree whose branches represent the relevant n — 1 minimum cuts in the original net. It is not just any equivalent tree; it is the tree structure corresponding precisely to the multi-terminal cut structure of the net. Such a tree is referred to as a cut-tree of the communication net. Notice that there are usually many flow-equivalent trees to a net. For example, as indicated in Corollary 4.3, every undirected communication net is equivalent to a linear tree. The maximum tree of the weighted complete graph constructed from the terminal capacity matrix of the net is another flow-equivalent tree. However, before we show that the tree constructed by the above algorithm is indeed an equivalent tree of the original net, we illustrate the procedure by the following examples, postponing the proof to the following section.
Fig. 4.42. A new tree «,+, obtained from the tree tt of Fig. 4.41.
282
MINIMUM TREES AND COMMUNICATION NETS
Fig. 4.43. An undirected communication net used to illustrate the construction of a cut-tree.
Example 4.11 Consider the undirected communication net G(V, E, c, / ) of Fig. 4.30 which is redrawn in Fig. 4.43. We follow the five steps of the algorithm to construct a cut-tree of G, as follows: Step 1. Set i = \. Arbitrarily select nodes 1 and 3 in G, and locate a minimum 1-3 cut (Xlt X2) = ({1, 5}, {2, 3, 4}). Construct tl as shown in Fig. 4.44(a). Step 2. Pick nodes 1 and 5 in Xx = {1, 5}. Removing the node X\ and its incident edge from fa results in a forest containing a subtree of an isolated node X2 = {2,3,4}. Construct a condensed net G*(V*, E*, c*, / * ) from G by condensing the nodes 2, 3 and 4 in G, as shown in Fig. 4.44(b). Step 3. Locate a minimum 1-5 cut (Y, Z) = (1, {5, X2}) in G* with c*(Y, Z) = 6, and construct t2 as in Fig. 4.44(c). (a) (2,3,4) X2
Fig. 4.44. The construction of a cut-tree for the net of Fig. 4.43: (a) <,; (b) G*; (c) h.
4.5 SYNTHESIS OF A FLOW-EQUIVALENT TREE
283
Step 4. Set i = 2,Xt = {1}, and X3 = {5}. Step 5. Return to Step 2. Step 2. Pick nodes 2 and 3 in X2 = {2, 3, 4}. Removing node Xz and its incident edge from t2 results in a forest containing the subtree consisting only of the edge (1, 5) in t2. Construct a condensed net G* from G by condensing the nodes 1 and 5 in G, as in Fig. 4.45(a). Step 3. Locate a minimum 2-3 cut (Y, Z) = {{Wu2, 4}, 3) in G with c*(Y, Z) = 8, where W1 is the combined node of 1 and 5. and construct t3 as in Fig. 4.45(b). Step 4. Set i = 3, X2 = {2,4}, and X4 = {3}. Step 5. Return to Step 2. Step 2. Pick nodes 2 and 4 in X2 = {2,4}. Removing node X2 and its incident edges from t3 results in a forest containing the subtrees (1, 5) and an isolated node 3. Construct a condensed net G* from G by condensing nodes 1 and 5 in G, as shown in Fig. 4.46(a). Step 3. Locate a minimum 2-4 cut (Y, Z) = ({Wu 2, 3}, 4) in G* with c*(Y, Z) = 11, where W1 is the combined node of 1 and 5, and construct t4 as in Fig. 4.46(b). Step 4. Set i = 4, X2 = {2}, and X5 = {4}. Step 5. Stop. The desired cut-tree is shown in Fig. 4.46(b). This cut-tree is more than just another equivalent tree; its structure corresponds precisely to the multi-terminal cut structure of G. In fact, the capacity of a branch is equal to the capacity of a minimum cut separating the two endpoints of the branch in the original net. In Fig. 4.46(b), the removal of the branch (2, 5) from t4 partitions the node set V of G into the subsets X= {1, 5} and X = {2, 3, 4}. Then the cut (X, X) = ({1, 5}, {2, 3, 4}) is precisely a minimum 2-5 cut in G. Likewise, the removal of the branch (2,4) from t4 partitions the node set V into the subsets Y = {1, 2, 3, 5} and Y = {4}. Then (Y, Y) = ({1, 2, 3, 5}, 4) is precisely a minimum 2-4 cut in G. (a)
(Y,Z) (b)
o
{2A} X2 Fig. 4.45. The construction of a cut-tree for the net of Fig. 4.43: (a) G*; (b) t3
284
MINIMUM TREES AND COMMUNICATION NETS
Fig. 4.46. The construction of a cut-tree for the net of Fig. 4.43: (a) G*; (b) t4.
Example 4.12 We use the Gomory-Hu algorithm to construct a cut-tree for the undirected communication net G(V, E, c, f) of Fig. 4.47, as follows: Step 1. Set i = 1. Select nodes e and g, and locate a minimum e-g cut (Xi, X2) - (e, {a, b,c,d,g}) having capacity 5. Construct tree tx as shown in Fig. 4.48(a). Step 2. Select nodes a and b in X2 and construct G* = G. Step 3. Locate a minimum a-b cut (Y, Z) = {b, {a, c, d, e, g}) with c*(Y, Z) = 5, and construct t2 as in Fig. 4.48(b). Step 4. Set i = 2, X2 = {a, c, d, g}, and X3 = {b}. Step 5. Return to Step 2. Step 2. Select nodes a and c in X2 and construct G* — G. Step 3. Locate a minimum a-c cut (Y, Z) = {{a, d, e}, {b, c, g}) with c*(Y, Z) = 8, and construct t3 as in Fig. 4.48(c). Step 4. Set / = 3, X2 = {a, d}, and X , = {c, g}. Step 5. Return to Step 2.
Fig. 4.47. An undirected communication net used to illustrate the construction of a cut-tree by the Gomory-Hu algorithm.
4.5
X\
SYNTHESIS OF A FLOW-EQUIVALENT TREE
X2
-A4
285
A3
Fig. 4.48. The construction of a cut-tree for the net of Fig. 4.47: (a) tx; (b) t2; (c) t3. Step 2. Select nodes a and d in X2 and construct G* as shown in Fig. 4.49(a). Step 3. Locate a minimum a-d cut (Y, Z) = (a, {d, e, Wt}) in G* with c*(Y, Z) = 8, and construct t4 as in Fig. 4.49(b), where Wl is the combined node of b, c and g. Step 4. Set i = 4, X2 = {d}, and X , = {a}. Step 5. Return to Step 2. Step 2 Select nodes c and g in X4 and construct G* as in Fig. 4.50(a). Step 3. Locate a minimum c-g cut (Y, Z) = (g, {fe, c, W2}) in G* with c*(Y, Z) = 6, and construct f5 as in Fig. 4.50(b), where W2 is the combined node of a, d and e. Step 4. Set i = 5, X4 = {g}, and X6 = {c}. Step 5. Stop. The desired flow-equivalent cut-tree t5 is shown in Fig. 4.50(b). If we remove branch (c, d) from t5, the node set V of G is partitioned into the subsets X={b, c, g} and X = {a, d, e). Then the cut (X, X) =
Fig. 4.49. The construction of a cut-tree for the net of Fig. 4.47: (a) G*; (b) t4.
286
MINIMUM TREES AND COMMUNICATION NETS (Y,Z)
(a)
(b)
Fig. 4.50. The construction of a cut-tree for the net of Fig. 4.47: (a) G*; (b) t5
{{b,c,g}, {a, d,e}) is precisely a minimum c-d cut in G. This is similarly valid for other branches of t5. Hence, the structure corresponds precisely to the multi-terminal cut structure of G. The terminal capacity matrix T of the cut-tree t5 of Fig. 4.50(b) is found to be b
c
d
e
a
"00
5
8
8
5
g 6"
b
5
00
5
5
5
5
c
8
5
00
8
5
6
d
8
5
8
00
5
6
e
5
5
5
5
00
5
R .6
5
6
6
5
00
a
T=
(4.61)
Rearranging the rows and columns yields the principally partitioned terminal capacity matrix: b 00
5 T = [rii] =
dl 5
e 5 00
a 5 5
c 5 5
d 5 5
00
8
8
8
_co_ ; 8_
8
8 i co.
(4.62)
4.5 SYNTHESIS OF A FLOW-EQUIVALENT TREE
287
Fig. 4.51. A linear tree realization of the terminal capacity matrix (4.62). This matrix can be realized by the linear tree of Fig. 4.51, where the branch capacities of the path from node b to node d correspond to the up-diagonal elements T 12 = 5, T 23 = 5, T 34 = 6, T 45 = 8 , and T 56 = 8 of T. This linear tree is not a cut-tree. For example, if we remove branch (g, a) from this linear tree, the node set V of G is partitioned into the subsets X= {b,e, g} and X = {a, c, d}. However, the cut {X,X) = ({b, e, g}, {a, c, d}) is not a minimum a-g cut in G of Fig. 4.47, because its capacity is 12 whereas the capacity of a minimum a-g cut is 6. Example 4.13 We use the Gomory-Hu algorithm to construct a cut-tree for the 14-node undirected communication net G(V, E, c, / ) of Fig. 4.52, as follows: Step 1. Set i = 1. Select arbitrarily nodes 6 and 10 and locate a minimum 6-10 cut (Xu X2) with Xr = {l, 5, 8, 9, 10, 12, 13, 14}
(4.63a)
* 2 = { 2 , 3 , 4 , 6 , 7 , 11}
(4.63ft)
as indicated in Fig. 4.52, where c(Xl, X2) —19. Construct the tree t-i as in Fig. 4.53(a).
Fig. 4.52. A 14-node undirected communication net used to illustrate the construction of a cut-tree by the Gomory-Hu algorithm.
288
MINIMUM TREES AND COMMUNICATION NETS
Fig. 4.53. The construction of a cut-tree for the net of Fig. 4.52: (a) tx; (b) G*.
Fig. 4.54. The resulting tree ts after the first seven iterations of the Gomory-Hu algorithm applied to the net of Fig. 4.52.
Fig. 4.55. The condensed net G* used in the construction of a cut-tree for the net of Fig. 4.52 by the Gomory-Hu algorithm.
4.5 SYNTHESIS OF A FLOW-EQUIVALENT TREE
289
Fig. 4.56. A cut-tree f13 for the net of Fig. 4.52 constructed by the Gomory-Hu algorithm. By repeatedly selecting node pairs in Xl, we can use the condensed net G* of Fig. 4.53(b) for the first seven iterations of Steps 2-5. This results in the tree t8 shown in Fig. 4.54. Likewise, for the next five iterations, we can use the condensed net G | of Fig. 4.55 for all the node pairs in X2, resulting in the desired cut-tree tl3 of Fig. 4.56. Finally, from the cut-tree t13 we compute the terminal capacity matrix TofG, and obtain 1 1 2 3 4 5 6 7 r= 8 9 10 11 12 13 14
"oo
6 6 6 6 6 6 6 6 6 6 6 6 .6
2 6 00
13 9 13 13 13 11 13 13 8 9 13 7
3 4 5 6 6 6 13 9 13 00 9 13 9 00 9 13 9 00 15 9 13 13 9 13 11 9 11 15 9 13 15 9 13 8 8 8 9 9 9 15 9 13 7 7 7
6 7 8 9 6 6 6 6 13 13 11 13 15 13 11 15 9 9 9 9 13 13 11 13 00 13 11 19 13 00 11 13 11 11 00 11 19 13 11 00 19 13 11 20 8 8 8 8 9 9 9 9 15 13 11 15 7 7 7 7
10 11 12 13 14 6 6 6 6 6 13 8 9 13 7 15 8 9 15 7 9 8 9 9 7 13 8 9 13 7 19 8 9 15 7 13 8 9 13 7 11 8 9 11 7 20 8 9 15 7 00 8 9 15 7 8 00 8 8 7 9 8 00 9 7 15 8 9 00 7 7 7 7 7 00 (4.64)
After permuting the rows and the corresponding columns, the terminal
290
MINIMUM TREES AND COMMUNICATION NETS
capacity matrix J of (4.64) can be principally partitioned as
1 14 11 4 12 8 T =
2 5 7 3 13 6 9 10
1 14 11 4 12 oo ; 6 6 6 6 6 00 7 7 7 6 • 7 00 1 8 8 6 7 8 i 00 9 6 7 8 9 00 6 7 8 9 9 6 7 8 9 9 6 7 8 9 9 6 7 8 9 9 6 7 8 9 9 6 7 8 9 9 6 7 8 9 9 6 7 8 9 9 6
I 7
8 ! 9
9
8
2
5
7
3
13
6
6
6
6
6
6
6
6
7 8 9 9
9 6 7 8 9 9 11 13 13 13 15 15 19
10 6" 7 8 9 9 11 13 13 13 15 15 19
11
13
13
13
00
7 8 9 9 11 13 13 13 15
11
13
13
13
15
00
7 8 9 9 11 13 13 13 15 15
11
13
13
13
15
15
00
11
13
13
13
15
15
19
11
13
13
13
15
15
19 20 i oo
7 7 7 7 8 8 8 8 9 9 9 9 9 9 9 9 00 11 11 11 11 11 00 13 13 13 11 13 00 13 13 11 13 13 00 13
oo i 20
(4.65) This matrix can be realized by the linear tree of Fig. 4.57, the branch capacities of which from node 1 to node 10 along the tree path correspond to its up-diagonal elements r 12 = 6, • r 23 = 7, T 34 = 8, T 45 = 9, T56 = 9, T 6 7 = l l ,
T78 = 13, T89 = 13, TqiQ^Yi,
T 1 0 | n = 15, T 1 i i l 2 = 1 5 ,
T 1 2 1 3 = 19, and r 1 3 1 4 = 20, respectively. This tree, however, is not a cut-tree. 4.5.2
Proof of the Gomory-Hu Algorithm
In this section, we show that the Gomory-Hu algorithm indeed generates a cut-tree that is flow-equivalent to the undirected communication net
14}
7
~<») © " ^ 13
6
© " ^ 13
15
10 20
&*-© &^
Fig. 4.57. A linear tree realization of the net of Fig. 4.52.
4.5
G(V, E, c,f).
SYNTHESIS OF A FLOW-EQUIVALENT TREE
291
Consider any two nodes x and y. Let Pxy = (x, *i)(*i, x2) . . . (xr, y)
(4.66)
be the unique path connecting the nodes x and y in the final tree t. We show that the terminal capacity rxy between x and y in G is equal to rxy = min [c,{x, xx), c ( (*i, x2), . . . , c,{xr, y)]
(4.67)
where c, is the capacity function of the tree t. To this end, we first demonstrate that the inequality rxy ^ min [ct(x, xj, c,{xu x2), ... , ct{xr, y)]
(4.68)
holds. Recall that the removal of any branch (u, v) of t from t results in a forest of two subtrees that partitions the node set V of G into two subsets X and X = V — X. The corresponding cut (X, X) in G separates the nodes u and v with c(X, X) = ct{u, v), and therefore is a u-v cut. That this is the case follows immediately from the construction, where each new tree produced in the construction represents cuts in this way provided that the old tree does. This implies that the terminal capacity rxy of G cannot exceed any of those x-y cuts corresponding to the tree branches (x, Xi), (xly x2), • • • , (xr, y), and (4.68) follows. We next show that the reverse inequality rxy g min [c,(x, xj, c,(xu x2), . . . , c,(xr, y)]
(4.69)
also holds. This is accomplished by showing that, at any stage of the construction, if an edge of capacity c^ connects nodes X and Y in the tree, then there is an x in X and a y in Y such that rxy = cl. We prove this by induction over the number of stages. This is certainly true at the first stage of Step 1. We show that this property is maintained. Suppose that a node Y is about to be split with node X attached to it by an edge of capacity c t . By induction hypothesis there is an x in X and a y in Y in the tree with c1 = rxy. Select nodes u and v arbitrarily in Y in Step 2 for locating a minimum u-v cut in G* of cut capacity c2 in Step 3. This u-v cut partitions the node set Y into the subsets Yj and Y2 with u in Yx and v in Y2. Without loss of generality, we may assume that X is connected to node Y: in the new tree as depicted symbolically in Fig. 4.58, where u and v provide the two nodes such that tuu = c2. As to the old edge of capacity cu two cases are possible. If y is in Y1; then x and y provide the two nodes. If y is in Y2, we show that nodes u and x provide the required nodes. Thus, we assume that y is in Y2. Observe that the removal of the cut of capacity c 2 from G separates the net into two parts with nodes u and x in one part and nodes v and y in the other. By Theorem 4.8, we can condense the nodes in Y2 in G without
292
MINIMUM TREES AND COMMUNICATION NETS
c2
Fig. 4.58. A symbolic representation showing that X is connected to node Yx in the new tree. affecting rxu. This is equivalent to saying that rxu remains unaffected if all pairs of nodes of Y2 are connected by edges of infinite capacity. Let the resulting net be denoted by G'(V, E', c',f) with r,y representing the terminal capacity between nodes i and j . Then we have *> XU
"XU
VXy
VXy
T'
^T
r'
=oo
(4.70a) = cx
(4.706)
= c2
(4.70c) (4.70d)
Appealing to (4.35) yields t'xu = min [r'xy, r'yv, T'VU] = min [r'xy, r'uv]
(4.71)
rxu = r'xu ^ min [r'xy, r'uv] ^ min [clt c2]
(4.72)
showing that
Since the cut of capacity c 2 also separates nodes x and y, it follows that c2^c,
(4.73)
TV,. — C i
(4.74)
Hence, we have
Because the cut of capacity cx is also a u-x cut, it is necessary that " Y1I
t- 1
and u and x provide the required nodes.
(4.75)
4.6 SYNTHESIS OF OPTIMUM UNDIRECTED COMMUNICATION NETS
293
In other words, the branch capacities in the final tree t actually represent the terminal capacities between adjacent nodes of t. Applying (4.35) to the unique tree path Pxy of (4.66) establishes the inequality (4.69). Using this in conjunction with (4.68), we obtain the equality of (4.67). This completes the proof that the Gomory-Hu algorithm indeed produces a cut-tree that is flow-equivalent to the original net.
4.6 SYNTHESIS OF OPTIMUM UNDIRECTED COMMUNICATION NETS In the foregoing, we have discussed ways to compute the maximum flows or the terminal capacities between all pairs of nodes in an undirected communication net. In the present section, we study the inverse problem of synthesizing a net having a preassigned lower bound on the maximum flow value between every pair of nodes. We certainly can construct a net, the flow values of which will exceed the lower bounds, simply by assigning arbitrarily large edge capacities between all pairs of nodes. Our objective here is to construct a net with maximum flow values exceeding all the lower bounds and with a minimum total edge capacity. Let R = [rti\ (4.76) where ru = <*>, be a symmetric matrix of nonnegative real elements of order n called the requirement matrix, and let T = [TU]
(4.77)
be the terminal capacity matrix of an n-node undirected communication net G(V, E, c, / ) . We shall call the net G feasible if for i =#=;" rv^ru,
i,j = l,2,...,n
(4.78)
The problem is to construct a feasible net G(V, E, c, f) that minimizes the total edge capacity of the net: c(G) = min c,(G,)
(4.79)
where G,-(V, Eh c„ f) is a feasible net. DEFINITION 4.12 Requirement Graph. Given a symmetric n X n requirement matrix R = [r /; ], the requirement graph of R is the n-node weighted complete graph GR(V, E, r) with r(i, /) = r,y for each edge (i,j)eE, where the requirement function r is from E to the elements of R.
294
MINIMUM TREES AND COMMUNICATION NETS
DEFINITION 4.13 Dominant Requirement Tree. If the weights of the edges of a requirement graph are considered as the lengths of the edges, then a dominant requirement tree is a maximum tree in the requirement graph. Given the requirement matrix 1
2 1
1 00 2 1 00 3 9 2 4 12 4 5 8 11 6 . 7 15
3 4 5 6 9 12 8 7' 2 4 11 15 00 3 14 10 3 00 5 13 14 5 0 0 6 10 13 6
(4.80)
of order 6, its requirement graph GR is the 6-node complete graph GR of Fig. 4.59. Using any of the algorithms developed in Section 4.3, a maximum tree tm of GR is produced in Fig. 4.60. This maximum tree tm is a dominant requirement tree of GR. The importance of the dominant requirement tree is enhanced considerably by the following theorem.
Fig. 4.59. The requirement graph GR for the requirement matrix (4.80). THEOREM 4.9 The necessary and sufficient condition that an undirected communication net be feasible is that (4.78) hold for all the branches of a dominant requirement tree.
4.6 SYNTHESIS OF OPTIMUM UNDIRECTED COMMUNICATION NETS
295
Fig. 4.60. A maximum tree for the requirement graph of Fig. 4.59. Proof. The necessity is obvious because the conditions (4.78) for all the branches of a dominant requirement tree are a subset of all the inequalities given in (4.78). To establish sufficiency, we show that if Tv*rv = r(i,j)
(4.81)
holds for each branch (i, j) of a dominant requirement tree tm, where r is the requirement function of the communication net G(V, E, r), then (4.81) holds for all i and / . Let (x, y) be a chord of the cotree with respect to the tree tm, and let Pv = (x, *!)(*!, x2) . . . (xk, y)
(4.82)
be the unique path in tm connecting between nodes x and y. Then from (4.40) and (4.81) we have rxy ^ m i n [TXXI,
rXlX2, . . . ,
xXky\
^ m i n [rXXl, rXlX2, ... , rXty]
(4.83)
Since the requirements rtj are considered as the lengths of the edges in the requirement graph G R and since tm is a maximum tree, from Theorem 4.4 we have rxy ^ m i n [rXXl, rXjX2, . . . , rXty]
(4.84)
which when combined with (4.83) gives rxy^rxy This completes the proof of the theorem.
(4.85) Q.E.D.
296
MINIMUM TREES AND COMMUNICATION NETS
Therefore, there is no need to consider all the requirements. The requirements associated with the branches of a dominant requirement tree are sufficient. These tree branch requirements are called the dominant requirements. Given an undirected communication net G(V, E, c, / ) , the total edge capacity is the sum of all edge capacities, or
c(G) = i 2 2 > ( w )
(4.86)
< / Assume that G is feasible with respect to the requirement matrix R = [r,y]. For any node i of G, define w, = maxr,7
(4.87)
J
In other words, w, is the largest flow requirement among those involving the node i. Thus, in any feasible net the sum of capacities of edges incident at a node i must be at least as large as u, to allow flow out of node /, or 2c(i,/)&u,
(4.88)
Because an edge in G is counted once in each of its two endpoints, a lower bound to the total edge capacity c(G) is then Ca = l2ui£c(G) *'
(4.89)
We now proceed to describe a procedure that produces a feasible net G such that (4.89) is satisfied with the equality sign. The resulting net is therefore optimum in the sense that its total capacity is minimum among all the feasible realizations. The technique was first proposed by Gomory and Hu (1961). Recall that from Theorem 4.9 it is sufficient to consider only the dominant requirements. Therefore, in selecting «, in (4.87) we need consider only those branches rtj of the dominant requirement tree tm that are incident at node i. Now suppose that the requirements for the branches of tm are replaced by a new set of requirements r,y. For this new set, there corresponds to a new lower bound Ca=\^u\
(4.90)
i
where M ;=maxr;
;'
(4.91)
4.6 SYNTHESIS OF OPTIMUM UNDIRECTED COMMUNICATION NETS
297
Finally, if the branches of tm are assigned the requirements r*ii = rq + r'il,
(i,j)etm
(4.92)
the corresponding lower bound becomes Ca = \^u1
(4-93)
i
where «;'=maxr£
(4.94)
i
Since M, and u\ may not be associated with the same branch, we have in general u'l^Ut + u'i
(4.95)
or C'a^Ca
+ C'a
(4.96)
However, if rtj or r\j are uniform requirement with r{j - r0 or r,y = r'0 for all ru or rlj in fm, then C = Ca + C'a
(4.97)
Let G(V, E, c,f) and G'(V, E', c',f) be two n-node undirected communication nets, and let G"{V", E", c", f") be the net obtained by superimposing the nets G and G'. Then V = V = V", E" - EUE' and c"(i,j) = c(i,j) + c'(i,j),
(i,j)eE"
(4.98)
The terminal capacity r"j between nodes i and / in G" and those r,7 and x\j in G and G' are related by the inequality T'^Tij + Tlj
(4.99)
The Gomory-Hu procedure of synthesis uses the dominant requirement tree and then decomposes it into a sum of "uniform" requirement forests. Each such uniform requirement forest is synthesized at its total lower bound capacity. The resulting net satisfies the original flow requirements in view of (4.99) and is of minimum total edge capacity because of (4.97). 4.6.1
Gomory-Hu Procedure
The procedure for constructing a feasible net with minimum total edge capacity was first proposed by Gomory and Hu (1961). In the following, we describe their procedure in detail.
298
MINIMUM TREES AND COMMUNICATION NETS
Fig. 4.61. The decomposition of the dominant requirement tree of Fig. 4.60 into the sum of a uniform dominant requirement tree t0 (a) and a requirement forest f0 (b).
Let tm be the dominant requirement tree that we wish to satisfy. Let A-min be the smallest requirement associated with the branches of tm. For each branch (i, j) in tm with requirement rtj, write hj = 'min + (hj - A-min)
(4.100)
The original requirement tree tm can then be considered as the superposition of a uniform dominant requirement tree t0 with uniform requirements rmin and a requirement forest f0 with requirements rit — rmin. For example, the dominant requirement tree tm of Fig. 4.60 can be decomposed into the sum of a uniform dominant requirement tree t0 with uniform requirements '•min =: ll and a requirement forest f0, as shown in Fig. 4.61. Clearly, the procedure can then further be applied to each subtree of the remaining
Fig. 4.62. The decomposition of the forest f0 into the sum of uniform requirement subtrees.
4.6 SYNTHESIS OF OPTIMUM UNDIRECTED COMMUNICATION NETS s~\
(V) 5.5/
© 5.5\
5.5
299
^
——(V) N. 5.5
(D A.5
Fig. 4,63. The synthesis of the uniform dominant requirement tree t0 of Fig. 4.61(a). requirement forest / 0 until fm has been expressed as a sum of uniform requirement subtrees ta. In Fig. 4.61, the forest can further be decomposed into those shown in Fig. 4.62. The uniform dominant requirement tree t0 in the decomposition is then synthesized by a circuit through its nodes in any order, each of whose edges has capacity equal to \rmin, half the uniform requirement. Clearly, such a circuit will satisfy all requirements of the uniform dominant requirement tree t0. Likewise, each uniform requirement subtree ta can be synthesized by a circuit passing through its nodes in any order, each edge of which has a uniform edge capacity equal to half the uniform requirement of the subtree ta. Therefore, by synthesizing a uniform requirement tree or subtree, we mean the construction of a net of one or more circuits as described above. We remark that in the case where a subtree is composed only of a single edge, it is convenient to use a single edge instead of two parallel edges, each having half the original edge capacity. For example, in Fig. 4.61 the uniform dominant requirement tree t0 is synthesized as shown in Fig. 4.63, and those of Fig. 4.62 are shown in Fig. 4.64. Finally, to obtain the desired feasible
Fig. 4.64. The synthesis of the uniform requirement subtrees of Fig. 4.62.
300
MINIMUM TREES AND COMMUNICATION NETS
Fig. 4.65. A feasible net for the requirement matrix (4.80).
net, we superimpose the resulting circuit realizations to form a net G* with each edge capacity equal to the sum of the corresponding edge capacities of the individual realizations. Thus, by superimposing the realizations of Figs. 4.63 and 4.64, we obtain the feasible net G* of Fig. 4.65. Before we justify our assertion that the final net G* is indeed a feasible minimum capacity realization, we illustrate the Gomory-Hu procedure by the following example. Example 4.14 Given the symmetric requirement matrix 2
3
4
5
00
2
1
4
6"
2
00
5
1
4
1
5
00
7
1
4
1
7
00
6
6
4
1
6
00 _
1
we synthesize a feasible net with a minimum total edge capacity. From the requirement matrix R, we first construct the requirement graph G R of Fig. 4.66, from which we obtain a maximum tree called a dominant requirement tree tm as shown in Fig. 4.67. This tree tm can be decomposed into a sum of a uniform dominant requirement tree t0 and a number of uniform requirement subtrees as indicated in Fig. 4.68. Each of such uniform tree or subtrees is then synthesized by a circuit or a number of circuits. The results are presented in Fig. 4.69. Finally, we superimpose the realizations of the nets of Fig. 4.69 to yield the desired realization G* of Fig. 4.70. The net G* is a feasible minimum-total-edgecapacity realization. The total edge capacity of G* is 15.5 or c*(G*) = 15.5.
Fig. 4.66. The requirement graph GR for the requirement matrix (4.101).
Fig. 4.67. A dominant requirement tree tm for the requirement graph G R of Fig. 4.66.
Fig. 4.68. The decomposition of the dominant requirement tree tm of Fig. 4.67 into the sum of a uniform dominant requirement tree t„ and a number of uniform requirement subtrees.
Fig. 4.69. The synthesis of the uniform dominant requirement tree t0 and the uniform requirement subtrees of Fig. 4.68.
Fig. 4.70. A feasible minimum-total-edge-capacity realization for the requirement matrix (4.101). 301
302
MINIMUM TREES AND COMMUNICATION NETS
THEOREM 4.10 The net G* constructed above is a feasible minimum capacity net. Proof. To show that G* is feasible, it suffices to demonstrate that the requirements of the dominant requirement tree tm are satisfied. Since each uniform requirement tree or subtree having uniform requirement r0 is realized by a circuit through its nodes, every edge of which has capacity \r0, each realization meets the flow requirements. From (4.99) we see that the terminal capacity r,* between nodes / and / in G* is no less than the sum of the corresponding terminal capacities of individual circuit realizations. Thus, the net G* is feasible. As indicated in (4.88), for any feasible net G(V, E, c,f) we must have c(i, V) = 2
(i, j) e E
(4.102)
i
or c(V, V) = 2c(G) ^ 2Ca = 2 ut
(4.103)
i
where c(V, V) denotes twice the sum of the edge capacity c(G) of G. We show that the net G*(V*, E*, c*,f*) constructed above achieves the lower bound Ca in (4.103), or c*(G*) = Ca
(4.104)
To proceed, we first define ut as in (4.87) where the max operation is taken over all branches incident at node i in the dominant requirement tree tm. It follows that w,^w,
(4.105)
But by the nature of the construction of G*, we have c*(i, V*) = Ui
(4.106)
yielding from (4.105) and (4.106) c*(V*r
v*) = 2 « , = i 2 > = 2C„
(4.107)
Since (4.103) holds for any feasible net, in particular it holds for G* or c*(V*, V*)^2Ca
(4.108)
4.6 SYNTHESIS OF OPTIMUM UNDIRECTED COMMUNICATION NETS
303
Combining (4.107) and (4.108) gives c*(V*,V*)
= 2Ca
(4.109)
Thus, G* is a feasible minimum capacity realization. This completes the proof of the theorem. Q.E.D. A consequence of the proof of the above theorem is the following. From (4.109) we obtain
S", = S",
(4.H0)
from which it follows that Ui = Ui
(4-111)
meaning that in determining w, in (4.87) we need only to check the requirements associated with the branches incident at node i of the dominant requirement tree tm. 4.6.2
Dominant Flow Realization
Recall that in synthesizing a uniform tree or subtree, we have the freedom of passing the circuit through the nodes in any order, each resulting in a feasible minimum capacity realization. However, among all these realizations, there is one whose flow function dominates all others. In other words, there exists a feasible minimum capacity net G(V, E, c,f) such that for any other feasible minimum capacity realization G(V, E, c, / ) we have f(iJW(i,j)
(4.112)
for all edges (i, j) in G and G. In the following, we describe a procedure for constructing such a net G known as the dominant flow net. Let R = [/•,-,•] be the symmetric requirement matrix, and let the elements rit of R be revised upward to yield a new requirement matrix R=m
(4.H3)
where ft, = min[uh Uj\
(4.114)
and u, and «, are defined in (4.87). As in (4.87), define «,=max^
(4.115)
304
MINIMUM TREES AND COMMUNICATION NETS
Then we have u, = u, for all i or 2 "< = 2 4-= 2 C . i
(4.116)
i
Let G(V, E, c, / ) be the net obtained by the Gomory-Hu procedure for the requirement matrix R. We shall show that if t is the terminal capacity matrix of G, then f =R
(4.117)
To establish (4.117), assume that txy > fxy where T — \txy\. Then c(x, V) ^ rxy > fxy = min [ux, uy] Without loss of generality, suppose that ux^uy.
(4.118)
Then from (4.118)
c(x, V)>ux
(4.119)
or, summing over all x e V, £{V,V)>JJui
= 2Ca
(4.120)
i
This contradicts the fact that G is a minimum capacity realization with total edge capacity equal to Ca. Thus, xxy = fxy for all x and y. Now we show that if T = [r,y] is the terminal capacity matrix of any feasible minimum capacity net G(V, E, c,f), then for all i a n d / %^r,y
(4.121)
To show this, we assume otherwise by letting xtj < Ttj for some / and / with rij>t,i = ru
(4.122)
and assume, say, that u{ t,y = fy = Uj = M,
(4. 123)
or c(V, V)>J,ut
= 2Ca
i
and the same contradiction results. Thus, %j ^ TZ>.
(4.124)
4.6 SYNTHESIS OF OPTIMUM UNDIRECTED COMMUNICATION NETS
305
In other words, there exists a feasible minimum capacity realization G such that any other such realizations G would result in no greater flow value, and more flow between any pair of nodes in G can be obtained only by increasing the total edge capacity. We illustrate the above results by the following example.
Example 4.15 Given the requirement matrix
1 2 R=3 4 5
1 2 "oo 5 5 00 9 6 2 5 _4 3
3 4 9 2 6 5 00 3 3 00 4 7
5 4 3 4 7
(4.125)
00
we construct a dominant flow net G. Using (4.87), the elements «,- (i = 1, 2, 3, 4, 5) are found from (4.125) to be u1 = 9,
w2 = 6,
u3 = 9,
u4 = 7,
u5 = 7
(4.126)
obtaining from (4.114) the revised requirement matrix 1 2
3
4
5
1 poo
6
9
7
71
2
6
oo 6
6
6
R =3
9
6
»
7
7
4
7
6
7
oo 7
5 L7
6
7
7
(4.127)
ooj
The requirement graph G R of R is shown in Fig. 4.71, from which we obtain a dominant requirement tree 1m of Fig. 4.72. This tree im can be decomposed as a sum of a uniform tree and uniform subtrees as indicated in Fig. 4.73. These uniform tree and subtrees can be synthesized as those shown in Fig. 4.74. The superposition of these circuit realizations yields a dominant flow net G of Fig. 4.75, the terminal capacity matrix of which is
Fig. 4.71. The requirement graph GR for the requirement matrix (4.127).
Fig. 4.72. A dominant requirement tree for the requirement graph of Fig. 4.71.
Fig. 4.73. The decomposition of the dominant requirement tree of Fig. 4.72 into the sum of a uniform tree and uniform subtrees.
Fig. 4.74. The synthesis of the uniform tree and subtrees of Fig. 4.73.
Fig. 4.75. A dominant flow net for the requirement matrix (4.127). 306
4.6 SYNTHESIS OF OPTIMUM UNDIRECTED COMMUNICATION NETS
307
found to be
1 2 3 4 5
t=
1 2 "oo 6 6 00 9 6 7 6 .7 6
3 4 5 9 7 7 6 6 6 00 7 7 7 00 7 7 7 00
(4.128)
showing that R is realized exactly. Applying the Gomory-Hu procedure, we can construct other feasible minimum capacity nets. Two such nets Gj and G2 are presented in Fig. 4.76, whose terminal capacity matrices l i and T2 are obtained as
1 2 3 1 "oo 6 9 2 6 00 6 n = 3 9 6 00 4 6 6 6 5 -6 6 6
1 2 T2 = 3 4 5
(a)
1 2 "00 6 6 00 9 6 5 5 .5 5
00
5 6" 6 6 7
7
00_
4 6 6 6
3 4 5 9 5 5" 6 5 5 00 5 5 5 00 7 5 7 00_
(4.129)
(4.130)
(b)
Fig. 4.76. Two feasible minimum capacity nets obtained by the Gomory-Hu procedure: (a) Gx; (b) G2.
308
MINIMUM TREES AND COMMUNICATION NETS
It is straightforward to verify that G is indeed a dominant flow net, because each element of its terminal capacity matrix is no smaller than the corresponding element in either 7| or T2, and the three nets G, G t and G2 have the same total edge capacity of 19.
4.7
ORIENTED COMMUNICATION NETS
So far we have been concerned only with undirected communication nets. These nets can be concisely and elegantly characterized in terms of the triangle inequality (4.35) or the principal partitions of (4.45). However, in the case of an oriented or directed communication net, where the flow can only be sent in the direction of an arc, no simple necessary and sufficient conditions are known. Only algorithms have been proposed to construct an oriented communication net having a preassigned real square asymmetric matrix to be its terminal capacity matrix. Examples of such algorithms can be found in Frisch and Sen (1967) and Matsui (1970). In the present section, we discuss a number of known properties of the terminal capacity matrix of an oriented communication net. Let T be the terminal capacity matrix of an oriented communication net G(V, E, c,f), which in general is real but asymmetric. The elements of T, however, still satisfy the triangle inequality (4.35).
THEOREM 4.11 If T = [TJJ] is the terminal capacity matrix of an oriented communication net, then for all /, /' and k, Tu,& min [Tik, rkJ]
(4.131)
The proof of the theorem is identical to the proof of necessity of Theorem 4.6 except that the net is now oriented instead of undirected. This triangle inequality (4.131) can easily be extended to the polygon inequality, as follows: For any i, xlt x2, • • • , xr, and j , we have Tygmin[T t e ] , TXJ
g min [ r « , ,
... , rXrj]
(4.132)
Tij ^ min [riXi, rXlX2, . . . , rXrJ]
(4.133)
TXIX2,
or ror any i, xx, x2, • . . , xr and j
However, this condition is not sufficient for the realizability of T.
4.7 ORIENTED COMMUNICATION NETS
309
DEFINITION 4.14 Semi-principal Partition. A real matrix T is said to be semi-principally partitionable if after possibly permuting rows and the corresponding columns, it can be partitioned into the form T =
(4.134)
where (i) every element in Tc is identical and is the smallest number in T, (ii) Ta and Tb are square submatrices, and (iii) every diagonal element in T is °°. r a and Tb are called the resultant main submatrices by a semi-principal partition. The definition is very similar to principal partition except tht T is not necessarily symmetric. Like the triangle inequality, the semi-principal partition is only a necessary condition for the realizability of a terminal capacity matrix but not sufficient.
THEOREM 4.12 If T is the terminal capacity matrix of an oriented communication net, then the semi-principal partition can be applied to T and all of its resultant main submatrices until all the final resultant main submatrices are of order 1. Proof. Let T be the terminal capacity matrix of an oriented communication net G(V, E, c, / ) . Then among all the cuts from one node to another in G, there is a minimum capacity cut (X, X). This cut partitions the node set V into subsets X and X = V — X. Then the terminal capacity xxy from any node xeX and yeX must be c(X, X). Every other element in T corresponds to some cut capacity not smaller than c(X, X). Thus, T can be semi-principally partitioned as X
X
X
T=
x
-Td
Th.
(4.135)
Next, among all the cuts from one node in X to another in X, there exists a minimum capacity cut (Y, Y) that partitions the node set X into the subsets W and Z such that every other such cut assumes a capacity not smaller than c(Y, Y). Thus, Ta can be principally partitioned as
a
p
w z wrr T z •2ad •*aa
^ab
(4.136)
310
MINIMUM TREES AND COMMUNICATION NETS
Clearly, this process can be applied to any resultant main submatrices until they are of order 1. The theorem follows. Q.E.D.
COROLLARY 4.4 The maximum number of numerically distinct entries in the terminal capacity matrix of an n-node oriented communication net is (n + 2){n — l)/2, excluding the entries on the main diagonal. Furthermore, there exists an n-node oriented communication net with (n + 2)(n — l ) / 2 numerically distinct entries. The corollary follows directly from the observation that in a semiprincipally partitioned T, the maximum number of numerically distinct entries above the main diagonal is n — 1, and the maximum number of such entries below the main diagonal is n(n — l)/2. The total number is therefore ( « - ! ) + \n{n - 1) = \{n + 2){n - 1)
(4.137)
Mayeda (1962) showed that an «-node oriented communication net with (n + 2)(« - l)/2 numerically distinct entries can be constructed. The net has the general configuration of Fig. 4.77, the terminal capacity matrix of which is found to be oo
n —1
2
1
oo
2
1
n"" + (n - 3) + (n - 1)
2
1
n2 + 2
oo
n" + (n - 2) T =
2n"
-1
+ (n - 3)
1
(n - 2)n3 +1
(n- 3)n3 + 1 + (« - 1)
(n - l)n2
(n - 2)n2 + ( « - ! )
(4.138)
Fig. 4.77. The general configuration of an n-node oriented communication net with (n + 2)(« - l)/2 numerically distinct entries in its terminal capacity matrix.
4.7 ORIENTED COMMUNICATION NETS
311
Fig. 4.78. The general configuration of a five-node oriented communication net with 14 numerically distinct entries in its terminal capacity matrix.
For n = 5 the net takes the form of Fig. 4.78, and its terminal capacity matrix becomes 00
5-1
5-2
2
l-
00
5-2
2
1
00
2
1
00
1
55 + 3 4
4
2x 5 +2
T =
5 +6 3
3
2x5 +5
3x5 + 1 .
4x5
3
2
2
3x5 +4
5 +4 2
2x5 +3
4
3
2
1"
3128
°°
3
2
1
1252
631
2
1
376
255
129
oo
1
. 100
79
53
27
00_
"00
2
5 +2
00 _
(4.139)
pie 4. 16 Consider the oriented communication net G(V, E, c,f) of Fig. 4.79, the terminal capacity matrix of which is found to be 2
3
4
5
1
"00
1
1
1
1
1"|
2
3
00
2
1
3
T = 3
1
1
00
1
1
4
3
3
4
00
3
5 .3
2
2
1
00
(4.140)
312
MINIMUM TREES AND COMMUNICATION NETS
Fig. 4.79. An oriented communication net used to illustrate semi-principal partition of its terminal capacity matrix.
After permuting the rows and the corresponding columns, this matrix can be semi-principally partitioned to yield 1 3
5
2
4
1
1
1
1"
1 ; oo
1
1
1
= 5
3
2
00
i2
1
2
3
2
3
I 00
4 -3
4
3
3
1 3
"00;
(4.141)
1 00 _
The matrix has four numerically distinct entries out of a possible total \{n + 2)(n - 1) = 14. Example 4.17 Consider the oriented communication net G{V, E, c,f) of Fig. 4.80, the 1
ATN
5
^
2
Fig. 4.80. An oriented communication net used to illustrate semi-principal partition of its terminal capacity matrix.
4.7 ORIENTED COMMUNICATION NETS
313
terminal capacity matrix of which is found to be
T =
9
10
11
12
13
14
3
3
3
3
3
3
3
7
3
5
11
5
3
5
2
4
2
2
4
4
2
2
2
2
6
2
2
5
6
2
2
2
00
6
6
3
6
6
5
3
6
7
2
2
00
7
2
2
9
5
2
2
1
2
2
2
2
00
2
2
5
5
2
2
3
1
6
2
5
6
6
00
7
7
5
3
7
9
3
1
6
2
3
6
6
3
00
14
5
3
8
10
2
1
2
2
2
2
2
2
2
00
3
2
2
11
2
1
2
2
2
2
2
2
2
2
00
2
2
12
3
1
6
2
4
6
6
4
6
6
5
13
3
1
3
2
3
3
3
3
3
7
4
3
14
2
1
2
2
2
2
2
2
2
2
2
2
1
2
3
4
5
6
7
1
00
1
3
2
3
3
3
2
3
00
11
2
5
9
3
2
1
00
2
2
4
2
1
2
00
5
3
1
6
6
2
1
7
2
8
6
00
to
(4.142) After permuting the rows and the corresponding columns, this matrix T can be semi-principally partitioned as follows: 11 14 10 7 3 6 1 13 9 5 8 4 2
T =
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
14
2
10
3
4
7
5
5
5
00
3
4
4
4
4
6
5
5
9
7
7
00
2
2
2
2
2
to to to to to to
11
1
3
3
3
3
3
3
00
3
3
3
3
3
2
1
13
4
5
7
3
3
3
3
3
3
3
3
2
1
9
5
5
14
6
6
6
3
8
00
3
3
3
2
1
5
5
5
6
6
6
6
3
6
6
00
: 3
3
2
1
8
5
5
7
6
6
6
3
7
7
5
! oo
3
2
1
12
5
5
6
6
6
6
3
6
6
4
4
2
1
4
6
5
5
6
2
2
2
2
2
2
2
2
00
1
2
Ls
5
11
7
11
9
3
5
5
5
3
3
2
00
^00
00
00
00
00
i l
00
1"
2
1
2
1
2
1
2
1
2
1
(4.143)
314
MINIMUM TREES AND COMMUNICATION NETS
4.8
SUMMARY AND SUGGESTED READING
We began this chapter by introducing the notions of forests, subtrees and trees and showed that every tree of a connected graph can be obtained from any other one by a finite sequence of elementary tree transformations. We then considered the minimum and maximum tree problems by presenting the greedy method, which builds up a minimum tree edge by edge by including appropriate short edges and excluding appropriate long edges until a minimum tree is constructed. Since edge lengths are allowed to be negative, when we can solve the minimum tree problem, we can also solve the maximum tree problem. All we have to do is to multiply each edge length by —1 and solve the corresponding minimum tree problem. For this reason, we only state the algorithms for solving the minimum tree problem, leaving the maximum tree problem as obvious. Three well-known minimum tree algorithms that are variants of the greedy method were examined. The Kruskal algorithm generates blue subtrees in an irregular fashion dictated solely by the edge lengths, and the Prim algorithm grows a blue subtree from a single root. The Boruvka algorithm, on the other hand, builds up blue subtrees uniformly throughout the net, and is therefore well suited for parallel computation. In the remainder of the chapter, we studied the terminal capacity matrix of a communication net and its realizability. We showed that a real symmetric matrix is the terminal capacity matrix of an undirected communication net if and only if its elements satisfy the triangle inequality or the matrix is principally partitionable, so do its resultant main submatrices. We demonstrated that every undirected communication net is flowequivalent to a tree and there are at most n — 1 numerically distinct terminal capacity values in an n-node net. We gave an algorithm for determining the elements of the terminal capacity matrix of an w-node undirected communication net by solving precisely n — 1 maximum flow problems. Moreover, many of these problems are solved in smaller and more simplified nets than the original one. We also studied the inverse problem of synthesizing a net having a preassigned lower bound on the maximum flow value between every pair of nodes with a minimum total edge capacity. The procedure uses the dominant requirement tree and then decomposes it into a sum of uniform requirement forests. Each such uniform requirement forest is synthesized at its total lower bound capacity. The resulting net obtained by superposition of these individual realizations would satisfy the original flow requirements with a minimum total edge capacity. However, among many of these minimum-capacity realizations, there is one which dominates all others. Finally, we discussed a number of known properties of the terminal capacity matrix of an oriented communication net. We showed that the elements of this matrix satisfy the triangle inequality, and that the matrix itself is semi-principally partitionable, so do its resultant main submatrices.
REFERENCES
315
However, these conditions are not sufficient for its realizability. In the oriented case, the maximum number of numerically distinct entries in the terminal capacity matrix is (n + 2)(n - l)/2, excluding the entries on the main diagonal. The standard book for communication nets is Frank and Frisch (1971). For a concise exposition on minimum tree problems, we refer to Tarjan (1983), and for undirected communication net problems, see Hu (1982). For further study on the various algorithms, the reader is referred to the original papers listed in the references. REFERENCES Agarwal, A. K. and Arora, S. R. (1976), "Synthesis of multiterminal communication nets: Finding one or all solutions," IEEE Trans. Circuits and Systems, vol. CAS-23, pp. 141-146. Akers, S. B. Ir (1960), "Use of the wye-delta transformation in network simplification," Operations Res., vol. 8, pp. 311-323. Ali, A. (1965), "Realizability conditions of special types of oriented communication nets," IEEE Trans. Circuit Theory, vol. CT-12, p. 417. Barnard, H. M. (1965), "Note on completely partitionable terminal capacity matrices," IEEE Trans. Circuit Theory, vol. CT-12, p. 122. Bentely, J. L. (1980), "A parallel algorithm for constructing minimum spanning trees," / . Algorithms, vol. 1, pp. 51-59. Berge, C. and Ghouila-Houri, A. (1965), Programming, Games, and Transportation Networks, New York: John Wiley. Blum, M., Floyd, R. W., Pratt, V. R., Rivest, R. L. and Tarjan, R.E. (1973), "Time bounds for selection," J. Comput. System Sci., vol. 7, pp. 448-461. Bock, F. (1971), "An algorithm to construct a minimum directed spanning tree in a directed network," in Developments in Operations Research, New York: Gordon and Breach, pp. 29-44. Boruvka, O. (1926), " O jistem problemu minimalnim," Prdca Moravske Pfirodovedecke Spolecnosti, vol. 3, pp. 37-58. Chen, C. (1974), "Realizability of communication nets: An application of the Zadeh criterion," IEEE Trans. Circuits and Systems, vol. CAS-21, pp. 150-151. Cheriton, D. and Tarjan, R. E. (1976), "Finding minimum spanning trees," SIAM J. Computing, vol. 5, pp. 724-742. Chien, R. T. (1960), "Synthesis of a communication net," IBM J. Res. Develop., vol. 4, pp. 311-320. Choquet, G. (1938), "Etude de certains reseaux de routes," C. R. Acad. Sci. Paris, vol. 206, pp. 310-313. Dalai, Y. K. (1987), "A distributed algorithm for constructing minimal spanning trees," IEEE Trans. Software Engineering, vol. SE-13, pp. 398-405. Dijkstra, E. W. (1959), "A note on two problems in connexion with graphs," Numerische Math., vol. 1, pp. 269-271.
316
MINIMUM TREES AND COMMUNICATION NETS
Ford, L. R. Jr and Fulkerson, D. R. (1962), Flows in Networks, Princeton, N.J.: Princeton University Press. Frank, H. and Frisch, I. T. (1971), Communication, Transmission, and Transportation Networks, Reading, Mass.: Addison-Wesley. Frisch, I. T. and Sen, D. K. (1967), "Algorithms for synthesis of oriented communication nets," IEEE Trans. Circuit Theory, vol. CT-14, pp. 370-379. Frisch, I. T. and Shein, N. P. (1969), "Necessary and sufficient conditions for realizability of vertex weighted nets," IEEE Trans. Circuit Theory, vol. CT-16, pp. 496-502. Gallager, R. G., Humblet, P. A. and Spira, P. M. (1983), "A distributed algorithm for minimum-weight spanning trees," ACM Trans. Program. Lang. Syst, vol. 5, pp. 66-77. Gomory, R. E. and Hu, T. C. (1961), "Multiterminal network flows," SIAM J. Applied Math., vol. 9, pp. 551-570. Gomory, R. E. and Hu, T. C. (1964), "Synthesis of a communication network," SIAM J. Applied Math., vol. 12, pp. 348-369. Gupta, R. P. (1966), "On flows in pseudosymmetric networks," SIAM J. Applied Math., vol. 14, pp. 215-225. Gusfield, D. (1983), "Simple constructions for multi-terminal network flow synthesis," SIAM J. Computing, vol. 12, pp. 157-165. Hu, T. C. (1974), "Optimum communication spanning tree," SIAM J. Computing, vol. 3, pp. 188-195. Hu, T. C. (1982), Combinatorial Algorithms, Reading, Mass.: Addison-Wesley. Jarnik, V. (1930), " O jistem problemu minimalmm," Prdca Moravske Pfirodovedecke Spolecnosti, vol. 6, pp. 57-63. Jelinek, F. (1963), "On the maximum number of different entries in the terminal capacity matrix of an oriented communication net," IEEE Trans. Circuit Theory, vol. CT-10, pp. 308-309. Johnson, D. B. (1975), "Priority queues with update and finding minimum spanning trees," Inf. Process. Lett., vol. 4, pp. 53-57. Kruskal, J. B. (1956), "On the shortest spanning subtree of a graph and the traveling salesman problem," Proc. Amer. Math. Soc, vol. 7, pp. 48-50. Lukasziewicz, L., Florek, K., Perkal, J., Steinhaus, H. and Zubrzycki, S. (1951), "Sur la liaison et la division des points d'un ensemble fini," Colloq. Math., vol. 2, pp. 282-285. Maffioli, F. (1981), "Complexity of optimum undirected tree problems: A survey of recent results," in Analysis and Design of Algorithms in Combinatorial Optimization, International Center for Mechanical Sciences, Courses and Lectures 266. New York: Springer-Verlag. Matsui, K. (1970), "Synthesis of oriented communication nets," Electronics and Communications in Japan, vol. 53-A, pp. 15-20. Mayeda, W. (1960), "Terminal and branch capacity matrices of a communication net," IRE Trans. Circuit Theory, vol. CT-7, pp. 260-269. Mayeda, W. (1962), "On oriented communication nets," IRE Trans. Circuit Theory, vol. CT-9, pp. 261-267.
REFERENCES
317
Ozawa, T. (1980), "Realization of a symmetric terminal capacity matrix by a tree with the minimum diameter," Networks, vol. 10, pp. 129-141. Pierce, A. R. (1975), "Bibliography on algorithms for shortest path, shortest spanning tree and related circuit routing problems (1956-1974)," Networks, vol. 5, pp. 129-149. Prim, R. C. (1957), "Shortest connection networks and some generalizations," Bell System Tech. J., vol. 36, pp. 1389-1401. Resh, J. A. (1965), "On the synthesis of oriented communication nets," IEEE Trans. Circuit Theory, vol. CT-12, pp. 540-546. Schonhage, A., Paterson, M. and Pippenger, N. (1976), "Finding the median," / . Comput. System Sci., vol. 13, pp. 184-199. Spira, P. M. and Pan, A. (1975), "On finding and updating spanning trees and shortest paths," SIAM J. Computing, vol. 4, pp. 375-380. Tang, D. T. and Chien, R. T. (1961), "Analysis and synthesis techniques of oriented communication nets," IRE Trans. Circuit Theory, vol. CT-8, pp. 39-44. Tapia, M. A. and Myers, B. R. (1967), "Generation of concave node weighted trees," IEEE Trans. Circuit Theory, vol. CT-14, pp. 229-230. Tarjan, R. E. (1981), "Minimum spanning trees," Technical Memo., Bell Labs., Murray Hill, N.J. Tarjan, R. E. (1982), "Sensitivity analysis of minimum spanning trees and shortest path trees," Inf. Process. Lett., vol. 14, pp. 30-33. Tarjan, R. E. (1983), Data Structures and Network Algorithms, Philadelphia, Penn.: Society for Industrial and Applied Mathematics. Whitney, H. (1935), "On the abstract properties of linear dependence," Amer. J. Math., vol. 57, pp. 509-533. Wing, O. and Chien, R. T. (1961), "Optimal synthesis of a communication net," IRE Trans. Circuit Theory, vol. CT-8, pp. 44-49. Yao, A. (1975), "An 0(\E\ log log |V|) algorithm for finding minimum spanning trees," Inf. Process. Lett., vol. 4, pp. 21-23. Yau, S. S. (1961), "On the structure of a communication net," IRE Trans. Circuit Theory, vol. CT-8, p. 365. Yau, S. S. (1962), "Synthesis of radio-communication nets," IRE Trans. Circuit Theory, vol. CT-9, pp. 62-68.
5 FEASIBILITY THEOREMS AND THEIR APPLICATIONS
In Chapter 3, we discussed the flow problems in a network. A flow pattern is said to be feasible if it satisfies the arc capacity constraints and the conservation equation for all the intermediate nodes. Our objective there was to find a maximum feasible flow pattern for a general net. We showed that the maximum flow value from the source s to the sink t in a net is equal to the capacity of a minimum s-t cut separating the source and the sink. This is known as the max-flow min-cut theorem. The remainder of Chapter 3 is primarily concerned with the various algorithms for finding a maximum flow in a net. In the present chapter, we develop several theorems characterizing the existence of network flows that satisfy additional linear inequalities of various kinds. Specifically, we give necessary and sufficient conditions for the existence of a flow pattern that satisfies the "demands" at certain nodes from the "supplies" at some of the others, or that satisfies both the lower and upper bounds of the arc flows. Since the proofs of these theorems rely on the max-flow min-cut theorem, it follows from the integrity theorem (Theorem 3.4) that if the additional constraints are integral, then integral feasible flows exist provided that there are any feasible flows. These results are then used to pose and solve a number of combinatorial problems in operations research.
5.1
A SUPPLY-DEMAND THEOREM
Given a net G(V, E, c, / ) with node set V, arc set E, capacity function c and flow function /, partition the node set V into the disjoint source set S, 318
5.1 A SUPPLY-DEMAND THEOREM
319
intermediate node set R, and the sink set T. Associate with each x e S a nonnegative real number a(x) called the supply of some commodity at node x, and with each x eT a nonnegative real number b(x), the demand for the commodity at node x. Thus, the supplies in G can be considered as a function a from the source set 5 to the nonnegative reals, and the demands as a function b from the sink set T to the nonnegative reals. The objective is to determine the existence of a flow pattern in G, so that the demands at the sink set T can be fulfilled from the supplies at the source set 5 satisfying the constraints f(x,V)-f(V,x)^a(x),
xeS
(5.1)
f(x,V)-f(V,x)
= 0,
xeR
(5.2)
f(V,x)-f(x,V)^b(x),
xeT
(5.3)
(x,y)eE
(5.4)
c(x,y)*f(x,y)^0,
If such a solution exists, we say that the constraints (5.1)-(5.4) are feasible. Otherwise, they are infeasible. Consider, for example, the net G(V, E, c,f) of Fig. 5.1, having the arc capacities as indicated. The node set V is partitioned into the source set S, intermediate node set R, and the sink set T, as follows: 5 = {1,2},
J? = {3, 4, 5},
r = {6,7}
(5.5)
Suppose that the supplies of some commodity at nodes in 5 and the demands for the commodity at nodes in T are specified as fl(l) = 7, 6(6) = 7,
a(2) = 10 6(7) = 8
(5.6) (5.7)
respectively. A flow pattern in meeting the demands from the supplies is
Fig. 5.1. A net with source nodes 1 and 2 and sink nodes 6 and 7.
320
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
a(2) = 10(2
Fig. 5.2. A feasible flow pattern for the net of Fig. 5.1. shown in Fig. 5.2, in which the second numbers adjacent to the arcs represent the amounts of flow in the arcs. The constraints (5.1)-(5.4) become / ( l , V) -f(V, 1) = 3 + 3 - 0 = 6 ^ a ( l ) = 7
(5.8a)
/ ( 2 , V) -f(V, 2) = 9 + 4 - 3 = 1 0 = a ( 2 ) = 10
(5.86)
/(3,V)-/(V,3) = 2 + l - 3 = 0
(5.9a)
/ ( 4 , V)-f(V,
(5.96)
4) = 6 + 2 + 2 + 0 - 9 - 1 = 0
f(5,V)-f(V, 5) = 6 - 4 - 2 = 0
(5.9c)
f(V, 6) - / ( 6 , V) = 2 + 6 - 1 = 7=-6(6) = 7
(5.10a)
f(V, 7) - / ( 7 , V ) = 1 + 2 + 6 = 9 ^ 6 ( 7 ) = 8
(5.106)
confirming that the flow pattern of Fig. 5.2 or the above supply-demand constraints are feasible. The general necessary and sufficient conditions for the existence of a flow pattern in a net that satisfies the supply-demand constraints were first given by Gale (1957) and are stated below as a supply-demand theorem.
THEOREM 5.1 Partition the node set V of a given net G(V, E, c, / ) into three disjoint subsets S, R and T. Associate with each x e S a supply a(x) = 0 at x and with each y e T a demand 6(y) = 0 at y. Then the constraints
f(x,V)-f(y,x)^a(x), f(x,V)-f(V,x) = 0, f(V,x)-f{x,V)^b{x), c(x,y)^f(x,y)^0,
xeS
(5.11)
xeR xeT
(5.12)
{x, y)eE
(5.13) (5.14)
5.1 A SUPPLY-DEMAND THEOREM
321
are feasible if and only if b(TnX)-a(SDX)^c(X,X)
(5.15)
holds for every subset X c.V, where X = V — X. Proof. Necessity. Assume that there is a flow f in G satisfying the constraints (5.11)—(5.14). Then by summing equations (5.12) and inequalities (5.11) and (5.13) over x e X yields
f(snx,v)-f(v,snx)^a(snx) f(RnX,V)-f(V,RnX) = 0 f(v,Tnx)-f(Tnx,v)^b(Tnx)
(5.16) (5.17) (5.18)
Rewriting (5.16) and (5.17) as
f(v,snx)-f(snx,v)^-a(snx) f(V, RnX)-f(RDX,V) = 0
(5.19) (5.20)
and combining these with (5.18), we obtain
f(v, mx) +f(y, snx) +f(v, «ni)-/(rnx, v) -f(s nx, v) -f(Rnx,v)^b(Tnx)-a(snx) (5.21) or equivalently f(V, X) -f(X, V) ^ b{T <1X)- a(S n X)
(5.22)
Using V = X U X in (5.22) gives f(X, X) -f(X, X) ^ b(T nX)- a(S n X)
(5.23)
Since/satisfies (5.14), summing over x eX and y eX results in f{X, X) -f{X, X) g c(X, X)
(5.24)
Combining this with (5.23) shows that the constraint b(TnX)-a(SnX)^c(X,X)
(5.25)
must hold for every subset X c. V. Sufficiency. To prove sufficiency, we construct a new net Gi(Vi, Ex, c1,fi) from G(V, E, c,f) by adjoining a fictitious source s, sink
322
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
«(*,)
^0*\
y
.-0*2
yzcx.
s
a(x2)
CKV.E.cf)
T
• • •
a(xp)
. • •
^o*.
b(y„)
y,o<
Fig. 5.3. The extended net Gi(V„ Eu c „ / 0 of the net G(V, E, c,f). t, and the arcs (s, S) and (T, t), as depicted in Fig. 5.3. Thus, we have Vi = VU{s,t},
E1 = EU(s,S)U(T,t)
(5.26)
The capacity function cx on Ex is defined by c^s, x) = a(x),
x eS
(5.27a)
cr(x, t) = b{x),
xeT
(5.27 b)
y)eE
(5.27c)
Ci(x, y) = c(x, y),
(x,
We now show that the inequality (5.15) holds for every subset I c V if and only if it holds for the cut (T, t) in Gy. The implication is that (T, t) is a minimum s-t cut in Gt. To see this, let (Xlt Xx) be any s-t cut in Glt and define X = X1-{s},
X =
(5.28)
Xl-{t)
Consider the expansion Cl(Xu
Xx) -
Cl(T,
t) = Cl(X, t) + cy(X, X) + Cl(s, X) - cx(T, t) = b(TDX) = c(X,X)
+ c(X,X)
+
a(SnX)-b(T)
+ a(SnX)-b(TDX)
By assumption, (5.15) holds for every subset X cV. CJC^.A-O-C.^OSO
(5.29)
Thus, the inequality (5.30)
holds for all s-t cuts (Xlr Xx) of Glt showing that (T, t) is a minimum s-t cut in Gy. Our conclusion is that (5.15) holds for all X c V if and only if (5.30) holds for all s-t cuts in Gy. Since (T, t) is a minimum s-t cut in Gy, by the max-flow min-cut theorem (Theorem 3.2) there exists a flow fy from s to t in Gy that saturates all the
5.1 A SUPPLY-DEMAND THEOREM
323
arcs of (T, t). Define f(x,y)=f1(x,y),
(x,y)eE
(5.31)
Clearly, /satisfies (5.12) and (5.14). To see that / also satisfies (5.11) and (5.13), we consider for all x e S and y e T the equations Ms, x) =f1(x, V) - / , ( V , x) =f(x,
V) -f(V, x)
My, t) =MV, y) -My, v) =f(v, y) - / ( y , v)
(5.32)
(5.33)
Since by construction a(x)^Ms,x)
(5.34)
b(y)=My,t)
(5.35)
the inequalities (5.11) and (5.13) follow. This completes the proof of the theorem. The necessary and sufficient conditions for the supply-demand feasibility constraints (5.15) are stated in terms of a set of inequalities. If a supply is considered as a negative demand, condition (5.15) states that the net demand over any subset of the node set of a net cannot exceed the capacity of the arcs leading into the subset. In other words, if the problem is feasible, then it must be possible to send into any subset of the node set a total amount that is at least equal to the excess of demand over supply for the subset. If this condition is satisfied for all subsets of the node set, then the problem is feasible. Otherwise, it is infeasible. For example, consider the net G(V, E, c, f) of Fig. 5.4 with source nodes 1 and 2 and sink nodes 6 and 7. The supplies and demands of these nodes are given by a ( l ) = 10,
a(2) = 3,
b{6) = 5,
b(7) = 8
(5.36)
as indicated in Fig. 5.4. A flow pattern that almost succeeds in meeting the demands from the sources is presented in Fig. 5.5, in which the second numbers adjacent to the arcs denote their flow values. To ascertain the feasibility of this problem, we apply Theorem 5.1 with S = {1,2},
R = {3,4,5},
r={6,7}
(5.37)
Using the cut ( * , * ) = ({1,3, 4, 6}, {2, 5, 7})
(5.38)
324
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
a(l) = 10
^)b(6) = 5
a(2) = 3
*(7)=8
Fig. 5.4. A net used to illustrate the feasibility theorem.
in (5.15) yields b{T f l i ) - a{S n l ) = b(l) - a(2) = 8 - 3 = 5 $ c(X, X) = c(l, 2) + c(4, 5) + c(4, 7) = 4
(5.39)
Thus, condition (5.15) is not satisfied for some Xc.V, therefore infeasible. Alternatively, the cut
and the problem is
(X-X) = ( { 1 , 2 , 3 , 4 > 5 , 6 } , { 7 »
(5.40)
also violates condition (5.15):
b(TnX)-a(SnX)
= b(7)-a{{
}) = 8^c(X, X) = 7
(5.41)
To see that the flow pattern of Fig. 5.5 represents the best one can do, we consider the extended net G-SYi, Elt clt /i) of Fig. 5.6, which is obtained +~(Y,Y)
a(l)=10
(X,X)
Fig. 5.5. A maximum flow pattern used to illustrate the feasibility theorem.
5.1 A SUPPLY-DEMAND THEOREM
325
Fig. 5.6. An extended net of the net of Fig. 5.5 used to demonstrate that the flow pattern in Fig. 5.5 is maximum. from G by adjoining a fictitious source s, sink t, and the arcs (s, S) and (T, t) with arc capacities as indicated in the figure. The flow in the net G1 of Fig. 5.6 is maximum because by the max-flow min-cut theorem the s-t cut (Yu Y,) = ({s, 1, 2, 3, 4, 5}, {6, 1, t})
(5.42)
is minimum. The restriction of (Ylt Y,) in G gives the corresponding partition (Y, Y) as depicted in Fig. 5.5. In practice, if we are interested in ascertaining the feasibility of a given supply-demand net G(V, E, c, f), the most efficient way to do this is to use the Ford-Fulkerson algorithm of Section 3.2 to solve the equivalent maximum flow problem in the extended net G^Vi, E1,c1,fl) of Fig. 5.3, rather than to check condition (5.15) for all subsets of the node set of G. If the problem is infeasible, a violation of condition (5.15) will be detected at the conclusion of the computation of the algorithm by taking X and X to be the labeled and unlabeled nodes of V, respectively. For example, if we wish to ascertain the feasibility of the supply-demand net G(V, E, c, f) of Fig. 5.5, we consider the extended net G^V,, Elt clt /i) of Fig. 5.6. Assume that the initial flow is as indicated in Fig. 5.6. Applying the Ford-Fulkerson algorithm yields the node labels as shown in Fig. 5.6. Then by taking Z = {s, 1, 3, 4}
(5.43a)
Z= {2,5,6,7,t}
(5.43b)
to be the labeled and unlabeled nodes of V, respectively, a subset * = Z - { * } = {!, 3, 4}
(5.44)
326
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
of V violating condition (5.15) is detected. To verify, we use (5.44) in (5.15) and obtain b(TnX)-a(S
nX) = b({6, 7}) - a ( 2 ) = 5 + 8 - 3 = 10 $c(X,X)
=l +l +2+5=9
(5.45)
where X = Z-{t}
= {2,5,6,7}
(5.46)
Recall that in the proof of Theorem 5.1 we appealed to the max-flow min-cut theorem (Theorem 3.2). In the following, we demonstrate that Theorem 5.1 implies the max-flow min-cut theorem. To see this, let G(V, E, c, / ) be a net with source s and sink t and let (X, X) be a minimum s-t cut of G. Suppose that we place a demand equal to c(X, X) at the sink t and an infinite supply at the source s. All other nodes of V are intermediate nodes. In terms of the symbols used in the supply-demand theorem (Theorem 5.1), we can make the following identifications: a(s) = oo, S = {s),
b(t) = c(X, X)
R = V-{s,t},
T = {t}
(5.47a) (5.476)
Then according to Theorem 5.1 the constraints
f(s,V)-f(V,s)=fsl f(x,V)-f(V,x)
(5.48a) = 0,
x*s,t
(5.48c)
f(V,t)-f(t,V)*c(X,X) c(x,y)^f(x,y)^0,
(5.486)
(x,y)eE
(5.49)
are feasible if and only if b(T n Y) - a(S n Y) ^ c(Y, Y)
(5.50)
holds for all subsets Y c.V, where Y =V — Y. For s e Y a(Sn?)
= a(s) = ™
(5.51)
= b({ }) = 0
(5.52)
and for t e Y b(Tn?)
In either case, condition (5.50) is satisfied. Therefore, we assume that s e Y and t e Y and (5.50) reduces to b(t) =
c(X,X)^c(Y,Y)
(5.53)
5.1 A SUPPLY-DEMAND THEOREM
327
since a(S D Y) = 0. But by assumption (X, X) is a minimum s-t cut and (Y, Y) is an arbitrary s-t cut. The inequality (5.53) is always satisfied. The constraints (5.48) and (5.49) are, therefore, feasible. In other words, there exists a flow from s to ( i n G with a value of at least c(X, X). Invoking Theorem 3.1 which states that the flow value from s to t in G cannot exceed the capacity of any s-t cut, c{X, X) is also the maximum flow value from 5 to t in G. The max-flow min-cut theorem follows. Theorem 5.1 can also be stated in terms of the aggregate demand at the sinks. Specifically, we show that if, corresponding to each subset of the sinks, there is a flow satisfying the aggregate demand of the subset without exceeding the supply limitations at each of the sources, then there exists a flow in the net meeting all the individual demands. This result, due to Gale (1957), is stated as follows.
THEOREM 5.2 Partition the node set V of a given net G(V, E, c,f) into three disjoint subsets S, R and T. Associate with each x e S a supply a(x) i? 0 at x and with each y e T a demand b(y) at y. Then the constraints f(x,V)-f(V,x)^a(x), f(x,V)-f{V,x) f(V, x) -f{x,
xeS
(5.54)
xeR
(5.55)
xeT
(5.56)
= 0, V) ^b(x),
c(x,y)^f(x,y)^0,
(x,y)eE
(5.57)
are feasible if and only if, for every subset Ta c T, there exists a flow fa in G satisfying fa(x, V) -fa(V,
x) ^ a(x),
xeS
(5.58)
fa(x, V) -fa(V,
x) = 0,
xeR
(5.59)
c(x,y)^fa(x,y)^0,
{x,y)eE
(5.60)
and fa(V, Ta) -fa(Ta,
V) ^ b(Ta)
(5.61)
Proof. The necessity is obvious. To prove sufficiency, let X and X= V -X be a partition of the node set V such that ( I - T J c I and Ta c X Since by hypothesis the flow/„ satisfies (5.58), (5.59) and (5.61), it follows immediately by summing these equations and inequalities over the
328
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
subsets 5 fl X, RC\X and T D X = Ta, respectively, that
fa(S nx,v)- fa(v, snx)^a(sn x) fa(Rnx, v)-fa(v,«ni) =o fa(V, TnX)-fa(TnX,V)^b(TnX)
(5.62) (5.63) (5.64)
Multiplying (5.62) and (5.63) by —1, reversing the inequality sign in (5.62), and adding the resulting inequality and equation to (5.64), we obtain
fa(v, snx) +fa(v, Rnx) +fa(v, m i ) ~fa(s nX, v) -fa(R nx, V)-fa(Tni,y)gb(Tnx)-a(snx)
(5.65)
or equivalently b(T DX)- a(S D X) ^fa(V, X) -fa(X, V) =fa(X, X) -fa(X, X)
(5.66)
Appealing to (5.60) by summing those equations over all {x, y) e (X, X) yields c(X, X)^fa(X,
X)^0
(5.67)
Using this in (5.66) and noting that fa(X, X)^0 gives b(T(lX)-a(SnX)^c(X,X)
(5.68)
showing that condition (5.15) is fulfilled for all subsets XcV. Thus, by Theorem 5.1 the constraints (5.54)-(5.57) are feasible. This completes the proof of the theorem. Dually, we can show that if, corresponding to each subset of the sources, there is a flow satisfying all individual demands without exceeding the aggregate supply of the subset with the supply at the sources outside the subset being infinite, then there exists a flow in the net meeting all the individual supplies and demands. We summarize this result as follows. THEOREM 5.3 Partition the node set V of a given net G(V, E, c, f) into three disjoint subsets S, R, and T. Associate with each x e S a supply a(x) ^ 0 at x and with each y e T a demand b(y) at v. Then the constraints f(x, V) -f(V, x)^a(x),
xeS
(5.69)
f(x,V)-f(V,x)
xeR
(5.70)
= 0,
5.1 A SUPPLY-DEMAND THEOREM
f(V,x)-f(x,V)^b(x),
xeT
c(x,y)^f(x,y)*0,
(x,y)eE
329
(5.71) (5.72)
are feasible if and only if, for every subset Sa c S, there exists a flow fa in G satisfying fa(x,V)-fa(V,x)
= 0,
fa(V, x) -fa(x,
V) g b(x),
c(x,y)*fa{x,y)*0,
xeR
(5.73)
xe T
(5.74)
(x,y)eE
(5.75)
and fa{Sa, V) -fa(V,
Sa) ^ a(Sa)
(5.76)
Observe that in proving Theorem 5.1 we used only the max-flow min-cut theorem (Theorem 3.2), and that Theorems 5.2 and 5.3 were derived directly from Theorem 5.1. As a result, if the functions a, b and c are integral valued and if there exists a feasible flow, then by the integrity theorem (Theorem 3.4) there is an integral feasible flow.
THEOREM 5.4 If there is a feasible flow for the constraints (5.11)-(5.14), (5.54)-(5.57), or (5.69)-(5.72), and H the supply function a, the demand function b, and the capacity function c are integral valued, then there is an integral feasible flow for these constraints. We illustrate the above results by the following examples. Example 5.1 We use the supply-demand net G(V, E, c,f) of Fig. 5.1, which for convenience is redrawn in Fig. 5.7, to determine its feasibility. Instead of applying Theorem 5.1 to determine the feasibility of the constraints for the net G of Fig. 5.7, which requires the checking of 27 = 128 inequalities of the type (5.15), we use the Ford-Fulkerson algorithm of Section 3.2 to calculate the maximum flow from the source 5 to the sink t in the extended net Gi(Vi, Elt C J . / J ) of Fig. 5.8. The extended net G t is obtained from G by adjoining a fictitious source s, sink t, and the arcs (s, 1), (s, 2), (6, t) and (7, t) with capacities Ciis, l) = a ( l ) = 7,
c^s, 2) = a(2) = 10
c x (6, t) = 6(6) = 1,
C l (7,
0 = b{l) = 8
(5.77)
330
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
Fig. 5.7. A supply-demand net used to illustrate the feasibility theorem.
Applying the Ford-Fulkerson algorithm to G 1; a final feasible flow pattern together with the associated node labels is as indicated in Fig. 5.8. Since the s-t cut (T, t) = ({s, I, 2, 3, 4, 5, 6, 7}, t) = {(6, t), (7, t)}
(5.78)
is minimum, being saturated, the problem is feasible. A feasible flow/for the net G is obtained by restricting /i to E. The result is shown in Fig. 5.9. Q.E.D. We remark that the feasible flow of Fig. 5.9 meets the demands at the sinks 6 and 7 without exceeding the supplies at 1 and 2. This does not imply that we cannot find other feasible flows that can do "better". For example, the feasible flow shown in Fig. 5.2 supplies 16 units to the sinks 6 and 7 from the sources 1 and 2 instead of the 15 for the flow of Fig. 5.9. (4,-,D
(2,©,1)
Fig. 5.8. An extended net of the supply-demand net of Fig. 5.7 used to calculate the maximum flow from s to t.
5.1 A SUPPLY-DEMAND THEOREM
331
Fig. 5.9. A feasible flow pattern for the supply-demand net of Fig. 5.7. Example 5.2 We use the net G(V, E, c,f) of Fig. 5.7 to illustrate Theorems 5.2 and 5.3. From Fig. 5.7 we can make the following identifications: 5 = {1,2},
R = {3,4,5},
T = {6,7}
(5.79)
First, we apply Theorem 5.2 to verify that there is a feasible flow in G. To this end, we consider the subsets Ta = {6}, {7}, and {6, 7} of T. The empty subset is not included because the constraints (5.58)-(5.61) can always be fulfilled with zero flow. For Ta = {6}, a flow fal meeting the demand at sink 6 without exceeding the individual supplies at the sources 1 and 2 is shown in Fig. 5.10. This flow/ttl, however, does not meet the demand at sink 7. For Ta = {7}, a flow fa2 meeting the demand at sink 7 without exceeding the individual supplies at sources 1 and 2 is presented in Fig. 5.11. Observe that this flow/a2 does not meet the demand at sink 6. Finally, for Ta = {6, 7} a flow fa3 meeting the aggregate demand, b(6) + b(7) = 7 + 8=15
(5.80)
Fig. 5.10. A flow pattern meeting the demand at sink 6 without exceeding the individual supplies at sources 1 and 2.
332
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
Fig. 5.11. A flow pattern meeting the demand at sink 7 without exceeding the individual supplies at sources 1 and 2.
without exceeding the individual supplies at sources 1 and 2 is given in Fig. 5.12. Notice that this flow fa3 does not meet the individual demand at sink 7. Since, corresponding to each subset Ta c T, there is a flow satisfying the aggregate demand of the subset without exceeding the supply limitations at each of the sources, according to Theorem 5.2 there exists a flow in the net G meeting all the individual demands without exceeding the supply limitations at each of the sources. Such a flow is shown in Fig. 5.9. Next, we apply Theorem 5.3 to verify the existence of a feasible flow in G. For this we consider the subsets Sa = {1}, {2}, and {1,2} of 5. Again, the trivial empty subset is not included. For Sa = {1}, a flow fa4 meeting the individual demands at sinks 6 and 7 without exceeding the supply at source 1 is given in Fig. 5.13, where the supply at source 2 was set to infinity. Observe that in this case the supply at source 2 exceeds the original supply limitation by 3 ( = 13 — 10). Likewise, for Sa = {2} a flow fa5 meeting the individual demands at sinks 6 and 7 without exceeding the
Fig. 5.12. A flow pattern meeting the aggregate demand of sinks 6 and 7 without exceeding the individual supplies at sources 1 and 2.
5.1 A SUPPLY-DEMAND THEOREM
333
Fig. 5.13. A flow pattern meeting the individual demands at sinks 6 and 7 without exceeding the supply at source 1. The supply at source 2 was set to infinity.
supply at source 2 is presented in Fig. 5.14. Finally, for Sa = {1, 2} there is a flow fa6 satisfying all individual demands at sinks 6 and 7 without exceeding the aggregate supply, fl(l) + a(2) = 7 + 10 = 17
(5.81)
at sources 1 and 2. This fiow/ r t , being equal tofa5, is again shown in Fig. 5.14. Thus, according to Theorem 5.3 there exists a flow in G meeting all the individual demands without exceeding the supply limitations at each of the sources. Such a flow is shown in Fig. 5.9 or 5.14. Q.E.D.
Fig. 5.14. A flow pattern meeting the individual demands at sinks 6 and 7 without exceeding the supply at source 2. The supply at source 1 was set to infinity. Example 5.3 Consider the supply-demand net G(V, E, c,f) of Fig. 5.15 with a(l) = 10,
a(2) = 3,
b(6) = 5,
b(7) = 8
(5.82)
334
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
Fig. 5.15. An infeasible supply-demand net.
We wish to ascertain the feasibility of this net. From Fig. 5.15 we have S = {1,2},
R = {3,4,5},
r={6,7}
(5.83)
To apply Theorem 5.3, we consider the subsets Sa = {1}, {2}, and {1, 2}. For Sa = {1} a l o w / , ! meeting the individual demands at sinks 6 and 7 without exceeding the supply at source 1 is shown in Fig. 5.16, where the supply at source 2 was set to infinity. This flow fal does not exceed the aggregate supply a ( l ) + o(2) = 10 + 3 = 13
(5.84)
of the subset Sa = {1, 2} of sources 1 and 2. Finally, for the subset Sa = {2} we set a{\) = » in Fig. 5.15. To meet the demand at sink 7, arcs (4, 7) and (5, 7) must be saturated. This in turn requires that the flow value in arc (2, 5) be at least 5, or source 2 must provide a supply of at least 4, exceeding its supply limitation. Therefore, there does not exist a
Fig. 5.16. A flow pattern meeting the individual demands at sinks 6 and 7 without exceeding the supply at source 1. The supply at source 2 was set to infinity.
5.2 AN EXTENDED SUPPLY-DEMAND THEOREM
335
Fig. 5.17. A flow pattern meeting the demand at sink 6 without exceeding the individual supplies at sources 1 and 2.
flow that will meet the individual demands at sinks 6 and 7 that will not exceed the supply at source 2, even after setting the supply at the other source 1 to infinity. By Theorem 5.3, the problem is infeasible. To verify this from the demand side, we consider the subsets Ta = {6}, {7}, and {6,7}. For Ta = {6} a flow fa2 meeting the demand at sink 6 without exceeding the individual supplies at sources 1 and 2 is presented in Fig. 5.17. However, for Ta = {7} it is straightforward to show that there is no flow that will meet the demand at sink 7 without exceeding the supplies at sources 1 and 2. Thus, the problem is infeasible. Q.E.D.
5.2
AN EXTENDED SUPPLY-DEMAND THEOREM
In the preceding section, we presented the necessary and sufficient conditions for the existence of a flow that meets all the individual demands at the sinks without exceeding the supply limitations at each of the sources. Neither the lower bounds for the supplies at each of the sources nor the upper bounds for the demands at each of the sinks are assumed. In the present section, we extend the problem by imposing these bounds on the net flow leaving each source and entering each sink. Our objective is to find the necessary and sufficient conditions for the resulting set of inequalities to be feasible. Specifically, we show that if there is a flow that meets the lower bound requirements at each of the sources and the upper bound requirements at each of the sinks, and if there is a flow that meets the upper bound requirements at each of the sources and the lower bound requirements at each of the sinks, then there is a flow that satisfies all the lower and upper bound requirements at each of the sources and sinks simultaneously. This results, due to Fulkerson (1959), is a kind of symmetry with respect to the demands and supplies, and is known as a symmetric supply-demand theorem.
336
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
THEOREM 5.5 Partition the node set V of a given net G(V, E, c,f) into three disjoint subsets S, R and T. Associate with each x e S two nonnegative real functions a(x) and a'(x), a(x) = a'(x), and with each x e T two nonnegative real functions b(x) and b'(x), b(x)^b'(x). Then the constraints a(x)£f(x,V)-f(V,x)^a'(x), f(x,V)-f(V,x)
= 0,
b(x)^f(V,x)-f(x,V)^b'(x), c(x,y)^f(x,y)^0,
{x,y)eE
xeS
(5.85)
xeR
(5.86)
xeT
(5.87) (5.88)
are feasible if and only if c(X, X) ^ b(T HX)-
a'(S n X)
c(X, X) ^ a(S nX)-b'(TD hold for every subset XcV,
X)
(5.89) (5.90)
where X = V - X.
Proof. We first construct an extended net G'(V, E', c',f) of Fig. 5.18 by adjoining new nodes s, t, u and v and arcs (s, S), (u, S), (T, t), (T, v),
Fig. 5.18. An extended net G'(V, E', c',f) obtained from the net G(V, E, c,f) by adjoining nodes s, t, u and v and arcs as indicated.
5.2 AN EXTENDED SUPPLY-DEMAND THEOREM
337
(u, t), (s, v) and (t, s) with capacities denned as c'(s, x) = a'(x) — a{x),
X€ S
(5.91a)
c'(u, x) = a(x),
xeS
(5.91ft)
xeT
(5.91c)
xeT
(5.91d)
c'(x,t) =
b'(x)- b{x),
c'(x, v) = b(x), c'(u,t) = b(T)
(5.91e)
c'(s, v) = a(S)
(5.91/)
C'{t, s) = 0°
(5-91g)
c'(x,y)
= c(x, y),
(x, y)eE
(5.91/i)
We assert that the constraints (5.85)-(5.88) are feasible if and only if the value of a maximum flow from u to v in G' is a(S) + b(T). To see this, let / be a feasible flow in G. E x t e n d / i n G t o / ' in G' by defining f'(s,x)=f(x,V)-f(V,x)-a(x),
xeS
(5.92a)
f'(u,x)
xeS
(5.92b)
xeT
(5.92c)
xeT
(5.92d)
f'(x,
= a(x), t) =f(V, x) -f(x, V) - b(x),
f'(x,v)
= b(x),
f'(u,t)
= b(T)
(5.92e)
f'(s,v)
= a(S)
(5.92/)
f'(t,s)=f(S,V)-f(V,S)
(5.92g)
f'(x,y)=f(x,y),
(x,y)eE
(5.92h)
It is straightforward to verify t h a t / ' , as defined above, is a flow from utov in G' having value a(S) + b(T). Conversely, if/' is a flow from u to v in G' of value a(S) + b(T), then f'(u,x)
= a(x),
xeS
(5.93a)
f'(x,v)
= b(x),
xeT
(5.93b)
Let / be / ' restricted to E. Then for x e 5 we have f'(u,
x) +f'(s, x) = / ( * , V) ~f(V,
x)
(5.94)
Since from (5.91a) a'(x)-a(x)^f'(s,x)^0
(5.95)
338
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
equation (5.94) can be rewritten as a'(x)^f(x,V)-f{V,x)^a(x),
xeS
(5.96)
xeT
(5.97)
after invoking (5.93a). Likewise, we can show that b'(x)^f(V,x)-f(x,V)^b(x),
This completes the proof of our assertion that the constraints (5.85)-(5.88) are feasible if and only if the value of a maximum flow from u to v in G' is a(S) + b(T). Thus, to prove the theorem, we need only show that the conditions (5.89) and (5.90) are necessary and sufficient for the existence of a flow/' from u to v in G' having value a(S) + b{T), or equivalently a flow that saturates all source and sink arcs. By appealing to the max-flow min-cut theorem (Theorem 3.2), we recognize that if we can show that every u-v cut in G'(V, E', c',f) has capacity value of at least a(S) + b(T), then G' has a flow from u to v of value a(S) + b(T) and the problem is feasible. To this end, let (X', X') be a u-v cut in C . Four cases are distinguished. Case 1 s e X' and t e X'. Partition the subsets X' and X' of V into X' = {u, s) UX,
X' = {v, ( } u i
(5.98)
so that X = V - X. Then c'(X', X') = c'(u, t) + c'(u, X) + c'(s, v) + c'(s, X) + c'(X, v) + c'(X, t) + c'(X, X) = b(T) + a(S C\X) + a(S) + a'(S DX) - a(S fl X) + b(T nX) + b'(TnX)-
b(T DX) + c(X, X)
(5.99)
Since a'(S HX)^ a(S D X) and b'(T HX)^ b(T n X), it follows that c'(X',X')^a(S)
+ b(T)
(5.100)
Case 2 s e X' and teX'. In this case, c'(X', X') is infinite and no condition is obtained. Case 3 s, t e X'. Partition X' and X' into X' = {s,t,u}UX,
X' = {v}UX
(5.101)
5.2 AN EXTENDED SUPPLY-DEMAND THEOREM
339
Then we have c'(X', X') = c'(s, v) + c'(s, X) + c'(u, X) + c'(X, v) + c'{X, X) = a(S) + a'(S nX)+ b(TnX)
+
= a(S) + a'(SnX)
a(S HX) + a(S n X) c(X,X) + b(T) - b(T <1X) + c(X, X)
(5.102)
This shows that c'(X',X')^a(S)
+ b(T)
(5.103)
if and only if c(X,X)^b(TnX)-a'(SnX)
(5.104)
Case 4 s, t € X'. Partition X' and X' into X' = {u}UX,
X' = {s,t,v}UX
(5.105)
Then we have c'(X', X') = c'(u, t) + c'(u, X) + c'(X, t) + c'(X, v) + c'(X, X) = b(T) + a(S n X) + b'(T n X) - b(T n Z )
+ ft(rni) + c(i,i) = b(T) + a(S) - a ( 5 nX) + b'(TnX)
+ c(X, X)
(5.106)
This shows that c'(X',X')^a(S)
+ b(T)
(5.107)
if and only if c(X, X)^a(SnX)-b'(TnX)
(5.108)
Thus, we have shown that the constraints (5.85)-(5.88) are feasible if and only if the value of a maximum flow from u to v in G' is a(S) + b(T), and that such a flow exists in G' if and only if conditions (5.89) and (5.90) are satisfied for every subset of the node set of G. This completes the proof of the theorem. Observe that if we set a(x) = 0 for x e 5 and b'{y) = °o for y e T, then Theorem 5.5 reduces to Theorem 5.1, a supply-demand theorem. Theorem 5.5 is therefore an extended supply-demand theorem. Suppose that we
340
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
interchange the roles of the sources and sinks in G by thinking of a as the demand function at the set 5 of sinks, b' as the supply function at the set T of sources, and reverse all arc directions of G. Then by Theorem 5.1 condition (5.90) is necessary and sufficient for the existence of a flow meeting all the supply and demand requirements in the reversed net. In this sense, the conditions (5.89) and (5.90) are symmetric, and Theorem 5.5 is also known as a symmetric supply-demand theorem. This leads directly to the following corollary.
COROLLARY 5.1 The constraints (5.85)-(5.88) are feasible if and only if each of the following constraint sets
a{x)?kf{x,V)-f{V,x), f(x,V)-f(V,x) = 0, f(V,x)-f(x,V)^b'(x), c(x,y)^f(x,y)^0,
(x,
x eS
(5.109a)
xeR
(5.1096)
xeT
(5.109c)
y)eE
(5.109a")
and
f(x,V)-f(V,x)^a'(x), f(x,V)-f(V,x) = 0, b(x)^f(V,x)-f(x,V), c(x,y)^f(x,y)^Q,
(x,
xeS
(5.110a)
xeR
(5.1106)
xeT
(5.110c)
y)eE
(5.110d)
is feasible. In words, the corollary states that if there is a flow meeting the lower bound requirements at each of the sources and the upper bound requirements at each of the sinks, and if there is a flow satisfying the upper bound requirements at each of the sources and the lower bound requirements at each of the sinks, then there is a feasible flow in the supply-demand net. We illustrate the above results by the following examples. Example 5.4 In the supply-demand net G(V, E, c,f) of Fig. 5.19, the sources are nodes 1 and 2 and the sinks are nodes 6 and 7. Thus, the node set V can be partitioned into the subsets 5 = {1,2},
fl
= {3,4,5},
r = {6,7}
(5.111)
5.2 AN EXTENDED SUPPLY-DEMAND THEOREM
3
Fig. 5.19. A supply-demand net with lower and upper bounds specified for the supplies and demands of the sources and sinks.
The lower and upper bounds of the supplies and demands at the sources and the sinks are preassigned, respectively, as a(l) = 5, b(6) = 7,
a'(l) = 7, fe'(6)
= 9,
a(2)=8,
o'(2) = 10
(5.112)
6(7) = 8,
b'(T) = 10
(5.113)
They are given as pairs of numbers adjacent to the nodes in the net of Fig. 5.19, the first number being the upper bound and the second the lower bound. Instead of directly applying Theorem 5.5 to ascertain the existence of a flow that meets the lower and upper bound requirements of the supplies and demands at the sources and the sinks simultaneously, which requires the checking of 2 x 2 | V | = 2 x 2 7 = 256 inequalities (5.89) and (5.90), we use Corollary 5.1 to determine its feasibility. To this end, we consider the net Ga of Fig. 5.20, in which the supplies at sources 1 and 2 are required to be at least 5 and 8, and the demands at sinks 6 and 7 are not to exceed
Fig. 5.20. A supply-demand net with lower bounds specified for the supplies at sources 1 and 2 and upper bounds specified for the demands at sinks 6 and 7.
342
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
Fig. 5.21. A supply-demand net with lower bounds specified for the demands at sinks 1 and 2 and upper bounds specified for the supplies at sources 6 and 7.
9 and 10, respectively. A feasible flow in Ga exists if and only if there is a flow in the reversed net Gp of Fig. 5.21, which is obtained from Ga by reversing all arc directions, such that the supplies at sources 6 and 7 do not exceed 9 and 10, and the demands at sinks 1 and 2 are at least 5 and 8, respectively. The existence of a flow meeting all the requirements in Gp is shown in Fig. 5.21 with the arc flows given as the second numbers in the pairs of numbers adjacent to the arcs. Thus, the constraints (5.109) are feasible. To check the feasibility of the constraints (5.110), we use the net of Fig. 5.1, in which the supplies at sources 1 and 2 cannot exceed 7 and 10, respectively, and the demands at sinks 6 and 7 are at least 7 and 8, respectively. A feasible flow is shown in Fig. 5.2. Thus, the constraints (5.110) are feasible. By Corollary 5.1, there is a feasible flow in the original net G meeting all the lower and upper bound requirements simultaneously. Such a flow is presented in Fig. 5.22. Q.E.D.
Fig. 5.22. A flow pattern meeting the lower and upper bound requirements of the supplies and demands at sources 1 and 2 and sinks 6 and 7.
5.2 AN EXTENDED SUPPLY-DEMAND THEOREM
343
Example 5.5 In the supply-demand net G(V, E, c,f) of Fig. 5.23, the lower and upper bounds of the supplies and demands at sources 1 and 2 and at sinks 6 and 7 are specified as a(l) = a'(l) = 5,
a(2) = a'(2) = 10
(5.114)
b(6) = b'(6) = 7,
6(7) = 6'(7) = 8
(5.115)
respectively. They are shown in Fig. 5.23 as pairs of numbers adjacent to the nodes. We wish to determine if there is a feasible flow in G that satisfies the requirements (5.114) and (5.115).
Fig. 5.23. A supply-demand net with the same lower and upper bounds specified for the supplies and demands of the sources and the sinks. To apply Corollary 5.1, we need only consider the feasibility problems for the nets Ga of Fig. 5.24 and Gp of Fig. 5.25. The net Ga was obtained from G by reversing all arc directions with the stipulations that the demands at sinks 1 and 2 be at least 5 and 10, respectively, and that the
Fig. 5.24. A supply-demand net with lower bounds specified for the demands at sinks 1 and 2 and upper bounds specified for the supplies at sources 6 and 7.
344
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
Fig. 5.25. A supply-demand net with lower bounds specified for the demands at sinks 6 and 7 and upper bounds specified for the supplies at sources 1 and 2.
supplies at sources 6 and 7 not exceed 7 and 8, respectively. A flow pattern meeting these requirements is shown in Fig. 5.24. Thus, the constraints (5.109) are feasible. For the net Gp, the requirements are that the demands at sinks 6 and 7 be at least 7 and 8, respectively, and that the supplies at sources 1 and 2 not exceed 5 and 10, respectively. A flow pattern satisfying these constraints is presented in Fig. 5.25, showing that the constraints (5.110) are feasible. The existence of the feasible flows in Ga and Gp implies the existence of a flow in G that meets all the requirements (5.114) and (5.115). Such a flow is shown in Fig. 5.26. Q.E.D.
Fig. 5.26. A flow pattern meeting the same lower and upper bound requirements of the supplies and demands at sources 1 and 2 and sinks 6 and 7.
We remark that in the case where a(x) = a'{x) for x e S and b{y) = b'{y) for yeT, (5.109) and (5.110) reduce to f(x,V)-f(V,x)
= a(x),
xeS
(5.116a)
5.3 CIRCULATION THEOREM
f(x, V) -f(V,
x) = 0,
f(V,x)-f(x,V)
= b(x),
c(x, y) &/(*, y) ^ 0,
345
xeR
(5.116ft)
xeT
(5.116c)
(x,y)eE
(5.116d)
Thus, in determining the feasibility for the net of Fig. 5.23, we need only consider the net Gp of Fig. 5.25 with the stipulations that the demands at the sinks 6 and 7 be exactly 7 and 8, and that the supplies at the sources 1 and 2 be exactly 5 and 10, respectively. A flow pattern meeting these requirements is shown in Fig. 5.25. Q.E.D.
5.3
CIRCULATION THEOREM
In the foregoing, we studied the feasibility problem of a supply-demand net, in which the lower and upper bounds are set for the supplies and demands at the sources and sinks. No minimum flow values are required in individual arcs. In the present section, we are concerned with the existence of a flow in a source-free and sink-free net, that satisfies the prescribed lower and upper bounds on the flow values in arcs. Let G(V, E, c,f) be a source-free and sink-free net, and let / and c be the lower and upper bound functions from E to the nonnegative reals with c(x,y)^l(x,y)^0,
(x,y)eE
(5.117)
Thus, for our purposes we write G as a quintuplet G(V, E, I, c,f). A feasible circulation in G is a function / from E to the nonnegative reals satisfying f(x,V)-f(V,x) c(x, y)£/(*,
= 0,
xeV
y)^l(x,y)^0,
(x,y)eE
(5.118) (5.119)
We now proceed to establish the circulation theorem due to Hoffman (1960) below.
THEOREM 5.6 A necessary and sufficient condition for the existence of a feasible circulation in a given net G(V, E, I, c, f) is that the inequality c(X, X)^l(X,
X)
holds for all subsets J c V , where X = V — X.
(5.120)
346
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
Fig. 5.27. An extended net obtained from G by adjoining nodes s and t and sets of arcs (s, V) and {V, t).
Proof. We first construct an extended net G'(V, E', I', c',f) from G by adjoining two nodes s and t and the sets of arcs (s, V) and (V", t), as depicted in Fig. 5.27. The lower and upper functions /' and c' of G' are defined by l'(x,y)
= 0,
(x,y)eE'
(5.121a)
(x, y)eE
(5.1216)
c'{s,x) = l{V,x),
xeV
(5.121c)
c'{x,t) = l{x,V),
xeV
(5.12W)
c'(x, v) = c(x, y) - l(x, y),
It is straightforward to verify that if / is a feasible circulation in G, then the flow function/' defined by f'(x,y)=f(x,y)-l(x,y),
(x,y)eE
(5.122)
f'(s,x)
= l(V,x),
xeV
(5.123a)
f'(x,t)
= l(x,V),
xeV
(5.1236)
is a flow from s to t in G'. Conversely, if there is a flow/' in G' satisfying (5.123), then the flow function /defined by f(x,y)=f'(x,y)
+ l(x,y),
(x,y)eE
(5.124)
is a feasible circulation in G. Conditions (5.123) imply the existence of a flow/' from s to t in G' of value l(V, V). Our conclusion is that a feasible circulation exists in G if and only if there is a flow from s to t in G' that has a value l(V, V). To complete the proof, it is sufficient to show that there is a flow from s to ( i n G' of value l(V, V). By appealing to the max-flow min-cut theorem
5.3 CIRCULATION THEOREM
347
(Theorem 3.2), we need only prove that all the s-t cuts in G' have values of at least l(V, V). To this end, let (X', X') be an arbitrary s-t cut in G', and partition X' and X' into X' = {s}UX,
X' = {t} U X
(5.125)
Consider the expansion of the cut capacity c'{X', X') = c'(s, X) + c'(X, X) + c'(X, t) = l(V, X) + c(X, X) - l(X, X) + l(X, V) = l(X, X) + c(X, X) + l(X, V) = l(V, V) - l(X, X) + c{X, X)
(5.126)
It follows that c'(X',X')^l(V,V)
(5.127)
c(X,X)^l(X,X)
(5.128)
if and only if
This completes the proof of the theorem. In words, the theorem states that the flow l(X, X) forced into any subset X of the node set must be able to escape through the cut (X, X) having capacity of at least l(X, X). If this condition is satisfied for all subsets of the node set of G, then there is assured a feasible circulation. In Section 3.9, we considered the flow problem in an undirected or mixed net G(V, E, c, / ) . If an edge (x, y) = (y, x) is undirected with capacity c(x, y) = c(y, x), we interpret this to mean that f{x,y)^c(x,y)
(5.129a)
f(y,x)^c(x,y)
(5.1296)
and that flow is permitted in only one of the two directions or f(x,y)f(y,x) = 0
(5.130)
In other words, the arc (x, y) has a flow capacity c(x, y) in either direction but the flow can only move in one of the two directions. To find a maximum flow in such a net, we first replace each undirected edge (x, y) by a pair of oppositely directed edges (x, y) and (y, x), each having capacity equal to that of the original undirected edge, and obtain a directed net G'(V, E', c',f).
348
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
We then apply any of the existing techniques to find a maximum flow. Once a solution / ' is found with a certain maximum flow value, we can construct a feasible flow pattern / in the original net G with the same flow value by taking f(x, y) = max [0,f'(x, v) -f'{y,
x)\
(5.131)
yielding f(*,y)f(y,x) = o
(5.132)
The operation (5.131) is equivalent to canceling flows in opposite directions. This procedure can be extended to Theorems 5.1-5.5 to solve the feasibility problem in a supply-demand net. However, if nonzero lower bounds are imposed on undirected edge flows, then the above procedure cannot be used in determining a feasible circulation in a source-free and sink-free net, because the operation is no longer valid. Thus, there is a basic difference between the supply-demand theorem and the circulation theorem. Theorem 5.6 gives a necessary and sufficient condition for the existence of aflow/ i n a net G(V, E, c, f) that is flow conservative at each node x e V and that meets the lower and upper bound requirements in each arc (x, y) e E. Like Theorem 5.5, this result can be extended to the situation where the net flow into a node x e V lies between prescribed bounds. The extension is due to Hoffman (1960) and is stated as follows.
THEOREM 5.7 In a given net G( V, E, I, c, / ) , associate with each x eV two real functions a(x) and a'(x), a(x)^a'(x). Then the constraints a(x)^f(V,x)-f(x,V)^a'(x), l(x,y)^f(x,y)^c(x,y),
xeV
(5.133)
(x,y)eE
(5.134)
are feasible if and only if c(X, X) g l(X, X) + max [a(X), -a'(X)]
(5.135)
holds for all subsets X cV. Proof. We first construct an extended net G'(V, E', I', c',f) from G by adjoining two nodes * and t and the sets of arcs (s, V) and (V, t) as depicted in Fig. 5.28. The lower and upper bound functions /' and c' for the
5.3 CIRCULATION THEOREM
349
max [0, a'(y)] max [0, a(y)]
max [0, -a(x)] max [0,-a'(x)]
max [0, a'(v)] max [0,a(v)]
max [0,-a(«)] max [0,-a'(«)]
Fig. 5.28. An extended net obtained from G by adjoining nodes s and t and sets of arcs (s, V) and (V, t).
arcs in G' are defined by l'(s, x) = max [0,
-a'(x)],
xeV
(5.136a)
c'(s, x) = max [0, — a(x)],
xeV
(5.136b)
l'(x, t) = max [0, a(x)],
xeV
(5.137a)
c'(x, t) = max [0, a'(x)],
xeV
(5.137b)
l'(x,y)
=
l(x,y),
(x, y)eE
(5.138a)
c'(x,y)
=
c(x,y),
(x, y)eE
(5.138b)
Since a'(x) ^ a(x), we have c'(s,x)^l'(s,x),
xeV
(5.139)
It is straightforward to verify that if there is a feasible flow / in G, then there is a flow/' from the source s to the sink t in G' meeting the lower and upper bound requirements (5.136)-(5.138) by defining f'(s,x) = max[0,f(x,V)-f(V,x)],
xeV
(5.140a)
f'(x,
xeV
(5.140b)
t) = max [0,f(V, x) -f{x, V)],
f'(x,y)=f(x,y),
(x,y)eE
(5.140c)
Conversely, if there is a flow / ' from s to t in G' satisfying the lower and upper bound requirements, then by restricting / ' over E we obtain a feasible flow / in G. Our conclusion is that the constraints (5.133) and (5.134) are feasible if and only if there is a feasible flow in G' from s to t. Suppose that we add arcs (s, t) and (t, s) to the net G'(V, E', I', c',f)
350
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
with infinite capacity and zero lower bound. Let the resulting net be denoted by G"(V", E", I", c",f"). Then there is a feasible flow in G' from s to t if and only if there is a feasible circulation in G". Thus, to complete our proof, it is sufficient to show that feasibility conditions (5.120) of Theorem 5.6, when applied to G", yield the inequalities (5.135). To this end, let X" be a subset of V" and define X" = V" - X". Then by Theorem 5.6 there is a feasible circulation in G" if and only if c"(X", X") - l"(X", X") g 0
(5.141)
for all X" c V". We show that (5.141) is satisfied if and only if (5.135) holds. To facilitate our discussion, four cases are distinguished. Case 1 s e X" and t e X". Partition the subsets X" and X" into X" = {s} U X,
X" = {t} U X
(5.142)
Then the left-hand side of (5.141) can be expanded as c"(X", X") - l"(X", X") = c " ( M U X, {t} UX)-
l"({t} U X, {s} U X)
= c"(s, t) + c"(s, X) + c"(X, t) + c"(X, X) - l"(t, s) - l"(X, X) = *> (5.143) Thus, (5.141) is always satisfied. No condition is obtained in this case. Case 2 5 e X" and t e X". Partition the subsets X" and X" into X" = {t} UX,
X" = {s} U X
(5.144)
The left-hand side of (5.141) becomes c"(X", X") - 1"{X", X") = c"({t} U X, {s} UX)-
l"({s} U X, {t} U X)
= c"(t, s) + c"(X, X) - l"(s, X) - l"(X, t) - l"(X, X) = «> (5.145) Equation (5.141) is always satisfied. No condition is obtained. Case 3 s, t e X". Partition X" into X" = {s,t}UX
(5.146)
5.3 CIRCULATION THEOREM
351
and rewrite X" = X. Then we have c"(X", X") - l"(X", X") = c"({s, t} U X, X) - l"(X, {s, t) U X) = c"(s, X) + c"(X, X) - l"(X, t) - l"(X, X) = c(X, X) - l(X, X)+J,
max [0, -a(y)]
- £ max [0, a(y)]
yeX
= c{X,X)-l{X,X)-
yeX
2 a{y)- £ a(y) yeX "(y)
yeX "(j')eo
= c(X, X) - l(X, X) - a(X)
(5.147)
Case 4 s, t € X". Write X ' = X and i"={j,(}Ui
(5.148)
Then we have c"(X", X") - l"(X", X") = c"(X, {s, t] U X) - l"({s, t} U X, X) = c"(X, t) + c"(X, X) - l"(s, X) - l"(X, X) = c(X, X) - l(X, X)+^Z
max [0, a'(x)] - £ max [0,
xeX
= c(X,X)-l(X,X)+
2
-a'(x)]
xeX
a'{x)+
xeX a'(x)>0
£
a'(x)
xeX a'(*)SO
= c(X, X) - l(X, X) + a'(X)
(5.149)
Thus, condition (5.141) holds for all X" c V" if and only if (5.135) is satisfied for all X cV. This completes the proof of the theorem. We illustrate the above results by the following examples. Example 5.6 In the given net G{V, E, I, c, f) of Fig. 5.29, the lower and upper bounds for the flow values in the arcs are shown in Fig. 5.29 as pairs of numbers adjacent to the arcs. Thus, we have c ( l , 3 ) = 4,
c ( l , 4 ) = 4,
c(2, 1) = 7
c(3,2) = 3,
c(3,4) = 3,
c(4,2) = 5
/(1,3) = 4,
/(1,4) = 3,
1(2, 1) = 2
/(3,2) = 2,
/(3,4) = 2,
/(4,2) = 3
(5.150)
(5.151)
352
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
7,2M
"3,2
Fig. 5.29. A source-free and sink-free net used to illustrate the circulation theorem. We use Theorem 5.6 to determine the existence of a feasible circulation in G. To this end, we apply (5.120) and obtain the following 14 inequalities: c(l, {2, 3, 4}) = c(l, 3) + c(l, 4) = 4 + 4 = 8 S / ( { 2 , 3 , 4 } , 1 ) = /(2,1) = 2
(5.152a)
c(2, {1, 3, 4}) = c(2, 1) = 7 2 ; / ( { l , 3, 4}, 2) = 5
(5.1526)
c(3, {1, 2, 4}) = 6 ^ /({l, 2, 4}, 3) = 4
(5.152c)
C(4,{1,2,3}) = 5&/({1,2,3},4) = 5
(5,152rf)
c({l, 2}, {3, 4}) = 8 ^ / ( { 3 , 4}, {1, 2}) = 5
(5.152e)
c({l, 3}, {2, 4}) = 10 g /({2, 4}, {1, 3}) = 2
(5.152/)
c({l, 4}, {2, 3}) = 9 ^ / ( { 2 , 3}, {1, 4}) = 4
(5.152g)
c({2, 3}, {1, 4}) = 1 0 S / ( { l , 4}, {2, 3}) = 7
(5.152ft)
c({2, 4}, {1, 3}) = 7 2 /({l, 3}, {2, 4}) = 7
(5.152/)
c({3, 4}, {1, 2}) = 8i£/({l, 2}, {3, 4}) = 7
(5.152/)
c({l, 2, 3}, 4) = 7 2 / ( 4 , {1, 2, 3}) = 3
(5.152*)
c({l, 2, 4}, 3) = 4 ^ 1(3, {1, 2, 4}) = 4
(5.152/)
c({2, 3, 4}, 1) = 7 2 /(l, {2, 3, 4}) = 7
(5.152m)
c({l, 3, 4}, 2) = 8 ^ / ( 2 , {1, 3, 4}) = 2
(5.152/z)
The empty subset and the node itself are not included because the condition (5.120) is trivially satisfied for them. Since (5.120) holds for all subsets X c V, by Theorem 5.6 there is a feasible circulation in G, one of which is shown in Fig. 5.30. In Fig. 5.30, the upper bounds, the flow values and the lower bounds for the arcs are given in this order as triplets of nonnegative real numbers adjacent to the arcs. For the arc (1,4), for example, the upper bound is 4, the flow value is 3 and the lower bound is 3. They are written as a triplet 4, 3, 3 adjacent to the arc (1,4) in G.
5.3 CIRCULATION THEOREM
353
4,4,4
If 3,2,2
7,7,2 n
5,5,3
Fig. 5.30. A feasible circulation for the net of Fig. 5.29.
Suppose that we reduce the capacity of the arc (2,1) in G from 7 to 6, everything else being the same. Choose X = {2, 4}. Then c({2,4},{l,3}) = c(2,l) = 6 (5.153)
£ / ( { ! , 3}, {2,4}) = 2 + 3 + 2 = 7
showing that condition (5.120) is violated and, therefore, the net of Fig. 5.29 with c(2, 1) = 7 being replaced by c(2, 1) = 6 does not possess a feasible circulation. Intuitively, this can be interpreted as follows: The amount of flow forced into the subset X={2, 4} is required to be at least /({l, 3}, {2, 4}) = 7, whereas the maximum available escape capacity is c({2, 4}, {1,3}) = 6. This is impossible to achieve for a feasible flow. The conclusion follows. Q.E.D. Example 5.7 For the net G(V, E, I, c,f) of Fig. 5.29, suppose that we stipulate that the net flow into each node must lie between the preassigned bounds, as follows: a(l) = - 4 ,
a ' ( l ) = 0,
o(2) = - 3 ,
«(3) = - 2 ,
a'(3) = 2,
«(4) = 2,
fl'(2)
= l
a'(4) = 4
(5.154)
These are indicated in Fig. 5.31 as pairs of numbers adjacent to the nodes, the first being the upper bound and the second the lower bound. To check to see if there is a feasible flow, we apply (5.135) and obtain c(l, {2, 3, 4}) = 8 i= /({2, 3, 4}, 1) + max [a({2, 3, 4}), - a ' ( l ) ] = 2 +max [-3,0] = 2 + 0 = 2
(5.155a)
c(2, {1, 3, 4}) = 7 ^ /({l, 3, 4}, 2) + max [a({l, 3, 4}), -a'(2)] = 5 +max [ - 4 , - 1 ] = 4
(5.155ft)
354
FEASIBILITY THEOREMS AND THEIR APPLICATIONS 4,4
0,-4 ( 1
3)2,-2
Fig. 5.31. A source-free and sink-free net used to illustrate the extended circulation theorem.
c(3, {1, 2, 4}) = 6 i£ /({l, 2, 4}, 3) + max [«({1, 2, 4}), -«'(3)] = 4 + max [ - 5 , - 2 ] = 2
(5.155c)
c(4, {1, 2, 3}) = 5 ^ /({l, 2, 3}, 4) + max [«({1, 2, 3}), -a'(4)] = 5 + max [ - 9 , - 4 ] = 1
(5.155d)
c({l, 2}, {3, 4}) = 8 i= /({3, 4}, {1, 2}) + max [a({3, 4}), -a'({l, = 5 +max [0,-1] = 5
2})] (5.155e)
c({l, 3}, {2, 4}) = 1 0 g /({2, 4}, {1, 3}) + max [a({2, 4}), -a'({l,
3})]
= 2+ max[-l,-2] = l
(5.155/)
c({l, 4}, {2, 3}) = 9 ^ /({2, 3}, {1, 4}) + max [a({2, 3}), -a'({l, = 4 +max [ - 5 , - 4 ] = 0
4})] (5.155g)
c({2, 3}, {1, 4}) = 1 0 § /({l, 4}, {2, 3}) + max [«({1, 4}), - „ ' ( { 2 , 3})] = 7 + max [ - 2 , - 3 ] = 5
(5.155A)
c({2, 4}, {1, 3}) = 7 ^ /({l, 3}, {2, 4}) + max [a({l, 3}), - « ' ( { 2 , 4})] = 7 + max [ - 6 , - 5 ] = 2
(5.1550
c({3, 4}, {1, 2}) = 8 S /({l, 2}, {3, 4}) + max [«({1, 2}), - a ' ( { 3 , 4})] = 7 + max [ - 7 , - 6 ] = 1 c({l, 2, 3}, 4) = 7 ^ /(4, {1, 2, 3}) + max [a(4), -a'{{\,
(5.155/) 2, 3})]
= 3 +max [2,-3] = 5
(5.155*)
c({l, 2, 4}, 3) = 4 ^ / ( 3 , {1, 2, 4}) + max [a(3), - « ' ( { ! . 2, 4})] = 4 +max [ - 2 , - 5 ] = 2 c({2, 3, 4}, 1) = 7 a /(l, {2, 3, 4}) + max [a(l), -a'{{2, = 7 + max [ - 4 , - 7 ] = 3
(5.155/) 3, 4})] (5.155m)
5.3 CIRCULATION THEOREM
c({l, 3, 4}, 2) = 8 g 1(2, {1, 3, 4}) + max [a(2), -a'({l,
355
3, 4})]
= 2 +max [ - 3 , - 6 ] = - 1
(5.155«)
Since all the conditions are satisfied, by Theorem 5.6 there is a feasible flow in G. One such flow is shown in Fig. 5.32, in which the upper bounds, the flow values, and the lower bounds for the arc flows are given as triplets of real numbers adjacent to the arcs. Furthermore, the stipulated upper bounds, the net in-flow values, and the lower bounds associated with the nodes are also represented in this order by the triplets of real numbers adjacent to the nodes in Fig. 5.32. Q.E.D. 4,4,4 0,-2,-4
7,6,2
n
1,1,-3
4 ) 4,2,2
5,4,3
Fig. 5.32. A feasible circulation for the net of Fig. 5.31.
Example 5.8 For the net G(V, E, I, c,f) of Fig. 5.33, the net flow into each node is required to lie between the prescribed bounds, as follows: a(l) = - 4 ,
a ' ( l ) = 0, .
a(2) = - 3 ,
«'(2) = l
a(3) = 0,
o'(3) = 2,
«(4) = 2,
a'(4) = 4
(5.156)
These are shown in Fig. 5.33 as pairs of numbers adjacent to the nodes.
0,-4
7,2 n
1,-3 Fig. 5.33. A source-free and sink-free net used to illustrate the non-existence of a feasible circulation.
356
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
To check the feasibility of a circulation in G, we apply (5.135) for the subset X = {1, 2} of V, and obtain c(X, X) = c({l, 2}, {3, 4}) = c(l, 3) + c(\, 4) = 4 + 2 = 6 ^ /({3, 4}, {1, 2}) + max [a({3, 4}), - a ' ( { l , 2})] = Z(3, 2) + /(4, 2) + max [0 + 2,0 - 1] = 2+ 3+ 2= 7
(5.157)
showing that (5.135) is violated. Therefore, there is no feasible flow in G meeting all the requirements. Q.E.D. Example 5.9 For the net G(V, E, I, c,f) of Fig. 5.34, the net flow into each node is required to lie between the prescribed bounds, as follows:
a(l)=-4,
a'(l)=-2,
a(2) = - 3 ,
a(3) = - 2 ,
a'(3) = 2,
a(4) = 2,
a'(2)=-2 a'(4) = 4
(5.158)
They are as indicated in Fig. 5.34. To check the feasibility of a circulation in G, we apply (5.135) for the subset X = {1, 2} of V, and obtain c(X, X) = c({l, 2}, {3, 4}) = c(l, 3) + c(l, 4) = 4 + 4 = 8 ^ Z({3, 4}, {1, 2}) + max [a({3, 4}), -a'({\,
2})]
= 1(3, 2) +1(4, 2) + max [-2 + 2, 2 + 2] = 2+ 3+ 4= 9
(5.159)
showing that condition (5.135) is violated, and there is no feasible circulation in G. Q.E.D. 4,4 -2,-4
3)2,-2
7,2 U
-2,-3
Fig. 5.34. A source-free and sink-free net used to illustrate the non-existence of a feasible circulation.
5.4 FEASIBLE CIRCULATION ALGORITHM
357
Before we move on to the construction of a feasible circulation, we give an intuitive interpretation of the condition (5.135). It states that either there must be sufficient cut capacity c(X, X) from X to X to accommodate the required minimum net out-flow l(X, X) from X to X plus the net flow a(X) into the nodes of X, or the net flow l(X, X) forced into X from X cannot exceed the sum of maximum net flows a'(X) into the nodes of X plus the escape cut capacity c(X, X) from X to X. If these conditions are satisfied for all subsets of the node set, the existence of a feasible circulation is assured. In the net of Fig. 5.33, for example, the required minimum net out-flow from ^ = { 3 , 4 } to X={\, 2} is l(X,X) = 5, whereas the net flow into nodes 3 and 4 is a({3,4}) = 2. There is not sufficient cut capacity c(X, X) = c({l, 2}, {3, 4}) = 6 to meet the minimum need, which is l(X, X) + a(X) = 5 + 2 = 7. Thus, there is no feasible circulation in the net. Likewise, for the net of Fig. 5.34, the net flow forced into X= {1, 2} from -X"={3, 4} is /({3, 4}, {1,2}) = 5. The maximum net flow that can be retained in X is a'(X) = a'({l, 2}) = —4. There is not sufficient escape cut capacity c(X, X) = c({l, 2}, {3, 4}) = 8 to accommodate the minimum need, which is l(X, X) — a'(X) = 5 + 4 = 9. Therefore, no feasible circulation exists. We now proceed to a discussion on the construction of a feasible circulation. However, before we do this we remark that in general if one is interested in checking the feasibility of a circulation in a given net, the most efficient method is to use the feasible circulation algorithm to be discussed in the following section rather than to check the conditions (5.120) for all subsets of the node set. If the problem is infeasible, a violation of (5.120) will be located at the conclusion of the computation.
5.4 FEASIBLE CIRCULATION ALGORITHM In the preceding section, we discussed the conditions under which a feasible circulation exists. No procedure is given to the construction of a feasible circulation. In the present section, we describe a labeling process for constructing a feasible circulation provided that the capacity function and the lower bound function are rational valued. This restriction is necessary because the labeling routine is a variant of the Ford-Fulkerson algorithm described in Section 3.4. Let G(V, E, I, c,f) be a given net. The algorithm assigns labels to the nodes in V. The label assigned to a node is represented by an ordered triplet (x, +, w) or (x, —, w), where x e V and w is a positive number. During the labeling process, a node is always considered to be in one of the following three states: (1) unlabeled node, (2) labeled and unscanned node, and (3) labeled and scanned node, as described in Section 3.4.
358
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
Feasible Circulation Algorithm Step 1. Step 2.
Step 3. Step 4.
Start with any integral valued conservative flow / or with / = 0. Select an arc (s, t) for which either f(s, t) > c(s, t) or f(s, t) < l(s, t). If f(s, t) > c(s, t), go to Step 3. If f(s, t) < l(s, t), go to Step 9. Otherwise, go to Step 15. Label s by (t, — , w(s)), where w(s) =f(s, t) — c(s, t). Select any labeled, unscanned node x, and perform the following operations: (a) For all nodes y, (x, y) e E, that are unlabeled such that f(x, y) < c(x, y), assign y the label (x, + , w(y)) where w(y) = min [w(x), c(x, y) - / ( * , y)]
(5.160)
(b) For all nodes y, (_y, x) e E, that are unlabeled such that f(y, x) > l(y, x), assign y the label (x, — , w(y)) where w(y) = min [w(x), f(y, x) - l(y, x)]
Step
Step Step Step Step Step Step
Step Step Step Step
(5.161)
Now change the label on x by circling the + or - entry. Then x is now labeled and scanned. 5. Repeat Step 4 until either t is labeled or no more labels can be assigned and t is unlabeled. In the former case, go to Step 6; and in the later case, terminate and there is no feasible circulation. 6. Let z = t. 7. If the label on z is (q, + , w(z)), increase the flow f(q, z) by w(t). If the label on z is (q, — , w(z)), decrease the flow/(z, q) by w(t). 8. Ifq = s, decrease/(s, t) by w(t) and discard all labels and return to Step 2. Otherwise, let z = q and return to Step 7. 9. If f(s, t) < l{s, t), label t by {s, + , w{t)) where w(t) = l(s, t) f(s, t). 10. Select any labeled, unscanned node x, and perform the same labeling operations as in Step 4. 11. Repeat Step 10 until either s is labeled or no more labels can be assigned and s is unlabeled. In the former case, go to Step 12; and in the later case, terminate and there is no feasible circulation. 12. Let z = s. 13. If the label on z is (q, + , w(z)), increase the flow/(<7, z) by w(s). If the label on z is (q, — , w{z)), decrease the flow/(z, q) by w(s). 14. If q = t, increase f(s, t) by w(s) and discard all labels and return to Step 2. Otherwise, let z = q and return to Step 13. 15. Stop. A feasible circulation has been constructed.
5.4 FEASIBLE CIRCULATION ALGORITHM
359
The above algorithm either constructs a feasible circulation in a finite number of steps or shows that there is no feasible circulation. To demonstrate that this is indeed the case, we observe that if t is labeled in Step 5, then a flow augmenting path Pst from s to t has been found, in which all forward arcs (x, y) of Pst are not saturated, f(x, y)
(x,y)e
(X, X)
f(y,x)^l(y,x),
(y,x)e(X,X)
(5.162a) (5.162b)
In addition, there is at least one arc (s, t) e (X, X) which satisfies the strict inequality f(s,t)>c(s,t) Summing over all xeX becomes
and yeX
(5.163)
in conjunction with (5.163), (5.162)
f(X, X) > c(X, X)
(5.164a)
f{X, X) ^ liX, X)
(5.164fe)
which can be combined to yield fiX, X) -fiX,
X) > ciX, X) - liX, X)
(5.165)
Since / satisfies the conservation equations at all nodes, the left-hand side of (5.165) is identically zero, and we obtain ciX, X) < liX, X)
(5.166)
violating the condition (5.120). Thus, there is no feasible circulation. In an exactly similar manner, we can show that if s in Step 11 is not labeled, there is no feasible circulation. We illustrate this algorithm by the following examples.
360
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
Example 5.10 Consider the source-free and sink-free net G(V, E, I, c, / ) of Fig. 5.35, in which the upper and lower bounds for the arcs are shown as pairs of nonnegative real numbers adjacent to the arcs. For simplicity, the capacities c(x, y), flow values f(x, y) and lower bounds l(x, y) for the arcs (x, y) will also be represented as triplets of nonnegative real numbers written adjacent to the arcs (x, y) in the order described. We follow the steps of the algorithm to construct a feasible circulation in the net.
Fig. 5.35. A source-free and sink-free net used to illustrate the feasible circulation algorithm.
Step 1.
Set / = 0. c(x, y), f(x, y) and l(x, y) are shown as triplets adjacent to the arcs (x, y) in Fig. 5.36.
First iteration Step 2. Step 9.
Select arc (s, t) = (4, 1) with f(4, 1) = 0 < 1(4, 1) = 1. Go to Step 9. Label t = 1 by (4, + , 1), where w(l) = 1(4, 1) -f(4, 1) = 1 0 = 1. (4,©,D
(1,©,1)
Fig. 5.36. A labeled net of Fig. 5.35 after selecting arc (4,1) for the first iteration in the use of the feasible circulation algorithm, where the initial flow is assumed to be zero.
5.4 FEASIBLE CIRCULATION ALGORITHM
361
Step 10. Select x = 1, and label nodes 2 and 3 as (1, + , 1) and (1, + , 1), respectively. Step 11. Select x = 3 and label node 5 = 4 by (3, + , 1 ) . The labeled nodes are shown in Fig. 5.36. Step 12. Let z = s = 4. Step 13. Increase the flow/(g, z) = / ( 3 , 4) by w(s) = w(4) = 1. Step 14. Let z = q = 3 and return to Step 13. Step 13. Increase f(q, z) = / ( l , 3) by w(s) = w(4) = 1. Step 14. Increase f(s, t) = / ( 4 , 1) by w(s) = w(4) = 1. Discard all labels and return to Step 2. At the end of Step 14, the flow pattern is shown in Fig. 5.37. Second iteration Step 2. Select (s, t) = (3, 1). Go to Step 9. Step 9. Label t = 1 by (3, + , 3). Step 10. Select x = 1 and label nodes 2 and 3 by (1, + , 3) and (1, + , 2), respectively, as shown in Fig. 5.37. Step 11. Go to Step 12. Step 12. Let z = s = 3. Step 13. Increase f(q, z) = / ( l , 3) by w(s) = w(3) = 2. Step 14. Increase f(s, t) = / ( 3 , 1) by w(s) = w(3) = 2. Discard all labels and return to Step 2. At the end of Step 14, the flow pattern is shown in Fig. 5.38. Third iteration Step 2. Step 9.
Select (s, t) = (3, 4). Go to Step 9. Label t = 4 by (3, + , 1). (3,©,3)
Fig. 5.37. The flow pattern after the first iteration and the selection of arc (3,1) for the second iteration.
362
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
(3,©,D
(1,©,U
(2, + ,l)
Fig. 5.38. The flow pattern after the second iteration and the selection of arc (3,4) for the third iteration.
Step Step Step Step Step Step Step Step Step Step Step Step Step
10. 11. 10. 11. 10. 11. 12. 13. 14. 13. 14. 13. 14.
Select x = 4 and label node 1 by (4, + , 1). Go to Step 10. Select x = 1 and label node 2 by (1, + , 1). Go to Step 10. Select x = 2 and label s = 3 by (2, + , 1). Go to Step 12. Let z = s = 3. Increase f(q, z) = / ( 2 , 3) by w(s) = w(3) = 1. Let z = q = 2 and return to Step 13. Increase f(q, z) = / ( l , 2) by »v(.s) = w(3) = 1. Let z = q = 1 and return to Step 13. Increase/(g, z) = / ( 4 , 1) by w(3) = 1. Increase f(s, t) = / ( 3 , 4) by w(3) = 1. Discard all labels and return to Step 2.
At the end of Step 14, the flow pattern is shown in Fig. 5.39.
(i,-,D
d,©,i) 3,2,2 \ ^ \ / 3
^
2
->>2
Fig. 5.39. The flow pattern after the third iteration and the selection of arc (3,1) for the fourth iteration.
5.4 FEASIBLE CIRCULATION ALGORITHM
363
Fourth iteration Step 2. Select (s, t) = (3, 1). Go to Step 9. Step 9. Label t = 1 by (3, + , 1). Step 10. Select x = 1 and label nodes 2 and 4 by (1, + , 1) and (1, - , 1), respectively. Step 11. Go to Step 10. Step 10. Select x = 2 and label node 3 by (2, + , 1). Step 11. Go to Step 12. Step 12. Let z = s = 3. Step i3. Increase f(q, z) = / ( 2 , 3) by w(s) = w(3) = 1. Step 14. Let z = q = 2 and return to Step 13. Step 13. Increase f(q, z) = / ( l , 2) by w(3) = 1. Step 14. Increase f(s, t) = / ( 3 , 1) by w(3) = 1. Discard all labels and return to Step 2. At the end of Step 14, the flow pattern is shown in Fig. 5.40. Step 15. Stop. A feasible circulation has been constructed, and is given in Fig. 5.40.
Fig. 5.40. A feasible circulation for the net of Fig. 5.35. Example 5.11 In the net G(V, E, I, c,f) of Fig. 5.41, the capacities, the conservative flow values, and the lower bounds of the arcs are as indicated in the figure by the triplets adjacent to the arcs. We use the algorithm to construct a feasible circulation. Step Step Step Step Step
1. 2. 3. 4. 5.
Start with the flow / as shown in Fig. 5.41. Select arc (s, t) = (2, 1), as shown in Fig. 5.42. Label s = 2 by (1, - , 1). Select x = 2 and label node 4 by (2, - , 1) Select x = 4 and label t = 1 by (4, - , 1)
364
FEASIBILITY THEOREMS AND THEIR APPLICATIONS 4,4,4
v
6,7,2)i
3,2,2
5,5,3 Fig. 5.41. A source-free and sink-free net used to illustrate the feasible circulation algorithm.
' r 3,2,2
6,7,2 i
(i.e.i)
5,5,3
(2,e,i) Fig. 5.42. A labeled net of Fig. 5.41 after selecting (2,1) as the initial arc for iteration.
Step Step Step Step Step 5tep Step
6. 7. 8. 7. & 2 15.
Let z = t = 1. Decrease f(z, q) = / ( l , 4) by w(l) = 1. Let z = 4 and return to Step 7. Decrease f(z, q) = / ( 4 , 2) by w{\) = 1. Decrease / ( s , f) = / ( 2 , 1) by w(l) = 1, and return to Step 2. Go to Step 15. Stop. A feasible circulation has been constructed as shown in Fig. 5.43. 4,4,4
' r 3,2,2
6,6,2 i i
5,4,3
Fig. 5.43. A feasible circulation for the net of Fig. 5.41.
5.4 FEASIBLE CIRCULATION ALGORITHM
365
Example 5.12 The net G(V,E,l,c,f) of Fig. 5.44 is the same as that of Fig. 5.41 except that the lower bound for the arc (1,4) has been increased from 2 to 3, everything else being the same. We use the algorithm to ascertain the feasibility of G.
Fig. 5.44. A source-free and sink-free net used to illustrate the non-existence of a feasible circulation by means of the feasible circulation algorithm.
Step Step Step Step Step
1. 2. 3. 4. 5.
Start with the flow / as shown in Fig. 5.44. Select arc (s, t) = (2, 1). Label s = 2 by (1, - , 1). Select x = 2 and label node 4 by (2, — , 1). Select x = 4. No more labels can be assigned. Terminate and there is no feasible circulation in G.
Let X and X be the labeled and unlabeled sets of nodes of G. Then we have from Fig. 5.44 *={2,4},
X={1,
3}
(5.167)
giving c(X, X) = c({2, 4}, {1, 3}) = c(2, 1) = 6 $l(X, X) = /({l, 3}, {2, 4}) = 2 + 3 + 2 = 7
(5.168)
Thus, a violation of condition (5.120) is detected, and there is no feasible flow in G confirming (5.153). Example 5.13 A source-free and sink-free net G(V, E, l,c,f) is shown in Fig. 5.45. Applying the feasible circulation algorithm yields a feasible circulation shown in Fig. 5.45, in which the capacities, the flow values, and the lower bounds for the arcs are represented by the triplets of nonnegative real numbers adjacent to the arcs.
366
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
Fig. 5.45. A source-free and sink-free net with capacities, flow values and lower bounds for the arcs given as triplets of nonnegative real numbers adjacent to the arcs. Thus, the most efficient way to check the feasibility of a circulation in a net is to use the feasible circulation algorithm outlined in this section rather than to check the conditions (5.120) for all subsets of the node set of the net. If the problem is infeasible, a violation of (5.120) will be located at the conclusion of the computation by taking X and X to be the labeled and unlabeled nodes of the node set, respectively. In the situation in which the net flow into a node is required to lie between prescribed bounds, we apply the algorithm to the extended net G"(V", E", I", c", /") of a given net G(V, E, I, c,f) as denned in the proof of Theorem 5.7. Once a feasible circulation / " is found in G", the restriction / of / " over E gives the desired flow in G. If a violation of the conditions (5.120) is located, the corresponding violation of (5.135) can be identified.
5.5
FLOWS IN NETS WITH LOWER BOUNDS ON ARCS
In Chapter 3, we considered the problem of determining the maximum flow value from a source to a sink in an arc capacitated net, where lower bounds of zero were assumed on all arc flows. In the present section, we extend the problem by requiring nonnegative real lower bounds on arc flows. Let G(V, E, I, c,f) be a net with source s and sink /, where / is a lower bound function from E to the nonnegative reals satisfying c(x,y)^l(x,y)^0,
(x,y)eE
(5.169)
A flow / is said to be feasible in G of value fst from s to t if it satisfies the
5.5 FLOWS IN NETS WITH LOWER BOUNDS ON ARCS
367
following constraints: For each x eV f(x,V)-f(V,x)=fM, f(x, V)-f(V,x)
= 0,
f(x, V)-f(V,x)=-fs„ c(x,y)^f(x,y)*l(x,y)^0,
x =s
(5.170a)
x*s,t
(5.1706)
x =t
(5.170c)
(x,y)eE
(5.171)
The maximum value of such flows from s to t in G is given by the following theorem, which is an extension of Theorem 3.2.
THEOREM 5.8 If there is a feasible flow from s to t in a given net G(V, E, I, c, / ) , then the maximum flow value / m a x from s to t is equal to the minimum of [c(X, X) - l(X, X)] taken over all s-t cuts (X, X) in G, i.e. / m a x = max {/„} = min {c(X, X) - l(X, X)} x
(5.172)
Proof. If there is a feasible flow / from 5 to t in G, then by summing over all x e X and ye X, (5.170) and (5.171) become f(X,V)-f(V,X)=fsl
(5.173)
c(X, X) § / ( * , X) ^ / ( * , X) ^ 0
(5.174)
giving c(X, X) - l(X, X) ^f(X,
X) -f(X,
X) = / „
(5.175)
This shows that the flow value fs, from s to r in G cannot exceed the minimum of c(X, X) — l(X, X) taken over all s-t cuts (X, X) in G. In particular, the maximum flow value/ m a x is bounded above by this minimum, i.e. / m a x =i min {c(X, X) - l(X, X)} x
(5.176)
It remains to be shown that a flow value equal to this minimum can be attained. To this end, we apply the Ford-Fulkerson algorithm to G for constructing a maximum flow from s to t. The only change is in the labeling rules (3.60), as follows: For all nodes y, (y, x) e E, that are unlabeled such that f{y,x)>l{y,x)
(5.177)
368
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
label y by (x, - , w(y)) where w(y) = min [w(x), f(y, x) - l(y, x)]
(5.178)
and node x has been labeled (z, ± , w(x)). As in the proof of the max-flow min-cut theorem, the modified algorithm will yield an s-t cut (Y, Y), all of whose arcs are saturated, and all the flow values in the arcs of (Y, Y) are equal to their lower bounds. Thus, we have / m a x = c(Y, Y) - l(Y, Y) = min {c(X, X) - l(X, X)} x
(5.179)
This completes the proof of the theorem. The theorem states that if there is a feasible flow from s to t in G, then the maximum flow value from s to Ms equal to min {c(X, X) - l(X, X)}. To x ascertain the existence of a feasible flow from s to ( i n G, we consider the extended net G'(V, E', I', c'.f) obtained from G(V, E, I, c,f) by adding the arcs (s, t) and {t, s) with infinite capacity and zero lower bound, as depicted in Fig. 5.46. It follows that there is a feasible flow from s to t in G if and only if there is a feasible circulation in C . According to Theorem 5.6, there is a feasible circulation in G' if and only if c'(X',X')^l'(X',X')
(5.180)
holds for all subsets X'cV, where X' = V - X'. If s e X' and t e X' or if s eX' and t eX', then c'(X', X') is infinite and condition (5.180) is always fulfilled. Therefore, we need only consider the situation where both s and t belong to X' or neither does. This implies that (5.180) is satisfied for all
O3,0
Fig. 5.46. The net G'(V, E', V, c',f) obtained from G(V,E,l,c,f) arcs (s, t) and (t, s) with infinite capacity and zero lower bound.
by adding
5.5 FLOWS IN NETS WITH LOWER BOUNDS ON ARCS
369
subsets I ' c V if and only if c(X,X)^l(X,X)
(5.181)
holds for all subsets X c V such that either both s and t are in X or neither is, where X = V — X. To construct such a flow, we can solve the equivalent maximum flow problem, using the modified Ford-Fulkerson algorithm as outlined in the proof of Theorem 5.8. Instead of finding a maximum flow from s to ( in G, we can use a modified Ford-Fulkerson algorithm to generate a minimum flow from s to t, assuming of course the existence of a feasible flow from s to t in G. The modification of (3.59) and (3.60) in Step 2 of the labeling routine is as follows: Select any labeled and unscanned node x with label (z, ± , w(x)), and perform the following operations: (a) For all nodes y, (x, y) e E, that are unlabeled such that f(x, y) > l(x, v), label y by (x, - , w(y)) where w(y) = min [w(x), f(x, y) - l(x, y)]
(5.182)
(b) For all nodes y, (y, x) e E, that are unlabeled such that / ( y , x) < c(y, x), label y by (x, + , w(y)) where w(y) = min [w(x), c(y, x)-f(y,
x)]
(5.183)
The procedure will result in a minimum flow from s to t in G. A dual to Theorem 5.8 is stated as follows.
THEOREM 5.9 If there is a feasible flow from 5 to t in a given net G(V, E, I, c, f), then the minimum flow value / m i n from s to ( is equal to the maximum of [l(X, X) - c(X, X)] taken over all s-t cuts (X, X) in G, i.e. / m i n = min {fst} = max {l(X, X) - c(X, X)} x
(5.184)
The theorem can be proved in a manner similar to that of Theorem 5.8, the details of which are omitted. We illustrate the above by the following examples. Example 5.14 A capacitated net G(V, E, I, c,f) is shown in Fig. 5.47. A feasible flow from s to / is presented in Fig. 5.48, where, as before, the triplets of
370
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
Fig. 5.47. A capacitated net with lower bounds on flows in arcs. nonnegative real numbers adjacent to the arcs denote the capacities, the flow values, and the lower bounds for the arcs given in the order described. Applying the modified Ford-Fulkerson algorithm outlined in the proof of Theorem 5.8, an augmenting path Psl from s to t is located by the labeling process: (5.185)
P„ = (s, 2)(2, 4)(4, 0
A unit flow can now be increased along this path, and the resulting flow pattern is shown in Fig. 5.49. Applying the modified Ford-Fulkerson algorithm to the net of Fig. 5.49 yields the node labels as indicated. Since no more labels can be assigned and t is not reached, the flow is therefore maximum. Let Y and Y be the sets of labeled and unlabeled nodes of the net of Fig. 5.49, respectively. Then we have Y = {s, 1}, Y = {2, 3, 4, t), and / ma x = c(Y, Y)-l(Y,
Y)
= c({s, 1}, {2, 3, 4, t}) -1({2, 3, 4, t), {s, 1}) = c(l, 3) + c(l, 4) + c(s, 2) - 1(2, 1) = 6 + 4 + 2 - 2 = 10 (s, +,2)
(5.186)
6,6,4
10,8,6 (s, ©,oo) (s
')(4, +,D
(*,©,!)
(2, ©,1)
4,2,1 Fig. 5.48. A feasible flow for the net of Fig. 5.47 together with the labeled nodes for flow augmentation.
5.5 FLOWS IN NETS WITH LOWER BOUNDS ON ARCS
371
4,3,1
Fig. 5.49. A maximum flow from s to t and the resulting labels for the nodes.
giving the maximum flow value from s to t in G to be 10. Observe that all the arcs in (Y, Y) are saturated and the arc in (Y, Y) equals to its lower bound. Example 5.15 We wish to determine the minimum flow value from s to ( in the capacitated net G(V, E, I, c,f) of Fig. 5.47. An initial feasible flow / is shown in Fig. 5.48, and is redrawn in Fig. 5.50. Applying the modified Ford-Fulkerson algorithm of (5.182) and (5.183) to the net G of Fig. 5.50 locates a flow augmenting path Pst = (s, 1)(1, 3)(3, /) from s to t. A unit flow reduction along this path is possible, and the resulting flow pattern is shown in Fig. 5.51. Repeating the labeling process once more for the net of Fig. 5.51 yields another flow augmenting path P'st — (s, 1)(2, 1)(2, 4)(4, t). In P'st a unit flow reduction can be made for the arcs (s, 1), (2, 4) and (4, t) and a unit flow increase is assigned to arc (2,1). The resulting flow pattern is presented in Fig. 5.52, in which if we repeat the labeling process, we find that except node s, no more labels can be assigned to other nodes and t is not reached. Thus, the flow from s to / of value 7 is the minimum among all the feasible flows.
Fig. 5.50. A feasible flow from s to t together with the node labels locating a flow augmenting path for flow reduction.
372
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
Fig. 5.51. A node labeling process locating a flow augmenting path from s to t for flow reduction.
Fig. 5.52. A minimum flow from s to t with node labels identifying the associated s-t cut. To identify an s-t cut having this minimum value, let X and X be the labeled and unlabeled nodes of G. Then from Fig. 5.52 X={s},
X= {1,2,3,4,1}
(5.187)
giving the minimum flow value fmin =
l(X,X)-c(X,X)
= l({s}, {1, 2, 3, 4, 0 ) - c({l, 2, 3, 4, t], {s}) = l(s, 1) + l(s, 2) = 6 + 1 = 7
(5.188)
5.6 FEASIBLE FLOWS IN NODE-AND-ARC CAPACITATED NETS In Section 3.10, we studied the maximum flow problem in a node-and-arc capacitated net. In the present section, we extend the feasibility theorems to node-and-arc capacitated nets.
5.6 FEASIBLE FLOWS IN NODE-AND-ARC CAPACITATED NETS
373
Let G(V, E, c,f) be a given net. Suppose that in addition to the arc capacity function, each node i eV is associated with a nonnegative real number h(i) called the node capacity of i. The node capacity h is, therefore, a function from the node set V to the nonnegative reals. For simplicity, we write G as a quintuplet G(V, E, c,f, h). As before, we partition the node set V into the disjoint source set 5, the intermediate node set R, and the sink set T. Associate with each x e S a nonnegative real number a(x) called the supply function, and with each x eT a nonnegative real number b(x) the demand function. The objective is to determine the existence of a flow pattern in G satisfying the constraints
f(x,V)-f(V,x)^a(x), f(x,V)-f(V,x) = 0, f(V,x)-f(x,V)^b(x), c(x,y)^f(x,y)^0, f(x,V)^h(x), f(V,x)^h(x),
x eS xeR xeT (x, y)eE xeV xeV
(5.189) (5.190) (5.191) (5.192) (5.193) (5.194)
If Vx and V2 are disjoint subsets of V, then a directed path from a node in Vi to a node in V2 is called a directed path from Vt to V2. Using this we introduce the notion of a generalized disconnecting set with respect to Vx and V2. DEFINITION 5.1 Generalized Disconnecting Set. A generalized disconnecting set from Vl to V2 in a directed graph G(V, E) is a collection of nodes and arcs of G such that every directed path from Vx to V2 has at least a node or an arc belonging to the collection, where Vx and V2 are disjoint subsets of V. Let X be a subset of V and write X = V — X. Denote by Dx x a generalized disconnecting set from X to X in G(V, E, c,f, h). Then the capacity k(DxyX) of Dx x is defined to be the sum of the capacities of its constituent elements:
KDX,X)=
£
c(x,y)+
2
Hx)
(5.195)
As in Section 3.10, the present problem can be converted to the arc capacity case by the following procedure. Let G*(V*, E*, c*,f*) be the net derived from G(V, E, c,f, h) in accordance with the following rules: To each node i e V, there correspond two nodes i', i"eV* such that if (i,j)eE, then (i',j")eE*. In addition, for each ieV, there is an
374
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
(/", i')e E*. The arc capacity defined on E* is given by c*{i',j") = c(i,j),
(i,j)eE
c*(i",i') = h(i),
ieV
(5.196) (5.197)
An example for this conversion is shown in Figs. 3.61 and 3.62. With this representation, it is clear that for any feasible flow in a supply-demand net G(V, E, c,f, h) that does not exceed the node capacities, there corresponds an equivalent feasible flow in G*(V*, E*, c*,f*) by taking r(i',j")=f(i,j),
(i,j)eE
f*(i",i')=f(i,V), / * ( ' " , i')=f(V,
i),
(5.198)
i*T
(5.199a)
ieT
(5.1996)
and vice versa. Thus, we can apply Theorem 5.1 to ascertain the feasibility conditions for G. To this end, let the node set V* be partitioned into the disjoint subsets S* = { x ' | x ' e V *
and xeS}
(5.200a)
T* = {x"\x"eV*
and xeT}
(5.2006)
(5.200c) R* = V*-S*-T* corresponding to the source, sink and intermediate sets of G*, respectively. The supply and demand functions a and b for the nodes of 5* and T* are defined the same as in G: a(x') = a(x),
x'eS*
and x e 5
(5.201a)
b(x") = b(x),
x"eT*
and xeT
(5.2016)
According to Theorem 5.1, there is a feasible flow in G* if and only if b(T* n X*) - a(S* D X*) ^ c*(X*, X*)
(5.202)
holds for every subset X*cV*, where X* = V* -X*. Observe that for each cut (X*, X*), there corresponds a generalized disconnecting set Dx x in G for some X c. V such that (x, y) € E or x € V is in Dxx if and only if either (x', y") or (x", x') is in (X*, X*), respectively, and vice versa. Furthermore, we have k(Dx,x) b(TnX)
= c*(X*, X*)
(5.203)
= b(T*nX*)
(5.204)
a(S n X) = a(S* <1 X*)
(5.205)
Thus, the constraints (5.189)-(5.194) are feasible if and only if ^(rn^-atSnZ^minA:^*)
(5.206)
5.6 FEASIBLE FLOWS IN NODE-AND-ARC CAPACITATED NETS
375
holds for every subset XeV. Thus, we have established a result of Duguid (1961). THEOREM 5.10 Partition the node set V of a given net G(V, E, c,f, h) into three disjoint subsets S, R and T with a supply function a(x) i? 0, x e S, and a demand function b(y) ^ 0 , y e T. Then the constraints
f(x,V)-f{V,x)?ka{x), f(x,V)-f(V,x) = 0, f(V,x)-f(x,V)^b(x), c(x,y)*f(x,y)*0, f(x,V)^h(x), f(V,x)^h(x),
x eS xeR xeT (x, y)eE xeV xeV
(5.207a) (5.2076) (5.207c) (5.207 d) (5.207e) (5.207/)
are feasible if and only if b(TnX)-a(SnX)^mink(DixJt)
(5.208)
holds for every subset I c V , where X = V — X and k(D'x%) is the capacity of the ith generalized disconnecting set from X to X in G. If a supply is considered to be a negative demand, then the theorem states that there is a feasible flow in G if and only if the net demand for every subset X of the node set does not exceed the minimum capacity of a generalized disconnecting set from its complement to X. We remark that if there are no node capacity constraints, Theorem 5.10 reduces to Theorem 5.1 after setting h(x) = °° for x 6 V. In Section 3.10, we demonstrated that the solution of the maximum flow problem from s to t in a node-and-arc capacitated net G(V, E, c,f, h) is equivalent to solving the maximum flow problem from s" to t' in the corresponding arc capacitated net G*(V*, E*, c*,f*). This result can now be stated in terms of the generalized disconnecting set. THEOREM 5.11 The maximum flow value / m a x from s to t in a node-and-arc capacitated net G{V, E, c,f, h) is equal to the minimum capacity of a generalized disconnecting set from s to /, i.e. / m a x = max {/„} = min {*(#.,)}
(5.209)
376
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
where D'st is the t'th generalized disconnecting set from 5 to t, and fst is taken over all feasible flow patterns in G. Proof. Let G*(V*, E*, c*,f*) be the net derived from G by the rules outlined in Section 3.10 or above. Then it is clear that for any flow from s to ( i n G that does not exceed the node capacities, there corresponds an equivalent flow/* from s" to t' in G* by taking f*(i',j")=f(i>)),
(hJ)eE
f*(i",i')=f(i,V),
(5.210a)
i*t
f*{t",f)=f(V,t)
(5.2106) (5.210c)
and vice versa. Then by the max-flow min-cut theorem (Theorem 3.2), the maximum flow value / £ a x from s" to t' in G* is equal to the capacity of a minimum s"-t' cut (X*, X*). By taking (x, y) € £ or x e V in Dst if and only if either (x1, y") or (x", x') is in (X*, X*), we see that for each s"-t' cut (X*, X*) in G*, there corresponds a generalized disconnecting set Ds, in G having the same capacity: c*(X*,X*)
= k(DStt)
(5.211)
The theorem follows. This completes the proof of the theorem. We illustrate the above results by the following examples. Example 5.16 A node-and-arc capacitated net G(V, E, c,f, h) is presented in Fig. 5.53 with the node capacities given as h(s) = U, fc(3) = 5,
h(l) = 9, /i(4) = 10,
h(2) = 5 h(t) = 15
Fig. 5.53. A node-and-arc capacitated net used to illustrate Theorem 5.11.
(5.212)
5.6 FEASIBLE FLOWS IN NODE-AND-ARC CAPACITATED NETS
377
Fig. 5.54. A minimum capacity generalized disconnecting set from s to t for the net of Fig. 5.53.
They are shown in Fig. 5.53 as numbers h(x) adjacent to the nodes x e V together with the arc capacities c(x, y) given as numbers adjacent to the arcs (x, y). The subgraph D]tt of Fig. 5.54 is a generalized disconnecting set from s to t in G because the removal of the subgraph corresponding to this set from G breaks all the the directed paths from 5 to t in G or, equivalently, every directed path from s to t has at least a node or an arc belonging to this subgraph. The set D2\t— {2, 3, (1, 4)} is another generalized disconnecting set from 5 to t. The capacities of these generalized disconnecting sets D], and D2\, are found to be *(Dj,,) = c(s, 2) + c(l, 4) + h(3) = 2 + 4 + 5 = 11
(5.213a)
k(Dl,) = h(2) + fc(3) + c(l, 4) = 5 + 5 + 4 = 14
(5.2136)
Since D\t has the minimum capacity among all the generalized disconnecting sets from s to t, by Theorem 5.11 the maximum flow value / m a x from i to t in G is equal to 11, or / m a x = max {/„} = min {£(£>!,)} = H
(5.214)
Fig. 5.55. A maximum flow pattern from s to t for the node-and-arc capacitated net of Fig. 5.53.
378
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
A flow pattern meeting the node and arc capacities is shown in Fig. 5.55 as pairs of numbers adjacent to the arcs, the first being the arc capacities and the second the arc flow values. To illustrate the actual construction of a maximum feasible flow from s to t in G, we apply the rules of Section 3.10 by first converting the node-and-arc capacitated net G of Fig. 5.53 to the equivalent arc capacitated net G*(V*, E*, c*, / * ) of Fig. 5.56, and then by using any of the existing maximum flow algorithms discussed in Chapter 3 we construct a maximum flow from s" to t' in G*. The resulting flow pattern is shown in Fig. 5.56, where as before the arc capacities c*(x, y) and arc flow values f*(x, y) are given as pairs of numbers adjacent to the arcs. Finally, applying the Ford-Fulkerson algorithm yields the node labels as indicated in Fig. 5.56. Let X* and X* be the sets of labeled and unlabeled nodes of V*, respectively. Then we have X* = {s", s', 1"},
X* = {1', 2", 2', 3", 3', 4", 4', t", t'}
(5.215)
giving c*(X*, X*) = c*({s", s', 1"}, {1', 2", 2', 3", 3', 4", 4', t", t'}) = c*(s', 2") + c*(l", 1') = 2 + 9 = 11
(5.216)
Thus, (X*, X*) is a minimum s"-t' cut. The corresponding minimum generalized disconnecting set D^, from 5 to t in G is identified as Dl,= {(s,2),l}
r
(X*,X*)
(5-217)
/—*~ (Y*,Y*)
Fig. 5.56. The conversion of the maximum flow problem of a node-and-arc capacitated net to that of an equivalent arc capacitated net.
5.6 FEASIBLE FLOWS IN NODE-AND-ARC CAPACITATED NETS
379
having capacity k(D*t) = c(s, 2) + h{\) = 2 + 9 = 11. As mentioned earlier, Dl,— {(s, 2), (1, 4), 3} is another such minimum set, the corresponding minimum s"-t' cut (Y*, Y*) of which in G* is found to be (Y*, ?*) = ({s", s', 1", V, 3"}, {2", 2', 3', 4", A', t", t})
(5.218)
Example 5.17 A node-and-arc capacitated net G(V, E, c,f, h) is shown in Fig. 5.57, where the supplies a(x), the demands b{x), the node capacities h{x) for the nodes x e V and the arc capacities c(x, y), (x, y) e E, are as indicated in the figure. We wish to ascertain the feasibility of this supply-demand problem. To proceed, we first construct a preliminary flow pattern as shown in Fig. 5.58, which nearly succeeds in meeting the supply and demand A(3)=5
A(5)=4
Fig. 5.57. A node-and-arc capacitated supply-demand net. /z(3)=5
fc(5)=4 Fig. 5.58. A flow pattern that almost succeeds in meeting the supply and demand requirements.
380
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
4,3" 10,8
8,7
2 11
6,4
Fig. 5.59. The conversion of a supply-demand problem in a node-and-arc capacitated net to a maximum flow problem in an equivalent net. requirements and satisfies the node and arc capacity constraints. We next construct an extended net G'(V, E', c',f, h') from G by adjoining two nodes 5 and t and the arcs (s, S) and (T, t), as shown in Fig. 5.59, where 5 = {1, 2} and T = {6, 7}. The node and arc capacity functions h' and c' of G' are denned by (5.219a)
h'{s) = h'{t) = <*> c'(s, x) = a(x),
xeS
(5.219b)
c'(x,t)
xeT
(5.219c)
xeV
(5.219d)
(x y)eE
(5.219e)
= b(x),
h'(x) = h{x), c\x,y)
= c{x,y),
Also, the flow values / ' are taken to be f'(s,
1) = / ( l , V) -f(V,
1) = / ( l , 3) + / ( 1 , 2) - / ( 4 , 1) = 3 + 3 - 0 = 6 (5.220a)
f'(s,
2) = / ( 2 , V) -f(V,
2) = / ( 2 , 4) 4-/(2, 5) - / ( l , 2) = 8 + 3 - 3 = 8 (5.2206)
/ ' ( 6 , t) =f(V, 6) - / ( 6 , V) = / ( 3 , 6) + / ( 4 , 6) - / ( 6 , 7) = 2 + 6 - 1 = 7 (5.220c) / ' ( 7 , 0 =f(V,
7) - / ( 7 , V) = / ( 6 , 7) + / ( 4 , 7) + / ( 5 , 7) = 1 + 2 + 4 = 7 (5.220d)
f'{x,y)=f{x,y),
(x,y)eE
These are as indicated in Fig. 5.59.
(5.220e)
5.6 FEASIBLE FLOWS IN NODE-AND-ARC CAPACITATED NETS
381
Fig. 5.60. The conversion of the feasibility problem of a node-and-arc capacitated net to the maximum flow problem in an equivalent arc capacitated net. To convert the maximum flow problem in a node-and-arc capacitated net G', we apply the rules of Section 3.10 which were repeated briefly in this section and obtain the equivalent arc capacitated net G*(V*, E*, c*,/*) of Fig. 5.60. In Fig. 5.60, the arc capacities and flow values are again given as pairs of numbers adjacent to the arcs. Finally, using the Ford-Fulkerson algorithm yields the node labels shown in Fig. 5.60. Let X* and X* be the labeled and unlabeled nodes of G*, respectively. Then Xt = {s", s', 1", l',2"}
(5.221a)
Xt = {2\ 3", 3', 4", 4', 5", 5', 6", 6', 1", T, t", t'}
(5.2216)
The s"-t' cut (X*, X*) is minimum in G* with cut capacity c*(Xt, Xt) = c*{V, 3") + c*(2", 2') = 3 + 11 = 14
(5.222)
By the max-flow min-cut theorem, the flow / * shown in Fig. 5.60 is maximum, so is the flow/' in Fig. 5.59. Since the arc (7, () in C is not saturated, the supply-demand problem for the net G of Fig. 5.58 is . infeasible. To verify that condition (5.208) is indeed violated for some X cV, let A r = { l , 2}. The subgraph of Dxx,x in G corresponding to the cut (X*, X*) of G* is a minimum generalized disconnecting set, as shown in Fig. 5.61, and is given by £>*,*= {(1,3), 2}
(5.223)
382
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
K2)=n
© Fig. 5.61. A minimum generalized disconnecting set from {1,2} to {3,4, 5, 6,7} for the net of Fig. 5.57. yielding from (5.208) b(T (1X) - a(S D X) = b({6, 7} n {3, 4, 5, 6, 7}) - a{{\, 2} n {3, 4, 5, 6, 7}) = b({6, 7}) - « ( { }) = b(6) + b{l) - 0 = 7 + 8 = 15 $k(Dx,x)
= *({(!. 3 >' 2 » = c(l, 3) + /i(2) = 3 + 11 = 14 (5.224)
confirming that the supply-demand problem for the net of Fig. 5.57 is infeasible. In addition to the cut (Xt, X%), there is another minimum s"-t' cut (X*, X$) in G*, as depicted in Fig. 5.60, where X* = {s", s', 1", V, 2", 2', 3", 3', 4", A', 5"}
(5.225a)
Xt = {6", 6', 5', 1", 1', t", t'}
(5.225fe)
whose capacity is found to be c*{X$, Xt) = c*{y, 6") + c*(4', 6") + c*(4\ 7") + c*(5", 5') = 2 + 6 + 2 + 4 = 14 (5.226) The subgraph of D2X x in G corresponding to this cut (X*, X*) is another minimum generalized disconnecting set, as shown in Fig. 5.62, and is given by Z>i*={(3,6),(4,6),(4,7),5}
(5.227)
where * = {1,2, 3, 4, 5},
^={6,7}
(5.228)
5.7 SUMMARY AND SUGGESTED READING
383
Fig. 5.62. A minimum generalized disconnecting set from {1,2,3,4,5} to {6, 7} for the net of Fig. 5.57.
yielding from (5.208) b(T nX)-
a(S f l i ) = b{{6, 7}) - a({ }) = 15
$k(D2x.x) = c(3, 6) + c(4, 6) + c(4, 7) + h(5) = 2 + 6 + 2 + 4 = 14
(5.229)
a violation of (5.208). We remark that if one is interested in checking the feasibility of a node-and-arc capacitated supply-demand net or in computing the maximum flow of a node-and-arc capacitated net, the most efficient method is to use the Ford-Fulkerson algorithm to solve the equivalent maximum flow problem in the enlarged arc capacitated net, rather than to check the conditions (5.208) for all subsets of the node set of the original net in determining the feasibility of the supply-demand problem. 5.7 SUMMARY AND SUGGESTED READING In this chapter, we developed several theorems characterizing the existence of network flows that satisfy additional linear inequalities of various kinds. Specifically, we gave necessary and sufficient conditions for the existence of a flow pattern that satisfies the demands at certain nodes from the supplies at some of the others. If such a solution exists, we say that the constraints are feasible. Otherwise, they are infeasible. We showed that if, corresponding to each subset of sinks, there is a flow satisfying the aggregate demand of the subset, without exceeding the supply limitations at each of the sources, then there exists a flow in the net meeting all the individual
384
FEASIBILITY THEOREMS AND THEIR APPLICATIONS
demands. Likewise, if, corresponding to each subset of sources, there is a flow satisfying all individual demands without exceeding the aggregate supply of the subset with the supply at the sources outside the subset being infinite, then there exists a flow in the net meeting all the individual supplies. These results were derived directly from the max-flow min-cut theorem. As a result, if the supply function, the demand function, and the capacity function are all integral valued, and if there exists a feasible flow, then by the flow integrity theorem there is an integral feasible flow. We then extended the problem by imposing lower bounds for the supplies at each of the sources and upper bounds for the demands at each of the sinks. We showed that if there is a flow that meets the lower bound requirements at each of the sources and the upper bound requirements at each of the sinks, and if there is a flow that meets the upper bound requirements at each of the sources and the lower bound requirements at each of the sinks, then there is a flow that satisfies all the lower and upper bound requirements at each of the sources and sinks simultaneously. This result, being symmetric with respect to the demands and supplies, is known as a symmetric supply-demand theorem. In addition to the supply-demand problem, we also studied the existence of a flow in a source-free and sink-free net that satisfies the prescribed lower and upper bounds on the flow values in the arcs. If such a flow exists, we say that there is a feasible circulation in the net. Necessary and sufficient conditions for the existence of a feasible circulation were derived, and is known as the circulation theorem. The extension of this problem to the situation where the net flow into an individual node lies between prescribed bounds was also considered. Necessary and sufficient conditions were obtained. To construct a feasible circulation, we described a labeling process that is a variant of the Ford-Fulkerson algorithm. This process is valid for all nets having rational-valued capacity function as well as the lower-bound function. The procedure is efficient in that it either constructs a feasible circulation or detects a violation of the feasibility condition. In Chapter 3, we considered the problem of finding a maximum flow from a source to a sink in a capacitated net with zero lower bound for all the arcs. We generalized this problem by requiring nonnegative real lower bounds on arc flows. We showed that if there is a feasible flow from the source s to the sink fin a net, then its maximum flow value is equal to the minimum of the difference of the capacity of an s-t cut (X, X) and the sum of the lower bounds of the arcs in the cut (X, X). A similar result was obtained for the minimum flow value from 5 to t. Finally, we studied the maximum flow problem in a node-and-arc capacitated net, in which each node is associated with a nonnegative real number. For this, we introduced the notion of a generalized disconnecting set. We showed that there is a feasible flow if and only if the net demand for every subset of the node set does not exceed the minimum capacity of a generalized disconnecting set from its complement to the subset. As a
REFERENCES
385
by-product, we demonstrated that the solution of the maximum flow problem in a node-and-arc capacitated net is equivalent to solving the maximum flow problem in an equivalent arc capacitated net. This result can also be stated in terms of a minimum capacity generalized disconnecting set. In words, it states that the maximum flow value from the source s to the sink ( i n a node-and-arc capacitated feasible net is equal to the minimum capacity of a generalized disconnecting set from s to t. The classical book for feasibility problems and their variants is Ford and Fulkerson (1962). For further study on the various aspects of the problems, the reader is referred to the original papers listed in the references, particularly the papers by Gale (1957) and Hoffman (1960).
REFERENCES Chen, W. K. (1976), Applied Graph Theory: Graphs and Electrical Networks, Amsterdam, The Netherlands: North-Holland, 2nd revised edition. Dantzig, G. B. and Fulkerson, D. R. (1954), "Minimizing the number of tankers to meet a fixed schedule," Naval Res. Logist. Quart., vol. 1, pp. 217-222. Duguid, A. M. (1961), "Feasible flows and possible connection," Pacific J. Math., vol. 11, pp. 483-488. Ford, L. R. Jr and Fulkerson, D. R. (1962), Flows in Networks, Princeton, N.J.: Princeton University Press. Fulkerson, D. R. (1959), "A network-flow feasibility theorem and combinatorial applications," Can. J. Math., vol. 11, pp. 440-451. Gale, D. (1957), "A theorem on flows in networks," Pacific J. Math., vol. 7, pp. 1073-1082. Hoffman, A. J. (1960), "Some recent applications of the theory of linear inequalities to extremal combinatorial analysis," Proc. Symposia on Applied Math., vol. 10, pp. 113-127. Lan, J. L. and Chen, W. K. (1985), "On/-factors of a graph," J. Franklin Inst., vol. 320, pp. 55-62.
6 APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
In the preceding chapter, we developed several theorems characterizing the existence of network flows that satisfy additional linear inequalities of various kinds. Specifically, we gave necessary and sufficient conditions for the existence of a flow pattern that satisfies the demands at certain nodes from the supplies at some of the others, or that satisfies both the lower and upper bounds of the arc flows. In the present chapter, we apply these theorems to the solutions of the subgraph problem for directed graphs, the matrix problem with prescribed row sums and column sums, and a number of other combinatorial problems in operations research.
6.1
THE SUBGRAPH PROBLEM OF A DIRECTED GRAPH
A problem that occurs in varying contexts is to establish a general criterion for the existence of subgraphs with prescribed degrees of a given directed graph. This problem has been studied extensively by many and a complete solution was given by Ore (1956a, 19566, 19586). A special case of the problem is to determine the necessary and sufficient conditions for the existence of a directed graph having the prescribed outgoing and incoming degrees. Various situations to this special case have been investigated by Chen (1966), Hakimi and Schmeichel (1978), and Eggleton and Holton (1979). In the following, we apply the flow theorems to generalize Ore's results by presenting criteria for the existence of (p, s) subgraphs with prescribed degrees and to show how this result allows the unification of many of the existing conditions. In general, we follow the recent work of Chen (1980). 386
6.1 THE SUBGRAPH PROBLEM OF A DIRECTED GRAPH
387
A directed graph G(V, E) consists of the node set V and edge set E of ordered pairs of the form (i, j), called the arcs, where i, j e V and f is a positive integer. The arcs (i, j), for t = 1, 2, . . . , k, fc =" 2, are the parallel arcs of G if (i, /), e E for all t. This is in direct contrast to most of the nets considered so far where the existence of at most one arc directed from one node to another has been postulated. For t=\, we write (i, j), = (i, j), for simplicity. Also, (i, j) is used to represent any one of the parallel arcs (i, j), e E. As before, the node i is called the initial node and / the terminal node of (/,/),- The local structure of a directed graph is described by the degrees of its nodes. DEFINITION 6.1 Outgoing and Incoming Degrees. For a directed graph G, the number d+(i) of arcs of G having node i as their initial node is called the outgoing degree of node i in G, and the number d~(i) of arcs of G having node i as their terminal node is called the incoming degree of node i in G. Together [d+(i), d~(i)] they are referred to as the degree pair of the node i in G. Thus, there are two numbers denned for each node of G. These numbers sometimes are also referred to as positive and negative degrees of a node. If d(i) denotes the number of arcs of G incident with node i, then d(i) = d+(i) + d-(i)
(6.1)
Since every arc is outgoing from a node and terminating at another, it is evident that the number b of arcs of G is related to the degrees of its nodes by the equation
& = 2 + (i) = 2<*~(0 l
(6.2)
i
where the summations are over all i of G. As an illustration, consider the directed graph G of Fig. 6.1, in which we have
d"(5) = 2,
d+(2) = l,
d~(2) = 2
+
d"(4) = 1
+
d (4) = 2, d (6) = l,
(6.3)
It is straightforward to confirm that 6
b
= 2 d+(i) = 2 + 1 + 3 + 2 + 1 + 1 6
= 2 d~(i) = l + 2 + 2 + 1 + 2 + 2 = 10
(6.4)
388
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
^
Fig. 6.1. A directed graph used for illustration.
The sequence of degree pairs [d+(i), d (i)] of the nodes i {i = 1, 2, . . . , 6) is given by {[d+(i), d~(i)]} = {[2, 1], [1, 2], [3, 2], [2, 1], [1, 2], [1, 2]}
(6.5)
In a given directed graph G(V, E), suppose that each node x e V has associated with it a nonnegative integer h(i) and that each arc (x, y) e E has associated with it a nonnegative integer g(x, y). The function h is defined from V to the nonnegative integers, and the function g from E to the nonnegative integers. As in Section 3.2, if X and Y are subsets of V, then (X, Y) denotes the set of all arcs (x, y) directed from x e X to y e Y; and, for any function h or g defined on V or E, write h(X)=^h(x)
(6.6)
xeX
g(X,Y)=
2
8(x,y)
(6.7)
(x,y)e(X,Y)
We denote a set consisting of one element by its single element. Thus, if X contains only one element x, we write (x, Y), h(x), g(x, Y), and so on. In this connection, (x, y) has two different meanings. On the one hand, it represents any one of the parallel arcs (x, y)„ t = l,2,...,k, k^2, in E. On the other hand, it denotes the set of parallel arcs from x to y in E. This should not create any difficulty as the context will tell. For a finite set 5, the number of its elements is denoted by \S\. Thus, |A"| denotes the number of nodes in X and \{X, Y)\ denotes the number of arcs in (X, Y). In particular, \(x, y)\ = k denotes the number of parallel arcs from x to y in E.
DEFINITION 6.2 (p,s)-Digraph. A (p, s)-digraph is a directed graph G(V, E), in which \(x, y)\ ^p for all (x, y) e E, x=£y, and \(x, x)\^s for all x e V, where p
6.1 THE SUBGRAPH PROBLEM OF A DIRECTED GRAPH
389
and s are two given nonnegative integers. When p = s, a (p, s)-digraph is simply called a p-digraph. The letters p and s stand for the words parallel and self-loop, respectively. In Fig. 6.2, the directed graph G(V, E) is a (3,2)-digraph, because the maximum number of parallel arcs from one node to another is 3 or |(1,2)| = 3, and the maximum number of self-loops at any node is 2 or |(3,3)| = 2. Clearly, it is also a (3,3)-digraph or a (4,3)-digraph. As a matter of fact, it is a (p, s)-digraph for any /? = 3 and s is2. Its degree-pair sequence is found to be {[d+(x), d~(x)]} = {[4, 1], [3, 4], [4, 4], [3, 3], [3, 5]}
(6.8)
Given a directed graph G(V, E), associate with each x eV four nonnegative integers a(x), a'(x), b(x) and b'(x) satisfying 0^a(x)^a'(x),
xeV
(6.9a)
0^b(x)^b'(x),
xeV
(6.9b)
The problem is to find necessary and sufficient conditions under which G possesses a (p, s)-digraph as a spanning subgraph H whose outgoing and incoming degrees d^(x) and djj(x) satisfy a(x)^dUx)^a'(x),
xeV
(6.10a)
b(x)^dj,(x)^b'(x),
xeV
(6.10fc)
To determine such conditions, we convert this to a flow problem, as follows: First construct from G(V, E) a directed bipartite graph B(V',V";E'): To each x e V, there correspond two nodes x'eV and x" e V". The arc (x', y") is in the arc set E' if and only if (x, y) is an arc of G. We remark that parallel arcs need not be considered in the present situation. If there are parallel arcs from x to y in G, there corresponds a
Fig. 6.2. A (3,2)-digraph G(V, E).
390
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
single arc (x',y")eE'. Thus, B(V, V";E') is a (l,0)-digraph associated with G(V, E). Associate with each arc (*', y") e E' a nonnegative integer c(x', y") called the capacity of (*', y"). The capacity function c from E' to the nonnegative integers is defined by c(x',y") = min[\(x,y)\,p],
x=ty
(6.11a)
= min [\(x, y)\, s], x=y
(6.116)
To complete the conversion to a supply-demand problem, associate with each x' e V two nonnegative integers a(x') and a'(x'), and with each x" e V" two nonnegative integers b(x") and &'(*") satisfying a(x') = a(x),
a'(x') = a'(x),
xeV,
x'eV
(6.12a)
b(x") = b(x),
b'(x") = b'(x),
xeV,
x"eV"
(6.12b)
The directed bipartite graph B(V, V"; E') can now be considered as a supply-demand net B(V U V", E',c,f) with source set V and sink set V". Then according to Theorem 5.5, the constraints a(x')^f(x',V'UV")-f(V'UV",x')^a'(x'),
x'eV
b(x") ^/(V' U V", x") -fix",
*" e V" (6.14)
V' U V") g 6'(*"),
c(x',y")^f(x',y")^0,
(*', v " ) e £ '
(6.13) (6.15)
are feasible if and only if c(X,X)^b(V"DX)-a'(V'nX)
(6.16a)
c(X,X)^a(V'nX)-b'(V"nX)
(6.16b)
hold for every subset XcV'UV", where X=V'UV"-X. Since the net B is bipartite with arcs directing from a node in V to a node in V , we have f(V'UV",x')
=0
(6.17a)
f(x",V'UV")
=0
(6.17 b)
Partition the subsets X and X into X = X'UX" X=X'UX"
(6.18a) (6.18b)
where X' c V, X" c V", and X' = V'-X',
X" = V" - X"
(6.19)
6.1 THE SUBGRAPH PROBLEM OF A DIRECTED GRAPH
391
Invoking the bipartite property of the net B, constraints (6.16) can be simplified to c(X', X") ^ b(X") -a'(X')
(6.20a)
c(X', X") ^ a ( X ' ) - b'(X")
(6.20b)
Our conclusion is that in the supply-demand net B(V U V", E', c, f) with source set V and sink set V", the constraints a(x')^f(x', V'UV")^a'(x'),
x' e V
(6.21)
b(x")s/(V
x"e V"
(6.22)
U V", x")^b'(x"),
c(x',y")^f(x',y")^0,
(x',y")eE'
(6.23)
are feasible if and only if c(X', X") ^ b(X") - a'(X')
(6.24a)
c(X', X") ^ a ( X ' ) - b'(X")
(6.24b)
hold for every subset X' c V and X" c V". It is clear that if the directed graph G(V, E) possesses a (p, s) spanning subgraph H whose outgoing and incoming degrees satisfy the inequalities (6.10), then there is a feasible integral flow finB satisfying (6.21)-(6.23) by defining the capacity function as in (6.11). Conversely, if there is a feasible integral flow/from V to V" in B satisfying the constraints (6.21)-(6.23), we can construct a (p, s) subgraph H satisfying (6.10) in G by putting arc (x, y)'\nH with multiplicity f(x', y") if and only if f(x', y")i=0. Hence, by translating conditions (6.24) in terms of those in G, we obtain the desired conditions on the subgraphs.
THEOREM 6.1 In a directed graph G(V, E), associate with each x eV four nonnegative integers a(x), a'(x), b(x) and b'(x) satisfying 0^a(*)^a'(*)
(6.25a)
0^b(x)^b'(x)
(6.25b)
and specify two nonnegative integers p and s. Then G has a (p, s) subgraph H whose outgoing and incoming degrees d„(x) and dj,(x) satisfy a(x)^dt,(x)^a'(x) ,
b(x)^djl(x)^b (x)
(6.26a) (6.26b)
392
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
for each x e V if and only if 2
min lb'(y),
yey(X)
<-
2
£ min [\(x, y)\, 6xy(s - p) + p])^a(X) xeX
min\a'(y),J/mm[\(y,x)\,6xy(s~p)+p]}^b(X)
yey*(X)
xeA -
*•
(6.27a)
J
(6.27b) J
hold for all subsets X c V, where 6xy is the Kronecker delta, y(X) denotes the set of terminal nodes of the arcs of G having their initial nodes in X, and y*(X) denotes the set of initial nodes of the arcs of G having their terminal nodes in X. Proof. It is sufficient to show that conditions (6.24) and (6.27) are equivalent. Observe that each of the conditions (6.24) is stated in terms of the selections of a pair of subsets X' c V and X" c V". We first demonstrate that each of these conditions (6.24) can be simplified to one involving the choice of but one subset. Consider (6.246), for example. For a given subset X' c. V, define U" = {y" | y" e V", b'(y") < c(X', y")}
(6.28)
For this pair of subsets X' c V and U" c V", the inequality (6.24b) can be written as c(X', U") + b'(U") =
2
min [b'(y"), c(X', y")]^a(X')
(6.29)
y"ey(X')
For any fixed X' c V, the left-hand side of (6.29) minimizes this sum over all X" c V", as can be demonstrated below: c(X', 0") + b'(U") = c(X', 0" DX") + c(X', X") - c(X', U" n X")
+ b'(U"nx") + b'(x") - b'(0" n x") ^c(X',X")
+ b'(X")
(6.30)
since c(X', 0" n X " ) - b'(U" n X") ^ 0
b'(U"nx") - c(X', u" nx") ^o
(6.31a)
(6.316)
Thus, condition (6.246) is satisfied for all X' c V and X" c V" if and only if (6.29) holds for all X' c V. Similarly, condition (6.24a) reduces to 2 x'eY'(X")
for all X" c V".
min [a'(*')> c(x', X")] ^b(X")
(6.32)
6.1 THE SUBGRAPH PROBLEM OF A DIRECTED GRAPH
393
To compute c(X', y") and c(x', X"), y" e V" and x' e V, let X = {xeV\x'eX'}
(6.33a)
Y={yeV\y"eX"}
(6.336)
Then from (6.11) we obtain c(X', y") = 2 min [\(x, y)\, dxy(s - p) +p]
(6.34a)
xeX
c(x', X") = 2 min [\(x, y)\, dxy(s -p)+p]
(6.346)
ysY
Translating (6.29) and (6.32) in terms of the specifications for the given directed graph G in conjunction with (6.34) gives conditions (6.27). This completes the proof of the theorem. COROLLARY 6.1 A directed graph G(V, E) has a subgraph H whose outgoing and incoming degrees d^(x) and djj(x) satisfy a(x)^dUx)^a'(x),
xeV
(6.35a)
b{x)^dH{x)^b'{x),
xeV
(6.35b)
if and only if the inequalities 2
min[b'(y),\(X,y)\]^a(X)
(6.36a)
min[a'(y),\(y,X)\]^b(X)
(6.36b)
yey(X)
2 ysy\X)
hold for all
XeV.
Proof. In (6.27), let s=P=
2
\(x,y)\
(6.37)
(x,y)e£
The corollary follows directly from the observation that \(X, y)\ = 2 l(*> v)| = 2 min [|(*, y)\, p] xeX
\(y, *)\ = 2 \(y, *)l = 2 min [\(y, x)\, p] xeX
(6.38a)
xsX
xeX
This completes the proof of the corollary.
(6.38b)
394
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
In the case for which the outgoing and incoming degrees are specified exactly, we set a(x) = a'(x) and b(x) = b'(x) and obtain the following theorem.
THEOREM 6.2 A directed graph G(V, E) has a (p, s) subgraph H with outgoing and incoming degrees satisfying dUx) = a(x) ^ 0,
xeV
d.-H{x) = b(x)^Q,
xeV
(6.39a) (6.39b)
if and only if a(V) = b{V)
(6.40)
min b{y), 2 min [\(x, y)\, dxy(s -p)+p]]^a(X)
(6.41)
and either 2 yey(X)
*-
xeX
or 2
min a(y), £ min [\(y, x)\, dxy(s -p)+p]]^b(X)
yey'(X)
holds for all
L
(6.42)
xcX
XcV.
Proof. For the subgraph H to exist, it is necessary that a(V) = b(V). To complete the proof, it is sufficient to show that (6.40) and (6.41) imply (6.42), and (6.40) and (6.42) imply (6.41). As indicated in the proof of Theorem 6.1, with a(x) = a'(x) and b(x) = b'(x), (6.41) and (6.42) are completely equivalent to (6.24). Using the symbols defined in (6.24) for the bipartite supply-demand net B(V U V", E', c,f), we first demonstrate that (6.40) and (6.24fo) imply (6.24a), as follows: a(X') + c(X', X") ^a(X') + a{X') - b'(X") = a(V) - b(X") = b(V") - b(X") = b(X")
(6.43)
6.1 THE SUBGRAPH PROBLEM OF A DIRECTED GRAPH
395
Likewise, we can show that (6.40) and (6.24a) imply (6.246): b(X") + c(X', X") ^ b(X") + b(X") -
a'(X')
= b(V") - a(X') = a(V)
-
a(X')
= a(X')
(6.44)
This completes the proof of the theorem. Using (6.38) in (6.41) and (6.42) yields a result due to Ore (1956a) on the existence of a subgraph of a directed graph having prescribed outgoing and incoming degrees.
COROLLARY 6.2 A directed graph G(V, E) has a subgraph H with outgoing and incoming degrees d^(x) and djj(x) satisfying d^(x) = a(x) ^ 0 ,
xeV
(6.45a)
dj,{x) = b(x)^0,
xeV
(6.45b)
if and only if a{V) = b(V)
(6.46)
2
mm[b(y),\(X,y)\]^a(X)
(6.47)
2
mm[a(y),\(y,X)\]^b(X)
(6.48)
and either
or yeY'(X)
holds for all I c V . We illustrate the above results by the following examples. Example 6.1 The directed graph shown in Fig. 6.3 is a (2, 2)-digraph G(V, E). We wish to determine if there is a (1,1) subgraph H whose outgoing and
396
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
Fig. 6.3. A (2,2)-digraph G(V, E) used to study the subgraph problem.
incoming degrees du{x) and dH(x) satisfy a(l) = l S d + ( i ) = | 2 =
fl'(l)
(6.49a)
= a'(2)
(6.4%)
a(3) = 2 ^ d + ( 3 ) ^ 3 = a'(3)
(6.49c)
a(4) = 0 g < * £ ( 4 ) S l = «'(4)
(6.49d)
6(l) = 0 S d ^ ( i ) S 2 = 6'(l)
(6.50a)
6(2) = l S d ^ ( 2 ) S 3 = 6'(2)
(6.50b)
6(3) = 2 g d ^ ( 3 ) ^ 4 = 6'(3)
(6.50c)
6(4) = l ^ ^ ( 4 ) ^ 3 = b'(4)
(6.5<W)
a(2) = l£dU2)£3
To apply Theorem 6.1, we consider all the nonempty subsets X of V = {1, 2, 3, 4} and use p = s = 1 in (6.27). The empty subset need not be considered because the inequalities (6.27) are trivially satisfied in this case. For the other 15 ( = 2 4 - 1) subsets, conditions (6.27a) become min {b'(2), min [|(1, 2)|, 1} + min {b'(3), min [|(1, 3)|, 1]} = min {3, min [2,1]} + min {4, min [1,1]} = min {3,1} + min {4,1} = 1 + 1 = 2 ^ a ( l ) = 1
(6.51a)
min {2, min [1,1]} + min {3, min [1,1]} + min {4, min [1,1]} + min {3, min [1,1]} = 1 + 1 + 1 + 1 = 4 gfl(2) = l
(6.516)
min {4, min [2,1]} + min {3, min [1,1]} = 2 ^ a ( 3 ) = 2
(6.51c)
min {2, min [2,1]} + min {4, min [1,1]} = 2 § a(4) = 0
(6.5Id)
6.1 THE SUBGRAPH PROBLEM OF A DIRECTED GRAPH
397
for the single element subsets; min {2, min [0,1] + min [1,1]} + min {3, min [2,1] + min [1,1]} + min {4, min [1,1] + min [1,1]} + min {3, min [0,1] + min [1,1]} = 1 + 2 + 2 + 1 = 6 ^ a ( { l , 2}) = 1 + 1 = 2
(6.52a)
min {3, min [2,1] + min [0,1]} + min {4, min [1,1] + min [2,1]} + min {3, min [0,1] + min [1,1]} = 4 Sa({l,3}) = 3
(6.526)
min {2, min [0,1] + min [2,1]} + min {3, min [2,1] + min [0,1]} + min {4, min [1,1] + min [1,1]} = 4 Sfl({l,4}) = l
(6.52c)
min {2, min [1,1] + min [0,1]} + min {3, min [1,1] + min [0,1]} + min {4, min [1,1] + min [2,1]} + min {3, min [1,1] + min [1,1]} = 6 § a ( { 2 , 3}) = 3
(6.52d)
min {2, min [1,1] + min [2,1]} + min {3, min [1,1] + min [0, 1]} + min {4, min [1,1] + min [1,1]} + min {3, min [1,1] + min [0, 1]} = 6§a({2,4}) = l
(6.52)
min {2, min [0,1] + min [2,1]} + min {4, min [2,1] + min [1,1]} + min {3, min [1,1] + min [0,1]} = 4 2=«({3,4}) = 2
(6.52/)
for the two-element subsets;
min {2, min [0,1] + min [1,1] + min [0,1]} + min {3, min [2,1] + min [1,1] + min [0,1]} + min {4, min [1,1] + min [1,1] + min [2,1]} + min {3, min [0,1] + min [1,1] + min [1,1]} = 8 i = a ( { l , 2 , 3}) = 4
(6.53a)
min {2, min [0,1] + min [1,1] + min [2,1]} + min {3, min [2,1] + min [1,1] + min [0,1]} + min {4, min [1,1] + min [1,1] + min [1,1]} + min {3, min [0,1] + min [1,1] + min [0, 1]} = 8i=a({l,2,4}) = 2
(6.536)
398
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
min {2, min [0,1] + min [0,1] + min [2,1]} + min {3, min [2,1] + min [0,1] + min [0,1]} + min {4, min [1,1] + min [2,1] + min [1,1]} + min {3, min [0,1] + min [1,1] + min [0,1]} = 6 ^ a ( { l , 3, 4}) = 3
(6.53c)
min {2, min [1,1] + min [0,1] + min [2,1]} + min {3, min [1,1] + min [0,1] + min [0,1]} + min {4, min [1,1] + min [2,1] + min [1,1]} + min {3, min [1,1] + min [1,1] + min [0,1]} = 8^a({2,3,4}) = 3
(6.53d)
for the three-element subsets; and
min {2, min [0,1] + min [1,1] + min [0,1] + min [2,1]} + min {3, min [2,1] + min [1,1] + min [0,1] + min [0,1]} + min {4, min [1,1] + min [1,1] + min [2,1] + min [1,1]} + min {3, min [0,1] + min [1,1] + min [1,1] + min [0,1]} = 10 ^ ( { 1 , 2 , 3 , 4 } ) = 4
(6.54)
for the set itself. For conditions (6.276), we have
min {3, min [1,1]} + min {1, min [2,1]} = 2 §ft(l) = 0
(6.55a)
min {2, min [2,1]} + min {3, min [1,1]} = 2 S6(2) = l
(6.556)
min {2, min [1,1]} + min {3, min [1,1]} + min {3, min [2,1]} + min {1, min [1,1]} = 4 ^ b(3) = 2
(6.55c)
min {3, min [1,1]} + min {3, min [1,1]} = 2 &6(4) = 1
(6.55d)
for the single element subsets; min {2, min [0,1] + min [2,1]} + min {3, min [1,1] + min [1,1]} + min {1, min [2,1] + min [0,1]} = 4 Sfe({l,2}) = l
(6.56a)
6.1 THE SUBGRAPH PROBLEM OF A DIRECTED GRAPH
399
min {2, min [0,1] + min [1,1]} + min {3, min [1,1] + min [1,1]} + min {3, min [0,1] + min [2,1]} + min {1, min [2,1] + m i n [ l , l ] } = 6 ^ 6 ( { l , 3}) = 2
(6.566)
min {3, min [1,1] + min [1,1]} + min {3, min [0,1] + min [1,1]} + min {1, min [2,1] + min [0,1]} = 4 S£({1,4}) = 1
(6.56c)
min {2, min [2,1] + min [1,1]} + min {3, min [1,1] + min [1,1]} + min {3, min [0,1] + min [2,1]} + min {1, min [0,1] + min [1,1]} = 6 ^ 6 ( { 2 , 3}) = 3
(6.56d)
min {2, min [2,1] + min [0,1]} + min {3, min [1,1] + min [1,1]} + min {3, min [0,1] + min [1,1]} + min {1, min [0,1] + min [0,1]} = 4^6({2,4}) = 2
(6.56e)
min {2, min [1,1] + min [0,1]} + min {3, min [1,1] + min [1,1]} + min {3, min [2,1] + min [1,1]} + min {1, min [1,1] + min [0,1]} = 6^6({3,4}) = 3
(6.56/)
for the two-element subsets;
min {2, min [0,1] + min [2,1] + min [1,1]} + min {3, min [1,1] + min [1,1] + min [1,1]} + min {3, min [0,1] + min [0,1] + min [2,1]} + min {1, min [2,1] + min [0,1] + min [1,1]} = 7§6({1,2,3}) = 3
(6.57a)
min {2, min [0,1] + min [2,1] + min [0,1]} + min {3, min [1,1] + min [1,1] + min [1,1]} + min {3, min [0,1] + min [0,1] + min [1,1]} + min {1, min [2,1] + min [0,1] + min [0,1]} = 6&6({1,2,4» = 2
(6.576)
min {2, min [0,1] + min [1,1] + min [0,1]} 4- min {3, min [1,1] + min [1,1] + min [1,1]} + min {3, min [0,1] + min [2,1] + min [1,1]} + min {1, min [2,1] + min [1,1] + min [0,1]} = 7Sfe({l, 3,4}) = 3
(6.57c)
400
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
min {2, min [2,1] + min [1,1] + min [0,1]} + min {3, min [1,1] + min [1,1] + min [1,1]} + min {3, min [0,1] + min [2,1] + min [1,1]} + min {1, min [0,1] + min [1,1] + min [0,1]} = 8 S b({2, 3, 4}) = 4
(6.57d)
for the three-element subsets; and min {2, min [0,1] + min [2,1] + min [1,1] + min [0,1]} + min {3, min [1,1] + min [1,1] + min [1,1] + min [1,1]} + min {3, min [0,1] + min [0,1] + min [2,1] + min [1,1]} + min {1, min [2,1] + min [0,1] + min [1,1] + min [0,1]} = 8S6({1,2,3,4}) = 4
(6.58)
for the set itself. Since conditions (6.27) are satisfied for all subsets X of V, by Theorem 6.1 we conclude that there is a (1,1) subgraph H whose outgoing and incoming degrees d„(x) and djfa) satisfy the inequalities (6.49) and (6.50). One such (1,1) subgraph H is presented in Fig. 6.4.
Fig. 6.4. A (1,1) subgraph H satisfying the degree constraints (6.49) and (6.50). Example 6.2 For the directed graph G(V, E) of Fig. 6.3, we wish to ascertain the existence of a subgraph H whose outgoing and incoming degrees d^(x) and d]f(x) satisfy the inequalities a(l) = 2 ^ d £ ( l ) ^ 3 = a'(l)
(6.59a)
a(2) = 2 ^ d £ ( 2 ) ^ 3 = a'(2)
(6.59b)
a(3) = 2 g ^ ( 3 ) i 3 = a'(3)
(6.59c)
fl(4)
= lS£(4)S2 =
6(1) = 1S<*^1) ^ 2 = &'(!)
fl'(4)
(6.59a1) (6.60a)
6.1 THE SUBGRAPH PROBLEM OF A DIRECTED GRAPH
401
b(2) = 2^d]J(2)^3 = b'(2)
(6.606)
ft(3) = 3 S r f ^ ( 3 ) ^ 4 = 6'(3)
(6.60c)
b (4) = 2 g d H (4) ^ 3 = 6' (4)
(6.60d)
From Corollary 6.1, such a subgraph H exists if and only if conditions (6.36) hold for all subsets X c.V. As before, we consider only the nonempty subsets of V. For (6.36a) we have min [b'(2), |(1,2)|] + min [b'(3), |(1, 3)|] = min [3, 2] + min [4,1] = 2 + l = 3ga(l) = 2
(6.61a)
min [2, |(2,1)|] + min [3, |(2,2)|] + min [4, |(2, 3)|] + min [3, |(2,4)|] = min [2,1] + min [3,1] + min [4,1] + min [3,1] = 1 + 1 + 1 + 1 = 4^0(2) = 2
(6.61b)
min [4, |(3,3)|] + min [3, |(3, 4)|] = min [4,2] + min [3,1] = 2 + l = 3Sa(3) = 2
(6.61c)
min [2, |(4,1)|] + min [4, |(4, 3)|] = min [2,2] + min [4,1] = 2 + l = 3§a(4) = l
(6.6W)
for the single element subsets; min [2, |({1, 2}, 1)|] + min [3, |({1,2}, 2)|] + min [4, |({1,2}, 3)|] + min[3,|({l,2},4)|] = min [2,1] + min [3, 3] + min [4,2] + min [3,1] = 1 + 3 + 2 + 1 = 7 ^ a ( { l , 2}) = 2 + 2 = 4
(6.62a)
min [3, |({1, 3}, 2)|] + min [4, |({1, 3}, 3)|] + min {3, |({1, 3}, 4)|] = min [3,2] + min [4, 3] + min [3,1] = 2 + 3 + l = 6^a({l,3}) = 2 + 2 = 4
(6.626)
m i n [ 2 , | ( { l , 4 } , l ) | ] + min[3,|({l,4},2)|] + min[4,|({l,4},3)|] = min [2, 2] + min [3, 2] + min [4,2] = 2 + 2 + 2 = 6Sa({l,4}) = 2 + l = 3
(6.62c)
min [2, |({2, 3}, 1)|] + min [3, |({2, 3}, 2)|] + min [4, |({2, 3}, 3)|] + min [3, |({2,3}, 4)|] = min [2,1] + min [3,1] + min [4, 3] + min [3, 2] = 1 + 1 + 3 + 2 = 7 ^ a ( { 2 , 3}) = 2 + 2 = 4
(6.62d)
402
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
min [2, |({2, 4}, 1)|] + min [3, |({2,4}, 2)|] + min [4, |({2, 4}, 3)|] + min[3,|({2,4},4)|] = min [2, 3] + min [3,1] + min [4,2] + min [3,1] = 2 + 1 + 2 + 1 = 6 S a ( { 2 , 4}) = 2 + 1 = 3
(6.62e)
min [2, |({3, 4}, 1)|] + min [4, |({3, 4}, 3)|] + min [3, |({3,4}, 4)|] = min [2,2] + min [4, 3] + min [3,1] = 2 + 3 + l = 6^a({3,4}) = 2 + l = 3
(6.62/)
for the two-element subsets; min [2, |({1,2, 3}, 1)|] + min [3, |({1, 2, 3}, 2)|] + min [4, |({1, 2, 3}, 3)|] + min [3, |({1,2,3}, 4)|] = min [2,1] + min [3, 3] + min [4,4] + min [3, 2] = 1 + 3 + 4 + 2 = 10 sfl({l,2,3}) = 2 + 2 + 2 = 6
(6.63a)
min [2, |({1,2,4}, 1)|] + min [3, |({1,2, 4}, 2)|] + min [4, |({1, 2, 4}, 3)|] + min [3, |({1,2,4}, 4)|] = min [2,3] + min [3, 3] + min [4, 3] + min [3,1] = 2 + 3 + 3 + 1 = 9 ^ a ( { l , 2, 4}) = 2 + 2 + 1 = 5
(6.63ft)
min [2, |({1, 3,4}, 1)|] + min [3,|({1,3,4}, 2)|] + min{4,|({l,3,4},3)|] + min[3,|({l,3,4},4)|] = min [2,2] + min [3,2] + min [4,4] + min [3,1] = 2 + 2 + 4 + 1 = 9 ^ a ( { l , 3, 4}) = 2 + 2 + 1 = 5
(6.63c)
min [2, |({2, 3, 4}, 1)|] + min [3, |({2, 3, 4}, 2)|] + min [4, |({2, 3 , 4 } , 3|] + min [3, |({2, 3 , 4 } , 4)|] = min [2, 3] + min [3,1] + min [4,4] + min [3, 2] = 2 + 1 + 4 + 2 = 9 ^ « ( { 2 , 3, 4}) = 2 + 2 + 1 = 5 for the three-element subsets; and min [2, |({1,2, 3, 4}, 1)|] + min [3, |({1,2, 3, 4}, 2)|] + min [4, |({1,2, 3, 4}, 3)|] + min [3, |({1,2, 3 , 4 } , 4)|] = min [2, 3] + min [3, 3] + min [4, 5] + min [3,2]
(6.63d)
6.1 THE SUBGRAPH PROBLEM OF A DIRECTED GRAPH
403
= 2 + 3 + 4 + 2 = 11 §a({l,2,3,4}) = 2 + 2 + 2 + l = 7
(6.64)
for the set itself. For conditions (6.366), we have min [a'(2), 1(2,1)|] + min [a'(4), |(4, 1)|] = min [3,1] + min [2,2] = 1 + 2 = 3 ^ 6 ( 1 ) = 1
(6.65a)
min [3, |(1,2)|] + min [3, |(2,2)|] = min [3, 2] + min [3,1] = 2 + 1 = 3^6(2) = 2
(6.65b)
min [3, |(1, 3)|] + min [3, |(2, 3)|] + min [3, |(3, 3)|] + min [2, |(4, 3)|] = min [3,1] + min [3,1] + min [3,2] + min [2,1] = 1 + 1 + 2 + 1 = 5 ^ 6(3) = 3
(6.65c)
min [3, |(2,4)|] + min [3, |(3, 4)|] = min [3,1] + min [3,1] = 1 + 1 = 2^6(4) = 2
(6.65d)
for the single element subsets; min [3, |(1, {1, 2})|] + min [3, |(2, {1, 2})|] + min [2, |(4, {1, 2})|] = min [3, 2] + min [3, 2] + min [2, 2] = 2 + 2 + 2 = 6 ^ 6 ( { l , 2}) = l + 2 = 3
(6.66a)
min [3, |(1, {1, 3})|] + min [3, |(2, {1, 3})|] + min [3, |(3, {1, 3})|] + min[2,|(4,{l,3})|] = min [3,1] + min [3, 2] + min [3,2] + min [2, 3] = 1 + 2 + 2 + 2 = 7 ^ b { { \ , 3}) = 1 + 3 = 4
(6.666)
min [3, |(2, {1,4})|] + min [3, |(3, {1, 4})|] + min [2, |(4, {1, 4})|] = min [3, 2] + min [3,1] + min [2,2] = 2 + l + 2 = 5 ^ 6 ( { l , 4}) = 1 + 2 = 3
(6.66c)
min [3, |(1, {2, 3})|] + min [3, |(2, {2, 3})|] + min [3, |(3, {2, 3})|] + min[2,|(4,{2,3})|] = min [3, 3] + min [3,2] + min [3,2] + min [2,1] = 3 + 2 + 2 + 1 = 8 ^ b ( { 2 , 3}) = 2 + 3 = 5
(6.66d)
404
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
min [3, |(1, {2,4})|] + min [3, |(2, {2, 4})|] + min [3, |(3, {2, 4})|] = min [3,2] + min [3, 2] + min [3,1] = 2 + 2 + l = 5^6({2, 4}) = 2 + 2 = 4
(6.66e)
min [3, |(1, {3, 4})|] + min [3, |(2, {3,4})|] + min [3, |(3, {3, 4})|] + min[2,|(4,{3,4})|] = min [3,1] + min [3,2] + min [3, 3] + min [2,1] = 1 + 2 + 3 + 1 = 7 ^ b ( { 3 , 4}) = 3 + 2 = 5
(6.66/)
for the two-element subsets; min [3, |(1, {1,2, 3})|] + min [3, |(2, {1, 2, 3})|] + min [3, |(3, {1, 2, 3})|] + min [2, |(4, {1, 2,3})|] = min [3, 3] + min [3, 3] + min [3, 2] + min [2, 3] = 3 + 3 + 2 + 2 = 10 Sfe({l,2,3}) = 1 + 2 + 3 = 6
(6.67a)
min [3, |(1, {1, 2, 4})|] + min [3, |(2, {1,2,4})|] + min [3, |(3, {1,2, 4})|] + min [2, |(4, {1,2,4})|] = min [3, 2] + min [3, 3] + min [3,1] + min [2,2] =2+3+1+2=8 gfe({l, 2, 4}) = 1 + 2 + 2 = 5
(6.676)
min [3, |(1, {1, 3, 4})|] + min [3, |(2, {1, 3, 4})|] + min [3, |(3, {1, 3, 4})|] + min [2, |(4, {1, 3, 4})|] = min [3,1] + min [3, 3] + min [3, 3] + min [2, 3] =1+3+3+2=9 gfe({l,3,4}) = l + 3 + 2 = 6
(6.67c)
min [3, |(1, {2, 3, 4})|] + min [3, |(2, {2, 3,4})|] + min [3, |(3, {2, 3,4})|] + min [2, |(4, {2, 3, 4})|] = min [3, 3] + min [3, 3] + min [3, 3] + min [2,1] = 3 + 3 + 3 + 1 = 10 ^fe({2,3,4}) = 2 + 3 + 2 = 7
(6.67d)
6.1 THE SUBGRAPH PROBLEM OF A DIRECTED GRAPH
405
Fig. 6.5. A subgraph H of the directed graph of Fig. 6.3, whose outgoing and incoming degrees satisfy the constraints (6.59) and (6.60).
for the three-element subsets; and min [3, |(1, {1, 2, 3, 4})|] + min [3, |(2, {1, 2, 3,4})|] + min [3, |(3, {1, 2, 3, 4})|] + min [2, |(4, {1,2, 3,4})|] = min [3, 3] + min [3, 4] + min [3, 3] + min [2, 3] = 3 + 3 + 3 + 2 = 11 Sfe({l,2,3,4}) = 1 + 2 + 3 + 2 = 8
(6.68)
for the set itself. Thus, conditions (6.36) of Corollary 6.1 are all satisfied, and the directed graph G(V, E) of Fig. 6.3 possesses a subgraph H whose outgoing and incoming degrees d^,(x) and dj,(x) satisfy the inequalities (6.59) and (6.60). One such subgraph is shown in Fig. 6.5. Example 6.3 Consider again the directed graph G(V, E) of Fig. 6.3, which is redrawn in Fig. 6.6. The problem is to determine the existence of a (1,0) subgraph H whose outgoing and incoming degrees d^(x) and dj/(x) are required to be d£(l) = 2,
^ ( 2 ) = 2,
d£(3) = 2,
d£(4) = 0
(6.69a)
^ ( 1 ) = 0,
dji(2) = l,
^ ( 3 ) = 3,
^«(4) = 2
(6.696)
From Theorem 6.2, such a (1,0) subgraph exists if and only if (6.40) and either (6.41) or (6.42) holds for all subsets Xc.V. It is straightforward to verify that (6.40) holds: a(V) = a({l, 2, 3, 4}) = 2 + 2 + 2 + 0 = 6 = 6({1, 2, 3, 4}) = 0 + 1 + 3 + 2 = b(V)
(6.70)
406
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
Fig. 6.6. A (2,2)-digraph G(V, E) used to study the subgraph problem.
where a(x) = d^(x) and b(x) = dj^x) for x = 1, 2, 3, 4. For our purposes, we use the subset X = {3} in (6.41) with p = 1 and s = 0, and obtain min {6(3), min [|(3, 3)|, 0]} + min {b(4), min [|(3, 4)|, 1]} = min {3, min [2,0]} + min {2, min [1,1]} = min [3, 0] + min [2,1] = 0 + 1 = 1 £a(3) = 2
(6.71)
where y(A^) = y(3) = {3, 4}. Thus, condition (6.41) is violated for the subset X= {3}, and according to Theorem 6.2 there is no (1,0) subgraph with outgoing and incoming degrees as prescribed in (6.69). Instead of looking for a (1,0) subgraph, suppose that the problem is to determine the existence of any subgraph having outgoing and incoming degrees as prescribed in (6.69). Then according to Corollary 6.2, the problem is solvable if and only if (6.46) and either (6.47) or (6.48) holds for all subsets X c. V. For illustrative purposes, we use (6.48) and obtain min [a(2), |(2, 1)|] + min [a(4), |(4, 1)|] = min [2,1] + min [0,2] = 1 + 0 = 1 ^ 6 ( 1 ) = 0
(6.72a)
min [2, |(1, 2)|] + min [2, |(2, 2)|] = min [2, 2] + min[2,1] = 2 + 1 = 3 ^ 6 ( 2 ) = 1
(6.726)
min [2, |(1, 3)|] + min [2, |(2, 3)|] + min [2, |(3, 3)|] + min [0, |(4, 3)|] = 1 + 1 + 2 + 0 = 4 S b(3) = 3
(6.72c)
min [2, |(2,4)|] + min [2, |(3, 4)|] = min [2,1] + m i n [ 2 , l ] = l + l = 2=-6(4) = 2
(6.72d)
6.1 THE SUBGRAPH PROBLEM OF A DIRECTED GRAPH
407
for the single element subsets; min [a(l), |(1, {1, 2})|] + min [a(2), |(2, {1, 2})|] + min[a(4),|(4, {1,2})|] = min [2, 2] + min [2, 2] + min [0, 2] = 2 + 2 + 0 = 4S6({l,2}) = 0 + l = l
(6.73a)
min [2,1] + min [2,2] + min [2, 2] + min [0, 3] = 1 + 2 + 2 + 0 = 5 ^ b ( { \ , 3}) = 0 + 3 = 3
(6.73b)
min [2, 2] + min [2,1] + min [0, 2] = 3 ^ 6({1, 4}) = 2
(6.73c)
min [2, 3] + min [2, 2] + min [2, 2] + min [0,1] = 6^b({2,
3}) = 4
(6.73d)
min [2,2] + min [2,2] + min [2,1] = 5i=6({2,4}) = 3
(6.73e)
min [2,1] + min [2, 2] + min [2, 3] + min [0, 1] = 5i=6({3,4}) = 5
(6.73/)
for the two-element subsets; min [2, 3] + min [2, 3] + min [2,2] + min [0, 3] = 6S&({1,2,3}) = 4
(6.74a)
min [2, 2] + min [2, 3] + min [2,1] + min [0, 2] = 5S6({1,2,4}) = 3
(6.746)
min [2,1] + min [2, 3] + min [2, 3] + min [0, 3] = 5^6({1,3,4}) = 5
(6.74c)
min [2, 3] + min [2, 3] + min [2, 3] + min [0,1] = 6^b({2,
3, 4}) = 6
(6.74d)
for the three-element subsets; and min [2, 3] + min [2, 4] + min [2, 3] + min [0, 3] = 6i£6({l,2,3,4}) = 6
(6.75)
for the set itself. Thus, conditions (6.48) are satisfied. These together with (6.70) imply the existence of a subgraph H in G(V, E) having its
408
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
Fig. 6.7. A subgraph H of the directed graph of Fig. 6.6, whose outgoing and incoming degrees are given by (6.69). outgoing and incoming degrees as prescribed in (6.69). An example of such a subgraph is presented in Fig. 6.7.
DEFINITION 6.3 Regular Directed Graph of Degree n. A directed graph is said to be regular of degree n if the outgoing and incoming degrees have the same value n for each of its nodes.
DEFINITION 6.4 it-Factor. An n-factor of a directed graph is a spanning regular subgraph of degree n. The directed graph shown in Fig. 6.8, for example, is a regular directed graph of degree 2. A directed circuit is a regular directed graph of degree 1. However, not every regular directed graph of degree 1 is a directed circuit, an example of which is shown in Fig. 6.9. A connected regular directed graph of degree 1 is a directed circuit. Two subgraphs of the directed graph
6.1 THE SUBGRAPH PROBLEM OF A DIRECTED GRAPH
409
Fig. 6.9. A regular directed graph of degree 1. G(V, E) of Fig. 6.6 are presented in Fig. 6.10. The subgraph of Fig. 6.10(a) is a 1-factor of G, being regular of degree 1, whereas the spanning subgraph of Fig. 6.10(b) is a 2-factor of G. We shall apply Corollary 6.2 to derive a criterion when a directed graph possesses a 1-factor.
Fig. 6.10. Two subgraphs of the directed graph of Fig. 6.6: (a) a 1-factor and (b) a 2-factor of the directed graph.
THEOREM 6.3 The necessary and sufficient condition that a directed graph G{V, E) possess a 1-factor is that either \y(X)\ ^ \X\
(6.76)
\Y*(X)\ i= \X\
(6.77)
or
holds for every subset X c.V, where Y(X) Y*(X)
= {y\xeX,
(x,y)eE)
= {y\xeX,(y,x)eE}
(6.78) (6.79)
Proof. We appeal to Corollary 6.2 by setting a(x) = b(x) = 1 for each
410
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
x e V. Then we have (6.80)
a(X) = b(X) = \X\ and (6.47) and (6.48) reduce to 2
min[b(y),\(X,y)\]=
£
yey(X)
min [1, \{X, y)\]
yey(X)
= 2
l=
\Y(X)\^a(X)=\X\
(6.81)
yey(X)
2
mm[a(y),\(y,X)\]
=
yey'(X)
£
min [1, \(y, X)\]
yey'(X)
= 2
1 = \Y*(X)\^HX) = \X\
(6.82)
yey*(X)
since \(X,y)\^l,
\(y,X)\^l
(6.83)
This completes the proof of the theorem. Thus, every regular directed graph has a 1-factor, and can be decomposed as the direct sum of n 1-factors if it is regular of degree n. Theorem 6.3 also establishes the existence of a matching in a directed bipartite graph due to Hall (1935) and Konig (1950).
Fig. 6.11. The node set V is matched into the node set V".
6.1 THE SUBGRAPH PROBLEM OF A DIRECTED GRAPH
411
Fig. 6.12. The node set V is matched onto the subset Y. DEFINITION 6.5 Matching. A matching of a directed bipartite graph B(V, V"; E') is a set of arcs Ex of E' such that no two arcs of Ex have a node in common. If a matching defines a one-to-one correspondence between a set X c. V and a set F e V", then X is matched onto Y or X is matched into V". A directed bipartite graph B(V',V";E') is shown in Fig. 6.11 with V' = {1',2',3',4'} and V" = {1", 2", 3", 4", 5"}. A matching from X=V onto Y={1", 2", 3", 4"} is shown in Fig. 6.12, or putting it differently X is matched into V" in Fig. 6.11. THEOREM 6.4 In a directed bipartite graph B(V, V";E'), V can be matched into V" if and only if \y{X)mX\
(6.84)
for each subset X<=V, where y(X)eV" replacing E.
is defined in (6.78) with E'
Proof. The necessity follows immediately from the observation that if there is a matching from V into V", there are at least as many nodes in y(X) as in X. To prove sufficiency, we assume that (6.84) holds for each XcV. In particular, we have \y(V')\ ^ \V'\ = k. Let Y be a subset of y(V) containing k elements. Let G(V, E) be the fc-node directed graph obtained from B(V, V"; E') such that (x, y)eE if and only if (*', y") e £ ' ; x' e V and y" e y. It is evident that there is a matching from V onto Y in B
412
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
if and only if there is a 1-factor in G. But according to Theorem 6.3, there is a 1-factor in G if and only if \Y(Z)\^\Z\
(6.85)
holds for each subset Z c V . Condition (6.85) is equivalent to |y(WO|^|W|
(6.86)
for each subset W ^ V in the sectional subgraph B[V U Y] of B, which is defined as the maximum subgraph of B over the node set V U Y. Since (6.86) is implied by (6.84), the theorem follows. We illustrate the above results by the following example. Example 6.4 A directed bipartite graph B{V',V";E') is shown in Fig. 6.13. The problem is to determine whether or not there is a matching from V into V". To this end, we apply (6.84) as follows: | y ( l ' ) | = |{1", 2", 4"}| = 3 ^ |{1'}| = 1
(6.87a)
| 7 ( 2 ' ) | = |{2"}| = 1 ^ | { 2 ' } | = 1
(6.876)
|y(3')| = |{1", 3", 4"}| = 3 ^ |{3'}| = 1
(6.87c)
|y({l', 2'})| = |{1", 2", 4"}| = 3 i £ | { l ' , 2 ' } | = 2
(6.87d)
l r ( { l ' , 3 ' } ) | = |{l",2",3",4"}|=4 S|{1',3'}|=2
(6.87c)
| 7 ( { 2 ' , 3 ' } ) | = |{1",2",3",4"}|=4 S|{2',3'}| = 2
(6.87/)
| y ( V ) | = |{l", 2", 3", 4"}| = 4 ^ | V | = 3
(6.87g)
'r)
Fig. 6.13. A directed bipartite graph B(V, V"; £')•
6.2 DIGRAPHIC SEQUENCES
413
Fig. 6.14. A matching from the node set V into the node set V" for the directed bipartite graph B(V, V"; £") of Fig. 6.13. Since all the conditions are satisfied, there is a matching from V into V" in B, one of which is shown in Fig. 6.14.
6.2
DIGRAPHIC SEQUENCES
In this section, we present necessary and sufficient conditions for the existence of a directed graph with prescribed outgoing and incoming degrees. One motivation for considering this problem is the potential applications of the result in science and engineering in general and in electrical engineering and computer science in particular. Now, we demonstrate that the problem can be solved using the previous theory.
DEFINITION 6.6 Digraphic Sequence. A sequence of n nonnegative integer pairs n = {[al,bl]\i
= l,2,...,n}
(6.88)
is said to be (p, s) digraphic if there exists a (p, s)-digraph having jt as the sequence of the degree pairs of its nodes, and such a directed graph is called a realization of n. We consider the following generalization of this problem. Given a sequence of n nonnegative integer four-tuples K' = {(a,, a', b„ b',) | a, =i a'„ bt ^ b\, i = 1, 2, . . . , «}
(6.89)
the problem is to find necessary and sufficient conditions under which there exists an rc-node (p, s)-digraph G(V, E), whose degree pairs [d+(i), d~(i)]
414
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
satisfy the inequalities ai^d+(i)^a'i
(6.90a)
b^d-W^b',
(6.90b)
for each i e V. Such a directed graph is called a realization of n', and n' is said to be (p, s) digraphic. To facilitate our discussion, let Sa = {a, | i = 1,2, . . . , « }
(6.91a)
Sa. = {a',\i = \,2,...,n}
(6.916)
St={Mi = l,2,...,»}
(6.92a)
Sb, = {&; | j = l, 2, . . . , n)
(6.92b)
To apply Theorem 6.1 to the present problem, we set \(x, y)\ = °° for all x and y. The left-hand side of (6.27a) reduces to 2
min \b'(y),
iy(X) y*rW
2 min [\(x, y)\, 6xy(s -p)
*~
xeX
= 2 min b'(y),
>
2
M
5
~P) +P
= 2 min fo'(y). 2 <M S yeX
L
+ p]\
~P)+P
jteA"
J
s
+ 2 min b'(y), £ M -/>) +P\ yeX
L
x e
^
J
= 2 min [fe'(y), (|A"| - l)p + *] + £ ye*
= 2
min
[fr'(y). 1*1 Pi
yeX
min[6;,(|Jf6.|-l)p+s]+
2
min[&;, l ^ - l p ] (6.93)
where Xb, is a subset of 5fc. corresponding to A', and Xb, denotes the complement of Xb. in S6.. For each Xb'cSb., there is a corresponding Xa c S„ with the property that a, e Xa if and only if b) eXb.. We say that Xb. and X,, are the corresponding subsets of Sfc. and Sa. This is similarly valid for other sets of (6.91) and (6.92). With this the right-hand side of (6.27a) can be written as a[X)=
2 aksXa
ak
(6.94)
6.2 DIGRAPHIC SEQUENCES
415
A similar result can be obtained for (6.276). The above results are summarized as a theorem.
THEOREM 6.5 A sequence n' = {(a,, a\, bh 6j) | a, Si a,', 6, Si 6-} is (p, s) digraphic if and only if, for each nonempty subset Xa c Sa, 2
inin[6;,(|*a|-l)p+*] + 2
and, for each nonempty subset 2
min[a},QXb\-l)p+s]+
min[6;,|Jr fl |p]S 2
Xbc.Sb, £
ajeXa>
a* (6.95a)
min[a,', |X ft |p]i? £
aleXa-
&* (6-956)
b^eX^
where Xa and Xb' are the corresponding subsets of Sa and S6., and X0. and ^ are the corresponding subsets of Sa. and Sb; and Xft. and Xa' denote the complements of X& and Xa, in Sb. and Sa., respectively. The sets Sa, Sa., Sb and Sb. are defined in (6.91) and (6.92). In the special situation where a, = a\ and bi = b'i, we obtain a result of Chen (1966).
COROLLARY 6.3 A sequence n = {[ah 6,]} of nonnegative integer pairs is (p, s) digraphic if and only if
2 fl/= E a,eS a
6
,
(6-96)
bjGSb
and either 2 bjeXb
min[6,-,aY ( ,|-l)p+*]+ 2 . min [6„ | X a | p ] ^ £ bieXb
a* (6.97)
akGXa
or 2
m i n [ a / , ( | * * | - l ) p + s ] + £ min [a,-, |**|p] ^ £
bfc (6.98)
holds for each nonempty subset I „ c S a j where Xfl and Xb are the corresponding subsets of Sa and 5fc.
416
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
The second condition (6.97) or (6.98) consists of 2" — 1 inequalities, n being the number of nonnegative integer pairs in JZ. These can be reduced to a set of n inequalities for p = 1 and 5 = 0, if the elements of n are properly ordered. COROLLARY 6.4 In a given sequence JZ = {[a,, b,\ | i = 1, 2, . . . , n} of nonnegative integer pairs, alter the indices if necessary so that bj^bi+1. Furthermore, if bi = bi+l then at=ai+l for / = 1, 2, . . . , n — 1. Then the sequence JZ is (1,0) digraphic if and only if n
n
(6.99)
2 a,• = 2 bj 1=1
y=i
n
n
2 min [a„ n - 1] g ]£ b, i=l
(6.100)
;=1
and fc
n
2 min [a,, k - 1] + 2
i=i
k
m i n fl
[ /> *] - 2 bi
/=*+i
(6.101)
j=i
for k = 1, 2, . . . , n — 1. Proof. Necessity. The inequalities (6.100) and (6.101) follow directly from (6.98) by taking Xb - Sb and Xb = {bt | i = 1, 2, . . . , k), respectively. Sufficiency. We show that (6.100) and (6.101) imply (6.98). Observe first that (6.100) implies (6.98) for Xb = Sb. Thus, it is sufficient to show that (6.101) implies (6.98) for all nonempty proper subsets Xb c.Sb. To this end, let ar(A a ) = |{a l |a / eA a
and a,^t}\
(6.102)
for t = 1, 2, . . . . To simplify the notation, write a?(Sa) = a?
(6.103)
We retain the functional notation only when proper subsets of Sa are used. Then the left-hand side of (6.98) can be expressed as a*k(Xa)+2ar
(6.104)
6.2 DIGRAPHIC SEQUENCES
417
where the second term is defined to be zero for k = 1. If we can demonstrate that the right-hand side of the inequality
£ «,*§:( £
b)-at(Xa)
(6.105)
is maximized over all A:-element subsets Xa c S„ or Xb c Sb by letting Xb = {b,\i = \,2, . . . , * }
(6.106)
then we need only consider the subsets of (6.106) for k = 1, 2, . . . , n because (6.98) is equivalent to (6.105). That this is indeed the case is shown below. Let Xb be any fc-element proper subset of Sb, that is different from (6.106). Let bx be an element of {bl, b2, • • • , bk} but not in Xb, and also let by be an element of Xb but not in {bt, b2, . . . , bk}. By virtue of the ordering of the bit it is clear that x < y. Consider the set Xl = {Xb-{by})\J{bx)
(6.107)
and its corresponding set Xlc.Sa. It is apparent that ak(X'a) and al(Xa) differ at most by 1 where X"a denotes the complement of X"a in Sa. Thus, for bx =£ by we have
( 2 *,-) - aUR) S ( 2 b) - a*k(Xa) X
b,sXe
I
^bieXb
(6.108)
I
since
2 bt> 2 &.i.eJfi'
(6-109)
b^Xb
For bx = by, (6.109) is satisfied with the equality sign. By our ordering of the ah ax^ay, it follows that at{X')^at{Xa) (6.110) As a result, (6.108) remains valid for bx = by. Since X'b has one more element in common with {blt b2, . . . , bk) than Xb, we conclude that the set {bx, b2, . . . , bk} can be obtained from Xb by the repeated application of
418
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
this process. Thus, from (6.101)
2 a: i= t
^(2
b, - at ({aj | / = k + 1, . . . , n })
b)-at{Xa)
(6.1H)
for all nonempty proper ^-element subsets Xb^Sb. Hence we obtain the desired result. This completes the proof of the corollary. Following a similar argument, a generalized version of the above result may be stated.
COROLLARY 6.5 In a given sequence of nonnegative integer pairs {[ah bj] \ i = 1, 2, . . . , n) if the indices of a, and b( can be altered such that a, i? ai+1 and b( i? bi+i for i = 1, 2, . . . , n - 1, n^2, then the sequence is (p, s) digraphic, p^s, if and only if n
n
2«, = 5>, ,=1
(6.112)
j=\
n
n
2 min [a,, (n -l)p+s]^ *
bj
(6.113)
;=i
<= i n
k
2 min [ah (k - l)p + s] + 2
min [a„ kp] ^ 2
b
j
( 6 -114)
for A: = 1, 2, . . . , n - 1. Before we consider other special cases, we illustrate the above results by the following examples.
Example 6.5 We wish to determine whether the following sequence of four-tuples of nonnegative integers is (2,1) digraphic: a' = {(3, 4, 3, 4), (2, 3, 3, 4), (3, 4, 3, 4)}
(6.115)
6.2 DIGRAPHIC SEQUENCES
419
From Theorem 6.5, we can make the following identifications: p =2
(6.116a)
s=l
(6.1166)
S f l ={o l f fl 2 > fl 3 } = {3,2,3}
(6.117a)
Sa. = {a[, a2, a 3 } = {4, 3, 4}
(6.117&)
Sb={bub2,b3}
(6.117c)
= {3,3,3}
Sb- = {b[, b'2, b3} = {4, 4, 4}
(6.117rf)
For the single element subsets Xa c Sa and Xb c Sb, (6.95) becomes min [b[, s] + min [b2, p] + min [63, p] = min [4,1] + min [4,2] + min [4, 2] = 5 ^ ax = 3
(6.118a)
min [b2, 1] + min [b[, 2] + min [6 3 , 2] = 5^a2 = 2
(6.1186)
min [fe3, 1] + min [b[, 2] + min [b2, 2] = 5^a3 = 3
(6.118c)
min [a[, s] + min [a2, p] + min [a3, /?] = min [4,1] + min [3,2] + min [4,2] =5 ^
=3
(6.119a)
min [a2, 1] + min [a\, 2] + min [a3, 2] = 5^Z>2 = 3
(6.1196)
min [a3, 1] + min [a[, 2] + min [a2, 2] = 5^&3 = 3
(6.119c)
For the two-element subsets Xa c 5 a and Xb c Sfc, (6.95) becomes min [b[, p + s] + min [fe2, /? 4- s] + min [b 3 , 2p] = min [4, 3] + min [4, 3] + min [4, 4] = 10 ^ a x + a 2 = 5
(6.120a)
min [b[, 3] + min [b3, 3] + min [b2, 4] = 10 ^ a j + a 3 = 6
(6.1206)
420
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
Fig. 6.15. A (2, l)-digraph realizing the sequence of four-tuples of (6.115).
min [b'2, 3] + min [b3, 3] + min [b[, 4] = 10 ^a2 + a3 = 5
(6.120c)
min [a[, p + s] + min [a2, p + s] + min [a'3> 2p] = min [4, 3] + min [3, 3] + min [4, 4] = 1 0 ^ b1 + b2 = 6
(6.121a)
min [a[, 3] + min [03, 3] + min [a2, 4] = 9^b1
+ b3 = 6
(6.1216)
min [a2, 3] + min [a'3, 3] + min [a[, 4] = 10mb2 + b3 = 6
(6.121c)
Finally, for the sets Sa and Sb themselves, we obtain min [b[, 2p + s] + min [b2, 2p + s] 4- min [b'3, 2p + s] = min [4,5] + min [4, 5] + min [4, 5] = 1 2 ^ a 1 + a2 + a3 = 8
(6.122a)
min [a[, 2p + s] + min [a2, 2p + s] + min [a3, 2p + s] = min [4, 5] + min [3, 5] + min [4,5] = ll^bl
+ b2 + b3 = 9
(6.1226)
Thus, all the conditions are satisfied, and the sequence n' is (2,1) digraphic. One such realization is shown in Fig. 6.15. Example 6.6 Determine whether the following sequence of nonnegative integer pairs is
6.2 DIGRAPHIC SEQUENCES
421
(2,1) digraphic: iphic: = {[at, ft,] | i = 1, 2, 3, 4} = {[3, 1], [2, 5], [4, 1], [0, 2]} (6.123) brollary 6.3, we can make the following identifications: From Corollary p=2
(6.124a)
5= 1
(6.124ft)
Sa = {au a2, a3, a 4 } = {3, 2, 4, 0}
(6.125a)
Sb={bu
(6.1256)
b2, b3, b4} = {1, 5, 1, 2}
Condition (6.96) is satisfied because 4
4
2 a,; = 3 + 2 + 4 + 0 = 9 = 2 6y = 1 + 5 + 1 + 2 i=l
(6.126)
;=1
Condition (6.97) consists of 15 ( = 2 4 — 1) inequalities, as follows: min [bx, s] + min [b2, p] + min [b3, p] + min [ft4, p] = min [1,1] + min [5,2] + min [1,2] + min [2,2] = 1+ 2 + 1+ 2 = 6 ^
=3
(6.127a)
min [b2, 1] + min [bl, 2] + min [ft3, 2] + min [ft4, 2] = l + l + l + 2 = 5^a2 = 2
(6.127ft)
min [ft3, 1] + min [ftx, 2] + min [ft2, 2] + min [ft4, 2] = l + l + 2 + 2 = 6^a3 = 4
(6.127c)
min [ft4, 1] + min [ft1; 2] + min [ft2, 2] + min [ft3, 2] = l + l + 2 + l = 5^a4 = 0
(6.127d)
min [bt, p +s] + min [ft2, p +s] + min [ft3, 2p] + min [ft4, 2p] - min [1, 3] + min [5, 3] + min [1,4] + min [2,4] = l + 3 + l + 2 = 7 ^ a 1 + a2 = 3 + 2 = 5
(6.128a)
min [blt 3] + min [ft3, 3] + min [ft2, 4] + min [ft4, 4] = l + l + 4 + 2 = 8 ^ a ! + a3 = 7
(6.128ft)
min [bit 3] + min [ft4, 3] + min [ft2, 4] + min [ft3, 4] = l + 2 + 4 + l = 8 g a ! + a4 = 3
(6.128c)
min [ft2, 3] + min [ft3, 3] + min [ftj, 4] + min [ft4, 4] = 3 + l + l + 2 = 7 S a 2 + a3 = 6
(6.128d)
422
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
min [b2, 3] + min tiin [b | 4, 3] + min [b1) 4] + min [b3, 4] = 3 + 2 + 1 + 1 = 7 ^ a2 + a4 = 2
(6.128e)
min [b3, 3] + min [b4, 3] + min [bly 4] + min [b2, 4] = 1l + ?2. + l1 ++ 4 = 8 > 4-/J. ^ fal3, + a4 = 4
(6. (6.128/)
in [blt 2p + s] + min [b2, 2p +s] + min [b3, 2p + s] + min [b4, 3p] min = min [1,5] + min [5, 5] + min [1,5] + min [2,6] = 9 g f l 1 + o 2 + fl3 = 3 + 2 + 4 = 9
(6.129a)
min [bi, 5] + min [b2, 5] + min [b4, 5] + min [b3, 6] = 9Sflj + a 2 + a 4 = 5
(6.1296)
nin [b3, 5] + min [b 4 , 5] + min [b2, 6] min [bi, 5] + min L = /7 = 9 = ai + a 3 + a4—
(6.129c)
min [6 2 , 5] + min [b3, 5] + min [b4, 5] + min [blt 6] = 9 = a2 + a3 + a4 = 6
(6.129d) v
minu [6 + min l7 3p 2 , J3/? [ f 1, ->y + T Js]J T 111111 [6 [t»2» / / +' •s] > J+ ~ min 111111 [Z>3, 3p + s] + min [b 4 , 3p + 5] „;*, n[1, -71 r< -71+-umin n -71+ _L . '- " m ; n [5,7] m ; ^[1,7] m ;.[2,7] = min 7] +-Lmin min = 9 g a i + a2 + a3 + a4 = 9
(6.130)
Thus, IUS, all the conditions are satisfied, and the sequence n of (6.123) is (2:, 1) digraphic. A realization of the sequence n is shown in Fig. 6.16.
Fig. 6.16. A (2, l)-digraph realizing the sequence of nonnegative integer pairs of (6.123).
6.2 DIGRAPHIC SEQUENCES
423
Example 6.7 Test to see if the following sequence is (1, 0) digraphic: {[2, 3], [2, 2], [4,0], [1,4], [3, 3]}
(6.131)
To apply Corollary 6.4, we first alter the indices of the elements of (6.131) to yield a properly ordered sequence Jt = {[ax, bx], [a2, b2], [a3, b3], [a4, b4], [as, b5]}
= {[1, 4], [3, 3], [2, 3], [2, 2], [4, 0]}
(6.132)
Substituting these in (6.99)-(6.101) gives ai + a 2 + a 3 + a 4 + a 5 = 1 + 3 + 2 + 2 + 4 = 12 = b1 + b2 + b3 + b4 + b5 = 4 + 3 + 3 + 2 + 0
(6.133)
min [a1, 4] + min [a2, 4] + min [a3, 4] + min [a4, 4] + min [a5, 4] = 1 + 3 + 2 + 2 + 4 = 12 ^bl
+ b2 + b3 + b4 + b5 = 12
(6.134)
min [ax, 0] + min [a2, 1] + min [a3, 1] + min [a4, 1] + min [a5, 1] = 0+ l + l + l + l = 4^61 = 4
(6.135a)
min [aly 1] + min [a2, 1] + min [a 3 , 2] + min [a4, 2] + min [a5, 2] = l + l + 2 + 2 + 2 = 8^b1
+ b2 = 7
(6.1356)
min [ax, 2] + min [a2, 2] + min [a3, 2] + min [a4, 3] + min [as, 3] = 1 + 2 + 2 + 2 + 3 = 10 ^ bx + b2 + b3 = 10
(6.135c)
min [fli, 3] + min [a 2 , 3] + min [a3, 3] + min [a 4 , 3] + min [a 5 , 4] = 1 + 3 + 2 + 2 + 4 = 12 ^ bi + 6 2 + ^3 + b4 = 12
(6.135d)
Thus, the sequence n is (1,0) digraphic. One such realization is presented in Fig. 6.17. Observe that if we use Corollary 6.3 to test the realizability of the sequence JT, we need to check 31 ( = 2 5 — 1) inequalities. Corollary 6.4 requires only 5, a reduction by a factor of more than 6. The price we paid in achieving this is the proper ordering of the elements of n. We shall now proceed to consider other special cases. The reason for doing this is that the conditions obtained for these special cases are much the simplest, and they are sufficiently important to be considered explicitly.
424
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
Fig. 6.17. A (l,0)-digraph realizing the sequence of nonnegative integer pairs of (6.131).
However, before we do this we define the dual sequence of a sequence of nonnegative integers.
DEFINITION 6.7 Dual Sequence. Let {a,} be a sequence of nonnegative integers. The dual sequence of {a,} is the sequence {a,*}, the ith element af of which denotes the number of the ay in {a,} greater than or equal to the integer i. There is a simple pictorial representation of the number af: Let each integer a ; be represented by a row of a ; dots, and arrange these rows in a vertical array so that aj+1 lies under a,. Then the number af is simply the number of dots in the ith column of the array. As an example, let a1 = 5,
a2 = 4,
a3 = 4,
a 4 = 5,
a5 = 1
(6.136)
The array corresponding to these integers is shown below: af
al
a*
at
a*
at
a*
a2 (6.137) a4
°s
6.2 DIGRAPHIC SEQUENCES
425
Thus, we have a*
= 5, a2* = 4, a3* = 4, a4* = 4, a5* = 2 a£ = 0, A; ^ 6
(6.138a) (6.1386)
They correspond to the numbers of dots in the columns of the array. Evidently, they are independent of the ordering of the elements of {a,}. As a matter of fact, if for a given sequence {a,} we define {a,}* = { a ; i ; = l , 2 , . . . }
(6.139)
then it is clear that {a,}* determines {a,} since the integer a, occurs exactly a* - a*+u x = a,, times in {a,}. The sequence {a,}* is the dual sequence of {a,}. In fact, the correspondence between {a,} and {a,}* is completely dual in the following sense: {{«,}•}* = {«.-}
(6.140)
In other words, the dual of a dual sequence is the sequence itself. The validity of (6.140) is quite obvious in view of the pictorial representation discussed in (6.137). We remark that two sequences can be brought to the same length by adding an appropriate number of zeros if necessary. Consider, for example, the sequence {a,} = {5, 4, 4, 5, 1}
(6.141)
Its dual sequence is given by {a,}* = {5, 4, 4, 4, 2, 0,0}
(6.142)
The original sequence {a,} can be brought to the same length as its dual by the insertion of two zeros: {a,} = {5, 4, 4, 5, 1, 0, 0}
(6.143)
After this digression into a discussion of the dual sequence, let us return to consider special cases of Corollary 6.3. One of the special cases was considered by Berge (1962) by putting p =s in (6.98), resulting in n
^mm[ah\Xb\p]^
2
bk
(6.144)
for each Xb c Sb. If the 6, are ordered so that bt = bi+1 for i =
426
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
1, 2, . . . , n — 1, then the inequality (6.144) is satisfied if and only if n
k
2 min [a„ kp] i? £ i=i
fy
(6145)
y=i
for A: = 1, 2, . . . , n. This establishes the following result.
COROLLARY 6.6 Consider a sequence {[a,, 6,]} of n nonnegative integer pairs in which, by altering the indices if necessary, />, is bi+1 for «" = 1, 2, . . . , « — 1, n il 2. Then the sequence is (p, p) digraphic if and only if
(6-146)
2«.- = 5> y 2 min [a,-, kp] i? 2 */» <=i
fc
= 1, 2, . . . , n
(6.147)
;=i
In the case where s =p = 1, Corollary 6.6 can be further simplified. It is possible to reformulate the result so that it can be tested more rapidly. This result was first established by Ryser (1957) and Gale (1957) in an attempt to obtain the existence conditions of a matrix of zeros and ones having prescribed row and column sums. This equivalent matrix problem will be treated in a later section.
COROLLARY 6.7 In a given sequence {[ah &,]} of n nonnegative integer pairs, alter the indices of the bt so that bt ^ bi+l for i = 1, 2, . . . , n - 1, n ^ 2. The necessary and sufficient conditions for the sequence to be (1,1) digraphic are that
2«, = 5>, i=l k
k
S«f^2^ i=i
(6-148)
y=l
(6-149)
j=\
for all integers k, where {a*} is the dual sequence of {a,}, and the sequences {/>,} and {a*} are assumed to have been brought to the same length by the insertion of an appropriate number of zeros if necessary.
6.2 DIGRAPHIC SEQUENCES
427
Proof. From Corollary 6.6, it is sufficient to show that 2 min [ah k) = £ a*
(6.150)
for all k. We prove this by induction over k. For k = \, we have i > i n [ a „ l] = af
(6.151)
from the definition of a*. Assume that (6.150) is true for any k or less. We show that it is also true for k + 1. Since min [a,, k + 1] = min [a,, k], min [a,, k + 1] = min [ah k] + 1,
at S= k a^k
(6.152a) +l
(6.152b)
it follows that n
n
2 min [a„ A: + 1] = a*k+1 + ^ min [a,-, k] i=i
;=i
;=i
The second line follows from the induction hypothesis. So the corollary is proved. In words, Corollary 6.7 states that a sequence is (1,1) digraphic if and only if the sum of the a, is equal to that of the bt and the partial sums of the bt are dominated by the corresponding partial sums of the af. Recall that in Corollary 6.3 condition (6.97) or (6.98) consists of 2" - 1 inequalities. These can be reduced to n inequalities for p = 1 and s = 0 if the elements of the sequence are properly ordered. In the following, we show that conditions (6.100) and (6.101) can be combined and simplified in terms of the modified dual sequence of {a,}.
DEFINITION 6.8 Modified Dual Sequence. Let {a,} be a sequence of nonnegative integers. The modified dual sequence of {a,} is the sequence {a"}, the A;th element al of which is defined by the number
< = 141 + 141
(6.154)
428
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
where Ik = {i\i
(6.155a)
Jk={i\i>k,a,^k}
(6.155Z>)
Like the number at, the number a'k also has a simple pictorial representation, again in terms of rows of dots, except that this time no dots are placed on the main diagonal of the array. For example, the array corresponding to the sequence {a,} = {4, 4, 3, 5, 2}
(6.156)
is shown below: a'[ ax a-,
a'i
a'i .
a\ .
. .
•
a", . .
<
.
(6.157)
a3 a
•
4
•
a5 Then the number a'k' is the number of dots in the &th column of the above diagonally restricted array of dots. Thus, we have a'[
= A, a£ = 4,
a'i = 3,
a'i = 3,
a? = 3,
al=\
(6.158)
giving the modified dual sequence of {a,} as {<} = { 4 , 4 , 3 , 3 , 3 , 1 }
(6.159)
Using this we see immediately that the left-hand sides of (6.100) and (6.101) can be expressed as 2 min fa, « - 1] = £ a? ;=1 k
n
^ min [a,, k - 1] + 2 i=l
(6.160a)
(=1
j=k + l
k
min
iaj> k] = 2
a
"
(6.1606)
i=l
respectively. Thus, conditions (6.100) and (6.101) are simply that the partial sums of the sequence {6;} be dominated by the corresponding partial sums of the modified dual sequence of {a,}. This result was first pointed out by Fulkerson (1960) in connection with his study of the existence of a square
6.2 DIGRAPHIC SEQUENCES
429
matrix of zeros and ones having prescribed row sums and column sums with zero trace. We summarize the above result as a corollary.
COROLLARY 6.8 Consider a sequence {[a,, 6,]} of n nonnegative integer pairs in which, by altering the indices if necessary, 6, i? bi+1 and, furthermore, if bt = bi+1 then a , ^ a , + 1 for i = 1, 2, . . . , n — 1, n i ? 2 . The sequence is (1,0) digraphic if and only if n
n
S ». = X b, i=l
k
(6.161)
;=1
k
2„ i=l
* = l,2,...,n
(6.162)
j=l
We illustrate the above results by the following examples.
Example 6.8 Test the sequence (6.123) to see if it is (1,1) digraphic. In order to apply Corollary 6.7, it is necessary that we alter the indices of 6, so that bt ^ bi+1 for i = 1, 2, 3, 4. A new sequence is given as n = {[a„ b,] | i = 1, 2, 3, 4} = {[2, 5], [0, 2], [4, 1], [3, 1]} (6.163) The dual sequence of the sequence {a,} = {au a2, a3, a4} = {2, 0, 4, 3}
(6.164)
is given by {a,}* = {a*} = {at, a*2, a*, a*4} = {3, 3, 2, 1}
(6.165)
where at is the number of dots in the A:th column of the following array: at
at
a%
at
ax a2 a3 a4
(6.166)
430
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
Using these, conditions (6.148) and (6.149) become a1 + a2 + a3 + a4 = 2 + 0 + 4 + 3 = 9 = bx + 6 2 + 6 3 + 6 4 = 5 + 2 + 1 + 1 at = 3^b1
=5
(6.168a)
at + at = 3 + 3 = 6 % bx + b2 = 5 + 2 = 7 at+a^
(6.167)
(6.1686)
+ fl* = 3 + 3 + 2 = 8 ^ 6 1 + 6 2 + fe3 = 5 + 2 + l = 8
a j + a2* + a3* + a? = 9 ^ 6j + 6 2 + b3 + 6 4 = 9
(6.168c) (6.1680")
Since not all the inequalities are satisfied, the sequence n is not (1,1) digraphic. Instead of looking for a (1, l)-digraph, suppose that we wish to know if the sequence JT is (2, 2) digraphic. To this end, we appeal to Corollary 6.6, and obtain from (6.147) min [aly 2] + min [a2, 2] + min [a 3 , 2] + min [a4, 2] = 2+ 0+ 2+ 2= 6 ^
=5
(6.169a)
min [2,4] + min [0, 4] + min [4, 4] + min [3, 4] = 9 ^ 6 1 + 62 = 5 + 2 = 7
(6.169fe)
min [2, 6] + min [0, 6] + min [4, 6] + min [3, 6] = 9 ^ 6 i + 62 + 63 = 5 + 2 + l = 8
(6.169c)
min [2, 8] + min [0, 8] + min [4, 8] + min [3, 8] = 9 ^ 6 t +62 + 63 + 64 = 5 + 2 + 1 + 1 = 9
(6.169d)
Fig. 6.18. A 2-digraph realizing the sequence of nonnegative integer pairs of (6.163).
6.2 DIGRAPHIC SEQUENCES
431
showing that the sequence n is (2,2) digraphic. One such realization is presented in Fig. 6.18. Example 6.9 Test to see if the following sequence of nonnegative integer pairs is (1,0) digraphic: * = {[a» b,]} = {[3, 3], [1, 3], [0, 3], [4, 1], [2, 1], [2, 1]} (6.170) Then we have {a,} = {3, 1, 0, 4, 2, 2}
(6.171)
{M = {3, 3, 3, 1, 1, 1}
(6.172)
The modified dual sequence of {a,-} is found to be {<,,}»={<} = {4,4, 2,1,1,0}
(6.173)
where a"k is the number of dots in the &th column of the following array: -»"
«i
r,"
al a2 a3 a4
„ "
-»"
a2
a3 .
.
a4 .
~l>
as
al
(6.174)
a5 a6
Since the elements of the sequence n are properly ordered so that bj^bi+l and, furthermore, iffo,= bi+1 then at^ai+l for i = 1, 2, 3, 4, 5, we can apply the conditions of Corollary 6.8 directly and obtain ax + a2 + a3 + a4 + a5 + a6 = 12 = & 1 + & 2 + &3 + & 4 + & 5 + 6 6 flj
= 4g61 = 3
a\ + al = 4 + 4 = 8 ^ bl + b2 = 3 + 3 = 6
(6.175) (6.176a) (6.1766)
a? + a'2 + a3' = 4 + 4 + 2 = 10 ^ 6,+fc2+ 6 3 = 3 + 3 + 3 = 9
(6.176c)
432
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
Fig. 6.19. A (l,0)-digraph realizing the sequence of nonnegative integer pairs of (6.170).
a'i + a'{ + a'i + a'i = 4 + 4 + 2 + 1 = 11 ^b1 + b2 + b3 + b4 = 3 + 3 + 3 + l = 10
(6A76d)
aI + «2+ «; + «; +a? = 4 + 4 + 2 + 1 + 1 = 12 ^bx + b2 + b3 + b4 + b5 = 3 + 3 + 3 + 1 + 1 = 11
(6.176e)
a'i + a'i + a'i + a'i + a'i + a'i = 4 + 4 + 2 + 1 + 1 + 0 = 12 ^ b1 + 62 + b3 + 6 4 + bs + />6 = 3 + 3 + 3 + 1 + 1 + 1 = 12 (6.176/) Thus, according to Corollary 6.8, the sequence n is (1,0) digraphic, a realization of which is presented in Fig. 6.19.
6.3 THE SUBGRAPH PROBLEM OF A GRAPH In Section 6.1, we considered the criterion for the existence of a (p,s) subgraph with prescribed outgoing and incoming degrees in a given directed graph. In the present section, we consider a similar problem for a class of graphs. In order to deduce similar results from those obtained earlier for the directed graphs, we introduce the notion of a symmetric (p, s)-digraph. DEFINITION 6.9 Symmetric (/»,s)-Digraph. A (p, s)-digraph G(V, E) is said to be symmetric if for each arc (i, j) e E, the arc (/', i) is also in E such that \(i, j)\ = I(7, i)\ for /' ¥=j and \(i, i)\ = 2e for i =), where e is a nonnegative integer.
6.3 THE SUBGRAPH PROBLEM OF A GRAPH
433
DEFINITION 6.10 Symmetric (p,s) Subgraph. A symmetric (p, s) subgraph of a directed graph is a subgraph which is also a symmetric (p, s)-digraph. Since an undirected graph may be transformed into a symmetric directed graph by representing each undirected edge by a pair of directed edges with opposite directions, and vice versa, it is convenient to use a simpler term. DEFINITION 6.11 (p,s)-Graph. A symmetric (p, 2s)-digraph is called a (p,s)-graph. A (p, p)-graph is simply called a p-graph and a (oo, oo)-graph is also referred to as a graph. The directed graph of Fig. 6.20 is a symmetric (2,4)-digraph, and can be converted to a (2,2)-graph or 2-graph as shown in Fig. 6.21. The immediate problem is to find necessary and sufficient conditions for the existence of a symmetric (p, s) subgraph with prescribed outgoing and incoming degrees in a given directed graph. Let G(V, E) be a given directed graph and let GS(V, Es) be a maximal spanning symmetric subgraph of G. Associate with each x eV two nonnegative integers a(x) and a'(x) satisfying 0^a(x)^a'(x),
xeV
(6.177)
Then G has a symmetric (p, s) subgraph H whose outgoing and incoming degrees d^{x) and d„(x) satisfy a{x)^dUx)^a'(x),
a{x)^d-H{x)^a,(x),
xeV
(6.178)
if and only if H is a subgraph of a maximal spanning symmetric subgraph of G. Thus, it is sufficient to consider only symmetric directed graphs or simply graphs.
Fig. 6.20. A symmetric (2, 4)-digraph used to convert to a 2-graph.
434
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
Fig. 6.21. A 2-graph. DEFINITION 6.12 {/-Invariant. Two (p, s) subgraphs or (p, s)-digraphs are said to be dinvariant if they possess the same sequence of degree pairs of their nodes. The term d-invariance stands for degree invariance. One of the implications of the d-invariance is that if two labeled (p, s)-digraphs are not d-invariant, then there does not exist a one-to-one correspondence between their node sets such that the corresponding nodes have the same degree pair. The two labeled directed graphs of Fig. 6.22 are d-invariant because they possess the same degree-pair sequence {[1,1], [2,2], [1,1], [2,2], [2,2]} even though they have different labels.
Fig. 6.22. Two labeled d-invariant directed graphs. DEFINITION 6.13 Elementary (p,s) d-Invariant Transformation. In a G{V, E), if there are two arcs (i1, i2) and Ui>h), h^ii that
directed graph d h^h* s u c n
an
l(ii,/2)l
h*h
(6.179a)
\(h,J2)\<s,
h=h
(6.17%)
6.3 THE SUBGRAPH PROBLEM OF A GRAPH
435
©——-© Fig. 6.23. An elementary (p, s) d-invariant transformation.
l(/i,'2)l
7i*«2
(6.179c)
K/i,i2)l<*,
/i = «2
(6.179d)
then the operation of replacing the arcs (i 1( i2) and (/i,/ 2 ) by the arcs O1./2) a n d 0i> '2) i s called an elementary (p,s) d-invariant transformation of G. An elementary (°°, 0°) d-invariant transformation is simply referred to as an elementary d-invariant transformation. The operation is depicted in Fig. 6.23. Clearly, this kind of operation will result in a d-invariant (p, s)-digraph. Two d-invariant (1, 0)-digraphs G t and G2 are shown in Fig. 6.24. It is easy to verify that if we replace the arcs (1, 2) and (5, 3) in d by (1, 3) and (5, 2), we obtain G2. In other words, G2 can be obtained from Gt by an elementary (1,0) d-invariant transformation. It was shown by Chen (1971) that any two d-invariant {p, s)-digraphs are transformable from each other by a finite sequence of elementary (p, s) d-invariant transformations, a proof of which will be given in Section 6.7.
Fig. 6.24. Two d-invariant (1, 0)-digraphs: (a) d and (b) G2. THEOREM 6.6 For a given (p, i)-digraph G, let {G} be the set of all (p, s)-digraphs that are d-invariant from G. Then any two (p, s)-digraphs of {G} are transformable from each other by a finite sequence of elementary (p, s) d-invariant transformations. We now proceed to the derivation of the necessary and sufficient
436
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
conditions for the existence of a symmetric (p, 0) subgraph with preassigned outgoing and incoming degrees for a class of directed graphs possessing the odd-circuit condition.
DEFINITION 6.14 Odd-Circuit Condition. A directed graph is said to satisfy the odd-circuit condition if it has the property that any two of its directed circuits of odd length either have a node in common, or there exists an arc connecting these directed circuits. The directed graph of Fig. 6.24(a) satisfies the odd-circuit condition, because the only two odd directed circuits (3,4)(4,5)(5,3) and (1,2)(2, 3)(3,4)(4, 5)(5,1) have at least a node in common. On the other hand, the directed graph of Fig. 6.22(b) does not satisfy the odd-circuit condition because there is no arc connecting the two odd directed circuits (1,1) and (4,4) directly. We remark that directed bipartite graphs and the complete directed graph all satisfy the odd-circuit condition.
THEOREM 6.7 Let G(V, E) be a symmetric directed graph without self-loops satisfying the odd-circuit condition. Associate with each x e V a nonnegative integer a(x). Then G has a symmetric (p, 0) subgraph H whose outgoing and incoming degrees d^(x) and dj,{x) satisfy d^,{x) = d„(x) = a{x),
xeV
(6.180)
if and only if the sum of all a(x) is even and 2 yeyW
min\a(y),2mm[\(x,y)\,p]\^a(X) <-
XGX
(6.181)
J
for all subsets X c V, where y(X) denotes the set of terminal nodes of the arcs of G having their initial nodes in X. Proof. Let d+H{x) = d-H{x) = dH{x)
(6.182)
If H is symmetric, it contains an even number of arcs. This number is equal to the sum of all dH(x) and the sum of all a(x) must, therefore, be even.
6.3 THE SUBGRAPH PROBLEM OF A GRAPH
437
The necessity of (6.181) follows directly from Theorem 6.2 by setting a(x) = b(x) for each x e V and s = 0 and by observing that min [\{x, y)\, (1 - 8xy)p] = min [\(x, y)\, p]
(6.183)
To prove sufficiency, we appeal to Theorem 6.2 and observe that there exists a (p, 0) subgraph K whose outgoing and incoming degrees d^(x) and dx(x) satisfy d%x) = dJHx) = a{x)
(6.184)
Thus, K is the arc-disjoint union of directed circuits. Let Ks be a maximal symmetric subgraph of K. If K — Ks = 0, the empty graph, the proof is completed. Assume that K — Ks¥=0. Three cases are distinguished. Case 1 In K — Ks, there is a directed circuit (h, t2)(i2, h)- • • ('2m-l, «2m)(J2m, h)
(6.185)
of length 2m. Then a series of elementary ^-invariant transformations would transform (6.185) to (i2, i3)(i3, i2), (i4, i5)(i5, i4), . . . , (i2m, ijfa,
i2m)
(6.186)
which is symmetric and is a (p, 0) subgraph of G. Case 2 In K - Ks, there are two directed circuits of odd length having a common node i1. Without loss of generality, let the two directed circuits be (h, h)(i2, i3)• • • (i2m~i, i'i)
(6.187a)
(«i. h)(h, h)• • • (72,-1, ii)
(6.1876)
Then a series of elementary d-invariant transformations would transform (6.187) to a symmetric (p, 0) subgraph of G, as follows: (h, hXii, i2), (*4, is)(is, u), • • • , (iim-2, hm-iXi^-u
i2m-2)
(h,J2)(J2, h), (j3, j*)U*> H)> ••• > {J2q-\, h)(i\, J2q-\)
(6.188a) (6.1886)
438
APPLICATIONS O F FLOW THEOREMS TO SUBGRAPH PROBLEMS
Case 3 In K — Ks, there are two node-disjoint directed circuits of odd length, which can be expressed as (h, J2)0'2, * 3 )• • • (i2m-i, h)
(6.189a)
0"i./2)02,/3)-.. (72,-1,7'i)
(6.18%)
By assumption, there is an arc connecting the two directed circuits in G. Without loss of generality, let this arc be (ilr]\). If (ii,/i) is not in Ks, then a series of elementary d-invariant transformations would transform (6.189) to a symmetric (p, 0) subgraph of G, as follows: (h> '3)('3> h)i
('*4J h)(is> U)> • • • , V2m-2> ' 2 m - l ) ( ' 2 m - l >
(hJiXJi, h), (hJsXis.h),
Hm-l)i
U4,h)(Js,J4), ••• ,
{J2c-2, J2<,-l)U2c,-l> hq-2)
(6- 190)
If (ii.ji) is in Ks, then consider the subgraph composed of the arcs of (6.189) and (ii,;'i) and (/ l7 it). This subgraph can be transformed by a series of elementary
iim-i),
(y'i, /2X/2.7i), (/a, ]4)(J4, h), ••• , (hg-i, 7'iX/i. 72,-1)
(6-191)
By repeated application of the above three types of transformations and by noting that since the sum of all d^(x) = a(x) is even, the number of directed circuits of odd length must be even, we conclude that K can be transformed into a symmetric (p, 0) subgraph of G by a finite sequence of elementary d-invariant transformations. This completes the proof of the theorem. A different version of the theorem can be stated equivalently in terms of a graph without self-loops. As in Definition 6.14, we say that a graph satisfies the odd-circuit condition if it possesses the property that any two of its circuits of odd length either have a node in common, or are connected by an edge.
THEOREM 6.8 Let G(V, E) be a graph without self-loops satisfying the odd-circuit condition. Associate with each x e V a nonnegative integer a(x). Then G
6.3 THE SUBGRAPH PROBLEM OF A GRAPH
439
has a (p, 0) subgraph H whose degrees dH(x) satisfy dH(x) = a(x),
xeV
(6.192)
if and only if the sum of all a(x) is even and, for all subsets X c V , 2 min \a(y),
£ min [\(x, y)|, p]\ ^a(X)
(6.193)
To obtain the necessary and sufficient conditions for the existence of a subgraph with prescribed degrees in a given graph, we set p - °° and obtain the following corollary.
COROLLARY 6.9 Let G(V, E) be a graph without self-loops satisfying the odd-circuit condition. Associate with each x e V a nonnegative integer a(x). Then G has a subgraph / / whose degrees dH{x) satisfy dH(x) = a(x),
xeV
(6.194)
if and only if the sum of all a(x) is even and 2 min [a(y), \(X, y)\]^a(X)
(6.195)
yeV
for all subsets X c V. We illustrate the above results by the following example. Example 6.10 We wish to determine if the graph G(V, E) of Fig. 6.25 possesses a (1, 0)
Fig. 6.25. A (2,0)-graph used to illustrate the subgraph problem.
440
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
subgraph H whose degrees dH(x) satisfy d „ ( l ) = a ( l ) = 2,
dH(2) = a(2) = 2
dH(3) = a(3) = 1,
dH(4) = «(4) = 1
(6.196)
According to Theorem 6.8, the problem is solvable if and only if (6.193) holds for each Xc V = {1, 2, 3, 4}, as follows: min {«(1), min [|(1,1)|, 1]} + min {a{2), min [|(1,2)|, 1]} + min (a(3), min [|(1, 3)|, 1]} + min {a(4), min [|(1,4)|, 1]} = min [2, 0] + min [2,1] + min [1,1] + min [1,0] = 0 + l + l + 0 = 2^a(l) = 2
(6.197a)
min [2,1] + min [2,0] + min [1,0] + min [1,1] = l + 0 + 0 + l = 2^a(2) = 2
(6.1976)
min [2,1] + min [2,0] + min [1,0] + min [1,1] = l + 0 + 0 + l = 2^a(3) = l
(6.197c)
min [2,0] + min [2,1] + min [1,1] + min [1,0] = 0 + l + l + 0 = 2^a(4) = l
(6.197d)
min {2, min [|(1,1)|, 1] + min [|(2,1)|, 1]} + min {2, min [|(1, 2)|, 1] + min [|(2, 2)|, 1]} + min {1, min [|(1, 3)|, 1] + min [|(2, 3)|, 1]} + min {1, min [|(1, 4)|,1] + m i n [|(2,4)|,1]} = 1 + 1 + 1 + 1 = 4 § «({1, 2}) = 2 + 2 = 4
(6.198a)
min [2,1] + min [2,1] + min [1,1] + min [1,1] = 4&«({1,3}) = 3
(6.1986)
min [2, 0] + min [2,2] + min [1,2] + min [1,0] = 3Sfl({i,4}) = 3
(6.198c)
min [2, 2] + min [2, 0] + min [1,0] + min [1, 2] = 3&a({2, 3}) = 3
(6.198<0
min [2,1] + min [2,1] + min [1,1] + min [1,1] = 4^a({2,4}) = 3
(6.19&)
min [2,1] + min [2,1] + min [1,1] + min [1,1] = 4^a({3,4}) = 2
(6.198/)
6.4 GRAPHICAL SEQUENCES
441
Fig. 6.26. A (1,0) subgraph of the graph of Fig. 6.25, whose degrees satisfy the requirements (6.196). min [2,2] + min [2,1] + min [1,1] + min [1, 2] = 5^a({l,2,3}) = 2 + 2 + l = 5
(6.199a)
min [2,1] + min [2, 2] + min [1,2] + min [1,1] = 5 ^ a ( { l , 2, 4}) = 5
(6.199ft)
min [2,1] + min [2,2] + min [1,2] + min [1,1] = 5 ^ a ( { l , 3, 4}) = 4
(6.199c)
min [2,2] + min [2,1] + min [1,1] + min [1, 2] = 5 ^ a ( { 2 , 3, 4}) = 4
(6.199d)
min [2,2] + min [2, 2] + min [1,2] + min [1,2] = 6 ^ f l ( { i , 2, 3, 4}) = 2 + 2 + 1 + 1 = 6
(6.200)
Thus, all the conditions are satisfied, and the graph G possesses such a (1, 0) subgraph. One of these subgraphs is presented in Fig. 6.26.
6.4
GRAPHICAL SEQUENCES
In the present section, we consider the realizability of a sequence of nonnegative integers as the degree sequence of a (p, s)-graph.
DEFINITION 6.15 Graphical Sequence. A sequence of n nonnegative integers n={ai\i
= \,2,...
, n}
(6.201)
is said to be (p, s) graphical if there exists a (p, s)-graph having n as the sequence of the degrees of its nodes, and such a graph is called a realization of the sequence.
442
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
The sequence K = {3, 4, 3, 4}, for example, is (2, 0) graphical because it can be realized as the degree sequence of the graph shown in Fig. 6.25. However, it is not (1,0) graphical because in a four-node (l,0)-graph, the maximum degree of a node cannot exceed 3 ( = n — 1).
THEOREM 6.9 A sequence {a,} of n nonnegative integers is (p, 0) graphical if and only if the sum of all a, is even, and 2
min[a I -,|A a |p]+ 2
ateXa
min [a,, (\Xa\ - l)p] ^ £
ajeXa
«* (6-202)
ak£X„
holds for each nonempty subset Xa<=:{ai), complement of Xa in {a,}.
where Xa denotes the
Proof. Let G(V, E) be the n-node graph such that for each pair of distinct nodes there are p and only p edges connecting between them and there are no self-loops. This graph clearly satisfies the odd-circuit condition, and, furthermore, each of its subgraphs is a (p, 0) graph. Using this graph G(V, E) in Corollary 6.9, the left-hand side of (6.195) becomes 2 min [a(y), \(X, y)\] + ^ min [a(y), \(X, y)|] yeX
yeX
= 2
min [ah \Xa\ p] + £
min [a,, {\Xa\ - l)p]
(6.203)
where ay e Xa if and only if v e X. The theorem follows. Condition (6.202) consists of 2" — 1 inequalities. These can be reduced to a set of n inequalities if the elements of {a,} are properly ordered. THEOREM 6.10 The necessary and sufficient conditions for a sequence JI = {a,}, a, ^ ai+1
for
i = 1, 2, . . . , n - 1
(6.204)
to be (p, 0) graphical are that the sum of all a, be even and k
n
^ min [ay, (k - l)p] + 2 j=\
i=k + l
k m m
[°i> kp] = 2 ;=1
a
i
(6.205a)
6.4 GRAPHICAL SEQUENCES
443
for k = 1, 2, . . . , n - 1 and imin[a,,(n-l)/7]^ia, ,= l
(6.2056)
;=l
The proof of the theorem is similar to that of Corollary 6.4, and is omitted. As before, conditions (6.205) can be expressed in terms of the modified dual sequence of {a,} for the (1, 0)-graphs. We show that the sequence n is (1,0) graphical if and only if the partial sums of n are dominated by those of its modified dual sequence.
COROLLARY 6.10 The necessary and sufficient conditions for a sequence of n nonnegative integers ji = {Oi},
a,i?a, + 1
for
i = 1, 2, . . . , n — 1
(6.206)
to be (1,0) graphical are that the sum of all a, be even, and any one of the following three conditions is satisfied:
S«7S2«i i=i
(6-207)
i=i
for k = 1, 2, . . . , n, where {a"} is the modified dual sequence of {a,}; n
x(x-l)+
2
x min
k> x) = 2
i=x+l
a
j
(6.208)
;=1
for x = 1, 2, . . . , n — 1; or n
k(x-l)+
k
2
fliSEay
i=x + i
(6-209)
y=i
for all A:, x in 1 =i & ^ x ^ n, the first summation being zero for x = n. Proof. Observe that for p = 1 the left-hand side of (6.205) can be written as k
k
2 a'\ = 2 i=\
1=1
n min
K> * - 1] + 2 y=*+i
min
[«;> £]
(6.210a)
444
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
for k < n and k
k
2 a"t = 2 min [a„ k-1]
(6.210ft)
for k = n. Condition (6.207) follows. To show that condition (6.208) is necessary, we demonstrate that (6.207) implies (6.208). To this end, two cases are distinguished. Case 1 ak^k — l. Then aq^k — l, q = k, and the right-hand side of (6.210a) and left-hand side of (6.208) are identical with k = x for all x. Thus, (6.208) follows from (6.207) and (6.210a). Case 2 ak < k — 1. Then k
k(k-l)>^mm[ai,k-l)
(6.211)
i=i
which in conjunction with (6.207) would imply (6.208). Thus, conditions (6.208) are necessary. To prove sufficiency, we show that if (6.208) is satisfied for all x, then (6.207) is satisfied for all k. To facilitate our discussion, two cases are again distinguished. Case 1 ak ^ k — 1. Then the left-hand side of (6.208) and the right-hand side of (6.210a) become identical with x = k for all k
(6.212)
For the above inequality to hold, it is necessary that an Si n — 1. Now consider (6.2106), which, under the assumed constraint, can be written as
ia;' = n(«-l) = («-l) 2 + ( « - l ) i=i
^(n-l) 2 + « „ 4 « /
( 6 - 213 )
6.4 GRAPHICAL SEQUENCES
445
The last inequality follows from (6.212). Hence, (6.207) is satisfied for allk. Case 2 ak0. Let y be the largest index such that ay^k — 1. Then aq
y
E a" = E i'=i
k
m m fl
i=i
n
mm a
[ » & - 1] + 2
l i> k-l]+
1=31 + 1
E
m m fl
[ ;> *]
y=*+i
= y(fc-l) + 2 «,•+ E «/ i=y+l
= y(y-l)
j=k+l
+ y(k-y)
+ E
«> + E
/=fc + l A:
Jt
2 < iSyCy - 1) + E ;' = 1
mi
n
y=fc + l *
k
= E«y+ E
A
[«/» .H + E "< i=y + l
min[a,,y] + 2 ««
i=y + l
/=1
min
n [«,, >0 + E
n
E
(6.214a)
i=.y + l
/=3> + l
= y(y-l)+ y
«/
i—y + 1 k
a, = E«y
i=y+l
(6.2146)
y=l
The last inequality follows from (6.208) by letting x = y. Thus, (6.207) holds for all k < n. For k = n, we consider (6.2106), which is the same as n
(6.214) except that all the terms containing
£
are replaced by zeros.
Note that in (6.214) we define S min [a,, k - 1] = 0 for y = 0. So 7= 1
conditions (6.208) and (6.207) are equivalent. Finally, we show that conditions (6.209) are both necessary and sufficient. For ak^k, (6.208) is identical to (6.209) for k=x. For ak>k, (6.210) is reduced to
fla"i = k(y-l) + E «,^E«, i'=l
for some y, k^y^n,
j=y + i
where
(6.215)
i'=i
E a, = 0 for y = n. The last inequality ]=y + l
follows from (6.209) for x=y. This proves sufficiency. For necessity, we need only to prove the situation where k < x. It is sufficient to show that (6.208) implies (6.209). To this end, consider the left-hand side of (6.209)
446
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
which can be expressed as n
k(x-l)
n
+ S a, = k(k-l)
^ k{k — 1) + ^
mm
i=fc+l
= jfc(A:-l) + 2
+ k(x-k)
ta<> *] + 2
+ £ a, mm
[a;> ^]
i'=x + l
min [c„ *] ^ 2 «y
(6.216)
The last inequality follows from (6.208) with x being replaced by k. This completes the proof of the theorem. We remark that, unlike the conditions stated in (6.207) and (6.208), which consist of n and n — \ inequalities, respectively, conditions (6.209) involve a set of \n(n + 1) inequalities and are thus of limited practical value. Condition (6.207) was first given by Chen (1973), (6.208) by Fulkerson, Hoffman and McAndrew (1965), and (6.209) by Erdos and Gallai (1960). We illustrate the above results by the following examples. Example 6.11 Determine whether the sequence n = {a,} = {6, 5, 4, 4, 3, 3, 3}
(6.217)
is (1,0) graphical. Since the elements of the sequence n are already arranged in non-increasing order, we can apply Corollary 6.10 directly. The sum of all a, is even because 2 a* = 6 + 5 + 4 + 4 + 3 + 3 + 3 = 28
(6.218)
To apply (6.207), we first compute the modified dual sequence of n and obtain K } = {6,6,6,3,4,2,1}
(6.219)
Conditions (6.207) become 6^6
(6.220a)
6 + 6 = 1 2 ^ 6 + 5 = 11
(6.2206)
6 + 6 + 6 = 1 8 ^ 6 + 5 + 4 = 15
(6.220c)
6.4 GRAPHICAL SEQUENCES
447
6 + 6 + 6 + 3 = 2 1 ^ 6 + 5 + 4 + 4 = 19
(6.220d)
6 + 6 + 6 + 3 + 4 = 25 ^ 6 + 5 + 4 + 4 + 3 = 22
(6.220e)
6 + 6 + 6 + 3 + 4 + 2 = 27 ^ 6 + 5 + 4 + 4 + 3 + 3 = 25
(6.220/)
6 + 6 + 6 + 3 + 4 + 2 + 1 = 28 ^ 6 + 5 + 4 + 4 + 3 + 3 + 3 = 28
(6.220g)
Thus, the sequence Jt is (1,0) graphical. A realization of n is shown in Fig. 6.27. Alternatively, we can use (6.208) and obtain 0 + min [5,1] + min [4,1] + min [4,1] + min [3,1] + min [3,1] + min [3,1] = 0 + 1+ 1+ 1+ 1+ 1+ 1= 6^6
(6.221a)
2 + 2 + 2 + 2 + 2 + 2 = 1 2 ^ 6 + 5 = 11
(6.2216)
6 + 3 + 3 + 3 + 3 = 1 8 ^ 6 + 5 + 4 = 15
(6.221c)
12 + 3 + 3 + 3 = 2 1 ^ 6 + 5 + 4 + 4 = 1 9
(6.221rf)
20 + 3 + 3 = 2 6 ^ 6 + 5 + 4 + 4 + 3 = 22
(6.221e)
30 + 3 = 3 3 ^ 6 + 5 + 4 + 4 + 3 + 3 = 25
(6.221/)
confirming that the sequence n is (1,0) graphical. Observe that (6.207) consists of 7 inequalities, whereas (6.208) involves only 6. If, on the other hand, conditions (6.209) are used for testing, we need to check 28 inequalities.
Fig. 6.27. A (1,0)-graph realizing the sequence of nonnegative integers of (6.217).
448
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
Example 6.12 Test to see if the sequence n = {a,} = {5, 4, 4, 3, 2}
(6.222)
is (2,0) graphical. Since the integers in n have already been arranged in non-increasing order, we can apply Theorem 6.10 directly. The sum of all a, is even: 2 a, = 5 + 4 + 4 + 3 + 2 = 18
(6.223)
Conditions (6.205) become min [5,0] + min [4,2] + min [4,2] + min [3,2] + min [2, 2] =0+2+2+2+2=8^5
(6.224a)
min [5,2] + min [4,2] + min [4,4] + min [3,4] + min [2,4] = 2 + 2 + 4 + 3 + 2 = 13 i?5 + 4 = 9
(6.2246)
min [5, 4] + min [4,4] + min [4, 4] + min [3, 6] + min [2, 6] = 4 + 4 + 4 + 3 + 2 = 17i?5 + 4 + 4=13
(6.224c)
min [5, 6] + min [4,6] + min [4, 6] + min [3, 6] + min [2, 8] = 5 + 4 + 4 + 3 + 2= 18 ^ 5 + 4 + 4 + 3 = 16
(6.224d)
min [5, 8] + min [4, 8] + min [4, 8] + min [3, 8] + min [2, 8] = 5 + 4 + 4 + 3 + 2 = 18 i55 + 4 + 4 + 3 + 2= 18
(6.224e)
Thus, the sequence Jt is (2, 0) graphical, a realization of which is shown in Fig. 6.28.
Fig. 6.28. A (2,0)-graph realizing the sequence of nonnegative integers of (6.222).
6.5 THE (p,s)-MATRIX
449
6.5 THE (p,s)-MATRIX In Section 6.2, we presented the necessary and sufficient conditions for the existence of a (p, s)-digraph with prescribed incoming and outgoing degrees. In the present section, we demonstrate that the existence of a (p, s)-digraph also establishes the existence of a class of matrices known as the (p, s)-matrices.
DEFINITION 6.16 (p,s)-Matrix. For given nonnegative integers p and s, a square matrix of nonnegative integers is called a (p, s)-matrix if and only if all of its off-diagonal elements are bounded above by p and all of its diagonal elements are bounded above by s. A (p, p)-matrix is also referred to as a p-matrix. For a given (p, s)-matrix M of order n, let the sum of the elements of its row i be denoted by a, and let the sum of the elements of its column j be bt for i,j = l,2,...,n. Then the sum of the elements of M is given by
S «, = t bj
(6.225)
Our problem is to establish arithmetic conditions that are necessary and sufficient for the existence of a (p, s)-matrix having prescribed row sums a, and column sums bj. The problem can be interpreted in terms of the existence of a (p, s)-digraph with prescribed degree pairs [a,, 6,] of its nodes: Let M = [m,y]
(6.226)
Then the associated (p, s)-digraph G(V, E) of M is an n-node directed graph such that if m,y ¥= 0 there are m,y parallel arcs from node i to node /' for i, j = 1, 2, . . . , n. Conversely, for a given n-node (p, s)-digraph G(V, E), the associated (p, s)-matrix is a square matrix M such that if there are m,y parallel arcs from node i to node /, then its ith row and /th column element is m,y. Thus, there exists a one-to-one correspondence between these two different representations. As an illustration, consider the (l,0)-digraph Gt of Fig. 6.24(a). The
450
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
associated (1, 0)-matrix is found to be 2 1 0 3 Mi-
1 2
2
1 0
0
1 0
0
1 1 0
1 0
0 0
1 0
1 0
0 0
0
2
1 0
(6.227)
1
1 0 0
For the (1,0)-digraph G2 of Fig. 6.24(b), its associated (1,0)-matrix is given by 2 1 "0
1
1 0
o'
0
1
1 0
1 0
0 0
1 0
1 0
0 0
0
1
1 0
0 0
3 M,
1 2 2
2
1 0
(6.228)
1
Consequently, all the results obtained for the (p, s)-digraphs can be carried over for the (p, s)-matrices. It is hardly necessary to repeat the same results all over again. However, we shall point out the corresponding operation for a (p, s)-matrix of an elementary (p, s) ^-invariant transformation for a (p, s)-digraph. Consider the 2 x 2 submatrix of M of the type
# i
=
a .c
bl d\
and
H7
b d
a c
(6.229)
where min(a, d)¥=0, and b, c
a-I 1 b b+l /1} c + 1 d-l]
and H4=\b
+1
ld-1
°-1}
c + lJ
(6.230)
A (p, s)-interchange is defined as a transformation of the elements of M that changes a specified submatrix of type Hx into H3, or else a submatrix of type H2 into H4, and leaves all other elements of M unaltered. Suppose that we apply a finite number of (p, s)-interchanges to M. Then by the nature of the operation, the resulting matrix has the same row sums and the same column sums. As a consequence of Theorem 6.6, if {M} is the set of all
6.5 THE (p, s)-MATRIX
451
{p, s)-matrices having the same row and column sums as those of M, then every element of {A/} can be obtained from any other one by a finite sequence of (p, .^-interchanges. For example, the two (1, 0)-matrices MX and M2 of (6.227) and (6.228) have the same row sums and column sums. If in Mx we replace the submatrix Afx(15; 23) consisting of the rows 1 and 5 and columns 2 and 3 by the corresponding submatrix M2(15; 23) in M2, we transform A/: into M2 by a (1,0)-interchange. We remark that since any matrix can be made square by the addition of a sufficient number of zero rows or columns, the above results can easily be extended to the non-square matrices. However, since this extension only complicates the matter and does not provide any additional information, for our purposes we shall only consider the square matrices except for a few cases where the general situation can be presented concisely. We restate Theorem 6.5 as follows. THEOREM 6.11 Given a sequence of n nonnegative integer four-tuples it' = {(ah a'„ bh b',) | a, ^ a'„ b, =ib[, i = 1, 2, . . . , n)
(6.231)
there is an n x n (p, s)-matrix M = [m,7] satisfying n
a, ^ 2
m
a =»/.
i = l,2,...,n
(6.232a)
bj ^ 2 mH ^ bj,
j = l,2,...,n
(6.2326)
n
i=i
if and only if conditions (6.95) hold. In the special situation where a, = 0 and b • = °o, we obtain a result of Gale (1957) and Ryser (1957). COROLLARY 6.11 Let {a, | i = 1, 2, . . . , m} and {bj\j = 1, 2, . . . , n} be two sequences of nonnegative integers, where bj ^ bj+l for j = 1, 2, . . . , n - 1. Then there is an m x n matrix W = [>Vy] composed of zeros and ones satisfying n
2 Wy ^ ait /=1
i = 1, 2, . . . , m
(6.233a)
452
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
2 Wn = bj,
j=
l,2,...,n
(6.2336)
if and only if k
k
2 a* i? 2 bJt 7= 1
k=
l,2,...,n
(6.234)
, = 1
where {a?} = {a,}*, the dual sequence of {a,}. Proof. To facilitate our discussion, two cases are distinguished. Case 1 m == n. The a, sequence can be brought to the same length as the bj sequence by the insertion of n — m zeros. Let the resulting sequence be again denoted by {a,}. Appealing to Theorem 6.11 by first setting a, = 0 and b'j = °° in (6.232) and (6.95) and then by replacing a[ in the resulting (6.232a) and (6.956) by at, we see that condition (6.95a) is trivially satisfied and condition (6.956) becomes n
2min[«/,|Ai>|]a 2
bj
(6.235)
with p = s = 1 for each Xb c. {bj}. Observe that the right-hand side of the inequality (6.235) is maximized over all A>element subsets Xb c {bj} by choosing the subset {blt b2, • • • , bk}, where k = \Xb\: n
k
2 min [a„ *] ^ 2 > y = 2 1=1
;=1
bt
(6.236)
b,eXb
or, in terms of the dual sequence, k
n
k
2 a* = 2 min [a,, &] §=£/>,, i=i
i=i
k = l,2,...,n
(6.237)
y=i
Case 2 m>n. The proof can be carried out in a similar manner after bringing the bj sequence to the same length as the a, sequence, and is omitted. This completes the proof of the corollary. In the case that the sum of a, equals that of bit the problem becomes that
6.5
THE (p, j)-MATRIX
453
of filling an m Xn matrix with zeros and ones so that the ith row sum is a,, and the /th column sum is bj.
COROLLARY 6.12 There is an m x n matrix composed of zeros and ones with prescribed row sums a, (i = 1, 2, . . . , m) and column sums bj (/ = 1, 2, . . . , n) with bx =£ b2 = • • • = bn if and only if m
n
fe
( 6 - 23 8)
* = 1, 2, . . . , n
(6.239)
E «/ = 2 2 < i= 2 6,-,
y
where {a*} = {a,}*. We illustrate the above results by the following examples. Example 6.13 There are five families having 3, 3, 2, 2 and 1 members to be seated at three tables having 5, 4 and 4 seats. The problem is to make a seat assignment so that no two members of the same family are seated at the same table. The problem is feasible if the following two sequences {a,} = {5, 4, 4}
(6.240a)
{b,} = {3, 3, 2, 2, 1}
(6.2406)
satisfy conditions (6.234). The dual sequence of {a,} is found to be {of } = {*/}* = {3, 3, 3, 3,1}
(6.241)
giving from (6.234) 3^3
(6.242a)
3+3=6^3+3=6
(6.2426)
3 + 3+ 3= 9^3 + 3+ 2= 8
(6.242c)
3 + 3 + 3 + 3 = 1 2 ^ 3 + 3 + 2 + 2 = 10
(6.242d)
3 + 3 + 3 + 3 + 1 = 13 ^ 3 + 3 + 2 + 2 + 1 = 11
(6.242e)
454
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
Thus, the problem is feasible and a seat assignment is given by 3
3 2
2
1
5 "1
1 1 0
1"
4
1
1 0
1 0
4 _1
1 1
1 0
(6.243)
Example 6.14 Determine whether there is a 4 x 5 matrix of zeros and ones with preassigned row sums 3, 1, 2 and 3 and column sums 2, 1, 2, 2, and 2. According to Corollary 6.12, the problem is feasible if and only if conditions (6.238) and (6.239) hold. In order to apply (6.239), we rearrange the column sums in a monotonously decreasing order as {&,} = {2, 2, 2, 2, 1}
(6.244)
3+1+2+3=9=2+2+2+2+1
(6.245)
giving from (6.238)
and from (6.239) 4^2
(6.246a)
4+3=7^2+2=4
(6.2466)
4+3+2=9^2+2+2=6
(6.246c)
4+3+2+0=9^2+2+2+2=8
(6.246d)
4 + 3+ 2 + 0 + 0 = 9^2 + 2 + 2 + 2 + 1 = 9
(6.246e)
{a*} = {a,-}* = {4, 3, 2, 0,0}
(6.247)
where
Thus, the problem is solvable, a solution of which is given by 2
2 2
3 "1 0
1
2
1
1 0"
1 0
0 0
2 0
1 0 0
3 .1
1
1 0 1
1 0 0.
(6.248)
6.5 THE {p, i)-MATRIX
455
COROLLARY 6.13 Let {a/1 i = 1, 2, . . . , m) be a sequence of nonnegative integers and let b be a given nonnegative integer. Then there is an m x n matrix W — [w^] composed of zeros and ones satisfying n
2 Wu ^ a„
i = l,2,...,m
(6.249a)
An
2>,yS&,
y= l,2,...,n
(6.24%)
if and only if
2«*Sn6
(6.250)
Proof. If we set 6 ; = b for all / in Corollary 6.11, (6.233) reduces to (6.249), and (6.234) becomes
^a*^kb,
k = l,2,...,n
(6.251)
For k = n, (6.251) is the same as (6.250). Thus, it is sufficient to show that (6.251) holds for k = 1, 2, . . . . n — 1. Since the dual sequence {a*} is monotonously decreasing, we have
( « - * ) £ a* g (n -fc)fca**i= *(/t - * K + 1 y'=i
s*: s «;
(6-252)
which can be written as
n 2 a * ^ * E « * = A:«/3 /=i
(6.253)
/=i
The last inequality follows from (6.250) by assumption. Thus, (6.251) holds for k = 1, 2, . . . , n — 1, and the proof is completed.
456
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
COROLLARY 6.14 Let {bj \j = 1, 2, . . . , n} be a sequence of nonnegative integers and let a be a given nonnegative integer. Then there is an m x n matrix W = [w,-,] composed of zeros and ones satisfying n
X ^ a ,
i = l, 2, ...,m
(6.254a)
j = l,2,...,n
(6.2546)
m
JsW^bj, i= l
if and only if bj^m
(6.255a)
^bj^ma
(6.2556)
n
Proo/. We show that if a, = a for all /', (6.255) imply (6.234) for all k. If k^a, then from (6.255a) k
2 6 ; ^ mk = m min [a, k]
(6.256a)
/=i
and if k > a, then from (6.2556) k
n 6
X fy' = 2 /=1
; ^ma=m
min [a, A:]
(6.2566)
y= l
Since m
A:
w min [a, A:] = 2 min [a,/c] = ^ a*
(6.257)
;=1
i= l
inequalities (6.256) can be combined to yield k
k
2 «* = ]>>,>
* = 1, 2, . . . , n
This completes the proof of the corollary. We illustrate the above results by the following examples.
(6.258)
6.5 THE (p, i)-MATRIX
457
Example 6.15 Determine whether there is a 4 x 5 matrix of zeros and ones with row sums bounded above by 3, 1, 2, and 3 and each column sum bounded below by 2. Appealing to Corollary 6.13, we can make the following identifications: m = A,
n = 5,
b=2
{a,} = {3, 1, 2, 3}
(6.259a) (6.25%)
the dual sequence of which is found to be {a*} = {a,}* = {4, 3, 2, 0, 0}
(6.260)
4 + 3 + 2 + 0 + 0 = 9 ^ 5 x 2 = 10
(6.261)
Since (6.250)
is not satisfied, the problem is infeasible and no such matrix exists. Example 6.16 Test to see if there is a 3 x 5 matrix of zeros and ones with each row sum bounded above by 4 and the column sums bounded below by 3, 3, 2, 2, and 2. According to Corollary 6.14, the problem is feasible if and only if inequalities (6.255) are satisfied:
bi^m-
3,
2 bj=3+3+2+2+2=
j = 1, 2, 3, 4, 5 1 2 § m f l = 3 x 4 = 12
(6.262a) (6.262/3)
7= 1
Thus, the problem is solvable, and a solution is given by 3 3 2 2 2 4 "i i i o r 4 1 1 0 1 1 4 _1 1 1 1 0_
(6.263)
Observe that in the present case since the sum of a, = a equals that of bj, the problem becomes that of filling a 3 x 5 matrix with zeros and ones with prescribed row sums and column sums, as exhibited in (6.263).
458
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
Before we proceed to the consideration of other special cases, we remark that a square matrix of zeros and ones is a 1-matrix, which is different from a (1,0)-matrix. A (1,0)-matrix is a square 1-matrix with zero trace, the sum of its diagonal elements being zero.
THEOREM 6.12 Let {a, | a, i?a, + 1 } and {bj\bj^bJ+l} be two sequences of n nonnegative integers. There is a (1,0)-matrix W = [w,y] of order n satisying n
n
S ^ = «n
2
7= 1
7= 1
w
a = bi
(6- 264)
for i = 1, 2, . . . , n if and only if k
k
2<=?5>„ ;=1
k = l,2,...,n
(6.265)
1=1
where {a"} = {a,}" is the modified dual sequence of {a,}. Proof. We appeal to Theorem 6.11 by first setting a, = 0 , bj = oo, p = 1 and s = 0 in (6.232) and (6.95), and then by replacing a\ in the resulting (6.232a) and (6.956) by ah we see that condition (6.95a) is trivially satisfied and condition (6.956) becomes 2
min [a„ \Xb\ - 1] + £ min [ah \Xb\] ^ 6 ,
(6.266)
where Xa and Xb are the corresponding subsets of {a,} and {bj}, respectively, and Xa = {cij}—Xa. Using the symbol af(Xa) defined in (6.102), the left-hand side of (6.266) can be expressed as «*(*«)+2
fl<*
(6-267)
t=\
for k = \Xb\, where the second term is zero for k = \. Equation (6.266) becomes 2«r^(S
b)-a*k(Xa)
(6.268)
Since {a,} and {bj} are monotonously decreasing sequences, the right-hand side of (6.268) is maximized by selecting Xb = {blt b2, . . . , bk}. Thus,
6.5 THE (p, i)-MATRIX
459
(6.266) may be replaced by the n inequalities k-\
k
2 a* + at({ak+1,
ak+2, ... , an}) ^ 2 > «
k =
l,2,...,n (6.269)
Since k-l
k
2 a* + at({ak+1,
ak+2, . . . , an}) = 2 «"
(6.270)
inequalities (6.265) follow. This completes the proof of the theorem. Particular cases under which an ordering of the elements of the sequences {a,} and {&,} exists are those where b, = b for all i or a, = a for all i, as in Corollaries 6.13 and 6.14. In words, Theorem 6.12 states that a (1, 0)-matrix satisfying (6.264) exists if and only if the partial sums of the bj sequence are dominated by those of the modified dual sequence of the a, sequence.
COROLLARY 6.15 Let {a, | a, i? a,+i} be a sequence of n nonnegative integers, and let b be a given nonnegative integer. Then there is a (l,0)-matrix W = [H',y] of order n satisfying n
n
S^Sfl,-,
*Zwj,^b
(6.271)
for i = 1, 2, . . . , n if and only if n
^a'l^nb
(6.272)
where {a"} is the modified dual sequence of {a,}. Proof. Recall that the dual sequence {a*} of {a,} is monotone, but the modified dual sequence {a"} is not necessarily monotone. However, it is straightforward to show that the monotonicity of the sequence {a,} implies that either the sequence {a"} is monotone, or else it has at most one point of unit increase; that is, either a'l^a'i^---^a:
(6.273a)
460
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
or, for some t = 1, 2, . . . , n — 1, a'[ iS a'^ • • • i? a';,
a'!+1 = a'/ + 1 § a"t+2 = = • • • & <
(6.2736)
To complete the proof, we need to show that (6.272) and (6.273) imply (6.265) or k
^a'l^kb,
k = l,2,...,n
(6.274)
We establish this by induction over n. For n = 1, (6.272) and (6.274) are identical. Assume that (6.272) implies (6.274) for any n - 1 or less. We show that the proposition is also true for any n. If a'^ > b, then by (6.273) we have a"^b for all i, and (6.274) follows. If, on the other hand, a'^b, then in order for (6.272) to hold, it is necessary that n-\
2a"^(n-l)fe
(6.275)
By induction hypothesis, we have k
^a'l^kb,
k = l,2,...,n-l
(6.276)
i=i
This together with (6.272) gives (6.274), and the proof is completed.
COROLLARY 6.16 Let {bj | bj^bJ+l} be a sequence of n nonnegative integers and let a be a given nonnegative integer. Then there is a (l,0)-matrix W = [vv/;] of order n satisfying i^Sa,
i^Sfc,
(6.277)
for i = 1, 2, . . . , n if and only if b^n-1
(6.278a)
'Zbj^na
(6.2786)
7=1
6.5 THE (p,5)-MATRIX
461
Proof. We show that (6.278) implies k
k
2«"=?2>y, y= l
k = l,2,...,n
(6.279)
j=\
To facilitate our discussion, two cases are distinguished. If kf=a, then a"j = n-l,
j ^ k
(6.280)
giving k
k
£ < = A:(rc-l)^2>,
(6.281)
If, on the other hand, k > a, then n — 1, j = a a, ; = fl + l 0, j>a + l
(6.282)
obtaining
7= 1
7= 1
7= 1
This completes the proof of the corollary. We illustrate the above results by the following examples. Example 6.17 Given two sequences {3, 3, 4 , 2 , 2 } and {3, 3, 3, 3, 2} of nonnegative integers, determine whether there is a (1, 0)-matrix whose row sums and column sums are bounded above and below by the elements of the two sequences, respectively. In order to apply Theorem 6.12, we interchange the first and third elements of the two sequences simultaneously, and obtain {a,} = {4, 3, 3, 2, 2}
(6.284a)
{bj} = {3, 3, 3, 3, 2}
(6.284fo)
The modified dual sequence of {a,} is found to be {<} = { 4 , 4 , 2 , 3 , 1 }
(6.285)
462
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
which is not necessarily monotone, as we observed in (6.273). The problem is solvable since from (6.265) 4=: 3
(6.286a)
4 + 4 = 8^3 + 3 = 6
(6.286ft)
4 + 4 + 2 = 10^3 + 3 + 3 = 9
(6.286c)
4 + 4 + 2 + 3 = 13 ="3 + 3 + 3 + 3 = 12
(6.286)
4 + 4 + 2 + 3 + 1 = 14 ^ 3 + 3 + 3 + 3 + 2 = 14
(6.286e)
A desired (1, 0)-matrix is given by 3 3
3 3
2
1
1
1 1"
3
1 0
0
1
3
1 1 0
2
0
1
1 0
0
2
1 0
1 0
0
4 "0
1
1 0
(6.287)
Since the sum of a, equals that of bjt the (l,0)-matrix yields the prescribed row sums and column sums. Example 6.18 We wish to know if there is a (1,0)-matrix, whose row sums are bounded above by 4, 3, 3, 2, 2 and each column sum is bounded below by 3. According to Corollary 6.15, the problem is solvable if and only if inequality (6.272) holds: JT a'l = 4 + 4 + 2 + 3 + 1 = 1 4 $ 5 x 3 = 15
(6.288)
where {a,} = {4, 3, 3, 2, 2} and {a'l} = {4,4,2, 3,1}. Since (6.272) does not hold, no such (1, 0)-matrix exists. Recall that Theorem 6.5 was deduced from Theorem 6.1, which in turn was derived from Theorem 5.5. A counterpart to Corollary 5.1 can now be stated explicitly for the existence of a nonnegative matrix whose row and column sums lie between designated limits, and, furthermore, whose elements are bounded above by specified numbers.
6.6 REALIZATION OF THE 1-MATRIX AND THE (1,0)-MATRIX 463
THEOREM 6.13 Let O^a^al, i = 1, 2, ... ,m; O^bj^bj, j = 1, 2, . . . , n; and c, y ^0 be given constants. If there are m x n matrices Fa = [fVa]
a n d Fp = [filP]
(6.289)
satisfying tn
n
y f.. >a
y f ^b'
y=l
O^f ^ c
(6.290a)
<=1
n
m
(6.2906)
Ifw^a'i,
Zfw^bj,
O^fu^dj
then there is an m x n matrix F = [^y] satisfying tn
n
a^Zf^al,
bj^fij^b}, O^f^c,
y=l
(6.291)
; = 1
In words, the theorem states that if there is a matrix meeting the lower bound requirements for the row sums and the upper bound requirements for the column sums, and if there is a matrix satisfying the upper bound requirements for the row sums and the lower bound requirements for the column sums, and, furthermore, if their elements are bounded above by specified numbers, then there is a matrix, whose row and column sums lie between designated limits and whose elements are bounded above by the specified numbers. 6.6 REALIZATION OF THE 1-MATRIX AND T H E (1,0)MATRIX In this section, we present a simple, direct n-stage algorithm for the construction of a 1-matrix satisfying the row and column constraints (6.233) in the case where the problem is feasible. The algorithm was first given by Gale (1957). Let {a, | i = 1, 2, . . . , m} and {bt \j = 1, 2, . . . , n} be two sequences of nonnegative integers, where bl i? b2 = • • • = bn. Suppose that the conditions *
k
E«* = 5>/. i=i
k = l,2,...,n
(6.292)
j=\
are satisfied. The following algorithm either constructs a solution or shows that the problem is infeasible.
464
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
The 1-matrix algorithm Select any column p and assign bp ones to the rows ait{t = 1,2, ... ,bp) having the largest row sum bounds. Repeat the procedure in the reduced problem by taking a, (i = 1, 2, . . . , m) and bj (/ = 1, 2, . . . , n — 1) to be the new upper and lower bounds on row and column sums, so that f*-l. la,,
fl
6, =
ie{h,i2,...,ibp} otherwise J;-1'2'"-"'-1
ft'
(6.293*)
To verify, we appeal to Corollary 6.11. The reduced problem is feasible if and only if k
k
2,a?*il6/, i=\
k = l,2,...,n-l
(6.294)
j=\
where {a*} = {&,}* is the dual sequence of {a,}. Using the symbol defined in (6.102), the left-hand side of (6.294) can be rewritten as ita* = a*k+l(I)-bp
+ *Za*
(6.295)
y= l
1= 1
where / = {a,,, a,2, . . . , aib }. As a result, the feasibility conditions (6.294) for the reduced problem become k
k
aUi(I) + t<>f^bP
+ 2bj,
k = 1,2, . . . , p-1
(6.296a)
y= l
j=\
a*k+1(I) + i a* ^ 2 */>
fc=p,p
+ l,...,n-l
(6.2966)
Since by choice a,, (r = 1, 2, . . . , bp) correspond to the bp largest ah we have a*k+1(I) = min [bp, a*k+1]
(6.297)
showing that conditions (6.296) always hold under the constraints (6.292); for if k
k
E « ; = 2^y y= l
y= l
(6-298)
6.6 REALIZATION OF THE 1-MATRIX AND THE (1,0)-MATRIX
465
and if k
( 6 - 2 ")
2a;*bp + tbj y=i
/=i
which is valid since from (6.292) k
jfc + l
k
2 a* i= bk+l + X bj i= bp + 2 6/ y=i
y=i
(6-300)
;=i
The last inequality follows from the fact that for b1^b2= • • • = 6„, bk+l^bp forp ^ k + 1. If, on the other hand, k^p and min [6P, a£+1] = 6P, (6.2966) reduces to
S«;^2^ 7=1
(6-301)
7=1
which is again valid since from (6.292)
2 « ; ^ 2 *,-=»P + S ^ ^*+i + 2 &y
7= 1
7= 1
7= 1 7^p
(6-302)
7= 1 y^p
and if k §/? and min [6P, aj*+1] = a| +1 , (6.2966) becomes k+l
k+l
2«7*=5>y 7=1
(6.303)
7=1
Thus, the algorithm constructs a desired 1-matrix. Example 6.19 Suppose that we wish to construct a 1-matrix W, whose row sums are bounded above by 4, 3, 2, 2, 1 and whose column sums are bounded below by 4, 3, 3, 2. Thus we have {a,-} = {4, 3, 2, 2,1}
(6.304a)
{*>,} = {4, 3, 3, 2}
(6.3046)
{a*} = {5, 4, 2,1}
(6.304c)
466
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
where m = 5 and n = 4. The problem is feasible since from (6.234) 5^4
(6.305a)
5+4=9^4+3=7
(6.3056)
5 + 4 + 2 = 1 1 ^ 4 + 3 + 3 = 10
(6.305c)
5 + 4 + 2 + 1 = 1 2 ^ 4 + 3 + 3 + 2 = 12
(6.305d)
For 6, = 4, the transpose of the first column of W is found to be [ 1 1 1 1 0 ]
(6.306)
Next, consider the reduced problem having the sequences {a,} = [3, 2, 1, 1, 1]
(6.307a)
{b,} = {3, 3, 2}
(6.3076)
For bx = 3, the transpose of the second column of W is given by [ 1 1 1 0
0]
(6.308)
Now, consider the new sequences { 2 , 1 , 0 , 1 , 1 } and {3,2} for the reduced problem. The transpose of the third column of W becomes [ 1 1 0
10]
(6.309)
The next sequences are { 1 , 0 , 0 , 0 , 1 } and {2}. They generate the transpose of the last column of W as [10
0 0
1]
(6.310)
The desired matrix becomes 4 3 3 2 4
1 1
3
1
1 1 0
=2
1
1 0
2
1 0
1
1 0
(6.311)
1 0
1 _0 0 0
1.
We remark that since the sum of the elements of the a, sequence equals that of the bj sequence, the problem becomes that of filling a 5 x 4
6.6 REALIZATION OF THE 1-MATRIX AND THE (1,0)-MATRIX
467
matrix with zeros and ones so that the ith row sum is a, and the ;'th column sum is bj. Instead of looking for a 1-matrix, suppose that we wish to construct a symmetric (l,0)-matrix having prescribed row and column sums. This problem is equivalent to the realization of a (1, 0)-graph having preassigned degrees of its nodes. A direct n-stage algorithm for its construction is available, and was first described by Havel (1955) and Hakimi (1962).
THEOREM 6.14 Let {a,} be a sequence of n nonnegative integers, where a 1 =£a 2 = • • • = a „ and n ^ 2. Then there is a symmetric (1, 0)-matrix, the ith row or column sum of which is a,, if and only if n — 1 i? a^ and the reduced sequence {a2 - 1, a3 - 1, . . . , a fl]+1 - 1, a ai+2 , . . . , an)
(6.312)
is feasible, i.e. there is a symmetric (l,0)-matrix, whose row sums or column sums are prescribed as in (6.312). Observe that if there is a symmetric (1, 0)-matrix Wof order n, there are at most n — l ones in any row or column and a1 cannot exceed n — 1. Thus, by deleting the row and column corresponding to alt the row sums and the column sums of the resulting matrix are those given in (6.312). By reversing the process, an iterative algorithm is obtained. Theorem 6.14 also establishes the existence of a (1, 0)-graph with prescribed degrees of its nodes. A formal proof of Theorem 6.14 can be found in Hakimi (1962) or Chen (1976); only an informal justification was described above. Example 6.20 Determine if there is a symmetric (l,0)-matrix of order 5 having prescribed row and column sums 4, 4, 3, 3, and 2. According to Theorem 6.14, the problem is feasible if and only if the reduced sequence {4 - 1, 3 - 1, 3 - 1, 2 - 1} = {3,2, 2,1}
(6.313)
is realizable. Applying Theorem 6.14 once more shows that the sequence (6.313) is realizable if and only if the new reduced sequence { 2 - 1 , 2 - 1 , 1 - 1 } = {1,1,0}
(6.314)
is realizable. A symmetric (l,0)-matrix satisfying (6.314) can easily be
468
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
constructed and is given by 0 1 0 1 0 0 0 0 0
(6.315)
To realize (6.313), we insert a row [0 1 1 1 ] and a corresponding column to the matrix of (6.315) and obtain "0 1 1 r 10 10 1 1 0 0 10 0 0
(6.316)
Finally, to construct a desired matrix, we insert a row [ 0 1 1 1 1 ] and a corresponding column to the matrix of (6.316) to yield 0 1 1 1 1 10 1 1 1 1 1 0 10 1 1 1 0 0 1 1 0 0 0
(6.317)
The associated (1, 0)-graph of the matrix of (6.317) is shown in Fig. 6.29. Thus, the algorithm can also be used to construct a (l,0)-graph with prescribed degrees of its nodes if the problem is feasible.
Fig. 6.29. The associated (1, 0)-graph of the matrix (6.317).
6.7 MINIMAL TRANSFORMATIONS
6.7
469
MINIMAL TRANSFORMATIONS
In Section 6.3, we indicated that any two (p, s)-digraphs having the same degree pairs are transformable into each other by a finite sequence of elementary (p, s) d-invariant transformations. Similar results can be stated for the (p, s)-matrices having the same row sums and column sums. In the present section, we shall determine the minimal number of such transformations or interchanges required to transform one into the other. Let G1 and G2 be two (p, *)-digraphs in the set {G} of all (p, s)-digraphs that are d-invariant from a given (p, s)-digraph G. We denote by Gi © G2 the n-node directed graph obtained from Gt and G2 such that the arc (i, j) is in Gx © G2 if and only if (i, j) is either in Gx or in G2 but not in both, where n is the number of nodes of G. We assume that the arcs of G t © G2 are properly distinguished or labeled so that we can distinguish the arcs of G, from those of G2. Accordingly, we shall write (i, j)x if (i, j) is an arc in G1 © G2 but not in G 2 , and write (/, j)2 if (i, j) is an arc in G, © G2 but not in Gj.
DEFINITION 6.17 Alternating Edge Train. An alternating edge train in G] © G2 is an edge train in which the arcs along the edge train belong alternately to Gl and G2 and in which if we reverse the directions of those arcs in Gi (or G2) we obtain a directed arc train. Thus, a closed alternating edge train and, in particular, an alternating circuit can be meaningfully defined only when it is of even length. As an example, consider the (2, 0)-digraphs GX and G2 of Figs. 6.30 and 6.31, respectively. The directed graph G t © G2 is shown in Fig. 6.32 with the arcs of Gx being denoted by the solid lines and the arcs of G2 denoted by the
Fig. 6.30. A (2, 0)-digraph G,.
470
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
Fig. 6.31. A (2,0)-digraph G2. dashed lines. Two closed alternating edge trains of Gx © G2 are given by (1, 7)(3, 7)(3,1)(2,1)(2, 5)(6, 5)(6, 3)(1, 3)
(6.318a)
(5, 9)(8, 9)(8, 4)(5, 4)
(6.3186)
However, the closed edge train (3, 7)(6, 3)(6, 5)(2, 5)(2,1)(1, 7)
(6.319)
is not a closed alternating edge train because if we replace the arcs (6, 3), (2,5) and (1, 7) by the arcs (3,6), (5, 2) and (7,1), respectively, in the edge train, the resulting graph is not a directed arc train.
Fig. 6.32. The ring sum Gt © G2 of the (2,0)-digraphs G, and G2.
6.7
MINIMAL TRANSFORMATIONS
471
DEFINITION 6.18 Distance. The distance between two «-node (p, s)-digraphs G, and G2 in {G} is defined to be the number
l\ll\\(i,j)i\-\(i,i)2
(6.320)
where (i, j)l and (i, j)2 denote the arcs from node i to node ;' in Gv and G2, respectively. In words, the distance between the two digraphs G t and G2 is the number of arcs in one but not in the other. For example, the distance between the two (2,0)-digraphs GX and G2 of Figs. 6.30 and 6.31 is 6, the number of arcs in Gl not belonging to G2, or vice versa. We remark that in all the discussion in this section, we have implicitly assumed that all the elements in {G} are labeled (p, s)-digraphs. We consider two (p, s)-digraphs G, and G2 of {G} as being identical when they are isomorphic, and they are denoted by Gt = G2. Thus, if Gt = G2, Gl © G2 need not be null. For example, consider the two directed circuits L, = (1, 2)(2, 3)(3, 4)(4, 1)
(6.321a)
L2 = ( l , 4 ) ( 4 , 3 ) ( 3 , 2 ) ( 2 , l )
(6.3216)
Clearly, Lr = L2 and Lx and L2 are
472
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
Fig. 6.33. Two (1, 0)-digraphs which cannot be transformed into each other by any finite sequence of elementary (1,0) d-invariant transformations. transformation may result in a (p, s)-digraph that contains arcs neither in Ga nor in Gp.
LEMMA 6.1 If Ga © Gp is not null, then Ga © Gp can be decomposed into an arc-disjoint union of closed alternating edge trains of even length greater than 3. Proof. Without loss of generality, let (i1, i2)a be an arc of Ga © Gp in Ga. Since the incoming degree of i2 is the same in both Ga and Gp, there is a node i3, i3^=ilt such that (i3, i2)p is an arc of Ga © Gp in Gp. The same argument can now be applied to i3 and generates an arc (i3, i4)a of Ga © Gp in Ga. Since Ga © Gp contains a finite number of arcs, the process can be repeated indefinitely only by returning to the arc (it, i2)a. Thus, for some positive integer k, k i? 2, there exists a sequence of nodes h> h> • • • > '2*-i. hk> h
(6.322a)
such that Li = (ilt i2)a(i3, i2)/3(«3. i*)a• • • O'at-i, i2k)a(h, iik)p
(6.3226)
is a closed alternating edge train Lx in G a © Gp. Note that not all the nodes in (6.322a) are necessarily distinct. If (Ga © Gp) — Ll is not null, the same argument may be employed to generate a closed alternating edge train of length § 4 because (Ga © Gp) — Lx possesses the same property as that of Ga © Gp. By repeated application of this procedure, we see that Ga © Gp can be decomposed into an arc-disjoint union of closed alternating edge trains of even length i?4. This completes the proof of the lemma.
6.7 MINIMAL TRANSFORMATIONS
473
LEMMA 6.2 Let L be a closed alternating edge train of length 2k, k^2, in Ga® Gp. If 5 ¥= 0, then there exists a sequence of (k — 1) elementary (/?, s) dinvariant transformations involving the arcs of L only which will transform Ga into GY so that the distance between Gp and GY is k shorter than that between Gp and Ga. Proof. Clearly, p^O; for otherwise Ga®Gp generality, let us assume that L is of the type
is null. Without loss of
L = 0'i, i2)a(h, J2)/3 • • • (iat-i, i2*) a (ii, iaOp
(6.323)
We shall prove the lemma by induction over k. For k = 2 we have (h, i2)a(t3, h)p{h, U)a{ii, U)p
(6.324)
Hence, an elementary (p, s) d-invariant transformation of replacing the arcs («!, i2) and (£3, i4) of G a by the arcs (i 3 , i2) and (i1} i4) would result in a (p, s)-digraph in {G} which is of distance two closer to Gp than Ga. Thus, there exists such a transformation. Assume that the assertion is true for any L which is of length 2q, q
«2/t)/3
(6.325)
in GJ,,© Gp where the index a now indicates the arcs of G'a in G'a(& Gp. Since L' is of length 2(fc — 1), by induction hypothesis there is a sequence of (k — 2) elementary (p, s) d-invariant transformations involving the arcs of L' only which will transform G'a into Gy. Thus, Ga can be transformed into Gy by a sequence of (k — 1) elementary (p, s) dinvariant transformations involving the arcs of L only. Case 2 In Ga, |(/"i, i'4)| = p for i ' l ^ ^ or \(ilt i4)\ =s for t'j = i 4 . If (h, i4)a is in Ga®Gp, then L' in (6.325) is a closed alternating edge train in Ga® Gp, which is of length (2k — 2). By induction hypothesis, there is a
474
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
sequence of (k — 2) elementary (p, s) d-invariant transformations involving the arcs of L ' only which will transform Ga into G£ such that the distance between G£ and Gp is (k — 1) shorter than that between Ga and Gp. Since (i1, i4) is not in G'„, an elementary (p, s) d-invariant transformation of replacing the arcs (i3, i4) and (i 1; i2) in G» by the arcs (i3, i2) and (i1, i4) will transform G« into Gy, which is k closer to Gp than Ga. If (ii, / 4 ) a is not in Ga © Gp, then (i1, i4) must be in both Ga and G^. Let G* be the directed graph obtained from Ga © G^ by adding the arcs (ij, 14)0. and (i t , i 4 )^. Then L' in (6.325) is again a closed alternating edge train in G*. Thus, by induction hypothesis, there is a sequence of {k — 2) elementary (p, s) d-invariant transformations involving the arcs of L' only which will transform Ga into Gal such that the distance between Gal and Gp is (A: — 2) shorter than that between Ga and G^. Since (i^, iA) is not in G„i, an elementary (p, s) d-invariant transformation of replacing the arcs (ilt i2) and (/3, i4) in GaX by the arcs (ilt i4) and (i3, i2) will transform Gal into G y , which is k closer to Gp than Ga. Note that the last transformation will shorten the distance between Gal and Gp by 2. This concludes the proof of the lemma.
LEMMA 6.3 In Ga ® Gp let L be a closed alternating edge train of length 2k, k^2, based on at least four distinct nodes. Then there is sequence of (k — 1) elementary (p, s) d-invariant transformations involving the arcs of L only which will transform Ga into Gr such that the distance between Gp and Gy is k shorter than that between Gp and Ga. Proof. Without loss of generality, assume that the nodes ilt i2, i3 and i4 are distinct nodes of L. Following a similar argument as given in the proof of Lemma 6.2, we arrive at the desired result. With these preliminaries, we now state the main result of this section.
THEOREM 6.15 Let Ga and Gp be two d-invariant (p, s)-digraphs with s ¥= 0. Then Ga can be transformed into Gp by a sequence of \E{Ga ®Gp)-C{Ga®Gp)
(6.326)
and no fewer elementary (p, s) d-invariant transformations, where E(Ga ®Gp) denotes the number of arcs in Ga®Gp, and C(Ga © Gp) is
6.7 MINIMAL TRANSFORMATIONS
475
the maximum number of arc-disjoint closed alternating edge trains in Ga © Gp. Proof. Assume that Ga(BGp¥=0; for if not we are finished. From Lemma 6.1, Ga © Gp can be decomposed into an arc-disjoint union of a maximum number of closed alternating edge trains Lx, x = 1, 2, . . . , C(Ga © Gp), of length 2kx, kx ^ 2. By Lemma 6.2, Ga can be transformed into Gp by a sequence of
= | £ ( G a © Gp) - C{Ga © Gp)
(6.327)
where C = C(Ga © Gp), elementary (p, s) d-invariant transformations. Thus, the existence of such a sequence is assured. To show that no fewer than this number is possible, we must prove that the number of transformations in any sequence which transforms Ga into Gp is no less than that given in (6.326). From Theorem 6.6 and Lemmas 6.1-6.3, we see that there is a minimal sequence of (p, s)-digraphs G 0 , Gx,...,Gk in {G} such that G a © G 0 = 0 , Gp® Gk = 0 and G, © G,_! is a closed alternating edge train of length 4 for i = 1, 2, . . . , k, each of which corresponds to an elementary (p, s) d-invariant transformation. Now, we shall establish the lower bound by induction over k. For k = \, we have \E(Ga © Gp) - C(Ga © Gp) = 2 - 1 = 1
(6.328)
Thus, (6.327) is a lower bound for k = 1. Assume that the assertion is true for any k — 1, k i? 2. We show that it is also true for any k. It can be shown that k
Ga®Gp
= ® (G, © G,-0
(6.329)
Let q(Gj © G,_ t ) be the number of arcs of G, © G,_! which are also contained in Ga © Gp. Then there is a G, © G,_j for which q(Gt © G , ^ ) =5 3; for otherwise we would have jt
E(Ga © Gp) ^ 2 9(G, © G,_0 ^ 2fc
(6.330)
;= 1
which, in conjunction with (6.327), would imply that k is not the minimal number of transformations required to transform Ga into Gp, a contradiction. To facilitate our discussion, two cases are distinguished.
476
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
Case 1 There exists a G, © G^,
l^j^k,
for which q{G}© Gy_x) = 4. Let
Gj © Gy_j = (/'i, i2)a(h, i2)p(i3, ijaih,
U)p
(6.331)
Let G'a=Ga-
(iu i2)(i3, i4)
(6.332a)
G^Gp-fo.iaXii.i*)
(6.3326)
Then G^ and G'p are d-invariant (/>, s)-digraphs, and k
G'a © G'p = 0 (G, © G , ^ ) <*/
(6.333)
Since G'a can be transformed into G'p by a sequence of (k - 1 ) elementary (p, s) ^-invariant transformations, by induction hypothesis we have k-l^\E{G'a®G'p)-C{G'a®G'p)
(6.334)
because the right-hand side of (6.334) is the minimal number of transformations required from G'a to G'p. Since Ga © Gp is the arcdisjoint union of G'a@ G'p and G, © G,_1( it follows that C(Ga@Gp)^C(G'a®G'p)
+l
(6.335a)
E(Ga®Gp)
+4
(6.335b)
= E(G'a®G'p)
Combining (6.334) and (6.335) yields k i= hE(Ga © Gp) - C(G'a® G'p) - 1 i= \E{Ga © Gp) - C(Ga © Gp)
(6.336)
Case 2 There exists a G, © Gj-U 1 =1; =i *, for which ?(G, © G , ^ ) = 3. Without loss of generality, we may assume that Gj © G,_x = (iu i2)a(h, i2)f}(i3> U)a(h, U)
(6.337)
where (ilt i4) is an arc which is not contained in Ga®Gp. Two subcases are considered. Subcase 1. (ilt i4) is in both Ga and Gp. Again we form
6.7 MINIMAL TRANSFORMATIONS
477
G'a and G'p as in (6.332). Then we have (6.333). Let G'a®G'p=@Lx
(6.338)
x= l
be a decomposition of G'a® G'p into an arc-disjoint union of a maximum number of closed alternating edge trains Lx, where C = C(G'a® G'p). We remark that Lx should be formally defined as a spanning subgraph of G'a®G'p containing a closed alternating edge train, but the present usage is sufficient for our purposes. Let L, be the closed alternating edge train in (6.338) which contains the arc (ilt i4)a. Then L, © (Gy © G ^ ) is also a closed alternating edge train. Since c Ga © Gp = L, © (G, © G,_0 © 0 Z^ (6.339) x= \ x*i
it follows that C(Ga ®Gp)^
C(G'a © G£)
(6.340)
Also we have E{Ga © Gp) = £ ( G ; © G'p) + 2
(6.341)
Since from (6.333) G'a can be transformed into G'p by a sequence of (k — 1) elementary (p, s) d-invariant transformations, by induction hypothesis we have (6.334). Combining (6.334), (6.340) and (6.341) shows that (6.336) remains valid in this case. Subcase 2. (ilt i4) is neither in Ga nor in Gp. Let G'a = Ga U (*!, i4) - (i l f i2)(i3, i4)
(6.342a)
G'p = Gp-(i3,i2)
(6.3426)
Clearly, G'a and G'p are d-invariant (p, 5)-digraphs, and we have (6.333) and (6.334). Following an argument similar to that of Subcase 1, we obtain (6.340) and (6.341) and finally (6.336). Thus, (6.326) is also a lower bound required to transform Ga and Gp into each other. This completes the proof of the theorem. We illustrate the above results by the following example. Example 6.21 Consider the two (2, l)-digraphs Ga and Gp of Figs. 6.30 and 6.31, respectively. We wish to determine the minimal number of (2,1)
478
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
d-invariant transformations required to transform Ga into Gp or vice versa. To this end, we first construct the directed graph Ga © Gp and the result is shown in Fig. 6.32. Since Ga © Gp can at most be decomposed into two closed alternating edge trains U = (1, 7)(3, 7)(3, 1)(2, 1)(2, 5)(6, 5)(6, 3)(1, 3)
(6.343a)
L 2 = (5, 9)(8, 9)(8, 4)(5, 4)
(6.343b)
we obtain E(Ga © Gp) = 12,
C(Ga®Gp)
=2
(6.344)
From Theorem 6.15, we conclude that Ga and Gp can be transformed into each other by a sequence of \ x 12 — 2 = 4 elementary (2,1) d-invariant transformations and no fewer than four such transformations are possible. One such sequence is shown below: (1,7) and (6, 3) by (1, 3) and (6, 7) (3,1) and (6,7) by (3, 7) and (6,1) (2, 5) and (6,1) by (2,1) and (6, 5) (5, 4) and (8, 9) by (5, 9) and (8, 4) In fact, Ga and Gp are also the (2,0)-digraphs. As a result, one can be transformed into the other by four elementary (2,0) d-invariant transformations. As mentioned in Section 6.5, the existence of a (p, s)-digraph also establishes the existence of a class of matrices called the (p, s)-matrices. Two (p, s)-matrices are said to be equivalent if and only if they have the same row and column sums. Then we have the following corollary.
COROLLARY 6.17 Let {M} be the set of (p, s)-matrices that are equivalent to a given (p, s)-matrix M. Then any two elements Ma and Mp of {M} can be transformed into each other by a sequence of \E(Ma - Mp) - C(Ma - Mp)
(6.345)
and no fewer (p, ^-interchanges [(/?, l)-interchanges if s = 0], where
6.7 MINIMAL TRANSFORMATIONS
479
E{Ma-Mp) denotes the sum of the absolute values of the integers in Ma- Mp, and C(Ma - Mp) is the maximum number of closed alternating edge trains in Ga®Gp, Ga and Gp being the associated (p, s)-digraphs of Ma and Mp, respectively. Clearly, the discussion on (p, s)-matrices can easily be extended to any matrix of bounded nonnegative integers with prescribed row and column sums by the addition of an appropriate number of rows or columns consisting only of zeros. For p = s = 1, (6.345) gives the minimal number of interchanges required to transform equivalent matrices of ones and zeros into each other, as given by Ryser (1957). Finally, for (p, s)-graphs, Theorem 6.15 becomes Corollary 6.18.
COROLLARY 6.18 Let {G} be the set of (p, s)-graphs that are d-invariant from a given (p, s)-graph G. Then any two elements Ga and Gp of {G} can be transformed into each other by a sequence of \E{Ga®Gp)-C(Ga®Gp)
(6.346)
and no fewer elementary (p, s) d-invariant transformations. We remark that in Corollary 6.18, the requirement that s be nonzero has been dropped. In Figs. 6.30 and 6.31 if we remove all the orientations or directions of the edges, we obtain two (2,0)-graphs Ga and Gp. The corresponding Ga © Gp is shown in Fig. 6.32, again with all orientations removed. Thus, from Corollary 6.18 we conclude that Ga and Gp can be transformed into each other by a sequence of four elementary (2,0) d-invariant transformations and no fewer than four are possible. Before we conclude this chapter, we justify an earlier assertion (Theorem 6.6) that any two (p, s)-digraphs G t and G2 of {G} can be transformed into each other by a finite sequence of elementary (p, s) d-invariant transformations. Let {Gi} be the set of all (p, s)-digraphs into which Gx is transformable by finite sequences of elementary (p, s) d-invariant transformations, and let {G2} be the corresponding set arising from G 2 . Let Gi and G 2 be the elements of {Gj} and {G 2 }, respectively, such that the distance between them is the minimum distance between the (p, s)-digraphs in { G J and {G 2 }. If G[ and G 2 are of zero distance or if G[ = G'2, we are finished. If p = 0 then all the elements of {G} are isomorphic. So let us assume that p ¥= 0, Gi¥=G2 and Gx and G 2 contain no isolated nodes and are of positive distance.
480
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
Since G[ © G'2=£0, there is a closed alternating edge train L of length 2k, k^2. If s ¥= 0 or if L is based on at least four distinct nodes, then by Lemmas 6.2 and 6.3 there is a (p, s)-digraph G" in {Gi} which is closer to G'2 than G[, violating our assumption on the minimality of the distance between G[ and G'z. Thus, s = 0 and any closed alternating edge train L of G[ © G'2 is based on exactly three distinct nodes. In other words, G[ © G2 consists of a set of node-disjoint closed alternating edge trains, each of which is based on exactly three distinct nodes. Without loss of generality, let L be one such edge train based on the distinct nodes ilt i2 and i3. Thus, L is composed of at least two directed circuits of length 3 oriented in opposite directions. If in G[ or G2 there exists a node /', which is distinct from ix (x = 1, 2, 3), such that, say, (il7 j) or (/, ix) is in G[ or G2 and \(iy, j)\ iy)\
= Gli
(6.347)
in which G, and G, +1 are related by an elementary (p, s) d-invariant transformation for i = 1, 2, . . . , k — 1. 6.8
SUMMARY AND SUGGESTED READING
We began this chapter by considering the subgraph problem of a directed graph. We applied the flow theorems to generalize Ore's results by presenting criteria for the existence of (p, s) subgraphs with preassigned bounds for their outgoing and incoming degrees. A special case of the problem is to find the necessary and sufficient conditions for the existence of a directed graph with prescribed outgoing and incoming degrees. In general, these conditions consists of 2" — 1 inequalities, n being the number of nodes of the directed graphs. However, they can be reduced to a set of n inequalities if the elements are properly ordered. In the cases of 1-digraphs and (1,0)-digraphs, the conditions can be stated in terms of the dual sequence and the modified dual sequence. More specifically, a sequence of nonnegative integer pairs [a,, bt] with monotone bt is (1,1) digraphic if and only if the sum of a, equals that of bt and the partial sums of the bt sequence are dominated by the corresponding partial sums of the dual sequence of
6.8 SUMMARY AND SUGGESTED READING
481
the a, sequence. Likewise, with proper ordering of the elements of a, and bh the sequence is (1,0) digraphic if and only if the sum of a, equals that of bt and the partial sums of the 6, sequence are dominated by the corresponding partial sums of the modified dual sequence of the a, sequence. By introducing the notions of a symmetric (p, s)-digraph and an elementary {p, s) d-invariant transformation, we showed that the criteria for the existence of a (p, s) subgraph with prescribed outgoing and incoming degrees in a given graph satisfying the odd-circuit condition can be deduced from those for the directed graphs. In particular, we discussed the realizability conditions of a sequence of n nonnegative integers to be the degree sequence of a (p, 0)-graph. As in the case for directed graphs, these conditions consist of 2" — 1 inequalities. They can be reduced to a set of n inequalities if the sequence is monotone. We showed that a monotone sequence is (1,0) graphical if and only if the partial sums of the sequence are dominated by those of its modified dual sequence. The existence of a (p, s)-digraph having prescribed bounds for its outgoing and incoming degrees also establishes the existence of a class of matrices known as the (p, s)-matrices. We demonstrated that arithmetic conditions for the existence of such a (p, s)-matrix can be deduced from those for directed graphs. In the case where the sum of the lower bounds equals that of the upper bounds, the problem becomes one of filling a matrix with the prescribed row sums and column sums. We also gave a more general theorem which states that if there is a matrix meeting the lower bound requirements for the row sums and the upper bound requirements for the column sums, and if there is a matrix satisfying the upper bounds for the row sums and the lower bounds for the column sums, then there is a matrix whose row and column sums lie between the designated limits. In addition, all elements are bounded above by specified numbers. Simple direct n -stage algorithms were presented for the construction of the 1-matrix and the (l,0)-matrix having preassigned bounds for their row sums and column sums. In the case where the sum of the lower bounds equals that of the upper bounds, the algorithms construct a desired matrix having prescribed row sums and column sums. Finally, we showed that any two (p, s)-digraphs having the same degree pairs are transformable into each other by a finite sequence of elementary (p, s) d-invariant transformations. Similar results can be stated for (p, s)matrices having the same row sums and column sums using the (p, s)interchanges. Formulas for determining the minimal number of such transformations or interchanges required to convert one into the other were given. For further study on the various aspects of the problems discussed in this chapter, the reader is referred to the original papers of Gale (1957), Ryser (1957), Fulkerson (1960) and Chen (1966, 1971, 1973, 1980). For other standard books on the subject matters, we refer to Ford and Fulkerson (1962) and Chen (1976).
482
APPLICATIONS OF FLOW THEOREMS TO SUBGRAPH PROBLEMS
REFERENCES Bauer, D. (1980), "Line-graphical degree sequences," J. Graph Theory, vol. 4, pp. 219-232. Berge, C. (1962), Theory of Graphs and its Applications, London, England: Methuen. Chen, W. K. (1966), "On the realization of a (p, ,s)-digraph with prescribed degrees," J. Franklin Inst., vol. 281, pp. 406-422. Chen, W. K. (1971), "On rf-invariant transformations of (p, s)-digraphs," J. Franklin Inst., vol. 291, pp. 89-100. Chen, W. K. (1973), "On equivalence of realizability conditions of a degree sequence," IEEE Trans. Circuit Theory, vol. CT-20, pp. 260-262. Chen, W. K. (1976), Applied Graph Theory: Graphs and Electrical Networks, Amsterdam, The Netherlands: North-Holland, 2nd revised edition. Chen, W. K. (1980), "Subgraphs and their degree sequences of a digraph," J. Franklin Inst., vol. 310, pp. 349-363. Eggleton, R. B. and Holton, D. A. (1979), "Graphic sequences," in Combinatorial Mathematics TV, Lecture Notes in Mathematics, vol. 748, pp. 1-10, New York: Springer. Erdos, P. and Gallai, T. (1960), "Grafok eloirt foku pontokkal," Mat. Lapok, vol. 11, pp. 264-274. Ford, L. R. Jr and Fulkerson, D. R. (1962), Flows in Networks, Princeton, N.J.: Princeton University Press. Fulkerson, D. R. (1959), "A network-flow feasibility theorem and combinatorial applications," Can. J. Math., vol. 11, pp. 440-451. Fulkerson, D. R. (1960), "Zero-one matrices with zero trace," Pacific J. Math., vol. 10, pp. 831-836. Fulkerson, D. R., Hoffman, A. J. and McAndrew, M. H. (1965), "Some properties of graphs with multiple edges," Can. J. Math., vol. 17, pp. 166-177. Fulkerson, D. R. and Ryser, H. J. (1961), "Widths and heights of (0, l)-matrices," Can. J. Math., vol. 13, pp. 239-255. Gale, D. (1957), "A theorem on flows in networks," Pacific J. Math., vol. 7, pp. 1073-1082. Gallai, T. (1950), "On factorization of graphs," Acta Math. Acad. Sci. Hungar., vol. 1, pp. 133-153. Haber, R. M. (1960), "Term rank of 0,1 matrices," Rend. Sem. Mat. Univ. Padova, vol. 30, pp. 24-51. Hakimi, S. L. (1962), "On realizability of a set of integers as degrees of the vertices of a linear graph I," / . Soc. Indust. Appl. Math., vol. 10, pp. 496-506. Hakimi, S. L. and Schmeichel, E. F. (1978), "Graphs and their degree sequences: A survey," in Theory and Applications of Graphs, Lecture Notes in Mathematics, vol. 642, pp. 225-235, New York: Springer. Hall, P., (1935), "On representatives of subsets," 7. Lond. Math. Soc, vol. 10, pp. 26-30.
REFERENCES
483
Havel, V. (1955), "Poznamka o existenci konecnych grafu," Casopis Pest. Mat., vol. 80, pp. 477-480. Konig, D. (1950), Theorie der endlichen und unendlichen Graphen, New York: Chelsea. Lan, J. L. and Chen, W. K. (1985), "On/-factors of a graph," J. Franklin Inst., vol. 320, pp. 55-62. Lovasz, L. (1970), "Subgraphs with prescribed valencies," / . Combinatorial Theory, Series B, vol. 8, pp. 391-416. Lovasz, L. (1974), "Valencies of graphs with 1-factors," Periodica Math. Hungar., vol. 5, pp. 149-151. Mahmoodian, E. (1977), "On factors of a graph," Can. J. Math., vol. 29, pp. 438-440. Ore, O. (1956a), "Studies in directed graphs I," Ann. Math., vol. 63, pp. 383-406. Ore, O. (19566), "Studies in directed graphs II," Ann. Math., vol. 64, pp. 142-153. Ore, O. (1957), "Graphs and subgraphs I," Trans. Amer. Math. Soc, vol. 84, pp. 109-136. Ore, O. (1958a), "Conditions for subgraphs of directed graphs," / . de Math., vol. 37, pp. 321-328. Ore, O. (1958b), "Studies in directed graphs III," Ann. Math., vol. 68, pp. 526-549. Ore, O. (1959), "Graphs and subgraphs II," Trans. Amer. Math. Soc, vol. 93, pp. 185-204. Rado, R. (1949), "Factorization of even graphs," Quart. J. Math., vol. 20, pp. 95-104. Ryser, H. J. (1957), "Combinatorial properties of matrices of zeros and ones," Can. J. Math., vol. 9, pp. 371-377. Ryser, H. J. (1958), "The term rank of a matrix," Can. J. Math., vol. 10, pp. 57-65. Ryser, H. J. (1960a), "Traces of matrices of zeros and ones," Can. J. Math., vol. 12, pp. 463-476. Ryser, H. J. (19606), "Matrices of zeros and ones," Bull. Amer. Math. Soc, vol. 66, pp. 442-464. Senior, J. K. (1951), "Partitions and their representative graphs," Amer. J. Math., vol. 73, pp. 663-689. Tutte, W. T. (1947), "The factorization of linear graphs," / . Lond. Math. Soc, vol. 22, pp. 107-111. Tutte, W. T. (1952), "The factors of graphs," Can. J. Math., vol. 4, pp. 314-328. Tutte, W. T. (1953), "The 1-factors of oriented graphs," Proc Amer. Math. Soc, vol. 4, pp. 922-931. Tutte, W. T. (1954), "A short proof of the factor theorem for finite graphs," Can. J. Math., vol. 6, pp. 347-352. Tutte, W. T. (1974), "Spanning subgraphs with specified valencies," Discrete Math., vol. 9, pp. 97-108.
7 SIGNAL-FLOW GRAPHS
The analysis of a linear system reduces ultimately to the solution of a system of simultaneous linear algebraic equations. As an alternative to conventional algebraic methods of solving the system, it is possible to obtain a solution by considering the properties of certain nets associated with the systems. The unknowns of the equations correspond to the nodes of the net, while the linear relations between them appear in the form of arcs connecting the nodes. The net approach is of particular interest in the analysis of engineering problems, linear problems especially, since the associated nets in many cases can be set up directly by inspection of the physical system without the necessity of first formulating the associated equations; it offers a visual structure upon which causal relationships among several variables may be laid out and compared. The basic idea of associating a net with a system of linear equations was first introduced by Mason (1953), and the net is called a signal-flow graph. The concept of a signal-flow graph was originally worked out by Shannon (1942) in dealing with analog computers. The greatest credit for the formulation and organization of signal-flow graphs is normally extended to Mason (1953, 1956). He showed how to use the signal-flow graph technique to solve some difficult electronic problems in a relatively simple manner. The term signal-flow graph was used because of its original application to electronic problems and the association with electronic signals and flowcharts of the systems under study. Since 1956, 484
7.1 THE SIGNAL-FLOW GRAPH
485
there has been considerable progress in formulating signal-flow graphs and broadening their applications to statistical, mechanical, hat transfer, pneumatic, microwave, and multiple-loop feedback systems. See, for example, Lorens (1964) and Riegle and Lin (1972). The present chapter is mainly concerned with the fundamental aspects of the problem, and not with specific applications of these nets to physical systems. Many examples of the applications of the signal-flow graph are to be found in Chow and Cassignol (1962), Robichaud, Boisvert and Robert (1962), and Truxal (1955). 7.1
THE SIGNAL-FLOW GRAPH
As mentioned in the beginning of Chapter 2, a weighted directed graph is called a directed network or simply a net. An electrical system, for example, may be modeled by a net, whose nodes denote the various states of the system and whose arcs represent all permissible transitions among the states. The weight associated with an arc is then the energy required in transformation. We denote by f(i,j) the weight associated with the arc (i,j) of a directed graph G. If Gs is a subgraph of G, by f(Gs) we mean
f(Gs)= n foj)
(71a)
0'J)EC,
if Gs *
7(0 = 0
(7.1b)
As an alternative, if the weights of G are from a field, the function / can be considered as a mapping function with domain in the set of all subgraphs of G and range in the field such that for each subgraph Gs of G, (7.1) holds. In other words, f(Gs) denotes the product of the weights associated with the arcs of Gs. The basic idea of the correspondence between the terms in the expansion of a determinant and the corresponding subgraphs in an associated net is not new. Konig (1916) was the first to apply a graph-theoretic approach to the evaluation of a determinant. Since then, it has been utilized for various purposes by many authors. See, for instances, Luce and Perry (1949), Kac and Ward (1952), Hohn and Schissler (1955), and Copi (1958). Our purpose here is to present a rigorous and systematic development of these correspondences based on the results of Chen (1967).
486
SIGNAL-FLOW GRAPHS
DEFINITION 7.1 Signal-Flow Graph. For a given square matrix M = [m,y] of order n, the signal-flow graph, denoted by the symbol G(M), is an n-node net. The nodes are labeled by the integers 1 to n such that if m,-,- * 0, there is an arc from node i to node j with associated weight m,-,- + <5y, for i,j= 1, 2, ..., n, where (7 2)
*Hi •
-
is the Kronecker delta. Sometimes, it is convenient to consider arcs that are not in G(M) as arcs with zero weight. The process of association described above shows how one goes from the matrix to the net G(M). The reverse process, to obtain the associated matrix M from a signal-flow graph G(M), is very simple and straightforward, and needs no further elaboration. The reason for this seemingly artificial association is that the resulting net is a more natural representation of a physical system. It presents a continual picture of the flow of signals through the physical system, and permits a physical evaluation and a heuristic proof of some basic theorems. More significantly, the signal-flow graph of a physical system, in many cases, can be drawn directly from the system diagram without the necessity of first setting up the equations in matrix form. To see this, consider the system of linear algebraic equations MX = F
(7.3)
where M = [m,-,-] is the coefficient matrix of order n and X and F are column vectors. The transposes of X and F are given by X' = [xl,x2,...,x„]
(7.4a)
F' = [fuf2,...,fn]
(7.4b)
Equation (7.3) may be written in a slightly different form as (Mu+Un+l)X
=X
(7.5)
where Mu is the augmented matrix obtained from M by attaching —F to the right of M and then attaching a row of zeros at the bottom of the resultant matrix, and the transpose of X is given by X =[xi , X"i,...,
Xn, Xn+\
]
(7.6)
7.1 THE SIGNAL-FLOW GRAPH
487
with xn+i = 1. Now, we can interpret the equations of the above system n
(m tt + \)xk - fkxn+i
+ £/%•*,• = xk
,7
7)
for k=l,2, ...,n as the flow of signals in G{M). Since the nodes of G(MU) are associated with the columns or rows of Mu, it is convenient to assign the variables xux2, • ••, x„+i to the nodes 1, 2, ..., n + 1 of G(MU), respectively. The associated weights xhx2, ...,*„+1 of the nodes may be considered as nodal signals xk. Then each equation gives the nodal signal as the algebraic sum of the signals entering via the incoming arcs. Each entering signal is the product of the arc weight and the signal at the node from which that arc originates, as depicted in Fig. 7.1. Since the signal at a given node is the sum of the incoming signals, the presence of outgoing arcs does not directly affect the signal at that node. Specifically, the flow of signals in G(MU) is to be interpreted as that shown in Fig. 7.2. This interpretation follows directly from the equations (7.7). The source-node signal xo = xn+i is considered as an independent variable in the algebraic equations and all other variables can be expressed in terms of the independent variable. Thus, the formulation is very convenient and intuitive for a large class of physical problems. This is why Mason's formulation is popular.
Fig. 7.1. A physical interpretation of equation (7.7).
488
SIGNAL-FLOW GRAPHS
-•O
x+y
xt
Fig. 7.2. A physical interpretation of the signal-flow graph.
We illustrate the above procedure by the following example. Example 7.1 Consider a feedback transistor amplifier and its equivalent network of Fig. 7.3. For illustrative purpose, its nodal equations are found to be ~ 8b
Gb+ gb ~8b
-Gb
8b+8e
+ 8c~Ol8e
-8c+a8e
~ Gb ~8c
Gb+8c+Gj
V
\Yl~ v2
=
v3
0
(7.8)
0
where Vh V2 and V3 are nodal voltage variables. The signal-flow graph G(M) associated with the coefficient matrix M is presented in Fig. 7.4. The augmented matrix Mu + U4 is obtained as (MU+U4)X l + Gb+8b ~8b -Gb 0
~8b
-Gb
l + 8b + ge + 8c-<X8e ~8c ~8c+oc8e l + Gb+gc+Gd 0 0
-h
[v,"
"Vi"
0 0 1
v2 v3 [l _
v2 v3 1 (7.9)
7.1 THE SIGNAL-FLOW GRAPH
Gb
U
n^ a, gb, gc, ge
Fig. 7.3(a). A transistor feedback amplifier.
Fig. 7.3(b). An equivalent network of the amplifier of Fig. 7.3(a).
489
490
SIGNAL-FLOW GRAPHS
1+Gfc+g*
Yi
-ch4 /
\
\-gb
~8b \
\
J /
~Gb
gc
gc+<Xge \+Gb+gc+Gd
\ j l+gb+ge+gc-Uge
Fig. 7.4. The associated signal-flow graph G(M).
7.2
TOPOLOGICAL EVALUATION OF DETERMINANTS
By graph determinant of a signal-flow graph G(M), denoted by det G(M), we mean the determinant of the matrix M. The rules for the evaluation of the graph determinant were first given and proved by Shannon (1942) using mathematical induction. His work remained essentially unknown even after Mason published his classical work in 1953. Three years later, Mason (1956) rediscovered the rules and proved them by considering the value of a determinant and how it changes as variables are added to the graph. Subsequently, a third proof was found by Lorens (1964) who showed the relationships between the signal-flow graph rules and the Cramer's rule for the solution of linear algebraic equations. However, the arguments that are followed in these derivations are heuristic, and sometimes quite devious. A formal proof was given by Ash (1959) and Nathan (1961) based on some simple properties of determinants, which can be correlated with a directed graph. In our derivation of the rules, it is convenient to consider signal-flow graphs having parallel arcs. If some of the arcs (i,j) of G(M) are replaced by the parallel arcs (i,j)x, x= 1, 2, ...,ktp (including the case where i-j)
7.2 TOPOLOGICAL EVALUATION OF DETERMINANTS
491
and such that /(«•,./) = £/(('•,./)*)
(7.10)
x=l
the resulting signal-flow graph has the same graph determinant. This simple manipulation is found to be very useful in proving many of the subsequent theorems, and we shall use it whenever convenient. DEFINITION 7.2 1-factor. A 1-factor of a directed graph G is a spanning subgraph of G, which is regular of degree 1. In general topological analysis of linear systems, 1-factors play a considerable role in various applications. More intuitively, a 1-factor is a set of node-disjoint directed circuits, which include all the nodes of G. Sometimes, a 1-factor is also referred to as a connection or a P-set of cycles in engineering literature. See, for example, Desoer (1960) and Seshu and Reed (1961). However, we prefer the above usage since the term 1-factor is more descriptive and was used long before the other terms like connection or P-set of cycles were coined [see, for example, Tutte (1953)]. For the signal-flow graph G(M) of Fig. 7.4, its six 1-factors are presented in Fig. 7.5. The first link between the determinant of M = [m,j] and the signal-flow graph G(M) is obtained by referring to the definition of a determinant: detM=
X
e
hh-jnmj1m2h...mnk
(7
n )
Ulh—jn)
v/herejij2...j„ is a permutation of 1, 2, ..., n; the summation is taken over all such permutations; andfc"/,7-2..._/„is 1 if jij2...jn is an even permutation and - 1 if jij2...j„is an odd permutation. THEOREM 7.1 Let G(M - Un) be the signal-flow graph associated with the matrix of order n. Then the determinant of M is given by
detM = (-l)"X(-D Lft /W
M-Un
(7.12)
h
where h is a 1-factor in G(M - Un) and Lh is the number of directed circuits in h.
492
SIGNAL-FLOW GRAPHS
l+Gb+gb
1+gb+ge+gc-age
\+Gb+gc+Gd
l+Gj+g*
far-
',
zr@
1 +gb+ge+gc-Uge
-gc-Wge
1+Gb+gc+G,
Fig. 7.5. The set of six 1-factors of the signal-flow graph G(M) of Fig. 7.4.
7.2 TOPOLOGICAL EVALUATION OF DETERMINANTS
493
Fig. 7.5 (Continued)
Proof. From (7.11) let mijlm2j2...mnja*0
(7.13)
for some permutation. Then the subgraph h of G(M - Un) corresponding to this non-vanishing term consists of the arcs (jh 1), (j2, 2), ..., and (jn, n). Since each integer k appears exactly twice in the sequence, once as a first element and once as a second element in some order pairs, it follows that the incoming and outgoing degrees of each node of h are 1. Thus, h is a spanning subgraph of G(M - Un) which is regular of degree 1, i.e., a 1-factor of G{M - Un). Conversely, for each 1-factor h of G(M - Un) there corresponds a unique non-vanishing term in (7.13). Thus, there exists a one-to-one correspondence between the non-vanishing terms in (7.13) and the 1-factors of G(M - Un). It remains to be shown that the sign of e hh-h c a n be determined by Lh. Let (ii,i2)u(i 2 ,i 3 )u...u(i/,ii)
(7.14)
be a directed circuit of length / in h. Set up a (2 x Z)-array as follows: In the first row, list the nodes in the order of ih i2, ..., if, and in the second, i2, h, ..., i/. Observe that (/ - 1) interchanges are sufficient to make the second row in the order of the first. Thus, if h has Lh directed circuits consisting of h,l2,-,lLh ar cs, a total of (h-V, + (l2-l) + ... + (lLh-l)
(7.15)
494
SIGNAL-FLOW GRAPHS
interchanges are sufficient to bring the column indices into the order of the row indices in the corresponding non-vanishing term f(h) of h. Consequently, the sign of the permutation is (-1) h+l2+...+lij,-Li,
_
f_]\n~Li<
(7.16)
which completes the proof of the theorem. The above result is really a variant of a well-known result in the theory of symmetric groups of degree n. It states that every permutation can be resolved into a family of disjoint "cycles", and this resolution is unique. (See, for example, MacLane and Birkhoff (1967)). The signal-flow graph G(M) of the coefficient matrix M of (7.8) is shown in Fig. 7.4. By Theorem 7.1, the determinant of the matrix M + U4 can be calculated by the formula
det(M+{/4)= (-l) 3 X(-!) L f t /W h
=
-(-\f(-Gb)(-gb)(-gc+age)-{-l)\-Gb){-gb){-gc) ~ ( - 1 ) ' (" 8c ) ( " gc+CCge )(l + Gb + gb )
-(-lf(-Gb)(-Gb){l
+ gb + ge + gc
-(-l?(-gb)(-gb)(l
+ Gb + gc + Gd)
-(-if(l
-age)
+ Gb + gb)(l + Gb + gc+Gd)(l + gb + ge + gc-ccge)
= Gbgb(- gc +age)-Gbgbgc
+ gc(- gc+age)(l + Gb + gb)
-G^(l + gb + ge + gc-age)-g^(l
+ Gb + gc + Gd)
+ (l + Gb + gb)(\ + Gb + gc+Gd)(l + gb + ge +
gc-age) (7.17)
where h is a 1-factor shown in Fig. 7.5, and Lh is the number of directed circuits in h. THEOREM 7.2 Let G(M) be the signal-flow graph of a square matrix M of order n. Then
detM = (-!)" l + X(-l) V /(C„v) «,v v>0
(7.18)
7.2 TOPOLOGICAL EVALUATION OF DETERMINANTS
495
where Cuv is the nth subgraph of v node-disjoint directed circuits in G(M). Proof. Let GX(M - Un) be the signal-flow graph of the matrix M - Un. It is clear that GX{M - Un) can be obtained from G(M) by simply adding a self-loop of weight - 1 to each node of G(M). Then Theorem 7.1 gives the determinant of M by
detM = (-l)"X(-i) L */(/0
(7.19)
h
where h is a 1-factor in G\{M - Un) and Lh is the number of directed circuits in h. If hy is the ith 1-factor in G\{M - Un) containing j added self-loops of weight —1, and if Qy is the subgraph obtained from hy with the j added self-loops removed, then (7.20)
fihtj) = (-WiQij) for j = 0, 1, ..., n - 1, and
(7.21)
My) = i-iy
for j = n. It follows that the totality of hy with appropriate signs is precisely the determinant of M: «-i
detM=(-ir£(-l)^/(^)=(-l)" <•;
i+XK-i^/fe,-) i 7=0
(7.22)
where LQ is the number of directed circuits in Qy. Since for each choice of Qy in G\{M - Un), there corresponds a unique subgraph C„v in G(Af) with v - LQ, and vice versa, the determinant of M can be evaluated by the subgraphs Cuv in G(M) rather than Qy in Gj(M - Un). Merely by rearranging the terms of (7.22), we obtain an alternative and better-known expansion:
d e t M = ( - l ) " l + X(-l)7(C„v)
(7.23)
«,v v>0
This completes the proof of the theorem. In linear system analysis, it is usually necessary to compute a symbolic system function, a function of the elements in literal rather than in
496
SIGNAL-FLOW GRAPHS
numerical form. For example, in the frequency domain analysis of an electrical network, the elements of a network matrix are usually rational functions in a complex variable s, being the ratios of polynomials in s. Although its determinant can be evaluated by the usual Gaussian-elimination or pivotal technique, the process is slow and complicated. The net approach provides an effective solution to the problem. However, its effectiveness depends upon the efficiency with which the subgraphs Cuv of G(M) are generated. Since, for a complicated signal-flow graph G(M), the number of terms expected in (7.18) is usually large, it is desirable to have a simple formula to determine this number in advance, so that no terms will be left out in the expansion. One way to achieve this is the following [see, for example, Chen (1965)]. For a given square matrix, there exists, in addition to the determinant of the matrix, also another less used quantity, the permanent of the matrix. The permanent of a square matrix M, denoted by per M, is defined exactly the same as the determinant of the matrix except that all the terms are taken with positive signs: perM=
£
m
\hm2h-mnh
(7.24)
For an n-node directed graph G, let C(G) = [Cjj] be the n X n connection matrix denoting the connection of G such that cy = k if and only if there are k arcs directed from node / to node j in G, and ctj = 0 otherwise. Thus, C{G) is a matrix of nonnegative integers. Now we show that the permanent of C(G) is equal to the number of subgraph Cuv in G(M).
COROLLARY 7.1 The number of terms in (7.18) is equal to the value of the permanent of the matrix C(G) + Un, where C(G) is the connection matrix of G(M). Proof. It is easy to verify that C(G) is the transpose of the matrix obtained from M by replacing each nonzero entries mtj of M = [mtj\ by 1. Since the permanent of a matrix is equal to the permanent of its transpose, each 1-factor of G(M - Vn) contributes a 1 in the summation of (7.12). Thus, the permanent of C(G) denotes the total number of 1-factors of G(M - £/„). Since for each 1-factor in G(M - Un), there corresponds a unique term in the summation of (7.18), the permanent of the matrix C(G) + Un gives the number of terms in (7.18). So the corollary is proved.
7.2 TOPOLOGICAL EVALUATION OF DETERMINANTS
497
As an example, consider the signal-flow graph G{M) of Fig. 7.4. Its connection matrix C(G(M)) is found to be 1 11 C(G(M)) = 1 1 1
(7.25)
1 11 If formula (7.18) is used to evaluate the determinant of M, the number of terms expected in the summation of (7.18) is simply the value of the permanent of the matrix C(G(M)) + U3 or "2 1 1" per[C(G(M)) + £/ 3 ]=per 1 2 1 = 8 + 1 + 1 + 2 + 2 + 2 = 1 6 1 1 2
(7.26)
In evaluating the determinant of the coefficient matrix M of (7.8) using formula (7.18),
M
Gb+gb
- gb
-Gb
~gb
gb + ge+gc-OCge
~gc
-Gb
-gc+age
(7.27)
Gb + gc+ Gd
we first list all 8 subgraphs Cuv of Fig. 7.4, each of which consists of one directed circuit: (1 + Gb + gb), (l+Gb + gc + Gd), (l+gb + ge + gc- ocge), (-Gb)(-Gb), (~gb) (-gbl (-gc)(-gc + age\ (~Gb)(-gb) (-gc + age), (-Gb)(-gb) (-gc) There are 6 subgraph Cuv, each of which consists of two node-disjoint directed circuits: (1 + Gb + gb)(\ +Gb + gc + Gd), (l + Gb + gc + Gd)(\ +gb + ge + gc- age), (\+Gb
+ gb)(l +gb + ge + gc- OCge), (-Gb)(-Gb)
(l+gb
+ ge + gc-
age),
(-gb)(-gb)(l +Gb + gc + Gd), (-gc)(-gc + age) (1 + Gb + gb) There is only one Cuv containing three node-disjoint directed circuits: (1 + Gb + gb)(l + Gb + gc + Gd){\ +gb + ge + gc- age)
498
SIGNAL-FLOW GRAPHS
Finally, the totality of these together with the appropriate signs is the determinant of M: detM = - 1 - [(1 + Gb + gb) + (\+Gb + gc + Gd) + (1 + gb + ge + gc - age) + (-Gb)(-Gb) + (-gb) (-gb) + (-gc)(-gc + age) + (-Gb)(-gb) x (-gc + age) + (-Gb)(-gb)(-gc)] + [(1 + Gb + gb)(l + Gb + gc + Gd) + (1 + Gb + gc + Gd)(l +gb + ge+gc- age) + (1 + Gb + gb) x(l+gb + ge + gc- age) + (-Gb)(-Gb)(\ +gb + ge + gc- age) + (-gb)(.-gb)(l + Gb + gc + Gd) + (-gc)(-gc + age)(l +Gb + gb)] - (1 + Gb + gb)(l +Gb + gc + Gd){\ +gb + ge + gc- age) = Gbgb(-gc + age) - Gbgbgc - Gb (gb + ge + gc- age) - gb(Gb + gc + Gd) + gc(-gc + age)(Gb + gb) + (Gb + gb)(Gb + gc + Gd)(gb + ge + gc- age) (7.28) This example brings out a very important point in that the signal-flow graph formula (7.18) suffers from unnecessary redundancies in the calculation of the determinants. However, in engineering analysis, there are some important advantages in using this, especially when we are considering systems in which physical feedback of some kind takes place. In such circumstances, the signal-flow graph approach can often provide a direct representation of the feedback process. [See, for example, Truxal (1955).] In addition, the number of feedback loops is usually small for most practical applications, and also the elements of the matrix are given in literal rather than in numerical form. In many situations, the elements of the matrix are usually given as rational functions in a complex variable s. 7.3
TOPOLOGICAL EVALUATION OF COFACTORS
The cofactor of an element of a matrix may be evaluated in a similar manner as the determinant. However, we shall need a definition for this. DEFINITION 7.3 1-factorial connection. A l-factorial connection from node i to node j of a directed graph G is a spanning subgraph of G which contains (1) a directed path from node / to node j ; (2) a set of node-disjoint directed circuits which include all the nodes of G except those contained in (1).
7.3 TOPOLOGICAL EVALUATION OF COFACTORS
499
-Gt,
l+Gb+gc+Gd
Fig. 7.6. The set of 1-factorial connections of signal-flow graph G{M) of Fig. 7.4.
A 1-factorial connection is also called a one-connection by Coates (1959). An example of a set of 1-factorial connections from node Vx node V2 in the signal-flow graph G{M) of Fig. 7.4 is presented in Fig. 7.6. THEOREM 7.3 Let G(M - Un) be the signal-flow graph associated with the matrix M -Un of order n. Then the cofactor Ay of the element my of the matrix M = [my] is given by 4,7 = ( - l ) " - 1 ^ - 1 ) ^ ' /(>*')
(7.29a)
ft'
(7.29b) H„
where /z' is a 1-factor in the signal-flow graph G(Mti - J7„_i); //y a 1-factorial connection from node i to node 7 in G(M - £/„); LA' and L//^ are the numbers of directed circuits in ti and Hy, respectively; and My is the matrix obtained from M by striking out the ith row and the 7'th column. Proof. We shall only prove (7.29b). Equation (3.29a) follows directly from Theorem 7.1. To prove (7.29b), we note that Ay is the determinant of matrix obtained from M by replacing the jth column of M by a column of zeros except for the element of the rth row, which is 1. Let the resulting matrix be denoted by Ma. In order to evaluate the determinant of Ma by topological means, we note that the signal-flow graph G(Ma - Un) may be
500
SIGNAL-FLOW GRAPHS
obtained from G(M - Un) simply by removing all the arcs having node j as their initial node including the self-loops at node j , if they exist, and then adding an arc directed from node j to node i with weight 1. From Theorem 7.1 we obtain
Aj =dctMa=(-\y2J(-l)L*f(ha)
= (-\y-1Jj(-l)L"«f(HiJ)
(7.30)
Hu
ha
where ha is a 1-factor in G(Ma - Un), and Lha is the number of directed circuits in ha. The last equality follows from the following argument: Since each ha in G(Ma - Un) must contain the added arc with weight 1, and since the removal of this arc from ha will not change the product of its arc weights, it follows that there exists a one-to-one correspondence between ha in G(Ma - Un) and Hy in G(M - Un) such that f{ha)=f{Htj)
(7.31)
Since the number of directed circuits in Hy is one less than that in ha, we have LHj. =Lha - 1 . This completes the proof of the theorem. The formula for the evaluation of the cofactors of the elements of a matrix M by means of certain subgraphs in the signal-flow graph G{M) can be derived in a manner similar to that of a determinant. THEOREM 7.4 Let G(M) be the signal-flow graph associated with the matrix M of order n > 1. Then the cofactor A^ of the element m^ of the matrix M = [m,-,] is given by
4f,-=(-D n-l
i+Z(-i) v /(C)
(7.32a)
v>0
Aj=(-Dn-lJ,f(Pi) l + X(-l)'/(££)
i*j
(7.32b)
t>0
where C'uv x& m e wth subgraph of v node-disjoint directed circuits in G(Muy, Pj- is the Ath directed path from node i to node j in G(M); D* is the 5th subgraph of t node-disjoint directed circuits which are also
7.3 TOPOLOGICAL EVALUATION OF COFACTORS 501
node-disjoint with P-- in G(M); and My is the submatrix obtained from M by striking out the /th row and y'th column. Proof. The first part of the theorem follows directly from (7.29a) of Theorem 7.3. The second part may be proved in a manner similar to that of Theorem 7.3, as follows. Let G(M - Un) be the signal-flow graph obtained from G(M) by inserting a self-loop of weight - 1 at each node of G(M). If H™ is the 5th 1-factorial connection from node / to node j in G(M - Un) containing x added self-loops of weight - 1 , and if W™ is the subgraph obtained from Hfx by removing the x added self-loops, then f(Hp = (-lYf(Wip
(7.33)
for x = 0, 1, ..., n-2. Thus, the totality of Hf* with appropriate signs is precisely the cofactor Aj^i-ir-^i-D^i-WfiWf),
i*j
(7.34)
s,x
where Lw is the number of directed circuits in Wyx. If Pyx is the directed path from i to j in W^x, and if Df? is the subgraph corresponding to the set of node-disjoint directed circuits of Wyx, then (7.34) can be rewritten as
L Ar=(-l)B-1S/(/F) 1+ X(-D »/(Df)
, i*j
(7.35)
X
L„*0
Since for each choice of P™ and Df in G(M - Un), there exist a unique corresponding directed path Pfi of P™ in G(M) and a unique corresponding set of node-disjoint directed circuits D*, of D-f in G{M) with t = Lw, and vice versa, it follows that the cofactor Ay can now be evaluated by the subgraphs P* and D*, of G(M) rather than the subgraphs Pyx and Dff of G{M - Un). Merely by substituting the proper terms in (7.35), we obtain the desired expansion (7.32b). This completes the proof of the theorem.
COROLLARY 7.2 The number of terms in the expansions (7.32) is equal to the value of the permanent of the matrix obtained from the connection matrix C(G(M)) + Un by striking out the v'th row and z'th column.
502
SIGNAL-FLOW GRAPHS
Thus, in Fig. 7.4, if formula (7.32b) is used to evaluate An, the number of terms expected in the expansion is simply the value of the permanent of the matrix obtained from that in (7.26) by striking out the 3 rd row and 1st column: 1 1 :l + 2 = 3 2 1
per
(7.36)
By Theorem 7.4 we obtain
43=(-D 3 - 1 I/(^ 3 ) i+X(-iy/(£>*,) s,t t>0
= (-Gb)[l-(l + gb + ge + gc -age)]+(-gb)(-gc = i-Gb) - (~Gb)(l + gb + 8e+gc-CCge) +
= Gb(gb + ge + gc -age)-gb(-gc
(7-37>
+age)[l]
(-gb)(-gc+age)
+age)
7.4 TOPOLOGICAL SOLUTIONS OF LINEAR ALGEBRAIC EQUATIONS The above results will now be applied to the solutions of a system of simultaneous linear algebraic equations (7.3), which is repeated below (7.38)
MX = F
where M = [m^] is the coefficient matrix of order n and X and F are column vectors. The transposes of X and F are given by X
-[Xi,*2>---»*n]
(7.39a)
F
=[/l>/2>
(7.39b)
•••,fn]
THEOREM 7.5 If the coefficient matrix M is nonsingular, the solution of the system of equations (7.38) is given by 2jf\P(,n+l)j
i+EW/te) s,t V
l + K-l) /(Cwv)
(7.40)
7.4 TOPOLOGICAL SOLUTIONS OF LINEAR ALGEBRAIC EQUATIONS
503
for j = 1, 2, ..., n; where P(kn+iy is the kth directed path from node n + 1 to node j in G(MU); D*, is the 5th subgraph containing t (t > 0) node-disjoint directed circuits which are also node-disjoint with Pfc+^j in G(MU); Mu is the augmented matrix obtained from M by attaching -F to the right of M, and then attaching a row of zeros at the bottom of the resultant matrix; and Cwv is the wth subgraph containing v (v > 0) node-disjoint directed circuits in G(MU). Proof. Since the coefficient matrix M is nonsingular, the solution of the system (7.38) is given by
detM
(7.41)
where Ay is the cofactor of m^ in det M. By interchanging the columns of Mu, if necessary, the numerator of (7.41) can be expressed in terms of the minor determinant of M„:
I/i4if = (-D(n+1)^-1(-l)det(Mu \\n+l)j
(7.42)
i=i
where det(M„)y is the determinant of the matrix obtained from M„ by striking out the rth row and the jth column. Appealing to Theorem 7.4 in conjunction with (7.42) we obtain
±fAj
=(-l)("+1)-^(-Ddet(M„)(„+1). =(-l)(«+1)^det(M„)(„+1).
i=i
:( _ 1) (« + .)-i£ / ( Ci) .)
l + I(-D'/fe) s,t I>0
= (-D"I/(P(tiw) i+l(-iy/te)
(7.43)
s,t
where t > 0 is implied in third line. From Theorem 7.2 we have
detA/ = (-l)" 1 + K-1)V/(C„V) v>0
(7.44)
504
SIGNAL-FLOW GRAPHS
Substituting (7.43) and (7.44) in (7.41), we obtain the desired result. This completes the proof of the theorem. A few comments at this point might be in order. Instead of considering the system (7.38), we may consider the equivalent system (7.5), which is repeated below (Mu+Un+l)X
=X
(7.45)
where the transpose of X is [x\,X2, ...,xn,xn+\\ with xn+1 = 1. Since the nodes of G(MU) are associated with the columns or rows of Mu, it is convenient to assign the variables xh x2, ..., xn, x0 to the nodes 1, 2, ..., n + 1 of G(MU), respectively. These variables may be considered as signals associated with its nodes. For convenience, we shall speak loosely of a node xk rather than of the node k associated with the node signal xk. The last node x0 = x„+1 is associated with the input variable x0 which is taken to be unity, and is referred to as the source node because in applications it corresponds to a source and there are no arcs terminating at it. The arc weights are also called transmittances. Sometimes, they are also called arc gains. In this chapter, arc weight and transmittance are used as synonyms. Recall that each equation of (7.7) gives the nodal signal as the algebraic sum of the signals entering via the incoming arcs. Each entering signal is the product of the arc transmittance and the signal at the node from which that arc originates. Thus, the solution (7.40) represents the signal at node j when the signal xn+\ at the last node n + 1 is taken to be unity. If xn+l is an arbitrarily chosen signal, the right-hand side of (7.40) denotes the ratio of Xj to xn+i in G(MU). The ratio is referred to as the graph transmission from node xn+\ to node Xj in G(MU). Formally, it is defined as DEFINITE 7.4 Graph transmission. Let G be an (n+l)-node signal-flow graph containing at least one source node x0 (a node with zero incoming degree). The graph transmission from node x0 to node x} (j = 1, 2, ..., n) in G is defined as the ratio
iMj) i+K-iy/fe) l + I(-l)V/(Qv)
(7.46)
where P£j is the kth directed path from node x0 to node Xj in G; D*f is the 5th subgraph containing t (t > 0) node-disjoint directed circuits
7.4 TOPOLOGICAL SOLUTIONS OF LINEAR ALGEBRAIC EQUATIONS
505
which are also node-disjoint with P0*, in G; and Cuv is the nth subgraph containing v (v > 0) non-disjoint directed circuits in G. In the above theorem, if G(M) is given, G(MU) can easily be obtained from G(M) simply by attaching a source node x0 = xn+i to G(M) such that if fk^O, there is an arc directed from the source node to node k with arc transmittance -fk. Strictly speaking, we should add a self-loop of transmittance 1 at the node xn+l. In practice, this is seldom done because the addition of a self-loop of transmittance 1 at the node xn+l is equivalent to adding a trivial equation xn+1 = JC„+1 to the system (7.38). Thus, it may be omitted from the graph without affecting its graph transmissions. Also, the omission would make the node xn+l a truly source node in the sense that it has zero incoming degree. We shall assume this for all G(MU). We emphasize that (7.46) is applicable only to the computation of the graph transmission from a source node to a non-source node. However, a signal-flow graph may possess several source nodes in evaluating its graph transmissions. Finally, we mention that in (7.40) the term P(kn+ly is also called a forward feedback loop, and its transmittance product a loop transmission. Since the term
i+K-iy/te)
(7.47)
is actually the graph determinant of the signal-flow graph obtained from G(MU) by the removal of all the nodes in Pkn+1y and all the arcs incident with this path, it is usually referred to as the cofactor of P(kn+i)j in G(MU). Example 7.2 Consider again the feedback transistor amplifier and its equivalent network of Fig. 7.3. For illustrative purpose, its nodal equations are found to be Gb + gb ~gb ~Gb
~gb gb+ge
+ gc-OCge
-gc+OCge
- Gb -gc Gb+gc+Gd
\Yl~
v2
[Vi_
'h = 0
(7.48)
0
where V\, V2 and V3 are nodal voltage variables. As indicated in (7.26), there will be sixteen terms in the denominator of (7.40). In
506
SIGNAL-FLOW GRAPHS order to reduce this n u m b e r , w e rewrite (7.48) in a slightly different form:
-1 8b 8b + 8e + Gb
8b
Gb
Gb + 8b
Gb + gb 8c
-1
r -/i Vi
v2 |_v3_
gb + 8e + gc-<X8e
8c-«8e gc~0C8e
Gb + 8c+ Gd
=
Gb + 8b 0 0
-1
Gb + 8c + Gd (7.49)
T h e signal-flow graph G{M) associated with the coefficient matrix M = [rriij] of (7.49) is s h o w n in Fig. 7.7. T h e a u g m e n t e d matrix Mu is found to b e
Mu =[/«(,] Gb 8b
Gb +gb
+8b
Gb+
i*
-1
8b+ge+8c-CC8e Gb Gb+gc
Gb
8b
-1
gb
0
gb+ge+8c-CC8e 8c~«8e
+Gd
Gb + gc+ 0
0
0
1 Gd
0
0
(7.50) T h e system (7.49) can b e rewritten in the form of (7.45):
0 8b
8b
Gb
Gb + 8b
Gb + gb gc
0
gb + ge + gc-age Gb
8c -age
Gb + 8c+Gd 0
Gb + 8c+Gd 0
1 Gb + 8b "Vi"
0
gb + 8e + 8c-CC8e
0
0
0
1
"Vi"
v2 v3
v2 v3
_/l_
./l.
(7.51)
7.4 TOPOLOGICAL SOLUTIONS OF LINEAR ALGEBRAIC EQUATIONS
507
Vi.
V(Gb+gb)
»121
mn . mi\
mn
mn
m32 Fig. 7.7. The signal-flow graph G(Af) of the coefficient matrix M of (7.49).
or V\ =
V2 H Gb + gb
V3 H Gb + gb
gb
Vo =
V, = ^
T/
1\ = m\2V2 + AM13V3 + m\$l\ Gb + gb
.
-v,+-
Gh n
Gb + gc + Gd
V, +
^ - ^
gc
-V3 = m2\V\ + mnV3
v2 s m 3 1 y , +
m32v2
Gb + gc+ Gd
(7.52) Thus, the first equation in (7.52) gives the nodal signal at node Vx as the algebraic sum of signals entering via the incoming arcs (V2, Vi), (V3, V'I) and (/1; Vi). Each entering signal is the product of the arc transmittance m12, m13 or m14 and the signal at the node V2, V3 or /j from which that arc originates. Likewise, the second equation gives the nodal signal at node V2 as the algebraic sum of signals entering via the incoming arcs (V h V2) and (V3, V2), and the third equation gives the nodal signal at node V3 as the algebraic sum of signals entering via the incoming arcs (Vu V3) and (V2, V3).
508
SIGNAL-FLOW GRAPHS
Suppose that we wish to compute the current-gain function of the amplifier, which is defined as l^l\ or GJVTJII. By Theorem 7.5, the graph transmission from /j to V3 is found from Fig. 7.7 to be ( 1 V, 1\
31 +
r 1 1 A
m21m32
1 - m\T,mT,\ - mi2m2i - m23m32 _ m\3m2\m32 — m-i\m23m\2 Gb +gb(gc-age) d\ \d33
2
d\ 1^22^33
Gl
gl
gc{gc-age)
^11^33
d\\d22
d22dtt
dud12dn
-d22Gl
d22Gb + -d33g^-dngc{gc
Gbgb(gc-age) di\d22d33
gb(gc-age) -age)-Gbgb{gc
Gbgcgb ^11^22^33
-age)-gcgbGb (7.53)
where dn = Gb + gb
(7.54a)
^22 = gb + ge+ gc ~ age
(7.54b)
d33 = Gb+gc+Gd
(7.54c)
We remark that the signal-flow graph obtained by rewriting the original system of equations in the form (7.49), in which all the diagonal elements of the coefficient matrix are - 1 , is termed as the normalized signal-flow graph of the original system by Hoskins (1961), since no self-loops will appear in it. Clearly, every signal-flow graph can be put in normal form. 7.5
EQUIVALENCE AND TRANSFORMATION
Once a signal-flow graph has been constructed, it is possible to write down a solution for the graph transmission from the source node to any other node quickly. However, it is usually advantageous to carry out some transformations and simplifications of the graph before applying the general formulas. There are a number of techniques available for this, each of which has its analogue in the conventional algebraic operations on systems of linear equations.
7.5 EQUIVALENCE AND TRANSFORMATION
7.5.1
509
Elimination of Nodes
A standard algebraic procedure for solving a system of linear equations for any set of variables as a function of some other set of variables is to reduce systematically the number of equations and the number of variables until a set of equations involving only the desired variables remains. To such a process in the algebraic procedure there corresponds a topological reduction process on the signal-flow graph such that the set of equations associated with the resultant signal-flow graph is that which results from applying the algebraic reduction process. In the following, we present a multiple-node removal algorithm for a signal-flow graph due to Chen (1964a, 1964b). Let Vm be a nonempty proper subset of the node set V of a signal-flow graph G{M). Let Gr be the reduced signal-flow graph obtained from G(M) by the following process: (i) Remove the sectional subgraph G[Vm] from G(M), i.e., remove all nodes and arcs incident with any node in Vm. (ii) The transmittance ttj associated with the arc (i, j) in Gr is given by
VA
(7.55) ) k
s,t
for all i and j in V - Vm\ where P» is the £th directed path from node / to node; in the sectional subgraph G[V%] with V% - Vm u{z',y'}; D^t is the 5th subgraph containing t (t > 0) node-disjoint directed circuits which are also node-disjoint with p]f in G[V%]; a is the number of nodes in Vj^; 5y is the Kronecker's delta; and K is the determinant of the sectional subgraph G[Vm], which can be evaluated by the formula
* = detG|yJ=(-iy» l + X(-DV/fc,v)
(7.56)
where C„v is the uth subgraph containing v (v > 0) node-disjoint directed circuits in G[Vm], and [5 is the number of nodes in Vm. When i = j , G[V% ] reduces to G[V^ ] and the kth directed path Ptf becomes a directed circuit containing the node i in G[Vm] by definition. The above process is easier to visualize than it is to describe in words. A simple physical interpretation of this process due to Chen (1969) will now be presented below.
510
SIGNAL-FLOW GRAPHS
For i & j , ty is the graph transmission from node i to node j in the directed graph G[V%] obtained from the sectional subgraph G[V%] by removing all the arcs terminating at node i and outgoing from node j . For i = j , it is necessary that we first split the node i in G\V„ ] into two distinct nodes i and i" such that all the arcs outgoing from i in G[Vm] now outgo from i, and all the arcs originally terminating at i now terminate at i". Then f„ is simply the graph transmission from node i to node i" in the resulting graph G[Vj,]. In other words, formula used to evaluate the transmittances t{j in the reduced signal-flow graph Gr is the same as the original graph-transmission formula (7.46) for G(M) except that it is now applied to the modified sectional subgraphs G\V„]. THEOREM 7.6 If K is nonzero, then (7.57)
det G(M) = K det Gr
Proof. Since a relabeling of the nodes of G(M) corresponds to simultaneous interchanges of the rows and the corresponding columns of M, without loss of generality we may assume that the matrix M can be partitioned in such a way that Mn corresponds to the node set Vm: Mn
M=
M12
(7.58)
M2i M22
where Mu and M 22 are square submatrices of order n ( and n — ti\, respectively. Since the sectional subgraph G[Vm] is the signal-flow graph G(MU) of the matrix Mn, this implies that Mn is nonsingular because by hypothesis K = G(Mn) is nonzero. It is straightforward to verify that the identities U„ -M2lM^1
0 (/„_„,
Mn
M12
M2i M22
Mn 0
M 12 2Mii-Mi 2-M2iM n-iwi2 XM7}Mx
detM = (detMi i )det(M22 - M2lM{\Mn
)
(7.59) (7.60)
hold. Let M
*=kto>]
(7.61)
7.5 EQUIVALENCE AND TRANSFORMATION
511
for k, t = 1, 2, where the subscripts i and j are the row and column indices; and M22 -M21MJM12
1 r~ =—[c„v] K
(7.62)
Aklhmkiv
(7.63)
Thus, we have -Kmuv
- 2^muk^ k,,k2
for u, v = 1, 2, ..., n - nu where Aklkl is the cofactor of the (k2, kx)element of Mn, and kx and k2 range from 1 to n\. By Theorem 7.4, we have
-(-Wi-l
4M. =(-D
l + X(-D v /(4v)
(7.64)
«,v v>0
forfci= k2, and
4i*=(-l) ,, - 1 Z/(ftfc)
l+Iny/^S)
(7.65)
»>0
for k{ ^ k2, where C„v is the uth subgraph containing v node-disjoint directed circuits in G[Vm -{&i}], Pkkk is the fcth directed path from node k2 to node k\ in G[Vm], and f)*t is the Jth subgraph containing t node-disjoint directed circuits which are also node-disjoint with P*k in G[V£'kl ]. Let i = u + nx and; = v + n\. Combining (7.63)-(7.65) yields
cuv = KfUJ)-J,f(kui) (-ir-'lfiPL) i+£(-i)'/(4*,) •fUM) kite
r>0
= KfU,i) + (-l)n> X l / f f t - O u P ^ u(;,*2l))+ l ( - D ' / ( ^ ) *1,*2
*
r>0
512
SIGNAL-FLOW GRAPHS
= Kf(j,i) + (-1)"1 X X f((j,ki) u Pkk2ki u (*,,i)) i+Ic-iy/c^) k
k\,k2
s,t l>0
=^/a,o+(-ir'S/(^) 1+ £(-!)'/(£*) (>0
= (-i)"/0\ 0 l + I(-D V /(C„v) «,v v>0
+(-l)"'+2I/fe) i+X(-i)'/(££) r>0
=(-i)or+**S/(^)
I+X(-D'/(5£)
(7.66)
SJ
/>0
The last line follows from the observation that all the terms containing the directed path P^ = f(j,i) correspond to the term on the fifth line, and the remaining terms containing all other directed paths correspond to the term on sixth line. Comparing (7.55) with (7.66) gives (7.67)
Kty — Cji
showing that Gr is the signal-flow graph associated with the matrix M22 -M 21 Mf 1 1 Mi 2 . From (7.60) we obtain (7.57). This completes the proof of the theorem. In particular, when Vm contains only a single node, the theorem reduces to that of Mason (1953). COROLLARY 7.3 If Wy is the transmittance associated with the arc (i, j) in the signal-flow graph G{M), and if w^ ^ 1, then detG(M) = (wkk-l)
detG r
(7.68)
7.5 EQUIVALENCE AND TRANSFORMATION
513
where Gr is obtained from G(M) by the following process: (i) Remove node k from G(M). (ii) The transmittance ty associated with the arc (i, j) in Gr is given by ty=Wy+-
WikWkj
(7.69)
The usefulness of Theorem 7.6 really lies in the following.
THEOREM 7.7 If Gr is the reduced signal-flow graph of G{M), and if K is nonzero and i * j , then
(-irX/(^) i+I(-D7(^) =KyLnfy)
i+X(-i)v/(4wv)
s,t
(7.70) for all i and j not in Vm; where Py and ^ j " are the kxh and wth directed paths from / to j in G(M) and Gr, respectively; Z)*, and D™v are the 5th and wth subgraphs containing t (t > 0) and v (v > 0) node-disjoint directed circuits which are also node-disjoint with Py in G{M) and Py in G„ respectively; and n\ is the number of nodes in Vm and K = det G[VJ. Proof. Let G be the signal-flow graph obtained from G(M) by deleting all the arcs having node j as their initial node, and all arcs having node i as their terminal node, and then adding an arc from node j to node i with transmittance 1. Also, let Gr be the reduced signal-flow graph obtained from G by the removal of the sectional subgraph G[vm] using the procedure outlined in (7.55). Then by Theorem 7.6 we have detG = ^ d e t G r
(7-71)
Observe that the matrix associated with the signal-flow graph G is the matrix obtained from M by setting all the elements in row i and column j to zero except the z'th row and jth column element, which is 1. Thus, the determinants of the matrices associated with G and Gr are equal to the cofactors of the (i, 7>element of the matrices associated with signal-flow
514
SIGNAL-FLOW GRAPHS
graphs G and Gn respectively. It follows from Theorem 7.4 that det G and det Gr can be evaluated by the subgraphs of G and Gr, respectively: detG = ( - l ) " - 1 X / ( ^ )
! + £(-!)'/(£>£)
(7.72)
s,t
detGr=(-ir-*-lJjf(Piy)
l + X(-l)v/(ATv)
(7.73)
Substituting these in (7.71) yields (7.70). This completes the proof of the theorem. THEOREM 7.8 The solution of the system (7.38) may be evaluated either in the signalflow graph G or its reduced signal-flow graph Gr for all variables not associated with the nodes in Vm. THEOREM 7.9 The graph transmission from a source node to a non-source node remains the same in both signal-flow graph G and its reduced signal-flow graph Gr for all nodes not in Vm. Example 7.3 Consider the signal-flow graph G of Fig. 7.9, which is associated with a transistor feedback amplifier of Fig. 7.8. Suppose that we wish to remove the nodes al\, V2 and I5 from G in order to construct a reduced signal-flow graph Gr, and then compute the graph transmission VyVg. The transmittance f7lv4 of the arc (/1; V4) in the reduced signal-flow graph Gr of Fig. 7.10 is simply the graph transmission from node Ix to node V4 in the signal-flow graph of Fig. 7.11. This transmittance together with others is given as follows:
aR4
(
*hv* - 1-
R5 sC2 As sC7
-CCRA
(7.74a)
7.5 EQUIVALENCE AND TRANSFORMATION
515
o/i
A/W-
JTYY\
AW ft
*
*0
ft < ^ V2 ^_ C2
ft /
V4
Fig. 7.8. A feedback transistor amplifier.
Fig. 7.9. A signal-flow graph of a feedback transistor amplifier of Fig. 7.8.
1 tv.i.
a *hh
=
(7.74b)
R\ + sLi
1 - 1 1 1 + /?3 SC2
/?3 5C2
1- J_ J-l_ R5
sC2
/? 3 + SC2R3R5
(7.74c)
516
SIGNAL-FLOW GRAPHS
Fig. 7.10. The reduced signal-flow graph of the signal-flow graph of Fig. 7.9.
Fig. 7.11. The signal-flow graph used to compute t,v_.
thi.
-1 -1 R5 sC2 Ri + sL\ 1 - 1 " ~ (/?! + sLx )(l + sC2R5) 1 R5 sC2
RA
thV,
1+sC2R5
' = R,
(7.74d)
(7.74e)
1+sC2R5
fy,/3
ft
1+-
5C 2 /? 5
1+
sC22 /? tt5
(7.74f)
7.5 EQUIVALENCE AND TRANSFORMATION
517
\lsC2
Fig. 7.12. The signal-flow graph used to calculate t,,.
The transmittance f/,/, for the self-loop (/j, /1) in Gr is simply the graph transmission from node l[ to node I" in the signal-flow graph shown in Fig. 7.12, and is found to be
thh
-1
-1
sC2
R\ + sL\ 1 ! R5
1
-1
5C2 ^1 + sL\ -1 sC2
/? 5 (a-D (Ri+sLl)(l
+ sC2R5)
(7.75a)
Likewise, we obtain 1
-1
#3 sC2 1
_
•
R5 R3{\ + sC2R5)
(7.75b)
R5 sC2 All other transmittances that are not specifically given above are zero. Finally, the graph transmission V4/Vg from node V^ to node V4 can be evaluated from the reduced signal-flow graph G> of Fig. 7.10, as follows: Y±= Vg
tVghthhtm+tVghtIlVi _
1 Viiit + thh +
^/i/3f/3/1
+
(1 - thh)
+ thvjv^h tiivjvththh )+ VuJhh
+
thhthvjvih ) (7.76)
518
SIGNAL-FLOW GRAPHS
Substituting the transmittances (7.74) and (7.75) in (7.76) yields the desired graph transmission V4__ R4R5+aR3R4{l + sC2R5) Vg " (/?! + sh)[R3 +R4+R5 + sC2R5(R3 +R4)]+ R5 fa + R3(l-a)] (7.77)
7.5.2
Inversion
Recall that the graph transmission is defined from a source node to any other node. However, in many applications, it is necessary to compute the graph transmission from a non-source to another, say, from x\ to x2. One way to accomplish this is simply first to compute the graph transmissions from the source node x0 to nodes X\ and x2, and then take the ratio. Another approach is to convert node x\ into a source node directly or to invert a directed path from node x0 to x{, and then to compute the needed graph transmissions. To invert an arc (x0, k) of transmittance tXok outgoing from a source node x0 to node & in a signal-flow graph G, we first move the set of arcs having their terminal node k to node x0 and move the initial node of the self-loop thus created at node xo to node k. Then we replace the transmittance t^ of the inverted arc (k, x0) in the resulting signal-flow graph by l/tXok, and multiply the transmittances of all other arcs whose terminal nodes have been moved by - 1 / tXok. To see this, consider the Ath equation of the system (7.5), as given in (7.7): n ("lick + l)Xk - fkXn+l + ZjmkjXj
= Xk
(7.78)
or n tkk*k +t()kx0 + ZjjkXj
= X
k
(7.79)
j*k
where tkk = mkk+\, t0k = -fk, x0 = xn+u and tjk = mkj, k*j. Equation (7.79) is pictured in Fig. 7.13(a), and can be rewritten as
1
x
^0* k tok
^v_ '*
+
.
X j=l~t0k j ~ j=l~tOk
ZJ
*o
The signal-flow graph for this equation is depicted Fig. 7.13(b).
(7.80)
7.5 EQUIVALENCE AND TRANSFORMATION
519
(a) The original signal-flow graph before the arc (XQ, xk) inversion.
(b) After the inversion of the arc (x0, xk) in (a). Fig. 7.13. A graphical description of arc inversion, where for simplicity txx = ttj for all i and j .
520
SIGNAL-FLOW GRAPHS
Another operation that is of considerable interest is the removal of a self-loop, so that the graph transmissions are not affected by this operation. This is accomplished as follows: For a signal-flow graph G, let fy =f(i,j) be the transmittance of the arc (i, j) for all i and j in G. If t^^ 1, the selfloop at node k can be removed simply by multiplying the transmittance of every arc which terminates at node k by the factor
To see this, we rearrange the terms of (7.79) by putting them into the form
\-t**
fa-t**i=xk
(7 82)
-
and the result follows. Example 7.4 Consider the signal-flow graph G of Fig. 7.14. Suppose that we wish to compute the graph transmission from node * 3 to node x6. In order to apply formula (7.46), it is necessary to convert node x3 into a source node. This can easily be accomplished as follows: To invert the arc (xi, x2), we move the arcs {x{, x2) and (JC3, X2) of transmittances a and -j to form new arcs (x2, x{) and (x3, x{) of transmittances \la and j/a, respectively, as depicted in Fig. 7.15. Now x2 becomes the source node. Next, to convert the node x3 to a source node, we invert the arc (x2, *3) in the signal-flow graph of Fig. 7.15. This is equivalent to moving the arcs (x2, x3), {x$, JC3) and (x^, JC3) of transmittances b, -k and -p to form new arcs (JC3, x2), (JC4, x2) and (x5, x2) of transmittances \lb, klb and plb, respectively, as indicated in Fig. 7.16. Node x3 in the resulting graph is now the source node. Thus, we can use this graph to compute the graph transmission from node JC3 to node x6 as follows: x
6 _
*3
— gh(l + dm)+ cde(\ + i)+ c — gh + cd — gh b b b 1 - -dm-en+—gh(-n)-\—gh(-n)(-m)-i b b J bcdeyl + i)+ gh(l + dm + ck + cdp) b(l + i + dm + en + idm + ien)-gh(kmn-np)
+\[-i)(-dm)+(-i)(-en)]
7.5 EQUIVALENCE AND TRANSFORMATION
521
Fig. 7.14. A signal-flow graph G used to illustrate arc inversion.
Fig. 7.15. The signal-flow graph obtained from G of Fig. 7.14 after inverting arc (xi, x2).
Fig. 7.16. The signal-flow graph obtained from that of Fig. 7.15 after inverting arc (x2, x^).
522
SIGNAL-FLOW GRAPHS
Likewise, if the graph transmission from node x-$ to node x4 is needed, we have
-gh{-n){-m)+c b
1- -i-en + gh(- «)— + ien
1- -dm-en-\—gh(-n)-\— gh{--n){-m)-i b V ' b
+ [(-i)(-dm)+(-i){-en)]
ghmn + bcyl + i + en + ien)+ cghnp b\i + i + dm + en + idm + ien)— ghykmn - np) 7.6
THE MATRIX INVERSION
Since each element in the inverse of a matrix is the ratio of the cofactor of an element of the matrix and its determinant, the signal-flow graph technique can be used to invert a nonsingular matrix. It is especially useful for large sparse matrices with elements given in literal rather than in numerical form such as frequently occur in engineering problems. Recall that the graph transmission is defined in terms of the ratio of a dependent variable and an independent variable called the source node for a signal-flow graph associated with a system of linear algebraic equations. In this section, we shall extend this idea to signal-flow graph associated with any matrix and then show how it can be used to invert a matrix. Let M be a square matrix. Let Gx. (M) be the signal-flow graph obtained from the signal-flow graph G{M) by attaching a source node x0 to G{M), and then by adding an arc with transmittance - 1 from node x0 to node JC, in the resulting graph. With this simple alteration of G(M), the following results are obvious. COROLLARY 7.4 Let M be a nonsingular matrix. Then the (i, y')-element of the inverse of M is simply the graph transmission from node x0 to node xj in GXi (M'), where the prime denotes the matrix transpose. COROLLARY 7.5 Let G> be the reduced signal-flow graph obtained from GXi{M') by the removal of the node set Vm by the processes outlined in Section 7.5.1. If the source node x0 is not in Vm, then the (/, j)-element of the inverse of M is simply the graph transmission from node x0 to node Xj in Gr for all j (^ x0) not in Vm.
7.6 THE MATRIX INVERSION
523
Example 7.5 Let us compute the inverse of the matrix 0 0
b 0
k
0
0
J
0
d
e
0
0
0 0
0 0
c 0
0 i
0 0
0 0
0 h
0 0
a
0
0
0
0
0
0 0
0 0
0 0
0 0
8 0
f
0 0 0
The associated signal-flow graph G(M') is presented in Fig. 7.17. Write M-l = [bij\, i,y = 1 , 2 , . . . , 7
(7.86)
Fig. 7.17. The associated signal-flow graph G(M').
To evaluate the elements, say, by, j= 1, 2, ..., 7, we construct the signal-flow graph GXl (M') by attaching a source node x0 to G(M') and then by adding an arc with transmittance - 1 from node xQ to node x\. The resulting graph GXl(M') is shown in Fig. 7.18. To compute the elements by (j = 1, 2, ..., 7), we evaluate the graph transmissions from x0 to Xj in GXl (M') and obtain
524
SIGNAL-FLOW GRAPHS
Fig. 7.18. The associated signal-flow graph Gx (M').
6ii =
_ A — •*2z — »12
—
*i-;(-l)(l-ft-<&)_ *o An
^ e ( l ) — ^ e U ~~ h)-bcje(l — h)_
B Am [(bi + bcj)A + kg]e
(7.87a)
(7.87b)
XQ
XT, _ b\3= — =
- bc(l - h - efg) _ bcB
(7.87c)
XQ
, x4 -kg-bi(l-h)-bcj(\.-h) bu = — XQ =
kg + b(i + cj)A =
blD = *5 =-b(l-h~efs)= *o Am
bn
k + bief+bcjef
XQ
An
x-i _ -bcd(l-h-efg) XQ
bB Am
x6
mt = — =
(7.87d)
_
(7.87e)
(7.87f) bcdB
(7.87g)
7.7 FEEDBACK AMPLIFIER THEORY
where A = l-h, B-l-h-efg
525
and
Am - -det M -1 - h - efg - abed + abedh + abedefg
(7.88)
Likewise, we can write down all other elements of the inverse M _1 of the matrix M as shown below: -1 M"' = — x
4. kg+b(i + cj)A bB k+bief+bejef bcdB [{bi + bcj)A + kg}e bcB fg{\-abcd) 0 f (I-abed) 0 0 0 (1 - abed)A daB (j + dabi)eA + dakge B (j + dabi)A + dakg dabB dak+ (j + dabi)ef dB (l-abcd)A 0 ef(l-abcd) 0 0 e(l -abed)A 0 (i + cj)A + cdakg B cdak + (i + cj)ef cdB cdaB (i + cj)eA + cdakge cB 0 g{\-abcd) 0 \-abcd 0 0 ge(l — abed) aB akge + ab(i + cj)eA abcE akg +ab(i + cj)A abB ak + ab(i + cj)ef B B
(7.89) 7.7 SIGNAL-FLOW GRAPH FORMULATION OF FEEDBACK AMPLIFIER THEORY In the present section, we demonstrate that the feedback amplifier theory can be formulated in terms of a signal-flow graph representing the signal transmissions among the various ports. One of the advantages of this approach is that it can easily be generalized to multiple-loop feedback networks. 7.7.1
Ideal Feedback Model
A feedback amplifier is a network in which some variable, either the output variable or any other controllable one, is fed back as the input variable to some part of the network in such a way that it is able to affect its own value. The simplest form of a feedback amplifier can be represented by the ideal block diagram of Fig. 7.19, in which /i(s) represents the transfer function of the unilateral forward path and is conventionally called the open-loop transfer function or forward amplifier gain, defined by the relation
rt.)-^u(s)
_y(s)
„ „ "«<(') Uf(s)=Q
, v
'
(7 90)
-
526
SIGNAL-FLOW GRAPHS
Oyis)
Uf(s)
Pis) Fig. 7.19. The block diagram of the ideal feedback model.
where y(s), w,(s) and u,f(s) denote either the current and/or voltage variables, and p\s) is the transfer function of a unilateral feedback path and is defined as
P(s) = M/O)
(7.91)
Thus, in this highly idealized model, none of the input signal is transmitted through the feedback path and none of the output signal is transmitted in the reverse direction through the forward path. Also, the presence of the ideal adder in the model indicates that there is no loading effect at the input. In other words, the transmission of signal is permitted only in the direction of the arrows as indicated in the block diagram of Fig. 7.19. Under these assumptions, the overall transfer function w(s) of the amplifier is found to be w(s) =
y(s) _ u(s)
n(s) l-ju(*)0(*)
(7.92)
which is referred to as the closed-loop transfer function. In terms of logarithms, we have (7.93) whose jco-axis real parts are related by ln|w( jco)\ = ln\n( jco)\ - ln|l - n(jco)/i(ja)\
(7.94)
Observe that in the application of feedback, the open-loop transfer function is modified by the factor l-/j.(s)P(s). This factor \-n(s)P(s) is referred
7.7 FEEDBACK AMPLIFIER THEORY
527
to as the feedback factor. At a specified frequency on the real-frequency axis, if its magnitude is greater than unity, we have negative or degenerative feedback, and if it is smaller than unity, we have positive or regenerative feedback. From (7.94) we see that negative feedback reduces the forward amplifier gain by the amount of feedback ln|l-^(ftj)/3(co)| measured in nepers, or 201n|l —/X(GJ))3(GJ)| measured in decibels. In exchange, it can be shown that the gain becomes less sensitive to the variations of the parameters, the effects of noise and nonlinear distortion are usually reduced, and the transmission and driving-point characteristics are modified, all by the feedback factor ln|l-^(G>)/J(o>)|. On the other hand, the positive feedback increases the forward amplifier gain, the sensitivity, and the effects of noise and nonlinear distortion all by the factor ln|l -/i(co)P(co)\, and is therefore seldom used in amplifier design. Nevertheless, it is useful in the design of oscillator circuits. Finally, under the condition l-H((o)P(co) = 0
(7.95)
a feedback amplifier will function as an oscillator. This condition is known as the Barkhausen criterion, which states that the frequency of a sinusoidal oscillator is determined by the condition that the phase shift of fi(j(o)p(jo)) is zero, provided that the magnitude of n(jco)P(ja>) equals unity. The factor /j.(s)P(s) is often called the loop transmission and can be interpreted physically as follows: Suppose that no input excitation is applied to the amplifier and that the input side of the unilateral forward path is broken, as depicted in Fig. 7.20, with a unit input applied to the right of the break. Then the signal appearing at the left of the break is precisely H(s)p(s).
+
p(s) Fig. 7.20. The physical interpretation of the loop transmission.
528
SIGNAL-FLOW GRAPHS
To employ the ideal feedback model to analyze a practical feedback amplifier, it becomes necessary to separate the feedback amplifier into two blocks: the basic unilateral amplifier fi(s) and the feedback network P(s). The procedure is difficult and sometimes virtually impossible, because the forward path may not be strictly unilateral, the feedback path is usually bilateral, and the input and output coupling networks are often complicated. Thus, the ideal feedback model of Fig. 7.19 is not an adequate representation of a practical feedback amplifier. 7.7.2
Signal-Flow Graph Formulation of Single-Loop Feedback Amplifier Theory
In the study of a feedback amplifier, we usually single out an element for particular attention. The element is generally one that is either crucial in terms of its effect on the entire system or of primary concern to the designer. The element may be the transfer function of an active device, the gain of an amplifier, or the immittance of a one-port network. For our purpose, we assume that the element x of interest is the controlling parameter of a voltage-controlled current source defined by the relation I = xV
(7.96)
To focus our attention on the element x, the controlled source is brought out as a two-port network connected to a general four-port network, as depicted in Fig. 7.21, along with the input source combination of Is and Y{ and the load admittance Y2.
•® • * Fig. 7.21. The general configuration of a feedback amplifier.
7.7 FEEDBACK AMPLIFIER THEORY
+0 v Q-
o
o
dO
^Q
'I _6a
Ob
529
/'2
•
•<S> U ot 1
Fig. 7.22. The four-port network in the general feedback configuration of Fig. 7.21.
We remark that the two-port representation of a controlled source (7.96) is quite general. It includes as a special case of a one-port element characterized by its immittance. In (7.96) if the controlling voltage V is the terminal voltage of the controlled current source /, then x represents the one-port admittance. Also, the consideration of voltage-controlled current source should not be deemed to be restrictive, because the other three types of controlled sources (current-controlled current source, voltagecontrolled voltage source, and current-controlled voltage source) can usually be converted to the above type by a simple transformation and by appealing to Norton's theorem if necessary. The element x can either be the transconductances or more generally a transfer admittance function, depending on the type of equivalent circuit being used. Consider the four-port network in the general feedback configuration of Fig. 7.21, which is redrawn in Fig. 7.22. Since the network is linear, the port current I'2 and voltage V can be expressed in terms of the port currents /, and / as follows: 12
=tnls+tnI
V
=t2lIs+t22I
(7.97)
where the transmittances ttj (i, j = 1,2) are all independent of the controlling parameter x. However, the port current / and voltage V are not independent, and as indicated in Fig. 7.21, they are related by the equation I = xV
(7.98)
530
SIGNAL-FLOW GRAPHS
Fig. 7.23. The fundamental feedback-flow graph.
Fig. 7.24. The signal-flow graph interpretation of return ratio.
Equations (7.97) and (7.98) may be represented by the signal-flow graph of Fig. 7.23, which is known as the fundamental feedback-flow graph. Suppose that in Fig. 7.23 we break the branch with transmittance x, as illustrated in Fig. 7.24. Then the return ratio T for the element x is defined as the negative of the signal returned to the left of the breaking mark when a unit signal is applied to the right of the breaking mark and when the input excitation is set to zero. This gives T = -xt22
(7.99)
7.7 FEEDBACK AMPLIFIER THEORY
531
If we set 4 = 0 and / = x in the second equation of (7.97), we find that V - xt22- This means that the return ratio T is equal to the negative of the voltage V appearing across the controlling branch of the controlled current source / = xV of the feedback amplifier when the controlled current source is replaced by an independent current source of x amperes and when the input excitation Is is set to zero. The return difference F(x) is defined as the difference between the unit signal input and the returned signal xt22 under the situation that the input excitation to the amplifier is set to zero: F(x) = l-xt22=l
+T
(7.100)
The above interpretation shows that return ratio T has the same physical significance as the loop transmission n(s)P(s), and that the return difference F(x) has the same significance as the feedback factor in the ideal feedback model. Example 7.6 We wish to compute the feedback quantities of the feedback amplifier of Fig. 7.25 by means of the signal-flow graph technique discussed above. The transmittances ty must first be determined. For this we replace the controlled current source hfeIb in the network of Fig. 7.25 by an independent current source / as depicted in Fig. 7.26. From (7.97), the transmittances ty are found to be
'ii = /=0
G2Gf (G2+Gf)(Gl+\/hie)+G2Gf
(7 101a)
-
G2 + Gf '21
t n -- T
/=0"
h
h=o
V h2 - — 7,=0
{G2 +
Gf)(G1+Vhie)+G2GJ
G2(Gf+Gl+l/hfe) ' (G2 + Gf )(Gi +Vhie)+ G2Gf
'{G2+Gf)(Gl+l/hie)+G2Gf
(7.101b)
(7 101c)
-
< 7 - 101d )
532
SIGNAL-FLOW GRAPHS
Fig. 7.25. An equivalent network of a common-emitter feedback amplifier.
Gf
® '
Gi+l/fe
®
G2
Fig. 7.26. The network used to compute the transmittances ty.
Substituting (7.101) in (7.100) with x-a difference with respect to a as
F ( a ) = 1-0*22=1 +
= hfelhie yields the return
aG f {G2 + Gf)(Gl+\/hie)+G2Gf
< 7 - 102 )
Another important concept known as the null return difference is found to be very useful in measurement situations and in the computation of the sensitivity for the feedback amplifiers. As in the case of return difference, the null return difference is simply the return difference in the network under the constraint that the input excitation has been adjusted so that the output is identically zero. For this we introduce the notion of null return ratio.
7.7 FEEDBACK AMPLIFIER THEORY
533
Refer again to Fig. 7.24. A unit signal is applied to the right of the breaking mark. Now we adjust the current source Is so that the output current I2 is reduced to zero. This requires that jcfo + Ish\ = 0, giving the required Is = -xti2/hi. The corresponding value of the returned signal to the left of the breaking mark becomes x
V = xt22
t\2t2\ ^ t\\
(7.103)
The null return ratio T with respect to a voltage-controlled current source / = xV is defined as the negative of the voltage appearing at the controlling branch when the controlled current source is replaced by an independent current source of x amperes and when the input excitation is adjusted so that the output of the amplifier is identically zero. Thus, we have "
Xt\2t2\
T = -V = -xt22 +
(7.104)
Like the return difference, the null return difference F(x) is simply the difference of the 1-V excitation applied to the right of the breaking mark of the broken controlling branch of the controlled source and the returned voltage V appearing at the left of the breaking mark under the situation that the input signal Is is adjusted so that the output is identically zero. In terms of the null return ratio, we have F(jc) = l - V = l + f = l - J t f 2 2 + i ^ L
(7.105)
hi
Combining this with (7.100) yields F(x) = F(x) +
(7.106) t\i
From Fig. 7.23, the current gain I2/Is is found to be . s
„„=
II
t\lXt2\
,11+__^
(7.107)
534
SIGNAL-FLOW GRAPHS
By applying (7.100) and (7.106) in (7.107), the current gain can be written in the form F(x) w(x) = w(0)—-
(7.108)
In Example 7.6, substituting (7.101) in (7.105) results in the null return difference with respect to the element a: F(a) = \-at22+
——
=1-—
(7.109)
the second term on the right-hand side of (7.109) is the null return ratio T. 7.7.3
Noise and Feedback
In the foregoing, we mentioned that feedback can be used to control the driving-point and transmission characteristics of an amplifier and can be employed to make an amplifier less sensitive to the variation of its parameters caused by aging, temperature change, or other environmental changes. In this section, we indicate that, in some cases, negative feedback can be used to reduce the effect of noise and nonlinear distortion generated within an amplifier. To demonstrate this effect, consider an amplifier composed of three internal amplifying stages without feedback represented by the signal-flow graph of Fig. 7.27, in which the extraneous signals xx and x2 represent noise or nonlinear distortion introduced at some arbitrary points within the amplifier. The output signal xL in terms of the input signal xs and the disturbing signals JCJ and x2 is xi = Hifi2^xs + /i2j"3*i + n3x2
(7.110)
The output signal-to-noise ratio in the absence of feedback is therefore given by W
W
'
C7.111)
Now, if a simple feedback loop is added as shown in Fig. 7.28, the output signal becomes X[ =
UlU2l^3Xs + fU^2UT,XI WM2W 3 1 + U3X2
7.7 FEEDBACK AMPLIFIER THEORY
xi
535
xi
0—s—d^^-i—e—0 Fig. 7.27. The signal-flow graph representing an amplifier composed of three internal amplifying stages without feedback.
x\
x%
P Fig. 7.28. The signal-flow graph representing an amplifier composed of three internal amplifying stages with feedback.
It is easy to check that the output signal-to-noise ratio with feedback is the same as that without feedback. Thus, feedback has no direct effect in improving the output signal-to-noise ratio. However, it does help indirectly. To see this, we observe from (7.112) that the effect of negative feedback on the output signal is the reduction of both signal and noise by a factor of (}-fii/j.2fi3P). If the input signal xs is increased so that the output signal remains at the same level as it had before the application of feedback, we see that the net effect at the output will be the reduction of the contribution of the extraneous signals x{ and x2 by the same factor (l-^i/i2M3^)- In other words, if the output of the amplifier is maintained constant with and without negative feedback, the effect of negative feedback increases the signal-to-noise ratio by the factor ( l - ^ i / ^ ^ / ? ) • Clearly this improvement is possible only if the extraneous signals are generated within the amplifier. The increase of input signal xs to the amplifier without feedback is impractical, because such an increase may cause excessive distortion due to nonlinearity.
536
SIGNAL-FLOW GRAPHS
For |l-^ 1 /i 2 i"3i3|»l, (7.112) reduces to
showing that the contribution of the extraneous signal x2 at the output has been reduced by a factor HxHiP, whereas that of x\ is reduced by Mi/* and that of xs by P. Therefore, the magnitude of the reduction depends largely on the origin of the extraneous signals. It is reasonable to assume that the extraneous signals are generated in the final stage, because nonlinear distortion increases with the level of the output signal. 7.8
MATRIX SIGNAL-FLOW GRAPH
As demonstrated in the foregoing, the feedback amplifier theory can be formulated equivalently in terms of a signal-flow graph representing the signal transmission among the various ports. To formulate the multipleloop feedback amplifier theory, we need the matrix version of the scalar signal-flow graph. In this section, we study the matrix signal-flow graph and present some of its properties. A scalar signal-flow graph is a graphic representation of a system of linear algebraic equations put into the form n
^mijXj=Xi,
(i = l,2,...,n)
(7.114)
7=0
where JCO is the only excitation source and xt are the dependent variables. The scalar signal-flow graph associated with the system (7.114) is a weighted directed graph or net in which the nodes correspond to the dependent variables xt and the independent variable x0 and the weights to the transmittances my. The construction of the associated scalar signalflow graph was shown in Fig. 7.1 for fcth equation of (7.7), and is repeated in Fig. 7.29 for the ith equation. As before, the graph transmission w0k from JC0 to xk is defined by the equation xk = w0kx0, and can be evaluated by inspection of the directed circuits and paths of the graph. In a similar fashion, a matrix signal-flow graph is a net representation of a system of linear algebraic matrix equation, which is put into the form n
^MijXj
= Xi, (i = l,2,...,«)
(7.115)
where X0 is the only source vector and Xt are the dependent vectors. The nodes of the net correspond to the independent vector X0 and the dependent
7.8 MATRIX SIGNAL-FLOW GRAPH
537
Fig. 7.29. The scalar signal-flow graph for the ith equation of (7.114).
Fig. 7.30. The matrix signal-flow graph for the j'th equation of (7.115).
vectors Xt and the weights of the arcs to the matrices My. To each node Xh there corresponds a matrix equation in (7.115). The construction of the associated matrix signal-flow graph is as illustrated in Fig. 7.30 for the ith equation in (7.115). The graph transmission W0k from the source node XQ to the output node Xk in the associated matrix signal-flow graph is defined by the matrix equation Xk- W0kX0
(7.116)
538
SIGNAL-FLOW GRAPHS
Fig. 7.31. The matrix signal-flow graph associated with the system (7.117).
We remark that in general Mason's gain formula cannot be utilized to obtain the graph transmission Wok. As an example of a matrix signal-flow graph, consider the following system of linear matrix equations: Xl=AX2 + BX0
(7.117a)
X3 = CX2 + DX0
(7.117b)
X2 = EXX
(7.117c)
The associated matrix signal-flow graph is presented in Fig. 7.31. One way to compute the graph transmission is to apply the basic reduction rules repeatedly until it can be written down directly by inspection. A direct approach is to develop a topological procedure to obtain the graph transmission without graph reduction. The best approach is probably a combination of both, so that the problem at hand can be solved in the most satisfying manner. In the following, we shall describe these two approaches. 7.8.1
Basic Reduction Rules
The basic reduction rules for a matrix signal-flow graph are given below. 1. Series reduction. As indicated in Fig. 7.32(a), the arcs with transmittances My and Mjk are replaced by a single arc with transmittance MijMjk. 2. Parallel reduction. As indicated in Fig. 7.32(b), the arcs with transmittances My and Ntj are replaced by a single arc with transmittance Mtj + Ntj.
7.8 MATRIX SIGNAL-FLOW GRAPH
539
(a)
(b) Fig. 7.32. The basic signal-flow graph reduction rules, (a) Series reduction and (b) parallel reduction.
3. Removal of a self-loop. The removal of a self-loop with transmittance Mu at node Xt is equivalent to replacing the transmittance M{j of the arcs directed from nodes Xj (where j * i;j - 0,1,2,..., n) to node Xt by ((J-Mu)~lMjj, where U, as before, denotes the identity matrix of appropriate order. To justify this operation, we observe that the rth equation of (7.115) can be rewritten as f,(U-MaY1MijXj
= Xi
(7.118)
7=0 j*i
and the result follows. The procedure is illustrated in Fig. 7.33. 4. Absorption of a node. To absorb a node Xk, we replace the transmittances My of the arcs directed from Xj to Xt by Mtj =Mij +Mik{U-Mkk)-lMkj
(7.119)
for all / and; (i,j^k). The operation is depicted in Fig. 7.34, and is equivalent to eliminating the vector Xk in (7.115). To see this, we replace / by k in (7.118) and substitute the resulting equation for Xk in (7.115), obtaining n
_
^MijXj=Xi >=o
(7.120)
The operations described in Fig. 7.34 follow directly from (7.120).
540
SIGNAL-FLOW GRAPHS
(a)
(b) Fig. 7.33. The removal of a self-loop in a matrix signal-flow graph, (a) Before the removal and (b) after the removal.
As an illustration, we compute the graph transmission from node X0 to node X3 in the matrix flow graph of Fig. 7.31. To this end, we first remove node X2 by the procedure outlined in Fig. 7.34; the resulting matrix flow graph is presented in Fig. 7.35(a). Repeating the process once more by
7.8 MATRIX SIGNAL-FLOW GRAPH
541
(a)
(b) Fig. 734. The absorption of a node in a matrix signal-flow graph, (a) Before the absorption and (b) after the absorption.
removing node X\ in Fig. 7.35(a) yields the reduced matrix signal-flow graph of Fig. 7.35(b). The graph transmission from X0 to Z 3 is found to be W03=D + CE(U-AE)lB
(7.121)
Alternatively, in Fig. 7.35(a) we can first remove the self-loop at node Xi by the procedure outlined in Fig. 7.33 and then apply the series and parallel reduction rules. The results are presented in Fig. 7.36, yielding, of course, the same graph transmission.
542
SIGNAL-FLOW GRAPHS
(a)
^ ^
D+CE(U- AE)~XB
s~^
©
^
©
(*) Fig. 7.35. (a) The resulting matrix signal-flow graph after absorbing node X2 in that of Fig. 7.31 and (b) the resulting matrix signal-flow graph after absorbing node X\ in (a).
(a) Fig. 7.36. The reduction of the matrix signal-flow graph of Fig. 7.35(a).
7.8 MATRIX SIGNAL-FLOW GRAPH
543
CE(U- AEYlB
ID® D (b)
©
^
©
(c) Fig. 7.36 {Continued)
7.8.2
Topological Procedure
In this section, we describe a topological procedure that avoids the necessity of repeated graph reduction to obtain the desired graph transmission. To facilitate our discussion, we introduce several terms. A node is said to be split when it is replaced by two nodes, a source node and a sink node, such that all arcs terminating at the original node are made to terminate on the new sink node and all arcs outgoing from the original node are made to originate at the new source. The node transmission W, of a node X, is the graph transmission from the source node to the sink node created by splitting node Xt after the original source node X0 is removed. The directed path product of a directed path from node Xj to node Xj is the product of the transmittances associated with the arcs of the directed path written in the order from node Xj to node Xt. Finally, the node factor of a node Xt on a directed path P is (t/ — |yr )_1, where W, is the node transmission calculated under the condition that all nodes on the directed path P between node Xt and the output node are split. Clearly, the node factor is dependent on the choice of the directed path. With these preliminaries, the following steps yield the graph transmission from the source node X0 to any dependent node Xj in a matrix signal-flow graph. 1. Determine all the directed paths from node X0 to node Xj. 2. For each directed path P, compute the node factors of the nodes Xt on P. A modified directed path product is formed from the directed path product of P by inserting the node factor of every node Xt on P between the transmittances of the arcs incident at node Xt in P.
544
SIGNAL-FLOW GRAPHS
3. The graph transmission from node XQ to node Xj is equal to the sum of the modified directed path products of all the directed paths from node Xo to node Xj. We illustrate the above procedure by the following example. Example 7.7 We compute the graph transmission from node Xo to node X^ in the matrix signal-flow graph of Fig. 7.31 by the procedure outlined above. 1. There are two directed paths from X0 to X3. The directed path products are given by D and CEB. 2. As shown in Fig. 7.37, for the directed path (X0, X{)(X\, X2) (X2, X3), the node factors of nodes Xx and X2 are given by (U - 0) - 1
(a)
(b) Fig. 7.37. The computation of node factors for the directed path (X0, X0(Xu X2)(X2, X3) for (a) node Xi and (b) node X2.
7.9 THE MULTIPLE-LOOP FEEDBACK AMPLIFIER THEORY
545
and (U-EA)'1, respectively. The modified directed path product becomes C(U - EA)~lEB. The other modified directed path product is simply D. 3. The graph transmission is found to be Wo3=D + C(U-EA)~lEB
(7.122)
where X^=Wo-}Xo. ^ *s straightforward to demonstrate that (7.121) and (7.122) are equivalent. We remark that the identity matrix in (7.121) is of order equal to the number of rows of A, whereas the one in (7.122) is of order equal to the number of rows of E. Thus, their orders are generally different but the final products are the same.
7.9
THE MULTIPLE-LOOP FEEDBACK AMPLIFIER THEORY
The general configuration of a multiple-input, multiple-output, and multiple feedback-loop amplifier can be represented by the block diagram of Fig. 7.38, in which N is a multi-port network and the elements of interest are exhibited explicitly by the block X. The vectors u and 8 are the inputs to A', whereas the vectors = A6 + Bu y=C6 + Du
(7.123a) (7.123b)
where A, B, C and D are transfer-function matrices of appropriate orders. The vectors 9 and
(7.124)
The above system of three linear matrix equations can be represented by a matrix signal-flow graph of Fig. 7.39, which is known as the fundamental matrix feedback-flow graph. The graph is identical to that shown in Fig. 7.31 used to illustrate the matrix signal-flow graph reduction rules. The overall closed-loop transfer-function matrix of the multiple-loop feedback amplifier is defined by the equation y = W(X)u
(7.125)
We remark that, to emphasize the importance of X, the matrix W is written as W(X) for the present discussion, even though it is also a function of the complex-frequency variable s. By using the matrix flow-graph
546
SIGNAL-FLOW GRAPHS
Fig. 7.38. The block diagram of a multiple-input, multiple-output, and multiple-feedback amplifier.
Fig. 7.39. The fundamental matrix feedback-flow graph.
reduction rules or the topological procedure discussed in the preceding section, the transfer-function matrix is found to be W(X) = D + CX {U - AX Yl B
(7.126a)
W(X) = D + C(U- XA)~l XB
(7.126b)
or
7.9 THE MULTIPLE-LOOP FEEDBACK AMPLIFIER THEORY
547
We remark that the order of identity matrix U in (7.126a) and (7.126b) in general is different. The order of U in (7.126a) is equal to the number of rows in the vector q>, whereas that in (7.126b) is equal to the number of rows in 6. Clearly, we have W(0) = D
(7.127)
In particular situation where X is square and nonsingular, (7.126) can be written as W(X)=D+C(X~1-A)'1B
(7.128)
Example 7.8 Consider the voltage-series feedback amplifier of Fig. 7.40. Assume that the two transistors are identical, with hie = 1.1 k£l, hfe = 50, hre = hoe = 0. The equivalent network of the amplifier is presented in Fig. 7.41. Let the controlling parameters of the two controlled current sources be the elements of interest. Then we have = 10"4
e=
455 0 V13 = X
(7.129)
Assume that the output voltage V25 a nd input current 75i are the output variables. Then the 7-port network iV defined by the variables
6.6 kn 4.7 kn
-AAA-
•o
35.7 kn
ioon<
Fig. 7.40. A voltage-series feedback amplifier.
4.7 kn
548
SIGNAL-FLOW GRAPHS
212.8
AA/V
-o
909
/51,
/a=0.0455Vi3
6)
104
28
©
^
1061 <
©
V45
•"< <
^
(N
>
V25 "
/6=0.0455V45
O Fig. 7.41. An equivalent network of the voltage-series feedback amplifier of Fig. 7.40, where all conductances are in umho.
^B> ^45. ^25. ^5i» hi h equations V13 V 45 V25
an
^ Vs can b e characterized b y the matrix
= A9 + Bu = an an a2\ a22 = C0 + Du =
/51
bn \Vs] b2\
la
h
c\\
C\2
'la'
c2\
C22_
[h\
+
dn _d2\_
[vA
(7.130a)
(7.130b)
To compute an, a2\, cn and c2y we set Ib = 0, Vs = 0 and Ia = 1 A. The voltages V/3, V45, V25 a n d /51 in the resulting network as shown in Fig. 7.42 are numerically equal to an, a2\, cu and c2\, respectively. The results are given by an = -90.782 Q,
a21 = -942.507 fi
cu =45.391 ft, c2X =0.08252
(7.131a) (7.131b)
For an, a22, cn and c22, we set Ia = 0, Vs = 0 and Ib = 1 A. The voltages V13, V^, V25 and / ' j in the resulting network as shown in Fig. 7.43 are numerically equal to an, a22, cl2 and c22> respectively.
7.9 THE MULTIPLE-LOOP FEEDBACK AMPLIFIER THEORY
549
212.8
A/W1A
/'51>
Vis 9 0 9 < V'i3
104
1061
Fig. 7.42. The network used for the calculation of an. «2i> ^n and c2i, where all the conductances are in umho.
212.8
AAA^/"51»
909 <
V"i3
10 4
1061 <
V"45
H1 A
2 \
^ "25
Fig. 7.43. The network used for the calculation of al2, a22, c12 and c22, where all the conductances are in umho.
The element values are found to be an= 45.391 Q,
a22=0
en = -2372.32 Q, c22 = 0.04126
(7.132a) (7.132b)
Finally, to compute bu, b2U dn and d2X, we set_Ia =Jb = 0, and V, = 1 V as shown in Fig. 7.44 and calculate Vn, V45, V25 ar>d /51,
550
SIGNAL-FLOW GRAPHS
212.8
vw
Fig. 7.44. The network used for the calculation of b\\, b2\, du and d2\, where all the conductances are in jimho.
respectively. The results are given by bu =0.91748,
(7.133a)
6 2 1 =0
dn = 0.04126, d2i = 0.000862 mho
(7.133b)
Substituting these in (7.130) yields
V13'
-90.782 45.391
V45
-942.507
0.91748
+
0
V25
45.391
-2372.32
V51
-0.08252
0.04126
0
[Vs]
(7.134a)
0.041260
\y ] (7.134b) h + 0.000862 s
According (7.125), the transfer-function matrix of the amplifier is defined by the matrix equation V25
/51
w2i
[VS]=W(X)U
(7.135)
7.9 THE MULTIPLE-LOOP FEEDBACK AMPLIFIER THEORY
551
Since X is square and nonsingular, we can use (7.128) and obtain
W(X) =D+C{X~1-AY1B 0.041260 0.000862
45.391
-2372.32T
4.856
10.029 0.91748
-0.08252 0.04126 1-208.245 24.914
45.387
Wii
0.369 10- 4
W2\
0
io-
(7.136)
where
(x~l -A}1=
IO-
4.856
10.029
-208.245 24.914
(7.137)
Thus, the closed-loop voltage gain of the amplifier is given by wn =V2s/Vs =45.387. The input impedance facing the voltage source Vs, being the reciprocal of w2\, is given by
hi 7.9.1
J_ = 27.1kQ
(7.138)
w2i
The Return Difference Matrix
In the study of a single-loop feedback amplifier, we usually single out an element for particular attention. The element is generally one that is either crucial in terms of its effect on the entire system or of main concern to the designer. For a multiple-loop feedback amplifier, instead of singling out an element, we pay particular attention to a group of elements represented by the matrix X and study its effects on the whole system. In this section, we generalize the concepts of return difference by introducing the return difference matrix. As indicated in Sec. 7.7, if we break the branch with transmittance x in the fundamental feedback-flow graph Fig. 7.23, the negative of the signal returned to the left of the breaking mark as shown in Fig. 7.24 when a unit signal is applied to the right of the breaking mark and when the input excitation is set to zero is the return ratio for the element x. Instead of applying a unit signal, we can apply any signal g to the right of the breaking mark. Then the ratio of the returned signal h to the applied signal g must be the negative of the return ratio T(x) for the element x, or
552
SIGNAL-FLOW GRAPHS
h = -T{x)g because the network is assumed to be linear. The difference between the applied signal g and the returned signal h defines the return difference F(x) with respect to the element x: g-h = [l + T(x)]g = F(x)g
(7.139)
giving F(x) = 1 + T(x). With the above interpretations, the extension of these concepts to multiple-loop feedback amplifiers is now clear. Refer to the fundamental matrix feedback-flow graph of Fig. 7.39. Suppose that we break the input of the branch with transmittance X, set the input excitation vector « to zero, and apply a signal vector g to the right of the breaking mark, as depicted in Fig. 7.45. Then the returned signal vector h to the left of the breaking mark is found to be h=AXg
(7.140)
The square matrix AX is called the loop-transmission matrix and its negative is referred to as the return ratio matrix denoted by the symbol T(X) = -AX
(7.141)
The difference between the applied signal vector g and the returned signal vector h is given by g-h
= {U-AX)g
(7.142)
The square matrix U - AX is called the return difference matrix with respect to X and is denoted by the symbol F(X) = U-AX
(7.143)
Combining this with (7.141) gives F(X) = U + T(X)
(7.144)
As an illustration, we compute the return difference matrix with respect to the matrix X of (7.129). From (7.134a), the return ratio matrix is found to be T(X) = -AX =
4.131 -2.065 42.884 1
(7.145)
7.9 THE MULTIPLE-LOOP FEEDBACK AMPLIFIER THEORY
553
Fig. 7.45. The physical interpretation of the loop-transmission matrix.
giving the return difference matrix as F(X) = U2+T(X) =
7.9.2
5.131 -2.065 42.884 1
(7.146)
The Null Return Difference Matrix
As a direct extension of the null return difference for the single-loop feedback amplifiers, in the present section we introduce the notion of the null return difference matrix for multiple-loop feedback networks. Referring to the fundamental matrix feedback-flow graph of Fig. 7.39, we break, as before, the branch with transmittance X, as illustrated in Fig. 7.46, and apply a signal vector g to the right of the breaking mark. We then adjust the input excitation vector u so that the total output vector y resulting from the inputs g and u is zero. From Fig. 7.46, the input vectors g and u are related by Du + CXg = 0
(7.147)
obtaining u=
-DlCXg
(7.148)
provided that the matrix D is square and nonsingular. This requires that the output^ be of the same dimension as the input u. Physically, this is
554
SIGNAL-FLOW GRAPHS
Fig. 7.46. The physical interpretation of the null return difference matrix.
rather obvious, because the effects at the output caused by g can be neutralized by a unique input excitation u only when u and y are of the same dimension. With inputs g and u, as given in (7.148), the returned signal to the left of the breaking mark in Fig. 7.46 is found to be h = Bu + AXg = (-BDlCX
+ Ax)g
(7.149)
giving g-h = (u-AX
+ BDlCx)g
(7.150)
The square matrix F(X) = U+f(X)
= U-AX+BD-lCX
=U-AX
(7.151)
is called the null return difference matrix with respect to X, where f(X) = -AX +BD'lCX A = A-BD~'C
=-AX
(7.152) (7-153)
The square matrix T(X) is referred to as the null return ratio matrix.
7.9 THE MULTIPLE-LOOP FEEDBACK AMPLIFIER THEORY
555
Example 7.9 Consider the voltage-series feedback amplifier of Fig. 7.40, as discussed in Example 7.8. Assume that the voltage V25 is t n e output variable. Then, from (7.134), w e have
V13
-90.782
45.391
V 45
-942.507
0
0.91748 0
h
\VS]=A0 + Bu (7.154a)
y
l
a
= [v25]= [ 4 5 . 3 9 1 - 2 3 7 2 . 3 2 ]
h
+ [O.O4\26][vs]=C0
+ Du (7.154b)
Substituting the coefficient matrices in (7.153) A = A-BDXC
-1100.12 52,797.6
=
-942.507
0
(7.155)
obtaining the null return difference matrix with respect to X as F(X) = U2-AX
=
51.055 - 2 4 0 2 . 2 9 42.884 1
(7.156)
Suppose that the input current / 5 i is chosen as the output variable. From (7.134b) w e obtain y = [/ 5 1 ]= [-0.08252
0.04126]
h h
+ [0.000862][vJ= C6 + Du (7.157)
and the corresponding null return difference matrix becomes =
1.13426 - 0 . 0 6 7 1 3 42.884 1
(7.158a)
>C =
- 2 . 9 5 0 8 5 1.47543 -942.507 0
(7.158b)
F(X) = U2-AX where A = A-BD
556
7.9.3
SIGNAL-FLOW GRAPHS
The Transfer-Function Matrix and Feedback
In this section, we apply the results developed in the foregoing to show the effect of feedback on the transfer-function matrix W(X). Specifically, we express det W(X) in terms of det X(0) and the determinants of the return difference and null return difference matrices, thereby generalizing Blackman's impedance formula for a single input to a multiplicity of inputs. Before we proceed to develop the desired relation, we first establish the following determinantal identity: det
(Um+MN)=det(Un+NM)
(7.159)
where M and N are two arbitrary matrices of orders m x n and n x m, respectively. To verify this result, we first show that (7.159) is valid when M and N are square matrices of order n. Then if M is nonsingular, we have det(Un +MN) = det[M(f/„ + NM)M-l]= detM det({/„ + NM)detM'1 = det(Un+NM) (7.160) If M is singular, it has a zero eigenvalue, and hence for some A the matrix Wn + M is nonsingular. Thus, from (7.160) we have det[t/„ +{Wn +M)N]=det[Un
+ N{XNn +M)]
(7.161)
Observe that both sides of (7.161) are polynomials in A of at most degree n. They must be identical for all A for which At/„ + M is nonsingular. Since A = 0 is a zero of det(A(/„ +A/), there exists a positive number AQ such that Wn + M is nonsingular for all real A satisfying 0 < A < AQ. Therefore, (7.161) is valid when A = 0. Consider now the situation where M and N are not square. Let M=
M 0" 0 0
,
AT =
'N 0
(7.162)
0 0
be the augmented square matrices of order n + m. Then we have det(t/„ +m +Miv)=det
det(t/„+m + iVM)=det
Um+MN
0"
0
un_
~U„+NM 0
0 " KJ
m
• det(Um+MN)
(7.163a)
= det(Un+NM)
(7.163b)
7.9 THE MULTIPLE-LOOP FEEDBACK AMPLIFIER THEORY
557
But M and N are square, and from the above discussion for square matrices we conclude that det((/„+m+ MN) = det(Un+m+ NM). The identity (7.159) follows. This completes the derivation of the identity. Using (7.159), we next establish the following result, which is a generalization of Blackman's formula for input impedance.
THEOREM 7.10 In a multiple-loop feedback amplifier, if W(0) = D is nonsingular, the determinant of the transfer-function matrix W(X) is related to the determinants of the return difference matrix F(X) and the null return difference matrix F(X) by det W(X) = det W ( 0 ) ^ | | g
(7.164)
Proof. From (7.126a) we have W(X)
= D[U„
+ D~1CX(up -AXY1B]
(7.165)
giving detW(X) =detW(0)det[t/„ +D-lCX(up = detW(0)det[up
+BDlCX{up
-AX)~1B]
-AXf1]
= detW(0)det(£/ p - AX + BD~lCx)det{U
P
-AX)'1
= detW(0)detF(y) detF(X)
(7.166)
The second line follows directly from the identity (7.159). In particular, for a single input, single output, and single feedback loop feedback amplifier, (7.164) reduces to a relation among the transfer function w(x), return difference F(x) and null return difference F(X): w(*) = w ( 0 ) - — F(x)
(7.167)
558
SIGNAL-FLOW GRAPHS
X
1f * -
t
+
• •• • •
• •
N
••
1
•• •
Fig. 7.47. The general configuration of a multiple-input, multiple-output, and multiplefeedback-loop amplifier.
If W(X) denotes the impedance matrix of a multiport network as shown in Fig. 7.47, F(X) is the return difference matrix with respect to X for the situation when the ports where the impedance matrix is defined are left open without any sources, and we write F(X) = F(input open-circuited). Likewise, F(X) is the return difference matrix with respect to X for the input port-current vector Is and the output port-voltage vector V under the condition that Is is adjusted so that the port-voltage vector V is identically zero. In other words, F(X) is the return difference matrix for the situation when the ports where the impedance matrix is defined are shortedcircuited, and we write F(X) = ,F(input short-circuited). Consequently, the determinant of the impedance matrix Z(X) of the multiport network can be expressed, from (7.164), as detZ(X) = detZ(0)
det F (input shorted - circuited) detF (input open - circuited)
(7.168)
In the case that X = x is a scalar, the input impedance Z(x) looking into a terminal pair can be conveniently expressed as Z(JC) = Z ( 0 )
F (input shorted - circuited) F(input open - circuited)
(7.169)
7.9 THE MULTIPLE-LOOP FEEDBACK AMPLIFIER THEORY
559
which is the well-known Blackman's formula for an active impedance, and was first derived by Blackman (1943). The formula is very useful in computing the impedance of an active network, because the right-hand side of (7.169) can usually be determined rather easily. If x represents the controlling parameter of a controlled source in a single-loop feedback amplifier, then setting x = 0 opens the feedback loop and Z(0) is simply a passive impedance. The return difference for x when the input port is short-circuited or open-circuited is relatively simple to compute, because shorting out or opening a terminal pair frequently breaks the feedback loop. On the other hand, Blackman's formula may be used to determine the return difference by measurements. However, because it involves two return differences, only one of them can be identified; the other must be known in advance. In the case of a single-loop feedback amplifier, it is usually possible to choose a terminal pair so that either the numerator or the denominator on the right-hand side of (7.169) is unity. If F(input short-circuited) = 1 and F(input open-circuited) = F(x), F(x) being the return difference under normal operating conditions, we have FM = —
(7.170)
On the other hand, if F(input open-circuited) = 1 and F(input short-circuited) = F(x), F(x) being the return difference under normal operating conditions, we have
F(X)=
W)
< 7 - 171 >
We illustrate the above results by the following examples.
Example 7.10 Consider the feedback network of Fig. 7.48. Suppose that the controlling parameter a is the element of interest, Is forms the input port, and G2 is the output load. The current gain I2^/Is when a is set to zero is found to be w(0) = ^ 1 e
<x=0
sC2G2 (G2 +sC2)(Gl + g3 + sCl)+sC2G2
<7-172)
560
SIGNAL-FLOW GRAPHS
Fig. 7.48. An equivalent network of a simplified transistor feedback amplifier.
The return difference with respect to a is obtained as F{a)
=
(G2 + sC2 )(d + g3 + sd)+ sC2 (a + G2) (G2 + sC2 )(Gi + g3 + sCx)+ sC2G2
(7.173)
and the null return difference F(a) is given by sC2-a F(a) = sC2
= 1- a sC2
(7.174)
Substituting these in (7.167) yields the current gain w(a)-
I 23 /,
G2{sC2-a) {G2+sC2){Gx+g3+sCx)+sC2{a
+ G2)
{1A15)
Assume that we wish to compute the impedance Z(d) facing the input current Is by Blackman's formula. F(input open-circuited) is the return difference with respect to a when the input excitation Is is removed, yielding the return difference (7.173). F(input short-circuited) is the return difference with respect to a in the network obtained from that of Fig. 7.48 by shorting the terminals 1 and 3, resulting in F(input shortcircuited) = 1. Finally, the input impedance Z(0) when a is set to zero is given by Z(0) =
G2 + sC2 (G2 + sC2 )(G, + g3 + sQ)+ sC2G2
(7.176)
7.9 THE MULTIPLE-LOOP FEEDBACK AMPLIFIER THEORY
561
Substituting these in (7.169) gives the active impedance Z(a)
G2 + sC2 {G2 + sC2){Gl + g3+sCl)+sC2(a
(1A11)
+ G2)
As another example, let us compute the impedance facing the capacitor C2 in the network of Fig. 7.48. The desired quantities are found to be F(input short - ciruited) = 1 +
"——— Gi+G2 + g3+ sQ
(7.178a) >
v
F(input open-circuited) = 1
(7.178b)
1 Gi + g2+ sQ
(7.178c)
Z(0) = -J- + G2
in which the input port is formed by removing the capacitor C2 and the element of interest is a. Thus, appealing to Blackman's formula, the active impedance facing the capacitor C2 is obtained as T/ x T/«X ^ (input short - circuited) G\ + G2 + g$ + sC\ + a Z(a) = Z(\)) = -. r— (7 179) v F(input open - circuited) G2{Gi + gi +sCi) ' ' Example 7.11 Refer again to the voltage-series feedback amplifier of Fig. 7.40, an equivalent network of which is shown in Fig. 7.41. As computed in (7.146), the return difference matrix with respect to the two controlling parameters is given by F(X) =
5.131 -2.065 42.884 1
(7.180)
whose determinant is found to be detF(X) = 93.68646
(7.181)
If V25 of Fig. 7.41 is chosen as the output and V^ as the input, the null return difference matrix is, from (7.156), F(X) =
51.055 -2402.29 42.884 1
(7.182)
562
SIGNAL-FLOW GRAPHS
obtaining detF(X) = 103,071
(7.183)
By appealing to (7.164), the voltage gain V2s/Vs of the amplifier can be written as y ,^ 25 103,071 ,_„„ /n,detF(X) nnAtn, w(X) = — = w(0) ^ ^ - = 0.04126x = 45.39 n is^ (/ 184J Vs detF(AT) 93.68646 Suppose, instead, that the input current / 51 is chosen as the output and Vs as the input. From (7.158a) the null return difference matrix becomes
F(X) =
1.13426 -0.06713 42.884 1
(7.185)
with detF(X) = 4.01307. Again, by invoking (7.164), the amplifier input admittance is obtained as / ^ /51 ^xdetF(X) O A „ tn , 4.01307 ^, M , w(X) = — = w(0) T^—t = 8.62xl0~ 4 x = 36.92 umho V, detF(AT) 93.68646 (7.186) or 27.1 k£X 7.10
SUMMARY AND SUGGESTED READING
In this chapter, the basic relationships between the determinant and the cofactor of an element of a matrix and the corresponding subgraphs in the associated signal-flow graphs were derived. The applications of these techniques to the solutions of a system of simultaneous linear algebraic equations and to the inversion of a matrix were discussed. The signal-flow graph approach offers an alternative viewpoint, which complements and enhances the more familiar classical methods. Since this approach not only displays in a very intuitive manner the causal relationships among the elements of the matrices under study, but also provides a great insight into the properties of the systems being described by such matrices, it has been widely used as a tool for analysis of engineering problems. The methods are especially useful for large sparse matrices with elements given in literal rather than in numerical form such as frequently occur in engineering problems.
7.10 SUMMARY AND SUGGESTED READING
563
We studied Bode's feedback theory by introducing the notion of return difference and null return difference. We showed that the return difference is a generalization of the concept of the feedback factor of the ideal feedback model and can be measured physically from the amplifier itself. Also, we introduced the notion of null return difference and discussed its physical significance. Finally, we reviewed the rules of the matrix signal-flow graph and presented some of its properties. One way to obtain the graph transmission is to apply the graph reduction rules repeatedly until the final graph is composed of only one arc. The transmittance of the arc is the desired graph transmission. To avoid the necessity of repeated graph reduction, we described a topological procedure for computing the graph transmission directly from the original matrix signal-flow graph. In the study of a single-loop feedback amplifier, we usually single out an element for particular attention. The scalar return difference and null return difference are then defined in terms of this particular element. For a multiple feedback-loop amplifier, we pay particular attention to a group of elements and study its effects on the whole system. This leads to the concepts of return difference matrix and null return difference matrix. Like the return difference, the return difference matrix is defined as the square matrix relating the difference between the applied vector signal and the returned vector signal to the applied vector signal. Likewise, the null return difference matrix is the return difference matrix under the situation when the input excitation vector of the feedback amplifier is adjusted so that the total output resulting from this input excitation and the applied signal vector at the controlling branches of the elements of interest is identically zero. The overall transfer characteristics of a multiple feedbackloop amplifier are described by its transfer-function matrix. We showed that the determinant of the transfer-function matrix can be expressed in terms of the determinants of the return difference and null return difference matrices and its value when the elements of interest assume the zero value, thereby generalizing Blackman's impedance formula for a single input to a multiplicity of inputs. For a general discussion of signal-flow graphs and their applications to electrical engineering, we refer to Robichaud, Boisvert and Robert (1962), Chow and Cassignol (1962) and Lorens (1964). For fundamental theory, we refer ta Mason (1953, 1956) and Chen (1997). For matrix signal-flow graphs, we refer to Riegle and Lin (1972). For a detailed discussion of Bode's feedback amplifier theory, we refer to Chen (1991).
564
SIGNAL-FLOW GRAPHS
REFERENCES Ash, R. B. (1959), "Topology and the solution of linear systems," J. Franklin Inst., vol. 268, pp. 453-463. Blackman, R. B. (1943), "Effect of feedback on impedance," Bell Syst. Tech. J., vol. 22, pp. 268-277. Bode, H. W. (1945), Network Analysis and Feedback Amplifier Design, Princeton, NJ: Van Nostrand. Chen, W. K. (1964a), "The inversion of matrices by flow graphs," J. Soc. Indust. Appl. Math., vol. 12, pp. 676-685. Chen, W. K. (1964b), "On signal-flow graphs," Proc. IEEE, vol. 52, p. 967. Chen, W. K. (1965), "Row graphs: Some properties and methods of simplification," IEEE Trans. Circuit Theory, vol. CT-12, pp. 128-130. Chen, W. K. (1967), "On direct graph solutions of linear algebraic equations," SIAM Review, vol. 9, pp. 692-707. Chen, W. K. (1969), "A physical interpretation of the multiple-node removal algorithm of a flow graph," Proc. IEEE, vol. 57, pp. 1691-1692. Chen, W. K. (1976), "Indefinite-admittance matrix formulation of feedback amplifier theory," IEEE Trans. Circuits and Systems, vol. CAS-23, pp. 498-505. Chen, W. K. (1977), "The hybrid matrix in linear multiple-loop feedback networks," IEEE Trans. Circuits and Systems, vol. CAS-24, pp. 469-474. Chen, W. K. (1979), 'Topological evaluation of feedback matrices in multiple-loop feedback amplifiers," /. Franklin Inst., vol. 308, pp. 125-139. Chen, W. K. (1991), Active Network Analysis, Singapore: World Scientific. Chen, W. K. (1997), Graph Theory and Its Engineering Applications, Singapore: World Scientific. Chen, W. K. and Elsherif, H. M. (1977), "Determinant of the null return-difference matrix," Electron. Lett., vol. 13, pp. 306-307. Chow, Y. and Cassignol, E. (1962), Linear Signal-Flow Graphs and Applications, New York: John Wiley. Coates, C. L. (1959), "Flow-graph solutions of linear algebraic equations," IRE Trans. Circuit Theory, vol. CT-6, pp. 170-187. Copi, I. M. (1958), "Matrix development of the calculus of relations," J. Symbolic Logic, vol. 31, pp. 193-203. Desoer, C. A. (1960), "The optimum formula for the gain of a flow graph or a simple derivation of Coates' formula," Proc. IRE, vol. 48, pp. 883-889. Hohn, F. E. and Schissler, L. (1955), "Boolean matrices and the design of combinational relay switching circuits," Bell System Tech., J., vol. 34, pp. 177-202. Hoskins, R. F. (1961), "Flow graphs, signal flow graphs, and graph determinants," Proc. IEE (London), vol. 109C, pp. 263-269. Kac, M. and Ward, J. C. (1952), "A combinatorial solution of the 2-dimensional Ising model," Phys. Rev., vol. 88, pp. 1332-1337. Konig, D. (1916), "Uber Graphen und ihre Anwendung auf Determinantentheorie und Mengenlehre," Math. Ann., vol. 77, pp. 453-465. Kuh, E. S. (1963), "Some results in linear multiple loop feedback systems," Proc. Allerton Conf. on Circuit and System Theory, University of Illinois, Urbana, Illinois, vol. 1, pp. 471-487. Lorens, C. S. (1964), Flowgraphs, New York: McGraw-Hill.
REFERENCES
565
Luce, R. D. and Perry, A. D. (1949), "A method of matrix analysis of group structure," Psychometrika, vol. 14, pp. 95-116. MacLane, S. and Birkhoff, G. (1967), Algebra, New York: Macmillan. Mason, S. J. (1953), "Feedback theory - some properties of signal flow graphs," Proc. IRE, vol. 41, pp. 1144-1156. Mason, S. J. (1956), "Feedback theory - further properties of signal flow graphs," Proc. IRE, vol. 44, pp. 920-926. Nathan, A. (1961), "A proof of the topological rules of signal-flow-graph analysis," Proc. IEE (London), vol. 109C, pp. 83-85. Riegle, D. E. and Lin, P. M. (1972), "Matrix signal flow graphs and an optimum topological method for evaluating their gains," IEEE Trans. Circuit Theory, vol. CT-19, pp. 427-435. Robichaud, L. P. A., Boisvert, M., and Robert, J. (1962), Signal Flow Graphs and Applications, Englewood, N.J.: Prentice-Hall. Sandberg, I. W. (1963), "On the theory of linear multi-loop feedback systems," Bell Syst. Tech. J., vol. 42, pp. 355-382. Seshu, S. and Reed, M. B. (1961), Linear Graphs and Electrical Networks, Boston, Mass.: Addison-Wesley. Shannon, C. E. (1942), "The theory and design of linear differential equation machines," OSRD Rept. 411, Sec. D-2 (Fire Control) of the U.S. National Defense Research Committee, January. Truxal, J. G. (1955), Automatic Feedback Control System Synthesis, New York: McGrawHill. Tutte, W. T. (1953), "The 1-factors of oriented graphs," Proc. Amer. Math. Soc, vol. 4, pp. 922-931.
8 OTHER NET APPLICATIONS
In the past five decades, we have witnessed a steady development of net theory and its applications that, in the last twenty years, have blossomed into a new period of intense activity. Some measure of this rapid expansion is indicated by the publication of a number of extensive bibliographies on graph theory and its applications. The earliest and most extensive bibliography was compiled by J. W. Moon and L. Moser and later extended by A. A. Zykov for a symposium held at Smolenice, Czechoslovakia, in June 1963; it appeared in the symposium proceedings [see Fiedler (1964)]. The bibliography contains 1617 entries and includes many Eastern European contributions not readily available in the West. One shortcoming of Zykov's bibliography is that it left out many significant references, which were more concerned with applications of graphs than their theory. Five years later, Deo (1969, 1971) compiled an extensive Englishlanguage bibliography on graph theory and its applications for the Jet Propulsion Laboratory. His bibliography contains about 3041 entries. The American Mathematical Society, under the editorship of Brown (1980), published a four-volume set, Reviews in Graph Theory. It includes all reviews in graph theory published by Mathematical Reviews between 1940 and 1978 (vols. 1-56, inclusive). Peripheral areas concerned with applications are covered less thoroughly. Among these are electrical networks, logical networks, applications to theoretical physics, certain operations research applications, especially problems involving bipartite graphs, and certain computer science applications. In addition, a project 566
8.1 BOOLEAN MATRICES AND SWITCHING NETS
567
on forward citations in graph theory has been developed at the University of Waterloo for researchers in various areas of combinatorics and optimization, including a separate bibliography on applied graph theory. An important feature of this project is that it lists all papers that have cited a given paper. As a result, it enables authors to identify new areas of research in which their papers have applied, and to locate more recent results in a given field based on known publications. This computerized system is expected to be updated regularly and is directed by G. Berman. Much current interest in net theory derives from its demonstrated applications in modeling systems arising in physical science, engineering, social science, and economics problems. In fact, any system involving a binary relation can be represented by a graph. It is predicted that net theory will continue to grow at a rapid rate for some time. This accelerated pace of development has confirmed the value of the general approach adopted in this book: to give an in-depth account of a relatively small part of net theory that is closely related to electrical engineering and computer science, rather than a shallow account of a greater part of graph theory. 8.1
BOOLEAN MATRICES AND SWITCHING NETS
The problem of synthesis of a switching system is one of ever increasing importance to modern technology; it arises in the design of all sorts of pushbutton devices. In this section, a short review of Boolean matrix algebra that has arisen in switching circuit theory is given, though no attempt is made to give more than an outline of certain phases of the subject. 8.1.1
Boolean Matrices
A Boolean matrix is simply a matrix over a Boolean algebra, i.e., a rectangular array of elements from a Boolean algebra. These arrays are subject to appropriate rules of operations, some of which are analogous to the rules of operation for ordinary matrices, whereas others reflect the Boolean character of the elements. However, before proceeding, we first define a Boolean algebra. DEFINITION 8.1 Boolean Algebra. A set © of elements {a, b, c, ...} and two associated binary operations u and n form a Boolean algebra if and only if the following postulates are satisfied:
568
OTHER NET APPLICATIONS
(Al) The operations are commutative, fluli = i u a
and
anb
= b na
(A2) Each of the operations distributes over the other,
an(bvc)
=
(anb)v(anc)
au(br\c)
=
(aub)n(avc)
(A3) There exist identity elements 0 and 1 for u and n , respectively, Oufl = a
and
1 n a = a for all a e (B
(A4) For each o e ^ there exists a n a e ^ such that flUa = l
and
ana=0
From this set of postulates it is possible to prove the following identities: a u a = a, a r\a = a
(Idempotent)
a u 1 = 1, a n 0 = 0
(Null elements)
(a) = a
(Involution)
a u (a n b) = a, « n (a u fc) = a
(Absorption)
a u ( i u c ) = ( f l u i ) ) u c , a n (b n c) = (a n fc) n c (a u b) = a n b, (anb)
= aub
(Associative)
(DeMorgan's laws)
We remark that the structure of the algebra of sets is formally identically with Boolean algebra. Thus, the union of two sets X and Y is written as X u Y and defined as the set containing all elements which are either in X or Y or both. The intersection of two sets X and Y is written as X n Y and is defined as the set containing all elements which are in both X and Y. If two sets have exactly the same members, they are said to be equal. If a set X has only elements which are also elements of another set Y, X is said to be a subset of Y or X is said to be included in Y, written as X c Y. If Y contains elements which are not also in X, then X is said to be a proper subset of Y, written as X c Y. This relation of inclusion has the following properties: (Bl) I c X
(Reflexive)
8.1 BOOLEAN MATRICES AND SWITCHING NETS
569
(B2) I f l c F a n d F c X then X=Y
(Anti-symmetric)
(B3) I f X c F a n d K c Z then X c Z
(Transitive)
A relation such as c possessing the above three properties is said to be a partial ordering. If the two sets X and Y do not have elements in common, their intersection X n Y is empty. It is customary to call this the null or empty set, denoted by the symbol 0, so that X n Y = 0. The universal set, denoted by the symbol /, is the set contains all the elements. The complement of a set X, written as X, is the set containing all the elements of / that are not in X. Thus, X c Y if and only if X n Y = 0. In other words, there can be no elements of X that are not in Y. From the above definition, the following relations hold: (CI) X u K = F u X
and
(Commutative)
XnY=YnX
(Distributive)
(C2) X n ( F u Z ) = ( X n F ) u ( X n Z )
X v(YnZ)
= (X vY)n(X
(C3) 0 u X = X
and
(C4)XuX=7
and
vZ)
=X
(Identity)
XnX=0
(Complementation)
IvX
Thus, the algebra of sets is formally identical to Boolean algebra if the elements of $ are chosen to be the subsets of some universal set / and the operations u and n are the set union and intersection. In fact, the visualization of the set operations is possible by means of a Venn diagram, in which a certain area represents a set. The universal set / is denoted by the interior of a rectangular. Individual sets are represented by the points inside a closed region inside the rectangle, as illustrated in Fig. 8.1.
Fig. 8.1. Venn diagram, where A = X r\Y, B = X nY, C = XnY
and D =
XnY.
570
OTHER NET APPLICATIONS
Let 2 be a Boolean algebra of at least two elements, and 9A be the set of all Boolean matrices of order mxn, being the Boolean matrices over (B. For 2? = [a, b, c, ...}, we use anb for intersection, a^jb for union, a for complementation, and a < b for inclusion. In the set M = {A, B, C, ...}, where aijy by, Cy, ..., (i = 1, 2, ..., m; j = 1, 2, ..., n), are elements of the corresponding matrices A, B, C, ..., respectively, we define A =B
if and only if ay = by for all i and j
A =B n C
if and only if ay = by n c,-, for all i and j
A =B u C
if and only if a,-,- =fe,yu c,y for all / and j
A =B
if and only if ay = by for all i and j
A
if and only if ay < by for all i and ;'
If 0 and 1 are the zero and universal elements of % then in 5^ the zero, identity, and universal matrices O, U, and / are defined as 0 = [O], f / = K - ] ,
7=[v,7]
where uy = 0 for i ^ j , uy = 1 for i = j , and vy - 1 for all i and _/. The transpose of A, denoted by A', is defined by A' = [dy] where dy = aji for all i and j . Under these terms, it is straightforward to verify that M forms a Boolean algebra. A multiplication may be defined as A B = AB
\J{aiknbkj) k=l
(8.1) pxr
where A is a Boolean matrix of order pxq and B is of order q x r. If this operation is used instead of A n B e 5^ with m = n, then fWdoes not form a Boolean algebra with respect to the operations ".'\"\j' and """. However, under these definitions and the given multiplication, iW forms a semigroup with identity element. In analogy to ordinary matrix theory, Luce (1952) has defined the concepts of symmetry, skew symmetry, orthogonal and inverse of a Boolean matrix. A Boolean matrix A is said to be symmetric if and only if A'nA-O. A is skew-symmetric if and only if A'c\A = 0 . The inverse of A, if it exists, denoted by A"1, is such that AA~l=A~lA = U. A is involutory if and only if AA = U. Finally, A is orthogonal if and only if it has an inverse which is A'. With these we can now state the following results due to Luce (1952).
8.1 BOOLEAN MATRICES AND SWITCHING NETS
571
THEOREM 8.1 A Boolean matrix has an inverse if and only if it is orthogonal. THEOREM 8.2 Any Boolean matrix can be uniquely decomposed into the disjoint union of a symmetric and a skew-symmetric matrix. Two observations could be given here for these definitions and theorems, which will be stated as corollaries. COROLLARY 8.1 A Boolean matrix A is symmetric if and only if A = A' or A ' u A =1. COROLLARY 8.2 A Boolean matrix A is involutory if and only if A is both orthogonal and symmetric. In addition to those terms defined above, yet other definitions, parallel to the one in ordinary matrix theory, may be considered. For our purposes, we define the tranjugate matrix. DEFINITION 8.2 Tranjugate Matrix. A Boolean matrix is said to be tranjugate if and only if A'KJA
= I.
From this we can state the following results. COROLLARY 8.3 Given any A, B e M, then A u B = I if and only if A < B. COROLLARY 8.4 A Boolean matrix A is tranjugate if and only if A'< A. COROLLARY 8.5 If a Boolean matrix A is tranjugate, its diagonal elements must be 1.
572
OTHER NET APPLICATIONS
These results are especially useful since a switching matrix has been defined by Hohn and Schissler (1955) as any Boolean matrix having all l's along the main diagonal, whereas in a Boolean matrix the elements along the main diagonal are arbitrary over $. For a skew-symmetric matrix the elements along the main diagonal are 0 since a,, n a,; = 0 for all i. THEOREM 8.3 Any Boolean matrix can be uniquely decomposed into the joint intersection of a symmetric and a tranjugate matrix. Proof. For any decomposition A=SnT T'uT = I, and SKJT = I, we have
subject to
S'nS=0,
AuA'=(5nr)u(Snr)'=[(5nr)u5']n[(5nr)ur'] = (SuS')n(S'ur)n(Sur)n(ruf)=/nS =S
(8.2a)
A u I ' = ( S n r ) u ( s ' n f ) = ( S n r ) u ( s 7 u T*) = [suS'uf]
ntuS'uf]
=7n(ruSu7r')=ruS=r
(8.2b)
in which we have used the DeMorgan's laws and the results that S is symmetric if and only if 5 = 5 ' and that T is tranjugate if and only if T')=(AuA')n(AuA')=Snr
(8.3a)
S ' n S = ( A ' u A ) n ( A A 7 A " ' ) = ( A U A ' ) n ( A n~A') = (AnAnA~')Kj(A'nAn~A')=0 f u r =(/l'ui)u(AuI')=A'uIu4uI' =/ SvT
=I
This completes the proof of the theorem.
(8.3b) (8.3c) (8.3d)
8.1 BOOLEAN MATRICES AND SWITCHING NETS
8.1.2
573
Switching Matrices and Matrices Associated with Combinational Circuits
Any Boolean matrix with all l's down the main diagonal is called a switching matrix. A switching circuit with output terminals is said to be combinational if the outputs are a unique function of the inputs. From an abstract point of view, a net can represent any switching circuit. In a combinational circuit, after a brief operate-time, the state fy of the 'connection' between the nodes i and j depends only on the combination of values assumed by the input variables, and hence may be represented as a Boolean function. In order to describe the terminal behavior of the net associated with such a circuit, two matrices are defined: The output matrix and the primitive connection matrix. For a net G with p output terminals, the output matrix F is a square matrix F = [fij]
(8.4)
of order p such that fy is the Boolean function from node i to node j . Since a node is always connected to itself, fu is defined to be 1 for each i. Nodes associated with output terminals are called output nodes; otherwise, non-output nodes. For an n-node net G, the (primitive) connection matrix C is a square matrix C = [Cij]
(8.5)
of order n such that ctj is the Boolean function associated with the arc (/,;'), i*j, of G. If the Boolean algebra 2? contains only two elements, denoted by 0 and 1, then Cy represents the 'connection' from node / to node/ This symbol has the value 0 if there is no connection at all and 1 if there is a short circuit, but otherwise it is the symbol denoting a single contact or a union of such symbols. Properties and techniques discussed here are more general and can be applied to any Boolean algebra. Certainly, any switching matrix may be interpreted as a connection matrix of a combinational switching circuit or a net. However, the question of how to characterize an output matrix is more interesting, and the answer is given by Hohn and Schissler (1955). THEOREM 8.4 The necessary and sufficient condition that a switching matrix F be an output matrix is that F2 = FF = F.
574
OTHER NET APPLICATIONS
Another useful tool in the analysis of switching circuits is the ordeterminant of a square Boolean matrix A of order m, the row expansion of which is defined as detA =
(J
alhna2j2n...namjm
(8.6)
(hh-jm)
where (j]J2---Jm) means that the union is to be extended over all permutations jj2-• Jm of the integers 1, 2, ..., m. Likewise, the cofactor of atj, denoted by det Atj, in det A is defined as the or-determinant of the matrix obtained from A by striking out the ith row and jth column of A. The adjoint matrix of A, denoted by adj A, is the matrix [dtj\ of order m such that dtj = det A7,. For the present case, au = 1 for all i. These terms are like the definition of the determinant of a matrix over the complex field except that " u " replaces "+" and no sign variations appear. From this it follows that the purely combinational properties of determinants of matrices over the complex field will also apply in the Boolean case. The properties that depend on the signs of the terms may not be carried over in the same way, however; e.g., 1. detA' = detA 2. The interchange of two lines of a matrix leaves the determinant invariant. 3. If A,, i = 1, 2, ..., m are the columns of A, then det[Ai A2 ••• fiAk ••• Am]=y?detA detfAjuA,- A2 ••• A m ]=(detA)u{det[A, A2 ••• Am]} where /J is a scalar. 4. Laplace expansion also holds in this case except there are no sign variations. For the use in the analysis of switching circuits the following result is significant.
THEOREM 8.5 If C is the connection matrix of a switching circuit, and F is the output matrix, then F = adj C
(8.7)
8.1 BOOLEAN MATRICES AND SWITCHING NETS
8.1.3
575
The Analysis and Synthesis of Combinational Circuits
The basic problem of analysis of combinational circuits is the determination of the relation between any given connection matrix and the corresponding output matrix. To accomplish this, Hohn and Schissler (1955) showed first how to obtain from a given circuit an equivalent circuit using one less non-output node in the formation of the connection matrix. This operation called the star-mesh transformation is repeated until there are no nonoutput nodes in the accounting. Matrixwise, this operation proceeds as follows: To remove a nonoutput node r, we join to entry ctj of C the intersection of the entry cir by the entry crj, thereafter deleting row r and column r from C. It is interesting to note this node removal process is very similar to Chio's method for the reduction of the order of a determinant in ordinary matrix theory. This method is very useful because it can be reversed, i.e., node insertion. In other words if a new line is to be placed in a reduced matrix, every row and every column must contain a same element, and the intersection of these two elements must in turn be contained in one entry. A natural question to ask at this point is, "Is it possible to generalize the single-node removal process to the process of multiple-node removal?" Shekel in an unpublished note first obtained this generalization in an algebraic form [see Yoeli (1959)]. However, Shekel's process can be accomplished topologically as follows. Let C be the connection matrix, not necessarily symmetric, of a given net G, and be partitioned in such a way that C = L[cij] J *1
=
nxn
C l l C\% C 21 C22
(8.8)
where Cn is a square submatrix of order p that corresponds to the output nodes of G. For convenience, a mapping function / is defined for the arc (i, j) of G into a Boolean algebra 2? such that f(i, j) = c{j for all arcs in G, where c,y e CB. This definition is extended to any nonempty subgraph R of G as follows: /(/?)=n/(«i,«2)
(8.9)
where the intersection runs over all arcs (wb u2) in R. Next let
C W l =[4 W l ) ], adjC22 = [m(,-]
h,t2 =1,2
(8.10a) (8.10b)
576
OTHER NET APPLICATIONS
*=[/*]„. >pxp
(8-10c)
where adj C 22 is the adjoint matrix of C22. Yoeli (1959) has shown that if F is the corresponding output matrix of order p, then F=adj[c n uC 1 2 (adjC 2 2 )C 2 1 ]
(8.11)
CuuC12(adjC22)C21=[^]
(8.12)
2 4,=4°u Ut£ u Wncf>)
(8.13)
Write
Then we have
Since m^ is the switching function from node k to node t of the circuit corresponding to C22, it follows that
mkt=\Jf(p'kt)
(8.14)
where p'^ is a directed path from node k to node t in the sectional graph G[A], where A is the node set corresponding to the submatrix C22, and the union is taken over all p'b € G[A\. Therefore, we have
Pa
=1
fori = j
(8.15)
where py is a directed path from node / to node j in the sectional graph G[A U {/, 7'}], where A u {/, j] is the set union of the nodes /, j and the node set A, and the union is taken over all /?,-, e G [ / 1 U { J , 7'}]. This leads to the following result. THEOREM 8.6 Let Vm be the subset of the node set V of a given net G corresponding to the non-output nodes of V. Then the nets Gr and G have the same output matrix, where Gr is derived from G by the following procedure:
8.1 BOOLEAN MATRICES AND SWITCHING NETS
577
(a) Remove G[Vm] from G, i.e., remove all nodes in Vm and also all arcs incident to and outgoing from any node in Vm. Arcs which do not previously exist in G may be considered as arcs which map to zero, i.e., f(i, j) = 0 for all (i, j) not in G where / is the mapping function of G. (b)
fr{(i,j))={jf{pijl
fori*j
Pa
=1
for* = ;
(8.16)
for all i, j e (V - Vm), where fr is the mapping function of Gr; V - Vm represents the nodes contained in V but not in Vm; />,-,- is a directed path from node i to node j in the sectional graph G\vm u{i,/}], where Vm u{i,y} is the set union of the nodes i, j and the node set Vm, and the union is taken over all ptj e G[Vmv{i,j}]. We remark that if Vm contains only one node, the above theorem reduces to the star-mesh transformation of Hohn and Schissler (1955). One advantage of the topological reduction process is that it not only displays in a very intuitive manner the causal relationships among the variables of the system under study, but also shows that the process is independent of the labeling of the nodes. Example 8.1 Consider the net G shown in Fig. 8.2 representing a switching circuit. The part enclosed within the circular line is the sectional graph to be removed. The reduced net Gr is presented in Fig. 8.3. For convenience, the intersection " n " and bar will be replaced by juxtaposition and "" " in all the figures, respectively. In fact, the above process can also be applied to nets representing sequential circuits. With minor modifications, this process is equivalent to a 'multiple node state removal' algorithm. Let G[A] be the sectional graph to be removed from a state diagram G, where A is a set of states. If there exist self-loops in G[A], the process shown in Fig. 8.4 must first be employed in order to eliminate all such self-loops, where A; is a nonnegative integer. After all the self-loops having been removed, Theorem 8.6 can now be applied to obtain the corresponding reduced state diagram.
578
OTHER NET APPLICATIONS
Fig. 8.2. A net G used to illustrate the multiple-node removal process, in which d*=d.
a*b*cVa*bc
Fig. 8.3. The corresponding reduced net Gr of the net G of Fig. 8.2, in which
8.2 TELLEGEN'S THEOREM
579
(a)
(b) hi=ciu\\Jbkci
U=
l,2,...,n.
Fig. 8.4. (a) A node with a self-loop, (b) With the self-loop removed.
Example 8.2 Consider the state diagram of Fig. 8.5(a). The part enclosed within a circular line is the sectional graph to be removed. Figure 8.5(b) is the corresponding reduced state diagram. 8.2
TELLEGEN'S THEOREM
Kirchhoff's current and voltage laws are algebraic constraints arising from the interconnection of network elements and are independent of their physical characteristics. As a consequence we show that they imply the conservation of energy. In other words, conservation of energy need not be an added postulate for the discipline of electrical network theory.
580
OTHER NET APPLICATIONS
(ft)
ba
(b) g=aavl\Jabka
k \ubb
Fig. 8.5. Example used to illustrate the multiple state removal process.
8.2 TELLEGEN'S THEOREM
581
For a given electrical network N modeled by an n-node directed graph or net G of rank r and nullity m, it fulfills Kirchhoff's current law (KCL) and Kirchhoff's voltage law (KVL) if and only if its branch-current vector i(t) and branch-voltage vector v(/) satisfy the equations 0(0 =0
(8.17a)
Bv(0 = 0
(8.17b)
where Q and B are a basis cutset or cut matrix and a basis circuit matrix of G. The most general solutions of i(t) and v(0 satisfying (8.17) can be written as i(t) = B'im{t) v(r) =
(8.18a) fi'vc(0
(8.18b)
where im{t) is an arbitrary m-vector, a vector consisting of m elements, and vc(r) an arbitrary /--vector. To verify we compute Qi(t) = QB'im(t) = (QB')im(t) = 0im(t) = 0
(8.19a)
Bv{t) = BQ'vc{t) = (QB')vc(t) = 0vc(t) = 0
(8-1%)
since from (1.121) QB' = 0. As a result, if G contains b branches, we immediately have X v* (0«t (0 = y'(t)i (0 = v'c (t)QB'im (0 = v'c (t)(QB% (r) = v'c (Wm {t) = 0 k=\
(8.20) showing that the sum of instantaneous powers delivered to all the elements, the voltages and currents of which are respectively vk(t) and ik(t), is equal to zero. If we integrate (8.20) between any two limits t0 and t, we obtain the total energy stored in the network from t0 to t as w(0 = X j vk {x)ik {x)dx = constant
(8.21)
k=\ '°
Stated differently, (8.21) shows that conservation of energy is a direct consequence of Kirchhoff's two laws, KCL and KVL, and there is no need to add the postulate that the total energy (electric, mechanical, thermal, or otherwise) is conservative in the discipline of electrical network theory.
582
OTHER NET APPLICATIONS
Since Kirchhoff s laws are independent of the characteristics of the network elements, an even more general result can be stated. Consider another network N having the same associated directed graph G. Let i (t) and v(t) denote the branch-current and branch-voltage vectors of N. Then we have i{t) = B'im{t)
(8.22a)
v(t) = Q'vc(t)
(8.22b)
where im (t) and vc (t) are arbitrary m-vector and r-vector, respectively. We can now compute v'{t)i (t) = v'c (t)QB'im (t) = 0
(8.23a)
v'(t)i(t) = v'c(t)QB'im(t) = 0
(8.23b)
By taking the transposes of these equations and observing that the transpose of a scalar - namely, a 1 x 1 matrix - is itself, we obtain several variations (8.23) as follows: v'(t)i{t) = v\t)i{t) = i'{t)v{t) =i\t)v{t) = 0
(8.24)
Equation (8.24) is referred to as the Tellegen's theorem due to Tellegen (1953). The entity v'(t)i(t) does not have any physical significance as the sum of instantaneous powers because v(t) and i (t) belong to two different networks N and N. We emphasize that Tellegen's theorem is valid under the assumption that two different networks under consideration have the same topology - namely, the same associated directed graph. The theorem remains valid whether the networks are linear or nonlinear and time invariant or time varying. In addition to its fundamental importance, the theorem provides a way to check the accuracy of the numerical results of a computer solution. After all the voltages and currents are computed, the sum of the products of the corresponding terms must be zero for every value of t. Another important application is its fundamental role in sensitivity analysis through adjoint networks. This aspect, however, will not be discussed here. We illustrate the above result by the following examples. Example 8.3 Consider the networks N and N in Fig. 8.6, the associated directed graph of which is shown in Fig. 8.7. The branch-current and the branch-voltage vectors of N and N are easily shown to be
8.2 TELLEGEN'S THEOREM
6ii
212
AA/V
vQ
AVv
®
4Q
1A
(a) Network W
V4 = 2(3
3ii
A/W 2A
®
V -,
5Q.
\>
9Q
(fo) Network JV Fig. 8.6. Two electrical networks N and N possessing the same topology.
-0-
« es
Fig. 8.7. The associated directed graph of the networks of Fig. 8.6.
583
584
OTHER NET APPLICATIONS
"1 " 3 1
I =
3 2 3
-1 1
,
v=
" 2" 2 ~3 8 , 3
-6
26 . 3 .
2~
'
-2 3
C1 I = ~2 1 2 1 . 2 .
^ » v=
27~ 2 -6 15 2
(8.25)
-3 9 2
Since the two networks have the same topology, Tellegen's theorem applies. It is straightforward to verify (8.24), as we have
,f = IV = 2x2 + (-|)x(-2)+fiy-ll+(-6)xf-i > |+ \3 J \
2
V 2J
)
-THIH (8.26a)
vi=iv=
27
(l) + (-6)x r v
n 3
15
^+(-3)x(-l)+
y
fo\
v2.
xl = 0
(8.26b) Example 8.4 In the networks N of Fig. 8.8, the current i\ is known to be -830/541 A, and the current i2 is -50/541 A. Suppose that a voltage source of v2 = 20 V replaces the shorted wire between terminals c and d, and a 6-£2 resistor replaces the 10-V generator connected between terminals a and b as indicated in Fig. 8.9. We wish to compute the current in the 6-Q. resistor by means of Tellegen's theorem. The associated directed graph G of the networks N and N of Figs. 8.8 and 8.9 is presented in Fig. 8.10. The branch voltage and the branch current associated with the arc ek are denoted by vk and ik for N, and v* and ik for N. By (8.24) we have
i
v'i = vi?i + v2i2 + X vkh = 0
(8.27)
A=3
Denote by Rk the resistance associated with arc ek (k = 3, 4, ..., 9). Then from (8.27) vji +V2l2
=-YlRkkk *=3
(8.28)
8.2 TELLEGEN'S THEOREM
585
4Q
•AA/V
aQ-
2n
10
3n
^6
-O
AAAr 8fi
7Q
9Q
AAAr
foO-
Fig. 8.8. A given resistive network N.
4£2
aQ-
-WW2£2
3Si
o 20 V
6£2
in
AA/V
7£2
8£i
9Q
foO"
AA/v
Fig. 8.9. A resistive network having the same topology as that of Fig. 8.8.
586
OTHER NET APPLICATIONS
W Vcj
^d
eA f
/^ei
e&
c
ei
\ f t j ^ e
9
eg
bi
^
Fig. 8.10. The associated directed graph G of the networks of Figs. 8.8 and 8.9.
Likewise, using v'i = 0 yields 9
I
(8.29)
*=3
Equating (8.28) and (8.29) gives Vil'i + V 2 / 2 =Vll'i
(8.30)
+V2l2
Substituting the known values in (8.30), we get 10/"i +0/ 2 =vi
f
830^ + 20x 541
541
(8.31)
which in conjunction with vi = 6/1 gives the solution * *i
8.3
= -
300 = -0.096 A 3117
(8.32)
GENERALIZED SIGNAL-FLOW GRAPHS
In electrical network theory, Tellegen's theorem and its generalized form play an important role. See, for example, Penfield, Spence, and Duniker (1970a). It has also been extended to linear and nonlinear electrical networks using the operator concept by Penfield, Spence, and Duniker (1970) and Kishi and Kida (1968). This theorem is a direct consequence
8.3 GENERALIZED SIGNAL-FLOW GRAPHS
587
of the fact that the branch voltages and currents of the network satisfy Kirchhoff's laws. In addition, many systems such as the digital filters can be represented by the signal-flow graphs. Since signals in a signal-flow graph are not required to satisfy Kirchhoff's laws, Tellegen's theorem cannot generally apply to the signal-flow graph. As shown by Seviora and Sablatash (1971), there exists a similar relation for signal-flow graphs and digital filters. This relation holds for two distinct but isomorphic signal-flow graphs and has been applied to generalized signal-flow graphs called the signal flow networks having complementary topology by Fettweis (1971, 1973). In the present section, we provide a generalized version of this relation by introducing an operator in a signal-flow graph, as opposed to the signal flow network. This section is based mostly on the work of Sengoku and Chen (1988). 8.3.1
Generalized Signal Flow Graph and Tellegen's Theorem
As described in the preceding chapter, a signal-flow graph is used to represent a system of simultaneous linear algebraic equations, and is modeled as a net. For an arc ek = (i, j), let zk and xk be its input and output signals, respectively. If the transmittance of ek is ay, then, as depicted in Fig. 8.11(a), xk = aijzk. This transmittance can be generalized as shown in Fig. 8.11(b), where the output signal is a function of the input signal, or xk=fij(zk)
(8.33)
where /;/(•) is a function. In particular, if fij(zk) = aijZk, it reduces to that of Fig. 8.11(a). Furthermore, an arc can be generalized to a block or multi-port arc as indicated in Fig. 8.11(c), and the resulting signal-flow graph is called a signal flow network by Fettweis (1971, 1973). In the following, we shall only consider the situation of Fig. 8.11(b) and call the resulting signal-flow graph a generalized signal-flow graph. For simplicity, we use the arrow as in Fig. 8.11(a) instead of the configuration of Fig. 8.11(b) for an arc. Before proceeding, we first define a few terms. Let G(V, E, f) or simply G be a directed graph or net with node set V, arc set E and transmittance function / such that fk (•) denotes the transmittance of the arc ek e E. Let S+i = {ek\ek=(i,j)eE}
(8.34a)
S-i = {ek\ek=(jJ)eE}
(8.34b)
588
OTHER NET APPLICATIONS
(Xij
iO-
Oj ek
ek
(a)
(b)
ooo (c)
Fig. 8.11. Signals in a generalized signal-flow graph.
be the sets of arcs of G whose initial node and terminal node is node i, respectively. Three types of signals can appear in G: nodal signal, the input signal of an arc, and the output signal of an arc. The net G(V, E,f) is said to be a generalized signal-flow graph if its signals obey the following rules: (i) For an arc ek = (i, j), its input signal zt is equal to the nodal signal y, of the node /. (ii) If xk is the output signal of ek = (i, j), whereas zk is its input signal, then Xk = fk {Zk )
(8.35)
which, in conjunction with (i), gives Xk = fk (y; )
(8.36)
(iii)
yj= X
x
n
(8.37)
where v; is the nodal signal of node j and xk is the output signal of arc ek.
8.3 GENERALIZED SIGNAL-FLOW GRAPHS
589
(iii) The nodal signal of a source is an arbitrary constant. If S i=(j), node i is referred to as a source, and if S+i = 0 node i is called a sink. Let G(V, E) and G'(V',E') be two isomorphic signal-flow graphs. Write V={l,2,3,...}
(8.38a)
V' = {l',2',3',...}
(8.38b)
E = \elte2,e3,..}
(8.38c)
E' = {e[,e2,e'3,...}
(8.38d)
where isV corresponds to i'eV', and e,;e E to e'i&E'. Furthermore, since G and G' are isomorphic, ek = (/, j) if e* = (/', / ) and e'k - (i\ j') if ek = (i, j)- Also, let xk and xk be the output signals of the corresponding arcs ek and e'k, and let y, and j , ' be the nodal signals of the corresponding nodes i and i' in G and G', respectively. Then we can state the following theorem due to Seviora, and Sablatash (1971), and is known as the Tellegen's theorem for signal-flow graphs, which is a special case of Theorem 8.8 to be stated and proved shortly. THEOREM 8.7 If G(V, E) and G'(V',E') are two isomorphic generalized signal-flow graphs with ek - (ik, jk ) and e'k = (i'k, j'k ) for all k, then
Z?.fc **=£/;»** k=\
(8.39)
k=\
where |E| denotes the number of elements in E. For our purposes, we adopt the following notation. Let ek = (ik, jk) and e'k - (ik, j'k) for all k. Equation like (8.39) can be rewritten as
et=(.i,j)^E
et=(i',j')sE'
If there is a one-to-one correspondence between nodes i e V and nodes /'e V', instead of using (8.40a) we use the simplified expression
,£
^4=
£
*'*
(8.40b)
590
OTHER NET APPLICATIONS
When G and G' are isomorphic, we write yjx'k
X ek=(i,j)eE
=
X
y'jxk
ek=(i,j)eE
(8.40c)
and use the simplified expressions
X y ' t = X >«• feV
(8.41a)
i'eV
X ** = X ** e*e£
(8.41b)
e*e£'
Note that the weight function /(•) of an arc is not necessarily linear, and the resulting signal-flow graphs G and G' may be nonlinear. 8.3.2
Operators for Two Isomorphic Signal-Flow Graph
In this section, we present a different version of Tellegen's theorem for generalized signal-flow graphs. DEFINITION 8.3 SFG Operator. Let G(V, E) and G'(V',E') be two isomorphic generalized signal-flow graphs. A function FG(y,x) is said to be a SFG operator simply an operator for G and G' if it satisfies the relation
X et=(i,j)EE
F
c{yj,4)=
X
Fc(y'j,xk)
(842)
et=(/',7>£
where y7 and y'j are the nodal signals of the corresponding nodes ; ' e V and j'e V', and x^ and x'k are the output signals of the corresponding arcs ek e E and e'k e E', respectively. Before proceeding, let us first define a few terms. Let Si ={y,} and ^2 = \Xi} be two signal spaces, where v, and x, are complex functions of the complex variables t\, t2, .... Let v, and x, be the nodal signals and the output signals of the arcs, respectively. For y, j i , y2 e Si and x,x-[,x2 e S2, we say that (i) an operator F(y, x) is symmetric, if F(y,x) = F(x,y)
(8.43)
8.3 GENERALIZED SIGNAL-FLOW GRAPHS
591
(ii) an operator F(y, x) is additive with respect to y or x, if F(yi +y2,x)=F{yi,x)+F(y2,x)
(8.44a)
F{y,xl+x2)=F(y,xl)+F(y,x2)
(8.44b)
or
(iii) an operator F(y, x) is biadditive, if both (8.44a) and (8.44b) hold, and (iv) an operator F(y, x) is bilinear, if F(y, x) is biadditive and F(ax, y) = F(x,ay) = aF(x, y)
(8.45)
for any constant a. For example, the operator F1(y,x) = yx
(8.46)
is symmetric, additive, biadditive and bilinear. However, the operator F2{y,x) = yx*
(8.47)
is biadditive but is not symmetric, where x* denotes the complex conjugate of x. The operator F3(y,x) = yx*-y*x
(8.48)
is also biadditive but is not symmetric. The operators F4(y,x) = yx-y*x*
(8.49)
F5(y,x) = yx+y*x*
(8.50)
F6(y,x) = yx*+y*x
(8.51)
are symmetric and biadditive. If y and x are differentiable with respect to tx, the operator IT
i
\
dx
dy
Fi(y,x) = y — -x— dt\
(8.52)
ati
is biadditive but is not symmetric. On the other hand, the operator 17 /
\
dx
Fs(y,x) = y is symmetric and biadditive.
ay +
x~
(8.53)
592
OTHER NET APPLICATIONS
THEOREM 8.8 Fc(y>x) is a SFG operator if and only if it is symmetric and FG (x + y, z) + c = FG (x, z) + FG {y, z)
(8.54)
where c is a constant such that FG O,0) = c. Proof. Necessity. If FG(y,x) is a SFG operator, it must satisfy (8.42) for any two isomorphic generalized signal-flow graphs. In particular, consider the two isomorphic graphs G and G' of Fig. 8.12. Invoking (8.42) yields FG(y2,x[)=FG(y'2,xl)
(8.55)
By definition we have yi=x\,
yi=x[
(8.56)
Substituting these in (8.55) gives FG{x\,x[)=FG{x[,xx)
(8.57)
for all signals x\ and x[, showing that FG{y,x) is symmetric. Now consider another two isomorphic signal-flow graphs G and G' of Fig. 8.13. Again invoking (8.42) obtains F,G{y2,x[)+ FG{y2,x'2)= FG{y'2,xx)+ FG(y'2,x2)
(8.58)
Since y2 = x\ + x2 and y'2 = x[ + x'2, we have FG(xi +x2,xi)+FG(xi
+x2,x'2)=FG(x[
+x'2,xi)+ FG{x[
+x'2,x2) (8.59)
Setting x[ = x'2 gives 2FG (Xl +x2,x[)= FG (2x[ ,xi)+FG (2x[, x2)
(8.60)
Letting X\ — X2 and xi = 0 in (8.60) and applying the symmetric property of (8.57) yield ,XI)= FG(xu0)
(8.61)
Now setting x2 = 0 in (8.60) and using the property of (8.61), we get 2FG (Xl,x[)= FG (2x[,Xl)+ FG {2x[,0)=FG {2x[,xx)+ FG (x[,0)
(8.62)
8.3 GENERALIZED SIGNAL-FLOW GRAPHS
- Q yi
yiO-
X\
y'
593
Oy'2
G'
G
Fig. 8.12. Two isomorphic generalized signal-flow graphs G and G'.
Fig. 8.13. Two isomorphic generalized signal-flow graphs G and G'.
Using this in (8.60) obtains 2FG fa + x2, x{) = 2FG (xi, x[) + FG {lx[ ,x2)-FG
(x{ ,0)
= 2FG (xi,x[)- FG (x{,0)+ 2FG (x2,x[)-
FG {x[,0) (8.63a)
or FG (xi +x2,x[)= FG (xi ,x[)+ FG (x2 ,x[)- FG (x[ ,0)
(8.63b)
Applying the symmetric property of (8.57) and (8.63b) to (8.58), we obtain FG{y2,x[)+FG(y2,x'2) = FG (x{,y2 )+FG(x2,y2)=
FG (x[ + x2, y2 )+ FG (y2,0)
= FG {yi, x[ + x'2 )+ FG {y2,0)= FG (y'2 ,xx)+FG {y'2, x2 ) = FG{y2,Xl+x2)+FG(y2,0)
(8.64)
which can be rewritten as FG(y2,y'2)+
FG(y2,0)= FG(y'2,y2)+
FG(y'2,0)
(8.65)
Since y2 is independent of y'2, it follows that FG(y2,0)=c
(8.66)
594
OTHER NET APPLICATIONS
Combining this with (8.63b) shows that FG(xi +X2,X[)+C
=
FG(XUX[)+FG(X2,X[)
Thus, the conditions that FG(y,x) necessary.
(8.67)
be symmetric and satisfy (8.54) are
Sufficiency. Let G(V, E) and G'(V, E) be two isomorphic generalized signal-flow graphs, and let S c V be the set of source nodes of G. As before, i e V corresponds to i'e V and ek e E and e'k e E'. We have
X ek=(i,j)eE
^b(y7.4)=X X Fc(y7,4)
(8.68)
j e S eke6 j jeV
From (8.54) we have F
c(:y/'*0=FG yj> X x'k + Ci\S~j\-1)
X
(8.69)
ek(Ed~j
e*e<> J
From (8.37), (8.69) can be rewritten as F
X ekeS
c{yj,4)=
FG(yj,y'j)+c[\s-j\-l)
(8.70)
j
where y'j= X x'k
(8.71)
ek<=S~j
Substituting this in (8.68) yields
X ek=(i,j)eE
Fo{yj,4)=j:\Fo(yj,y'j)+4s-j\-4
(8.72)
US
Likewise, we obtain
X ek=(iJ)cE
FG(y),xk)=J,\FG(y'j,yj)+c(\d-j\-ll
(8.73)
8.3 GENERALIZED SIGNAL-FLOW GRAPHS
595
Since FG(y,x) is symmetric, (8.72) and (8.73) show that
X
FG(yj,4)=
et=(.i,j)eE
X
FG(y'j,xk)
(8.74)
et=(,i,j)zE
This completes the proof of the theorem. If, in addition, the function FG(y,x) following corollary.
is continuous, we obtain the
COROLLARY 8.6 A continuous real function FG (y, x) with respect to real variables y and x is a SFG operator for two isomorphic generalized signal-flow graphs if and only if FG(y,x)=H(y,x)+c
(8.75)
where H(y,x) is continuous, symmetric and bilinear, and c is a real constant such that FG(x,0) = c. Proof. To prove necessity, let FG(y,x)= H(y,x)+c. we have
From Theorem 8.8
H(y,x)=H(x,y)
(8.76)
H(y + x,z)=H(y,z)+H(x,z)
(8.77)
H(z,y + x)=H(z,y)+H(z,x)
(8.78)
which together gives
To show that H(x, y) is bilinear, we must demonstrate that H{ay,x)=H{y,ax)=aH{y,x)
(8.79)
To this end, let x - 0 in (8.77), and obtains H{y,z)=H(y,z)+H(0,z)
(8.80)
implying that H(0,z) = H(z,0) = 0
(8.81)
596
OTHER NET APPLICATIONS
Next setting y = -x in (8.77) yields H(0,z)=H(-x,z)+H{x,z)
(8.82)
Combining this with (8.81) gives H(-x,z)=-H(x,z)
(8.83)
In view of (8.81), it needs only to show that (8.79) holds for a > 0. Since H(y, z) is continuous, it is sufficient to show that (8.79) holds under the condition that a = jlk, where j and k are positive integers. Because, for a positive real number a, a rational number or sequence yn > 0 converges to a or ^« - > a
(8.84)
it follows that if H(yny,x)=y„H(y,x), by continuity of H(ay,x) = aH(y,x) as « ^ « . . From (8.77) we have
H(y,x),
H(jy,x)= H(y+ y + ...+ y,x)= H(y,x)+ H(y,x)+... + H(y,x)=
jH(y,x) (8.85)
If y = kz, then H (jkz, x) = jH (kz, x) = kH (jz, x)
(8.86)
If z = ulk, then jH{u,x)=kH
—u,x k
(8.87)
or H —u,x = ~H(u,x) k j k
(8.88)
which proves (8.79). Conversely, if H(y, x) is symmetric and bilinear, (8.77) holds and hence (8.54). By Theorem 8.8, FG(x,y) is a SFG operator. We remark that since FG (y,x)= yx satisfies the condition of Theorem 8.8 or Corollary 8.6, FG(y,x)- yx is a SFG operator, and Theorem 8.7 follows.
8.3 GENERALIZED SIGNAL-FLOW GRAPHS
8.3.3
597
Operators for Two Non-Isomorphic Signal-Flow Graph
In the preceding section, we discussed a SFG operator for two isomorphic generalized signal-flow graphs. In the present section, we extend this result to two not necessarily isomorphic generalized signal-flow graphs. Let G(V, E) and G'(y',E') be two not necessarily isomorphic generalized signal-flow graphs satisfying the following condition: Condition A: Except for the sources, all other nodes of V and V' are in one-to-one correspondence. Let S c V and S'
DEFINITION 8.4 SFG Operator. A function F(y, x) is said to be a SFG operator or simply an operator if for any two generalized signal-flow graphs G(V, E) and G'(V',E') satisfying condition A, it satisfies the relation £ e'k=(i',j')eE'
F
(yj>*k)=
X
F
(y'j'xk)
(8-89)
ek=(i,j)eE
where yj and y) are the nodal signals of the corresponding nodes jeV and j'sV', and x^ and x'k are the output signals of the corresponding arcs e^ e E and e'k e E', respectively. We remark that, for simplicity, we have used the same term SFG operator but different symbols in Definitions 8.3 and 8.4. Now we can state the following.
THEOREM 8.9 F{y,x) is a SFG operator for two not necessarily isomorphic generalized signal-flow graphs G(V, E) and G'(V',E') satisfying condition A with \E\ = \El if, and only if, it is symmetric and F(x + y,z) + c = F(x,z) + F(y,z) where c is a constant such that F(x,0) = c.
(8.90)
598
OTHER NET APPLICATIONS
Proof. Necessity. Since F(y,x) must satisfy (8.89) for any two G(V, E) and G'(V',E') satisfying condition A with |is| = |.El, in particular it must satisfy (8.89) when G and G' are isomorphic. The generalized signalflows graphs of Figs. 8.12 and 8.13 are such examples. The necessity follows from a proof similar to that of Theorem 8.8. Sufficiency. Assume that F(y,x) is symmetric and satisfies (8.90). The left-hand side of (8.89) can be rewritten as F
X
X F(yj>x'k)
bj>Xk)= X j'iS' j'eV
e'k=(i',j')eE'
(8.91)
e'ke$ /
Applying (8.90) shows
y;> X x'k e'keS-j'
+*(M-1)
(8.92)
According to (8.37), we have
y) = X x'k
(8.93)
e'ksS-f
Substituting these in (8.91) yields
1 X *W*)=X X ^.t)=X[^./;)+^(MJ 4=('',/)e£" jVS' e' es-j' j'tS' k
j'eV'
(8.94) Likewise, we obtain
X
*•&.**)= X 1 jiS jeV
ek=(i,j)eE
Hy'j>xkhl[F(y'j,yj)+c(\s-j\-i)]
eksS j
jeV
(8.95) In (8.94) and (8.95), since V and V' satisfy condition A with \E\ = \E'\ and F(y,x) is symmetric, it follows that X ek=(i',j')eE'
F
(yj>xk)=
X ek=(i,j)eE
This completes the proof of the theorem.
F
(y'j>xk)
(8.96)
8.3 GENERALIZED SIGNAL-FLOW GRAPHS
599
COROLLARY 8.7 A continuous real function F(y,x) with respect to real variables y and x is a SFG operator for any two generalized signal-flow graphs satisfying condition A and possessing the same number of arcs if and only if F(y,x)=H(y,x)+c
(8.97)
where H(y,x) is continuous, symmetric and bilinear, and c is a real constant such that F(x, 0)-C. The corollary can be proved in a manner similar to that of Corollary 8.6, its proof being omitted. In the situation where the two generalized signalflow graphs do not possess the same number of arcs, we have the following more general result. THEOREM 8.10 F(y,x) is a SFG operator for any two generalized signal-flow graphs if, and only if, it is symmetric and additive. Proof. Necessity. F{y,x) is a SFG operator satisfying (8.89) for any two generalized signal-flow graphs G(V, E) and G\V', E') meeting condition A. First, we consider the graphs G and G' satisfying condition A and \E\ = \E'\. From Theorem 8.9, F(y,x) must be symmetric and satisfies (8.90). Next, we consider the graphs G and G' satisfying condition A and having different number of arcs or l^l ^ \E'\. Then (8.94) and (8.95) apply. Since F(y,x) satisfies (8.89), this in conjunction with (8.94) and (8.95) implies that c = 0. Thus, F(y,x) is symmetric and additive. Sufficiency. It can be proved in a manner similar to that of Theorem 8.9 except for c = 0. The details are omitted. COROLLARY 8.8 A continuous real function F(y, x) with respect to real variables y and x is a SFG operator for any two generalized signal-flow graphs satisfying condition A if and only if it is symmetric and bilinear. Thus, from Theorem 8.10, the following are SFG operators: Fl(y,x) = yx
(8.98a)
600
OTHER NET APPLICATIONS
F4(y,x) = yx-y*x*
(8.98b)
Fs(y,x) = yx + y*x*
(8.98c)
F6(y,x) = yx*+y*x
(8.98d)
Fs(y,x) = y — + x—
(8.98e)
For a SFG operator F(y, x), y and x are signals of nodes and arcs. Let \jf be an additive operator which transforms one set of signals of nodes and arcs to another: y=w(y)
(8.99a)
x=y/(x)
(8.99b)
Let Fv(y,x) be a symmetric and additive operator. Then by Theorem 8.10, Fv(y,x) is a SFG operator. Since y/ is additive, Fv(y/(y),\i/(x)) is also symmetric and additive with respect to y and x. By Theorem 8.10, Fv(yf(y),yr(x)) is a SFG operator F(y,x): F(y,x) = Fv(¥(y),¥(x))=Fv{y,x)
(8.100)
Hence (8.89) can be rewritten as
X
^(y,,4)=
X
F
&'**)
( 8101 )
Since Fv,(y,x) is a SFG operator, we can state that for signals y and 3c derived from v and x through an operator y/, respectively, F(y,x) also possesses the property (8.89) for a SFG operator F(y,x). Clearly, the operator y/ includes the linear transformations such as the Fourier transform and the z-transform. In particular, if we let F¥(y,x) = yx in (8.101), then for signals Y and X derived from y and x, respectively, through a linear transformation, we obtain
X el=(i',f)EE'
YjX'k=
X
Y
'JX*
(8-102)
et=(i,j)eE
This result is well known in digital signal processing (see, for example, Fettweis (1971) and Oppenheim and Schafer (1975).
8.3 GENERALIZED SIGNAL-FLOW GRAPHS
8.3.4
601
Applications of the SFG Operator
In this section, we present some applications of the SFG operator. However, before we do this, we show how to treat the source and sink as arcs and define the graph transmission in a generalized signal-flow graph. The source and sink can be treated as arcs by using the self-loop of Fig. 8.14, where *k
(8.103)
=fk{yi)=d
i: source, if d * 0
(8.104)
i: sink, if d = 0
(8.105)
We remark that in (8.104) d may be zero if the forcing at node / is not required. Next, we define the graph transmission in a generalized signal-flow graph G(V, E). Let 5 c V be the set of sources of G. Attach a self-loop of (8.103) to each of its sources and sinks. For any two chosen nodes i, je V, if i is not a source, attach a self-loop of (8.103) and (8.104) to i, and if j is not a sink, attach a self-loop of (8.103) and (8.105) toy. For simplicity, let the self-loops attached to node m e V be em. The graph transmission or gain Ty from node / to node j in a generalized signal-flow graph G is defined as
Xi x,*0 and xt=0 for keS-{i}
(8.106)
if i is a source.
r. -1L Xi
(8.107) JC,-*0 and **=()
for
keS
if / is not a source. We remark that in the definition if i is a source, (8.106) becomes Ttj-
yj Xi*0 and xk=0 for keS-{i}
(8.108)
because xt = yt, but if / is not a source, Ttj is not always equal to
yt
(8.109) * , * 0 and Xk = Q for keS
602
OTHER NET APPLICATIONS
Fig. 8.14. Representation of a source or a sink by means of a self-loop.
Note that the value of the graph transmission Ty remains unaltered whether or not node j is a sink. The graph transmission Ttj from node i to node j equals the ratio of the signal of node j to that of node i if i is a source, and it is not always equal to this ratio if i is not a source. A linear signal-flow graph is a signal-flow graph in which every arc function fk(.) except for the self-loops of the sources and sinks is linear fk(y) = a£y. where ak is a constant. Many graph-theoretic properties of linear signal-flow graphs are known. For instance, it is known that the graph transmission from source to sink of a linear signal-flow graph G with one source and one sink is equal to the graph transmission from source to sink of the graph G' obtained from G by reversing the direction of every arc with the same arc function, in which the value of the function of the self-loop of the source or sink is changed. The graph G' is referred to as the transposed graph of G. This property is used for the realization of digital filters, and may not hold for nonlinear signal flow graphs. We can now state the following result using the SFG operator. THEOREM 8.11 The graph transmission from source to sink in a signal flow graph with one source and one sink equals that of its transposed graph if, and only if, it is a linear signal flow graph. Proof. Necessity. Consider a signal-flow graph G(V, E) and its transposed graph G'(y',£') of Fig. 8.15. In G and G', attach self-loops to represent the source and sink. If ie V corresponds to i'e V' for i = 1, 2. Then G and G' satisfy condition A, and a SFG operator F{y,x) can be chosen and applied to G and G'. Let F(y,x)= yx, which satisfy the conditions of Theorem 8.9 or 8.10. From (8.89) and Fig. 8.15, we obtain yxx's + yix[ + y2x'0 = y[xs + y'2xy + y'2x0
(8.110)
Setting V! = xs, y2 =x'0, x0 = 0 and x's = 0 in (8.110) yields yix[ + y2y'2 = y[yi + y'2xi
(8.111)
8.3 GENERALIZED SIGNAL-FLOW GRAPHS
y.G>—•—*-©»
©-=—<
G
603
(^
y*
G'
Fig. 8.15. A signal-flow graph G and its transposed graph G', where eo = c'j and x'0 = x's.
Since G' is the transposed signal-flow graph of G, we have *i=/i'(y2)=/i(y0
( 8 - 112 )
Substituting this in (8.111) gives yifi(y2)+y2y'2
= y'iy\ + y2fi(yi)
(8.113)
Since the graph transmissions from source to sink in G and G' are identical, it follows that yi y[ — =— yi y2
(8.114)
Combining this with (8.113), we obtain /i (yi)
/i iy'i)
yi
y2
(8.115)
Because yl is independent of y'2 for any yi and y'2, for (8.115) to hold it must be a constant, or /i(yi) = yi
fxiy'i) „ 1— = ai y2
(8.116) v
'
where «[ is a constant. Therefore, the arc function is linear or /i(yi)=aiyi
(8.H7)
Sufficiency. Assume that all the arc functions are linear or /,(y) = a,v for all i. In G and G' let s,? e V and ?',s'e V' be the source and the sink of G and G', respectively. If the self-loops are attached to the nodes of the source and sink in G and G', the resulting graphs satisfy condition A.
604
OTHER NET APPLICATIONS
For simplicity, let these new graphs still be represented by G and G', respectively. Let the self-loops of the source and the sink of G be es and gj, respectively. Then the self-loops of the source and sink of G' are e'~s and es, respectively. By choosing F(y,x)- yx in (8.89), we obtain X
yj4=
X
y'jxk
(8-118)
We remark that ek and e'k are not the corresponding arcs in (8.118). Next, we apply (8.118) to G and G''• If xk = fk (yt) = ak j , for an arc ek -{i, j) e E of G, there is an arc e'k = ( / , i')e E' with x'k - fk (y'j )= a'k y) = ak y) in G', where k^s,s. Then (8.118) can be rewritten as
^
f X
y&ky'j
^«ii=(/,'')e£"-{es.^}
+ ys*s + ysXs
X
y'jakyi + ^ ^ + 7 ^ ^
(8.119)
k ^=(i',7')eE-{e s ,ej}
Note that in this equation, e'k in G' denotes the arc whose direction is opposite to that of ek in G. Hence, (8.118) becomes ysx's + ysX~ =y'sxs+y'sXs
(8.120)
Since .? and s' are the sinks of G and G', respectively, we can set JCJ = 0 and x's =0, and obtain y* y's — = TT
(8-121)
showing that the graph transmission r v j from source s to sink s in G is equal to that T£s in G'. This completes the proof of the theorem. We remark that in Theorem 8.11, the signal-flow graph has only one source and one sink. This result can be extended to include multiple sources and sinks. THEOREM 8.12 The graph transmission Tpq from node p to node q in a linear signal-flow graph G is equal to that T'qp from node q to node p in its transposed signal-flow graph G', or Tpq=T^p
(8.122)
8.3 GENERALIZED SIGNAL-FLOW GRAPHS
605
Proof. Let 5 c V and S c V be the sets of sources and sinks of G(V, E), and let S' c V and S' c V' be the sets of sources and sinks of its transposed graph G'(y',E'), respectively. Attach a self-loop to the node of each source and sink in G and G'. The resulting graphs satisfy condition A. If ps S, attach a self-loop of (8.103) and (8.104) to node p; and if qe S, attach a self-loop of (8.103) and (8.105) to node q. Likewise, attach a self-loop of (8.103) and (8.104) to node q and a self-loop of (8.103) and (8.105) to node p'. Let the self-loops attached to node me V and node tri e V' be em and e'm, and let the sets of self-loops attached to G and G' be denoted by L and L', respectively. For simplicity, the resulting graphs after the attachment are again denoted by G and G'. Choosing F(y,x)=yx in (8.89) yields yjx'k =
X
y Xk
X
e't =(i',/)e E'
'j
(8 123)
et=(i,j)eE
Note again that ek and e'k are not the corresponding arcs in (8.123). Next, we apply (8.123) to G and G'. If xk = fk (y,) = ak y,- for an arc ek = (i, j) e E, there is an arc ek =(j',i')e E' with x'k= fk{y'j)=a'ky'j =aky'j in G', where eA is not an attached self-loop. Using these in (8.123) gives
X
y*4 =
e't=(k'X)&L'
X
y'k**
(s 124) v
ek=(k,k)<=L
'
'
which can be rewritten as yPxp + yqx'q+
yjx)+
Y. /eS'-{p'}
= 3'pJCp + 3 ' ^ +
X
y*4
t'eS'-{?'}
X
y'j*J+
jsS-{p}
X
y***
(8.125)
k<=S-{q}
with jct = 0 for k e S and x) = 0 for j'e S', since 5 and S' are the sets of sinks of G and G', respectively. Set Xj = 0 4=0
for j e S - {p}
(8.126a)
for Jfc'eS' -{?'}
(8.126b)
xp*0
and
JC^O
(8.126c)
Xg=0
and
^=0
(8.126d)
Substituting these in (8.125) results in yqxq=ypxP
(8.127)
606
OTHER NET APPLICATIONS
From (8.126), (8.127), and (8.106) or (8.107) T 1
(8.128)
Xp
pq
T *qp
(8.129)
we obtain T 1
-Z±.-ZJL-T' pq -
-
, -
l
qp
(8.130)
This completes the proof of the theorem. As another example of the usage of SFG operator, consider a linear signal-flow graph G(V, E) and its transposed signal-flow graph G'(y',E') of Fig. 8.16. Assume that G contains only one source and one sink. Let s, s G V and S ^ / e V' be the sources and the sinks of G and G', respectively. If self-loops are attached to the nodes of the sources and sinks of G and G', the resulting graphs satisfy condition A. Denote by es and e-s the source and sink of G, and by e\ and e's the source and sink of G', respectively. As before, the resulting graphs after the self-loop attachment are again represented by G and G'. Choosing F(y,x) = y+x danm dan
(8.131)
which is the same as (8.98e), in (8.89) yields
I
e'k=(i',j')e.E'
dx'k yj-—+Xk
dyj \
,
da„
da„
=I
dXk yj
dan.
et=(i,j)GE
• + xk
da„m
(8.132)
where ek and e'k are not the corresponding arcs. Now, we apply this to G and G'. Since d*k
da„m *k
= 0,
—aijyi>
danm f
Xk
=0 r
(8.133) /
(8.134)
=aiiyi
it follows that aayt «t=(i'./)e£'
da„
= 1
ek=(i,j)£E
, Mjyi yy
da„
(8.135)
8.3 GENERALIZED SIGNAL-FLOW GRAPHS
607
<
G' Fig. 8.16. A linear signal-flow graph G and its transposed graph G', in which 0' = s.
Since G' is the transposed graph of G, it follows that if (/, j) e E then (j',i')e E' and a'jt -aij. As a result daij/danm=0 for i^n and j^m, and (8.135) becomes / fyn , / dy? ^ / 3y, , 3a„my„ , 3xj , 3^ a n my m + x-s + xs = ym — + yj + ys danm o(inm dan da„ dan da„ (8.136)
608
OTHER NET APPLICATIONS
Because x? = 0 , x's = 0 and xs is a constant, (8.136) is simplified to dys
y'myn
(8.137)
or d(ys/xs)^yn
y'm
(8.138)
Since y-s/xs =TsS, yn/xs =Tsn, and from (8.121), y'm/x~ = 7 m j, we obtain the following known result •=T 1
T sn1ms
(8.139)
This formula has been applied to system sensitivity analysis and used as a basis of a deduction method employing Tellegen's theorem for signal flow graphs [see, for example, Fettweis (1971) and Oppenheim and Schafer (1975)]. Finally, we apply the SFG operator
Aa,
Aan (8.140)
to the linear signal-flow graph G(V, E) and its transposed graph G'(V',£') of Fig. 8.16, where y and x are functions of anm, being the coefficient of the function fk(z) = anmz of the arc ek =(n,m), and y(ai) and x{a\) are the values of y and x in the case where anm — a\, respectively. It is straightforward to verify that this operator is symmetric and bilinear. Using this operator in (8.89) results in / ei=(i",/)e£' (
+4 \anm
1 xk \flnm + Aanm )-Xk (anm)
V*nm )
Aanm \ yj (anm + ^nm ) ~ yj {anm ) )
Aa„m
= I
+ Aanm)-
yj \anm)
Aanm
et =(1,7)6 £
,
/
xk(anm)
.
\ y'j (anm +Aanm)- y) {anm )
+ Xk [anm )
Aanm
(8.141)
8.3 GENERALIZED SIGNAL-FLOW GRAPHS
609
where ek and e'k are not the corresponding arcs. We next apply (8.141) to G and G'. Since y\ and x\ of G' do not depend on a„m, we have x'k (anm -f Aanm ) ~ x'k (anm )
(8.142a)
y) (anm + Aanm ) = y) (anm)
(8.142b)
obtaining from (8.141) 2,
xk[anm) M
ei=(i',/)6B'
X
« *nm
>I
\Xk\Pnm~' AGnn)
yj{anm)
Xk\Q,nm)
•*««
,„ - . „ . (8.143)
Since for a linear signal-flow graph G Xk(anm)=aijyi(<*nm)
(8.144a)
Xk(anm)=aijy'i{a„m)
(8.144b)
xk(anm + Aa„m) = aijyi{anm + Aa„m) for i^n,j^m, becomes
(8.144c)
and since (i',j')e E' for (j,i)& E and a'y, ~a,j, (8.143)
,
//
_ ' /
\ yS {anm + Aanm)~
?Jfanm )
\Xp\anm-rAanm)— Xp\a.nm) Aanm
, 'i \X~S (anm + Aanm)- x-s \anm) ' y$ \flnm ) . Aanm -X-v'(n
\*s '^" m
"w / ~ ~*s \flnm)
(8 145^1
Aanm where ep = (n, m) and, as before, s and .v denote the source and sink of G, respectively. Invoking the following relations
610
OTHER NET APPLICATIONS
(8.146a) Xs \flnm T AQ-nm ) = %s \flnm )
(8.146b)
Xs \flnm < AQnm ) = Xs \Onm J
(8.146c)
Xp \flnm ) ~ anm J « \flnm )
(8.146d)
xP (anm + Aanm ) = (anm + Aanm )yn (anm + Aanm)
(8.146e)
in (8.145) yields '( \ys{anm+Aanm)-ys\anm) *s \anm ) — Aa„m
,, \ ( \ = ym \anm hn [a„m + Aanm )
(8.147)
which can be rewritten as Us {anm + Aanm )-y-s (anm)]/xs (anm ) _ y'm (anm ) yn (anm + Aanm ) AQnm _
X$ \Qnm)
Xs
\Clnm)
yn (anm ) j yn (anm + Aanm )-yn (anm )
y'm(anm)
Xs \flnm )
Xs \flnm )
(8.148)
Xs \flnm )
Let yj (anm + Aanm ) - yy- (anm ) *TSj
= Xs Kflnm )
(8.149)
From Theorem 8.12, we have y'm (anm ) _ ~
(8.150)
Xs yO-nm )
Using these in (8.148) results in AZ = Aa„
Tns1jsn+£Tsn)
(8.151)
Likewise, ATsr Aam
~ lmn\Lsn
<
Alsn)
(8.152)
8.4 PERMUTATIONS BY SPAGHETTI AMIDA
611
We remark that the value of Tsq remains unaltered whether or not the node q is a sink. Finally, combining (8.151) and (8.152) gives (8.153)
AT„
The equation states that the ratio of the graph transmission changes ATSs and ATsn by a significant change Aanm of anm is equal to the ratio of the graph transmissions T„js and Tmn of G. Using (8.152) and (8.153), we obtain AT
+sn+ms^Qnm ss =
l-T 1
Aa
(8 154)
"
1
mn'-'unm
This result can also be deduced using Taylor series expansion of ATSg (see, for example, Crochiere (1973). 8.4
PERMUTATIONS BY SPAGHETTI AMIDA
Amida is a traditional scheme of lottery often practiced by Chinese and Japanese children to determine the priority of selecting items of limited supply. The scheme works in the following way: (a) Suppose that four persons, say, Jake, Cooper, Melissa and Jerome are contestants for four different items. Then draw four straight horizontal line segments of equal length and of equal spacing, R = fa, r-i, rj,, r^ }, as shown in Fig. 8.17. The left-hand endpoints of R are called the input and numbered sequentially as 1, 2, 3 and 4. The right-hand endpoints of R are called the output. (b) Each right-hand endpoint is associated with a contestant. One of such associations is indicated in Fig. 8.17. Each contestant is allowed to draw as many vertical lines called the bridges between any two elements of R as he or she wishes. The only restrictions are that the bridges do not cross each other or share the same endpoint such as depicted in Fig. 8.17. (c) To decide the priority, the following rules are used: Pick an input end of a horizontal line segment rk (k = 1, 2, 3, 4) and trace along rk rightwards until the first bridge is met. Then tracing is switched to the bridge and continued upward or downwards until another horizontal line is met. At this point, tracing is now switched again to the
612
OTHER NET APPLICATIONS
horizontal line and proceed rightwards until a bridge is met. This process is continued until one of the output ends is reached. The person associated with this node becomes the one in the £th place. The process is then repeated for other input endpoints. Figure 8.17 illustrates one realization of an Amida scheme on the selection ordering for Jake, Cooper, Melissa and Jerome. The dotted line indicates the trace for the first place. The result is summarized in Table 8.1. It is well known that Amida maps the input one-to-one onto the output so that it always functions correctly as the lottery, meaning that there are no duplications or missing terms. Mathematically, the Amida performs a permutation on the output labels, each bridge between r, and r, performing a transposition (/, j). In Fig. 8.17, we have the following relations: Initial permutation 770 = {Jake, Cooper, Melissa, Jerome} Final permutation Ill0 = {Melissa, Jerome, Jake, Cooper} yielding H 1 0 = (l,3)(2,3)(3,4)(l,2)(l,4)(2,4)(l,3)(3,4)(2,3)(l,2)/70
(8.155)
where the order of the product of the transpositions (i, j) coincides with that of the bridges encountered when the Amida is scanned from the left to the right. In this section, we critically examines the permutation mechanism of a 'spaghetti' Amida, where the constraints on the bridge insertions are completely relaxed except that no two bridges share the same endpoint. A bridge may connect any two horizontal lines or even two different points of the same line. We present necessary and sufficient conditions for an Amida to perform the one-to-one mapping between the input and the output terminals. We follow closely the work of Onaga and Chen (1982). The adjective 'spaghetti' is used because of the entangled appearance of
l o-
•^1
-O Jake
_ I 20-
"O Cooper
30-
"O Melissa
4 0-
"O Jerome
Fig. 8.17. An undirected simple Amida scheme.
8.4 PERMUTATIONS BY SPAGHETTI AMIDA
613
TABLE 8.1. An ordering of players of the Amida scheme of Fig. 8.17. Place
Name
1 2
Melissa Jerome
3
Jake
4
Cooper
the visual patterns of the unconstrained bridges. It should be noted that the transposition formula does not apply in this case. 8.4.1
Spaghetti Amida with Undirected Bridges
We first define a spaghetti Amida Q = (R,B) with undirected bridges as follows: (a) A set of n directed horizontal line segments of equal length is represented by R = {rur2,...,rn}. Each of these line segments r, (i = 1, 2, ..., n) is directed from an input node i to an output node tt. (b) A set of m bridges is denoted by B = fyi,b2,...,bm}. Each of these bridges b}, (j = 1, 2, ..., m) is connected between two distinct points Xj and yj on either a horizontal line or two different horizontal lines of R. The only restriction on the connection of the bridges is that no two bridges share a common endpoint. Figure 8.18 is an example of such spaghetti Amida. The rule of the game is the same as that of the ancient Amida: Starting from an input node, it is traced rightwards until the first bridge is met. Tracing is then switched to the bridge and continued on the bridge upward or downwards until another horizontal line is met. Tracing is then switch again to the horizontal line rightwards and the process is repeated.
•
*
—•
•
* • +
*• \ » y
•
»
•
o/j,
•
T
*
°n2
Input
Output
• -*-•
\
vX.
«^i^»
•
°n,
-^V• » » \ • t ^ f V .
•
0,7.
Fig. 8.18. A spaghetti Amida with undirected bridges.
614
OTHER NET APPLICATIONS
•—•
n it i
T i i
= >
(a)
(« Fig. 8.19. Equivalent representations of undirected bridges.
Let Q = (R,B) be an Amida. The input to Q is (1, 2, ..., n) and the output is (/7i, J7 2 ,...,i7„), where 17, is a set of labels of the input nodes to which output nodes tt are connected by the rules outlined above. If |/7, | = 1 for all i, the output of Q is a permutation of the input (1,2, ..., n). For our purposes, we introduce an equivalent transformation of a bridge by a pair of oppositely directed bridges that preserves the correct tracing, where the tracing along a directed bridge is allowed only in the direction of the bridge. Such an equivalent is presented in Fig. 8.19. The validity of the transformation is self-evident as can be verified by following the lines in the figure. The transformed directed graph of Q is denoted by Qj. It is important to observe that to each internal node of i2j, there is only one arc outgoing from that node and incoming to the node. In other words, both the incoming and the outgoing degrees are unity. With this we are now in a position to state a fundamental result on a spaghetti Amida with undirected bridges. THEOREM 8.13 The output of a spaghetti Amida with undirected bridges is a permutation of the input.
8.4 PERMUTATIONS BY SPAGHETTI AMIDA
615
Proof. Using the equivalent transformation of Fig. 8.19, let Qj be the transformed directed graph of the given Amida. Then the incoming and the outgoing degrees of each internal node of i2j are both unity. Also, each of the input nodes has outgoing degree 1 and each of the output nodes has the incoming degree 1. It is straightforward to verify that each input node is connected one and only one output node by a simple directed mapping from the input to the output; namely, a permutation. This completes the proof of the theorem. 8.4.2
Spaghetti Amida with Directed Bridges
We now consider the more general situation where the direction of a bridge is specified by an arrow. The tail and head of a directed bridge are labeled by T and //, respectively. Figure 8.20 is an example of such a labeling. To describe how the labels T and H appear on the horizontal lines ru r2, ..., rn, we define a ///-sequence D = (di,d2,...,dn) as follows: The z'th element dt is given by di=di(jl)di<J2\.jdi{jk)
(8.156)
where di(j) = T if y'th internal node on r, from left is a T-node = H if jth internal node on r, from left is an //-node = >
(8.157)
For the spaghetti Amida of Fig. 8.20, the 77/-sequence is found to be D = (THTHT, HHT, HHTHHT, THTHTT)
(8.158)
In addition, we make the following observations: (a) At a 7-node, the incoming degree is 1 and the outgoing degree is 2. At an //-node, the incoming degree is 2 and outgoing degree is 1. (b) The horizontal arc outgoing from a T-node is never used in the tracing, and therefore can be removed without affecting the outcome. (c) Two or more 7-nodes appearing in a row on a horizontal line are referred to as the multiple T-nodes such as double-r, triple-/1, etc. Bridges outgoing from the multiple 7-nodes except the first are redundant in the sense that they do not affect the mapping produced by the Amida. Hence, they can also be removed.
616
OTHER NET APPLICATIONS
10—•
Input
Output
Fig. 8.20. A spaghetti Amida with directed bridges.
A 77/-sequence D is said to be non-redundant if no multiple 7-nodes appear in d, (i = 1, 2, ..., n). Likewise, an Amida Q is non-redundant if its associated 77/-sequence is non-redundant. Therefore, every Amida has a non-redundant sub-Amida after the removal of the multiple T-nodes except the first. LEMMA 8.1 In a non-redundant 77/-sequence D = {d\,d2,—,dn), if two or more H's appear in a row in some dt, then there is a dj, which ends in a T. Proof. First observe that the number of Ts is equal to that of H's in D because each bridge has exactly one head and one tail. Secondly, no multiple Ts appear in any dk (k = 1, 2, ..., n) since D is non-redundant. Suppose that no dj ends in a T. Then every dk ends with a single or multiple H. These multiple H's are denoted by Hx, x>\. Now remove a pair [T, Hx] whenever Hx is preceded by a T in dk. Since no multiple Ts appear in dk, the pairing and removal process can be repeated until either only H's remain in D or D is empty. But by hypothesis, there exists at least one pair [T, Hx] for which x> 1. As a result, the number of H's in D is more than that of Ts, a contradiction. Thus, there is a
8.4 PERMUTATIONS BY SPAGHETTI AMIDA
617
(i) T and H alternate in every dit (ii) Every d, ends with an H. Proof. Sufficiency. Let Cl'd be the non-redundant sub-Amida. Because the directed horizontal arcs outgoing from the T-nodes in £2j are never used in the game, they can be removed without affecting the outcome. By conditions (i) and (ii), every internal node has the incoming degree 1 and the outgoing degree 1. Each input node has the outgoing degree 1 and incoming degree 0, whereas each output node has the incoming degree 1 and the outgoing degree 0. It is straightforward to verify that the input nodes are connected to the output nodes in a one-to-one and onto manner by the simple directed paths. Necessity. Assume that the non-redundant sub-Amida Qj maps the input one-to-one onto the output. As before, we can remove all directed horizontal arcs outgoing from the 7-nodes. By hypothesis, there are nodedisjoint directed paths by which each input node is connected to one and only one output node and vice versa. Thus, condition (i) must hold. For, otherwise, multiple H's would appear in some dt and some dj would end with a 7 by Lemma 8.1. As a result, the output node tj is never connected to any input node, a contradiction. If some dj ends with a T, this will prevent its access to the output node tj. Therefore, condition (ii) must hold. This completes the proof of the theorem. Example 8.5 Consider a spaghetti Amida Q with directed bridges of Fig. 8.21, in which bridges A and B are included but C is excluded. Observe that there are two double 7"s as indicated by the circled dotted lines. Since bridges A and B are directed from the second T, they are redundant and can be removed. The resulting sub-Amida Q' = Q - {A,B} possesses a resequence D' = (THTH JHTHTH JHTHTH JHTHTH)
(8.159)
that satisfies the conditions of Theorem 8.14. Therefore, its output is ;r' = (4,3,2,1), being a permutation of (1, 2, 3, 4). On the other hand, if bridge C is added to Q', the 77/-sequence of the resulting Amida Q" becomes D" = (THTHH JHTHTHT JHTHTH JHTHTH)
(8.160)
This sequence does not meet condition (ii) of Theorem 8.14. Hence, its output 7r* = ({4,3},0,2,l) is not a permutation of (1, 2, 3, 4).
618
OTHER NET APPLICATIONS
Fig. 8.21. An illustrative example of a spaghetti Amada with directed bridges.
8.5
THE AMIDA GRAPH
In the foregoing, we studied permutations by Amida. A completed game results in a graph structure with certain distinguished paths. Orton (1984) generalized this structure to Amida paths in arbitrary connected graphs. In this section, we present some of Orton's results. DEFINITION 8.5 Amida graph of type n. A graph is said to be a Amida graph of type n, n > 1, if there exist distinct nodes s and t, a set S of pairwise nonadjacent edges, and a collection of n distinct paths between s and t such that (i) the edges of each path are alternately in and out of 5, (ii) if an edge is in two of the paths, then it is in S, (iii) an edge in S is in at most two of the n paths. The paths are called the Amida paths and the edges in S are called bridge edges. DEFINITION 8.6 n-Amida and Amida number. A graph is said to be an n-Amida if it is an Amida graph of type n. The Amida number for a graph G, denoted by am(G), is the largest n for which G is n-Amida.
8.5 THE AMIDA GRAPH
619
The Amida scheme of Fig. 8.17 is an example of an Amida graph of type 4 when the four input nodes are identified, as are the four output nodes, and S is taken to be the set of bridges. With the above definitions, the following elementary results can be stated, the proofs of which are omitted: (a) Every graph is 1-Amida. (b) Every graph has an Amida number. (c) A graph G is n-Amida if and only if am(G) > n. (d) If a graph G is n-Amida, then G is m-Amida for 1 < m < n. (e) If H is a subgraph of a graph G, then am(H) < am(G). (f) No interior node of an Amida path is on more than two such Amida paths. In fact, in considering the Amida number of a graph, we can restrict our attention to blocks, as can be seen by the following theorem. THEOREM 8.15 The Amida number of a graph is the largest of the Amida numbers of the blocks of the graph. Proof. Let G be an Amida graph of type n with s, t and S as defined in Definition 8.5 with am(G) = n. If nodes s and t are in two different blocks Bi and B2 of G, let u be the cutpoint separating Bx from B2. Since u lies on every path between 5 and t in G, and since no interior node of an Amida path is on more than two such paths, it follows that am(G) < 2. Now new Amida paths contained in B\ may be constructed by replacing t by u. This shows that if am(G) > 2, nodes s and t must be in the same block of G, and the theorem follows. THEOREM 8.16 The Amida number of a graph cannot exceed the maximum degree of the graph plus one. Proof. Let u and v be two distinct nodes of a graph G. Since bridge edges are pairwise nonadjacent, at most one edge at u or v can be a bridge edge, being the only edge that can support two Amida paths. Therefore, the number of Amida paths between u and v is bounded above by min{deg(w),deg(v)}+l, where deg (u) denotes the degree of node u,
620
OTHER NET APPLICATIONS
implying that the Amida number of a graph cannot exceed the maximum degree of the graph plus one. This completes the proof of the theorem. We will now determine the Amida numbers of some well-known graphs: Circuit, complete graph and complete bipartite graph. PROPERTY 8.1 For a circuit C„ of length n, am(C„)= 2, n > 3. PROPERTY 8.2 For the n-node complete graph Kn of order 1, am(K„) - n, if n > 4 and n is even = n - l , i f « > 3 and «is odd
(8.161)
Proof. This result can easily be verified for A"3. Assume first that n > 4 and n is even. Let s = I, t = 3 and S = {(M + l)|i = l,3,...,/i-l}
(8.162)
be nodes and set as defined in Definition 8.5 for Kn. Define the Amida paths Pi as follows: fl=(l,2)(2,3)
(8.163a)
P2 = (l,2)(2,4)(4,3)
(8.163b)
P3=(U)
(8.163c)
/>4 = (1,4)(4,3)
(8.163d)
Pi = (1, /)(/', i + l)(i + l,3), if i is odd and
5
= (1, i)(i, i - l)(i -1,3), if i is even and 5 < i < n
(8.163e)
showing that am(^T„) > n. According to Theorem 8.16, n is also an upper bound for am(^„). Thus, we have am(tf„) = n. Next assume that n > 5 and n is odd. Since Kn_x is a subgraph of Kn, and since n - 1 > 4 is even, by an earlier argument we have am(^„) > am(^„_i) = n - 1. If S is the set of bridge edges associated with the realization of the Amida number of Kn, there is a node of Kn, say, v
8.6 GRAPH DECOMPOSITION AND HYBRID ANALYSIS
621
that has no bridge-edge incident with it. If v = 5 or t, we have am(K„)<deg(v) = / i - l . If v is not a terminal node for any of these Amida paths, all such paths are paths of Kn -{v}, or am(Kn)m, am(^Tm?m') = 1 if m = 1, am(^ffl,m') = 2 if m = 2, and am(Km<m') = m +1 if m > 3. Proof. It is straightforward to verify that am(^fi>m') = 1 and am(^ 2 , m ') = 2. Thus, we examine am(/sTm>m') for m > 3. Observe that when both terminals of the set of Amida paths belong to the same partite set, all such paths have even length, meaning that if the starting edge is a bridge edge, the ending edge must be a non-bridge edge and vice versa. Hence there are no more than four of them. For the bipartite graph Kmn{, let its bipartite node sets be V = {l,2,...,mJ and V'= {l',2',...,w'}. Let s = 1 and t = 2' and S = {(i,/')[ i = 1,2, ...,m\. The Amida paths are defined as follows: Pl = (U')(l',2)(2,2')
(8.164a)
P2 = (l,l')(l',3)(3,3')(3',2)(2,2')
(8.164b)
P3 = (1,2')
(8.164c)
PM = (l,i')(i',i){i,2')for 3
(8.164d)
showing that Km>m' is (m + 1)-Amida. Since am{Kmm') cannot exceed the degree of the node t - 2' plus one, which is m + 1, we obtain am(^Tm m ')= m + 1 for s and t in different partite node sets. This together with the facts that there are no more than four Amida paths when both terminals of these paths belong to the same partite set and that m +1 > 4 shows that &m{Kmm')=m + l for m > 3. This completes the proof of the theorem. 8.6
GRAPH DECOMPOSITION AND HYBRID ANALYSIS OF ELECTRICAL NETWORKS
One of the most important applications of graph theory in physical science is its use in electrical network theory. From an abstract viewpoint, a net
622
OTHER NET APPLICATIONS
can represent an electrical network with arcs denoting, to some extent at least, electrical components and weights representing the constituents of the components. This leads to three classical methods of network analysis: the nodal, loop, and cutest or cut methods [see, for example, Chen (1976)]. In frequency domain, these methods are derived by expressing Ohm's law in a form involving either admittances or impedances for all the branches. As a result, they can cause lack of generality and roundoff errors in computer-aided network design [see, for example, Kuo (1966)]. To circumvent this difficulty, it is extremely useful if some branches are expressed in admittances and others in impedances. This results in the hybrid method of network analysis, which was first proposed by Kron (1953) and elaborated by Branin (1962) and Happ (1971). In time domain, an important class of hybrid equations is that of state equations. Writing explicit systems of state equations was initiated by Bashkow (1957) and generalized by Bryant (1959, 1962). In hybrid analysis, the voltages of some arcs and the currents of other arcs are taken as independent variables. They are said to form a complete set of variables if their values can be assigned arbitrarily without violating Kirchhoff's laws, and if they determine either voltage or current of every arc of the net by means of Kirchhoff s laws. This method is a generalization of the well-known node-pair and loop analyses. The number of independent variables in a complete set of variables in hybrid analysis is called the hybrid rank. This number depends on the partitioning of the set of arcs of the net. It was first pointed out by Amari (1962) that the hybrid rank could be made less than the minimum of the rank and nullity in some nets. The minimum hybrid rank taken over all the partitionings is called the topological degree of freedom, an inherent property of a net uniquely determined from its topological structure. The advantages of the hybrid analysis are numerous. First, the minimum number of hybrid equations can never exceed that of loop or nodal equations. In the network of Fig. 8.22, which frequently occurs in power systems, the net is comprised of three groups of nodes with a high density of branches in each group, interconnected by two ladder networks with relatively few branches between the nodes. It is straightforward to verify that there are 44 nodal equations and 50 loop equations. However, only 32 hybrid equations are needed: three groups with six voltage variables each, and two groups with seven current variables each, as follows: Voltage variables: 1, 2, 3, 4, 5, 6; 39, 40, 41, 42, 43, 44; 77, 78, 79, 80, 81, 82
8.6 GRAPH DECOMPOSITION AND HYBRID ANALYSIS
623
Fig. 8.22. A practical net used to illustrate the advantage of hybrid analysis.
Current variables: 19, 22, 25, 28, 31, 34, 37; 57, 60, 63, 66, 69, 72, 75 As the number of operations required to solve a system of linear equations is approximately proportional to the cube of the number of variables, the hybrid analysis is an improvement by a factor of 2.6 (=443/323) over the nodal analysis, and of 3.8 (=503/323) over the loop analysis. Since, in hybrid analysis, each arc is describable in its most appropriate form, the difference in magnitude of the element values in the coefficient matrix can be limited, and the roundoff errors introduced in the solution process are reduced [see, for example, Bracchi and Somalvico (1971)]. Finally, the hybrid representation can easily and naturally be extended to time-varying and nonlinear networks. In fact, the computer-aided solution of time-varying nonlinear network problems is almost always accomplished using the hybrid approach. The main difficulty in hybrid analysis lies in the choice of a complete set of variables. This involves the partitioning of the arc set of the net into different classes, and is closely related to the notion of principal partition, which was first introduced by Kish and Kajitani (1967) in their study of the following two problems: • Find a maximum subset S of the edge set £ of a graph G such that, for any partition of S into S = S\ u S 2 with S\ nS2 = 0, there exists at least one tree that contains the edges of 5j and none of the edges of S2. Thus, if 151 denotes the number of elements of S, all the trees of G can be partitioned into 2UI non-empty classes.
624
OTHER NET APPLICATIONS
• Construct a Hamiltonian circuit in the tree graph. A Hamiltonian circuit of a graph G is a spanning circuit of G. The tree graph TG of G is a graph in which its nodes correspond to the trees of G and there is an edge between two nodes in TG if and only if the corresponding tree-pair are related by an elementary tree transformation. Because the subset S in the former problem is an edge set that contains neither circuits nor cutsets, the partition is representable by the difference of two trees. Consequently, the problem reduces to: • Find a tree pair that is of maximum distance. Starting from a given pair of trees, Kishi and Kajitani (1969) presented an algorithm that will result in a pair of trees of farther distance. In order to prove that this process will yield a tree pair of maximum distance, they introduced the notion of principal partition as a proof technique. Using this concept, Ohtsuki, Ishizaki, and Watanabe (1970) gave an algorithm for finding a minimum complete set of variables for hybrid analysis. Their approach focuses on a mixed system of network equations proposed by Amari (1962), and is based on the notion of an extremal tree, a. tree such that the rank of its complement (cotree) is maximal. They showed that three classes of subgraphs of the network graph could be defined through the principal partition. These correspond to subnetworks where admittances, impedances and immittances are used. The concept of principal partition is not new. Dulmage and Mendelsohn (1958, 1959) studied the structure of bipartite graphs with respect to the coverings of the nodes and the maximum matchings, and introduced the unique partition of nodes known as DM decomposition. They showed that any bipartite graph could be decomposed into two parts, an inadmissible part and a core. The core can be further decomposed into irreducible parts, thereby obtaining a canonical reduction of the bipartite graph. From the present knowledge of transversal matroids, this partition could have been extended to the principal partition of matroids. Some regard the principal partition as originating from DM decomposition. A technique to augment the distance between a pair of trees was proposed in a more general form for matroids by Edmonds (1965). Verification of the maximality of the distance was made by applying a min-max theorem of Tutte (1961) and Nash-Williams (1961). A different algorithm for constructing a maximum distance tree pair was given by Baron and Imrich (1968) as a solution to a problem posed by Ore (1962). Once a maximally distant free pair is constructed, the edge set of the given graph can then be tri-partitioned into (Ed, E0, Es). The principal partition
8.6 GRAPH DECOMPOSITION AND HYBRID ANALYSIS
625
of graph G is the triple (Gd, G0, Gs) of minors uniquely determined by the tri-partitioned (Ed, E0, Es) of the edge set of G, satisfying the conditions that their nullity-to-rank ratios called density are greater than, equal to, and less than unity, respectively. Ohtsuki, Ishizaki and Watanabe (1970) showed that the collection of the sets of edges realizing the topological degree of freedom of a network is closed with respect to the union and intersection operations. Kajitani (1970) and Ozawa (1971) indicated that the central part G0 of the principal partition (Gd, G0, Gs) can further be decomposed and a partial order could be defined on these finer structures. The monotone dissections of the partially ordered set yield sets of variables realizing the topological degree of freedom in the associated network. Since 1971, the notion of principal partition has been extended to matrices, matroids, a pair of graphs, and, finally, to a pair of matroids by Bruno and Weinberg (1971), Narayanan (1974), and Tomizawa (1976). Bruno and Weinberg (1971) extended the partition by showing that a similar unique partition can be obtained with respect to any nonnegative integer-valued density rather than unity. Tomizawa (1976) and Narayanan (1974) proved that this could be done for any nonnegative real-valued density. Their result is considered to be the finest partition in the context of the principal partitions and includes those of Bruno and Weinberg (1971). It should be noted that Narayana's P-sequence, molecular, and atomic matroids are equivalent to Tomizawa's irreducible minors, irreducible matroids, and strongly irreducible minors, respectively. 8.6.1
Topological Degree of Freedom
In hybrid analysis of an electrical network represented by a net, the voltages of some arcs and the currents of other arcs are taken as independent variables to form a complete set of variables. The central issue is to generate a minimum set of such variables to form a complete set of variables, the number of which is known as the topological degree of freedom. Many have considered this problem. A nice summary was given by Watanabe and Shinoda (1999), and will be presented in this section. A linear time-invariant electrical network can be represented by a net G(V, E). For our purposes, assume that G is connected for simplicity. For, otherwise, we can consider each connected component separately, or simply use the term forest instead of tree in all the subsequent discussions. For each arc of G, there are two electrical variables called voltage and current associated with it. The arrow or orientation of the arc is used as the references for the voltage and current. The current of the arc is considered to be positive in the direction of the arc, whereas the voltage
626
OTHER NET APPLICATIONS
drop is in the direction of the arc. Unless otherwise stated, it is assumed that no arc is made up only of independent voltage and/or current source. This is not to be deemed to be a restriction because we can always apply Blakesley transformation or its dual if necessary [see, for example, Chen (1990)]. The physical nature of each of its elements is describable by a linear equation among the voltages and currents through generalized Ohm's laws, and is referred to as the arc v-i characteristic or relation. An arc of G is said to be an impedance arc if its arc v-i relation is represented by a voltage in terms of currents, and an admittance arc if its arc v-i relation is represented by a current in terms of voltages. With respect to a chosen tree T, an impedance arc in T is called an impedance branch, and an admittance arc in T an admittance branch. Likewise, an impedance_ arc in a cotree T is an impedance chord, and an admittance arc in T an admittance chord. Equations that arise from an application of Kirchhoff's current law to a set of f-cutsets of G is referred to as a fundamental system ofKCL equations, and that arise from an application of Kirchhoff's voltage law to a set of f-circuits is a fundamental system of KVL equations. These equations depend only on the topology of the net, not on the arc v-i relations. Appealing to Theorems 1.25 and 1.28, we see that the number of linearly independent KCL equations of G is equal to its rank r and that the number of linearly independent KVL equations is equal to its nullity m, where r + m = \E\, the number of arcs of G. We remark that since the number of arc v-i relations of G is also LEI, a system of 2LE1 equations made up of a fundamental system of KCL equations, a fundamental system of KVL equations and the arc v-i relations constitutes the complete set of network equations sufficient to characterize G completely. We now proceed to describe the steps used to determine a complete set of hybrid network equations: Step 1: Choose a tree Ty containing as many admittance arcs as possible of G. Such a tree Ty is called a y-reference tree of G. Step 2: Apply the KVL to the f-circuits defined by the admittance chords of the cotree Ty, the complement of Ty. Use these _equations to express all the voltages of the admittance chords of Ty as linear combinations of the voltages of the admittance branches of Ty. This is possible because by the choice of Ty there are no impedance branches in these f-circuits. Step 3: Substitute the voltages of the admittance chords of Ty in their arc v-i relations to express all the currents of the admittance arcs as linear combinations of the voltages of the admittance branches of Ty and the known values of the voltage and/or current sources.
8.6 GRAPH DECOMPOSITION AND HYBRID ANALYSIS
627
Step 4: Substitute all the currents of the admittance arcs in the KCL equations corresponding to the f-cutsets defined by the admittance branches of Ty, and obtain a set of simultaneous equations involving the voltages of the admittance branches of Ty and the currents of the impedance chords of T ly.
Step 5: Apply the KCL to the f-cutsets defined by the impedance branches of Ty to express all the currents of the impedance branches o f ^ as linear combinations of the currents of the impedance chords of Ty. This is possible because by the choice of Ty there are no admittance chords in these f-cutsets. Step 6: Substitute the currents of these impedance branches of Ty in their arc v-i relations to express all the voltages of the impedance arcs as linear combinations of the currents of the impedance chords of Ty and the known values of voltage and/or current sources. Step 7: Substitute all the voltages of these impedance arcs in the KVL equations corresponding to the f-circuits defined by the impedance chords of Ty, and obtain another set of simultaneous equations involving the voltages ofthe admittance branches and the currents of the impedance chords of Ty. Finally, by combining the two sets of simultaneous equations derived in Steps 4 and 7, we obtain a system of simultaneous hybrid equations. This system reduces to that of loop equations if all arcs are impedance arcs, and to that of cutset or cut equations if all arcs are admittance arcs. The number of variables of the system is equal to the number of the admittance branches plus the number of impedance chords of Ty, and is given by h{Ey)=\TynEy\
+ \fynEz\
(8.165)
where Ey denotes the set of admittance arcs and Ez the set of impedance arcs of G. The number h(Ey) is called the hybrid rank of G. Observe that the hybrid rank depends not only on the topology of G but also on the distribution of impedance and admittance arcs. Denote by G\Ey the subgraph obtained from G by removing all the arcs in Ez = E - Ey, and by r(G\Ey) the rank of G\Ey. If T is a tree of G, then T n Ey is a tree or forest of G\Ey, showing that r(G\Ey) = \Ty r\Ey\. Thus, the hybrid rank can be written as h(Ey)=m-\Ey\
+ 2r(G\Ey)
(8.166)
628
OTHER NET APPLICATIONS
The minimum hybrid rank hmin = miah{Ey)
(8.167)
is called the topological degree of freedom of G. We call Ey satisfying h(Ey) = hmin a critical set of G. It can be shown that if E'y and E"y are critical sets of G, so are E'y u E" and E'y n £*. Therefore, the family of all critical sets forms a distributive lattice. The minimal critical set Ey0^ is uniquely determined, so is the maximal critical set Ey°°). In fact, any critical set Ey satisfies the relation Ey0) ^Ey^E^ A unique tri-partition \Ey,Ey,Ey)
(8.168)
defined by
E+=Ef\ E^ = E^-Ef\
Ey=E-E™
(8.169)
is called the principal partition of G. This partition was originally proposed by Kishi and Kajitani (1967, 1968) when they presented an algorithm for finding a pair of maximally distant trees of a graph. Recall that Ey is a subset of the arc set E and Ty is a tree containing as many arcs of Ey as possible and satisfies the relations |7i n Ey | < \Ty n Ey | = r(G\Ey) \T2nEy\<\Ty^Ey\
(8.170a)
= r(G\Ey)
(8.170b)
for any two trees Tx and T2 of G. Applying these to (8.166) yields h{Ey)=m-\Ey\ + 2r(G\Ey)>m-\Ey\ + \TlnEy\ + \T2nEy\ >m-\Ey\ + piuT2)nEy\
=
m-p\nT2)nEy\
>m-\(finf2)nEy\>m-\finf2\^\Ti-T2\
= d(TuT2)
(8.171)
where d(^i,T2) is the distance between trees T{ and T2. Elements in T\ C\T2 are called common branches and those in T\ C\T2 the common chords. Two trees Tx and T2 are said to be maximally distant if d(j\,T2)> d(T{,T2) for every pair of trees T{ and J2' of G. For a tree 7 of G, the number d(F) = max d(T,T') 7"eG
(8.172)
8.6 GRAPH DECOMPOSITION AND HYBRID ANALYSIS
629
is called the eccentricity function of T, where T' is a tree of G. Define dmax = max d(T) TeG
drain = min d(T)
(8 173) v
'
(8.174)
The number dmax is called the diameter and dm{n the radius of the tree set of G. Finally, a tree T satisfying d(T) = dmax is a peripheral tree, and a tree T satisfying d(T) = dmin a central tree of G. Since ^(7 1 ,72)<^ max for any two trees T\ and 7 2 of G, and moreover, since /zmin < h\Ey ) for any subset Ey e £ , it follows that d{Tl,T2)=dm3X=hmin=h{Ey)
(8.175)
holds if and only if
(i)
TlnT2^Ey
(ii) T\ n lij, and T2 n E^ have no common branches, (iii) T\ n Ey and 7/2 n Ey are trees of G | £ r Thus, the topological degree of freedom of G is equal to dmax. The two trees T\ and T2 satisfying the above three conditions are a pair of maximally distant trees, and a subset Ey meeting these conditions becomes a critical set of G. For a critical set Ey of G, a certain tree Ty, not always every tree, containing as many arcs of Ey as possible satisfies the condition d\Ty)=dm3X, and is a peripheral tree. Such a tree is one in a maximally distant tree pair and is called an extremal tree. Thus, to determine the topological degree of freedom, it is sufficient to find a critical set and an extremal tree in G. An algorithm to this effect was given by Ohtsuki, Ishizaki and Watanabe (1968). For two subsets E' and E" satisfying E' c E" c; E, the graph derived from G\E" by contracting all arcs in E' is denoted by {G\E")X (E" - E'). As before, its rank is denoted by r[(G\E")x (£'-£')]. Therefore, for any two critical sets E'y and Ey satisfying the condition E'y a E" QE and for a pair of maximally distant trees Tx and T2 of G, we have (i) 71 n {Ey - Ey) and T2 n {E" - E'y) are two trees of (G\E" )X ( E ; - E'y), (ii) one of the two trees is a cotree of the other. Such a graph \G\Ey)X[Ey -E'y) is referred to as a minor wif/i complementary tree structure, or simply a CTS-minor. A CTS-minor is also called an irreducible minor with complementary tree structure by Tomizawa (1976).
630
OTHER NET APPLICATIONS
For any two critical sets E'y and Ey satisfying £ y C £ j c E, if there is no critical set Ey satisfying E'y
8.6 GRAPH DECOMPOSITION AND HYBRID ANALYSIS
631
(1976) also indicated that in the case when there are no common trees, a partition called the principal partition of the two-graph is obtained, through which subnetworks contributing to insolvability are identified. For the class of linear networks made up of resistors, capacitors and ideal gyrators known as the RCG networks, it was solved by Milic (1974) by finding a common tree satisfying a certain property in its associated two graphs. The same problem was solved by Ueno and Kajitani (1985) using the augmenting path and solving a parity problem repeatedly, and by Stallmann and Gabow (1984) using an efficient algorithm for solving a parity problem of linear matroids. We remark that since a linear network can be represented equivalently by an RCG network, the necessary and sufficient topological conditions for the unique solvability of a general linear network are now available. Network diagnosis - One problem in network diagnosis is to determine the minimum set of arc-currents and arc-voltages to be measured, so as to determine all the element values. Suppose that in a network three kinds of elements are distinguished in which only the currents, voltages, or both are measurable. Shinoda (1970) showed that the minimum number of elements sufficient for determining all element values could be found by finding a maximum distant tree pair under a certain restriction. Tomizawa (1974) pointed out that this problem might be included in the problem of finding a maximally distant suspended pair of bases in semi-muoids. New games defined on a graph - Kano (1979a, 1979b) introduced several kinds of games that can be considered generalizations of the Shannon switching game. Their solutions are described by using the concept of principal partition of a graph. Generalization of Menger's Theorem - Tomizawa (1974) showed that Menger's theorem for matroids could be treated as a theorem on a maximally distant pair of bases of matroids with certain constraints. The partition of a directed graph - A unique partition called the principal partition of a directed graph was introduced by Oishi, Aikyo and Ohtsu (1978) based on the notion of minimal strongly-connected subgraphs. Central tree - A Kajitani and Kawamoto (1976) demonstrated that a minimum complete set of variables in the hybrid analysis could be obtained by using a central tree of the graph, and introduced the secondorder hybrid network analysis as an extension of the primitive hybrid network analysis. The characterization of a central tree in terms of the
632
OTHER NET APPLICATIONS
principal partition has been studied by Kawamoto, Kajitani and Shinoda (1977, 1981), and Kawamoto and Shinoda (1980). However, the basic problem of developing an algorithm for the enumeration of a central tree remains. Computer-aided network analysis - One of the most remarkable applications of the generalized partitions was provided by Murota, Iri and Nakamura (1987). They proposed an efficient method of solving systems of linear and/or nonlinear equations. From network analysis viewpoint, their technique is regarded as a tabular method, where the coefficient matrix is expressed in terms of two matrices: One is related to the net topology and the other to the arc v-i relations. In fact, their method makes the most effective use of the finest principal partition of the coefficient matrix of a system of 2\E\ equations required to describe the net G [see Iri (1971, 1983, 1984)], and involves a sparse matrix technique, an effective tool in speeding up the computational time and reducing the memory size. Although SPICE and its improved versions are the most popular network simulators in the world, a new simulator based on this may be more promising. 8.6.2
Second Topological Degree of Freedom
Using the two-graph model of Mayeda (1958), Kajitani, Kawamoto and Shinoda (1983) developed a new method of network analysis called the primal-dual method. Using the primal-dual method in solving a system of simultaneous equations, they introduced the notion of 'second topological degree of freedom' in relation to the minimum dimension of the system. For our purposes, we introduce the primal-dual method using a single graph model. As before, let an electrical network be represented by a connected net G. For a tree T of G, assume that its branches^ are impedance arcs, whereas the chords in the corresponding cotree T of T are admittance arcs, and that there are no mutual couplings among the branches and chords in G. The primal-dual method using a single graph model can be formulated as follows: Step 1: Let G\T be the subgraph obtained from G by removing all the arcs of T. Then choose a tree or forest T* in G\T. Step 2: Apply the KVL to the f-circuits defined by the chords of T* = T - T*, the complement of T* in G\T, and express all the voltages of the chords of T* as linear combinations of the voltages of the branches of T*.
8.6 GRAPH DECOMPOSITION AND HYBRID ANALYSIS
633
Step 3: Substitute the chord voltages of T* computed in Step 2 in the arc v-i relations, and obtain the currents of the chords of T as linear combinations of the voltages of the branches of T* and the known values of the voltage and/or current sources. Step 4: Substitute these chord currents of T computed in Step 3 in the KCL equations corresponding to the f-cutsets defined by the branches of T in G, and obtain the currents of the branches of T as linear combinations of the branch voltages of T* and the known values of voltage and/or current sources. Step 5: Substitute the branch currents of T computed in Step 4 in their v-i relations, and obtain the voltages of the branches of T as linear combinations of the branch voltages of T* and the known values of voltage and/or current sources. Step 6: Substitute the branch voltages of T computed in Step 5 in the KVL equations corresponding to the f-circuits defined by the arcs of T nT* with respect to T of G, and obtain a system of simultaneous equations in the branch voltages of T*, being the voltages of the arcs of f nT*. The system of equations derived in Step 6 is to be solved by primaldual method. The number of variables involved in this system is equal to the number of branches of T* or the arcs in T n T*, and is given by h(V(T) = \fnT*\ = r(G\T)
(8.176)
This number U2\T) is referred to as the second hybrid rank of G, being dependent on T. Now consider the eccentricity function d(T), which can be expressed as d(r) = m-mm\T
nT'\ = r[G\T)
(8.177)
showing that h^(T) = d{T)
(8.178)
Since d(T) satisfies dmia
(8.179)
/i(2)(7) assumes the minimum value dmin when T is a central tree of G. The minimum second hybrid rank is called the second topological degree of
634
OTHER NET APPLICATIONS
freedom of G, and can always be achieved whenever T is taken to be a central tree. It is significant to point out that any second hybrid rank is not greater than the topological degree of freedom as can be seen from the inequalities (8.179). We remark that the topological degree of freedom of G is equal to the diameter of its tree set, whereas the second topological degree of freedom is equal to the radius of its tree set. Thus, the second topological degree of freedom can never exceed the topological degree of freedom. As an example, consider the 4-node complete graph K4 of order 1. Its topological degree of freedom is 3, whereas the second topological degree of freedom is 2. Since the number of operations required in solving a system of simultaneous equations numerically depends critically on its dimension, in this sense the primal-dual method is preferable to the hybrid analysis. Dually, if in each of the above five steps, we replace tree with cotree, cotree with tree, branches with chords, chords with branches, currents with voltages, voltages with currents, KCL with KVL, KVL with KCL, and so forth, we obtain a dual system of equations. The number of variables involved, again called the second hybrid rank, is equal to the nullity of the graph, denoted by G x T, obtained from G by contracting the chords of the cotree T with respect to a chosen tree T. It can be shown that this nullity m(G x T) is equal to d(T) and the same conclusion as stated above can be reached. 8.6.3
Central Tree
As discussed in the foregoing, to determine the second topological degree of freedom, it is necessary to find a central tree. The concept of a central tree was introduced by Deo (1966), but no polynomial time algorithm for finding such a tree is available. Amoia and Cottafava (1971) gave an invariance property of the central trees; and Kawamoto, Kajitani and Shinoda (1977, 1981) studied the relationships between a central tree and the Kishi-Kajitani partition of a graph by introducing the notion of eccentricity 5 of the tree set of a graph G as P
<5 =
" m a x - "min
„„v
(8.180)
"max
Thus, a tree of G is a central tree if and only if 5 = 0. Kawamoto, Kajitani and Shinoda (1977, 1981) showed that 5 = 0 if and only if either any cutset of G contains a circuit or any circuit contains a cutset, and that
8.6 GRAPH DECOMPOSITION AND HYBRID ANALYSIS
635
5=1/2 if and only if there exists a critical set S of G such that E - S is a central tree. Shinoda and Saishu (1980) demonstrated that an incidence set Et of a node i is a central tree if 1) Et is a tree, 2) the graph G - Et obtained from G by removing all the edges in £, and node i is connected, and 3) the diameter of G - Et is not greater than 2. Finally, Shinoda and Kawamoto (1980, 1981) extended the work of Kawamoto, Kajitani and Shinoda (1977, 1981) and characterized a new class of graphs, the central trees of which can be determined. In this section, we present this new class of graphs. For any real number a, 0 < a < °° and for any subset S e E of a graph G(V, E), the quantity fa(s)=a\S\-r{G\s)
(8.181)
is called the deficiency of S with respect to a. A subset Sa of E satisfying f„(Sa)= max fa{S)
(8.182)
is referred to as a critical set of G with respect to a. It can be shown that if S'a and S„ are critical sets of G with respect to a, so are S'a u S„ and S'a n S„- In fact, the family of all critical sets of G with respect to a forms a distributive lattice, and has a unique minimal critical set 5„0) and a unique maximal critical set 5^°o). Thus, for any critical set S there holds 5<0)cScS<M)
(8.183)
A unique tri-partition (E^,E^,E^) with E%=s£\ Eg = s£°)-S£) and E„ =E — Sa is again called the principal partition of G with respect to a. It is significant to note that the principal partition of G with respect to a = V2 is nothing but the well-known Kish-Kijitani principal partition discussed in the foregoing. We next order all the maximal critical sets of G with respect to a, 0 < a < 00, as 0 = 5 (oo) c S(™} c S M c . . . c 5 (oo) c 5 Y
«o
<*i
«2
at
M
=E
a*+i
(8.184) v
7
where 0
636
OTHER NET APPLICATIONS
1
r(G\s)-r{G\S%) s'-'cScfi k _ c ( ~_) | sg^ScE \S-S' aj
These numbers c, are called the densities of G with respect to A partition (Xo,Xi,X2,...,Xk) with Xs = S$ - S{~\
i = 0,1,2,..., k
(8.186) a,0
(8.187)
is referred to as the Narayanan-Tomizawa partition of G due to Narayanan (1974) and, independently, Tomizawa (1976), who also provided an algorithm for finding all the critical sets in polynomial time. Using the concept of critical sets, Shinoda and Kawamoto (1980, 1981) obtain the following:
PROPERTY 8.4 Let S„. be a critical set of a graph G with respect to a, satisfying c,
Sai^T
(ii) 1 > cr|Sai. - f |-r((G\Sai )x(Sai - f)) then T is a central tree.
PROPERTY 8.5 Let 5«. be a critical set of a graph G with respect to a, satisfying c, (1 - c,, )| f - S„, I - m((G|f )x (f - S„,)) then 7 is a central tree. We remark that in applying Property 8.4, if l>c,|S a / -T\ there is no need to compute r^G\Sai )x {Sai - f)). Likewise, if 1 > (l - c, )\T - Sa. |, there is no need to compute m((G|r)x(r
-Sa.)).
8.6 GRAPH DECOMPOSITION AND HYBRID ANALYSIS
637
Example 8.6 Consider the graph G(V, E) of Fig. 8.23. Using Tomizawa's algorithm, all the critical sets of G with respect to a, 0 < a < °°, are found to be
s*=sr=* -C-< S
«i
= s
(8.188a)
= e
i^
{ 6,eT,es,e9,eio,en,ei2,ei3,e\4}
Sa2=S^={e4,e5}uS^
(8.188b) (8.188c)
Sai=S^={eue2,e3}uS^=E
(8.188d)
0
(8.189a)
with
C2
CT, < Of3 < °°
(8.189b)
Select a tree T = \e\, e2, e^, e4, e^, e^, e-j} of G. For the critical set 5„, we obtain Sai ^T
={es,e9,eio,en,e\2,ei3,ei4}
(8.190a) (8.190b)
showing that l>ci\Sa.-T\
= -x2 =
8
Fig. 8.23. A graph with a central tree denoted by the heavy lines.
(8.191)
638
OTHER NET APPLICATIONS
Fig. 8.24. The graph G x 5Hi derived from the graph G of Fig. 8.23, where Sai is the maximal critical set of G with respect to a\ - Vi.
Appealing to Property 8.4, we see that T is a central tree of G with ^min =r\p\T)=4. In fact, G has 11 central trees, and they can be obtained as ,e2,e3,e4,e5}(jH
(8.192)
where H is a tree of the graph GxSai as shown in Fig. 8.24. 8.7
SUMMARY AND SUGGESTED READING
In this chapter, we first studied the basic properties of Boolean matrices and their applications to the analysis of both combinational relay and sequential circuits. No attempt was made to give more than an outline of certain phases of the subject. For a more extensive treatment, we refer to Sikorski (1964), Lunts (1950), Luce (1952), Hohn and Schissler (1955) and Yoeli (1959). We generalized Tellegen's theorem for generalized signal-flow graphs using the concept of a SFG operator, and presented some of its applications. The SFG operator has some resemblance to the operators for electrical networks governed by Kirchhoff's laws. For example, the SFG operator F%(y,x) = y(dx/dti)+x(dy/dt\) is also applicable to the branch current x and the branch voltage y of an electrical network. On the other hand, the operator F7(y,;c) = y(dx/dt\)-x(dy/dti) is applicable to the electrical networks, but is not applicable to generalized signal-flow graphs, and therefore it is not a SFG operator. Like the generalized forms of Tellegen's theorem, which can be applied to many electrical engineering problems, a
REFERENCES
639
SFG operator can also be employed in a wide range of problems in signalflow graphs and signal-flow networks. We examined critically the permutation mechanism of a spaghetti Amida. Necessary and sufficient conditions for an Amida to perform the one-to-one mapping between the input and the output terminals were given, thus generalizing and justifying a well-known ancient result in combinatorics. This structure was further generalized to Amida paths in an arbitrary connected graph. Finally, we studied graph decomposition and hybrid analysis. Unlike the nodal, cutset and loop analysis, where either the nodal or cutset voltages or the loop currents are selected as the independent variables, the hybrid analysis uses some arc voltages and some arc currents as independent variables. The advantage is that the minimum number of hybrid equations can never exceed that of nodal, cutset or loop equations. The main difficulty, however, lies in the choice of a minimum complete set of variables. This involves the partitioning of the arc set of the net into different classes, and is closely related to the notion of principal partition, which amounts to partitioning the net into three classes of subgraphs where admittances, impedances and immittances are used. As a result, a significant number of basic problems have either been solved or well characterized, using principal partition as a tool. The minimum hybrid rank is known as the topological degree freedom, and is also the minimum number of hybrid equations required in hybrid analysis. For this we presented an algorithm for formulating such a system. Another interesting approach is to employ the two-graph model to develop a new network analysis technique called primal-dual method, using the notion of second topological degree freedom in relation to the minimum dimension for a system of simultaneous equations. To this end, we presented an algorithm for obtaining such a system. In order to do this, we had to find a central tree, but to this day no polynomial algorithm is available. We only characterized a class of graphs whose central trees can be determined. REFERENCES Amari, S. (1962), 'Topological foundation of Kron's tearing of electrical networks," RAAG Memoirs, vol. 3, pp. 322-349. Amoia, V. and Cottafava, G. (1971), "Invariance property of central trees," IEEE Trans. Circuit Theory, vol. CT-18, pp. 465-467. Aranovich, B. I. (1949), "The use of matrix methods in problems of structural analysis of relay-contact networks," Avtomatika i Telemekhanika, SSSR, vol. 10, pp. 437-451. Baron, G. and Imrich, W. (1968), "On the maximal distance of spanning trees," J. Combinatorial Theory, Series B, vol. 5, pp. 378-385.
640
OTHER NET APPLICATIONS
Bashkow, T. R. (1957), "The A matrix, new network description," IRE Trans. Circuit Theory, vol. CT-4, pp. 117-119. Berman, G., Forward Citations in Graph Theory, Department of Combinatorics and Optimization, University of Waterloo, Waterloo, Ontario, Canada. Bracchi, G. and Somalvico, M. (1971), "Topological properties and optimum application of the mixed method of network analysis," IEEE Trans. Circuit Theory, vol. CAS-18, pp. 228-232. Branin, F. H., Jr. (1962), "The relation between Kron's method and the classical methods of network analysis," Matrix and Tensor Quart. Vol. 12, pp. 62-105. Brayton, R. K. and Moser, J. K. (1964), "A theory of nonlinear networks - I," Quart. Appl. Math., vol. 22, pp. 1-33 and 81-104. Brown, W. G. (editor) (1980), Reviews in Graph Theory, Providence, RI: American Math. Society (four-volume set). Bruno, J. and Weinberg, L. (1970), "A constructive graph-theoretic solution of the Shannon switching game," IEEE Trans. Circuits Syst., vol. CAS-17, pp. 74-81. Bruno, J. and Weinberg, L. (1971), "The principal minors of a matroids," Linear Algebra and Its Appl., vol. 4, pp. 17-54. Bryant, P. R. (1959), "Problems in Electrical Network Theory," Ph.D. dissertation, Cambridge University, Cambridge, England, July. Bryant, P. R. (1962), "The explicit form of Bashkow's A matrix," IRE Trans. Circuit Theory, vol. CT-9, pp. 303-306. Chen, W. K. (1966), "Boolean matrices and switching nets," Math. Magazine, vol. 39, pp. 1-8. Chen, W K. (1976), Applied Graph Theory - Graphs and Electrical Networks, Amsterdam, The Netherlands: North-Holland, 2nd revised edition. Chen, W K. (1990), Linear Networks and Systems: Algorithms and Computer-Aided Implementations, Singapore: World Scientific, p. 96. Chen, W. K. and Chan, F. N. T. (1974), "On the unique solvability of linear active networks," IEEE Trans. Circuits Syst., vol. CAS-21, pp. 26-35. Coates, C. L. (1958), "General topological formulas for linear network functions," IRE Trans. Circuit Theory, vol. CT-5, pp. 30-42. Crochiere, R. (1973), "Some network properties of digital filters," Proc. 1973 Int. Symp. on Circuit Theory, pp. 146-148, April 9-11. Deo, N. (1966), "A central tree," IEEE Trans. Circuit Theory, vol. CT-13, pp. 439-440. Deo, N. (1969), "An extensive English-language bibliography on graph theory and its applications," Tech. Report 32-1413, Jet Propulsion Lab., Pasadena, Calif., Oct. Deo, N. (1971), "Supplement I - an extensive English-language bibliography on graph theory and its applications," Tech. Report 32-1413, Jet Propulsion Lab., Pasadena, Calif., April. Dulmage, L. and Mendelsohn, N. S. (1958), "Covering of bipartite graphs," Can. J. Math., vol. 10, pp. 517-534. Dulmage, L. and Mendelsohn, N. S. (1959), "A structural theory of bipartite graphs of finite exterior dimension," Trans. Roy. Soc. Can., 3 rd series, Sec. Ill, vol. 53, pp. 1-13, vol. 10, pp. 517-534. Edmonds, J. (1965), "Minimum partition of a matroids into independent subsets," J. Res. Nat. Bur. Stand., Sect. B, Mathematics and Mathematical Physics, vol. 69B, pp. 67-72. Fettweis, A. (1971), "A general theorem for signal-flow networks, with applications," Arch. Electron. Ubertragung., vol. 25, pp. 557-561.
REFERENCES
641
Fettweis, A. (1973), "Some general properties of signal-flow networks," in Network and Signal Theory, (Editors: J. K. Skirzynski and J. O. Scanler), London, England: Peregrinus, pp. 48-59. Fiedler, M. (editor) (1964), Theory of Graphs and Its Applications, New York: Academic Press, pp. 171-234. Gao, S. and Chen, W. K. (1982a), "The hybrid method of network analysis and topological degree of freedom," Proc. IEEE Intl. Symp. Circuits Syst., pp. 158-161. Gao, S. and Chen, W. K. (1982b), "On graph classification with application," Proc. 25th Midwest Symp. Circuits Syst., pp. 244-248. Happ, H. H. (1971), Diakoptics and Networks, New York: Academic Press. Hohn, F. E. (1955), "A matrix method for the design of relay circuits," IRE Trans. Circuit Theory, vol. CT-2, pp. 154-161. Hohn, F. E. and Schissler, L. R. (1955), "Boolean matrices in the design of combinational switching circuits," Bell System Tech. J., vol. 34, pp. 177-202. Iri, M. (1968), "A min-max theorem for the ranks and term-ranks of a class of matrices An algebraic approach to the problem of the topological degrees of freedom of a network," Trans. Inst. Electron, and Comm. Engrs., Japan, vol. J51-A, pp. 30-37. Iri, M. (1971), "Combinatorial canonical form of a matrix with applications to the principal partition of a graph," Trans. Inst. Electron, and Comm. Engrs., Japan, vol. 54-A, pp. 30-37. Iri, M. (1983), "Applications of matroid theory," in Mathematical Programming - The State of the Art, A. Bachem, M. Groetschel, and B. Korte, Eds., pp. 158-201, Berlin, Germany: Springer-Verlag. Iri, M. (1984), "Structural theory for the combinatorial systems characterized by submodular functions," in Progress in Combinatorial Optimization, W. R. Pulleyblank, Ed., pp. 197-219, Toronto, Canada: Academic Press. Iri, M. and Tomizawa, N. (1974), "A practical criterion for the existence of the unique solution in a linear electrical network with mutual couplings," Trans. Inst. Electron, and Comm. Engrs., Japan, vol. 57A, pp. 599-605. Iri, M. and Tomizawa, N. (1975), "A unifying approach to fundamental problems in network theory by means of matroids," Trans. Inst. Electron, and Comm. Engrs., Japan, vol. 58-A, pp. 33-40. Kajitani, Y. (1970), "A few properties concerning the principal partition of a graph," Proc. Elect. Eng. Four Inst. Joint Conv., Basic Theory, paper no. 54, Japan. Kajitani, Y. and Kawamoto, T. (1976), "Graph theoretical degree of freedom in network analysis and all-central-tree graphs," Papers of Tech. Group on Circuit Syst. Theory, Inst. Electron, and Comm. Engrs., Japan, CST76-94, pp. 65-70. Kajitani, Y, Kawamoto, T. and Shinoda, S. (1983), "A new method of circuit analysis and central trees of a graph," Trans. Inst. Electron, and Comm. Engrs., Japan, vol. J66-A, pp. 78-85. Kano, M. (1979a), "Cycle games and cycle cut games - games which are solved by using principal partition," Papers of Tech. Group on Circuit Syst. Theory, Inst. Electron, and Comm. Engrs., Japan, CAS79-85, pp. 71-76. Kano, M. (1979b), "Generalized Shannon switching game," Papers of Tech. Group on Circuit Syst. Theory, Inst. Electron, and Comm. Engrs., Japan, CAS79-148, pp. 13-18. Kawamoto, T, Kajitani, Y and Shinoda, S. (1977), "New theorems on central trees described in connection with the principal partition of a graph," Papers of Tech. Group on Circuit Syst. Theory, Inst. Electron, and Comm. Engrs., Japan, CST77-109, pp. 63-68.
642
OTHER NET APPLICATIONS
Kawamoto, T, Kajitani, Y. and Shinoda, S. (1981), "Eccentricity of the tree set," Proc. IEEE Intl. Symp. Circuits Syst., Paper R14-1, pp. 786-789. Kawamoto, T. and Shinoda, S. (1980), "Theorems on central trees in connection with the principal partition of a graph," Papers of Tech. Group on Circuit Syst. Theory, Inst. Electron, and Comm. Engrs., Japan, CAS80-49, pp. 41-45. Kishi, G. and Kajitani, Y. (1967), "On maximally distant trees," Proc. 5th Allerton Conf. Circuit and Syst. Theory, pp. 635-643. Kishi, G. and Kajitani, Y. (1968), "Maximally distant trees in a linear graph," Trans. Inst. Electron, and Comm. Engrs., Japan, vol. J51-A, pp. 196-203. Kishi, G. and Kajitani, Y. (1969), "Maximally distant trees and principal partition of a linear graph," IEEE Trans. Circuit Theory, vol. CT-16, pp. 323-330. Kishi, G., and Kida, T. (1968), "Edge-port conservation in networks," IEEE Trans. Circuit Theory, vol. CT-15, pp. 274-276. Kron, G. (1953), "A set of principles to interconnect the solutions of physical systems," J. Appl. Phys., vol. 24, pp. 965-960. Kuh, E. S., Layton, D. and Tow, J. (1968), "Network analysis and synthesis via state variable," in Network and Switching Theory, G. Biorce, Ed. New York: Academic Press. Kuo, F. F. (1966), "Network analysis by digital computer," Proc. IEEE, vol. 54, pp. 820-829. Lee, H. B. (1965), "On the differing abilities of RL structures to realize natural frequencies," IEEE Trans. Circuit Theory, vol. CT-12, p. 365. Lehman, A. (1964), "A solution of the Shannon switching game," J. Soc. Indust. Appl. Math., vol. 12, pp. 687-724. Lin, P. M. (1980), "Complementary trees in circuit theory," IEEE Trans. Circuits Syst., vol. CAS-27, pp. 921-928. Luce, R. D. (1952), "Note on Boolean matrix theory," Proc. Amer. Math. Soc, vol. 3, pp. 382-388. Lunts, A. G. (1950), "The application of Boolean matrix algebra to the analysis and synthesis of relay contact networks," Doklady Akademii Nauk, SSSR, vol. 70, pp. 421-423. Malic, M. (1974), "General passive networks - Solvability, degeneracies, and order of complexity," IEEE Trans. Circuit Theory, vol. CAS-21, p. 177. Malik, N. R. and Hale, H. W. (1967), "Equations for active networks: Existence of unique solutions," IEEE Trans. Circuit Theory, vol. CT-14, pp. 37-43. Mayeda, W. (1958), 'Topological formulas for nonreciprocal networks and networks with transformers," Proc. Natl. Electron. Conf., vol. 14, pp. 631-643. Murota, K., Iri, M. and Nakamura, M. (1987), "Combinatorial canonical form of layered mixed matrices and its application to block-triangulation of system of linear/nonlinear equations," SIAM J. Algebra Discrete Methods, vol. 8, pp. 123-149. Narayanan, H. (1974), "Theory of Matroids and Network Analysis," Ph.D. dissertation, Indian Inst, of Tech., Bombay, Feb. Nash-Williams, St. J. A. (1961), "Edge-disjoint spanning trees of finite graphs," J. London Math. Soc, Vol. 36, pp. 445-450. Ohtsuki, T, Ishizaki, Y. and Watanabe, H. (1968), "Network analysis and topological degrees of freedom," Trans. Inst. Electron, and Comm. Engrs., Japan, vol. J51-A, pp. 238-245. Ohtsuki, T, Ishizaki, Y. and Watanabe, H. (1970), "Topological degrees of freedom and mixed analysis of electrical networks," IEEE Trans. Circuit Theory, vol. CT-17, pp. 491-499.
REFERENCES
643
Oishi, S., Aikyo, T. and Ohtsu, T. (1978), "Partition of directed graphs by making use of minimal connected graphs," Papers of Tech. Group on Circuit Syst. Theory, Inst. Electron, and Comm. Engrs., Japan, CST78-155, pp. 41-48. Onaga, K. and W. K. Chen (1982), "On permutations by spaghetti Amida," Matrix and Tensor Quart., vol. 32, pp. 83-89. Oppenheim, A. V. and Schafer, R. W. (1975), Digital Signal Processing, Englewood Cliffs: NJ: Prentice-Hall. Ore, O. (1962), Theory of Graphs, Providence, R.I.: American Math. Society. Orton, L. M. (1984), "The Amida number of a graph," Congressus Numerantium, vol. 44, pp. 315-320. Ozawa, T. (1970), "On a certain class of minimal graphs," Proc. Elect. Eng. Four Inst. Joint Conv., Basic Theory, paper no. 55, Japan. Ozawa, T. (1971), "On the minimal graphs of a certain class of graphs," IEEE Trans. Circuit Theory, vol. CT-18, p. 387. Ozawa, T. (1973a), "Common trees and partition of two graphs," Papers of Tech. Group on Circuit Syst. Theory, Inst. Electron, and Comm. Engrs., Japan, CST73-47, pp. 1-8. Ozawa, T. (1973b), "On the existence of common trees in the two-graph method," Trans. Inst. Electron, and Comm. Engrs., Japan, vol. 56A, pp. 371-372. Ozawa, T. (1974), "Common trees and the principal partition of two graphs," Trans. Inst. Electron, and Comm. Engrs., Japan, vol. 57A, pp. 383-390. Ozawa, T. (1976), "Topological conditions for the solvability of linear active networks," Intl. J. Circuit Theory and Appl, vol. 4, pp. 125-136. Penfield, P. Jr., Spence, R., and Duniker, S. (1970a), "A generalized form of Tellegen's theorem," IEEE Trans. Circuit Theory, vol. CT-17, pp. 302-305. Penfield, P. Jr., Spence, R., and Duniker, S. (1970b), Tellegen's Theorem and Electric Networks, Cambridge, MA: MIT Press. Roth, J. P. (1955), "An application of algebraic topology to numerical analysis: On the existence of a solution to the network problem," Proc. Natl. Acad. Sci. U.S., vol. 41, pp. 518-521. Roth, J. P. (1959), "An application of algebraic topology: Kron's method of tearing," Quart. Appl. Math., vol. 17, pp. 1-24. Sengoku, M. and Chen, W. K. (1988), "An operator in signal flow graphs and its applications," IEEE Trans. Circuits and Systems, vol. 35, pp. 1383-1392. Seviora, S., and Sablatash, M. (1971), "A Tellegen's theorem for digital filters," IEEE Trans. Circuit Theory, vol. CT-18, pp. 201-203. Shinoda, S. (1970), "A minimization problem in network diagnosis," Trans. Inst. Electron. and Comm. Engrs., Japan, vol. 53A, pp. 569-570. Shinoda, S. and Kawamoto, T. (1980), "Central trees and critical sets," Proc. Fourteenth Asilomar Conf. Circuits, Systems & Computers, Pacific Grove, CA, pp. 183-187. Shinoda, S. and Kawamoto, T. (1981), "On central trees of a graph," in Graph Theory and Algorithms, (Editors: N. Saito and T. Nishizeki), Lecture Notes in Computer Science. Berlin, Germany: Springer-Verlag, no. 108, pp. 137-151. Shinoda, S. and Saishu, K. (1980), "Conditions for an incidence set to be a central tree," Papers of Tech. Group on Circuit Syst. Theory, Inst. Electron, and Comm. Engrs., Japan, CAS80-6. Shinoda, S., Sengoku, M., Chen, R. and Chen, W. K. (1995), "On generators of all prime CTS-graphs," Proc. Int. Symp. Nonlinear Theory and Its Applications, Las Vegas, NV, pp. 877-880. Sikorski, R. (1964), Boolean Algebras, 2nd Edition, Berlin, Germany: Springer-Verlag.
644
OTHER NET APPLICATIONS
Stallmann, M. and Gabow, H. N. (1984), "An augmenting path algorithm for the parity problem on linear matroids," in Proc. 25th Ann. IEEE Symp. on Foundations of Computer Sciences, Springer Island, pp. 217-228. Tellegen, B. D. H. (1953), "A general network theorem, with applications," Proc. Inst. Radio Engrs. Australia, vol. 14, pp. 265-270. Tomizawa, N. (1974a), "An algorithm for determining the maximally distant pair of bases with matroidal constraints - generalized versions of Menger's theorem for matroids," Papers of Tech. Group on Circuit Syst. Theory, Inst. Electron, and Comm. Engrs., Japan, CST74-33, pp. 17-24. Tomizawa, N. (1974b), "An algorithm for determining the maximally suspended pair of bases in a semi-muoid with applications to the diagnosis of networks," Papers of Tech. Group on Circuit Syst. Theory, Inst. Electron, and Comm. Engrs., Japan, CST74-80, pp. 19-22. Tomizawa, N. (1976), "Strongly irreducible matroids and principal partition of a matroids into strongly irreducible minors," Trans. Inst. Electron, and Comm. Engrs., Japan, vol. 59A, pp. 83-91. Tomizawa, N. and Iri, M. (1974), "An algorithm for determining the rank of a triple matrix product AXB with application to the problem of discerning the existence of the unique solution in a network," Trans. Inst. Electron, and Comm. Engrs., Japan, vol. 57A, pp. 834-841. Tsetlin, M. L. (1952), "Application of matrix calculus to the synthesis of relay-contact networks," Doklady Akademii Nauk, SSSR, vol. 86, pp. 525-528. Tutte, W. T. (1961), "On the problem of decomposing a graph into n-connected factors," J. London Math. Soc, vol. 36, pp. 221-230. Ueno, S. and Kajitani, Y. (1985), "The unique solvability and state variables of an RCG network," Trans. Inst. Electron, and Comm. Engrs., Japan, vol. 68A, pp. 859-866. Watanabe, H. and Shinoda, S. (1999), "Soul of circuit theory - A review on research activities of graphs and circuits in Japan," IEEE Trans. Circuits and Systems, vol. 45, pp. 83-94. Yoeli, M. (1959), "The theory of switching nets," IRE Trans. Circuit Theory, vol. CT-6 (special supplement), pp. 152-157.
INDEX
(l,0)-matrix, realization 463, 467 0-cell 1 0-simplex 1 1-factor 491, 493-496, 499, 500 1-factorial connection 498, 499, 501 1-matrix algorithm 464 1-matrix, realization 463, 464 1-simplex 1 2-isomorphic graph 48 2-isomorphism 48 A Absorption of a node 539, 541 Absorption postulate 568 Abstract directed graph 74 Abstract graph 1 Acyclic directed graph 92 Additive operator 591, 600 Adjacent node 3 Adjoint matrix 574, 576 Admittance arc 626, 630 Admittance branch 626 Admittance chord 626 Advance of preflow 224, 225
Algebra of the residue class modulo 2 addition 52 multiplication 52 Algorithm 1-matrix 464 blocking flow 205 Bonivka 254, 255 Dijkstra 103 Dinic 220 Edmonds-Karp 216 feasible circulation 357, 358 Floyd-Warshall 146 Ford-Fulkerson 130, 184 Ford-Moore-Bellman 113 Gomory-Hu 280 Karzanov 223, 225 Kruskal 259 matrix 139 maximum tree 252 minimum tree 252 MPM 205, 206 Prim 261, 262 proof of Gomory-Hu 290 round robin 266
646
INDEX
shortest directed path 103, 113, 122, 130, 139, 146 variants of the Ford-Fulkerson 215, 216, 220, 221 Yen 122 Alternating edge train 469 Amida bridge 611-621 bridge edge 619, 621 graph of type n 618, 619 input 504, 525-528, 530-535, 545_547, 551, 552, 554-564, 573, 587, 588, 611-617, 619, 639 n- 618, 619 non-redundant 616, 617 number 618-620, 643 output 525, 526, 528, 532-537, 543, 545-547, 553-555, 557-559, 561-563, 573-576, 587-590, 597, 611-617, 619, 639 path 618 spaghetti 611, 613-617, 639, 643 Anti-symmetric relation 569 Arc 1, 74, 387 admittance 626, 627, 630, 632 basic 146 circuit 77 closed 224 directed 75 flow in net with lower bound on 366 flowless 179 forward 179 gain 504 length 100 noncircuit 77 open 224 oriented 75 outgoing 75 parallel 75, 387 reverse 179 saturated 179 special 193 useful 197 v-i characteristic 626
V-J relation 626 weight 504 Arc capacity 167, 390 irrational 192 residual 192 Arc flow 168 Arc length 100, 216 Arc sequence 77 directed 78 length 77 Arc train 77 directed 78 Articulation point 15 Associated (p.j)-digraph 449 Associated (p,j)-matrix 449 Associated undirected graph 76 Associative postulate 568 Atomic matroid 625 Augmentation routine 185 Augmenting path, flow 180 B Backward process 144 Balance of preflow 224, 225 Balanced node 224 Barkhausen criterion 527 Basic arc 146 Basic reduction rules 538 Basis circuit matrix 61, 83 Basis cut matrix 66, 87 Basis incidence matrix 55, 82 Biadditive operator 591 Bilinear operator 591, 595, 596, 599, 608 Bipartite graph 14, 17 complete 25 directed 92 Blackman's formula 557, 559 Blakesley transformation 626 Block 16, 77, 123 Blocked node 226 Blocking flow 201 Blocking flow algorithm 205 Blue rule 252
INDEX Boolean algebra 567 absorption 568 anti-symmetric 569 associative 568 commutative 569 complement 569 complementation 569 DeMorgan's laws 568, 572 distributive 569 idempotent 568 identity 539, 545, 547, 556, 557, 568-570 identity element 570 inclusion 568, 570 intersection 568-570, 572, 575, 577, 625 inversion 518, 519, 521, 522, 562, 564 involution 568 null element 568 reflexive 568 transitive 569 universal 569, 570 zero 486, 504, 505, 513, 517, 527, 530-533, 551-553, 556, 558-560, 563, 570, 577, 581, 582, 601 Boolean matrix 567, 570-574, 642 Bordering node 261 Bonivka algorithm 254, 255 Branch 1, 55, 77, 241 Breadth-first search 216 Bridge edge 611, 618 C Capacitated net feasible flow in node-and-arc 372 flow in node-and-arc 231 Capacity 167, 173, 373, 390 arc 167, 390 irrational arc 192 node 231, 373 residual 192 terminal 266 Capacity function 168, 329, 390 Capacity matrix, terminal 266, 267
647
Capacity of a generalized disconnecting set 373 Central tree 629, 631-643 Chord 58, 77, 242 Circuit 7, 8, 77 directed 79, 99 /- 59, 83, 242 fundamental 59, 83, 242 length 7 length of a directed 99 negative directed 99 orientation of an /- 83 oriented 82 Circuit arc 77 Circuit-edge incidence matrix 58 Circuit matrix 57, 58, 83, 93 basis 61, 83 complete 61 /- 59, 83 fundamental 59, 83 Circuit rank 8 Circulation, feasible 345, 384 Circulation algorithm, feasible 357, 358 Circulation theorem 345, 384 Closed arc 224 Closed directed-arc sequence 78 Closed edge sequence 7 Closed-loop transfer function 526 Cofactor 498-501, 503, 505, 511, 522, 562, 574 Coincident orientation 82, 85 Color in variance 253 Combinational circuit 573 Combinatorial dual graph 38 Common branch 628, 629 Common chord 628 Common edge 248 Communication net 240 directed 308 oriented 308 synthesis of an optimum undirected 293 Commutative relation 568, 569 Complement 569, 624, 626, 632
648
INDEX
Complementary subgraph 4, 75 Complementary tree structure 630 Complementation 569, 570 Complete bipartite graph 25 order 25 Complete circuit matrix 61 Complete directed graph 92 order 92 Complete graph 25 order 25 Complete incidence matrix 55 Complete set of variables 622-625, 630, 631, 639 Component 8, 77 exterior 29 interior 30 strong 80 strongly connected 80 Computer-aided network analysis 632 Condensed net 276 Condition A 597 Conditional distance 131 Connected directed graph 77 Connected graph 8 Connection 1, 7, 77, 491, 496-499, 501, 573-575, 613, 641, 642 Connection matrix 140, 496, 497, 501, 573-575 Connectivity 9 Conservation equation 168 Constraint feasible 319, 383 infeasible 319, 383 Contraction, graph 35 Corresponding subsets 414 Cotree 58, 77, 242 Critical set 628-630, 635-638 Critical set of G with respect to a 635 CTS-graph 630 CTS-minor 629, 630 Current 508, 526, 528, 529, 531, 533, 534, 547, 555, 558-560, 562, 567, 579, 581, 582, 584, 622, 623, 625-627, 633, 638
Cut 64, 171 incidence 64 minimum s-t 173 oriented 85 s-t 170, 172 capacity 173 Cut-edge incidence matrix Cut matrix 63, 65, 86 basis 66, 87 Cut orientation 85 Cutpoint 15, 77 Cutset 63, 64, 170 /- 67, 87 fundamental 67, 87 minimum s-t 173 s-t 171 capacity 173 Cutset matrix /- 67, 87 fundamental 67, 87 Cut-tree 281 Cycle 8 Cycle rank 9 Cyclomatic number 9
65
D Decomposition 16, 153 Deficiency of 5 with respect to a 635 Degenerative feedback 527 Degree 9, 387 incoming 387 negative 387 outgoing 387 positive 387 Degree pair 387 Demand 319, 373 Demand function 319, 329, 373 DeMorgan's laws 568, 572 Densities of G with respect to a 636 Density 622, 625 Depth-first search 220 Diameter of a tree set 629, 634 Difference, symmetric 10, 11 Difference of sets 10, 11
INDEX Digraph 74 (p,s)- 388 p389 Digraphic realization 413, 414, 441 Digraphic sequence 413 (p,s) 413, 414 Dijkstra algorithm 103 Dinic algorithm 220 d-invariance 434 Directed arc 75 Directed-arc sequence 78 closed 78 length 78 open 78 Directed-arc train 78 Directed bipartite graph 92 Directed bridge 614, 615 Directed circuit 79, 99 length 79, 99 length of a negative 99 negative 99 Directed communication net 308 Directed edge 74, 75 Directed edge train length 99 shortest 99 Directed graph 74, 93, 386, 387 abstract 74 acyclic 92 bipartite 92 complete 92 connected 77 isomorphic 77 matrix associated with 81 nonseparable 77 planar 77 regular 408 separable 77 strongly connected 79 subgraph problem 386 symmetric 91 Directed network 99, 485 Directed path 78, 373 length 78, 100
649
multiterminal shortest 139 shortest 99, 100 Directed path algorithm, shortest 103 Directed path between node sets 373 Directed path product 543, 545 Disconnecting set, generalized 373 Distance, conditional 131 Distance matrix 140 Distance of (p,i)-digraphs 471 Distance of nodes 100, 244, 471 Distance of trees 244 Distributive relation 569, 628, 635 DM decomposition 624, 630 Dominant flow net 303 Dominant flow realization 303 Dominant requirement 296 Dominant requirement tree 294 Dual combinatorial 38 geometric 36 Dual graph 36, 47 combinatorial 38 geometric 36 Dual sequence 424 modified 427 Duality 47 E Eccentricity function of a tree 629, 633 Eccentricity of the tree set 634, 642 Edge 1 common 248 directed 74 parallel 2 removal 10 shorting an 13 subdivision 26 successive 7 Edge-disjoint subgraph 3 Edge incidence 75 Edge length 246, 247 Edge removal 10 Edge sequence 6 closed 7
650
INDEX
endpoints 7 initial node 7 internal nodes 7 length 6 open 7 terminal node 7 Edge subdivision 26 Edge train 7 alternating 469 length of a directed 99 shortest directed 99 Edmonds-Karp algorithm 216 Element 1 Elementary (p,s) d-invariant transformation 434, 435 minimum number 471 Elementary ^-invariant transformation 435 Elementary tree transformation 245 Elimination of node 509 Empty set 569 Endpoint 2, 7, 74 Enumeration of shortest directed paths 153 Equal sets 496, 501, 513, 531, 544, 545, 547, 548, 568, 581, 588, 601, 602, 604, 611, 613, 616, 625-627, 629, 633, 634 Equivalency, flow 270 Equivalent (p,s) matrices 478 Equivalent net, flow 270 Euler formula 20 Extended supply-demand theorem 335, 336, 339 Exterior component 29 Exterior of a circuit 29 Extremal tree 624, 629 F /-circuit 59, 83, 242 orientation 82, 83 /-circuit matrix 59, 83 /-cutset 67, 87 /-cutset matrix 67, 87 Feasibility theorem 318
Feasible circulation 345, 384 Feasible circulation algorithm 357, 358 Feasible constraint 319, 383 Feasible flow 366 Feasible flow in node-and-arc capacitated net 372 Feasible flow pattern 168, 318 Feasible net 293 Feedback amplifier 489, 514, 525, 527, 528, 531, 532, 536, 545-548, 551, 555, 557, 559-561, 563, 564 Feedback factor 527, 531, 563 Finite graph 2 First Betti number 9 Flow 167, 168 blocking 201 feasible 366 maximum 168, 177 minimum 369 Flow algorithm, blocking 205 Flow augmenting path 180 Row conservation equation 168 Flow equivalency 270 Flow equivalent net 270 Flow-equivalent tree, synthesis 275 Flow function 168 Flow in net with lower bound on arc 366 Flow in node-and-arc capacitated net 231 feasible 372 Flow in undirected and mixed net 229 Flow net, dominant 303 Flow pattern 168 feasible 168, 318 value 168 Flow potential 206 Flow problem, simultaneous maximum 240 Flow realization, dominant 303 Flow value 168 Flowless arc 179 Floyd-Warshall algorithm 146 Forbidden subgraph 26 Ford-Fulkerson algorithm 130, 184 variants 215, 216, 220, 221
INDEX Ford-Moore-Bellman algorithm 113 Forest 241, 243 Forward amplifier gain 525, 527 Forward arc 179 Forward feedback loop 505 Forward process 143 Four-tuple net representation 413 Function capacity 168, 329, 390 demand 319, 329, 373 flow 168 length 100, 246 requirement 293 supply 319, 329, 373 Fundamental circuit 59, 83, 242 Fundamental circuit matrix 59, 83 Fundamental cutset 67, 87 Fundamental cutset matrix 67, 87 Fundamental feedback-flow graph 530, 551 Fundamental matrix feedback-flow graph 545, 546, 552, 553 Fundamental system of KCL equations 626 Fundamental system of KVL equations 626 G Gain 508, 525, 527, 528, 533, 534, 538, 551, 559, 560, 562, 564, 601 Games defined on a graph 631 Generalization of Blackman's formula 557 Generalization of Menger's theorem 631 Generalized disconnecting set 373 capacity 373 Generalized signal-flow graph 586-590, 592-595, 597, 599, 601, 638 Geometric diagram 1 Geometric dual graph 36 Geometric graph 2 Gomory-Hu algorithm 280 proof 290 Gomory-Hu realization procedure 297
651
Graph 1, 6, 433 (p,s)- 433 p433 2-isomorphic 48 abstract 1 abstract directed 74 acyclic directed 92 associated undirected 76 bipartite 14, 17 complete 25 complete bipartite 25 complete directed 92 connected 8 density 622, 625 determinant 490, 491, 505 directed 74, 93, 386, 387 directed bipartite 92 dual 36 finite 2 fundamental feedback-flow 530, 551 fundamental matrix feedback-flow 545, 546, 552, 553 gain 601 games defined on 631 generalized signal-flow 586-590, 592-595, 597, 599, 601, 638 geometric 2 geometric dual 36 homeomorphic 28 infinite 2 intersection 11 isomorphic 4, 77 labeled 6 linear 1 linear signal-flow 564, 602, 604, 606-609 matrix associated with 52 matrix associated with a directed 81 matrix signal-flow 536-538, 540-545, 563 nonseparable 14, 15, 77 normalized signal-flow 508 null 3 operation on 10
652
INDEX
Petersen 34 planar 18, 77, 93 principal partition of a 631, 641, 642 principal partition of a directed 631 requirement 293 separable 15, 77 signal-flow 484-486, 488, 490-492, 494-501, 504-510, 512-525, 528, 530, 531, 534-545, 562-564, 586-590, 592-595, 597, 599, 601-604, 606-609, 638, 639 subgraph problem 432 subgraph problem of a directed 386 sum 11 symmetric directed 91 Tellegen's theorem for signal-flow 589, 608 transmission 504, 505, 508, 510, 514, 517, 518, 520, 522, 523, 536-538, 540, 541, 543-545, 563, 601-604, 611 transposed 602, 603, 605, 607, 608 tree 624, 641 weighted 6 Graph contraction 35 Graph decomposition 16, 153, 621 Graph isomorphism 4. 77 Graph operation 10 triple 147 Graphical sequence 441 (pj) 441 Greedy method 252 H Hamiltonian circuit 624 Height of a layered net 201 Homeomorphic graph 28 Homeomorphism 28 Hybrid analysis 621 Hybrid rank 622, 627, 628, 633, 634, 639 I Ideal feedback model 531, 563
525, 526, 528,
Idempotent 568 Identity 539, 545, 547, 556, 557, 568-570 Identity Boolean matrix 570 Impedance arc 626 Impedance branch 626 Impedance chord 626 Incidence 1, 75 Incidence cut 64 Incidence matrix 53, 81 basis 55, 82 circuit-edge 58 complete 55 cut-edge 65 node-edge 53 Inclusion 568, 570 Incoming degree 387 Induced subgraph 14 Infeasible constraint 319, 383 Infinite graph 2 In-flow potential 206 Initial node 7, 74, 78, 387 Inner piece 30 Input endpoint 611 Input signal 526, 533-535, 587, 588 Integrity theorem 191, 192 Interchange, (p,s)- 450 Interior component 30 Interior of a circuit 30 Intermediate node 168 Internal node 7 Interrelations of graph matrices 70, 89 Intersection 568-570, 572, 575, 577, 625 Intersection graph 11 Intersection of sets 10, 11 Into matching 411 Invariance, color 253 Inversion of a matrix 522, 562 Involutory Boolean matrix 570 Irrational arc capacity 192 Irreducible matroid 625 Irreducible minor 625 Irreducible minor with complementary tree structure 629, 630
INDEX Isolated node 3, 243 Isomorphic graph 4, 77 Isomorphism 4, 77 J Junction
1
K Karzanov algorithm 223, 225 Kronecker delta 486 Kruskal algorithm 259 L Label permanent 103 temporary 103 Labeled graph 6 Labeled node 103, 184, 357 Labeling routine 185 Labeling rules 367 Layer 197 unbalanced 224 Layered net 197 Layered residue net 217 Length 99, 100, 246, 247 Length function 100, 264 Length of a circuit 7 Length of a directed-arc sequence 78 Length of a directed circuit 79, 99 Length of a directed edge train 99 Length of a directed path 78, 100, 216 Length of a path 7, 216 Length of a tree 247 Length of an arc 100 Length of an arc sequence 77 Length of an edge 246 Length of an edge sequence 6 Line 1 Linear graph 1 Linear signal-flow graph 564, 602, 604, 606-609 Linear tree 279 Link 58, 242 Loop 8
653
Loop transmission 505, 527, 531 Loop-transmission matrix 552, 553 M Major submatrix 56 Mapping 18 Matching in a directed graph 411 Matrices, interrelationships among graph 70, 89 Matrix (p,s) 449 adjoint 574, 576 basis circuit 61, 83 basis cut 66, 87 basis incidence 55, 82 circuit 57, 58, 83, 93 circuit-edge incidence 58 complete circuit 61 complete incidence 55 connection 140, 496, 497, 501, 573-575 cut 63, 65, 86 cut-edge incidence 65 distance 140 /-circuit 59, 83 /-cutset 67, 87 fundamental circuit 59, 83 fundamental cutset 67, 87 incidence 53, 81 interrelationships among graphs 70, 89 inversion 522, 570 involutory 570, 571 loop-transmission 552, 553 node-edge incidence 53 node-to-datum path 71, 72, 89 null return difference 553-555, 557, 561-563 null return ratio 554 orthogonal 570 output 573-576 p449 primitive connection 573 principally partitionable 271 requirement 293
654
INDEX
return difference 551-555, 557, 558, 561-563 return ratio 552, 554 semi-principally partitionable 309 skew-symmetric 570, 571 switching 572, 573 symmetric 570, 571 terminal capacity 266, 267 tranjugate 571, 572 transfer-function 545, 546, 550, 556, 557, 563 transposition 570, 612, 613 universal 569, 570 zero 486, 504, 505, 513, 517, 527, 530-533, 551-553, 556, 558-560, 563, 570, 577, 581, 582, 601 Matrix algorithm 139 Matrix associated with a directed graph 81 Matrix associated with a graph 52 Matrix signal-flow graph 536-538, 540-545, 563 Max-flow min-cut theorem 177, 178 Maximally distant trees 628, 629, 642 Maximum flow 168, 177 Maximum flow problem, simultaneous 240 Maximum-rank minimum-term rank theorem 630 Maximum tree 246, 247 Maximum tree algorithm 252 Mesh 19 outside 23 Minaddition operation 140 Minimal property 171 Minimal transformation 469, 471 Minimum flow 369 Minimum s-t cut 173 Minimum s-t cutset 173 Minimum tree 240, 246, 247 Minimum tree algorithm 252 Minor with complementary tree structure 629, 630 Mixed and undirected net, flow in 229
Modified directed path product 543, 545 Modified dual sequence 427 Molecular matroid 625 MPM algorithm 205, 206 Multiple-loop feedback amplifier theory 536, 545 Multiple node removal 509, 575, 577 Multiterminal shortest directed path 139 N n-Amida 618, 619 Narayanan-Tomizawa partition 636 Negative degree 387 Negative directed circuit 99 Negative feedback 527, 534, 535 Neighboring node 3 Net 99, 484-486, 496, 535, 536, 566, 567, 573, 575-578, 581, 587, 588, 621-623, 625, 626, 632, 639 capacitated 167 communication 240 condensed 276 directed communication 308 dominant flow 303 feasible 293 feasible flow in node-and-arc capacitated 372 flow equivalent 270 flow in node-and-arc capacitated 231 flow in undirected and mixed 229 layered 197 layered residue 217 oriented communication 308 residue 216 synthesis of an optimum undirected communication 293 undirected 246 Net with lower bound on arc, flow in 366 Network capacitated 167 directed 99 Network diagnosis 631, 643 n-factor 408
INDEX Nodal signal 487, 504, 507, 588, 589 Node 1, 74 absorption 539, 541, 568 absorption of a 539, 541 adjacent 3 balanced 224 blocked 226 bordering 261 elimination of 509 factor 543 initial 7, 74, 78, 387 intermediate 168 internal 7 isolated 3, 243 labeled 103, 184, 357 neighboring 3 non-output 573, 575 output 37, 543, 573, 575, 613, 615, 617 reference 55, 82 removal 10 scanned 184, 357 signal 487, 504, 507, 588, 589 sink 168 source 102, 168, 504, 505, 508, 514, 518, 520, 522, 523, 537, 543, 589 split 510, 543 terminal 7, 74, 78, 387 transmission 543 unbalanced 224 unlabeled 184, 357 unscanned 184, 357 Node-and-arc capacitated net feasible flow in 372 flow in 231 Node capacity 231, 373 Node degree 9 Node-disjoint subgraphs 3 Node-edge incidence matrix 53 Node label 103 Node removal 10 Node-to-datum path matrix 71, 72, 89 Noise and Feedback 534
655
Noncircuit arc 77 Non-output node 573, 575 Non-redundant Amida 616, 617 Non-redundant TH-sequence 616 Nonseparable directed graph 77 Nonseparable graph 14, 15, 77 Normalized signal-flow graph 508 Null element 568 Null graph 3 Null return difference 532-534, 553-557, 560-563 Null return difference matrix 553-555, 557, 561-563 Null return ratio 532-534, 554 Null return ratio matrix 554 Null set 485, 532-534, 553-557, 560-564, 568, 569 Nullity 8, 75 O Odd-circuit condition 436, 438 One-connection 499 Onto matching 411 Open arc 224 Open directed-arc sequence 78 Open edge sequence 7 Open-loop transfer function 525, 526 Operation on graph 10 Operator additive 600 biadditive 591 bilinear 591, 595, 596, 599, 608 for two isomorphic signal-flow graphs 590 for two non-isomorphic signal-flow graphs 597 SFG 590, 592, 595-597, 599-602, 606, 608, 638, 639 symmetric 494, 569-572, 575, 590-600, 608 Opposite orientations 82, 85 Optimum undirected communication net, synthesis 293 Ordered pair 74
656
INDEX
Or-determinant 574 Orientation of a cut 85 Orientation of an /-circuit 83 Oriented arc 75 Oriented circuit 82 Oriented communication net 308 Oriented cut 85 Orthogonal Boolean matrix 570, 571 Outer piece 29 Out-flow potential 206 Outgoing arc 75 Outgoing degree 387 Output endpoint 611 Output matrix 573-576 Output node 573, 575, 613, 615, 617 Output signal 587, 588 Outside mesh 23 Outside region 19 P (p,5)-digraph 388 associated 449 (p,s) digraphic realization 414 (p,s) digraphic sequence 413, 414 (p,s) digraphs, distance 471 (p,s)-graph 433 (p,s) graphical realization 441 (p,s) graphical sequence 441 (p,s)-interchange 450 (p,j)-matrix 449 associated 449 equivalent 478 (p,s) subgraph, symmetric 433 Parallel arc 75, 387 Parallel edge 2 Parallel reduction 538, 541 Partial ordering 569 Partition principal 271 semi-principal 309 Path 7, 77 directed 78, 373 flow augmenting 180 multiterminal shortest directed 139 shortest directed 100
Path length 7, 216 directed 78, 216 Path matrix, node-to-datum 71, 72, 89 Path of arc length 216 p-digraph 389 Peripheral tree 629 Permanent 496, 497, 501, 502 Petersen graph 34 p-graph 433 Phase 201, 217 Piece inner 30 outer 29 Planar graph 18, 77, 93 circuit matrix 93 p-matrix 449 Point 1 articulation 15 Positive current 625 Positive degree 387 Positive feedback 527 Potential flow 206 in-flow 206 out-flow 206 Preflow 224 advance 224, 225 balance 224, 225 Prim algorithm 261, 262 Primal-dual method 632-634, 639 Prime CTS-minor 630 Primitive connection matrix 573 Principal partition 271, 623-625, 628, 630-632, 635, 639, 641-644 Principal partition of a directed graph 631 Principal partition of a graph 631, 641, 642 Principal partition of G with respect to a 635 Principal partition of the two-graph 631 Principally partitionable matrix 271 Process backward 144 forward 143 Proof of the Gomory-Hu algorithm 290
INDEX Proper subgraph 2 symmetric 432 Proper subset 509, 568 P-sequence 625 P-set of cycles 491 Q Quadruplet net representation Queue 225 Quintuplet net representation
168 345, 373
R Radius of a tree set 629, 634 Rank 8, 75 circuit 8 cycle 9 RCG networks 631 Realization (p,s) digraphic 414 (p,s) graphical 441 dominant flow 303 Realization of the (l,0)-matrix 463, 467 Realization of the 1-matrix 463, 464 Red rule 253 Reference node 55, 82 Reflexive relation 568 Regenerative feedback 527 Region 19 outside 19 Regular directed graph 408 degree 408 Removal of a node 10 Removal of a self-loop 520, 539, 540 Removal of an edge 10 Requirement dominant 296 uniform 297 Requirement function 293 Requirement graph 293 Requirement matrix 293 Requirement subtree, synthesis of a uniform 299 Requirement tree dominant 294 synthesis of a uniform 299
657
Residual capacity 192 Residue class modulo 2 algebra 52 addition 52 multiplication 52 Residue net 216 layered 217 Resultant main submatrix 272, 309 Return difference 531-534, 551-563 Return difference matrix 551-555, 557, 558, 561-563 Return ratio 530-534, 551, 552, 554 Return ratio matrix 552, 554 Reverse arc 179 Ring sum 10, 11 RLCT network 630 Round robin algorithm 266 Rule blue 252 red 253 S Saturated arc 179 Scanned node 184, 357 Search breadth-first 216 depth-first 220 Second hybrid rank 633, 634 Second topological degree of freedom 632-634 Sectional subgraph 14, 75 Self-dual 38 Self-loop 2, 75, 389 Semi-principal partition 309 Semi-principally partitionable matrix Separable directed graph 77 Separable graph 15, 77 decomposition of 16 Separation, u-v 30 Sequence (p,s) digraphic 413, 414 (p,s) graphical 441 digraphic 413 dual 424 graphical 441 modified dual 427
309
658
INDEX
Series reduction 538, 539 Set empty 569 equal 496, 501, 513, 531, 544, 545, 547, 548, 581, 588, 601, 602, 604, 611, 613, 616, 625-627, 629, 633, 634 null 485, 532-534, 553-557, 560-564, 568, 569 universal 569 Set difference 10, 11 Set inclusion 568 Set intersection 10, 11 Set ring sum 10, 11 Set union 10, 11 SFG operator 590, 592, 595-597, 599-602, 606, 608, 638, 639 Shannon switching game 630, 631, 640-642 Shortest directed edge train 99 Shortest directed path 100 multiterminal 139 Shortest directed path algorithm 103, 113, 122, 130, 139, 146 Shortest directed-path enumeration by decomposition 153 Shorting an edge 13 Signal-flow graph 484-486, 488, 490-492, 494-501, 504-510, 512-525, 528, 530, 531, 534-545, 562, 563, 587, 588, 590, 597, 601-604, 606-609 Signal flow network 587 Signal-to-noise ratio 534, 535 Simultaneous maximum flow problem 240 Single-loop feedback amplifier theory 528 Sink 543, 589, 601-606, 609, 611 Sink node 168 Skew-symmetric Boolean matrix 570 Source node 102, 168, 504, 505, 508, 514, 518, 520, 522, 523, 537, 543, 589 Spaghetti Amida 611, 613-617, 639, 643 Spanning subgraph 3 Spanning tree 241
Special arc 193 s-t cut 170, 172, 173 capacity 172 minimum 173 s-t cutset 170, 171, 173 capacity 173 minimum 173 Stack 225 Star-mesh transformation 575, 577 Strong component 80 Strongly connected component 80 Strongly-connected directed graph 79 Strongly irreducible minor 625 Strongly irreducible minor with complementary tree structure 630 Subdivision of an edge 26 Subgraph 2, 75 complementary 4, 75 edge-disjoint 3 forbidden 26 induced 14 node-disjoint 3 proper 2 sectional 14, 75 spanning 3 symmetric (p,s) 433 Subgraph problem of a directed graph 386 Subgraph problem of a graph 432 Submatrix major 56 resultant main 272, 309 Subset 509, 568, 576, 623, 624, 628, 629, 635 Subsets, corresponding 414 Subtree 241, 243 synthesis of a uniform requirement 299 Successive edge 7 Sum graph 11 Supply 319, 373 Supply-demand theorem 318 extended 335, 336, 339 symmetric 335, 336, 340, 384 Supply function 319, 329, 373 Switching matrix 572, 573
INDEX
Switching net 567, 640, 644 Symmetric (p,s)-digraph 432 Symmetric (p,s) subgraph 433 Symmetric Boolean matrix 570 Symmetric difference 11 Symmetric directed graph 91 Symmetric operator 494, 569-572, 575, 590-600, 608 Symmetric supply-demand theorem 335, 336, 340, 384 Synthesis of a flow-equivalent tree 275 Synthesis of a uniform requirement subtree 299 Synthesis of a uniform requirement tree 299 Synthesis of an optimum undirected communication net 293 T Tabular method 632 Tellegen's theorem 579, 582, 584, 586, 587, 589, 590, 608, 638, 643 Tellegen's theorem for signal-flow graphs 589, 608 Terminal capacity 266 Terminal capacity matrix 266, 267 Terminal node 7, 74, 78, 387 Terminating node 75 Theorem circulation 345, 384 extended supply-demand 335, 336, 339 feasibility 318 integrity 191, 192 max-flow min-cut 177, 178 supply-demand 318 symmetric supply-demand 335, 336, 340, 384 TH-sequence 615-617 Topological degree of freedom 622, 625, 628, 629, 632-634, 641 Topological procedure 538, 543, 546, 563 Tranjugate matrix 571, 572 Transfer-function matrix 545, 546, 550, 556, 557, 563
659
Transfer function of a unilateral feedback path 526 Transfer function of the unilateral forward path 525 Transformation elementary (p,s) ^-invariant 434, 435 elementary ^-invariant 435 elementary tree 245 minimal 469, 471 Transitive relation 569 Transmittance 504, 505, 507, 509, 512-514, 517, 518, 520, 522, 523, 530, 538, 539, 551-553, 563, 587 Transposed graph 602, 603, 605, 607, 608 Tree 55, 77, 241 central 629, 631-643 dominant requirement 294 eccentricity function of a tree 629, 633 eccentricity of the tree set 634, 642 extremal 624, 629 graph 624, 641 linear 279 maximally distant 628, 629, 642 maximum 246, 247 minimum 240, 246, 247 peripheral 629 spanning 241 synthesis of a flow-equivalent 275 synthesis of a uniform requirement 299 y-reference 626 Tree algorithm maximum 252 minimum 252 Tree graph 624, 641 Tree length 247 Tree transformation, elementary 245 Triple operation 147 Triplet net representation 100 U Unbalanced layer 224 Unbalanced node 224, 357 Undirected and mixed net, flow in 229 Undirected communication net, synthesis of an optimum 293
660
INDEX
Undirected graph, associated 76 Undirected net 246 Uniform requirement 297 Uniform requirement subtree, synthesis 299 Uniform requirement tree, synthesis Union 568-571, 573, 574, 576, 577, Unique solvability of electrical networks 630 Universal Boolean matrix 570 Universal element 570 Universal set 569 Unlabeled node 184, 357 Unordered pair 1 Unscanned node 184, 357 Useful arc 197 u-v separation 30 V Variants of the Ford-Fulkerson algorithm 215, 216, 220, 221
Venn diagram 569 Vertex 1 Voltage 488, 505, 526, 528, 529, 531, 533, 547, 548, 551, 555, 558, 561, 562, 579, 581, 582, 584, 622, 625-627, 633, 638 Voltage drop 625 W Weight 485-487, 495, 500, 501, 504, 590 Weighted graph 6 Window 19 Y Yen algorithm 122 y-reference tree 626 Z Zero Boolean element 570 Zero Boolean matrix 570