+ All Categories
Home > Documents > Graph Theory with Applications to Engineering and Computer ......Library of Congress...

Graph Theory with Applications to Engineering and Computer ......Library of Congress...

Date post: 31-Mar-2021
Category:
Upload: others
View: 10 times
Download: 1 times
Share this document with a friend
598
Transcript
Page 1: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications
Page 2: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

www.TechnicalBooksPDF.com

Page 3: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

GraphTheorywithApplicationstoEngineering&ComputerScience

NARSINGHDEOMillicanChairProfessor,Dept.ofComputerScience

Director,CenterforParallelComputation,

UniversityofCentralFlorida

DOVERPUBLICATIONS,INC.Mineola,NewYork

www.TechnicalBooksPDF.com

Page 4: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

CopyrightCopyright©1974byNarsinghDeo

Allrightsreserved.

BibliographicalNote

ThisDoveredition,firstpublishedin2016,isanunabridgedrepublicationoftheworkoriginallypublishedin1974byPrentice-Hall,Inc.,EnglewoodCliffs,NewJersey.

LibraryofCongressCataloging-in-PublicationDataNames:Deo,Narsingh1936–Title:Graphtheorywithapplicationstoengineeringandcomputerscience/NarsinghDeo.

Description:Doveredition.|Mineola,NewYork:DoverPublications,2016.Originallypublished:EnglewoodCliffs,NewJersey:Prentice-Hall,Inc.,1974.|Includesbibliographicalreferencesandindex.

Identifiers:LCCN2016008025|ISBN9780486807935|ISBN0486807932Subjects:LCSH:Graphytheory.|Engineeringmathematics.

Classification:LCCTA338.G7D462016|DDC511/.5—dc23LCrecordavailableathttp://lccn.loc.gov/2016008025

ManufacturedintheUnitedStatesbyRRDonnelley

807932012016www.doverpublications.com

www.TechnicalBooksPDF.com

Page 5: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Tothememoryofmyfather,whodidnotlivetorealizehisgreatestambition—thatofwitnessinghiseldestsonmatriculate.

www.TechnicalBooksPDF.com

Page 6: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

CONTENTS

PREFACE

1 INTRODUCTION

1-1 WhatisaGraph?1-2 ApplicationofGraphs1-3 FiniteandInfiniteGraphs1-4 IncidenceandDegree1-5 IsolatedVertex,PendantVertex,andNullGraph1-6 BriefHistoryofGraphTheory

SummaryReferencesProblems

2 PATHSANDCIRCUITS

2-1 Isomorphism2-2 Subgraphs2-3 APuzzleWithMulticoloredCubes2-4 Walks,Paths,andCircuits2-5 ConnectedGraphs,DisconnectedGraphs,andComponents2-6 EulerGraphs2-7 OperationsOnGraphs2-8 MoreonEulerGraphs2-9 HamiltonianPathsandCircuits2-10 TheTravelingSalesmanProblem

Summary

www.TechnicalBooksPDF.com

Page 7: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

ReferencesProblems

3 TREESANDFUNDAMENTALCIRCUITS

3-1 Trees3-2 SomePropertiesofTrees3-3 PendantVerticesinaTree3-4 DistanceandCentersinaTree3-5 RootedandBinaryTrees3-6 OnCountingTrees3-7 SpanningTrees3-8 FundamentalCircuits3-9 FindingAllSpanningTreesofaGraph3-10 SpanningTreesinaWeightedGraph

SummaryReferencesProblems

4 CUT-SETSANDCUT-VERTICES

4-1 Cut-Sets4-2 SomePropertiesofaCut-Set4-3 AllCut-SetsinaGraph4-4 FundamentalCircuitsandCut-Sets4-5 ConnectivityandSeparability4-6 NetworkFlows4-7 1-Isomorphism4-8 2-Isomorphism

SummaryReferencesProblems

www.TechnicalBooksPDF.com

Page 8: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

5 PLANARANDDUALGRAPHS

5-1 CombinatorialVs.GeometricGraphs5-2 PlanarGraphs5-3 Kuratowski’sTwoGraphs5-4 DifferentRepresentationsofaPlanarGraph5-5 DetectionofPlanarity5-6 GeometricDual5-7 CombinatorialDual5-8 MoreonCriteriaofPlanarity5-9 ThicknessandCrossings

SummaryReferencesProblems

6 VECTORSPACESOFAGRAPH

6-1 SetswithOneOperation6-2 SetswithTwoOperations6-3 ModularArithmeticandGaloisFields6-4 VectorsandVectorSpaces6-5 VectorSpaceAssociatedwithaGraph6-6 BasisVectorsofaGraph6-7 CircuitandCut-SetSubspaces6-8 OrthogonalVectorsandSpaces6-9 IntersectionandJoinofWandWs

SummaryReferencesProblems

7 MATRIXREPRESENTATIONOFGRAPHS

7-1 IncidenceMatrix7-2 SubmatricesofA(G)

www.TechnicalBooksPDF.com

Page 9: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

7-3 CircuitMatrix7-4 FundamentalCircuitMatrixandRankofB7-5 AnApplicationtoaSwitchingNetwork7-6 Cut-SetMatrix7-7 RelationshipsamongAf,Bf,andCf7-8 PathMatrix7-9 AdjacencyMatrix

SummaryReferencesProblems

8 COLORING,COVERING,ANDPARTITIONING

8-1 ChromaticNumber8-2 ChromaticPartitioning8-3 ChromaticPolynomial8-4 Matchings8-5 Coverings8-6 TheFourColorProblem

SummaryReferencesProblems

9 DIRECTEDGRAPHS

9-1 WhatIsaDirectedGraph?9-2 SomeTypesofDigraphs9-3 DigraphsandBinaryRelations9-4 DirectedPathsandConnectedness9-5 EulerDigraphs9-6 TreeswithDirectedEdges9-7 FundamentalCircuitsinDigraphs9-8 MatricesA,B,andCofDigraphs9-9 AdjacencyMatrixofaDigraph9-10 PairedComparisonsandTournaments

www.TechnicalBooksPDF.com

Page 10: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

9-11 AcyclicDigraphsandDecyclizationSummaryReferencesProblems

10 ENUMERATIONOFGRAPHS

10-1 TypesofEnumeration10-2 CountingLabeledTrees10-3 CountingUnlabeledTrees10-4 Pólya’sCountingTheorem10-5 GraphEnumerationWithPólya’sTheorem

SummaryReferencesProblems

11 GRAPHTHEORETICALGORITHMSANDCOMPUTERPROGRAMS

11-1 Algorithms11-2 Input:ComputerRepresentationofaGraph11-3 TheOutput11-4 SomeBasicAlgorithms

Algorithm1:ConnectednessandComponentsAlgorithm2:ASpanningTreeAlgorithm3:ASetofFundamentalCircuitsAlgorithm4:Cut-VerticesandSeparabilityAlgorithm5:DirectedCircuits

11-5 Shortest-PathAlgorithmsAlgorithm6:ShortestPathfromaSpecifiedVertextoAnotherSpecifiedVertexAlgorithm7:ShortestPathbetweenAllPairsofVertices

11-6 Depth-FirstSearchonaGraphAlgorithm8:PlanarityTesting

11-7 Algorithm9:Isomorphism

www.TechnicalBooksPDF.com

Page 11: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

11-8 OtherGraph-TheoreticAlgorithms11-9 PerformanceofGraph-TheoreticAlgorithms11-10 Graph-TheoreticComputerLanguages

SummaryReferencesProblemsAppendixofPrograms

12 GRAPHSINSWITCHINGANDCODINGTHEORY

12-1 ContactNetworks12-2 AnalysisofContactNetworks12-3 SynthesisofContactNetworks12-4 SequentialSwitchingNetworks12-5 UnitCubeandItsGraph12-6 GraphsinCodingTheory

SummaryReferences

13 ELECTRICALNETWORKANALYSISBYGRAPHTHEORY

13-1 WhatIsanElectricalNetwork?13-2 Kirchhof’sCurrentandVoltageLaws13-3 LoopCurrentsandNodeVoltages13-4 RLCNetworkswithIndependentSources:NodalAnalysis13-5 RLCNetworkswithIndependentSources:LoopAnalysis13-6 GeneralLumped,Linear,FixedNetworks

SummaryReferencesProblems

14 GRAPHTHEORYINOPERATIONSRESEARCH

14-1 TransportNetworks

www.TechnicalBooksPDF.com

Page 12: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

14-2 ExtensionsofMax-FlowMin-CutTheorem14-3 MinimalCostflows14-4 TheMulticommodityFlow14-5 FurtherApplications14-6 MoreonFlowProblems14-7 ActivityNetworksinProjectPlanning14-8 AnalysisofanActivityNetwork14-9 FurtherCommentsonActivityNetworks14-10 GraphsinGameTheory

SummaryReferences

15 SURVEYOFOTHERAPPLICATIONS

15-1 Signal-FlowGraphs15-2 GraphsinMarkovProcesses15-3 GraphsinComputerProgramming15-4 GraphsinChemistry15-5 MiscellaneousApplications

AppendixA BINET-CAUCHYTHEOREM

AppendixB NULLITYOFAMATRIXANDSYLVESTER’SLAW

INDEX

www.TechnicalBooksPDF.com

Page 13: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

PREFACE

The last two decades have witnessed an upsurge of interest and activity ingraph theory, particularly among appliedmathematicians and engineers. Clearevidence of this is to be found in an unprecedented growth in the number ofpapers and books being published in the field. In 1957 therewas exactly onebookon the subject (namely,König’sThéoriederEndlichenundUnendlichenGraphen).Now,sixteenyearslater,thereareovertwodozentextbooksongraphtheory, and almost an equal number of proceedings of various seminars andconferences.Eachbookhasitsownstrengthandpointsofemphasis,dependingontheaxe

(or thepen) the authorhas togrind. Ihaveemphasized thecomputational andalgorithmic aspects of graphs. This emphasis arises from the experience andconviction that whenever graph theory is applied to solving any practicalproblem(beitinelectricalnetworkanalysis,incircuitlayout,indatastructures,in operations research, or in social sciences), it almost always leads to largegraphs—graphs that are virtually impossible to analyzewithout the aid of thecomputer. An engineer often finds that those real-life problems that can bemodeled into graphs small enough to be worked on by hand are also smallenough to be solved bymeans other than graph theory. (In this respect graphtheory is different from college algebra, elementary calculus, or complexvariables.)Infact,thehigh-speeddigitalcomputerisoneofthereasonsfortherecentgrowthofinterestingraphtheory.Convincedthatastudentofappliedgraphtheorymustlearntoenlistthehelp

of a digital computer for handling largegraphs, I have emphasized algorithmsandtheirefficiencies.Inprovingtheorems,constructiveproofshavebeengivenpreferenceovernonconstructiveexistenceproofs.Chapter11,thelargestinthebook, is devoted entirely to computational aspects of graph theory, includinggraph-theoreticalgorithmsandsamplesofseveraltestedcomputerprogramsforsolvingproblemsongraphs.Ibelievethisapproachhasnotbeenusedinanyofthe earlier books on graph theory. Thematerial covered inChapter 11 and inmanysectionsfromotherchaptersisappearingforthefirsttimeinanytextbook.

www.TechnicalBooksPDF.com

Page 14: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Yet theappliedandalgorithmicaspectof thisbookhasnotbeenallowed tospoil the rigor and mathematical elegance of graph theory. Indeed, the bookcontainsenoughmaterialforacoursein“pure”graphtheory.Thebookhasbeenmadeasmuchself-containedaswaspossible.Thelevelofpresentationisappropriateforadvancedundergraduateandfirst-

year graduate students in all disciplines requiring graph theory. The book isorganized so that the first half (Chapters 1 through 9) serves as essential andintroductory material on graph theory. This portion requires no specialbackground, except some elementary concepts from set theory and matrixalgebraand,ofcourse,acertainamountofmathematicalmaturity.Althoughtheillustrationsofapplicationsareinterwovenwiththetheoryeveninthisportion,theexamplesselectedareshortandmostlyofthenatureofpuzzlesandgames.Thisisdonesothatastudentinalmostanyfieldcanreadandgraspthefirsthalf.Thesecondhalfofthebookismoreadvanced,anddifferentchaptersrequire

different backgrounds as they deal with applications to nontrivial, real-world,complexproblemsindifferentfields.Keepingthisinmind,Chapters10through15havebeenmadeindependentofeachother.Onecouldstudya laterchapterwithout going through the earlier ones, provided the first nine chapters havebeencovered.Sincethereismorematerialherethanwhatcanbecoveredinaone-semester

course,itissuggestedthatthecontentsbetailoredtosuittherequirementsofthestudentsindifferentdisciplines,forexample:

1. ElectricalEngineering:Chapters1–9,and11,12,and13.

2. ComputerScience:Chapters1–9,11,12,andpartsof10and15.

3. OperationsResearch:Chapters1–9,and11,14,andpartsof15.

4. AppliedMathematics:Chapters1–11andpartsof15.

5. Introductory“pure”graphtheory:Chapters1–10.

In fact, the book grew out of a number of such courses and lecture-seriesgivenbytheauthorattheJetPropulsionLaboratory,CaliforniaStateUniversityatLosAngeles,theIndianInstituteofTechnologyatKanpur,andtheUniversityofIllinoisatUrbana-Champaign.

ACKNOWLEDGMENTS

It is a pleasure to acknowledge the help I have received from different

www.TechnicalBooksPDF.com

Page 15: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

individualsandinstitutions.IamparticularlyindebtedtoMr.DavidK.Rubin,adear friend and former colleague at the Jet PropulsionLaboratory;Mr.MatetiPrabhaker, a former graduate student of mine at the Indian Institute ofTechnology,Kanpur;andProfessorJurgNievergeltoftheUniversityofIllinoisatUrbana-Champaignforhavingreadtheentiremanuscriptandmadenumeroussuggestionsforimprovementsthroughoutthebook.Otherfriends,colleagues,andstudentswhoreadpartsofthemanuscriptand

madehelpfulsuggestionsare:ProfessorHarryLassandMr.MarvinPerlmanofthe Jet Propulsion Laboratory, Professor Nandlal Jhunjhunwala of CaliforniaStateUniversityatLosAngeles,Dr.GeorgeShuraymofTexasInstruments,Mr.Jean A, DeBeule of Xerox Data Systems, Mr. Nicholas Karpov of Bell &Howell,ProfessorC.L.LiuoftheUniversityofIllinoisatUrbana-Champaign,Messrs. M. S. Krishnamoorthy, K. G. Ramakrishnan, and Professors C. R.MuthukrishnanandS.K.BasuoftheIndianInstituteofTechnologyatKanpur.I am also grateful to the late Professor George E. Forsythe of Stanford

Universityforhisencouragementattheveryoutsetofthisproject.SupportinwritingthisbookwasreceivedfromtheJetPropulsionLaboratory,

the Indian Institute of Technology at Kanpur, and the Computer ScienceDepartmentoftheUniversityofIllinoisatUrbana-Champaign.Justasonedoesnotthankhimself,expressinggratitudetoone’swifeinpublic

isnotaHinducustom.Forthewifeisconsideredapartofthehusband,andhercoauthorship is tacitlyassumed inanybookherhusbandwrites.There is littledoubtthatwithoutKiran’shelpthisbookwouldnothavebeenpossible.

NARSINGHDEO

Kanpur

www.TechnicalBooksPDF.com

Page 16: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

GraphTheorywithApplicationstoEngineering&ComputerScience

www.TechnicalBooksPDF.com

Page 17: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

1INTRODUCTION

1-1. WHATISAGRAPH?

Alinear†graph(orsimplyagraph)G=(V,E)consistsofasetofobjectsV={v1v2,...}calledvertices,andanothersetE={e1’e2,...},whoseelementsarecallededges,suchthateachedgeekisidentifiedwithanunorderedpair(vi,vj)ofvertices.Theverticesvivjassociatedwithedgeekarecalledtheendverticesofek. Themost common representation of a graph is bymeans of a diagram, inwhich the vertices are represented as points and each edge as a line segmentjoiningitsendvertices.Oftenthisdiagramitselfisreferredtoasthegraph.TheobjectshowninFig.1-1,forinstance,isagraph.Observethatthisdefinitionpermitsanedgetobeassociatedwithavertexpair

(vi,vi).Suchanedgehavingthesamevertexasbothitsendverticesiscalledaself-loop(orsimplyaloop.Thewordloop,however,hasadifferentmeaninginelectrical network theory; we shall therefore use the term self-loop to avoidconfusion).Edgee1inFig.1-1isaself-loop.Alsonotethatthedefinitionallowsmorethanoneedgeassociatedwithagivenpairofvertices,forexample,edgese4ande5inFig.1-1.Suchedgesarereferredtoasparalleledges.

Fig.1-1Graphwithfiveverticesandsevenedges.

www.TechnicalBooksPDF.com

Page 18: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Agraphthathasneitherself-loopsnorparalleledgesiscalledasimplegraph.Insomegraph-theoryliterature,agraphisdefinedtobeonlyasimplegraph,butinmostengineeringapplicationsitisnecessarythatparalleledgesandself-loopsbe allowed; this is why our definition includes graphs with self-loops and/orparallel edges. Some authors use the term general graph to emphasize thatparalleledgesandself-loopsareallowed.Itshouldalsobenotedthat, indrawingagraph,it isimmaterialwhetherthe

lines are drawn straight or curved, long or short: what is important is theincidencebetweentheedgesandvertices.Forexample,thetwographsdrawninFigs.1-2(a)and(b)arethesame,becauseincidencebetweenedgesandverticesisthesameinbothcases.

Fig.1-2Samegraphdrawndifferently.

Inadiagramofagraph,sometimestwoedgesmayseemtointersectatapointthat does not represent a vertex, for example, edges e and f in Fig. 1-3. Suchedges should be thought of as being in different planes and thus having nocommonpoint.(Someauthorsbreakoneofthetwoedgesatsuchacrossingtoemphasizethisfact.)

Fig.1-3Edgeseandfhavenocommonpoint.

Agraph is also called a linear complex, a1-complex, or aone-dimensional

www.TechnicalBooksPDF.com

Page 19: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

complex.Avertexisalsoreferredtoasanode,ajunction,apoint,0-cell,oran0-simplex.Othertermsusedforanedgeareabranch,aline,anelement,a1-cell,an arc, and a1-simplex. In this bookwe shall generally use the terms graph,vertex,andedge.

1-2. APPLICATIONSOFGRAPHS

Because of its inherent simplicity, graph theory has a very wide range ofapplications in engineering, in physical, social, and biological sciences, inlinguistics,andinnumerousotherareas.Agraphcanbeusedtorepresentalmostanyphysicalsituationinvolvingdiscreteobjectsandarelationshipamongthem.Thefollowingarefourexamplesfromamonghundredsofsuchapplications.

KönigsbergBridgeProblem:TheKönigsbergbridgeproblem isperhaps thebest-known example in graph theory. It was a long-standing problem untilsolved by Leonhard Euler (1707-1783) in 1736, by means of a graph. Eulerwrotethefirstpapereveringraphtheoryandthusbecametheoriginatorofthetheoryofgraphsaswellasof therestof topology.Theproblemisdepicted inFig.1-4.Two islands,C andD, formedby thePregelRiver inKönigsberg (then the

capitalofEastPrussiabutnowrenamedKaliningradandinWestSovietRussia)wereconnected toeachotherand to thebanksA andBwithsevenbridges,asshowninFig.1-4.Theproblemwastostartatanyofthefourlandareasofthecity,A,B,C,orD,walkovereachofthesevenbridgesexactlyonce,andreturntothestartingpoint(withoutswimmingacrosstheriver,ofcourse).Eulerrepresentedthissituationbymeansofagraph,asshowninFig.1-5.The

verticesrepresentthelandareasandtheedgesrepresentthebridges.Aswe shall see inChapter 2,Euler proved that a solution for this problem

doesnotexist.

www.TechnicalBooksPDF.com

Page 20: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.1-4Königsbergbridgeproblem.

Fig.1-5GraphofKönigsbergbridgeproblem.

TheKönigsbergbridgeproblemisthesameastheproblemofdrawingfigureswithoutliftingthepenfromthepaperandwithoutretracingaline(Problems2-1and 2-2). We all have been confronted with such problems at one time oranother.

UtilitiesProblem:Therearethreehouses(Fig.1-6)H1,H2,andH3,eachtobeconnectedtoeachofthethreeutilities—water(W),gas(G),andelectricity(E)—by means of conduits. Is it possible to make such connections without anycrossoversoftheconduits?

Fig.1-6Three-utilitiesproblem.

Figure 1-7 shows how this problem can be represented by a graph—theconduits are shown as edges while the houses and utility supply centers arevertices.AsweshallseeinChapter5,thegraphinFig.1-7cannotbedrawnintheplanewithoutedgescrossingover.Thustheanswertotheproblemisno.

ElectricalNetworkProblems:Properties(suchas transferfunctionandinputimpedance)ofanelectricalnetworkarefunctionsofonlytwofactors:

1. The nature and value of the elements forming the network, such as

www.TechnicalBooksPDF.com

Page 21: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

resistors,inductors,transistors,andsoforth.

2. Thewaytheseelementsareconnectedtogether,thatis,thetopologyofthenetwork.

Fig.1-7Graphofthree-utilitiesproblem.

Sincethereareonlyafewdifferenttypesofelectricalelements,thevariationsinnetworksarechieflyduetothevariationsintopology.Thuselectricalnetworkanalysis and synthesis are mainly the study of network topology. In thetopological study of electrical networks, factor 2 is separated from 1 and isstudiedindependently.TheadvantageofthisapproachwillbeclearerinChapter13,achapterdevotedsolelytoapplyinggraphtheorytoelectricalnetworks.The topology of a network is studied bymeans of its graph. In drawing a

graph of an electrical network the junctions are represented by vertices, andbranches (which consist of electrical elements) are represented by edges,regardlessofthenatureandsizeoftheelectricalelements.AnelectricalnetworkanditsgraphareshowninFig.1-8.

www.TechnicalBooksPDF.com

Page 22: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.1-8Electricalnetworkanditsgraph.

SeatingProblem:Ninemembersofanewclubmeeteachdayforlunchataroundtable.Theydecidetositsuchthateverymemberhasdifferentneighborsateachlunch.Howmanydayscanthisarrangementlast?Thissituationcanberepresentedbyagraphwithnineverticessuchthateach

vertex represents a member, and an edge joining two vertices represents therelationshipofsittingnexttoeachother.Figure1-9showstwopossibleseatingarrangements—theseare1234567891(solidlines),and1352749681(dashedlines). Itcanbeshownbygraph-theoreticconsiderations that thereareonlytwomorearrangementspossible.Theyare1573928461and1795836241. Ingeneral it canbe shown that forn people thenumberof suchpossiblearrangementsis

Fig.1-9Arrangementsatadinnertable.

www.TechnicalBooksPDF.com

Page 23: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

and

The reader has probably noticed that three of the four examples ofapplicationsabovearepuzzlesandnotengineeringproblems.Thiswasdonetoavoidintroducingatthisstagebackgroundmaterialnotpertinenttographtheory.Moresubstantiveapplicationswillfollow,particularlyinthelastfourchapters.

1-3. FINITEANDINFINITEGRAPHS

AlthoughinourdefinitionofagraphneitherthevertexsetVnortheedgesetEneedbefinite,inmostofthetheoryandalmostallapplicationsthesesetsarefinite.A graphwith a finite number of vertices aswell as a finite number ofedges is called a finite graph; otherwise, it is an infinite graph.The graphs inFigs.1-1,1-2,1-5,1-7,and1-8areallexamplesoffinitegraphs.PortionsoftwoinfinitegraphsareshowninFig.1-10.

Fig.1-10Portionsoftwoinfinitegraphs.

In this book we shall confine ourselves to the study of finite graphs, andunlessotherwisestatedtheterm“graph”willalwaysmeanafinitegraph.

www.TechnicalBooksPDF.com

Page 24: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

1-4. INCIDENCEANDDEGREE

When a vertex vi is an end vertex of some edge ej, vi and ej are said to beincidentwith(onorto)eachother.InFig.1-1,forexample,edgese2,e6,ande7areincidentwithvertexv4.Twononparalleledgesaresaidtobeadjacentiftheyareincidentonacommonvertex.Forexample,e2ande7inFig.1-1areadjacent.Similarly,twoverticesaresaidtobeadjacentiftheyaretheendverticesofthesameedge.InFig.1-1,v4andv5areadjacent,butv1andv4arenot.Thenumberofedgesincidentonavertexvi,withself-loopscountedtwice,is

called thedegree,d(vi) of vertex vi. In Fig. 1-1, for example,d(v1) =d(v3) =d(v4) = 3,d(v2) = 4, andd(v5) = 1. The degree of a vertex is sometimes alsoreferredtoasitsvalency.

Fig.1-11Agraphwithfiveverticesandsevenedges.

Letusnowconsider agraphGwithe edges andn verticesv1,v2, . . . ,vn.Sinceeachedgecontributestwodegrees,thesumofthedegreesofallverticesinGistwicethenumberofedgesinG.Thatis,

TakingFig.1-1asanexample,oncemore,

d(v1)+d(v2)+d(v3)+d(v4)+d(v5)=3+4+3+3+1=14=twicethenumberofedges.

FromEq.(1-1)weshallderivethefollowinginterestingresult.

www.TechnicalBooksPDF.com

Page 25: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

THEOREM1-1

Thenumberofverticesofodddegreeinagraphisalwayseven.

Proof: Ifweconsider theverticeswithoddandevendegreesseparately, thequantity in theleftsideofEq.(1-1)canbeexpressedas thesumof twosums,eachtakenoververticesofevenandodddegrees,respectively,asfollows:

Since the left-hand side inEq. (1-2) is even, and the first expressionon theright-hand side is even (being a sumof evennumbers), the second expressionmust

BecauseinEq.(1-3)eachd(vk) isodd, thetotalnumberoftermsinthesummustbeeventomakethesumanevennumber.Hencethetheorem.?

Agraphinwhichallverticesareofequaldegreeiscalledaregulargraph(orsimplyaregular).ThegraphofthreeutilitiesshowninFig.1-7isaregularofdegreethree.

1-5. ISOLATEDVERTEX,PENDANTVERTEX,ANDNULLGRAPH

Avertexhavingnoincidentedgeiscalledanisolatedvertex.Inotherwords,isolatedverticesareverticeswithzerodegree.Verticesv4andv7inFig.1-11,forexample,areisolatedvertices.Avertexofdegreeoneiscalledapendantvertexoranendvertex.Vertexv3inFig.1-11isapendantvertex.Twoadjacentedgesaresaidtobeinseriesiftheircommonvertexisofdegreetwo.InFig.1-11,thetwoedgesincidentonv1areinseries.

www.TechnicalBooksPDF.com

Page 26: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.1-11Graphcontainingisolatedvertices,seriesedges,andapendantvertex.

InthedefinitionofagraphG=(V,E),itispossiblefortheedgesetEtobeempty.Suchagraph,withoutanyedges,iscalledanullgraph.Inotherwords,everyvertexinanullgraphisanisolatedvertex.AnullgraphofsixverticesisshowninFig.1-12.AlthoughtheedgesetEmaybeempty,thevertexsetVmustnotbeempty;otherwise,thereisnograph.Inotherwords,bydefinition,agraphmusthaveatleastonevertex.†

Fig.1-12Nullgraphofsixvertices.

1-6. ABRIEFHISTORYOFGRAPHTHEORY

Asmentioned before, graph theorywas born in 1736with Euler’s paper inwhichhesolvedtheKönigsbergbridgeproblem[1-4].†Forthenext100yearsnothingmorewasdoneinthefield.In1847,G.R.Kirchhoff(1824-1887)developedthetheoryoftreesfortheir

applicationsinelectricalnetworks[1-6].Tenyearslater,A.Cayley(1821-1895)discovered trees while he was trying to enumerate the isomers of saturated

www.TechnicalBooksPDF.com

Page 27: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

hydrocarbonsCnH2n+2[1-3].AboutthetimeofKirchhoffandCayley,twoothermilestonesingraphtheory

were laid.Onewas the four-colorconjecture,whichstates that fourcolorsaresufficientforcoloringanyatlas(amaponaplane)suchthatthecountrieswithcommonboundarieshavedifferentcolors.It is believed that A. F. Möbius (1790-1868) first presented the four-color

problem in one of his lectures in 1840. About 10 years later, A. DeMorgan(1806-1871)discussedthisproblemwithhisfellowmathematiciansinLondon.DeMorgan’sletteristhefirstauthenticatedreferencetothefour-colorproblem.TheproblembecamewellknownafterCayleypublished it in1879 in the firstvolume of theProceedings of the RoyalGeographic Society. To this day, thefour-color conjecture is by far the most famous unsolved problem in graphtheory;ithasstimulatedanenormousamountofresearchinthefield[1-11].The othermilestone is due to SirW.R.Hamilton (1805-1865). In the year

1859heinventedapuzzleandsolditfor25guineastoagamemanufacturerinDublin.Thepuzzleconsistedofawooden,regulardodecahedron(apolyhedronwith12facesand20corners,eachfacebeingaregularpentagonandthreeedgesmeetingateachcorner;seeFig.2-21).Thecornersweremarkedwiththenamesof20importantcities:London,NewYork,Delhi,Paris,andsoon.Theobjectinthe puzzle was to find. a route along the edges of the dodecahedron, passingthrougheachofthe20citiesexactlyonce[1-12].Although thesolutionof this specificproblem iseasy toobtain (asweshall

seeinChapter2),todatenoonehasfoundanecessaryandsufficientconditionfor the existence of such a route (called Hamiltonian circuit) in an arbitrarygraph.Thisfertileperiodwasfollowedbyhalfacenturyofrelativeinactivity.Thena

resurgenceofinterestingraphsstartedduringthe1920s.OneofthepioneersinthisperiodwasD.König.Heorganized theworkofothermathematiciansandhisownandwrotethefirstbookonthesubject,whichwaspublishedin1936[1-7].Thepast30yearshasbeenaperiodofintenseactivityingraphtheory—both

pureandapplied.Agreatdealof researchhasbeendoneand isbeingdone inthisarea.Thousandsofpapershavebeenpublishedandmorethanadozenbookswrittenduringthepastdecade.AmongthecurrentleadersinthefieldareClaudeBerge,OysteinOre (recently deceased),PaulErdös,WilliamTutte, andFrankHarary.

SUMMARY

www.TechnicalBooksPDF.com

Page 28: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

SUMMARY

Inthischaptersomebasicconceptsofgraphtheoryhavebeenintroduced,andsomeelementaryresultshavebeenobtained.Anattempthasalsobeenmadetoshowthatgraphscanbeusedtorepresentalmostanyprobleminvolvingdiscretearrangements of objects, where concern is not with the internal properties oftheseobjectsbutwiththerelationshipsamongthem.

REFERENCES

Asan elementary text ongraph theory,Ore’s book [1-10] is recommended.BusackerandSaaty[1-2]isagoodintermediate-levelbook.SeshuandReed[1-13] is specially suited for electrical engineers. Berge [1-1] and Ore [1-9] aregoodgeneraltexts,butaresomewhatadvanced.Harary’sbook[1-5]containsanexcellent treatment of the subject. It is compact and clear, but it contains noapplicationsandiswrittenforanadvancedstudentofgraphtheory.Forrelatinggraph theory to the rest of topology one should read [1-8], a well-writtenelementary book on important aspects of topology. The entertaining book ofRouseBall[1-12]containsavarietyofpuzzlesandgamestowhichgraphshavebeenapplied.1-1. BERGE, C.,The Theory ofGraphs and Its Applications, JohnWiley&

Sons, Inc.,NewYork,1962.English translationof theoriginalbook inFrench:Théorie des graphes et ses applications,DunodEditeur, Paris,1958.

1-2. BUSACKER, R. G., and T. L. SAATY,Finite Graphs and Networks: AnIntroduction with Applications, McGraw-Hill Book Company, NewYork,1965.

1-3. CAYLEY, A., “On the Theory ofAnalytical FormsCalled Trees,”Phil.Mag.,Vol.13,1857,172–176.

1-4. EULER, L., “Solutio Problematis ad Geometriam Situs Pertinantis,”Academimae Petropolitanae (St. Petersburg Academy), Vol. 8, 1736,128–140.EnglishtranslationinSci.Am.,July1953,66–70.

1-5. HARARY,F.,GraphTheory,Addison-WesleyPublishingCompany,Inc.,Reading,Mass.,1969.

1-6. KIRCHHOFF,G.,“ÜberdieAuflösungderGleichungen,aufwelchemanbei der Untersuchungen der Linearen Verteilung Galvanisher Strömegeführtwird,”PoggendorfAnn.Physik,Vol.72,1847,497–508.Englishtranslation,IRETrans.CircuitTheory,Vol.CT-5,March1958,4–7.

1-7. KÖNIG, D., Theorie der endlichen und unendlichen Graphen, Leipzig,

www.TechnicalBooksPDF.com

Page 29: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

1936;Chelsea,NewYork,1950.1-8. LIETZMANN, W., Visual Topology, American Elsevier Publishing

Company,Inc.,NewYork,1965.EnglishtranslationoftheGermanbookAnschaulicheTopologie,R.OldenbourgK.G.,Munich,1955.

1-9. ORE, O., Theory of Graphs, American Mathematical Society,Providence,R.I.,1962.

1-10. ORE,O.,GraphsandTheirUses,RandomHouse,Inc.,NewYork,1963.1-11. ORE, O., The Four Color Problem, Academic Press, Inc., New York,

1967.1-12. ROUSE BALL, W.,Mathematical Recreations and Essays, London and

NewYork,1892;andTheMacmillanCompany,NewYork,1962.1-13. SESHU, S., and M. B. REED, Linear Graphs and Electrical Networks,

Addison-WesleyPublishingCompany,Inc.,Reading,Mass.,1961.

PROBLEMS

1-1. Drawallsimplegraphsofone,two,three,andfourvertices.1-2. Drawgraphsrepresentingproblemsof(a)twohousesandthreeutilities;

(b) four houses and four utilities, say, water, gas, electricity, andtelephone.

1-3. Name10 situations (games, activities, real-life problems, etc.) that canbe represented bymeans of graphs. Explain what the vertices and theedgesdenote.

1-4. DrawthegraphoftheWheatstonebridgecircuit.1-5. Drawgraphsof thefollowingchemicalcompounds:(a)CH4, (b)C2H6,

(c) C6H6, (d) N2O3. (Hint: Represent atoms by vertices and chemicalbondsbetweenthembyedges.)

1-6. Drawagraphwith64verticesrepresentingthesquaresofachessboard.Join theseverticesappropriatelybyedges,each representingamoveoftheknight.Youwillseethatinthisgrapheveryvertexisofdegreetwo,three,four,six,oreight.Howmanyverticesareofeachtype?

1-7. GivenamazeasshowninFig.1-13,representthismazebymeansofagraph such that a vertex denotes either a corridor or a dead end (asnumbered). An edge represents a possible path between two vertices.(ThisisoneofnumerousmazesthatweredrawnorbuiltbytheHindus,Greeks,Romans,Vikings,Arabs,etc.)

www.TechnicalBooksPDF.com

Page 30: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.1-13Amaze.

1-8. Decantingproblem.YouaregiventhreevesselsA,B,andCofcapacities8, 5, and3 gallons, respectively.A is filled,whileB andC are empty.DividetheliquidinAintotwoequalquantities.[Hint:Leta,b,andcbetheamountsofliquidinA,B,andC,respectively.Wehavea+b+c=8atall times.Sinceat leastoneof thevessels isalwaysemptyorfull,atleastoneofthefollowingequationsmustalwaysbesatisfied:a=0,a=8;b=0,b=5;c=0,c=3.Youwillfindthatwiththeseconstraintsthereare16possiblestates(situations)inthisprocess.Representthisproblembymeansofa16-vertexgraph.Eachvertexstands forastateandeachedge for a permissible change of states between its two end vertices.Nowwhenyoulookatthisgraphitwillbecleartoyouhowtogofromstate(8,0,0)tostate(4,4,0).]Thisistheclassicaldecantingproblem.

1-9. Convince yourself that an infinite graphwith a finite number of edges(i.e., a graphwith a finite number of edges and an infinite number ofvertices)musthaveaninfinitenumberofisolatedvertices.

1-10. Showthataninfinitegraphwithafinitenumberofvertices(i.e.,agraphwith a finite number of vertices and an infinite number of edges)willhaveat leastonepairofvertices (oronevertex incaseofparallelself-

www.TechnicalBooksPDF.com

Page 31: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

loops)joinedbyaninfinitenumberofparalleledges.1-11. Convince yourself that themaximumdegree of any vertex in a simple

graphwithnverticesisn–1.1-12. Show that the maximum number of edges in a simple graph with n

verticesisn(n–l)/2.

†Theadjective“linear”isdroppedasredundantinourdiscussions,becausebyagraphwealwaysmeanalineargraph.Thereisnosuchthingasanonlineargraph†Someauthors(see,forexample,[2-9],p.1,or[15-58],p.17)doallowthecaseinwhichthevertexsetVisalsoempty.Thistheycallthenullgraph,andtheycallagraphwithE=ØandV≠Øavertexgraph.Forour purposes this distinction is of no consequence. For a lively discussion on paradoxes arising out ofdifferentdefinitionsofthenullgraph,seepp.40-41inTheoryofGraphs:aBasisforNetworkTheory,byL.M.MaxwellandM.B.Reed(PergamonPress,N.Y.1971).†Bracketednumbersrefertoreferencesattheendofchapters.

www.TechnicalBooksPDF.com

Page 32: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

2PATHSANDCIRCUITS

Thischapterservestwopurposes.Thefirstistointroduceadditionalconceptsand terms in graph theory. These concepts, such as paths, circuits, and Eulergraphs, deal mainly with the nature of connectivity in graphs. The degree ofvertices,whichisalocalpropertyofeachvertex,willbeshowntoberelatedtothemoreglobalpropertiesofthegraph.The second purpose is to illustrate with examples how to solve actual

problemsusinggraphtheory.ThecelebratedKönigsbergbridgeproblem,whichwas introduced in Chapter 1, will be solved. The solution of the seatingarrangementproblem,alsointroducedinChapter1,willbeobtainedbymeansofHamiltonian circuits. A third problem, which involves stacking fourmulticolored cubes, will also be solved. These three unrelated problems willdemonstratetheproblem-solvingpowerofgraphtheory.Thereadermayattempttosolvetheseproblemswithoutusinggraphs;thedifficultyofsuchanapproachwillquicklyconvincehimofthevalueofgraphtheory.

2-1. ISOMORPHISM

Ingeometrytwofiguresarethoughtofasequivalent(andcalledcongruent)ifthey have identical behavior in terms of geometric properties. Likewise, twographsarethoughtofasequivalent(andcalledisomorphic)iftheyhaveidenticalbehavior in termsofgraph-theoreticproperties.Moreprecisely:TwographsGand G′ are said to be isomorphic (to each other) if there is a one-to-onecorrespondence between their vertices and between their edges such that theincidence relationship is preserved. In other words, suppose that edge e isincidentonverticesv1andv2inG;thenthecorrespondingedgee′inG′mustbeincidentontheverticesv′1andv′2thatcorrespondtov1andv2,respectively.Forexample, one can verify that the two graphs in Fig. 2-1 are isomorphic. Thecorrespondencebetweenthetwographsisasfollows:Theverticesa,b,c,d,and

www.TechnicalBooksPDF.com

Page 33: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

ecorrespondtov1,v2,v3,v4,andv5,respectively.Theedges1,2,3,4,5,and6correspondtoe1,e2,e3,e4,e5,ande6,respectively.

Fig.2-1Isomorphicgraphs.

Except for the labels (i.e., names) of their vertices and edges, isomorphicgraphsarethesamegraph,perhapsdrawndifferently.AsindicatedinChapter1,agivengraphcanbedrawninmanydifferentways.Forexample,Fig.2-2showstwodifferentwaysofdrawingthesamegraph.

Fig.2-2Isomorphicgraphs.

Itisnotalwaysaneasytasktodeterminewhetherornottwogivengraphsareisomorphic.Forinstance,thethreegraphsshowninFig.2-3areallisomorphic,but justbylookingat themyoucannottell that.It is leftasanexercisefor thereadertoshow,byredrawingandlabelingtheverticesandedges,thatthethreegraphsinFig.2-3areisomorphic(seeProblem2-3).It is immediately apparent by the definition of isomorphism that two

isomorphicgraphsmusthave

1. Thesamenumberofvertices.

2. Thesamenumberofedges.

3. Anequalnumberofverticeswithagivendegree.

www.TechnicalBooksPDF.com

Page 34: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.2-3Isomorphicgraphs.

Fig.2-4Twographsthatarenotisomorphic.

However, these conditions are by no means sufficient. For instance, the twographsshowninFig.2-4satisfyallthreeconditions,yettheyarenotisomorphic.That the graphs in Figs. 2-4(a) and (b) are not isomorphic can be shown asfollows: If the graph in Fig. 2-4(a) were to be isomorphic to the one in (b),vertex x must correspond to y, because there are no other vertices of degreethree.Nowin(b)thereisonlyonependantvertex,w,adjacenttoy,whilein(a)therearetwopendantvertices,uandv,adjacenttox.Findinga simple andefficient criterion fordetectionof isomorphism is still

actively pursued and is an important unsolved problem in graph theory. InChapter11weshalldiscussvariousproposedalgorithmsandtheirprogramsforautomaticdetectionofisomorphismbymeansofacomputer.Fornow,wemovetoadifferenttopic.

2-2. SUBGRAPHS

AgraphgissaidtobeasubgraphofagraphGifalltheverticesandalltheedgesofgareinG,andeachedgeofghasthesameendverticesingasinG.

www.TechnicalBooksPDF.com

Page 35: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

For instance, the graph in Fig. 2-5(b) is a subgraph of the one in Fig. 2-5(a).(Obviously,whenconsideringasubgraph,theoriginalgraphmustnotbealteredby identifying two distinct vertices, or by adding new edges or vertices.) Theconceptof subgraph isakin to theconceptof subset inset theory.Asubgraphcanbethoughtofasbeingcontainedin(orapartof)anothergraph.Thesymbolfromsettheory,g⊂G,isusedinstating“gisasubgraphofG.”

Fig.2-5Graph(a)andoneofitssubgraphs(b).

Thefollowingobservationscanbemadeimmediately:

1. Everygraphisitsownsubgraph.

2. AsubgraphofasubgraphofGisasubgraphofG.

3. AsinglevertexinagraphGisasubgraphofG.

4. AsingleedgeinG,togetherwithitsendvertices,isalsoasubgraphof

Edge-DisjointSubgraphs:Two (ormore) subgraphsg1 andg2 of agraphGaresaidtobeedgedisjointifg1andg2donothaveanyedgesincommon.Forexample, the twographs inFigs.2-7(a)and (b)areedge-disjoint subgraphsofthegraph inFig.2-6.Note thatalthoughedge-disjointgraphsdonothaveanyedge in common, they may have vertices in common. Subgraphs that do notevenhaveverticesincommonaresaidtobevertexdisjoint,(Obviously,graphsthathavenoverticesincommoncannotpossiblyhaveedgesincommon.)

2-3. APUZZLEWITHMULTICOLOREDCUBES

Nowweshalltakeabriefpausetoillustrate,withanexample,howaproblem

www.TechnicalBooksPDF.com

Page 36: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

canbesolvedbyusinggraphs.Twostepsareinvolvedhere:First,thephysicalproblemisconvertedintoaproblemofgraphtheory.Second, thegraph-theoryproblem is then solved. Let us consider the following problem, awell-knownpuzzleavailableintoystores(underthenameInstantInsanity).Problem:Wearegivenfourcubes.Thesixfacesofeverycubearevariously

coloredblue,green,red,orwhite.Isitpossibletostackthecubesoneontopofanother to forma column such that no color appears twiceon anyof the foursides of this column? (Clearly, a trial-and-error method is unsatisfactory,becausewemayhavetotryall41,472(=3×24×24×24)possibilities.)

Solution: Step1:Drawagraphwith fourverticesB,G,R, andW—one foreachcolor(Fig.2-6).Pickacubeandcallitcube1;thenrepresentitsthreepairsof opposite faces by three edges, drawnbetween the verticeswith appropriatecolors. Inotherwords, ifablue face incube1hasawhite faceopposite to it,draw an edge between vertices B andW in the graph. Do the same for theremainingtwopairsoffaces incube1.Put label1onall threeedgesresultingfromcube1.Aself-loopwiththeedgelabeled1atvertexR,forinstance,wouldresult if cube 1 had a pair of opposite faces both colored red. Repeat theprocedurefortheotherthreecubesonebyoneonthesamegraphuntilwehaveagraphwithfourverticesand12edges.AparticularsetoffourcoloredcubesandtheirgraphareshowninFig.2-6.

www.TechnicalBooksPDF.com

Page 37: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.2-6Fourcubesunfoldedand.thegraphrepresentingtheircolors.

Step2:Consider thegraph resulting from this representation.Thedegreeofeach vertex is the total number of faceswith the corresponding color. For thecubesofFig.2-6,wehavefivebluefaces,sixgreen,sevenred,andsixwhite.Considertwooppositeverticalsidesofthedesiredcolumnoffourcubes,say

facingnorthandsouth.Asubgraph(withfouredges)willrepresenttheseeightfaces—fourfacingsouthandfournorth.Eachofthefouredgesinthissubgraphwillhaveadifferent label—1,2,3,and4.Moreover,nocoloroccurs twiceoneither thenorthsideor southsideof thecolumn ifandonly ifeveryvertex inthissubgraphisofdegreetwo.Exactlythesameargumentappliestotheothertwosides,eastandwest,ofthe

column.Thus the four cubes can be arranged (to form a column such that no color

appearsmorethanonceonanyside)ifandonlyifthereexisttwoedge-disjointsubgraphs,eachwithfouredges,eachoftheedgeslabeleddifferently,andsuchthat eachvertex is ofdegree two.For the set of cubes shown inFig. 2-6, thisconditionissatisfied,andthetwosubgraphsareshowninFig.2-7.

www.TechnicalBooksPDF.com

Page 38: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.2-7Twoedge-disjointsubgraphsofthegraphinFig.2-6.

2-4. WALKS,PATHS,ANDCIRCUITS

A walk is defined as a finite alternating sequence of vertices and edges,beginning and ending with vertices, such that each edge is incident with thevertices preceding and following it.No edge appears (is coveredor traversed)more thanonce in awalk.Avertex,however,mayappearmore thanonce. InFig.2-8(a), for instance,v1av2bv3cv3dv4ev2 f v5 is awalk shownwithheavy lines.Awalk is also referred to as anedge train or achain.The setofverticesandedgesconstitutingagivenwalkinagraphGisclearlyasubgraphofG.

Fig.2-8Awalkandapath.

Verticeswithwhichawalkbeginsandendsarecalled its terminal vertices.Verticesv1andv5aretheterminalverticesofthewalkshowninFig.2-8(a).Itispossibleforawalktobeginandendatthesamevertex.Suchawalkiscalleda

www.TechnicalBooksPDF.com

Page 39: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

closedwalk.Awalkthatisnotclosed(i.e.,theterminalverticesaredistinct)iscalledanopenwalk[Fig.2-8(a)].Anopenwalkinwhichnovertexappearsmorethanonceiscalledapath(ora

simple path or an elementary path). In Fig. 2-8, vl a v2 b v3 d v4 is a path,whereasv1av2bv3cv3dv4ev2fv5isnotapath.Inotherwords,apathdoesnotintersectitself.Thenumberofedgesinapathiscalledthelengthofapath.It immediately follows, then, thatanedgewhich isnotaself-loop isapathoflengthone.Itshouldalsobenotedthataself-loopcanbeincludedinawalkbutnotinapath(Fig.2-8).Theterminalverticesofapathareofdegreeone,andtherestofthevertices

(called intermediate vertices) are of degree two. This degree, of course, iscounted onlywith respect to the edges included in the path andnot the entiregraphinwhichthepathmaybecontained.A closed walk in which no vertex (except the initial and the final vertex)

appears more than once is called a circuit. That is, a circuit is a closed,nonintersectingwalk.InFig.2-8(a),v2bv3dv4ev2 is,forexample,acircuit.ThreedifferentcircuitsareshowninFig.2-9.Clearly,everyvertexinacircuitisof degree two; again, if the circuit is a subgraph of another graph, one mustcountdegreescontributedbytheedgesinthecircuitonly.

Fig.2-9Threedifferentcircuits.

Acircuitisalsocalledacycle,elementarycycle,circularpath,andpolygon.Inelectricalengineeringacircuit issometimesreferredtoasa loop—nottobeconfusedwith self-loop. (Every self-loop isacircuit,butnoteverycircuit is aself-loop.)ThedefinitionsinthissectionaresummarizedinFig.2-10.Thearrowsarein

thedirectionofincreasingrestriction.Youmayhaveobservedthatalthoughtheconceptsofapathandacircuitare

verysimple,theformaldefinitionbecomesinvolved.

www.TechnicalBooksPDF.com

Page 40: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.2-10Walks,paths,andcircuitsassubgraphs.

2-5. CONNECTEDGRAPHS,DISCONNECTEDGRAPHS,ANDCOMPONENTS

Intuitively, theconceptofconnectedness isobvious.Agraphisconnectedifwe can reach any vertex from any other vertex by traveling along the edges.Moreformally:AgraphGissaidtobeconnectedifthereisatleastonepathbetweenevery

pair of vertices inG.Otherwise,G isdisconnected. For instance, thegraph inFig.2-8(a)isconnected,buttheoneinFig.2-11isdisconnected.Anullgraphofmorethanonevertexisdisconnected(Fig.1-12).Itiseasytoseethatadisconnectedgraphconsistsoftwoormoreconnected

graphs.Eachoftheseconnectedsubgraphsiscalledacomponent.ThegraphinFig.2-11consistsoftwocomponents.Anotherwayoflookingatacomponentisasfollows:ConsideravertexviinadisconnectedgraphG.Bydefinition,notallverticesofG are joinedbypaths tovi.Vertexvi andall theverticesofG thathavepathstovi,togetherwithalltheedgesincidentonthem,formacomponent.Obviously,acomponentitselfisagraph.

www.TechnicalBooksPDF.com

Page 41: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.2-11Adisconnectedgraphwithtwocomponents.

THEOREM2-1

AgraphGisdisconnectedifandonlyifitsvertexsetVcanbepartitionedintotwo nonempty, disjoint subsetsV1 andV2 such that there exists no edge inGwhoseoneendvertexisinsubsetV1andtheotherinsubsetV2.

Proof:Supposethatsuchapartitioningexists.ConsidertwoarbitraryverticesaandbofG,suchthata∈V1andb∈V2.Nopathcanexistbetweenverticesaandb;otherwise,therewouldbeatleastoneedgewhoseoneendvertexwouldbeinV1andtheotherinV2.Hence,ifapartitionexists,Gisnotconnected.Conversely,letGbeadisconnectedgraph.ConsideravertexainG.LetV1be

thesetofallverticesthatarejoinedbypathstoa.SinceG isdisconnected,V1does not include all vertices of G. The remaining vertices will form a(nonempty)setV2.NovertexinV1isjoinedtoanyinV2byanedge.Hencethepartition.

Twointerestingandusefulresultsinvolvingconnectednessare:

THEOREM2-2

Ifagraph(connectedordisconnected)hasexactlytwoverticesofodddegree,theremustbeapathjoiningthesetwovertices.

Proof: LetG be a graph with all even vertices† except vertices v1 and v2,whichareodd.FromTheorem1-1,whichholds for everygraphand thereforeforeverycomponentofadisconnectedgraph,nographcanhaveanoddnumberof odd vertices. Therefore, in graph G, v1 and v2 must belong to the same

www.TechnicalBooksPDF.com

Page 42: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

component,andhencemusthaveapathbetweenthem.

THEOREM2-3

A simple graph (i.e., a graph without parallel edges or self-loops) with nverticesandkcomponentscanhaveatmost(n−k)(n−k+l)/2edges.

Proof:LetthenumberofverticesineachofthekcomponentsofagraphGben1,n2,...,nk.Thuswehave

n1+n2+...+nk=n,ni≥1.

Theproofofthetheoremdependsonanalgebraicinequality†

Now the maximum number of edges in the ith component ofG (which is asimple connected graph) is . (See Problem 1-12.) Therefore, themaximumnumberofedgesinGis

ItmaybenotedthatTheorem2-3isageneralizationoftheresultinProblem1-12.ThesolutiontoProblem1-12isgivenby(2-3),wherek=1.NowweareequippedtohandletheKönigsbergbridgeproblemintroducedin

Chapter1.

2-6. EULERGRAPHS

As mentioned in Chapter 1, graph theory was born in 1736 with Euler’sfamouspaper inwhichhe solved theKönigsbergbridgeproblem. In the samepaper,Eulerposed (and then solved)amoregeneralproblem: Inwhat typeofgraphG is it possible to find a closedwalk running through every edge ofG

www.TechnicalBooksPDF.com

Page 43: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

exactlyonce?SuchawalkisnowcalledanEulerline,andagraphthatconsistsofanEulerlineiscalledanEulergraph.Moreformally:If someclosedwalk inagraphcontainsall theedgesof thegraph, then the

walkiscalledanEulerlineandthegraphanEulergraph.Byitsverydefinitionawalkisalwaysconnected.SincetheEulerline(which

is a walk) contains all the edges of the graph, an Euler graph is alwaysconnected, except for any isolatedvertices thegraphmayhave.Since isolatedverticesdonotcontributeanythingtotheunderstandingofanEulergraph,itishereafter assumed that Euler graphs do not have any isolated vertices and arethereforeconnected.Nowweshallstateandproveanimportanttheorem,whichwillenableusto

tellimmediatelywhetherornotagivengraphisanEulergraph.

THEOREM2-4

AgivenconnectedgraphG isanEulergraphifandonlyifallverticesofGareofevendegree.

Proof: Suppose thatG is anEulergraph. It therefore contains anEuler line(which is a closedwalk). In tracing thiswalkwe observe that every time thewalkmeetsavertexvitgoesthroughtwo“new”edgesincidentonv—withonewe “entered” v and with the other “exited.” This is true not only of allintermediate vertices of the walk but also of the terminal vertex, because we“exited” and “entered” the same vertex at the beginning and end of thewalk,respectively.ThusifGisanEulergraph,thedegreeofeveryvertexiseven.Toprovethesufficiencyofthecondition,assumethatallverticesofGareof

evendegree.NowweconstructawalkstartingatanarbitraryvertexvandgoingthroughtheedgesofGsuchthatnoedgeistracedmorethanonce.Wecontinuetracingasfaraspossible.Sinceeveryvertexisofevendegree,wecanexitfromeveryvertexweenter;thetracingcannotstopatanyvertexbutv.Andsincevisalsoofevendegree,weshalleventually reachvwhen the tracingcomes toanend.IfthisclosedwalkhwejusttracedincludesalltheedgesofG,GisanEulergraph.Ifnot,weremovefromGalltheedgesinhandobtainasubgraphh′ofGformed by the remaining edges. Since bothG andh have all their vertices ofevendegree, thedegreesof theverticesofh′arealsoeven.Moreover,h′musttouchhatleastatonevertexa,becauseGisconnected.Startingfroma,wecanagainconstructanewwalk ingraphh′.Sinceall theverticesofh′areofevendegree, thiswalk in h′ must terminate at vertex a; but thiswalk in h′ can becombinedwithhtoformanewwalk,whichstartsandendsatvertexvandhas

www.TechnicalBooksPDF.com

Page 44: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

moreedgesthanh.ThisprocesscanberepeateduntilweobtainaclosedwalkthattraversesalltheedgesofG.ThusGisanEulergraph.

Königsberg Bridge Problem: Now looking at the graph of the Königsbergbridges(Fig.1-5),wefindthatnotallitsverticesareofevendegree.Hence,itisnotanEulergraph.Thusitisnotpossibletowalkovereachofthesevenbridgesexactlyonceandreturntothestartingpoint.

OneoftenencountersEulerlinesinvariouspuzzles.Theproblemcommontothesepuzzlesistofindhowagivenpicturecanbedrawninonecontinuouslinewithout retracing and without lifting the pencil from the paper. Two suchpictures are shown in Fig. 2-12. The drawing in Fig. 2-12(a) is calledMohammed’sscimitarsandisbelievedtohavecomefromtheArabs.TheoneinFig.2-12(b)is,ofcourse,thestarofDavid.(Equaltime!)IndefininganEulerlinesomeauthorsdroptherequirementthatthewalkbe

closed.Forexample,thewalka1c2d3a4b5d6e7binFig.2-13,whichincludesalltheedgesofthegraphanddoesnotretraceanyedge,isnotclosed.Theinitialvertexisaandthefinalvertexisb.Weshallcallsuchanopenwalkthatincludes(ortracesorcovers)alledgesofagraphwithoutretracinganyedgeaunicursallineoranopenEulerline.A(connected)graphthathasaunicursallinewillbecalledaunicursalgraph.

Fig.2-12TwoEulergraphs.

www.TechnicalBooksPDF.com

Page 45: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.2-13Unicursalgraph.

It is clear that by adding an edge between the initial and final vertices of aunicursallineweshallgetanEulerline.Thusaconnectedgraphisunicursalifandonly if it has exactly twovertices of odddegree.This observation canbegeneralizedasfollows:

THEOREM2-5

In a connected graph G with exactly 2k odd vertices, there exist k edge-disjointsubgraphssuchthattheytogethercontainalledgesofGandthateachisaunicursalgraph.

Proof:LettheoddverticesofthegivengraphGbenamedv1,v2,...,vk;w1,w2,...,wkinanyarbitraryorder.AddkedgestoGbetweenthevertexpairs(v1,w1),(v2,w2),...,(vk,wk)toformanewgraphG′.SinceeveryvertexofG′isofevendegree,G′consistsofanEulerlinep.Now

if we remove from p the k edges we just added (no two of these edges areincident on the same vertex), p will be split into k walks, each ofwhich is aunicursal line: The first removalwill leave a single unicursal line; the secondremovalwillsplitthatintotwounicursallines;andeachsuccessiveremovalwillsplitaunicursallineintotwounicursallines,untiltherearekofthem.Thusthetheorem.Weshall interruptourstudyofEulergraphs todefinesomecommonlyused

graph-theoretic operations.One of these operations is required immediately inthenextsection;otherswillbeneededlater.

2-7. OPERATIONSONGRAPHS

Asisthecasewithmostmathematicalentities,it isconvenienttoconsidera

www.TechnicalBooksPDF.com

Page 46: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

large graph as a combination of small ones and to derive its properties fromthoseofthesmallones.Sincegraphsaredefinedintermsofthesetsofverticesand edges, it is natural to employ the set-theoretical terminology to defineoperationsbetweengraphs.Inparticular:TheunionoftwographsG1=(V1,E1)andG2=(V2,E2)isanothergraphG3

(writtenasG3=G1⋃G2)whosevertexsetV3=V1⋃V2andtheedgesetE3=E1⋃E2.Likewise,theintersectionG1⋂G2ofgraphsG1andG2isagraphG4consistingonlyofthoseverticesandedgesthatareinbothG1andG2.TheringsumoftwographsG1andG2(writtenasG1⊕G2)isagraphconsistingofthevertexsetV1⋃V2andofedgesthatareeitherinG1orG2,butnotinboth.Twographsandtheirunion,intersection,andringsumareshowninFig.2-14.†Itisobviousfromtheirdefinitionsthatthethreeoperationsjustmentionedare

commutative.Thatis,

G1⋃G2=G2⋃G1, G1⋂G2=G2⋂G1,G1⊕G2=G2⊕G1.

IfG1andG2areedgedisjoint,thenG1⋂G2isanullgraph,andG1⊕G2=G1⋃G2.IfG1andG2arevertexdisjoint,thenG1⋂G2isempty.ForanygraphG,

G⋃G=G⋂G=G,and

G⊕G=anullgraph.

IfgisasubgraphofG,thenG⊕gis,bydefinition,thatsubgraphofGwhichremainsafteralltheedgesinghavebeenremovedfromG.Therefore,G⊕giswrittenasG−g,wheneverg⊆G.Becauseofthiscomplementarynature,G⊕g=G−gisoftencalledthecomplementofginG.Decomposition: A graph G is said to have been decomposed into two

subgraphsg1andg2if

g1⋃g2=G,

andg1⋂g2=anullgraph.

www.TechnicalBooksPDF.com

Page 47: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.2-14Union,intersection,andringsumoftwographs.

Inotherwords,everyedgeofGoccurseitheringloring2,butnotinboth.Someofthevertices,however,mayoccurinbothglandg2.Indecomposition,isolatedvertices are disregarded.A graph containingm edges {el, e2, . . ., em} can bedecomposedin2m-1−1differentwaysintopairsofsubgraphsg1,g2(why?).Although union, intersection, and ring sum have been defined for a pair of

graphs,thesedefinitionscanbeextendedinanobviouswaytoincludeanyfinitenumberofgraphs.Similarly,agraphGcanbedecomposedintomorethantwosubgraphs—subgraphsthatare(pairwise)edgedisjointandcollectivelyincludeeveryedgeinG.

Deletion: Ifvi isavertex ingraphG, thenG—videnotesasubgraphofGobtained by deleting (i.e., removing) vi fromG. Deletion of a vertex alwaysimpliesthedeletionofalledgesincidentonthatvertex.(SeeFig.2-15.)Ifejisanedge inG, thenG—ej isasubgraphofGobtainedbydeletingej fromG.Deletionofanedgedoesnotimplydeletionofitsendvertices.ThereforeG−ej

www.TechnicalBooksPDF.com

Page 48: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

=G⊕ej.

Fig.2-15Vertexdeletionandedgedeletion.

Fusion: A pair of vertices a, b in a graph are said to be fused (merged oridentified)ifthetwoverticesarereplacedbyasinglenewvertexsuchthateveryedgethatwasincidentoneitheraorboronbothisincidentonthenewvertex.Thusfusionoftwoverticesdoesnotalterthenumberofedges,butitreducesthenumberofverticesbyone.SeeFig.2-16foranexample.

Fig.2-16Fusionofverticesaandb.

These are some of the elementary operations on graphs. More complexoperations have been defined and are used in graph-theory literature. For asurveyofsuchoperationsseethepaperbyHararyandWilcox[2-10].

2-8. MOREONEULERGRAPHS

ThefollowingaresomemoreresultsontheimportanttopicofEulergraphs.

THEOREM2-6

AconnectedgraphG isanEulergraph ifandonly if itcanbedecomposedintocircuits.

Proof:SupposegraphGcanbedecomposedintocircuits;thatis,Gisaunion

www.TechnicalBooksPDF.com

Page 49: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

ofedge-disjointcircuits.Sincethedegreeofeveryvertexinacircuitistwo,thedegreeofeveryvertexinGiseven.HenceGisanEulergraph.Conversely,letGbeanEulergraph.Consideravertexv1.Thereareatleast

two edges incident at v1. Let one of these edges be between v1 and v2. Sincevertexv2isalsoofevendegree,itmusthaveatleastanotheredge,saybetweenv2 andv3.Proceeding in this fashion,weeventuallyarriveat avertex thathaspreviouslybeentraversed,thusformingacircuitΓ.LetusremoveΓfromG.Allverticesintheremaininggraph(notnecessarilyconnected)mustalsobeofevendegree. From the remaining graph remove another circuit in exactly the sameway as we removed Γ fromG. Continue this process until no edges are left.Hencethetheorem.ArbitrarilyTraceableGraphs:Consider the graph inFig. 2-17,which is an

Eulergraph.Supposethatwestartfromvertexaandtracethepathabc.

Fig.2-17Arbitrarilytraceablegraphfromc.

Nowatcwehavethechoiceofgoingtoa,d,ore.Ifwetookthefirstchoice,wewouldonly trace thecircuitabca,which isnot anEuler line.Thus, startingfroma,wecannottracetheentireEulerlinesimplybymovingalonganyedgethat has not already been traversed. This raises the following interestingquestion:WhatpropertymustavertexvinanEulergraphhavesuchthatanEulerline

is alwaysobtainedwhenone followsanywalk fromvertexv according to thesinglerulethatwheneveronearrivesatavertexoneshallselectanyedge(whichhasnotbeenpreviouslytraversed)?Such a graph is called an arbitrarily traceable graph from vertex v. For

instance, the Euler graph in Fig. 2-17 is an arbitrarily traceable graph fromvertex c, but not from any other vertex. The Euler graph in Fig. 2-18 is notarbitrarily traceable from any .vertex; the graph in Fig. 2-19 is arbitrarilytraceablefromallitsvertices.Thefollowinginterestingtheorem,duetoOre[2-5],answersthequestionjustraised.

www.TechnicalBooksPDF.com

Page 50: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.2-18Eulergraph;notarbitrarilytraceable.

Fig.2-19Arbitrarilytraceablegraphfromallvertices.

THEOREM2-7

An Euler graphG is arbitrarily traceable from vertex v inG if and only ifeverycircuitinGcontainsv.

Foraproofofthetheoremthereaderisreferredto[2-5].

2-9. HAMILTONIANPATHSANDCIRCUITS

AnEulerlineofaconnectedgraphwascharacterizedbythepropertyofbeinga closed walk that traverses every edge of the graph (exactly once). AHamiltonian circuit in a connected graph is defined as a closed walk thattraverseseveryvertexofGexactlyonce,exceptofcoursethestartingvertex,atwhich the walk also terminates. For example, in the graph of Fig. 2-20(a)starting at vertex v, if one traverses along the edges shown in heavy lines—passing through each vertex exactly once—one gets a Hamiltonian circuit. AHamiltoniancircuit for thegraph inFig.2-20(b) isalsoshownbyheavy lines.Moreformally:

www.TechnicalBooksPDF.com

Page 51: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.2-20Hamiltoniancircuits.

AcircuitinaconnectedgraphGissaidtobeHamiltonianifitincludeseveryvertex ofG. Hence a Hamiltonian circuit in a graph of n vertices consists ofexactlynedges.Obviously,noteveryconnectedgraphhasaHamiltoniancircuit.Forexample,

neither of the graphs shown inFigs. 2-17 and 2-18 has aHamiltonian circuit.This raises the question: What is a necessary and sufficient condition for aconnectedgraphGtohaveaHamiltoniancircuit?

Fig.2-21DodecahedronanditsgraphshownwithaHamiltoniancircuit.

This problem, first posed by the famous Irish mathematician Sir WilliamRowan Hamilton in 1859, is still unsolved. As was mentioned in Chapter 1,Hamilton made a regular dodecahedron of wood [see Fig. 2-21(a)], each ofwhose20cornerswasmarkedwiththenameofacity.Thepuzzlewastostartfromanycityand finda routealong theedgeof thedodecahedron thatpassesthrougheverycityexactlyonceandreturnstothecityoforigin.Thegraphofthedodecahedron is given in Fig. 2-21(b), and one of many such routes (aHamiltoniancircuit)isshownbyheavylines.The resemblance between the problem of an Euler line and that of a

Hamiltoniancircuitisdeceptive.Thelatterisinfinitelymorecomplex.AlthoughonecanfindHamiltoniancircuitsinmanyspecificgraphs,suchasthoseshown

www.TechnicalBooksPDF.com

Page 52: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

inFigs.2-20and2-21,thereisnoknowncriterionwecanapplytodeterminetheexistenceofaHamiltoniancircuitingeneral.Thereare,however,certaintypesofgraphsthatalwayscontainHamiltoniancircuits,aswillbepresentlyshown.

HamiltonianPath:IfweremoveanyoneedgefromaHamiltoniancircuit,weare left with a path. This path is called a Hamiltonian path. Clearly, aHamiltonianpathinagraphGtraverseseveryvertexofG.SinceaHamiltonianpath is a subgraph of a Hamiltonian circuit (which in turn is a subgraph ofanother graph), every graph that has a Hamiltonian circuit also has aHamiltonianpath.Thereare,however,manygraphswithHamiltonianpathsthathavenoHamiltoniancircuits(Problem2-23).ThelengthofaHamiltonianpath(ifitexists)inaconnectedgraphofnverticesisn—1.InconsideringtheexistenceofaHamiltoniancircuit(orpath),weneedonly

considersimplegraphs.ThisisbecauseaHamiltoniancircuit(orpath)traverseseveryvertexexactlyonce.Henceitcannotincludeaself-looporasetofparalleledges.Thusageneralgraphmaybemadesimplebyremovingparalleledgesandself-loopsbeforelookingforaHamiltoniancircuitinit.It is leftasanexercise for thereader toshowthatneitherof the twographs

showninFig.2-22hasaHamiltoniancircuit(orHamiltonianpath).SeeProblem2-24.

Fig.2-22GraphswithoutHamiltoniancircuits.

What general class of graphs is guaranteed to have a Hamiltonian circuit?Completegraphsofthreeormoreverticesconstituteonesuchclass.

CompleteGraph:Asimplegraphinwhichthereexistsanedgebetweeneverypairofverticesiscalledacompletegraph.Completegraphsoftwo,three,four,and five vertices are shown inFig. 2-23.A complete graph is sometimes alsoreferred to as auniversal graph or aclique. Since every vertex is joinedwithevery other vertex through one edge, the degree of every vertex isn − 1 in a

www.TechnicalBooksPDF.com

Page 53: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

completegraphGofnvertices.AlsothetotalnumberofedgesinGisn(n−l)/2.SeeProblem1-12.

Fig.2-23Completegraphsoftwo,three,four,andfivevertices.

ItiseasytoconstructaHamiltoniancircuitinacompletegraphofnvertices.Lettheverticesbenumberedv1,v2 ,. . . ,vn.Sinceanedgeexistsbetweenanytwovertices,wecanstartfromv1andtraversetov2,andv3,andsoontovn,andfinallyfromvntov1.ThisisaHamiltoniancircuit.

NumberofHamiltonianCircuitsinaGraph:Agivengraphmaycontainmorethan oneHamiltonian circuit.Of interest are all the edge-disjointHamiltoniancircuits in a graph. The determination of the exact number of edge-disjointHamiltoniancircuits(orpaths)inagraphingeneralisalsoanunsolvedproblem.However,thenumberofedge-disjointHamiltoniancircuitsinacompletegraphwithoddnumberofverticesisgivenbyTheorem2-8.

THEOREM2-8

In a complete graph with n vertices there are (n − l)/2 edge-disjointHamiltoniancircuits,ifnisanoddnumber≥3.

Proof: A complete graph G of n vertices has n(n − l)/2 edges, and aHamiltonian circuit inG consists of n edges. Therefore, the number of edge-disjointHamiltoniancircuitsinGcannotexceed(n−l)/2.Thatthereare(n−l)/2edge-disjointHamiltoniancircuits,whennisodd,canbeshownasfollows:Thesubgraph(ofacompletegraphofnvertices)inFig.2-24isaHamiltonian

circuit. Keeping the vertices fixed on a circle, rotate the polygonal patternclockwiseby360/(n−1),2·360/(n−1),3·360/(n−1),...,(n−3)/2·360/(n−1)degrees.Observe that each rotationproducesaHamiltoniancircuit thathasnoedge in commonwith any of the previous ones. Thuswe have (n − 3)/2 newHamiltoniancircuits, all edgedisjoint from theone inFig.2-24andalsoedgedisjointamongthemselves.Hencethetheorem.

www.TechnicalBooksPDF.com

Page 54: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.2-24Hamiltoniancircuit;nisodd.

Thistheoremenablesustosolvetheproblemoftheseatingarrangementataroundtable,introducedinChapter1,asfollows:Representingamemberxbyavertexandthepossibilityofhissittingnextto

anothermemberybyanedgebetweenxandy,weconstructagraphG.Sinceeverymemberisallowedtositnexttoanyothermember,Gisacompletegraphofninevertices—ninebeingthenumberofpeopletobeseatedaroundthetable.EverySeatingarrangementaroundthetableisclearlyaHamiltoniancircuit.The first day of their meeting they can sit in any order, and it will be a

Hamiltonian circuit H1. The second day, if they are to sit such that everymember must have different neighbors, we have to find another HamiltoniancircuitH2inG,withanentirelydifferentsetofedgesfromthoseinH1;thatis,H1andH2areedge-disjointHamiltoniancircuits.FromTheorem2-8thenumberof edge-disjoint Hamiltonian circuits in G is four; therefore, only four sucharrangementsexistamongninepeople.AnotherinterestingresultonthequestionofexistenceofHamiltoniancircuits

inagraph,obtainedbyG.A.Dirac,is:

THEOREM2-9

Asufficient (butbynomeansnecessary) condition for a simplegraphG tohaveaHamiltoniancircuitisthatthedegreeofeveryvertexinGbeatleastn/2,wherenisthenumberofverticesinG.

Proof:ForproofthereaderisreferredtotheoriginalpaperbyDirac[2-3].

www.TechnicalBooksPDF.com

Page 55: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

2-10. TRAVELING-SALESMANPROBLEM

A problem closely related to the question of Hamiltonian circuits is thetraveling-salesmanproblem,statedasfollows:Asalesmanisrequiredtovisitanumberof cities during a trip.Given thedistancesbetween the cities, inwhatordershouldhetravelsoas tovisiteverycitypreciselyonceandreturnhome,withtheminimummileagetraveled?Representingthecitiesbyverticesandtheroadsbetweenthembyedges,we

getagraph. In thisgraph,witheveryedgeei there isassociatedarealnumber(thedistanceinmiles,say),w(ei).Suchagraphiscalledaweightedgraph;w(ei)beingtheweightofedgeei..Inourproblem,ifeachofthecitieshasaroadtoeveryothercity,wehavea

completeweightedgraph.ThisgraphhasnumerousHamiltoniancircuits,andwearetopicktheonethathasthesmallestsumofdistances(orweights).The total number of different (not edge disjoint, of course) Hamiltonian

circuits in a complete graph ofn vertices can be shown to be (n − l)!/2. Thisfollowsfromthefactthatstartingfromanyvertexwehaven−1edgestochoosefrom the first vertex,n − 2 from the second,n − 3 from the third, and soon.Thesebeing independent choices,weget (n−1)!possiblenumberof choices.This number is, however, divided by 2, because eachHamiltonian circuit hasbeencountedtwice.Theoretically,theproblemofthetravelingsalesmancanalwaysbesolvedby

enumeratingall(n−l)!/2Hamiltoniancircuits,calculatingthedistancetraveledineach,andthenpickingtheshortestone.However,foralargevalueofn, thelaborinvolvedistoogreatevenforadigitalcomputer(trysolvingitforthe50statecapitalsintheUnitedStates;n=50).Theproblem is toprescribeamanageablealgorithm for finding the shortest

route.Noefficientalgorithmforproblemsofarbitrarysizehasyetbeenfound,althoughmanyattemptshavebeenmade.Sincethisproblemhasapplicationsinoperations research, some specific large-scale examples havebeenworkedout(see [2-1]). There are also available several heuristicmethods of solution thatgivearouteveryclosetotheshortestone,butdonotguaranteetheshortest(see[2-4]forsuchamethod).

SUMMARY

In this chapter we discussed the subgraph—a graph that is part of another

www.TechnicalBooksPDF.com

Page 56: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

graph.Walks, paths, circuits, Euler lines,Hamiltonian paths, andHamiltoniancircuitsinagraphGareitssubgraphswithspecialproperties.AgivengraphGcan be characterized and studied in terms of the presence or absence of thesesubgraphs.Manyphysicalproblemscanberepresentedbygraphsandsolvedbyobservingtherelevantpropertiesofthecorrespondinggraphs.VarioustypesofwalksdiscussedinthischapteraresummarizedinFig.2-25.

Thearrowspointinthedirectionofincreasingrestriction.

Fig.2-25Differenttypesofwalks.

REFERENCES

Textbooks listed inChapter 1 are to be read for this chapter also.Speciallyrecommendedare

1. Berge[1-1],Chapters1,7,11,and17.

2. BusackerandSaaty[1-2],Chapters1,3,and6.

3. Harary[1-5],Chapter7.

4. Ore[1-9],Chapters2and3.

5. Ore[1-10],Chapters1and2.

6. SeshuandReed[1-13],Chapter2.

Forarbitrarilytraceablegraphs,oneshouldreadOre’spaper[2-5].Additional

www.TechnicalBooksPDF.com

Page 57: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

informationonpropertiesofHamiltoniangraphscanbefoundinpapersbyTutte[2-8],Ore [2-6], Smith and Tutte [2-7], andDirac [2-3]. Chapters 4 and 5 ofTutte’sbook[2-9]arealsodevoted topathsandEulerpaths.Onthe traveling-salesmanproblem therearemanypapers. Inanexcellent surveyBellmoreandNemhauser[2-1]summarizeandlistmostofthesepapers.DeoandHakimi[2-2]generalizedtheHamiltonian-pathproblemandappliedittoawiringproblemincomputers.

2-1. BELLMORE, M., and G. L. NEMHAUSER, “The Traveling SalesmanProblem:ASurvey,”OperationsRes.,Vol.16,1968,538–558.

2-2. DEO, N., and S. L. HAKIMI, “The Shortest Generalized HamiltonianTree,”Proc.Third Annual AllertonConf., University of Illinois, 1965,879-888.

2-3. DIRAC, G. A., “Connectivity Theorems for Graphs,” Quart J. Math.Oxford,Ser.(2),Vol.3,1952,171–174.

2-4. LIN,S.,“ComputerSolutionoftheTravelingSalesmanProblem,”BSTJ,Vol.44,965,2245–2269.

2-5. ORE, O., “A Problem Regarding the Tracing of Graphs,” Rev.ElementaryMath.,.6,1961,49–53.

2-6. ORE, O., “Note on Hamilton Circuits,” Am. Math. Monthly, Vol. 67,1960,55.

2-7. SMITH,C.A.B.,andW.T.TUTTE,“OnUnicursalPathsinaNetworkofDegreeFour,”Am.Math.Monthly,Vol.48,1941,233–237.

2-8. TUTTE,W.T.,“OnHamiltonianCircuits,”J.LondonMath.Soc.,Vol.21,1946,98–101.

2-9. TUTTE, W. T., Connectivity in Graphs, University of Toronto Press,Toronto,1966.

2-10. HARARY,F.,andG.W.WILCOX,“BooleanOperationsonGraphs,”Math.Scand.,Vol.20,1967,41–51.

PROBLEMS2-1. Verify that the two graphs in Fig. 2-2 are isomorphic. Label the

correspondingverticesandedges.2-2. Showbyredrawing,stepbystep,thatgraphs(b)and(c)inFig.2-3.are

isomorphicto(a).2-3. ShowthatthetwographsinFigs.2-26(a)and(b)areisomorphic.

www.TechnicalBooksPDF.com

Page 58: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.2-26

2-4. Construct threemore examples to show that conditions 1, 2, and 3 inSection2-1arenotsufficientforisomorphismbetweengraphs.

2-5. Provethatanytwosimpleconnectedgraphswithnvertices,allofdegreetwo,areisomorphic.

2-6. ArethetwographsinFig.2-27isomorphic?Why?

Fig.2-272-7. GiventhesetofcubesrepresentedbythegraphinFig.2-6,isitpossible

tostackallfourcubesintoacolumnsuchthateachsideshowsonlyonecolor?Explain.

2-8. Prove that a simple graph with n verticesmust be connected if it hasmorethan[(n−1)(n−2)]/2edges.(Hint:UseTheorem2-3.)

2-9. ProvethatifaconnectedgraphGisdecomposedintotwosubgraphsg1andg2,theremustbeatleastonevertexcommonbetweeng1andg2.

2-10. Prove that a connected graphG remains connected after removing anedgeeifromG,ifandonlyifeiisinsomecircuitinG.

2-11. Draw a connected graph that becomes disconnectedwhen any edge isremovedfromit.

2-12. ProvethatagraphwithnverticessatisfyingtheconditionofProblem2-11is(a)simple,and(b)hasexactlyn−1edges.

2-13. WhatisthelengthofthepathfromtheentrancetothecenterofthemazeinProblem1-7?

www.TechnicalBooksPDF.com

Page 59: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

2-14. Listallthedifferentpathsbetweenvertices5and6inFig.2-5(a).Givethelengthofeachofthesepaths.

2-15. Group thepaths listed inProblem2-14 intosetsofedge-disjointpaths.Demonstratethattheunionoftwoedge-disjointpathsbetweenapairofverticesformsacircuit.

2-16. In a graphG let p1 and p2 be two different paths between two givenvertices.Provethatp1⊕p2isacircuitorasetofcircuitsinG.

2-17. Let a, b, and c be three distinct vertices in a graph. There is a pathbetweenaandbandalsothereisapathbetweenbandc.Provethatthereisapathbetweenaandc.

2-18. If the intersection of two paths is a disconnected graph, show that theunionofthetwopathshasatleastonecircuit.

2-19. Youaregivena10-piecedominosetwhosetitleshavethefollowingsetofdots:(1,2);(1,3);(1,4);(1,5);(2,3);(2,4);(2,5);(3,4);(3,5);(4,5). Discuss the possibility of arranging the tiles in a connected seriessuch thatonenumberona titlealways touches thesamenumberon itsneighbor.(Hint:Useafive-vertexcompletegraphandseeifitisanEulergraph.)

2-20. Is it possible tomove a knight on a chessboard such that it completesevery permissiblemove exactly once?Amovebetween two squares iscountedasoneregardlessofthedirectioninwhichit ismade.(Hint:IsthegraphofProblem1-6unicursal?)

2-21. Around-robintournament(wheneveryplayerplaysagainsteveryother)among n players (n being an even number) can be represented by acomplete graph of n vertices. Discuss how you would schedule thetournamentstofinishintheshortestpossibletime.

2-22. Observe that therecanbenopath longer thanaHamiltonianpath (if itexists)inagraph.

2-23. Draw a graph that has a Hamiltonian path but does not have aHamiltoniancircuit.

2-24. ShowthatneitherofthegraphsinFig.2-22hasaHamiltonianpath(andthereforenoHamiltoniancircuit).[Hint:ForFig.2-22(a),ofalltheedgesincident at a vertex only two can be included in aHamiltonian circuit.Countthenumberofedgesthathavetobeexcluded.Youwillfindthat13edgesmustbeexcludedfromFig.2-22(a).ThenumberofremainingedgesisinsufficienttoformaHamiltoniancircuit.ForFig.2-22(b),firstconsiderallverticesofdegreetwo.]

2-25. Showthat thegraphofa rhombicdodecahedron(witheightverticesof

www.TechnicalBooksPDF.com

Page 60: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

degree three and six vertices of degree four) has no Hamiltonian path(andthereforenoHamiltoniancircuit).

2-26. DrawagraphinwhichanEulerlineisalsoaHamiltoniancircuit.Whatcanyousayaboutsuchgraphsingeneral?

2-27. Is itpossible, starting fromanyof the64squaresof thechessboard, tomoveaknightsuchthatitoccupieseverysquareexactlyonceandreturnsto the initial position? If so, give one such tour. (Hint: Look for aHamiltoniancircuitinthegraphofProblem1-6.)

2-28. ProvethatagraphGwithnverticesalwayshasaHamiltonianpathifthesum of the degrees of every pair of vertices vi, vj in G satisfies thecondition

d(vi)+d(vj)≥n−1.

(Hint:FirstshowthatGisconnected.ThenuseinductiononpathlengthinG.)2-29. Using the result of Problem 2-28, show that in a dancing ring of n

childrenitisalwayspossibletoarrangethechildrensothateveryonehasafriendateachsideifeverychildenjoysfriendshipwithatleasthalfthechildren.

†Forbrevity,avertexwithodddegreeiscalledanoddvertex,andavertexwithevendegreeanevenvertex.†Proof: .Squaringbothsides,

or nonnegativecrossterms=n2+k2−2nkbecause(ni−1)≥0,foralli.Therefore,.

†lfanedgeeiisintwographsG1andG2,itsendverticesinG1musthavethesamelabelsasinG2.

www.TechnicalBooksPDF.com

Page 61: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

3TREESANDFUNDAMENTALCIRCUITS

The concept of a tree is probably the most important in graph theory,especiallyfor those interested inapplicationsofgraphs. In thefirsthalfof thischapterweshalldefineatreeandstudyitsproperties.Asusual,weshallpointout some of its applications to simple situations and puzzles and games,deferring theapplications tomorecomplexscientificproblems tillChapter12.Other graph-theoretic terms related to trees will also be introduced anddiscussed.The second part of the chapter introduces the spanning tree—another

importantnotioninthetheoryofgraphs.Therelationshipsamongcircuits,trees,andsoon,inagraphareexplored.Unavoidably,aswithChapters1and2,thischapter alsohas a largenumberofdefinitions. In studying anynewbranchofmathematics,thereisnowaytoavoidnewtermsanddefinitions.

3-1. TREES

A tree is a connectedgraphwithout anycircuits.Thegraph inFig.3-1, forinstance,isatree.Treeswithone,two,three,andfourverticesareshowninFig.3-2. As pointed out in Chapter 1, a graphmust have at least one vertex, andtherefore somust a tree. Some authors allow thenull tree, a treewithout anyvertices.Wehaveexcludedsuchanentityfrombeingatree.Similarly,asweareconsideringonlyfinitegraphs,ourtreesarealsofinite.Itfollowsimmediatelyfromthedefinitionthatatreehastobeasimplegraph,

that is, having neither a self-loop nor parallel edges (because they both formcircuits).Trees appear in numerous instances. The genealogy of a family is often

representedbymeansofatree(infactthetermtreecomesfromfamilytree).Ariver with its tributaries and subtributaries can be represented by a tree. Thesortingofmailaccordingtozipcodeandthesortingofpunchedcardsaredone

www.TechnicalBooksPDF.com

Page 62: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

accordingtoatree(calleddecisiontreeorsortingtree).

Fig.3-1Tree.

Fig.3-2Treeswithone,two,three,andfourvertices.

Fig.3-3Decisiontree.

Figure3-3mightrepresenttheflowofmail.Allthemailarrivesatsomelocaloffice,vertexN.ThemostsignificantdigitinthezipcodeisreadatN,andthe

www.TechnicalBooksPDF.com

Page 63: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

mail is divided into10pilesN1,N2, . . . ,N9, andN0, dependingon themostsignificant digit. Each pile is further divided into 10 piles according to thesecond most significant digit, and so on, till the mail is subdivided into 105possiblepiles,eachrepresentingauniquefive-digitzipcode.Inmanysortingproblemswehaveonlytwoalternatives(insteadof10asin

the preceding example) at each intermediate vertex, representing a dichotomy,suchaslargeorsmall,goodorbad,0or1.Suchadecisiontreewithtwochoicesateachvertexoccursfrequentlyincomputerprogrammingandswitchingtheory.WeshalldealwithsuchtreesandtheirapplicationsinSection3-5.Letusfirstobtainafewsimplebutimportanttheoremsonthegeneralpropertiesoftrees.

3-2. SOMEPROPERTIESOFTREES

THEOREM3-1

Thereisoneandonlyonepathbetweeneverypairofverticesinatree,T.

Proof: Since T is a connected graph, there must exist at least one pathbetweeneverypairofvertices inT.Nowsuppose thatbetween twoverticesaandbofTtherearetwodistinctpaths.TheunionofthesetwopathswillcontainacircuitandTcannotbeatree.

Conversely:

THEOREM3-2

IfinagraphGthereisoneandonlyonepathbetweeneverypairofvertices,Gisatree.

Proof: Existence of a path between every pair of vertices assures thatG isconnected.Acircuitinagraph(withtwoormorevertices)impliesthatthereisatleastonepairofverticesa,bsuchthattherearetwodistinctpathsbetweenaandb.SinceGhasoneandonlyonepathbetweeneverypairofvertices,Gcanhavenocircuit.Therefore,Gisatree.

THEOREM3-3

Atreewithnverticeshasn−1edges.

Proof:Thetheoremwillbeprovedbyinductiononthenumberofvertices.

www.TechnicalBooksPDF.com

Page 64: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.3-4TreeTwithnvertices.

It is easy to see that the theorem is true forn= 1, 2, and 3 (seeFig. 3-2).Assumethatthetheoremholdsforalltreeswithfewerthannvertices.LetusnowconsideratreeTwithnvertices.InTletekbeanedgewithend

verticesviandvj.AccordingtoTheorem3-1, there isnootherpathbetweenviandvjexceptek.Therefore,deletionofek fromTwilldisconnect thegraph,asshowninFig.3-4.Furthermore,T−ekconsistsofexactlytwocomponents,andsince therewerenocircuits inT tobeginwith, eachof these components is atree.Boththesetrees, t1and t2,havefewerthannverticeseach,andtherefore,by the induction hypothesis, each contains one less edge than the number ofverticesinit.ThusT−ekconsistsofn−2edges(andnvertices).HenceThasexactlyn−1edges.

THEOREM3-4

Anyconnectedgraphwithnverticesandn−1edgesisatree.

Proof:Theproofofthetheoremislefttothereaderasanexercise(Problem3-5).

You may have noticed another important feature of a tree: its vertices areconnected togetherwith theminimumnumber of edges.A connected graph issaid tobeminimallyconnected if removalofanyoneedgefromitdisconnectsthe graph. Aminimally connected graph cannot have a circuit; otherwise, wecouldremoveoneoftheedgesinthecircuitandstillleavethegraphconnected.Thusaminimallyconnectedgraphisatree.Conversely,ifaconnectedgraphGisnotminimallyconnected,theremustexistanedgeeiinGsuchthatG−eiisconnected.Therefore,ei is in some circuit,which implies thatG is not a tree.Hencethefollowingtheorem:

www.TechnicalBooksPDF.com

Page 65: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

THEOREM3-5

Agraphisatreeifandonlyifitisminimallyconnected.

The significanceofTheorem3-5 is obvious. Intuitively, one can see that tointerconnectndistinctpoints,theminimumnumberoflinesegmentsneededisn−1. It requiresnobackground in electrical engineering to realize that to short(electrically) n pins together, one needs at least n − 1 pieces of wire. Theresultingstructure,accordingtoTheorem3-5,isatree.

Fig.3-5EdgeeaddedtoG=g1⋃g2.

Weshowed that a connectedgraphwithn vertices andwithout any circuitshasn−1edges.Wecanalso show that agraphwithn verticeswhichhasnocircuitandhasn−1edgesisalwaysconnected(i.e.,itisatree),inthefollowingtheorem.

THEOREM3-6

AgraphGwithnvertices,n−1edges,andnocircuitsisconnected.

Proof: Suppose there exists a circuitless graphGwithn vertices andn − 1edges which is disconnected. In that case G will consist of two or morecircuitless components. Without loss of generality, let G consist of twocomponents,g1 andg2.Addan edgee betweenavertexv1 ing1 andv2 ing2(Fig. 3-5). Since therewas no path between v1 and v2 inG, adding e did notcreateacircuit.ThusG⋃e isacircuitless,connectedgraph (i.e., a tree)ofnverticesandnedges,whichisnotpossible,becauseofTheorem3-3.

Theresultsof theprecedingsix theoremscanbesummarizedbysaying thatthe following are five different but equivalent definitions of a tree. That is, agraphGwithnverticesiscalledatreeif

www.TechnicalBooksPDF.com

Page 66: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

1. Gisconnectedandiscircuitless,or

2. Gisconnectedandhasn−1edges,or

3. Giscircuitlessandhasn−1edges,or

4. ThereisexactlyonepathbetweeneverypairofverticesinG,or

5. Gisaminimallyconnectedgraph.

3-3. PENDANTVERTICESINATREE

Youmusthaveobservedthateachofthetreesshowninthefigureshasseveralpendantvertices(apendantvertexwasdefinedasavertexofdegreeone).Thereason is that ina treeofn verticeswehaven−1edges, andhence2(n−1)degreestobedividedamongnvertices.Sincenovertexcanbeofzerodegree,wemusthaveatleasttwoverticesofdegreeoneinatree.Thisofcoursemakessenseonlyifn≥2.Moreformally:

Fig.3-6Treeofthemonotonicallyincreasingsequencesin4,1,13,7,0,2,8,11,3.

THEOREM3-7

www.TechnicalBooksPDF.com

Page 67: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Inanytree(withtwoormorevertices),thereareatleasttwopendantvertices.

An Application: The following problem is used in teaching computerprogramming.Givenasequenceofintegers,notwoofwhicharethesame,findthe largest monotonically increasing subsequence in it. Suppose that thesequencegiventousis4,1,13,7,0,2,8,11,3;itcanberepresentedbyatreeinwhich thevertices (except thestartvertex) represent individualnumbers in thesequence,andthepathfromthestartvertextoaparticularvertexvdescribesthemonotonically increasing subsequence terminating inv.As shown inFig. 3-6,thissequencecontainsfourlongestmonotonicallyincreasingsubsequences,thatis,(4,7,8,11),(1,7,8,11),(1,2,8,11),and(0,2,8,11).Eachisoflengthfour.Sucha treeused in representingdata is referred to as adata treebycomputerprogrammers.

3-4.DISTANCEANDCENTERSINATREE

The tree in Fig. 3-7 has four vertices. Intuitively, it seems that vertex b islocatedmore“centrally” thananyof theother threevertices.Weshallexplorethisideafurtherandseeifinatreethereexistsa“center”(orcenters).Inherentintheconceptofacenter is theideaof“distance,”sowemustdefinedistancebeforewecantalkofacenter.

Fig.3-7Tree.

InaconnectedgraphG,thedistanced(vi,vj)betweentwoofitsverticesviandvjisthelengthoftheshortestpath(i.e.,thenumberofedgesintheshortestpath)betweenthem.Thedefinitionofdistancebetweenanytwoverticesisvalidforanyconnected

graph (notnecessarily a tree). In agraph that isnot a tree, there aregenerallyseveralpathsbetweenapairofvertices.Wehave toenumerateall thesepathsandfindthelengthoftheshortestone.(Theremaybeseveralshortestpaths.)

www.TechnicalBooksPDF.com

Page 68: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Forinstance,someofthepathsbetweenverticesv1andv2inFig.3-8are(a,e),(a,c,f),(b,c,e),(b,f),(b,g,h),and(b,g,i,k).Therearetwoshortestpaths,(a,e)and(b,f),eachoflengthtwo.Henced(v1,v2)=2.Inatree,sincethereisexactlyonepathbetweenanytwovertices(Theorem3-

1),thedeterminationofdistanceismucheasier.Forinstance,inthetreeofFig.3-7,d(a,b)=1,d(a,c)=2,d(c,b)=1,andsoon.

AMetric:Beforewecanlegitimatelycallafunctionf(x,y)oftwovariablesa“distance”betweenthem,thisfunctionmustsatisfycertainrequirements.Theseare

Fig.3-8Distancebetweenv1andv2istwo.

1. Nonnegativity:f(x,y)≥0,andf(x,y)=0ifandonlyifx=y.

2. Symmetry:f(x,y)=f(x,y).

3. Triangleinequality:f(x,y)≤f(x,z)+f(z,y)foranyz.

A function that satisfies these three conditions is called a metric. That thedistanced(vi,vj)betweentwoverticesofaconnectedgraphsatisfiesconditions1and 2 is immediately evident. Sinced(vi, vj) is the length of the shortest pathbetweenverticesviandvj,thispathcannotbelongerthananotherpathbetweenviandvj,whichgoesthroughaspecifiedvertexvk.Henced(vi,vj)≤d(vi,vk)+d(vk,vj).Therefore,

THEOREM3-8

Thedistancebetweenverticesofaconnectedgraphisametric.

Comingbacktoouroriginaltopicofrelativelocationofdifferentverticesina

www.TechnicalBooksPDF.com

Page 69: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

tree,letusdefineanothertermcalledeccentricity(alsoreferredtoasassociatednumberorseparation)ofavertexinagraph.TheeccentricityE(v)ofavertexvinagraphGisthedistancefromvtothe

vertexfarthestfromvinG;thatis,

A vertex withminimum eccentricity in graphG is called a center ofG. TheeccentricitiesofthefourverticesinFig.3-7areE(a)=2,E(b)=1,E(c)=2,andE(d)=2.Hencevertexb is thecenterofthattree.Ontheotherhand,considerthetreeinFig.3-9.Theeccentricityofeachofitssixverticesisshownnexttothe vertex. This tree has two vertices having the sameminimum eccentricity.Hencethistreehastwocenters.Someauthorsrefertosuchcentersasbicenters;weshallcallthemjustcenters,becausetherewillbenooccasionforconfusion.The reader can easily verify that a graph, in general, hasmany centers.For

example,inagraphthatconsistsofjustacircuit(apolygon),everyvertexisacenter.Inthecaseofatree,however,König[1-7]provedthefollowingtheorem:

THEOREM3-9

Everytreehaseitheroneortwocenters.

Fig.3-9Eccentricitiesoftheverticesofatree.

www.TechnicalBooksPDF.com

Page 70: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.3-10Findingacenterofatree.

Proof: The maximum distance, max d(v, vi), from a given vertex v to anyothervertexvioccursonlywhenviisapendantvertex.Withthisobservation,letusstartwitha treeThavingmore than twovertices.TreeTmusthave twoormore pendant vertices (Theorem 3-7). Delete all the pendant vertices fromT.TheresultinggraphT′isstillatree.WhatabouttheeccentricitiesoftheverticesinT′?AlittledeliberationwillrevealthatremovalofallpendantverticesfromT

www.TechnicalBooksPDF.com

Page 71: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

uniformlyreducedtheeccentricitiesoftheremainingvertices(i.e.,verticesinT′)byone.Therefore,allverticesthatThadascenterswillstillremaincentersinT′.FromT′wecanagainremoveallpendantverticesandgetanother treeT″.Wecontinuethisprocess(whichisillustratedinFig.3-10)untilthereislefteitheravertex (which is the center ofT) or an edge (whose end vertices are the twocentersofT).Thusthetheorem.

COROLLARY

FromtheargumentusedinprovingTheorem3-9,weseethatifatreeThastwocenters,thetwocentersmustbeadjacent.

ASociologicalApplication:Supposethat thecommunicationamongagroupof14personsinasocietyisrepresentedbythegraphinFig.3-10(a),wherethevertices represent the persons and an edge represents the communication linkbetweenitstwoendvertices.Sincethegraphisconnected,weknowthatallthememberscanbereachedbyanymember,eitherdirectlyorthroughsomeothermembers. But it is also important to note that the graph is a tree—minimallyconnected.Thegroupcannotaffordtoloseanyofthecommunicationlinks.Theeccentricityofeachvertex,E(v),representshowclosevistothefarthest

memberofthegroup.InFig.3-10(a),vertexcshouldbetheleaderofthegroup,ifclosenessofcommunicationwerethecriterionforleadership.

RadiusandDiameter: If a treehas a center (or twocenters),does it havearadius also?Yes. The eccentricity of a center (which is the distance from thecenterofthetreetothefarthestvertex)inatreeisdefinedastheradiusofthetree.Forinstance,theradiusofthetreeinFig.3-10(a)isthree.ThediameterofatreeT,ontheotherhand,isdefinedasthelengthofthelongestpathinT.It isleftasanexerciseforthereader(Problem3-6)toshowthataradiusinatreeisnotnecessarilyhalfitsdiameter.

3-5. ROOTEDANDBINARYTREES

Atreeinwhichonevertex(calledtheroot)isdistinguishedfromalltheothersiscalledarootedtree.Forinstance,inFig.3-3vertexN,fromwhereallthemailgoes out, is distinguished from the rest of the vertices. Hence N can beconsideredtherootofthetree,andsothetreeisrooted.Similarly,inFig.3-6thestartvertexmaybeconsideredastherootofthetreeshown.Inadiagramofarooted tree, the root is generally marked distinctly. We will show the root

www.TechnicalBooksPDF.com

Page 72: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

enclosedinasmalltriangle.AllrootedtreeswithfourverticesareshowninFig.3-11. Generally, the term tree means trees without any root. However, foremphasis they are sometimes called free trees (or nonrooted trees) todifferentiatethemfromtherootedkind.

Fig.3-11Rootedtreeswithfourvertices.

BinaryTrees:Aspecialclassofrootedtrees,calledbinaryrootedtrees,isofparticular interest, since they are extensively used in the study of computersearch methods, binary identification problems, and variable-length binarycodes.Abinarytreeisdefinedasatreeinwhichthereisexactlyonevertexofdegreetwo,andeachoftheremainingverticesisofdegreeoneorthree(Fig.3-12). (Obviously,weare talkingabout treeswith threeormorevertices.)Sincethevertexofdegreetwoisdistinctfromallothervertices,thisvertexservesasaroot. Thus every binary tree is a rooted tree. Two properties of binary treesfollowdirectlyfromthedefinition:

1. Thenumberofverticesn in abinary tree is alwaysodd.This isbecausethereisexactlyonevertexofevendegree,andtheremainingn−1verticesareofodddegrees.SincefromTheorem1-1thenumberofverticesofodddegreesiseven,n−1iseven.Hencenisodd.

2. LetpbethenumberofpendantverticesinabinarytreeT.Thenn−p−1isthenumberofverticesofdegreethree.Therefore,thenumberofedgesinTequals

hence

www.TechnicalBooksPDF.com

Page 73: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Anonpendantvertexinatreeiscalledaninternalvertex.ItfollowsfromEq.(3-1) that the number of internal vertices in a binary tree is one less than thenumberofpendantvertices.Inabinarytreeavertexviissaidtobeatlevelliifviisatadistanceoflifromtheroot.Thustherootisatlevel0.A13-vertex,four-levelbinarytreeisshowninFig.3-12.Thenumberofverticesatlevels1,2,3,and4are2,2,4,and4,respectively.One of the most straightforward applications of binary trees is in search

procedures. Each vertex of a binary tree represents a test with two possibleoutcomes.Westartattheroot,andtheoutcomeofthetestattherootsendsustooneofthetwoverticesatthenextlevel,wherefurthertestsaremade,andsoon.Reaching a specified pendant vertex (the goal of the search) terminates thesearch.For such a searchprocedure it is often important to construct a binarytreeinwhich,foragivennumberofverticesn,thevertexfarthestfromtherootisasclosetotherootaspossible.Clearly,therecanbeonlyonevertex(theroot)atlevel0,atmosttwoverticesatlevel1,atmostfourverticesatlevel2,andsoon.Therefore,themaximumnumberofverticespossibleinak-levelbinarytreeis

20+21+22+...+2k≥n.

Fig.3-12A13-vertex,4-levelbinarytree.

Themaximumlevel,lmax,ofanyvertexinabinarytreeiscalledtheheightofthetree.Itiseasytoseethattheminimumpossibleheightofann-vertexbinarytreeis

where[n]denotesthesmallestintegergreaterthanorequalton.

www.TechnicalBooksPDF.com

Page 74: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

On the other hand, to construct a binary tree for a given n such that thefarthest vertex is as far as possible from the root, wemust have exactly twoverticesateachlevel,exceptatthe0level.Therefore,

Forn=11,binarytreesrealizingboththeseextremesareshowninFig.3-13.

Fig.3-13Two11-vertexbinarytrees.

Inanalysisofalgorithmswearegenerallyinterestedincomputingthesumofthe levels of all pendant vertices. This quantity, known as the path length (orexternal path length)of a tree, can be defined as the sum of the path lengthsfromtheroottoallpendantvertices.ThepathlengthofthebinarytreeinFig.3-12,forexample,is

1+3+3+4+4+4+4=23.

ThepathlengthsoftreesinFigs.3-13(a)and(b)are16and20,respectively.Theimportanceofthepathlengthofatreeliesinthefactthatthisquantityisoftendirectlyrelatedtotheexecutiontimeofanalgorithm.It canbe shown that the typeofbinary tree inFig.3-13(a) (i.e., a treewith

2lmax-1verticesatlevellmax−1)yieldstheminimumpathlengthforagivenn.

Weighted Path Length: In some applications, every pendant vertex vj of abinarytreehasassociatedwithitapositiverealnumberwj.Givenw1,w2,...,

www.TechnicalBooksPDF.com

Page 75: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

wm the problem is to construct a binary tree (with m pendant vertices) thatminimizes

whereljisthelevelofpendantvertexvj,andthesumistakenoverallpendantvertices.Letusillustratethesignificanceofthisproblemwithasimpleexample.

ACokemachineistoidentify,byasequenceoftests,thecointhatisputintothemachine.Onlypennies,nickels,dimes,andquarterscangothroughtheslot.Letusassume that theprobabilitiesofacoinbeingapenny,anickel, adime,andaquarter are .05, .15, .5, and .30, respectively.Each testhas theeffectofpartitioning the four types of coins into two complementary sets and assertingtheunknowncointobeinoneofthetwosets.Thusforfourcoinswehave23−1suchtests. If the timetakenforeach test is thesame,whatsequenceof testswillminimizetheexpectedtimetakenbytheCokemachinetoidentifythecoin?The solution requires the construction of a binary tree with four pendant

vertices (and therefore three internal vertices) v1, v2, v3, and v4 andcorrespondingweightsw1= .05,w2= .15,w3= .5, andw4= .3, such that thequantity∑liwiisminimized.ThesolutionisgiveninFig.3-14(a),forwhichtheexpectedtimeis1.7t,wheretisthetimetakenforeachtest.ContrastthiswithFig.3-14(b);forwhichtheexpectedtimeis2t.Analgorithmforconstructingabinarytreewithminimumweightedpathlengthcanbefoundin[3-6].InthisproblemofaCokemachine,manyinterestingvariationsarepossible.

Forexample,notallpossibletestsmaybeavailable,ortheymaynotallconsumethesametime.Binary trees with minimum weighted path length have also been used in

constructingvariable-lengthbinarycodes,where the lettersof thealphabet (A,B, C, . . . , Z) are represented by binary digits. Since different letters havedifferent frequencies of occurrence (frequencies are interpreted asweightsw1,w2,...,w26),abinarytreewithminimumweightedpathlengthcorrespondstoabinarycodeofminimumcost;see[3-6].Formoreonminimumpathbinarytreesandtheirapplicationsthereaderisreferredto[3-5]and[3-7].

www.TechnicalBooksPDF.com

Page 76: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.3-14Twobinarytreeswithweightedpendantvertices.

3-6. ONCOUNTINGTREES

In 1857, Arthur Cayley discovered trees while he was trying to count thenumberof structural isomersof the saturatedhydrocarbons (orparaffin series)CkH2k+2 .He used a connected graph to represent the CkH2k+2 molecule.Correspondingtotheirchemicalvalencies,acarbonatomwasrepresentedbyavertexofdegreefourandahydrogenatombyavertexofdegreeone(pendantvertices).Thetotalnumberofverticesinsuchagraphis

n=3k+2,

andthetotalnumberofedgesis

Since the graph is connected and the number of edges is one less than thenumberofvertices,itisatree.Thustheproblemofcountingstructuralisomersof a given hydrocarbon becomes the problem of counting trees (with certainqualifyingproperties,tobesure).ThefirstquestionCayleyaskedwas:whatisthenumberofdifferenttreesthat

onecanconstructwithndistinct(orlabeled)vertices?Ifn=4,forinstance,wehave16trees,asshowninFig.3-15.Thereadercansatisfyhimselfthatthereare

www.TechnicalBooksPDF.com

Page 77: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

nomoretreesoffourvertices.(Ofcourse,someofthesetreesareisomorphic—tobediscussedlater.)Agraphinwhicheachvertexisassignedauniquenameorlabel(i.e.,notwo

vertices have the same label), as in Fig. 3-15, is called a labeled graph. Thedistinctionbetweenalabeledandanunlabeledgraphisveryimportantwhenwearecountingthenumberofdifferentgraphs.Forinstance,thefourgraphsinthefirst row inFig.3-15arecountedas fourdifferent trees (even though theyareisomorphic) only because the vertices are labeled. If therewere no distinctionmadebetweenA,B,C,orD,thesefourtreeswouldbecountedasone.Acarefulinspection of the graphs in Fig. 3-15will reveal that the number of unlabeledtreeswith four vertices (no distinctionmade betweenA,B,C, andD) is onlytwo.Butfirstweshallcontinuewithcountinglabeledtrees.

Fig.3-15All16treesoffourlabeledvertices.

The following well-known theorem for counting trees was first stated andprovedbyCayley,andisthereforecalledCayley′stheorem.

THEOREM3-10

www.TechnicalBooksPDF.com

Page 78: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Thenumberoflabeledtreeswithnvertices(n≥2)isnn-2.

Proof: The result was first stated and proved by Cayley. Many differentproofs with various approaches (all somewhat involved) have been publishedsince.Anexcellentsummaryof10suchproofsisgivenbyMoon[3-9].WewillgiveoneproofinChapter10.

UnlabeledTrees:IntheactualcountingofisomersofCkH2k+2,Theorem3-10isnot enough. In addition to theconstraintson thedegreeof thevertices, twoobservationsshouldbemade:

1. Sincetheverticesrepresentinghydrogenarependant,theygowithcarbonatoms only one way, and hence make no contribution to isomerism.Therefore,weneednotshowanyhydrogenvertices.

2. Thus the tree representing CkH2k+2 reduces to one with k vertices, eachrepresentingacarbonatom.Inthistreenodistinctioncanbemadebetweenvertices,andthereforeitisunlabeled.

Thusforbutane,C4H10,thereareonlytwodistincttrees(Fig.3-16).Aseveryorganicchemistknows,thereareindeedexactlytwodifferenttypesofbutanes:n-butaneandisobutane.ItmaybenotedinpassingthatthefourtreesinthefirstrowofFig.3-15areisomorphictotheoneinFig.3-16(a);andtheother12areisomorphictoFig.3-16(b).

Fig.3-16Alltreesoffourunlabeledvertices.

Theproblemofcounting treesofdifferent typeswillbe takenupagainanddiscussedmorethoroughlyinChapter10.

www.TechnicalBooksPDF.com

Page 79: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

3-7. SPANNINGTREES

Sofarwehavediscussedthetreeanditspropertieswhenitoccursasagraphbyitself.Nowweshallstudythetreeasasubgraphofanothergraph.Agivengraph has numerous subgraphs—from e edges, 2e distinct combinations arepossible.Obviously,someofthesesubgraphswillbetrees.Outofthesetreesweare particularly interested in certain types of trees, called spanning trees—asdefinednext.AtreeTissaidtobeaspanningtreeofaconnectedgraphGifTisasubgraph

ofGandTcontainsallverticesofG.Forinstance,thesubgraphinheavylinesinFig.3-17isaspanningtreeofthegraphshown.SincetheverticesofGarebarelyhangingtogetherinaspanningtree,itisa

sortofskeletonoftheoriginalgraphG.ThisiswhyaspanningtreeissometimesreferredtoasaskeletonorscaffoldingofG.Sincespanningtreesarethelargest(withmaximum number of edges) trees among all trees inG, it is also quiteappropriatetocallaspanningtreeamaximaltreesubgraphormaximaltreeofG.It is to benoted that a spanning tree is definedonly for a connectedgraph,

becauseatreeisalwaysconnected,andinadisconnectedgraphofnverticeswecannot find a connected subgraphwithn vertices.Each component (which bydefinitionisconnected)ofadisconnectedgraph,however,doeshaveaspanningtree. Thus a disconnected graph with k components has a spanning forestconsistingofkspanningtrees.(Acollectionoftreesiscalledaforest.)FindingaspanningtreeofaconnectedgraphGissimple.IfGhasnocircuit,

itisitsownspanningtree.IfGhasacircuit,deleteanedgefromthecircuit.Thiswill still leave the graph connected (Problem2-10). If there aremore circuits,repeat the operation till an edge from the last circuit is deleted—leaving aconnected,circuit-freegraphthatcontainsalltheverticesofG.Thuswehave

Fig.3-17Spanningtree.

www.TechnicalBooksPDF.com

Page 80: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

THEOREM3-11

Everyconnectedgraphhasatleastonespanningtree.

AnedgeinaspanningtreeTiscalledabranchofT.AnedgeofGthatisnotinagivenspanningtreeTiscalledachord.Inelectricalengineeringachordissometimesreferredtoasatieoralink.Forinstance,edgesb1,b2,b3,b4,b5,andb6arebranchesofthespanningtreeshowninFig.3-17,whileedgesc1,c2,c3,c4,c5,c6,c7,andc8arechords.Itmustbekeptinmindthatbranchesandchordsaredefinedonlywithrespecttoagivenspanningtree.AnedgethatisabranchofonespanningtreeT1 (inagraphG)maybeachordwithrespect toanotherspanningtreeT2.ItissometimesconvenienttoconsideraconnectedgraphGasaunionoftwo

subgraphs,Tand ;thatis,

where T is a spanning tree, and is the complement of TinG. Since thesubgraph isthecollectionofchords,itisquiteappropriatelyreferredtoasthechordset(ortiesetorcotree)ofT.Fromthedefinition,andfromTheorem3-3,thefollowingtheoremisevident.

THEOREM3-12

Withrespecttoanyofitsspanningtrees,aconnectedgraphofnverticesandeedgeshasn−1treebranchesande−n+1chords.

Forexample,thegraphinFig.3-17(withn=7,e=14),hassixtreebranchesandeightchordswithrespecttothespanningtree{b1,b2,b3,b4,b5,b6}.Anyotherspanningtreewillyieldthesamenumbers.Ifwehaveanelectricnetworkwitheelements(edges)andnnodes(vertices),

what is the minimum number of elements we must remove to eliminate allcircuits in thenetwork?Theanswer ise−n+1.Similarly, ifwehavea farmconsistingofsixwalledplotsofland,asshowninFig.3-18,andtheseplotsarefullofwater,howmanywallswillhavetobebrokensothatallthewatercanbedrainedout?Heren=10ande=15.Weshallhavetoselectasetofsix(15−10+1=6)wallssuchthattheremainingnineconstituteaspanningtree.Breakingthesesixwallswilldrainthewaterout.

www.TechnicalBooksPDF.com

Page 81: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.3-18Farmwithwalledplotsofland.

Rank and Nullity:When someone specifies a graphG, the first thing he ismostlikelytomentionisn,thenumberofverticesinG.Immediatelyfollowingcomese,thenumberofedgesinG.Thenk,thenumberofcomponentsGhas.Ifk=1,G is connected.Howare these threenumbersofagraph related?Sinceeverycomponentofagraphmusthaveatleastonevertex,n≥k.Moreoever,thenumberofedges inacomponentcanbenoless thanthenumberofvertices inthatcomponentminusone.Therefore,e≥n−k.Apartfromtheconstraintsn−k≥0ande−n+k≥0,thesethreenumbersn,e,andkareindependent,andtheyarefundamentalnumbersingraphs.(Needlesstomention,thesenumbersalonearenotenoughtospecifyagraph,exceptfortrivialcases.)From these three numbers are derived two other important numbers called

rankandnullity,definedas

rankr=n−k,

nullityµ=e−n+k.

Therankofaconnectedgraphisn−1,andthenullity,e−n+1.AlthoughtherealsignificanceofthesenumberswillbeclearinChapter7,itmaybeobservedherethat

rankofG= numberofbranchesinanyspanningtree(orforest)ofG,nullityofG= numberofchordsinG,

rank+nullity= numberofedgesinG.

Thenullityofagraphisalsoreferredtoasitscyclomaticnumber,orfirstBettinumber.

www.TechnicalBooksPDF.com

Page 82: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

3-8. FUNDAMENTALCIRCUITS

Youmayhavenoticedthatifweaddanedgebetweenanytwoverticesofatree(say,inFig.3-1)acircuitiscreated.Thisisbecausetherealreadyexistsonepathbetweenanytwoverticesofatree;addinganedgebetweenthemcreatesanadditional path, and hence a circuit. Along this line of reasoning, it is notdifficulttoprove

THEOREM3-13

AconnectedgraphGisatreeifandonlyifaddinganedgebetweenanytwoverticesinGcreatesexactlyonecircuit.

Letusnowconsidera spanning treeT in a connectedgraphG.AddinganyonechordtoTwillcreateexactlyonecircuit.Suchacircuit,formedbyaddingachordtoaspanningtree,iscalledafundamentalcircuit.Howmany fundamental circuitsdoesagraphhave?Exactlyasmanyas the

numberofchords,µ(=e−n+k).Howmanycircuitsdoesagraphhaveinall?Weknowthatonecircuitiscreatedbyaddinganyonechordtoatree.Supposethat we add one more chord. Will it create exactly one more circuit? Whathappensifweaddallthechordssimultaneouslytothetree?Letuslookatthetree{b1,b2,b3,b4,b5,b6}inFig.3-17.Addingc1toit,we

get a subgraph {b1,b2,b3,b4,b5,b6, c1},whichhas one circuit (fundamentalcircuit),{b1,b2,b3,b4,b5,c1}.Hadweaddedthechordc2(insteadofc1)tothetree,wewould have obtained a different fundamental circuit, {b2,b3,b5, c2}.Nowsupposethatweaddbothchordsc1andc2tothetree.Thesubgraph{b1,b2,b3,b4,b5,b6c1,c2},hasnotonly the fundamentalcircuitswe justmentioned,but it has also a third circuit, {b1,c1,c2},which is not a fundamental circuit.Althoughthereare75circuitsinFig.3-17(enumeratedbycomputer),onlyeightare fundamental circuits, each formed by one chord (together with the treebranches).Two comments may be appropriate here. First, a circuit is a fundamental

circuit only with respect to a given spanning tree. A given circuit may befundamentalwithrespecttoonespanningtree,butnotwithrespecttoadifferentspanning treeof thesamegraph.Although thenumberof fundamentalcircuits(as well as the total number of circuits) in a graph is fixed, the circuits thatbecomefundamentalchangewiththespanningtrees.Second, in most applications we are not interested in all the circuits of a

www.TechnicalBooksPDF.com

Page 83: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

graph, but only in a set of fundamental circuits, which fortuitously are a loteasiertotrack.Theconceptofafundamentalcircuit,introducedbyKirchhoff,isofenormoussignificanceinelectricalnetworkanalysis.WhatKirchhoffshowed,whichnoweverysophomore inelectricalengineeringknows, is thatnomatterhow many circuits a network contains we need consider only fundamentalcircuitswith respect to any spanning tree.The restof the circuits (aswe shallproverigorouslyinChapter7)arecombinationsofsomefundamentalcircuits.

3-9. FINDINGALLSPANNINGTREESOFAGRAPH

Usually, in a given connected graph there are a large number of spanningtrees.Inmanyapplicationswerequireallspanningtrees.Onereasonablewaytogeneratespanningtreesofagraphistostartwithagivenspanningtree,saytreeT1 (a b c d in Fig. 3-19). Add a chord, say h, to the tree T1. This forms afundamentalcircuit(bchdinFig.3-19).Removalofanybranch,sayc, fromthefundamentalcircuitbchd justformedwillcreateanewspanningtreeT2.Thisgenerationofonespanningtreefromanother,throughadditionofachordand deletion of an appropriate branch, is called a cyclic interchange orelementarytreetransformation.(Suchatransformationisastandardoperationintheiterationsequenceforsolvingcertaintransportationproblems.)

Fig.3-19Graphandthreeofitsspanningtree

Intheaboveprocedure,insteadofdeletingbranchc,wecouldhavedeleteddorbandthuswouldhaveobtainedtwoadditionalspanningtreesabchandachd.Moreover,aftergeneratingthesethreetrees,eachwithchordhinit,wecanrestartwithT1 and add a different chord (e, f, org) and repeat the process ofobtaining a different spanning tree each time a branch is deleted from thefundamentalcircuitformed.Thuswehaveaprocedureforgeneratingspanningtreesforanygivengraph.

www.TechnicalBooksPDF.com

Page 84: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Asweshall see inChapter13, the topological analysisof a linearelectricalnetworkessentiallyreducestothegenerationoftreesinthecorrespondinggraph.Therefore,findinganefficientprocedureforgeneratingalltreesofagraphisaveryimportantpracticalproblem.Theprocedureoutlinedaboveraisesmanyquestions.Canwestart fromany

spanningtreeandgetadesiredspanningtreebyanumberofcyclicexchanges?Canwegetallspanningtreesofagivengraphinthisfashion?Howlongwillwehave tocontinueexchangingedges?Outofallpossible spanning trees thatwecanstartwith,isthereapreferredoneforstarting?Letustrytoanswersomeofthesequestions;otherswillhavetowaituntilChapters7,10,and11.ThedistancebetweentwospanningtreesTiandTjofagraphGisdefinedas

thenumberofedgesofGpresentinonetreebutnotintheother.Thisdistancemaybewrittenasd(Ti,Tj).Forinstance,inFig.3-19d(Ti,Tj)=3.LetTi⊕TjbetheringsumoftwospanningtreesTiandTjofG(asdefinedin

Chapter2,Ti⊕TjisthesubgraphofGcontainingalledgesofGthatareeitherinTiorinTjbutnotinboth).LetN(g)denotethenumberofedgesinagraphg.Then,fromdefinition,

It is not difficult to see that the number d(Ti, Tj) is the minimum number ofcyclicinterchangesinvolvedingoingfromTitoTj.Thereaderisencouragedtoprovethefollowingtwotheorems.

THEOREM3-14

The distance between the spanning trees of a graph is ametric. That is, itsatisfies

d(Ti,Tj)≥0andd(Ti,Tj)=0ifandonlyifTi=Tj,d(Ti,Tj)=d(Tj,Ti),d(Ti,Tj)≤d(Ti,Tk)+d(Tk,Tj).

THEOREM3-15

StartingfromanyspanningtreeofagraphG,wecanobtaineveryspanningtreeofGbysuccessivecyclicexchanges.

SinceinaconnectedgraphGofrankr(i.e.,ofr+1vertices)aspanningtree

www.TechnicalBooksPDF.com

Page 85: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

hasredges,wehavethefollowingresults:ThemaximumdistancebetweenanytwospanningtreesinGis

Also, if µ is the nullity of G, we know that no more than µ edges of aspanningtreeTicanbereplacedtogetanothertreeTj.

Hence maxd(Ti,Tj)≤µ

combiningthetwo,

maxd(Ti,Tj)≤min(µ,r),

wheremin(µ,r)isthesmallerofthetwonumbersµandrofthegraphG.

CentralTree:ForaspanningtreeT0ofagraphG, letmaxd(T0 ,Ti)denotethemaximaldistancebetweenT0andanyotherspanningtreeofG.ThenT0 iscalledacentraltreeofGif

Theconceptofacentraltreeisusefulinenumeratingalltreesofagivengraph.Acentraltreeinagraphis,ingeneral,notunique.Formoreoncentraltreesthereadershouldsee[3-1]and[3-4].

TreeGraph:ThetreegraphofagivengraphGisdefinedasagraphinwhicheachvertexcorrespondstoaspanningtreeofG,andeachedgecorrespondstoacyclicinterchangebetweenthespanningtreesofGrepresentedbythetwoendvertices of the edge. From Theorem 3-15 we know that starting from anyspanningtreewecanobtainallotherspanningtreesthroughcyclicinterchanges(or elementary tree transformations). Therefore, the tree graph of any given(finite,connected)graph isconnected.Foradditionalpropertiesof treegraphs,thereadershouldsee[3-3].

www.TechnicalBooksPDF.com

Page 86: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

3-10. SPANNINGTREESINAWEIGHTEDGRAPH

Asdiscussedearlierinthischapter,aspanningtreeinagraphGisaminimalsubgraphconnectingalltheverticesofG.IfgraphGisaweightedgraph(i.e.,ifthere is a real number associated with each edge ofG), then theweight of aspanningtreeTofGisdefinedasthesumoftheweightsofallthebranchesinT.Ingeneral,differentspanningtreesofGwillhavedifferentweights.Amongall the spanning trees of G, one with the smallest weight is of practicalsignificance.(Theremaybeseveralspanningtreeswiththesmallestweight;forinstance, in a graph of n vertices in which every edge has unit weight, allspanningtreeshaveaweightofn−1units.)Aspanningtreewiththesmallestweightinaweightedgraphiscalledashortestspanningtreeorshortest-distancespanningtreeorminimalspanningtree.Onepossibleapplicationoftheshortestspanningtreeisasfollows:Suppose

thatwearetoconnectncitiesv1,v2, . . . ,vn throughanetworkofroads.Thecostcijofbuildingadirectroadbetweenviandvjisgivenforallpairsofcitieswhereroadscanbebuilt.(Theremaybepairsofcitiesbetweenwhichnodirectroadcanbebuilt.)Theproblemisthentofindtheleastexpensivenetworkthatconnects all n cities together. It is immediately evident that this connectednetworkmustbeatree:otherwise,wecanalwaysremovesomeedgesandgetaconnectedgraphwith smallerweight.Thus theproblemof connectingn citieswithaleastexpensivenetworkistheproblemoffindingashortestspanningtreein a connected weighted graph of n vertices. A necessary and sufficientconditionforaspanningtreetobeshortestisgivenby

THEOREM3-16

A spanning tree T (of a given weighted connected graphG) is a shortestspanningtree(ofG)ifandonlyifthereexistsnootherspanningtree(ofG)atadistanceofonefromTwhoseweightissmallerthanthatofT.

Proof:Thenecessaryorthe“onlyif”conditionisobvious;otherwise,weshallget another tree shorter than T by a cyclic interchange. The fact that thisconditionisalsosufficientisremarkableandisnotobvious.Itcanbeprovedasfollows:LetT1beaspanningtreeinGsatisfyingthehypothesisofthetheorem(i.e.,

thereisnospanningtreeatadistanceofonefromT1whichisshorterthanT1).The proofwill be completed by showing that ifT2 is a shortest spanning tree

www.TechnicalBooksPDF.com

Page 87: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

(differentfromT1)inG,theweightofT1willalsobeequaltothatofT2.LetT2beashortestspanningtreeinG.Clearly,T2mustalsosatisfythehypothesisofthetheorem(otherwisetherewillbeaspanningtreeshorterthanT2atadistanceofonefromT2,violatingtheassumptionthatT2isshortest).Consider an edge e in T2 which is not in T1. Adding e to T1 forms a

fundamentalcircuitwithbranchesinT1.Some,butnotall,ofthebranchesinT1that form the fundamental circuit with e may also be in T2; each of thesebranches inT1 has aweight smaller than or equal to that ofe, because of theassumptiononT1.AmongstallthoseedgesinthiscircuitwhicharenotinT2atleast one, say bj, must form some fundamental circuit (with respect to T2)containinge.BecauseoftheminimalityassumptiononT2weightofbjcannotbeless than that of e. Therefore bj must have the same weight as e. Hence thespanning tree = (T1⋃e−bj),obtained fromT1 throughonecycleexchange,hasthesameweightasT1.ButT1hasoneedgemoreincommonwithT2,anditsatisfies the condition of Theorem 3-16. This argument can be repeated,producingaseriesoftreesofequalweight,T1,T1,T1,...,eachaunitdistanceclosertoT2,untilwegetT2itself.This proves that if none of the spanning trees at a unit distance from T is

shorterthanT,nospanningtreeshorterthanTexistsinthegraph.

AlgorithmforShortestSpanningTree:Thereareseveralmethodsavailableforactuallyfindingashortestspanningtreeinagivengraph,bothbyhandandbycomputer.OnealgorithmduetoKruskal[3-8]isasfollows:ListalledgesofthegraphG in order of nondecreasingweight.Next, select a smallest edge ofG.Then for each successive step select (from all remaining edges ofG) anothersmallestedgethatmakesnocircuitwiththepreviouslyselectededges.Continueuntiln−1edgeshavebeenselected,andtheseedgeswillconstitutethedesiredshortestspanningtree.ThevalidityofthemethodfollowsfromTheorem3-16.Another algorithm, which does not require listing all edges in order of

nondecreasingweightorcheckingateachstepifanewlyselectededgeformsacircuit,isduetoPrim[3-10].ForPrim′salgorithm,drawnisolatedverticesandlabelthemv1,v2,...,vn.TabulatethegivenweightsoftheedgesofGinannbyn table. (Note that theentries in the tablearesymmetricwithrespect to thediagonal, and the diagonal is empty.) Set the weights of nonexistent edges(correspondingtothosepairsofcitiesbetweenwhichnodirectroadcanbebuilt)asverylarge.

www.TechnicalBooksPDF.com

Page 88: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Start fromvertexv1andconnect it to itsnearestneighbor(i.e., to thevertexwhichhasthesmallestentryinrow1ofthetable),sayvk.Nowconsiderv1andvkasonesubgraph,andconnect thissubgraphto itsclosestneighbor(i.e., toavertexotherthanv1andvkthathasthesmallestentryamongallentriesinrows1andk).Letthisnewvertexbevi.Nextregardthetreewithverticesv1,vk,andvias one subgraph, and continue the process until all n vertices have beenconnectedbyn−1edges.Letusnowillustratethismethodoffindingashortestspanningtree.

Fig.3-20Shortestspanningtreeinaweightedgraph.

Aconnectedweightedgraphwith6verticesand12edgesisshowninFig.3-20(a).TheweightofitsedgesistabulatedinFig.3-20(b).Westartwithv1andpickthesmallestentryinrow1,whichiseither(v1,v2)or(v1,v5).Letuspick(v1,v5).[Hadwepicked(v1,v2)wewouldhaveobtainedadifferentshortesttreewiththesameweight.]Theclosestneighborofsubgraph(v1,v5)isv4,ascanbeseen by examining all the entries in rows 1 and 5.The three remaining edgesselectedfollowingtheaboveprocedureturnouttobe(v4,v6),(v4,v3),and(v3,v2) in that sequence.The resulting tree—ashortest spanning tree—isshown inFig.3-20(a)inheavylines.Theweightofthistreeis41.5units.

Degree-Constrained Shortest Spanning Tree: In a shortest spanning treeresulting from the preceding construction, a vertex vi can end up with anydegree; that is,1≤d(vi)≤n−1.Insomepracticalcasesanupperlimitonthedegreeof everyvertex (of the resulting spanning tree) has to be imposed.Forinstance,inanelectricalwiringproblem,onemayberequiredtowiretogethern

www.TechnicalBooksPDF.com

Page 89: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

pins (using as little wire as possible) with nomore than threewires wrappedaroundanyindividualpin.Thus,inthisparticularcase,

d(vi)≤ 3foreveryvi.

Suchaspanningtreeiscalledadegree-constrainedshortestspanningtree.Ingeneral,theproblemmaybestatedasfollows:Givenaweightedconnected

graphG,findashortestspanningtreeTinGsuchthat

d(vi)≤k foreveryvertexviinT.

If k = 2, this problem, in fact, reduces to the problem of finding the shortestHamiltonian path, as well as the traveling-salesman problem (without thesalesmanreturningtohishomebase),discussedattheendofChapter2.Sofar,no efficient method of finding an arbitrarily degree-constrained shortestspanningtreehasbeenfound.

SUMMARY

This chapter dealt with a particular type of connected graph called a tree.Becauseoftheirwideapplications,treesformthemostimportanttopicingraphtheory. Different types of trees, such as labeled and unlabeled, rooted andunrooted,werediscussed,togetherwiththeirpropertiesandapplications.Of special interest are those trees that are subgraphs of a given connected

graphGcontainingallverticesofG.SuchtreesarecalledspanningtreesofG.Findingallspanningtreesofagivengraphisofgreatpracticalimportance,andsoistheproblemoffindingashortestspanningtreeinagivenweightedgraph.Other related concepts, such as centers, radius, and diameter of a tree, rank

and nullity of a graph, fundamental circuits, branches and chords, cyclicinterchange, distance between spanning trees, and tree graphs, were alsointroduced and studied. Trees, spanning trees, and fundamental circuits willcontinuetoappearfromtimetotimeinmostofthesucceedingchapters.

REFERENCESEvery textbook on graph theory has a chapter or two on trees. Especiallyrecommendedare

www.TechnicalBooksPDF.com

Page 90: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

1. Berge[1-1],Chapters12,13,and16.

2. BusackerandSaaty[1-2],Sections1-8,2-6,3-6,3-7,6-19,6-22,and6-31.

3. Harary[1-5],Chapters4,15,andAppendix3.

4. Ore[1-9],Chapter4,Sections2.4and6.5.

5. Ore[1-10],Chapter3.

TheimportanceoftreesininformationstorageandprocessingcanbeseeninKnuth′sbook [3-7],pages305-422,and in [3-2].Forcounting treesofvarioustypes,seeChapter6ofRiordan′sbook[3-11],andalsoseereferencesgiveninChapter 10 of this book. An elegant algorithm for finding a binary tree withminimum weighted path length has been given by Huffman in [3-6]. Onalgorithms for generating spanning trees, seeChapter 11 in this book and thereferencescitedthere.Moon[3-9]gives10differentproofsofCayley′sformulaforcountingtrees.Appendix3inHarary′sbook[1-5]hasdiagramsofall treeswithn≤10.Fortreatmentofdistancebetweentreesandcentraltreesoneshouldrefer to Deo [3-4] and Amoia and Cottafava [3-1]. Tree graphs were firstintroduced and studied by Cummins [3-3]. Kruskal′s [3-8] and Prim′s [3-10]papersaresourcesforthestudyofshortestspanningtrees.

3-1. AMOIA,V.,andG.COTTAFAVA,“InvariancePropertiesofCentralTrees,”IEEETrans.CircuitTheory,Vol.CT-18,No.4,July1971,465–467.

3-2. COLLINS, N. L., and D. MICHIE (eds.) Machine Intelligence, Vol. 1,AmericanElsevierPublishingCompany,Inc.,NewYork,1967.

3-3. CUMMINS, R. L., “Hamiltonian Circuits in Tree Graphs,” IEEE Trans.CircuitTheory,Vol.CT-13,No.1,March1966,82–90.

3-4. DEO,N.,“ACentralTree,”IEEETrans.CircuitTheory,Vol.CT-13,No.4,Dec.1966,439–440.

3-5. HU, T. C., and A. C. TUCKER, “Optimal Binary Search Tree,” MRCReportNo.1049,UniversityofWisconsin,Madison,March1970;alsoinSIAMJ.Appl.Math.,Vol.21,No.4,Dec.1971,514–532.

3-6. HUFFMAN, D. A., “A Method for the Construction of Minimum-RedundancyCodes,”Proc.I.R.E.,Vol.40,Sept.1952,1098–1101.

3-7. KNUTH, D. E., The Art of Computer Programming, Vol. 1, Addison-WesleyPublishingCompany,Inc.,Reading,Mass.,1968.

3-8. KRUSKAL,J.B.,Jr.,“OntheShortestSpanningSubtreeofGraphandtheTravelingSalesmanProblem,”Proc.Am.Math.Soc.,Vol.7,1956,48–50.

www.TechnicalBooksPDF.com

Page 91: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

3-9. MOON,J.W.,“VariousProofsofCayley′sFormulaforCountingTrees,”Chapter II in A Seminar on Graph Theory, (F. Harary, ed.), Holt,RinehartandWinston,Inc.,NewYork,1967,70–78.

3-10. PRIM,R.C.,“ShortestConnectionNetworksandSomeGeneralizations,”BellSystemTech.J.,Vol.36,Nov.1957,1389–1401.

3-11. RIORDAN, J.,AnIntroduction toCombinatorialAnalysis, JohnWiley&Sons,Inc.,NewYork,1958.

PROBLEMS

3-1. Drawalltreesofnlabeledverticesforn=1,2,3,4,and5.3-2. Drawalltreesofnunlabeledverticesforn=1,2,3,4,and5.3-3. Drawallunlabeledrootedtreesofnverticesforn=1,2,3,4,and5.3-4. Itcanbeshownthatthereareonlysixdifferent(nonisomorphic)treesof

sixvertices.TwosuchtreesaregiveninFig.2-4.Drawtheotherfour.3-5. ProveTheorem3-4.3-6. Showatreeinwhichitsdiameterisnotequaltotwicetheradius.Under

whatconditiondoesthisinequalityhold?Elaborate.3-7. Citethreedifferentsituations(games,activities,orproblems)thatcanbe

representedbytrees.Explain.3-8. HowmanyisomersdoespentaneC5H12have?Hexane,C6H14?3-9. Supposeyouaregiveneightcoinsandaretoldthatsevenofthemareof

equalweight,andonecoiniseitherheavierorlighterthantherest.Youareprovidedwithanequal-armbalance,whichyoumayuseonly threetimes, for comparingcoins.Sketcha strategy in the formof adecisiontree for identifying the nonconforming coin, aswell as for finding outwhetheritisheavierorlighterthantherest.

3-10. Sketch all (unlabeled) binary trees with six pendant vertices. Find thepathlengthofeach.[Hint:Distributethe11vertices(becausen=6+5)amongdifferentlevels.Observethatlevel0hasexactlyonevertex,level1hasexactly twovertices; level2canhaveeither twoor fourvertices;andsoon.Therearesixsuchtrees,andtwoofthemareshowninFig.3-13.]

3-11. SketchallspanningtreesofthegraphinFig.2-1.3-12. Showthatapathisitsownspanningtree.3-13. Prove that apendant edge (an edgewhoseone endvertex is ofdegree

one)inaconnectedgraphGiscontainedineveryspanningtreeofG.

www.TechnicalBooksPDF.com

Page 92: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

3-14. ProvethatanysubgraphgofaconnectedgraphGiscontainedinsomespanningtreeofGifandonlyifgcontainsnocircuit.

3-15. Whatisthenullityofacompletegraphofnvertices?3-16. ShowthataHamiltonianpathisaspanningtree.3-17. Prove that any circuit in a graph G must have at least one edge in

commonwithachordset.3-18. ProveTheorem3-13.3-19. Findaspanningtreeatadistanceoffourfromspanningtree{b1,b2,b3,

64,b5,b6}inFig.3-17.Listallfundamentalcircuitswithrespecttothisnewspanningtree.

3-20. Show that the distance between two spanning trees as defined in thischapterisametric.

3-21. Canyouconstructagraphifyouaregivenallitsspanningtrees?How?3-22. Provethatthenullityofagraphdoesnotchangewhenyoueitherinserta

vertex in themiddle of an edge, or remove a vertex of degree two bymergingtwoedgesincidentonit.

3-23. Prove thatanygivenedgeofaconnectedgraphG isabranchofsomespanningtreeofG.IsitalsotruethatanyarbitraryedgeofGisachordforsomespanningtreeofG?

3-24. Suggestamethodfordeterminingthetotalnumberofspanningtreesofaconnectedgraphwithoutactuallylistingthem.

3-25. Provethattwocolorsarenecessaryandsufficienttopaintallnvertices(n≥2)ofatree,suchthatnoedgeinthetreehasbothofitsendverticesof the same color. (This fact is expressed by the statement that thechromaticnumberofatreeistwo.)

3-26. Suppose that you are given a set of n positive integers. State somenecessaryconditionsof thissetso that thesetcanbe thedegreesofallthenverticesofatree.Aretheseconditionssufficientalso?

3-27. Let v be a vertex in a connected graph G. Prove that there exists aspanningtreeTinGsuchthatthedistanceofeveryvertexfromvisthesamebothinGandinT.

3-28. LetT1andT2betwospanningtreesofaconnectedgraphG.IfedgeeisinT1butnotinT2,provethatthereexistsanotheredgefinT2butnotinT1such thatsubgraphs(T1−e)⋃ fand(T2− f)⋃earealsospanningtreesofG.

3-29. Constructatreegraph(with16vertices,eachcorrespondingtoatreeinFig.3-15)ofalabeledcompletegraphoffourvertices.

3-30. In the tree graph obtained in Problem 3-29, observe the following

www.TechnicalBooksPDF.com

Page 93: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

properties(discoveredbyR.L.Cummins).AtreegraphhasatleastoneHamiltoniancircuit,andanarbitraryedgeofatreegraphcanbeincludedinaHamiltoniancircuit.

3-31. InagivenconnectedweightedgraphG,supposethereexistsanedgeeswhoseweight is smaller than that of any other inG. Prove that everyshortestspanningtreeinGmustcontaines.

3-32. LetG be a connectedweighted graph inwhich every edge belongs tosomecircuit.Ifel istheedgewithweightgreaterthanthatofanyotheredgeinG,showthatnoshortestspanningtreeinGwillcontainel.

3-33. Showbyconstructingcounterexamples that inProblems3-31and3-32the same cannot be said of the second smallest and the second largestedges,respectively.

3-34. Use the algorithm of Kruskal, as outlined in this chapter, to find ashortestspanningtreeinthegraphofFig.3-20(a).

3-35. Pick 15 large cities in the United States and obtain the 105 intercitydistancesfromanatlas.Findtheshortestspanningtreeconnectingthesecities by using (a)Kruskal’smethod, and (b)Prim’smethod.Comparetheirrelativeefficiencies.

www.TechnicalBooksPDF.com

Page 94: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

4CUTSETSANDCUT-VERTICES

InChapter 3we studied the spanning tree—a special type of subgraphof aconnectedgraphG—whichkeptalltheverticesofGtogether.Inthischapterweshallstudythecut-set—anothertypeofsubgraphofaconnectedgraphGwhoseremovalfromGseparatessomeverticesfromothersinG.Propertiesofcutsetsandtheirapplicationswillbecovered.Otherrelatedtopics,suchasconnectivity,separability,andvulnerabilityofgraphs,willalsobediscussed.

4-1. CUTSETS

Ina connectedgraphG, acut-set is a setof edges†whose removal fromGleavesG disconnected, provided removal of no proper subset of these edgesdisconnectsG.Forinstance,inFig.4-1thesetofedges{a,c,d,f}isacut-set.Therearemanyothercutsets,suchas{a,b,g},{a,b,e,f},and{d,h,f}.Edge{k}aloneisalsoacut-set.Thesetofedges{a,c,h,d},ontheotherhand,isnotacut-set,becauseoneofitspropersubsets,{a,c,h},isacut-set.Toemphasizethefactthatnopropersubsetofacut-setcanbeacut-set,some

authorsrefertoacut-setasaminimalcut-set,apropercut-set,orasimplecut-set.Sometimesacut-setisalsocalledacocycle.Weshalljustusethetermcut-set.A cut-set always “cuts” a graph into two. Therefore, a cut-set can also be

definedasaminimalsetofedgesinaconnectedgraphwhoseremovalreducestherankofthegraphbyone.TherankofthegraphinFig.4.1(b),forinstance,isfour,onelessthanthatofthegraphinFig,4.1(a).Anotherwayoflookingatacut-set is this: ifwepartition all theverticesof a connectedgraphG into twomutually exclusive subsets, a cut-set is a minimal number of edges whoseremoval from G destroys all paths between these two sets of vertices. Forexample,inFig.4-1(a)cut-set{a,c,d,f}connectsvertexset{v1,v2,v6}with{v3,v4,v5}.(Notethatoneorbothofthesetwosubsetsofverticesmayconsist

www.TechnicalBooksPDF.com

Page 95: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

of justonevertex.)Sinceremovalofanyedgefroma treebreaks the tree intotwoparts,everyedgeofatreeisacut-set.

Fig.4-1Removalofacut-set{a,c,d,f}fromagraph“cuts”itintotwo.

Cutsetsareofgreatimportanceinstudyingpropertiesofcommunicationandtransportationnetworks.Suppose, forexample, that thesixvertices inFig.4-1(a)representsixcitiesconnectedbytelephonelines(edges).Wewishtofindoutifthereareanyweakspotsinthenetworkthatneedstrengtheningbymeansofadditionaltelephonelines.Welookatallcutsetsofthegraph,andtheonewiththe smallest number of edges is the most vulnerable. In Fig. 4-1(a), the cityrepresented by vertex v3 can be severed from the rest of the network by thedestruction of just one edge. After some additional study of the properties ofcutsets,weshallreturntotheirapplications.

4-2. SOMEPROPERTIESOFACUT-SET

ConsideraspanningtreeTinaconnectedgraphGandanarbitrarycutsetSinG.IsitpossibleforSnottohaveanyedgeincommonwithT?Theanswerisno.Otherwise, removal of the cut-set S fromG would not disconnect the graph.Therefore,

THEOREM4-1

Everycut-setinaconnectedgraphGmustcontainatleastonebranchofevery

www.TechnicalBooksPDF.com

Page 96: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

spanningtreeofG.

Willtheconversealsobetrue?Inotherwords,willanyminimalsetofedgescontainingatleastonebranchofeveryspanningtreebeacut-set?Theanswerisyes,bythefollowingreasoning:InagivenconnectedgraphG, letQbeaminimalsetofedgescontainingat

leastonebranchofeveryspanningtreeofG.ConsiderG−Q,thesubgraphthatremains after removing the edges in Q from G. Since the subgraph G − QcontainsnospanningtreeofG,G−Qisdisconnected(onecomponentofwhichmayjustconsistofanisolatedvertex).Also,sinceQ isaminimalsetofedgeswiththisproperty,anyedgeefromQreturnedtoG−Qwillcreateatleastonespanning tree. Thus the subgraph G − Q + e will be a connected graph.Therefore,Q is aminimal set of edgeswhose removal fromG disconnectsG.This,bydefinition,isacut-set.Hence

THEOREM4-2

In a connected graphG, any minimal set of edges containing at least onebranchofeveryspanningtreeofGisacut-set.

THEOREM4-3

Everycircuithasanevennumberofedgesincommonwithanycut-set.

Proof: Consider a cut-set S in graph G (Fig. 4-2). Let the removal of Spartition theverticesofG into two (mutually exclusiveor disjoint) subsetsV1andV2. Consider a circuit Γ inG. If all the vertices in Γ are entirely withinvertexsetV1 (orV2), thenumberofedgescommontoSandΓ iszero; that is,N(S⋂Γ)=0,anevennumber.†If,ontheotherhand,someverticesinΓareinV1andsomeinV2,wetraverse

backandforthbetweenthesetsV1andV2aswetraversethecircuit(seeFig.4-2).Becauseof the closednatureof a circuit, thenumberof edgeswe traversebetweenV1andV2mustbeeven.AndsinceveryedgeinShasoneendinV1andthe other inV2, and no other edge inG has this property (of separating setsV1andV2),thenumberofedgescommontoSandΓiseven.

www.TechnicalBooksPDF.com

Page 97: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.4-2Circuitandacut-setinG.

4-3. ALLCUTSETSINAGRAPH

InSection4-1itwasshownhowcutsetsareusedtoidentifyweakspotsinacommunication net. For this purpose we list all cutsets of the correspondinggraph,andfindwhichoneshavethesmallestnumberofedges.Itmustalsohavebecomeapparenttoyouthateveninasimpleexample,suchasinFig.4-1,thereis a large number of cutsets, and we must have a systematic method ofgeneratingallrelevantcutsets.Inthecaseofcircuits,wesolvedasimilarproblembythesimpletechniqueof

finding a set of fundamental circuits and then realizing that other circuits in agraph are just combinations of two or more fundamental circuits. We shallfollowasimilarstrategyhere.Justasaspanningtreeisessentialfordefiningaset of fundamental circuits, so is a spanning tree essential for a set offundamental cutsets. It will be beneficial for the reader to look for theparallelismbetweencircuitsandcutsets.

Fundamental CutSets: Consider a spanning treeT of a connected graphG.TakeanybranchbinT.Since{b}isacut-setinT,{b}partitionsallverticesofT into twodisjoint sets—one at each endofb.Consider the samepartitionofverticesinG,andthecutsetS inG thatcorrespondstothispartition.CutsetSwillcontainonlyonebranchbofT,and therest (ifany)of theedges inSarechordswithrespecttoT.Suchacut-setScontainingexactlyonebranchofatreeT is called a fundamental cut-setwith respect toT. Sometimes a fundamentalcut-set is also called a basic cut-set. In Fig. 4-3, a spanning treeT (in heavylines)andallfiveofthefundamentalcutsetswithrespecttoTareshown(broken

www.TechnicalBooksPDF.com

Page 98: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

lines“cutting”througheachcut-set).

Fig.4-3Fundamentalcutsetsofagraph.

Just as everychordof a spanning treedefinesaunique fundamental circuit,every branch of a spanning tree defines aunique fundamental cut-set. Itmustalsobekeptinmindthatthetermfundamentalcut-set(likethetermfundamentalcircuit)hasmeaningonlywithrespecttoagivenspanningtree.Nowweshallshowhowothercutsetsofagraphcanbeobtainedfromagiven

setofcutsets.

THEOREM4-4

Theringsumofanytwocutsetsinagraphiseitherathirdcut-setoranedge-disjointunionofcutsets.

OutlineofProof:LetS1andS2betwocutsetsinagivenconnectedgraphG.LetV1andV2bethe(uniqueanddisjoint)partitioningofthevertexsetVofGcorresponding to S1. Let V3 and V4 be the partitioning corresponding to S2.Clearly[seeFigs.4-4(a)and(b)],

V1⋃V2=VandV1⋂V2=Ø,V3⋃v4=VandV3⋂V4=Ø.

Nowletthesubset(V1⋂V4)⋃(V2⋂V3)becalledV5,andthisbydefinitionisthesameastheringsumV1⊕V3.Similarly,letthesubset(V1⋂V3)⋃(V2⋂V4)becalledV6,whichisthesameasV2⊕V3.SeeFig.4-4(c).TheringsumofthetwocutsetsS1⊕S2canbeseentoconsistonlyofedges

thatjoinverticesinV5tothoseinV6.Also,therearenoedgesoutsideS1⊕S2

www.TechnicalBooksPDF.com

Page 99: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

thatjoinverticesinV5tothoseinV6.ThusthesetofedgesS1⊕S2producesapartitioningofVintoV5andV6such

that

V5⋃v6=VandV5⋂V6=Ø.

HenceS1⊕S2 is a cut-set if the subgraphscontainingV5 andV6 each remainconnected after S1⊕ S2 is removed fromG. Otherwise, S1⊕ S2 is an edge-disjointunionofcutsets.

Example:InFig.4-3letusconsiderringsumsofthefollowingthreepairsofcutsets.

www.TechnicalBooksPDF.com

Page 100: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.4-4Twocutsetsandtheirpartitionings.

Sowehaveamethodofgeneratingadditionalcutsetsfromanumberofgivencutsets.Obviously,we cannot startwith any two cutsets in a given graph andhope to obtain all its cutsets by this method. What then is a minimal set ofcutsetsfromwhichwecanobtaineverycut-setofGbytakingringsums?Theanswer (to be proved in Chapter 6) is the set of all fundamental cutsets withrespecttoagivenspanningtree.

4-4. FUNDAMENTALCIRCUITSANDCUTSETS

Considera spanning treeT inagivenconnectedgraphG.Letcibeachordwith respect to T, and let the fundamental circuit made by ci be called Γ,consistingofkbranchesb1,b2,...,bkinadditiontothechordci;thatis,

Γ={ci,b1,b2,...,bk)isafundamentalcircuitwithrespecttoT.

www.TechnicalBooksPDF.com

Page 101: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Everybranchofanyspanningtreehasafundamentalcut-setassociatedwithit.LetS1bethefundamentalcut-setassociatedwithbl,consistingofqchordsinadditiontothebranchb1;thatis,

S1={bl,cl,c2,...,cq}isafundamentalcut-setwithrespecttoT.

BecauseofTheorem4-3,theremustbeanevennumberofedgescommontoΓ andS1. Edgeb1 is in both Γ andS1, and there is only one other edge in Γ(whichisci)thatcanpossiblyalsobeinS1.Therefore,wemusthavetwoedgesb1andcicommontoS1andΓ.Thusthechordciisoneofthechordsc1,c2,...cq.Exactlythesameargumentholdsforfundamentalcutsetsassociatedwithb2,

b3,...,andbk.Therefore,thechordciiscontainedineveryfundamentalcut-setassociatedwithbranchesinΓ.Is itpossiblefor thechordci tobe inanyotherfundamentalcut-setS′ (with

respect toT, of course) besides those associatedwithb1,b2, . . . andbk?Theanswerisno.Otherwise(sincenoneofthebranchesinΓareinS′),therewouldbeonlyoneedgecicommontoS′andΓ,acontradictiontoTheorem4-3.Thuswehaveanimportantresult.

THEOREM4-5

With respect to a given spanning tree T, a chord ci that determines afundamental circuit Γ occurs in every fundamental cut-set associatedwith thebranchesinΓandinnoother.

As an example, consider the spanning tree {b, c, e, h, k}, shown in heavylines,inFig.4-3.Thefundamentalcircuitmadebychordfis

{f,e,h,k}.

Thethreefundamentalcutsetsdeterminedbythethreebranchese,h,andkare

determinedbybranche:{d,e,f},determinedbybranchh:{f,g,h},determinedbybranchk:{f,g,k}.

Chor foccurs ineachof these three fundamentalcutsets,and there isnootherfundamentalcut-setthatcontainsf.TheconverseofTheorem4-5isalsotrue.

Page 102: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

THEOREM4-6

With respect to a given spanning tree T, a branch bi that determines afundamentalcut-setS iscontainedineveryfundamentalcircuitassociatedwiththechordsinS,andinnoothers.

Proof:TheproofconsistsofargumentssimilartothosethatledtoTheorem4-5.Letthefundamentalcut-setSdeterminedbyabranchbibe

S={bi,c1,c2,...,cp},

andletΓ1bethefundamentalcircuitdeterminedbychordc1:

T1={c1,b1,b2,...,bq}.

SincethenumberofedgescommontoSandΓ1mustbeeven,bimustbeinΓ1.Thesameistrueforthefundamentalcircuitsmadebychordsc2,c3,...,cp.Ontheotherhand,supposethatbioccursinafundamentalcircuitΓp+1made

byachordotherthanc1,c2,...,cp.Sincenoneofthechordsc1,c2,...,cpisinΓp+1,thereisonlyoneedgebicommontoacircuitΓp+1andthecut-setS,whichisnotpossible.Hencethetheorem.

Turning again for illustration to the graph in Fig. 4-3, consider branch e ofspanningtree{b,c,e,h,k}.Thefundamentalcut-setdeterminedbyeis

{e,d,f}.

Thetwofundamentalcircuitsdeterminedbychordsdandfare

determinedbychordd:{d,c,e},determinedbychordf:{f,e,h,k}.

Branch e is contained in both these fundamental circuits, and none of theremainingthreefundamentalcircuitscontainsbranche.

4-5. CONNECTIVITYANDSEPARABILITY

EdgeConnectivity:Eachcut-setofaconnectedgraphGconsistsofacertain

Page 103: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

numberofedges.Thenumberofedges in thesmallestcut-set (i.e.,cutsetwithfewestnumberofedges)isdefinedastheedgeconnectivityofG.Equivalently,the edge connectivity of a connected graph† can be defined as the minimumnumberofedgeswhoseremoval(i.e.,deletion)reducestherankofthegraphbyone.Theedgeconnectivityofatree,forinstance,isone.TheedgeconnectivitiesofthegraphsinFigs.4-1(a),4-3,4-5areone,two,andthree,respectively.

Vertex Connectivity: On examining the graph in Fig. 4-5, we find thatalthough removal of no single edge (or even a pair of edges) disconnects thegraph, the removal of the single vertex v does.†Therefore,we define anotheranalogous term called vertex connectivity. The vertex connectivity (or simplyconnectivity) of a connected graphG is defined as the minimum number ofvertices whose removal from G leaves the remaining graph disconnected.‡Again,thevertexconnectivityofatreeisone.ThevertexconnectivitiesofthegraphsinFigs.4-1(a),4-3,and4-5areone,two,andone,respectively.Notethatfrom the way we have defined it vertex connectivity is meaningful only forgraphsthathavethreeormoreverticesandarenotcomplete.

Fig.4-5Separablegraph.

Separable Graph: A connected graph is said to be separable if its vertexconnectivity is one. All other connected graphs are called nonseparable. AnequivalentdefinitionisthataconnectedgraphGissaidtobeseparableifthereexistsasubgraphginGsuchthat (thecomplementofginG)andghaveonlyonevertex incommon.That these twodefinitionsareequivalentcanbeeasilyseen(Problem4-7).Inaseparablegraphavertexwhoseremovaldisconnectsthegraphiscalledacut-vertex,acut-node,oranarticulationpoint.Forexample,inFig.4-5thevertexvisacut-vertex,andinFig.4-1(a)vertexv4isacut-vertex.Itcanbeshown(Problem4-18)thatinatreeeveryvertexwithdegreegreaterthanoneisacut-vertex.Moreover:

Page 104: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

THEOREM4-7

AvertexvinaconnectedgraphGisacut-vertexifandonlyifthereexisttwoverticesxandyinGsuchthateverypathbetweenxandypassesthroughv.

Theproofofthetheoremisquiteeasyandisleftasanexercise(Problem4-17).Theimplicationofthetheoremisverysignificant.Itstatesthatvisacrucialvertexinthesensethatanycommunicationbetweenxandy(ifGrepresentedacommunicationnetwork)must“passthrough”v.

Fig.4-6Graphwith8verticesand16edges.

AnApplication:Supposewearegivennstationsthataretobeconnectedbymeansofelines(telephonelines,bridges,railroads,tunnels,orhighways)wheree ≥ n − 1.What is the best way of connecting? By “best” wemean that thenetwork should be as invulnerable to destruction of individual stations andindividuallinesaspossible.Inotherwords,constructagraphwithnverticesande edges that has the maximum possible edge connectivity and vertexconnectivity.For example, the graph in Fig. 4-5 has n = 8, e = 16, and has vertex

connectivityofoneandedgeconnectivityofthree.Anothergraphwiththesamenumberofverticesandedges(8and16,respectively)canbedrawnasshowninFig.4-6.It can easily be seen that the edge connectivity as well as the vertex

connectivityofthisgraphisfour.Consequently,evenafteranythreestationsarebombed,oranythreelinesdestroyed,theremainingstationscanstillcontinueto“communicate”witheachother.ThusthenetworkofFig.4-6isbetterconnectedthanthatofFig.4-5(althoughbothconsistofthesamenumberoflines—16).Thenextquestioniswhatisthehighestvertexandedgeconnectivitywecan

achieveforagivennande?Thefollowingtheoremsconstitutetheanswer.

Page 105: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

THEOREM4-8

The edge connectivity of a graphG cannot exceed the degree of the vertexwiththesmallestdegreeinG.

Proof:LetvertexvibethevertexwiththesmallestdegreeinG.Letd(vi)bethedegreeofvi.VertexvicanbeseparatedfromGbyremovingthed(vi)edgesincidentonvertexvi.Hencethetheorem.

THEOREM4-9

The vertex connectivity of any graph G can never exceed the edgeconnectivityofG.

Proof:LetαdenotetheedgeconnectivityofG.Therefore,thereexistsacutsetSinGwithαedges.LetSpartitiontheverticesofGintosubsetsV1andV2.ByremovingatmostaverticesfromV1(orV2)onwhichtheedgesinSareincident,wecaneffect theremovalofS (togetherwithallotheredges incidenton thesevertices)fromG.Hencethetheorem.

COROLLARY

Everycut-setinanonseparablegraphwithmorethantwoverticescontainsatleasttwoedges.

THEOREM4-10

The maximum vertex connectivity one can achieve with a graph G of nverticesandeedges(e≥n−1)istheintegralpartofthenumber2e/n; thatis,⌊2e/n⌋.Proof: Every edge inG contributes two degrees. The total (2e degrees) is

divided among n vertices. Therefore, there must be at least one vertex inGwhosedegreeisequaltoorlessthanthenumber2e/n.ThevertexconnectivityofGcannotexceedthisnumber,inlightofTheorems4-8and4-9.Toshowthatthisvaluecanactuallybeachieved,onecanfirstconstructann-

vertexregulargraphofdegree⌊2e/n⌋andthenaddtheremaininge−(n/2)·⌊2e/n⌋edgesarbitrarily.Thecompletionoftheproofisleftasanexercise.

TheresultsofTheorems4-8,4-9,and4-10canbesummarizedasfollows:

vertexconnectivity≤edgeconnectivity≤ ,

Page 106: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

and

maximumvertexconnectivitypossible= .

Thus, for a graph with 8 vertices and 16 edges (Figs. 4-5 and 4-6), forexample,wecanachieveavertexconnectivity(andthereforeedgeconnectivity)ashighasfour(=2·16/8).A graphG is said to be k-connected if the vertex connectivity ofG is k;

therefore,a1-connectedgraphisthesameasaseparablegraph.

THEOREM4-11

AconnectedgraphGisk-connectedifandonlyifeverypairofverticesinGis joined by k or more paths that do not intersect,† and at least one pair ofverticesisjoinedbyexactlyknonintersectingpaths.

THEOREM4-12

TheedgeconnectivityofagraphGisk:ifandonlyifeverypairofverticesinG is joinedbykormoreedge-disjointpaths (i.e.,paths thatmay intersect,buthavenoedgesincommon),andatleastonepairofverticesisjoinedbyexactlykedge-disjointpaths.ThereaderisreferredtoChapter5of[1-5]for theproofsofTheorems4-11

and4-12.Note thatourdefinitionofk-connectedness isslightlydifferent fromthe one given in [1-5].A special result of Theorem 4-11 is that a graphG isnonseparable ifandonly ifanypairofvertices inGcanbeplaced inacircuit(Problem4-13).The reader is encouraged toverify these theoremsbyenumerating all edge-

disjointandvertex-disjointpathsbetweeneachofthe15pairsofverticesinFig.4-3.

4-6. NETWORKFLOWS

Inanetworkoftelephonelines,highways,railroads,pipelinesofoil(orgasorwater), and so on, it is important to know the maximum rate of flow that ispossible from one station to another in the network. This type of network isrepresentedbyaweightedconnectedgraphinwhichtheverticesarethestationsand the edges are lines through which the given commodity (oil, gas, water,number of messages, number of cars, etc.) flows. The weight, a real positive

Page 107: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

number,associatedwitheachedgerepresentsthecapacityoftheline,thatis,themaximumamountof flowpossibleperunitof time.Thegraph inFig.4-7, forexample, representsa flownetworkconsistingof12stationsand31 lines.Thecapacityofeachoftheselinesisalsoindicatedinthefigure.It is assumed that at each intermediate vertex the total rate of commodity

enteringisequaltotherateleaving.Inotherwords,thereisnoaccumulationorgenerationofthecommodityatanyvertexalongtheway.Furthermore,theflowthroughavertexislimitedonlybythecapacitiesoftheedgesincidentonit.Inotherwords, thevertex itself canhandle asmuch flowas allowed through theedges.Finally,thelinesarelossless.

Fig.4-7Graphofaflownetwork.

Insuchaflowproblemthequestionstobeansweredare

1. What is the maximum flow possible through the network between aspecifiedpairofvertices—say,fromBtoMinFig.4-7?

2. Howdoweachievethisflow(i.e.,determinetheactualflowthrougheachedgewhenthemaximumflowexists)?

Theorem 4-13, perhaps themost important result in the theory of transportnetworks,answersthefirstquestion.Thesecondquestionisansweredimplicitlybyaconstructiveproofofthetheorem.Tofacilitatethestatementandproofofthetheorem,letusdefineafewterms.Acut-setwithrespecttoapairofverticesaandbinaconnectedgraphGputs

a and b into two different components (i.e., separates vertices a and b). Forinstance,inFig.4-3cut-set{d,e,f}isacut-setwithrespecttov1andv6.Theset{f,g,h}isalsoacut-setwithrespecttov1andv6.Butthecut-set{f,g,h}isnot

Page 108: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

a cut-set with respect to v1 and v6. The capacity of cut-set S in a weightedconnected graph G (in which the weight of each edge represents its flowcapacity)isdefinedasthesumoftheweightsofalltheedgesinS.

THEOREM4-13

Themaximum flow possible between two vertices a and b in a network isequaltotheminimumofthecapacitiesofallcutsetswithrespecttoaandb.

Proof: Consider any cut-setS with respect to verticesa andb inG. In thesubgraphG −S (the subgraph left after removingS fromG) there is no pathbetweena andb.Therefore, everypath inG betweena andbmust containatleast one edge ofS. Thus every flow froma tob (or fromb toa)must passthrough one ormore edges ofS.Hence the total flow rate between these twovertices cannot exceed the capacity of S. Since this holds for all cutsets withrespecttoaandb,theflowratecannotexceedtheminimumoftheircapacities.

To show that this flow can actually be achieved is somewhat involved. Itrequiressomeconceptsthataretobeintroducedlater.Thecompleteproofwilltherefore be deferred till Chapter 14, where flow problems will be treated inmuchgreaterdetail.

4-7. 1-ISOMORPHISM

Aseparablegraphconsistsof twoormorenonseparable subgraphs.Eachofthelargestnonseparablesubgraphsiscalledablock.(Someauthorsusethetermcomponent,buttoavoidconfusionwithcomponentsofadisconnectedgraph,weshallusethetermblock.)ThegraphinFig.4-5hastwoblocks.ThegraphinFig.4-8 has five blocks (and three cut-vertices a, b, and c); each block is shownenclosedbyabrokenline.Notethatanonseparableconnectedgraphconsistsofjustoneblock.

Page 109: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.4-8Separablegraphwiththreecut-verticesandfiveblocks.

Fig.4-9Disconnectedgraph1-isomorphictoFig.4-8.

VisuallycomparethedisconnectedgraphinFig.4-9withtheoneinFig.4-8.These two graphs are certainly not isomorphic (they do not have the samenumberofvertices),buttheyarerelatedbythefactthattheblocksofthegraphin Fig. 4-8 are isomorphic to the components of the graph in Fig. 4-9. Suchgraphsaresaidtobe1-isomorphic.Moreformally:TwographsG1andG2aresaidtobe1-isomorphiciftheybecomeisomorphic

toeachotherunderrepeatedapplicationofthefollowingoperation.

Operation 1: “Split” a cut-vertex into two vertices to produce two disjointsubgraphs.From this definition it is apparent that two nonseparable graphs are 1-

isomorphicifandonlyiftheyareisomorphic.

THEOREM4-14

IfG1andG2aretwo1-isomorphicgraphs,therankofG1equalstherankofG2andthenullityofG1equalsthenullityofG2.

Proof:Underoperation1,wheneveracut-vertexinagraphG is“split” intotwovertices, thenumberof components inG increasesbyone.Therefore, the

Page 110: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

rankofGwhichis

numberofverticesinG−numberofcomponentsinG

remainsinvariantunderoperation1.

Also,sincenoedgesaredestroyedornewedgescreatedbyoperation1,two1-isomorphic graphs have the same number of edges. Two graphswith equalrankandwithequalnumbersofedgesmusthavethesamenullity,because

nullity=numberofedges−rank.

WhatifwejointwocomponentsofFig.4-9by“gluing”togethertwovertices(sayvertexxtoy)?WeobtainthegraphshowninFig.4-10.Clearly,thegraphinFig.4-10is1-isomorphictothegraphinFig.4-9.Since

theblocksofthegraphinFig.4-10areisomorphictotheblocksofthegraphinFig.4-8,thesetwographsarealso1-isomorphic.ThusthethreegraphsinFigs.4-8,4-9,and4-10are1-isomorphictooneanother.

Fig.4-10Graph1-isomorphictoFigs.4-8and4-9.

4-8. 2-ISOMORPHISM

InSection4-7wegeneralizedtheconceptof isomorphismbyintroducing1-isomorphism.AgraphG1was1-isomorphictographG2iftheblocksofG1wereisomorphictotheblocksofG2.Sinceanonseparablegraphisjustoneblock,1-isomorphismfornonseparablegraphsisthesameasisomorphism.However,forseparablegraphs(i.e.,graphswithvertexconnectivityofone),1-isomorphismis

Page 111: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

different fromisomorphism.Graphs thatare isomorphicarealso1-isomorphic,but1-isomorphicgraphsmaynotbeisomorphic.Thisgeneralizedisomorphismisveryusefulinthestudyofseparablegraphs.Wecangeneralize this concept further tobroaden its scope for2-connected

graphs(i.e.,graphswithvertexconnectivityoftwo),asfollows:In a 2-connected graphG let vertices x and y be a pair of vertices whose

removalfromGwillleavetheremaininggraphdisconnected.Inotherwords,Gconsistsofasubgraphg1anditscomplement suchthatg1and haveexactlytwo vertices, x and y, in common. Suppose that we perform the followingoperation 2 onG (after which, of course, G no longer remains the originalgraph).

Operation2:“Split”thevertexxintox1andx2andthevertexyintoy1andy2suchthatGissplitintog1and .Letverticesx1andy1gowithg1andx2andy2with .Now rejoin thegraphsg1 and bymergingx1withy2 andx2withy1.(Clearly,edgeswhoseendverticeswerexandyinGcouldhavegonewithg1or,withoutaffectingthefinalgraph.)Two graphs are said to be 2-isomorphic if they become isomorphic after

undergoingoperation1 (inSection4-7)oroperation2,orbothoperationsanynumberoftimes.Forexample,Fig.4-11showshowthetwographsinFigs.4-11(a)and(d)are2-isomorphic.Notethatin(a)thedegreeofvertexxisfour,butin(d)novertexisofdegreefour.Fromthedefinitionitfollowsimmediatelythatisomorphicgraphsarealways

1-isomorphic, and 1-isomorphic graphs are always 2-isomorphic. But 2-isomorphic graphs are not necessarily 1-isomorphic, and 1-isomorphic graphsarenotnecessarily isomorphic.However, forgraphswithconnectivity threeormore,isomorphism,1-isomorphism,and2-isomorphismaresynonymous.

Page 112: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.4-112-isomorphicgraphs(a)and(d).

Itisclearthatnoedgesorverticesarecreatedordestroyedunderoperation2.Therefore,therankandnullityofagraphremainunchangedunderoperation2.And as shown in Section 4-7, the rank or nullity of a graph does not changeunderoperation1.Therefore,2-isomorphicgraphsareequalinrankandequalinnullity.Thefactthattherankrandnullityµarenotenoughtospecifyagraphwithin 2-isomorphism can easily be shown by constructing a counterexample(Problem4-23).

Circuit Correspondence: Two graphsG1 andG2 are said to have a circuitcorrespondence if they meet the following condition: There is a one-to-onecorrespondence between the edges of G1 and G2 and a one-to-onecorrespondence between the circuits of G1 andG2, such that a circuit inG1formedbycertainedgesofG1hasacorrespondingcircuitinG2formedbythecorrespondingedgesofG2,andviceversa.Isomorphicgraphs,obviously,havecircuitcorrespondence.Since in a separable graphG every circuit is confined to a particular block

(Problem4-15),everycircuitinGretainsitsedgesasGundergoesoperation1(inSection4-7).Hence1-isomorphicgraphshavecircuitcorrepondence.Similarly, let us consider what happens to a circuit in a graphG when it

Page 113: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

undergoesoperation2,asdefinedinthissection.AcircuitTinGwillfallinoneofthreecategories:

1. Γismadeofedgesalling1,or

2. Γismadeofedgesallin ,or

3. Γismadeofedgesfrombothg1and ,andinthatcaseTmustincludebothverticesxandy.

Incases1and2,Γisunaffectedbyoperation2.Incase3,Γstillhastheoriginaledges,except that thepathbetweenverticesx andy ing1,whichconstitutedapartofΓ,is“flippedaround.”Thuseverycircuitinagraphundergoingoperation2 retains its original edges. Therefore, 2-isomorphic graphs also have circuitcorrespondence.Theorem4-15,whichisconsideredthemostimportantresultfor2-isomorphic

graphs,isduetoH.Whitney.

THEOREM4-15

Twographsare2-isomorphicifandonlyiftheyhavecircuitcorrespondence.

Proof:The“onlyif”parthasalreadybeenshownintheargumentprecedingthe theorem. The “if” part is more involved, and the reader is referred toWhitney’soriginalpaper[4-7].Asweshallobserve insubsequentchapters, the ideasof2-isomorphismand

circuit correspondence play important roles in the theory of contact networks,electricalnetworks,andindualityofgraphs.

SUMMARY

Ourmainconcerninthischapterwaswithansweringthefollowingquestionabout a connected graph: Which part of a connected graph, when removed,breaksthegraphapart?Clearly,theanswertothisquestiondoesspecifyagraphinmanyaspectsandtellsagreatdealabout it.Someof thesepropertiesareofconsiderablesignificancebothintheoryandapplicationsofgraphs.Inpursuitoftheanswertotheabovequestion,wecameacrosstheconceptsof

cutsets, cut-vertices, connectivity, and so on. Many of the theorems showedrelationshipsbetweenthesecharacteristicsofagraph.In contrast to a spanning tree (which keeps the vertices together), a cutset

Page 114: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

separatesthevertices.Consequently,therewasboundtobeacloserelationshipbetweenaspanningtreeandacut-set.Someofthetheorems(andtheproblemsattheendofthischapter)describethisrelationshipbetweenspanningtreesandcutsets.In terms of theminimum number of vertices whose removal disconnects a

graph,allgraphscanbeclassifiedaccordingtoFig.4-12.

Fig.4-12Classificationofgraphsaccordingtotheirconnectivity.

Averyimportantandpracticalresultofthischapterwasthemax-flowmin-cuttheorem(Theorem4-13).

REFERENCES

Mostof thematerial in this chapter is basedon the classicworkofHasslerWhitneyconductedintheearly1930s,[4-6,4-7].Menger[4-5],in1927,showedthat the vertex connectivity of a graph was related to the number of vertex-disjoint paths between two vertices in a graph. Many variations of Menger’stheorem have appeared.Harary [1-5], Chapter 5, gives an excellent survey ofMengerian results and showshow there are 18different theoremspossible (ofwhichwehavegiven the twomost important—Theorems4-11and4-12).The

Page 115: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

max-flow min-cut theorem—also a variation of Mengerian results —wasdiscoveredindependentlybyFordandFulkerson[4-2]andElias,Feinstein,andShannon[4-1].Thebestreferencefornetworkflowproblemsistheauthoritativebook by Ford and Fulkerson [4-3]. Other references recommended for thischapterare

1. Berge[1-1],Chapter20.

2. BusackerandSaaty[1-2],Chapter7.

3. KimandChien[4-4],PartV,Chapters2and3.

4-1. ELIAS, P.,A.FEINSTEIN, andC.E.SHANNON, “ANoteon theMaximalFlowThroughaNetwork,” IRETrans. Inform.Theory,Vol. IT-2,Dec.1956,117–119.

4-2. FORD, L. R., and D. R. FULKERSON, “Maximal Flow Through aNetwork,”Can.J.Math.,Vol.8,1956,399–404.

4-3. FORD, L. R., and D. R. FULKERSON, Flows in Networks, PrincetonUniversityPress,Princeton,N.J.,1962.

4-4. KIM, W. H., and R. T. CHIEN, Topological Analysis and Synthesis ofCommunicationNetworks,ColumbiaUniversityPress,NewYork,1962.

4-5. MENGER, K., “Zur allgemeinen Kurventheorie,”Fund.Math., Vol. 10,1927,96–115.

4-6. WHITNEY,H.,“CongruentGraphsandtheConnectivityofGraphs,”Am.J.Math.,Vol.54,1932,150–168.

4-7. WHITNEY,H.,“2-IsomorphicGraphs,”Am.J.Math.,Vol.55,1933,245–254.

PROBLEMS

4-1. Pick an arbitrary spanning tree in the graph given in Fig. 4-6. List allseven(becausen−1=7)fundamentalcutsetswithrespecttothistree.

4-2. By taking the ring sum of the seven fundamental cutsets obtained inProblem4-1,listallothercutsetsofthegraph.

4-3. Listallcutsetswithrespecttothevertexpairv2,v3inthegraphinFig.4-1(a).

4-4. ShowthattheedgeconnectivityandvertexconnectivityofthegraphsinFig.2-2areeachequaltothree.

4-5. Whatistheedgeconnectivityofthecompletegraphofnvertices?

Page 116: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

4-6. ProvethatinaconnectedgraphGthecomplementofacut-setinGdoesnotcontainaspanningtreeandthecomplementofaspanningtree(i.e.,chordset)doesnotcontainacut-set.

4-7. Show that the two definitions of separability in Section 4-5 areequivalent.

4-8. Prove that inanonseparablegraphG thesetofedges incidentoneachvertexofGisacut-set.

4-9. WhyistheresultofProblem4-8notapplicabletoseparablegraphsalso?Explain.

4-10. ProvethatinaconnectedgraphGavertexvisacut-vertexifandonlyifthereexisttwo(ormore)edgesxandyincidentonvsuchthatnocircuitinGincludesbothxandy.

4-11. Provethateveryconnectedgraphwiththreeormoreverticeshasatleasttwoverticeswhicharenotcut-vertices.

4-12. Prove that a nonseparable graph has a nullityµ = 1 if and only if thegraphisacircuit.

4-13. ShowthatagraphGisnonseparableifandonlyifeveryvertexpairinGcanbeplacedinsomecircuitinG.

4-14. Showthatasimplegraphisnonseparableifandonlyifforanytwogivenarbitraryedgesacircuitcanalwaysbefoundthatwillincludethesetwoedges.

4-15. HowcanyouutilizetheresultofProblem4-13toobtainanalgorithmforidentifyingeveryblockofalargeseparablegraph?

4-16. What is a necessary and sufficient condition that any n − 1 cutsets inProblem4-8constituteasetoffundamentalcutsetsinG?

4-17. ProveTheorem4-7.4-18. Prove that in a tree every vertex of degree greater than one is a cut-

vertex.4-19. Show that a graphwithn vertices andwithvertex connectivitykmust

haveatleastkn/2edges.(Aspecialcaseofthisresultisthatthedegreeofeveryvertexinanonseparablegraphisatleasttwo.)

4-20. Is every regular graph of degreed(d ≥ 3) nonseparable? If not, give asimpleregulargraphofdegreethreethatisseparable.

4-21. CompletetheproofofTheorem4-10.4-22.InaconnectedgraphG, letQbeasetofedgeswiththefollowingproperties:(a)Q has an even number (zero included) of edges in common witheverycut-setofG.

(b)ThereisnopropersubsetofQthatsatisfiesproperty(a).ProvethatQisacircuit.

Page 117: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

4-23. ConstructagraphGwiththefollowingproperties:EdgeconnectivityofG=4,vertexconnectivityofG=3,anddegreeofeveryvertexofG≥5.

4-24. Show (by drawing them) that two graphs with the same rank and thesamenullityneednotbe2-isomorphic.

4-25. InFig.4-7,betweenverticesAandM,pickoutacompletesetof(a)Edge-disjointpaths.(b)Vertex-disjointpaths.Fromthis,verifyTheorems4-11and4-12.

4-26. Suppose that a singles tennis tournament is to be arranged among nplayersandthenumberofmatchesplannedisafixednumbere(wheren−1<e<n(n− l)/2).For thesakeoffairness,howwillyoumakesurethat someplayersdonot group together and isolate an individual (or asmallgroupofplayers)?

4-27. Let us define a new term called edge isomorphism as follows: Twographs G1 and G2 are edge isomorphic if there is a one-to-onecorrespondencebetweentheedgesofG1andG2suchthattwoedgesareincident (at a common vertex) inG1 if and only if the correspondingedges are also incident in G2. Discuss the properties of edgeisomorphism. Construct an example to prove that edge-isomorphicgraphsmaynotbeisomorphic.

4-28. ProvethatanEulergraphcannothaveacut-setwithanoddnumberofedges.(Hint:UseTheorem1-1.)

†Sinceasetofedges(togetherwiththeirendvertices)constitutesasubgraph,acutsetinGisasubgraphofG.†AsinChapter3,N(g)standsforthenumberofedgesinsubgraphg.†Althoughwe shall talk of edge connectivity and vertex connectivity only for a connected graph, someauthorsdefineboththeedgeconnectivityandvertexconnectivityofadisconnectedgraphaszero.† Recall that removal of a vertex implies the removal of all the edges incident on that vertex, becausewithoutboththeendverticesanedgedoesnotexist.Ontheotherhand,whenwedeleteorremoveanedgefromagraph,theendverticesoftheedgearestillleftinthegraph.‡Seethefootnoteonp.75.†Paths with no common vertices, except the two terminal vertices, are called nonintersecting paths orvertex-disjointpaths.

Page 118: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

5PLANARANDDUALGRAPHS

In Chapters 2, 3, and 4 we studied properties of subgraphs, such as paths,circuits, spanning trees, and cut-sets, in a given connected graph G. In thischapterweshallsubjecttheentiregraphGtothefollowingimportantquestion:IsitpossibletodrawGinaplanewithoutitsedgescrossingover?Thisquestionofplanarity isofgreatsignificancefroma theoreticalpointof

view. In addition, planarity and other related concepts are useful in manypractical situations. For instance. in the design of a printed-circuit board, theelectricalengineermustknowifhecanmaketherequiredconnectionswithoutanextralayerofinsulation.Thesolutiontothepuzzleofthreeutilities,posedinChapter 1, requires the knowledge ofwhether or not the corresponding graphcanbedrawninaplane.Butbeforeweattempttodrawagraphinaplane,letusexaminethemeaning

of“drawing”agraph.

5-1. COMBINATORIALVERSUSGEOMETRICGRAPHS

AsmentionedinChapter1,agraphexistsasanabstractobject,devoidofanygeometric connotation of its ability of being drawn in a three-dimensionalEuclideanspace.Forexample,anabstractgraphG1canbedefinedas

G1=(V,E,Ψ)

wherethesetVconsistsofthefiveobjectsnameda,b,c,d,ande,thatis,

V={a,b,c,d,e},

andthesetEconsistsofsevenobjects(noneofwhichisinsetV)named1,2,3,4,5,6,and7,thatis,

Page 119: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

E={1,2,3,4,5,6,7},

and the relationshipbetween the two sets isdefinedby themappingΨ,whichconsistsof

Here, the symbol1→(a,c) says thatobject1 fromsetE ismappedonto the(unordered)pair(a,c)ofobjectsfromsetV.Now it so happens that this combinatorial abstract object G1 can also be

representedbymeansof ageometric figure. In fact, the sketch inFig.2-13 isone such geometric representation of this graph.Moreover, it is also true thatany graph can be represented by means of such a configuration in three-dimensionalEuclideanspace.ItisimportanttorealizethatwhatissketchedinFig.2-13ismerelyone(out

of infinitelymany) representationof thegraphG1 andnot thegraphG1 itself.Wecouldhave,for instance, twistedsomeoftheedgesorcouldhaveplacedewithinthetrianglea,d,bandtherebyobtainedadifferentfigurerepresentingG1.However,whenthereisnochanceofconfusion,apictorialrepresentationofthegraphhasbeenandwillberegardedasthegraphitself.This convenient slurringover is donedeliberately for the sakeof simplicity

andclarity.Learninggraphtheoryforthefirsttimewithoutanydiagramswouldbeextremelydifficultandlittlefun.†Unlike in the last four chapters, in this chapter itwill oftenbenecessary to

makeadistinctionbetweentheabstract(orcombinatorial)graphandageometricrepresentationofagraph.

5-2. PLANARGRAPHS

AgraphGissaidtobeplanarifthereexistssomegeometricrepresentationof

Page 120: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Gwhich can be drawn on a plane such that no two of its edges intersect.†Agraphthatcannotbedrawnonaplanewithoutacrossoverbetweenitsedgesiscallednonplanar.Adrawingofageometricrepresentationofagraphonanysurfacesuchthat

no edges intersect is called embedding. Thus, to declare that a graph G isnonplanar,wehavetoshowthatofallpossiblegeometricrepresentationsofGnonecanbeembeddedinaplane.Equivalently,ageometricgraphGisplanarifthereexistsagraphisomorphictoGthatisembeddedinaplane.Otherwise,Gisnonplanar. An embedding of a planar graph G on a plane is called a planerepresentationofG.For instance, consider the graph represented by Fig. 1-3. The geometric

representationshowninFig.1-3clearlyisnotembeddedinaplane,becausetheedgeseandfareintersecting.Butifweredrawedgefoutsidethequadrilateral,leavingtheotheredgesunchanged,wehaveembeddedthenewgeometricgraphintheplane,thusshowingthatthegraphwhichisbeingrepresentedbyFig.1-3is planar. As another example, the two isomorphic diagrams in Fig. 2-2 aredifferent geometric representations of one and the same graph. One of thediagramsisaplanerepresentation;theotheroneisnot.Thegraph,ofcourse,isplanar. On the other hand, you will not be able to draw any of the threeconfigurations inFig.2-3onaplanewithoutedges intersecting.The reason isthat the graph which these three different diagrams in Fig. 2-3 represent isnonplanar.Anaturalquestionnowis:HowcanwetellifagraphG[whichmaybegiven

byanabstractnotationG=(V,E,Ψ)orbyoneofitsgeometricrepresentations]isplanarornonplanar?Toanswerthisquestion,letusfirstdiscusstwospecificnonplanar graphs which are of fundamental importance. These are calledKuratowski’sgraphs, after thePolishmathematicianKasimirKuratowski,whodiscoveredtheiruniqueproperty.

5-3. KURATOWSKI’STWOGRAPHS

THEOREM5-1

Thecompletegraphoffiveverticesisnonplanar.

Proof:Letthefiveverticesinthecompletegraphbenamedv1v2,v3,v4,andv5.Acompletegraph,asyoumayrecall,isasimplegraphinwhicheveryvertexisjoinedtoeveryothervertexbymeansofanedge.Thisbeingthecase,wemust

Page 121: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.5-1Buildingupofthefive-vertexcompletegraph.

haveacircuitgoingfromv1tov2tov3tov4tov5tov1—thatis,apentagon.SeeFig.5-1(a).Thispentagonmustdividetheplaneof thepaper intotworegions,oneinsideandtheotheroutside(Jordancurvetheorem).Sincevertexv1istobeconnectedtov3bymeansofanedge,thisedgemaybe

drawninsideoroutsidethepentagon(withoutintersectingthefiveedgesdrawnpreviously). Suppose that we choose to draw a line from v1 to v3 inside thepentagon. See Fig. 5-1(b). (If we choose outside, we end up with the sameargument.)Nowwehavetodrawanedgefromv2tov4andanotheronefromv2to v5. Since neither of these edges can be drawn inside the pentagonwithoutcrossing over the edge already drawn, we draw both these edges outside thepentagon. See Fig. 5-1(c). The edge connecting v3 and v5 cannot be drawn

Page 122: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

outsidethepentagonwithoutcrossingtheedgebetweenv2andv4.Therefore,v3andv5havetobeconnectedwithanedgeinsidethepentagon.SeeFig.5-1(d).Nowwe have yet to draw an edge betweenv1 andv4. This edge cannot be

placedinsideoroutsidethepentagonwithoutacrossover.Thusthegraphcannotbeembeddedinaplane.SeeFig.5-1(e).

Somereadersmayfindthisproofsomewhatunsatisfactorybecauseitdependsso heavily on visual intuition. Do not despair; we shall provide you with analgebraicnonvisualproofinthenextsection.A complete graph with five vertices is the first of the two graphs of

Kuratowski.ThesecondgraphofKuratowskiisaregular†connectedgraphwithsixverticesandnineedges,showninitstwocommongeometricrepresentationsin Figs. 5-2(a) and (b), where it is fairly easy to see that the graphs areisomorphic.Employing visual geometric arguments similar to those used in proving

Theorem 5-1, it can be shown that the second graph of Kuratowski is alsononplanar.TheproofofTheorem5-2is,therefore,leftasanexercise(Problem5-1).

Fig.5-2Kuratowski’ssecondgraph.

THEOREM5-2

Kuratowski’ssecondgraphisalsononplanar.

You may have noticed several properties common to the two graphs ofKuratowski.Theseare

1. Bothareregulargraphs.

2. Botharenonplanar.

Page 123: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

3. Removalofoneedgeoravertexmakeseachaplanargraph.

4. Kuratowski’s firstgraph is thenonplanargraphwith thesmallestnumberofvertices,andKuratowski’ssecondgraphisthenonplanargraphwiththesmallestnumberofedges.Thusbotharethesimplestnonplanargraphs.

In the literature, Kuratowski’s first graph is usually denoted by K5 and thesecondgraphbyK3.3—letterKbeingforKuratowski.

5-4. DIFFERENTREPRESENTATIONSOFAPLANARGRAPH

InfollowingtheproofofTheorem5-1,itmayhaveappearedthatone’sabilitytodrawaplanargraphinaplanedependedonhisabilitytodrawmanycrookedlinesthroughdeviousroutes.Thisisnotthecase.Thefollowingimportantandsomewhat surprising result, due toFary, tells us that there is no need to bendedgesindrawingaplanargraphtoavoidedgeintersections.

THEOREM5-3

Anysimpleplanargraphcanbeembeddedinaplanesuchthateveryedgeisdrawnasastraightlinesegment.

Proof: The proof is involved and does not contribute much to theunderstandingofplanarity.Theinterestedreaderis,therefore,referredtopages74-77in[1-2]ortotheoriginalpaperofFary[5-4].Asanillustration,thegraphinFig.5-1(d)canberedrawnusingstraightlinesegmentstolooklikeFig.5-3.Inthistheorem,itisnecessaryforthegraphtobesimplebecauseaself-looporoneoftwoparalleledgescannotbedrawnbyastraightlinesegment.

Region:Aplanerepresentationofagraphdividestheplaneintoregions(alsocalledwindows,faces,ormeshes),asshowninFig.5-4.Aregionis

Page 124: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.5-3Straight-linerepresentationofthegraphinFig.5-1(d).

Fig.5-4Planerepresentation(thenumbersstandforregions).

characterizedby the setofedges (or the setofvertices) forming itsboundary.Notethataregionisnotdefinedinanonplanargraphoreveninaplanargraphnotembeddedinaplane.Forexample,thegeometricgraphinFig.1-3doesnothaveregions.Thusaregionisapropertyofthespecificplanerepresentationofagraphandnotofanabstractgraphperse.

InfiniteRegion:Theportionoftheplanelyingoutsideagraphembeddedinaplane,suchasregion4inFig.5-4,isinfiniteinitsextent.Sucharegioniscalledthe infinite, unbounded, outer, or exterior region for that particular planerepresentation.Likeotherregions, the infiniteregion isalsocharacterizedbyasetofedges(orvertices).Clearly,bychangingtheembeddingofagivenplanargraph,wecanchangetheinfiniteregion.Forinstance,Figs.5-1(d)and5-3aretwodifferentembeddingsofthesamegraph.Thefiniteregionv1v3v5inFig.5-1(d)becomestheinfiniteregioninFig.5-3.Infact,weshallshortlyshowthatanyregioncanbemadetheinfiniteregionbyproperembedding.

Page 125: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Embedding on a Sphere: To eliminate the distinction between finite andinfiniteregions,aplanargraphisoftenembeddedinthesurfaceofasphere.Itisaccomplishedbystereographicprojectionofasphereonaplane.Putthesphereontheplaneandcall thepointofcontactSP(southpole).AtpointSP,drawastraight line perpendicular to the plane, and let the point where this lineintersectsthesurfaceofthespherebecalledNP(northpole).SeeFig.5-5.Now,correspondingtoanypointpontheplane,thereexistsauniquepointp′

onthesphereandviceversa,wherep′isthepointatwhichthestraightlinefrompointp topointNPintersectsthesurfaceofthesphere.Thusthereisaone-to-onecorrespondencebetweenthepointsofthesphereandthefinitepointsontheplane, and points at infinity in the plane correspond to the point NP on thesphere.Fromthisconstruction,itisclearthatanygraphthatcanbeembeddedinaplane(i.e.,drawnonaplanesuchthatitsedgesdonotintersect)canalsobeembeddedinthesurfaceofthesphere,andviceversa.Hence

Fig.5-5Stereographicprojection.

THEOREM5-4

Agraphcanbeembedded in thesurfaceofasphere ifandonly if itcanbeembeddedinaplane.

Aplanargraphembedded in thesurfaceofaspheredivides thesurface intodifferent regions.Eachregionon thesphere is finite, the infinite regionon theplanehavingbeenmappedonto the region containing thepointNP.Now it isclearthatbysuitablyrotatingthespherewecanmakeanyspecifiedregionmapontotheinfiniteregionontheplane.Fromthisweobtain

Page 126: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

THEOREM5-5

Aplanar graphmaybe embedded in a plane such that any specified region(i.e.,specifiedbytheedgesformingit)canbemadetheinfiniteregion.

Thinking in termsof the regions on the sphere,we see that there is no realdifference between the infinite region and the finite regions on the plane.Therefore,whenwetalkoftheregionsinaplaneregresentationofagraph,weincludetheinfiniteregion.Also,sincethereisnoessentialdifferencebetweenanembeddingofaplanargraphonaplaneoronasphere(aplanemayberegardedas the surface of a sphere of infinitely large radius), the term “planerepresentation” of a graph is often used to include spherical aswell as planarembedding.

Euler’s Formula: Since a planar graph may have different planerepresentations, we may ask if the number of regions resulting from eachembedding is the same. The answer is yes. Theorem 5-6, known as Euler’sformula,givesthenumberofregionsinanyplanargraph.

THEOREM5-6

Aconnectedplanargraphwithnverticesandeedgeshase−n+2regions.

Proof:Itwillsufficetoprovethetheoremforasimplegraph,becauseaddinga self-loop or a parallel edge simply adds one region to the graph andsimultaneously increases the value of e by one. We can also disregard (i.e.,remove)alledgesthatdonotformboundariesofanyregion.Threesuchedgesare shown in Fig. 5-4. Addition (or removal) of any such edge increases (ordecreases)ebyoneandincreases(ordecreases)nbyone,keepingthequantitye−nunaltered.Sinceanysimpleplanargraphcanhaveaplanerepresentationsuchthateach

edgeisastraight line(Theorem5-3),anyplanargraphcanbedrawnsuchthateach region is apolygon (apolygonalnet).Let thepolygonalnet representingthegivengraphconsistoffregionsorfaces,andletkpbethenumberofp-sidedregions.Sinceeachedgeisontheboundaryofexactlytworegions,

wherekristhenumberofpolygons,withmaximumedges.Also.

Thesumofallanglessubtendedateachvertexinthepolygonalnetis

Page 127: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Recallingthatthesumofallinterioranglesofap-sidedpolygonisπ(p−2),andthesumoftheexterioranglesisπ(p+2),letuscomputetheexpressionin(5-3)asthegrandsumofallinterioranglesoff−1finiteregionsplusthesumoftheexterioranglesofthepolygondefiningtheinfiniteregion.Thissumis

Equating(5-4)to(5-3),weget

2π(e−f)+4π=2πn,or e−f+2=n.

Therefore,thenumberofregionsis

f=e−n+2.

COROLLARY

Inanysimple,connectedplanargraphwithfregions,nvertices,andeedges(e>2),thefollowinginequalitiesmusthold:

Proof: Since each region is bounded by at least three edges and each edgebelongstoexactlytworegions,

SubstitutingforffromEuler’sformulaininequality(5-5),

Inequality (5-6) is often useful in finding out if a graph is nonplanar. For

Page 128: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

example,inthecaseofK5,thecompletegraphoffivevertices[Fig.5-1(e)],

n=5, e=10, 3n−6=9<e.

Thusthegraphviolatesinequality(5-6),andhenceitisnotplanar.Incidentally,thisisanalternativeandindependentproofofthenonplanarityof

Kuratowski’sfirstgraph,aspromisedinSection5-3.Thereadermustbewarnedthatinequality(5-6)isonlyanecessary,butnota

sufficient,conditionfortheplanarityofagraph.Inotherwords,althougheverysimple planar graphmust satisfy (5-6), themere satisfaction of this inequalitydoesnotguaranteetheplanarityofagraph.Forexample,Kuratowski’ssecondgraph,K3.3,satisfies(5-6),because

e=93n−6=3·6−6=12.

Yetthegraphisnonplanar.ToprovethenonplanarityofKuratowski’ssecondgraph,wemakeuseofthe

additionalfactthatnoregioninthisgraphcanbeboundedwithfewerthanfouredges.Hence,ifthisgraphwereplanar,wewouldhave

2e≥4f,and,substitutingforffromEuler’sformula,

2e≥4(e−n+2),

or 2·9≥4(9−6+2),

or 18≥20,acontradiction.

Hencethegraphcannotbeplanar.

Plane Representation and Connectivity: In a disconnected graph theembeddingofeachcomponentcanbeconsideredindependently.Therefore,itisclearthatadisconnectedgraphisplanarifandonlyifeachofitscomponentsisplanar.Similarly, inaseparable(or1-connected)graphtheembeddingofeachblock (i.e.,maximal nonseparable subgraph) can be considered independently.Henceaseparablegraphisplanarifandonlyifeachofitsblocksisplanar.Therefore, in questions of embedding or planarity, one need consider only

nonseparablegraphs.DoesanonseparableplanargraphGhaveauniqueembeddingonasphere?

Before answering this question, we must define the meaning of unique

Page 129: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

embedding.Twoembeddingsofaplanargraphonspheresarenotdistinctiftheembeddingscanbemadetocoincidebysuitablyrotatingonespherewithrespectto the other and possibly distorting regions (without letting a vertex cross anedge).Ifofallpossibleembeddingsonaspherenotwoaredistinct,thegraphissaidtohaveauniqueembeddingonasphere(orauniqueplanerepresentation).For example, consider two embeddings of the same graph in Fig. 5-6. The

embedding(b)hasaregionboundedwithfiveedges,butembedding(a)hasnoregionwithfiveedges.Thus,rotatingthetwospheresonwhich(a)and(b)areembeddedwillnotmakethemcoincide.Hencethetwoembeddingsaredistinct,andthegraphhasnouniqueplanerepresentation.Ontheotherhand,theembeddingsinFigs.5-1(d)and5-3,whenconsidered

onasphere,canbemadetocoincide.(Rememberthatedgescanbebent,andinasphericalembeddingthereisnoinfiniteregion.)Theorem5-7,duetoWhitney,tellsusexactlywhenagraphisuniquelyembeddableinasphere.Foraproofofthetheorem,thereaderisreferredto[5-9].

THEOREM5-7

Thesphericalembeddingofeveryplanar3-connectedgraphisunique.

Thistheoremplaysaveryimportantroleindeterminingifagraphisplanarornot.The theoremstates thata3-connectedgraph, if it canbeembeddedatall,canbeembeddedinonlyoneway.

Fig.5-6Twodistinctplanerepresentationsofthesamegraph.

5-5. DETECTIONOFPLANARITY

HowtotellifagivengraphGisplanarornonplanarisanimportantproblem,and “find out by drawing it” is obviously not a good answer.Wemust have

Page 130: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

some simple and efficient criterion. Toward that goal, we take the followingsimplifyingsteps:

ElementaryReduction

Step 1: Since a disconnected graph is planar if and only if each of itscomponentsisplanar,weneedconsideronlyonecomponentatatime.Also,aseparablegraphisplanarifandonlyifeachofitsblocksisplanar.Therefore,forthegivenarbitrarygraphG,determinetheset

G={G1,G2,...,Gk},

whereeachGi isanonseparableblockofG.Thenwehave to testeachGi forplanarity.

Step 2: Since addition or removal of self-loops does not affect planarity,removeallself-loops.

Step 3: Since parallel edges also do not affect planarity, eliminate edges inparallelbyremovingallbutoneedgebetweeneverypairofvertices.

Step4:Eliminationofavertexofdegreetwobymergingtwoedgesinseries†doesnotaffectplanarity.Therefore,eliminatealledgesinseries.Repeatedapplicationofsteps3and4willusuallyreduceagraphdrastically.

Forexample,Fig.5-7illustratestheseries-parallelreductionofthegraphofFig.5-6(b).LetthenonseparableconnectedgraphGibereducedtoanewgraphHiafter

therepeatedapplicationofsteps3and4.WhatwillgraphHilooklike?Theorem5-8hastheanswer.

THEOREM5-8

GraphHiis

1. Asingleedge,or

2. Acompletegraphoffourvertices,or

3. Anonseparable,simplegraphwithn≥5ande≥7.

Page 131: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.5-7Series-parallelreductionofthegraphinFig.5-6(b).

Proof:Thetheoremcanbeprovedbyconsideringallconnectednonseparablegraphsofsixedgesorless.Theproofisleftasanexercise(Problem5-9).

InTheorem5-8,allHifallingincategories1or2areplanarandneednotbecheckedfurther.From now on, therefore, we need to investigate only simple, connected,

nonseparable graphs of at least five vertices and with every vertex of degreethreeormore.Next,wecanchecktoseeife≤3n−6.Ifthisinequalityisnotsatisfied,thegraphHiisnonplanar.Iftheinequalityissatisfied,wehavetotestthegraphfurtherand,withthis,wecometoKuratowski’stheorem(Theorem5-9),perhapsthemostimportantresultofthischapter.

Homeomorphic Graphs: Two graphs are said to be homeomorphic if onegraphcanbeobtainedfromtheotherbythecreationofedgesinseries(i.e.,byinsertionofverticesofdegreetwo)orbythemergerofedgesinseries.Thethreegraphs inFig.5-8arehomeomorphic toeachother, for instance.AgraphG isplanarifandonlyifeverygraphthatishomeomorphictoGisplanar.(Thisisarestatementofseriesreduction,step4inthissection.)

Page 132: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

THEOREM5-9

AnecessaryandsufficientconditionforagraphGtobeplanaristhatGdoesnot contain either ofKuratowski’s two graphs or any graph homeomorphic toeitherofthem.

Fig.5-8Threegraphshomeomorphictoeachother.

Proof: The necessary condition is clear, because a graph G cannot beembedded in a plane ifG has a subgraph that cannot be embedded. That thiscondition is also sufficient is surprising, and its proof is involved. Severaldifferent proofs of the theorem have appeared since Kuratowski stated andproveditin1930.Foracompleteproofofthetheorem,thereaderisreferredtoHarary [1-5], pages 108–112, Berge [1-1], pages 211-213, or Busacker andSaaty[1-2],pages70-73.

Note that it is not necessary for a nonplanar graph to have either of theKuratowskigraphsasasubgraph,as this theorem issometimesmisstated.Thenonplanar graphmay have a subgraph homeomorphic to aKuratowski graph.Forexample,thegraphinFig.5-9(a)isnonplanar,andyetitdoesnothaveeitheroftheKuratowskigraphsasasubgraph.However,ifweremoveedges(a,x)and(A, C) from this graph, we get a subgraph, as shown in Fig. 5-9(b). Thissubgraph is homeomorphic (merge two series edges at vertex x) to the oneshown in Fig. 5-9(c). The graph of Fig. 5-9(c) clearly is isomorphic toK3,3,Kuratowski’ssecondgraph,andthisdemonstratesthenonplanarityofthegraphinFig.5-9(a).

Page 133: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.5-9NonplanargraphwithasubgraphhomeomorphictoK3,3.

The example just discussed also points out that although Theorem 5-9(Kuratowski’s theorem) gives an elegant and simple-looking criterion forplanarityofagraph, the theorem isdifficult toapply in theactual testingofalarge graph (say, a simple, nonseparable graph of 25 vertices, each of degreethreeormore).Therehavebeenseveralalternativecharacterizationsofaplanargraph. One of these characterizations, the existence of a dual graph, is thesubjectofthenexttwosections.

5-6. GEOMETRICDUAL

ConsidertheplanerepresentationofagraphinFig.5-10(a),withsixregionsorfacesF1,F2,F3,F4,F5,andF6,Letusplacesixpointsp1,p2,...,p6,oneineachof the regions,asshown inFig.5-10(b).Next letus join thesesixpointsaccordingtothefollowingprocedure:

Page 134: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.5-10Constructionofadualgraph.

IftworegionsFiandFjareadjacent(i.e.,haveacommonedge),drawalinejoining points pi and pj that intersects the common edge between Fi and Fjexactlyonce. If there ismore thanoneedgecommonbetweenFiandFj,drawonelinebetweenpointspiandpjforeachofthecommonedges.Foranedgeelyingentirely inone region, sayFk, drawa self-loopatpointpk intersectingeexactlyonce.BythisprocedureweobtainanewgraphG*[inbrokenlinesinFig.5-10(c)]

consisting of six vertices,p1,p2, . . . ,p6 and of edges joining these vertices.SuchagraphG*iscalledadual(orstrictlyspeaking,ageometricdual)ofG.Clearly, there isaone-to-onecorrespondencebetween theedgesofgraphG

and its dual G*−one edge of G* intersecting one edge of G. Some simpleobservationsthatcanbemadeabouttherelationshipbetweenaplanargraphGanditsdualG*are

1. Anedgeformingaself-loopinGyieldsapendantedge†inG*.

2. ApendantedgeinGyieldsaself-loopinG*.

3. EdgesthatareinseriesinGproduceparalleledgesinG*.

4. ParalleledgesinGproduceedgesinseriesinG*.

Page 135: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

5. Remarks1-4 are the result of thegeneral observation that thenumberofedgesconstitutingtheboundaryofaregionFiinGisequaltothedegreeofthecorrespondingvertexpiinG*,andviceversa.

6. GraphG*isalsoembeddedintheplaneandisthereforeplanar.

7. ConsideringtheprocessofdrawingadualG*fromG,itisevidentthatGisadualofG*[seeFig.5-10(c)].Therefore,insteadofcallingG*adualofG,weusuallysaythatGandG*aredualgraphs.

8. Ifn,e,f,r,andµdenoteasusualthenumbersofvertices,edges,regions,rank,andnullityofaconnectedplanargraphG,andifn*,e*, f*,r*,andµ*arethecorrespondingnumbersindualgraphG*,then

n*=f,

e*=e,

f*=n.

Usingtheaboverelationship,onecanimmediatelyget

r*=µ,

µ*=r.UniquenessofDualGraphs: Isa (geometric)dualofagraphunique? Inotherwords, are all duals of a given graph isomorphic? From the method ofconstructingadual,itisreasonabletoexpectthataplanargraphGwillhaveaunique dual if and only if it has a unique plane representation or uniqueembeddingonasphere.

Fig.5-11DualsofgraphsinFig.5-6.

Page 136: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

For instance, in Fig. 5-6 the same graph (isomorphic) had two distinctembeddings,(a)and(b).Consequently,thedualsoftheseisomorphicgraphsarenonisomorphic,asshowninFig.5-11.The graphs in Fig. 5-11, however, are 2-isomorphic. Theorem 5-10, stated

withoutproof,isageneralizationofthisexample.

THEOREM5-10

AlldualsofaplanargraphGare2-isomorphic;andeverygraph2-isomorphictoadualofGisalsoadualofG.

Withthisqualificationinmind,itisquiteappropriatetorefertoadualasthedualofaplanargraph.Sincea3-connectedplanargraphhasauniqueembeddingonasphere,itsdual

must also be unique. In other words, all duals of a 3-connected graph areisomorphic.

5-7. COMBINATORIALDUAL

So far we have defined and discussed duality of planar graphs in a purelygeometric sense. The following provides us with an equivalent definition ofdualityindependentofgeometricnotions.

THEOREM5-11

Anecessaryandsufficient condition for twoplanargraphsG1 andG2 tobedualsofeachotherisasfollows:Thereisaone-to-onecorrespondencebetweentheedgesinG1andtheedgesinG2suchthatasetofedgesinG1formsacircuitifandonlyifthecorrespondingsetinG2formsacut-set.

Proof:LetusconsideraplanerepresentationofaplanargraphG.Letusalsodraw(geometrically)adualG*ofG.ThenconsideranarbitrarycircuitTinG.Clearly,TwillformsomeclosedsimplecurveintheplanerepresentationofG−dividingtheplaneintotwoareas.(JordanCurveTheorem).ThustheverticesofG*arepartitionedintotwononempty,mutuallyexclusivesubsets−oneinsideTandtheotheroutside.Inotherwords,thesetofedgesΓ*inG*correspondingtothesetΓinGisacut-setinG*.(NopropersubsetofΓ*willbeacut-setinG*;why?).Likewiseitisapparentthatcorrespondingtoacut-setS*inG*thereisauniquecircuit consistingof thecorrespondingedge-setS inG such thatS is a

Page 137: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

circuit.ThisprovesthenecessityportionofTheorem5-11.Toprove the sufficiency, letG be a planar graph and letG’ be a graph for

which there is a one-to-one correspondence between the cut-sets of G andcircuitsofG′,andviceversa.LetG*beadualgraphofG.Thereisaone-to-onecorrespondencebetween thecircuitsofG′ andcut-setsofG, andalsobetweenthe cut-sets of G and circuits of G*. Therefore there is a one-to-onecorrespondencebetweenthecircuitsofG′andG*,implyingthatG′andG*are2-isomorphic(Theorem4-15).AccordingtoTheorem5-10,G′mustbeadualofG

DualofaSubgraph:LetGbeaplanargraphandG*beitsdual.LetabeanedgeinG,andthecorrespondingedgeinG*bea*.SupposethatwedeleteedgeafromGandthentrytofindthedualofG−a.Ifedgeawasontheboundaryoftworegions,removalofawouldmergethesetworegionsintoone.Thusthedual(G−a)*canbeobtained fromG*bydeleting thecorrespondingedgea*andthenfusingthetwoendverticesofa*inG*−a*.Ontheotherhand,ifedgeaisnotontheboundary,a*formsaself-loop.InthatcaseG*−a*isthesameas(G−a)*.Thus ifagraphGhasadualG*, thedualofanysubgraphofGcanbeobtainedbysuccessiveapplicationofthisprocedure.

DualofaHomeomorphicGraph:LetGbeaplanargraphandG*beitsdual.LetabeanedgeinG,andthecorrespondingedgeinG*bea*.SupposethatwecreateanadditionalvertexinGbyintroducingavertexofdegreetwoinedgea(i.e.,anowbecomestwoedgesinseries).Howwillthisadditionaffectthedual?Itwillsimplyaddanedgeparalleltoa*inG*.Likewise,thereverseprocessofmergingtwoedgesinseries(step4inSection5-5)willsimplyeliminateoneofthecorrespondingparalleledgesinG*.ThusifagraphGhasadualG*,thedualof any graph homeomorphic to G can be obtained from G* by the aboveprocedure.Sofarwehavebeenstudyingdualityforplanargraphsonly.Thiswasforced

upon us because the very definition of duality depended on the graph beingembedded in a plane. However, now that Theorem 5-11 provides us with anequivalent abstract definition of duality (namely, the correspondence betweencircuits and cut-sets), which does not depend on a plane representation of agraph,wewillseeiftheconceptofdualitycanbeextendedtononplanargraphsalso.Inotherwords,givenanonplanargraphG,canwefindanothergraphG′withone-to-onecorrespondencebetweentheiredgessuchthateverycircuitinGcorresponds to a unique cut-set in G′, and vice versa? The answer to thisquestionisno,asshowninthefollowingimportanttheorem,duetoWhitney.

Page 138: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

THEOREM5-12

Agraphhasadualifandonlyifitisplanar.

Proof:Weneedprovejustthe“onlyif”part.Thatis,wehaveonlytoprovethatanonplanargraphdoesnothaveadual.LetGbeanonplanargraph.Thenaccording to Kuratowski’s theorem, G contains K5 or K3,3 or a graphhomeomorphictoeitherofthese.WehavealreadyseenthatagraphGcanhaveadualonlyifeverysubgraphgofGandeverygraphhomeomorphictoghasadual.ThusifwecanshowthatneitherK5norK3,3hasadual,wehaveprovedthetheorem.Thisweshallprovebycontradictionasfollows:(a)SupposethatK3,3hasadualD.Observethatthecut-setsinK3.3correspond

to circuits in D and vice versa (Theorem 5-10). Since K3.3 has no cut-setconsisting of two edges,D has no circuit consisting of two edges. That is,Dcontainsnopairofparalleledges.SinceeverycircuitinK3.3isoflengthfourorsix,Dhasnocut-setwith less than fouredges.Therefore, thedegreeofeveryvertexinDisatleastfour.AsDhasnoparalleledgesandthedegreeofeveryvertexisatleastfour,Dmusthaveatleastfiveverticeseachofdegreefourormore.Thatis,Dmusthaveatleast(5x4)/2=10edges.Thisisacontradiction,becauseK3,3hasnineedgesandsomustitsdual.ThusK3,3cannothaveadual.Likewise,(b)SupposethatthegraphK5hasadualH.NotethatK5has(1)10edges,(2)

no pair of parallel edges, (3) no cut-setwith two edges, and (4) cut-setswithonly fouror sixedges.Consequently,graphHmusthave (1)10edges, (2)novertexwithdegreelessthanthree,(3)nopairofparalleledges,and(4)circuitsoflengthfourandsixonly.NowgraphHcontainsahexagon(acircuitoflengthsix),andnomorethanthreeedgescanbeaddedtoahexagonwithoutcreatingacircuitoflengththreeorapairofparalleledges[seeFig.5-2(b)].Sincebothofthese are forbidden in H and H has 10 edges, there must be at least sevenverticesinH.Thedegreeofeachoftheseverticesisatleastthree.ThisleadstoHhavingatleast11edges.Acontradiction.

This proof of theorem 5-12 is not the one originally given by Whitney.Whitney’s proof, thoughmore rigorous, ismuchmore involved.Our proof isbasedononegivenbyParson[5-7].Thereisyetanotherequivalentcombinatorialdefinitionofduality,alsogiven

byWhitneyandprovedequivalenttotheearliertwodefinitions[5-10].TwoplanargraphsGandG*aresaidtobeduals(orcombinatorialduals)of

Page 139: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

eachother if there isaone-to-onecorrespondencebetweentheedgesofGandG*suchthat ifg isanysubgraphofGandh is thecorrespondingsubgraphofG*,then

ThisrelationshipisshowndiagrammaticallyinFig.5-12.

Fig.5-12Combinatorialduals.Asanexample,considerthegraphinFig.5-6(a)anditsdualinFig.5-11(a).

Takethesubgraph{e4,e5,e6,e7}inFig.5-6(a)andthecorrespondingsubgraphinFig.5-11(a).

and

2=3−1.

Clearly,thisdefinitionisalsoindependentofthegeometricconnotation.Itistherefore often preferred for proving results in purely algebraic fashion.However, in deciding whether or not two given graphs are dual thecombinatorialdefinitionsaredifficulttouse.The proof of equivalence of combinatorial and geometric duals is quite

involved.TheinterestedreaderisreferredtotheoriginalpapersofWhitney[5-10, 5-12] or to Seshu andReed [1-13], pages 45-50. Since the geometric andcombinatorialdualsareoneandthesame,wesimplyrefertothemasthedual,ratherthanthegeometricorcombinatorialdual.

Page 140: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Self-Dual Graphs: If a planar graphG is isomorphic to its own dual, it iscalled a self-dual graph. It can be easily shown that the four-vertex completegraph is a self-dual graph (Problem 5-20). Self-dual graphs have interestingpropertiesandposesomeunsolvedproblems.

5-8. MOREONCRITERIAOFPLANARITY

Theorems 5-9 (Kuratowski’s theorem) and 5-12 (Whitney’s theorem)provided uswith twodifferent and alternativeways of characterizing a planargraph.Thethirdclassicplanaritycriterion,duetoMacLane[5-6],isgivennext.

SetofBasicCircuits:AsetCofcircuitsinagraphissaidtobeacompletesetofbasiccircuitsif(i)everycircuitinthegraphcanbeexpressedasaringsumofsomeorallcircuitsinC,and(ii)nocircuitinCcanbeexpressedasaringsumofothersinC.Thesignificanceofcompletesetsofbasiccircuitswillbeclearerin Chapter 6, in relation to the vector space of a graph. It may, however, bementionedherethatwhereasasetoffundamentalcircuits(asdefinedinChapter3 with respect to a spanning tree) always constitutes a complete set of basiccircuits,theconversedoesnotholdforallgraphs(Problem5-15).Inaplanargraphacompletesetofbasiccircuitshasanadditionalproperty,

whichwewillobservenext.In a plane representation of a planar, connected graphG the set of circuits

formingtheinteriorregionsconstitutesacompletesetofbasiccircuits.Foranycircuit Γ inG can be expressed as the ring sum of the circuits defining theregionscontainedinΓ.Observethateveryedgeappearsinatmosttwoofthesebasiccircuits.ThusforeveryplanargraphGwecanfindacompletesetofbasiccircuitssuchthatnoedgeappearsinmorethantwoofthesebasiccircuits.Thisresult and its converse (proof ofwhich can be found in [5-6]) lead to anotherwell-knowncharacterizationofplanargraphs.

THEOREM5-13

AgraphGisplanarifandonlyifthereexistsacompletesetofbasiccircuits(i.e.,allµofthem,µbeingthenullityofG)suchthatnoedgeappearsinmorethantwoofthesecircuits.

All three of these classic characterizations suffer from two shortcomings.First,theyareextremelydifficulttoimplementforalargegraph.Second,incasethegraphisplanartheydonotgiveaplanerepresentationofthegraph.

Page 141: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

These drawbacks have prompted recent discoveries of severalmapconstruction methods, where the testing of planarity itself is based on anattempttoproduceaplanerepresentationofthegraph.OnesuchmethodisgivenbyTutte[5-9].Severalotherconstructionmethods,someofthemquitesimilar,have been implemented on digital computers [5-2, 5-8]. In most of thesemethods, thegivengraph is first reduced tooneormoresimple,nonseparablegraphswitheveryvertexofdegreethreeormoreandwithe≤3n−6.Thentheconstruction algorithm is applied such that either one succeeds in obtaining aplanar realizationof thegraphor thegraph isnonplanar.MorewillbesaidonsuchalgorithmsinChapter11.Some algorithms are better than others, but all are laborious and time-

consuming.Thesearchforasimple,elegant,andpracticalcharacterizationofaplanargraphisfarfromover.

5-9. THICKNESSANDCROSSINGS

HavingfoundthatagivengraphG isnonplanar, it isnatural toask,what istheminimumnumberofplanesnecessaryforembeddingG?TheleastnumberofplanarsubgraphswhoseunionisthegivengraphGiscalledthethicknessofG.Inaprinted-circuitboard,forinstance,thenumberofinsulationlayersnecessaryisthethicknessofthecorrespondinggraph.Bydefinition, then, the thicknessof aplanargraph isone.The thicknessof

eachofKuratowski’sgraphsisclearlytwo.Thereadercanshow,bysketchingthem,thatthethicknessofthecompletegraphofeightverticesistwo,whilethethickness of the complete graph of nine vertices is three (Problem 5-19).Althoughthereareseveralresultsavailableonthethicknessofspecialtypesofgraphs [1-5, pages 120-121], the thickness of an arbitrary graph is in general,difficulttodetermine.Another question one might ask about a nonplanar graph is: What is the

fewestnumberof crossings (or intersections)necessary inorder to “draw” thegraphinaplane?Thecrossingnumberofaplanargraphis,bydefinition,zero,andofeitherof

Kuratowski’sgraphs,itisone.Thecrossingnumbersofonlyafewgraphshavebeendetermined.Noformulaexiststogivethecrossingnumberofanarbitrarygraph.

SUMMARY

Page 142: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Canagivengraphbeplacedinaplanewithoutitsedgescrossingover?Thisis clearly a geometric question about the graph−an object that exists in twodifferentworlds, purely combinatorial and purely geometric. To quoteHarary[1-5],page106,“oneofthemostfascinatingareasofstudy...istheinterplaybetween considering a graph as a combinatorial object and as a geometricfigure.”On probing a bit further, we discovered thatwe needed to investigate only

simple, nonseparable graphs which have no vertex of degree less than three.Moreover,wefoundthatanygraphwith thenumberofedgese>3n−6neednotbeinvestigatedanyfurther,becausesuchagraphisnonplanar.Three equivalent, but very different, planarity characterizations, those of

Kuratowski,Whitney,andMacLane,werepresentedandtheirsignificanceanddrawbacks discussed. For graphs that are nonplanar, additional relevantproperties, such as thickness and number of crossings, were defined anddiscussed.Therearemanyunsolvedproblemsinthisfieldofstudy.Becauseofthe current interest in such areas as automatic wiring of complex systems,technologyofprintedcircuits,anddesignoflarge-scaleintegratedcircuits,thesegeometricalpropertiesofgraphsareofpracticalimportance.Theexistenceofadualgraph, inaddition tobeingaconditionequivalent to

that of planarity, is important in its own right. The underlying structuralrelationshipbetweendualgraphsbecomesveryclearintermsofthevectorspaceofthegraph,asubjectforthenextchapter.

REFERENCES

Starting from Kuratowski’s celebrated paper in 1930, a large number ofpapersonplanarityofgraphshaveappeared.Anexcellentsurveyofthiswork,especially on characterization of planar graphs and practical methods ofembedding, isgiven in [5-8],whichalsocontains abibliographyof about120papersonthesubject.RecommendedreadingsfromtextbooksareHarary[1-5],Chapter11,SeshuandReed[1-13],Chapter3,Ore[1-10],Chapter8,Berge[1-1],Chapter21,andBusackerandSaaty [1-2],Chapter4.Bruno,Steiglitz,andWeinberg[5-2]giveanefficientcomputeralgorithmfortestingofplanarity,asdoesShirey [5-8].WorksofWhitney [5-10,5-11,5-12],MacLane [5-6],Fary[5-4], andTutte [5-9] have already been referred to earlier.More on self-dualgraphs can be found in [5-1] and [5-3]. A thorough survey on thickness ofgraphswith relevant references is tobe found in [5-5].Formoreoncomputer

Page 143: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

algorithmsforplanaritytesting,seeChapter11.

5-1. BENEDICT, C. P., “On Self-Dualism in Graphs and Networks,” Ph.D.Dissertation,UniversityofWaterloo,Waterloo,Canada1969.

5-2. BRUNO,J.,K.STEIGLITZ,andL.WEINBERG,“ANewPlanarityTestBasedon 3-Connectivity,” IEEE Trans. Circuit Theory, Vol. CT-17, No. 2,May1970,197–206.

5-3. DEO,N.,“Self-DualGraphsandDigraphs,”Proc.SixthAnnualAllertonConf.onCircuitandSystemTheory,Oct.1968,832–840.

5-4. FARY,I.,“OnStraightLineRepresentationofPlanarGraphs,”ActaSci.Math.Szeged,Vol.11,1948,229–233.

5-5. HOBBS, A. M., “A Survey of Thickness,” in Recent Progress inCombinatorics (W. T. Tuttle, ed.), Academic Press, Inc., New York,1969,255-264.

5-6. MACLANE, S., “A Combinatorial Condition for Planar Graphs,”Fund.Math.,Vol.28,1937,22–32.

5-7. PARSON,T.D.,“OnPlanarGraphs,”Am.Math.Monthly,Vol.78,No.2,1971,176-178.

5-8. SHIREY, R. W., “Implementation and Analysis of Efficient GraphPlanarity Testing Algorithms,” Ph.D. Dissertation, Computer Sciences,UniversityofWisconsin,Madison,Wisc.,1969.

5-9. TUTTE,W.T.,“HowtoDrawaGraph,”Proc.LondonMath.Soc.,Ser.3,Vol.13,1963,743–768.

5-10. WHITNEY, H., “Nonseparable and Planar Graphs,” Trans. Am. Math.Soc.,Vol.34,1932,339–362.

5-11. WHITNEY, H., “A Set of Topological Invariants for Graphs,” Am. J.Math.,Vol.55,1933,231–235.

5-12. WHITNEY,H.,“PlanarGraphs,”Fund.Math.,Vol.21,1933,73–84.

PROBLEMS

5-1. UsinggeometricargumentssimilartothoseusedinprovingTheorem5-1,provethatKuratowski’ssecondgraphisalsononplanar.

5-2. If every region of a simple planar graph (withn vertices and e edges)embeddedinaplaneisboundedbykedges,showthat

Page 144: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

5-3. Asimpleplanargraphtowhichnoedgecanbeaddedwithoutdestroyingits planarity (while keeping the graph simple, of course) is called amaximal planar graph. Prove that every region in a maximal planargraphisatriangle.

5-4. Provethataplanargraphofnvertices(n≥4)hasat leastfourverticeswith degree five or less. This will also prove that there are no 6-connectedplanargraphs.(Hint:UsetheresultofProblem5-3.)

5-5. AplanargraphG is said tobecompletely regular if thedegreesof allverticesofGareequalandeveryregionisboundedbythesamenumberofedges.ThegraphsinFigs.2-20(a)and2-21(b)arecompletelyregular,for example. Show that there are only five possible simple completelyregular planar graphs, excluding the trivial graphs with degree ≤ 2.Sketchthem.(Hint:UseEuler’sformula.)

5-6. Prove that an infinite pattern formed of a regular polygon repeatingitself,suchasthosefoundinmosaicsandtiledfloors(seeinfinitegraphsin Fig. 1-10), can consist of only three types of polygons−square,triangular,andhexagonal.

5-7. Redraw the graph in Fig. 5-4 such that region 2 becomes the infiniteregion.

5-8. UsingKuratowski’stheorem,showthatthegraphsinFig.2-3(knownasPetersen’sgraph)arenonplanar.

5-9. By sketching all (don’t panic, their number is small) simple,nonseparablegraphswithn≤4ande≤6,proveTheorem5-8.

5-10. DrawthegeometricdualofthegraphinFig.5-4.5-11. Show by actual construction that the geometric dual of the two (2-

isomorphic)graphsinFigs.4-11(a)and(d)areisomorphic.5-12. Construct an example todemonstrate thatG**, thedual of a dual of a

graphG,maynotbeisomorphictoG,butis2-isomorphictoit.5-13. Prove that the geometric dual of a self-loop-free nonseparable planar

graphisalsononseparable.5-14. Provethataself-loop-freeplanargraphis2-connectedifandonlyifits

dualisalso2-connected.5-15. Giveanexampleofagraphwhichhasatleastonecompletesetofbasic

circuitsnotconstitutingasetoffundamentalcircuits(withrespecttoanyspanningtree).

5-16. Show that the edges forming a spanning tree in a planar graph GcorrespondtotheedgesformingasetofchordsinthedualG*.

5-17. ShowthatasetoffundamentalcircuitsinaplanargraphGcorrespondstoasetoffundamentalcut-setsinitsdualG*.

Page 145: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

5-18. DeterminethenumberofcrossingsandthethicknessofthegraphinFig.2-3.

5-19. Show,bysketching,thatthethicknessoftheeight-vertexcompletegraphistwo,whereasthatofthenine-vertexcompletegraphisthree.

5-20. Showthatthecompletegraphoffourverticesisself-dual.Giveanotherexampleofaself-dualgraph.

† At this point I cannot resist quoting the following comment by Hadamard: “Descartes distrusts thatinterventionofimagination,andwishestoeliminateitcompletelyfromscience....Morerecently,anotherrigoroustreatmentof...geometry...freedfromanyappealtointuition,hasbeendeveloped...bythecelebratedmathematicianHilbert.Logically,everyinterventionofgeometricalsenseiseliminated.Butisitthesamefromthepsychologicalpointofview?Certainlynot . . . .Diagramsappearatpracticallyeverypage(ofHilbert’sbook).”†Notethatthe“meeting”ofedgesatavertexisnotconsideredanintersection.†Recallthatagraphinwhichallverticesareofequaldegreeiscalledaregulargraph.†inagraph,twoedgesaresaidtobeinseriesiftheyhaveexactlyonevertexincommonandifthisvertexisofdegreetwo.Edgese5ande6(andalsoe1ande2)areinseriesinFig.5-6.†Anedgeincidentonapendantvertexiscalledapendantedge.

Page 146: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

6VECTORSPACESOFAGRAPH

Modern abstract algebra is a powerful tool in the theory as well as in theapplicationsofgraphs.Itisessentialforathoroughunderstandingofgraphsanda must for those wishing to do research in the field. Moreover, since digitalcomputersdonot(atleastinternally)workonpictorialgraphs,itisnecessarytorepresentagraphalgebraicallyandtomanipulateitalgebraically,ifonewishestoenlisttheaidofacomputerinsolvinggraph-theoryproblems.

6-1.SETSWITHONEOPERATION

Set:Asetisacollectionofobjects(calledtheelementsoftheset).Notethatthereisnospecificationonthenatureoftheelementsorthenumber

of elements.Nordo the elements have anything todowith eachother, exceptbelong to the same set. Braces are used to enclose the elements of a set. Forinstance,asetSconsistingoffiveobjectsa,b,c,x,andymaybewrittenasS={a, b, c, x, y}. Since the order in which these elements appear is of nosignificance, we could have written the same set as S = {x, b, a, y, c}, forinstance.Thesymbola∈SisusedtoindicatethatelementaisinsetS.

AsubsetS′ofasetSisacollectionofsomeoftheelementsofS.IfS′hasatleast one element that is not inS′ then S” is calleda.proper subset ofS. Theemptysetornullset,written∅,hasnoelementinitandisconsideredasubsetofeveryset.The twomostcommoncombinationsofsetsare theunion∪andintersection∩,definedas

S1∪S3=S3, asetcontainingalltheelementsofS1andS2,

S1∩S2=S4, asetcontainingonlythoseelementsthatarebothinS1andinS2.

In thischapterweshallbeconcernedwith thecombinationof twoelements

Page 147: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

withinasetratherthanthecombinationoftwodifferentsets.Operation: Let us introduce a rule of combination called binary operation

(also called binary composition, law of composition, or internal law ofcomposition) between two elements of a set. Addition, multiplication,subtraction,anddivisionaresomeofthefamiliarbinaryoperationsbetweentwoelementsinasetofnumbers.Tokeepthebinaryoperationgeneralenough,weshalluse the symbol* (rather thanusing+,−,×,÷, etc.) todenote thebinaryoperation.A setwithoperationsdefinedon it is called analgebraic system orjustalgebra.SpecialTypesofAlgebras:Nowwehaveaset,sayS={a,b,c, . . .},anda

binaryoperation*(writtenasa*b)betweentheelementsofS.Dependingonthe nature of the binary operation *, setS can be classified as one of severalspecialtypesofalgebras.Forinstance,if*satisfiespostulates1and2below,setSiscalledasemigroup:

1. Closure:IfaandbareinS,thena*bisalsoinS.2. Associative:Iftheelementsa,b,andcareinS,then(a*b)*c=a*(b*c).

Semigroupshavemany interestingpropertiesandhavebeenstudied ingreatdetail.Infact,thereareseveralthickbookswrittenonthetheoryofsemigroups.Butsincesemigroupsassucharenotapplicabletothebusinessathand,weshallmoveontomorespecializedsemigroups.Asemigroupthatsatisfiespostulate3,below,iscalledamonoid.

3. Identity element: There exists a unique element e in S such that for anyelementxinS,x*e=e*x=x.

Amonoidthatsatisfiespostulate4,below,iscalledagroup.

4. Inverse:ForeveryelementxinSthereexistsauniqueelementx′inSsuchthatx*x′=x′*x=e.Elementx′iscalledtheinverseofx,withrespecttooperation*.

Asemigroupthatsatisfiespostulate5,below,iscalledanabeliansemigrouporcommutativesemigroup.

5. Commutative:IfaandbareinS,thena*b=b*a.

Page 148: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.6-1Algebraicsystemswithoneinternaloperation.

If an abelian semigroup alsohas an identity element, it is called anabelianmonoid(oranabeliansemigroupwithidentityelement).AsetSwithanoperation*thatsatisfiesallthesefivepostulatesiscalledan

abeliangroup(oracommutativegroup).Figure6-1summarizesthedefinitionsofthese“algebraicsystems”andshows

the relationships among them. The arrows point toward the direction ofincreasing restriction on the set S. The number next to a line indicates theparticularpostulatethatconvertsonealgebraicsystemintoanother.It ought to bementioned here that an algebraic system inwhich the binary

operation does not satisfy even the closure and associative rules is of littlemathematicalinterest.Anotherobservationthatmaybemadeisthatpostulate4cannotbesatisfiedbefore3.Inviewofthesetworemarks,Fig.6-1doesshowallpossiblecombinationsofthefivepostulates.

Examples:Someexamplesareinordernow.Consider the setofallpositive integers,S1={1,2,3, . . .}.SetS1 satisfies

Page 149: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

closure and associative rules if the binary operation * is the ordinary additionoperation+.Moreover, italsosatisfies thecommutative requirement.HenceS1underadditionisacommutativesemigroup.Note that inS1 there isnoidentityelement (an element when added to any other element results in the latterelement).ConsiderthesamesetS1={1,2,3,...}undertheordinarydivisionoperation

÷.SinceS1containsnofractions,clearlyS1doesnotsatisfytheclosurerule,andhenceisnotasemigroup.Again,thesamesetS1undermultiplication·isanabelianmonoid,becauseit

has an identity element, 1. The set S1, however, is not a group under themultiplicationoperationbecauseS1doesnothavetheinverseofeveryelement(becauseS1hasnofractions).Thesetofall integersS2={. . . ,−3,−2,−1,0,1,2,3, . . .} isanabelian

groupundertheadditionoperation(henceanadditiveabeliangroup).Thereadercanverify(Problem6-2)thatthesetconsistingofthefourfourth

rootsofunity,whichis{1,−1,i,−i}(wherei= ),isanabeliangroupunderthemultiplicationoperation(therefore,amultiplicativeabeliangroup).Groups of Subgraphs:Nowwe shall show that sets of certain subgraphs of

anygivengraphG satisfy theprecedingpostulatesand thus formtheirgroups.Theseareveryfundamentalandimportantresultsingraphtheory.

THEOREM6-1

TheringsumoftwocircuitsinagraphGiseitheracircuitoranedge-disjointunionofcircuits.

Proof:LetΓ1andΓ2beanytwocircuitsinagraphG.Ifthetwocircuitshaveno edges or vertices in common, their ring sum Γ1⊕ Γ2 is a disconnectedsubgraph ofG, and is obviously an edge-disjoint union of circuits. If, on theother hand,Γ1 andΓ2 do have edges and/or vertices in common,wehave thefollowingpossiblesituations:Sincethedegreeofeveryvertexinagraphthatisacircuitistwo,everyvertex

vinsubgraphΓ1⊕Γ2hasdegreed(v),where

d(v)=2 ifvisinΓ1only,orinΓ2only;orifoneoftheedgesformerlyincidentonvwasinbothΓ1andΓ2;or

Page 150: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

d(v)=4 ifΓ1andΓ2justintersectatv(withoutacommonedge).

ThereisnoothertypeofvertexinΓ1⊕Γ2.ThusΓ1⊕Γ2isanEulergraph,andtherefore consists of either a circuit or an edge-disjoint union of circuits(Theorem2-6).

ItisimmediatefromTheorem6-1thattheringsumofanytwoedge-disjointunionsofcircuitsisalsoacircuitoranotheredge-disjointunionofcircuits.

THEOREM6-2

The set consistingof all the circuits and the edge-disjoint unionsof circuits(including thenullset∅) inagraphG isanabeliangroupunder thering-sumoperation⊕.

Proof: It is required to prove that this set under the operation⊕ satisfiespostulates1–5inthissection.ThattheclosurepostulateissatisfiedhasjustbeenprovedinTheorem6-1.Associativeandcommutativepostulatesarealsoclearlysatisfied.Thenullgraphservesas the identityelement∅,because∅⊕g=g,foranysubgraphgofG.Whatabouttheinverse?Acircuitoranedge-disjointunionofcircuitsΓisitsowninverse,because

Γ⊕Γ=∅.

Hencethetheorem.

THEOREM6-3

The set consisting of all the cutsets and the edge-disjoint unions of cutsets(including thenullset∅) inagraphG isanabeliangroupunder theringsumoperation.Proof:ItisfollowsfromTheorem4-4thatthissetsatisfiestheclosureaxiom.

Associativity and commutativity are also immediately apparent.And so is theexistenceoftheidentityelement∅.Justasinthecaseofcircuits,acut-setoranedge-disjointunionofcutsetsisitsowninverse.Thusthetheorem.

6-2.SETSWITHTWOOPERATIONS

Page 151: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Now suppose that on the elements of an abelian group we impose anotherbinaryoperation⊙, inadditionto theoperation* imposedinSection6-1.Thefive postulates on⊙ can be written as follows (note that these are the samepostulatesasinSection6-1,buttheyareforadifferentbinaryoperation⊙):

6. Closure:IfaandbareinS,thena⊙bisalsoin5.7. Associative:Ifa,b,andcareinS,then(a⊙b)⊙c=a⊙(b⊙c).8. Identity element: There exists a unique element i in S such that for any

element x in S, x⊙ i = i⊙ x = x. This element i is called the identityelement(orunity)withrespecttooperation⊙.

9. Inverse:Foreveryelement(exceptfortheidentityelementeofpostulate3inSection6-1)xinS,thereexistsauniqueelementx−1inSsuchthatx⊙x−1=x−1⊙x= i.Elementx−1 is called the inverseofx,with respect tooperation⊙.

10. Commutative:IfaandbareinS,thena⊙b=b⊙a.

Andtorelatethesetwodifferentbinaryoperations,postulate11isintroduced.

11. Distributive:Theoperation⊙isdistributivewithrespecttotheoperation*;thatis,forelementsa,b,andcinS

a⊙(b*c)=a⊙b*a⊙c,and (b*c)⊙a=b⊙a*c⊙a.

Just as in Section 6-1, the different combinations of these postulates, inaddition to postulates 1–5, will render different types of algebraic systems.Theseare

Ring:Anabeliangroupwithrespectto*thatsatisfiespostulates6,7,and11iscalledaring.

RingwithUnity:Aringthathasaunityoridentityelementiwithrespecttothesecondoperation⊙.

CommutativeRing:Aringthatsatisfiesthecommutativepostualate(10)withrespectto⊙.

Commutative Ring with Unity: A commutative ring that has an identityelement(8)withrespectto⊙.

Page 152: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

DivisionRing(orSkewFieldorS-Field):Aringwithunitythatalsosatisfiestheinversepostulate(9)withrespectto⊙.

Field(sometimescalledCommutativeField):Adivisionringthatsatisfiesthecommutativepostulate (10)with respect to⊙.Thus a field satisfies all elevenpostulates, and thereforemay be regarded as the “strongest” algebraic systemconsideredhere.

TherelationshipamongthesealgebraicsystemsissummarizedinFig.6-2.Examples:AsmentionedinSection6-1,thesetofallintegers

S2={...,−3,−2,−1,0,1,2,3,...}

is an abelian group under +, the usual addition operation.Moreover, ordinarymultiplication between elements of S2 also satisfies the closure, associative,distributive,andcommutativepostulates,andthere isaunityelement,1, inS2.ThusS2 is acommutative ringwithunity.However, sinceS2 doesnotcontainfractions,itdoesnotsatisfypostulate9,andhenceS2isnotafield.The set of all rational numbers does satisfy postulate 9, in addition to the

other ten satisfied by S2. Therefore, the set of all rational numbers is a fieldunderadditionandmultiplication.Thesetofallrealnumbersalsoformsafieldunderadditionandmultiplication.Allcomplexnumbersalsoformafieldundertheusualadditionandmultiplication.Inthisbookweshallmainlybeconcernedwithgroupsandfields.Therestof

thealgebraicsystemsaredefinedsimplyforyourgeneralinterest.

Page 153: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.6-2Algebraicsystemswithtwointernaloperations.

6-3.MODULARARITHMETICANDGALOISFIELDS

Considerasystemofnumbersthathasonlythreenumbersinit,ordinary0,1,and 2. And let the rules for addition andmultiplication in this system be thesameasordinaryadditionandmultiplicationwiththefollowingexception:Ifanumber q (resulting from addition or multiplication operations) equals orexceeds3,itistobedividedby3,thequotientisdiscarded,andtheremainderisused in place of q. The addition and multiplication tables for such a numbersystemaregiveninFig.6-3,andarecalledadditionmodulo3andmultiplicationmodulo3.Togethertheyarecalledmodulo3arithmetic.Forexample,inmodulo3arithmetic,

1+1+2·2+1+2+1=1 (mod3).

Similarly, we can define any modulo m arithmetic system consisting of m

Page 154: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

elements0,1,2,...,m−1andtherelationshipforanyq>m−1:

Fig.6-3Additionandmultiplicationtablesforarithmeticmodulo3.

q=m·p+r=r (modm) and r<m.

Itissuggestedthatthereaderwritedownarithmetictablesform=4,5,6,and7(Problem6-7).

FiniteFields:FromthetablesinFig.6-3,itcanbeverifiedthattheset{0,1,2}with addition andmultiplicationmodulo3 is a field.There is an identity 0with respect tomodulo3 addition, andan identity1with respect tomodulo3multiplication.Everyelementhasauniqueadditiveinverse,andeveryelementotherthan0hasamultiplicativeinverse.Bymeansofactualtables,likethoseinFig.6-3,itcanbeeasilyverfiedthat

modulo2,5,and7systemsarealsofields.Ontheotherhand,theset{0,1,2,3}withmodulo4additionandmultiplicationisnotafield,becausenoinverseof2existswithrespecttomodulo4multiplication(Problem6-8).Infact,itturnsoutthateveryfiniteset

Zm={0,1,2,...,m−1}

withmodulomadditionandmultiplicationisafieldifandonlyifmisaprimenumber.SuchafieldiscalledaGaloisfieldmodulom,orGF(m).

Aswe shall see shortly, in representing graphswe are concerned onlywithGF(2),Galoisfieldmodulo2.Itconsistsof{0,1}andtheadditionmodulo2andmultiplicationmodulo2operations.ThetwoarithmetictablesaregiveninFig.6-4.(Thosefamiliarwithcomputerlogicwillreadilyrecognizethatin

Page 155: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.6-4AdditionandmultiplicationtablesofGF(2)

Fig.6-4,+ is thesameas“EXCLUSIVEOR”and • is thesameas“AND”ofBooleanlogic.)

6-4.VECTORSANDVECTORSPACES

Inanordinarytwo-dimensional(Euclidean)plane,apointisrepresentedbyanorderedpairofnumbersX=(x1,x2).PointXcanalsoberegardedasavectoremanating from the origin 0 = (0, 0) to the point (x1, x2). Similarly, in three-dimensional Euclidean space the triplet (7, 2.1, − 3) represents a vector.Sometimes,insteadofrownotationacolumnnotationisused,forexample,

Thethreecomponents7,2.1,and−3intheexampleabovearefromthefieldof real numbers. Every point (of the infinitelymany points) inE3, the three-dimensional Euclidean space, corresponds to a unique ordered triplet (of theinfinitelymanytriplets)consistingofthreerealnumbers.NowsupposethatweareworkingwithGF(2),thefieldofintegersmodulo2.

Then every number in a triplet can only be either 0 or 1.Thus there are onlyeight(23=8)vectorspossible(insteadofinfinitelymanyasintherealnumbersystem) in a three-dimensional space if our numbers are restricted to GF(2).Theseare

(0,0,0), (1,0,0), (0,1,0), (0,0,1), (1,1,0), (1,0,1), (0,1,1), (1,1,1).

Page 156: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

This concept of representing vectors can be extended to representation of avectorink-dimensionalspacebymeansofanorderedk-tuple.Forinstance,the7-tuple (0, 1, 1, 0, 1, 0, 1,) represents a vector in a seven-dimensional vectorspaceoverthefieldGF(2).Thenumbersinafieldaresometimescalledscalars(todistinguishthemfrom

vectors).ThescalarsinthefieldGF(2)are0and1.Avectorspace,inadditiontobeingmadeupofk-tuples(fromsomespecified

field), must satisfy certain other conditions regarding combinations of twovectors, or operation of a vector with a scalar, and the like. These can besummarizedinthefollowingdefinition.

DEFINITION

Ak-dimensionalvectorspace(oralinearvectorspace)overthefieldF,isanobjectconsistingof

1. AfieldF(withitssetofelementsS,andtwooperations*and⊙).2. AsetWofk-tuples(allnumberstakenfromF).3. Abinaryoperation⊞(calledvectorsum)betweentheelementsofthesetW,suchthatWisanabeliangroupunderthisoperation⊞.

4. Abinary operation⊡ (called scalarmultiplication),whichwhen appliedbetweenanyscalarcinFandavectorX=(xl,x2,...,xk)inWproducesanother vector P inW. P is called the scalar product of c andX, and isgivenby

P=c⊡X=(c⊙x1,c⊙x2,...,c⊙xk).Furthermore,scalarmultiplicationsatisfiesthefollowing:

Let us now leave the general vector space, and concern ourselves with thespecificvectorspaceassociatedwithagraphG.

6-5.VECTORSPACEASSOCIATEDWITHAGRAPH

Page 157: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

LetusconsiderthegraphGinFig.6-5withfourverticesandfiveedgese1,e2,e3, e4,e5. Any subset of these five edges (i.e., any subgraph g) ofG can berepresentedbya5-tuple:

x=(x1,x2,x3,x4,x5)

suchthat

xi=1 ifeiisingandxi=0 ifeiisnoting.

Forinstance,thesubgraphg1inFig.6-5willberepresentedby(1,0,1,0,1).

Fig.6-5Graphandtwoofitssubgraphs.

Altogetherthereare25or32such5-tuplespossible,includingthezerovector0=(0,0,0,0,0),whichrepresentsanullgraph,†and(1,1,1,1,1),whichisGitself.It is not difficult to see that the ring-sum operation between two subgraphs

correspondstothemodulo2additionbetweenthetwo5-tuplesrepresentingthetwosubgraphs.Forexample,considertwosubgraphs

g1={e1,e3,e5} representedby(1,0,1,0,1),andg2={e2,e3,e4} representedby(0,1,1,1,1).

Theringsum

g1⊕g2={e1,e2,e4,e5} representedby(1,1,0,1,1),

whichisclearlymodulo2additionofthe5-tuplesforg1andg2.Now,generalizingthisexample,wecanmakethemostimportantobservation

ofthischapter:ThereisavectorspaceWGassociatedwitheverygraphG,and

Page 158: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

thisvectorspaceconsistsof

1. Galoisfieldmodulo2;thatis,set{1,0}withoperationadditionmodulo2written as + such that 0 + 0 = 0, 1 + 0 = 1 = 0 + 1, 1 + 1 = 0, andmultiplicationmodulo2writtenas·suchthat0·0=0=1·0=0·1,and1·1=1.

2. 2evectors(e-tuples),whereeisthenumberofedgesinG.3. AnadditionoperationbetweentwovectorsX,Yinthisspace,definedas

thevectorsum‡

X⊕Y=(x1+y1,x2+y2,...,xe+ye),+beingadditionmodulo2.

4. And a scalar multiplication between a scalar c in Z2 and a vector X,definedasc·X=(c·x1,...,c·xe).

ThereadercanverifythatthevectorspaceWGassociatedwithagraphG,asdefined above, does indeed satisfy all the requirements of a vector space(Problem6-11).Notethattheidentityelement(forthevectorsumoperation)inavectorspaceis0,thezerovector.

6-6.BASISVECTORSOFAGRAPH

LinearDependence:AsetofvectorsX1,X2, . . .,Xr (over some fieldF) issaidtobelinearlyindependentifforscalarsc1,c2,...,crinFtheexpression

c1X1+c2X2+...+crXr=0

holdsonlyifc1=c2=. . .=cr=0.Otherwise, thesetofvectorsissaidtobelinearlydependent.Forexample,considerthesetofthreevectors,overthefieldofrealnumbers:

Anarbitrarylinearcombinationofthesethreevectorssettozerogives

Page 159: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Thatis,2c2=0,4c1+c2=0,andc1+3c3=0,whichholdonlyifc1=c2=c3=0.Thusthesetofvectors{X1,X2,X3}islinearlyindependent.Ontheotherhand,consideranothersetofvectors(overthesamefieldofreal

numbers):

Settinganarbitrarylinearcombinationofthesevectorstozero,

givesc4=−c5= .5c6=α,whereαcanbeany realnumbernotnecessarilyzero.Therefore,theset{X4,X5,X6}islinearlydependent.

BasisVectors:Tothesetofthreelinearlyindependentvectors{X1,X2,X3}inthefirstexample,letusaddanothervector

Now you can show without much difficulty that the set {X1, X2, X3, Y} islinearlydependentregardlessofwhatYis.Inotherwords,youcanfindasetoffourrealnumbersa,b,c,andd(notallofwhicharezero)suchthat†

RewritingEq.(6-1),

Page 160: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

ThusavectorYcanbeexpressedasalinearcombinationofthevectorsX1,X2,X3. Such a set of k linearly independent vectors is called a basis (or thecoordinatesystem)inthevectorspace.Moreformally:IfeveryvectorinavectorspaceWcanbeexpressedasalinearcombination

of a given set of vectors, this set is said to span the vector space W. ThedimensionofthevectorspaceWistheminimalnumberoflinearlyindependentvectorsrequiredtospanW.AnysetofklinearlyindependentvectorsthatspansW,ak-dimensionalvectorspace,iscalledabasisforthevectorspaceW.For example, the following set of k unit vectors in a k-dimensional vector

space isabasis.This is themostcommonlyusedbasis,and isoftencalled thenaturalorstandardbasis.

Itisclearthatanyvectorinthek-dimensionalvectorspace(overthefieldofrealnumbers)canbeexpressedasalinearcombinationofthesekvectors.

BasisVectorsofaGraph:InSection6-5itwasshownthattherewasavectorspaceWGassociatedwitheverygraphG.CorrespondingtoeachsubgraphofGtherewasavector inWG, representedbyane-tuple.Thenaturalbasis for thisvectorspaceWG isa setofe linearly independentvectors,each representingasubgraphconsistingofoneedgeofG.Forinstance,forthegraphinFig.6-5,thesetofthefollowingfivevectorsservesasabasisforWG,

(1,0,0,0,0),(0,1,0,0,0),(0,0,1,0,0),

Page 161: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

(0,0,1,0,0),(0,0,0,1,0),(0,0,0,0,1).

Anyofthepossible32subgraphs(includingGaswellasthenullgraph)canberepresented by a suitable (and unique) linear combination of these five basicvectors.

6-7.CIRCUITANDCUT-SETSUBSPACES

A nonempty subset of vectors in a space is called a subspace if the subsetsatisfies the axioms of a vector space. To check whether a given subset ofvectors is a subspace we have only to check for closure under scalarmultiplicationandvectoraddition.Sincethescalarproductof0andavectorXisthezerovector0,theclosureunderscalarmultiplicationassuresthepresenceof0.Closureunderscalarmultiplicationalsoassurestheinverseofeveryvector[because the inverse of vector X is the vector (− 1)·X]. If the associative,commutative,anddistributiveaxiomsholdintheoriginalspace,theymustalsohold for every subset of vectors.Thus a subset of vectors closedunder vectoradditionandmultiplicationbyscalarsisasubspace.

Avectorspaceistriviallyitsownsubspace.Thenullspace,consistingof0,isalso a subspace.AEuclideanplaneE2 through theorigin is a subspaceof thethree-dimensionalEuclideanspaceE3.AlineE1throughtheoriginisasubspaceofbothE2andE3.

Thedimension of a subspace is the number of linearly independent vectorsrequiredtospanthesubspace.

SubspacesinWG

In the vector spaceWG (over the Galois fieldmodulo 2) associated with agraphG,letusconsiderthefollowingtwotypesofvectors:AcircuitvectorisavectorinWGrepresentingeitheracircuitoraunionofedge-disjointcircuitsingraphG. A cut-set vector is a vector inWG representing either a cut-set or aunionofedge-disjointcutsetsinG.

Weknowthat in thevectorspaceWG the linearcombinationof twovectors

Page 162: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

(whichissimplymodulo2additionoftheircomponents)correspondstotheringsumof thecorrespondingsubgraphs inG.FromTheorem6-2, the ringsumoftwocircuits(orunionsofedge-disjointcircuits)isacircuitoraunionofedge-disjointcircuits.Therefore,thelinearcombinationoftwocircuitvectorsisalsoacircuitvector.Hence

THEOREM6-4

ThesetofallcircuitvectorsinWGformsasubspaceWΓ.

BasedonparallelargumentsandonTheorem6-3,wehaveanidenticalresultforcut-setvectors.

THEOREM6-5

Thesetofallcut-setvectorsinWGformsasubspaceWs.

Quitenaturally,subspacesWΓandWsarecalledthecircuitsubspaceandcut-setsubspace,respectively.

BasesofWsandWΓ

Afterhavingdiscoveredthataparticularsetofvectorsconstitutesasubspace,thequestions thatoneasksnextare :What is thedimensionof this subspace?How many vectors does the subspace contain? These questions about thesubspacesWΓandWsareansweredbythefollowingimportantresults.

THEOREM6-6

The set of circuit vectors corresponding to the set of fundamental circuits,withrespecttoanyspanningtree,formsabasisforthecircuitsubspaceWΓ.

Proof:Consideraspanningtree,T,inaconnectedgraphG,withn−1=rtreebranches and e − n + 1 = μ chords. Adding a chord c1 to T produces afundamentalcircuit,andthecorrespondingcircuitvectorcanbeincludedinthebasis ofWΓ. Adding another chord c2 to subgraph T∪ c1 produces anotherfundamentalcircuit,withat leastoneedgethatwasnot in thepreviouscircuit.Therefore,thecircuitvectorrepresentingthesecondfundamentalcircuitandthefirstcircuitvectorare linearly independent.Thusboth thesecircuitvectorscan

Page 163: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

beincludedinthebasis.AddingathirdchordtoT∪c1∪c2willgiveanotherfundamentalcircuitwithatleastoneedgenotineitherofthepreviouscircuits.Therefore,thisthirdcircuitvectorcanalsobeincludedinthebasis.Continuingwiththisargument,weseethatalltheμvectorssuccessivelyobtainedthiswayarelinearlyindependent,becauseeachrepresentsacircuitcontainingatleastoneedge not present in any of the previous ones.Therefore, theseμ vectors, eachcorrespondingtoafundamentalcircuit,arelinearlyindependent.

Nowwehavetoshowthateverycircuitvectorisalinearcombinationoftheseμvectors.

ConsideranarbitrarycircuitΓ1inG,suchthat

Γ1={e1,e2,...,ei,ei+1,...,em},

whereedgese1,e2,...,eiarechordswithrespecttoT,andei+1,ei+2,...,emarebranchesofT.Let g be a subgraph obtained by taking the ring sum of the i fundamental

circuitsformedbythechordse1,e2,...,andet.Because of Theorem 6-1, subgraphgmust be a circuit or a union of edge-

disjoint circuits. Assume Γ1 ≠ g. Then the subgraph Γ1⊕ gmust be either acircuitoraunionofedge-disjointcircuits.ButsincebothΓ1andgcontain thechordse1,e2,...,eiandnootherchords,thesubgraphΓ1⊕gwillnotcontainanychordwithrespecttoT.HenceΓ1⊕ghasnocircuit,acontradiction.SoΓ=g.Thus we have shown that any circuit (and by extension a union of edge-

disjointcircuits)inGcanbeexpressedasaringsumofsomeofthefundamentalcircuits with respect to T. The vectors corresponding to a set of fundamentalcircuitsmustthereforespanWΓ.

AswasbroughtoutinChapter5,everysetoffundamentalcircuitsconstitutesabasisinthecircuitsubspaceWΓ(i.e.,formsasetofbasiccircuits),buteverybasisinthecircuitsubspaceneednotcorrespondtoasetoffundamentalcircuits.(SeeProblems5-15and6-18.)

COROLLARY

Page 164: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

ThedimensionofthecircuitsubspaceWΓisequaltothenullityμofthegraph,andthenumberofcircuitvectors(including0)inWΓis2μ.EmployinganargumentparalleltothatusedinprovingTheorem6-6,itcanbe

shown that the r cut-set vectors, each corresponding to a fundamental cut-setwithrespecttoaspanningtree,arelinearlyindependent.Also,byaparallel argument it canbeproved that anycut-setor aunionof

edge-disjointcutsetscanbeobtainedbytakingtheringsumofasubsetoftherfundamentalcutsetswith respect toaspanning tree.And thuswegetasimilarresultforthecut-setsubspace.

THEOREM6-7

Thesetofcut-setvectorscorrespondingtothesetoffundamentalcutsets,withrespecttoanyspanningtree,formsabasisforthecut-setsubspaceWs.

COROLLARY

Thedimensionofthecut-setsubspaceWsisequaltotherankrofthegraph,andthenumberofcut-setvectors(including0)inWsis2r.

Example:Letusnowillustratetheseresultswithanexample.

ForthegraphGinFig.6-5

numberofedges,e=5,rank,r=3,

nullity,μ=2.

Thenumberofvectorsinthecircuitsubspace,therefore,is22=4,andtheseare

Page 165: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

The first two of these vectors correspond to the set of fundamental circuitswithrespecttoeitherofthespanningtreesinFig.6-5,andthereforetheyformabasisforWΓ.(Infact,anytwoofthefirstthreevectorsformabasisofWΓ.)Thethree subgraphs, each corresponding to a nonzero vector inWΓ, are shown inFig.6-6.Thecut-setsubspaceWshasadimensionofthree,andthereforethenumberof

vectorsinWsis23=8.Thesecut-setvectorsare

The first three vectors correspond to the three fundamental cutsets withrespecttothetreeg2inFig.6-5.Therestofthevectorscaneasilybeseentobethevectorsumsofanytwoorthreeofthesebasisvectors.Thesevensubgraphs,eachcorrespondingtoanonzerocut-setvector,aresketchedinFig.6-7.

Fig.6-6CircuitsingraphGofFig.6-5.

Page 166: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.6-7Cutsetsandunionofedge-disjointcutsetsingraphGofFig.6-5.

In this exampleyoumayhaveobserved that the subgraph{el, e2, e4, e5} isbothacircuitandaunionoftwoedge-disjointcutsets.Thevector(1,1,0,1,1)correspondingtothissubgraph,therefore,occursinbothsubspacesWΓandWs.

Anotherobservationyoumayhavealsomadeisthatthereareatleast(2e−2μ

−2r+1)nonzerovectorswhichareneitherinWΓnorinWs.Inthisexamplewemusthaveatleast21(=25−23−22+1)suchvectors.SincethereisonevectorcommontoWΓandWS,wehaveinfact22vectorsinWGthatareneithercircuitvectorsnorcut-setvectors.

Havingobtainedsomeinsight intothecircuitsubspaceandcut-setsubspace,letusnowexploretherelationshipbetweenthesetwosubspaces.

6-8.ORTHOGONALVECTORSANDSPACES

Considertwovectors(4,2)and(−3,6)inaplane(whichisalsocalledatwo-dimensional Euclidean space E2), as shown in Fig. 6-8. These vectors areorthogonalbecausetheirdotproduct4·(−3)+2·6=0.Generalizingthisnotiontoak-dimensionalvectorspace,wehavethefollowingdefinitions:

DotProduct:ThedotproductoftwovectorsXandYinavectorspaceWisascalarquantitydefinedas

Page 167: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

X·Y=(x1,x2,...,xk)·(y1,y2,...,yk)=x1·y1+x2·y2+...+xk·yk.

Fig.6-8PairoforthogonalvectorsinspaceE2.

OrthogonalVectors:Twovectorsarecalledorthogonaliftheirdotproductiszero;andtwosubspacesaresaidtobeorthogonaltoeachotherifeveryvectorinoneisorthogonaltoeveryvectorintheother.Returning to thevector space associatedwith agraphG, thedotproductof

two vectors, each representing a subgraph ofG, is the modulo 2 sum of theproductsof the corresponding entries in the twovectors.For example, thedotproductofthevectorsrepresentingsubgraphsg1andg2inFig.6-5is

Thenumberofnonzeroentriesinthesumofproductsaboveisthenumberofedgescommontog1andg2.Theorem6-8followsdirectlyfromthedefinitionofthedotproductoftwovectors.

THEOREM6-8

Thedotproductof twovectors,onerepresentingasubgraphgandtheotherg′,iszeroifthenumberofedgescommontogandg′iseven;thedotproductis1ifthenumberofcommonedgesisodd.

THEOREM6-9

Page 168: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

In thevectorspaceofagraph, thecircuit subspaceand thecut-set subspaceareorthogonaltoeachother.

Proof:AccordingtoTheorem4-3, thenumberofedgescommontoacircuitanda cut-set is even.What about thenumberof edges common to aunionofedge-disjointcircuitsandaunionofedge-disjointcutsets?Thatthisisalsoevencanbeshownasfollows:Letg1beaunionofthreeedge-disjointcircuitsΓ1,Γ2,andΓ3 inagraphG,

andg2beaunionoftwoedge-disjointcutsetsS1andS2inG.Letthenumberofedgescommonto

Γ1andS1be2a,Γ1andS2be2b,Γ2andS1be2c,Γ2andS2be2d,Γ3andS1be2e,Γ3andS2be2f.

SincethereisnoedgecommonbetweenS1andS2,orbetweenΓ1andΓ2andΓ3,the six setsofcommonedgesenumeratedabovearealldistinct (somemaybeempty).Therefore,thenumberofedgescommontog1andg2is

2a+2b+2c+2d+2e+2f, anevennumber.

Thisexamplecanbeextendedtog1andg2toincludetheunionofanyfinitenumbersofedge-disjointcircuitsandCutsets,respectively.FromTheorem6-8,the dot product of a circuit vector and a cut-set vector is zero. Hence everyvector in each of these subspaces is orthogonal to every vector in the other.Therefore,thetheorem.

Forinstance,thedotproductofthecut-setvector(0,1,1,1,0)andthecircuitvector(1,1,1,0,0)intheexampleinSection6-7(i.e.,Fig.6-5)is

(0,1,1,1,0)·(1,1,1,0,0)=0·1+1·1+1·1+1·0+0·0=0(mod2).

Page 169: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

6-9.INTERSECTIONANDJOINOFWΓANDWs

GiventhetwosubspacesWΓandWsofthevectorspaceWG,itisinterestingtoaskwhatisthelargestsetofvectorsthatbelongstobothcircuitsubspaceWΓandthecut-setsubspaceWs;andwhatisthesmallestsetofvectorscontainingbothWΓ andWs?Clearly, thenullorzerovector0 is inbothWΓ andWs,but theremayalsobe somenonzerovectorscontained in the intersectionWΓ∩Ws.Forexample,thevector

forthegraphinFig.6-5isinbothsubspaces.ItisnotdifficulttoshowthatthesetofvectorsWΓ∩WsalwaysformsavectorsubspaceinWG.

On the other hand, the smallest subspace containing bothWΓ andWs mustcontain the set union WΓ ∪ WS, of course, but (because of the closurerequirementsforasubspace)itwillusuallycontainsomeadditionalvectorsnotinWΓ∪Ws. For example, for thegraph inFig. 6-5 setWΓ∩Ws contains10vectors(unionofFigs.6-6and6-7),whilethesmallestsubspacecontainingsetWΓ ∩Ws, that is, the subspace spanned by the set of vectors inWΓ∪Ws,consists of 16 vectors. (What are the remaining six subgraphs not included inFigs.6-6and6-7?)ThesubspacespannedbyWΓ∪WsiscalledthejoinofWΓandWs,andiswrittenasWΓVWs.Thefollowingisawell-knownresultfromlinearalgebra:IfXandYaretwo

subspacesinafinite-dimensionalvectorspace,thenthedimensionoftheirjoin,dim(XVY),isgivenby

dim(XVY)=dimX+dimY−dim(X∩Y).

Usingthisresult,weget

Page 170: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

dim(WΓVWs)=e−dim(WΓ∩Ws).

Twosubspacesofavector spacearesaid tobeorthogonalcomplements if thesubspacesareorthogonaltoeachother,andtheytogetherspantheentirevectorspace.Thuswehavethefollowinginterestingresult.

THEOREM6-10

SubspacesWΓandWsareorthogonalcomplementsifandonlyif

dim(WΓ∩Ws)=0, i.e., WΓ∩Ws=0.

Inotherwords,asetofbasisvectorsofWΓtogetherwithasetofbasisvectorsofWsformabasisforWGifandonlyifWΓ∩Ws=0.Consequently,anysubgraphgofGcanbeuniquelyexpressedasaringsumoftwosubgraphs,oneacircuitor an edge-disjoint union of circuits and the other a cutset or an edge-disjointunionofcutsets,ifandonlyif

WΓ∩Ws=0.

ThesepropertiesareillustratedinFig.6-9.Inthecase

WΓ∩Ws≠0

we have nonzero vectors each orthogonal to itself. This seemingly peculiarsituation arises from the finiteness of the field. In fact, thedot product of anyvectoroverGF(2)with itself iszero ifandonly if thevectorcontainsanevennumberofl′s.

Page 171: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.6-9Graphanditsdifferentsubspaces.

Now,since

dim(WΓ∩Ws)≠0,

thetwosubspacesWΓandWsarenotorthogonalcomplements.Norisitpossibleto express every vector inWG as a sumof two vectors, one fromWΓ and theotherfromWs.Forexample,inFig.6-5nolinearcombinationofvectorsinWΓandWswillyieldthevector

Page 172: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

In fact, forFig.6-5 there are16 suchvectors inWG that arenot inWΓVWs,because

dim(WΓVWs)=e−dim(WΓ∩Ws)=5−1=4.

Thereader isencouraged tosketcha figure likeFig.6-9,using thegraph inFig.6-5.Identifyall32subgraphs,andplacetheminsubspacesWΓ,Ws,(Ws∩WΓ),and(WsVWΓ).Formoreonpropertiesofthesesubspacessee[6-8]and[6-1].

SUMMARY

In this chapter various algebraic or number systemswere introduced, and itwasshownthattoeverygraphGcorrespondsavectorspaceWGoverthefieldofintegersmodulo2[i.e.,GF(2)].ForagraphGwitheedgesthedimensionofWG

ise,andthenumberofvectorsinWGis2e,eachcorrespondingtoasubgraphofG.Cutsetsandunionsofedge-disjointcutsetsformedanr-dimensionalsubspace

Ws inWG. The number of vectors in subspaceWs is naturally 2r, each vectorcorresponding to a cut-set or a union of edge-disjoint cutsets. Similarly, thecircuitsandunionofedge-disjointcircuitscorrespondtoaμ-dimensionalvectorspaceWΓ, with 2μ vectors. Out of many bases available, the set of μ vectorsrepresentingallfundamentalcircuits,withrespecttoanyspanningtree,formsaconvenient basis in the circuit subspace. Likewise, the set of r fundamentalcutsets, with respect to any spanning tree, provides a basis in the cut-setsubspace.Thecut-set subspaceandcircuit subspaceofagraphareorthogonal toeach

other. The intersection of these two subspaces is not necessarily {0}; that is,theremaybe nonzero vectors common to cut-set and circuit subspaces.Every

Page 173: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

oneofthesevectorsinWs∩WΓisorthogonaltoitself,andthey(includingtheorigin0)formanothervectorsubspace.ThesetofvectorsintheunionWs∪WΓdoesnotnecessarilyformavectorspace.ItwasalsoshownthatWGhas,ingeneral,alargenumberofvectors(2e−2μ−

2r+1vectorsormore)whichbelongneithertothecut-setsubspacenortothecircuitsubspace.Ononehand,agraphprovidesanelegantandconcreteexampleof“spaces”of

more than three dimensions, which often appear frighteningly mysterious tomanynonmathematicians.Agraphalsoprovidesanexampleofavectorspaceover a field other than those of usual real or complex numbers. On the otherhand,astudyofthevectorspaceofagraphandthenatureofdifferentsubspacesshows us “what makes a graph tick.” It gives us an additional mathematicalfooting in analysis andapplicationsofgraphs, such as in coding theory (tobecoveredinChapter12).Vectorsandmatricesarecloselyrelated.In thenextchapterwewillexplore

variousmatricesassociatedwithagraph,andtiethevectorspacesandmatricesofgraphstogether.

REFERENCES

Asmallbutveryimportantportionofabstractalgebrahasbeenpresentedinitsbarestessentials,andthattoowithoutmuchrigor.SincetheclassicalbookofvanderWaerden(1931),manyexcellenttextshaveappearedonthesubject.Ofthese, four are recommended for thosewishing amore detailed and thoroughcoverage.ForgroupsandfieldsseeChapters2,3,and4ofHerstein [6-6]andChapter3ofMiller[6-7].Forvectorspaces,consultChapter1ofHalmos[6-5],Chapter7ofDean[6-2],andChapter5ofHerstein[6-6].Forastudyofvectorspacesofgraphs,Chapter4ofSeshuandReed[1-13],

and papers by Gould [6-4] and Goldman and Rota [6-3] are suggested; inparticular,forthematerialcoveredinSection6-9,seeChen[6-1]andWilliamsandMaxwell[6-8].(Notethatin[6-8],segisacut-setoranedge-disjointunionofcutsets;circisacircuitoranedge-disjointunionofcircuits.)6-1. CHEN,W. K., “On Vector Spaces Associated with a Graph,” SIAM J.

Appl.Math.,Vol.20,No.3,May1971,526–529.6-2. DEAN, R.A.,Elements of Abstract Algebra, JohnWiley& Sons, Inc.,

NewYork,1966.6-3. GOLDMAN, J., G. C. ROTA, “The Number of Subspaces of a Vector

Page 174: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Space,” in Recent Progress in Combinatorics (W. T. Tutte, ed.),AcademicPress,Inc.,NewYork,1969.

6-4. GOULD,R.,“GraphsandVectorSpaces,”J.Math.Phys.,Vol.37,1958,193–214.

6-5. HALMOS, P. R., “Finite-Dimensional Vector Spaces,” Van NostrandReinholdCompany,NewYork,1958.

6-6. HERSTEIN, I. N., Topics in Algebra, Xerox College Publishing,Lexington,Mass.,1964.

6-7. MILLER, K. S.,Elements ofModern Abstract Algebra, Harper&Row,Inc.,NewYork,1958.

6-8. WILLIAMS,T.W.,andL.M.MAXWELL,“TheDecompositionofaGraphandtheIntroductionofaNewClassofSubgraphs,”SIAMJ.ApplMath.,Vol.20,No.3,May1971,385–389.

PROBLEMS6-1. Show that the usual operation of subtraction does not satisfy the

associativeaxiom.6-2. Showthatthesetofthefourfourthrootsofunitythatis,{1,−1,i,−i},

satisfies all five criteria for being an abelian group under the ordinarymultiplicationoperation.

6-3. Givenaset{x,y,z}ofthreeelements,showthatthereisonlyonegrouppossiblewiththisset.

6-4. FromthetableinFig.6-3(a),showthateachelementintheset{0,1,2}has a unique inverse under modulo 3 addition. What about undermultiplicationmodulo3?UsethetableinFig.6-3(b).

6-5. Show that there are only two different groups possible with fourelements,andthatboththesegroupsareabelian.

6-6. Given a set {a, b, c, d} of four elements, construct two four by fourtables for operations * and⊙, such that the set is a field. Identify thelettersplayingtherolesofidentitieswithrespectto*and⊙(i.e.,0and1).

6-7. Writedowntheadditionandmultiplicationtablesforeachofmodulo4,5,6,and7arithmetics(similartothoseinFigs.6-3and6-4).

6-8. FromtheappropriatetableinProblem6-7,showthatnoteverynonzeroelement (i.e., 1,2, and 3) has a unique inverse under the modulo 4multiplicationoperation.

6-9. Showthatthemodulo6systemisanabelianringwithunity,butisnotafield.

Page 175: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

6-10. Prove that in anyvector space thenull vector 0 is orthogonal to everyvectorinthespace.

6-11. ShowthatWG,asdefinedinSection6-5,satisfiesallfourconditionsforbeingavectorspace,asstatedinSection6-4.

6-12. InvectorspaceWG,dothevectorsassociatedwiththespanningtreesofGformavectorspaceoverGF(2)?Explain.

6-13. LetGbeagraphconsistingofacircuitof length four.Depict the foursubspacesWs,WΓ,WΓ, ∩Ws, andWΓ VWs as was done in Fig. 6-9.Draw the corresponding subgraphs. Have all 16 subgraphs of G beenaccountedfor?

6-14. RepeatProblem6-13foracompletegraphoffourvertices.FindabasisforWsandWΓ,.

6-15. IfagraphGisatree(oraforest),showthatthecut-setsubspaceWsfillstheentirevectorspaceWGofgraphG.

6-16. Characterizeagraphforwhichthecircuitspacecontainsthevector(1,1,...,1).

6-17. Provethatthenumberofdistinctbasespossibleinacut-setsubspaceis

whereristherankofthegraph.6-18. Prove that the number of spanning trees in a connected labeled graph

withnullitypcannotexceedthenumber

(Hint: Associated with each spanning tree there is a distinct basis insubspace WΓ, corresponding to the set of fundamental circuits.Therefore,thereareatleastasmanydistinctbasesinWΓasthenumberofdifferentspanningtrees.)

6-19. Sketch a graphG that has the following vectors (among others) in itscircuitsubspace:(0,1,1,1,1,0,0,1),(0,1,1,1,0,1,1,0),(0,1,0,0,1,0,1,0),(0,1,0,0,0,1,0,1),(1,0,1,0,1,1,0,1),(1,0,1,0,0,0,1,0),(1,0,0,1,1,1,1,0),and(1,0,0,1,0,0,0,1).

6-20. Given that a graph is connected and thatWΓ, ∩Ws ≠ 0, investigatefurther the properties of the subgraphs corresponding to the vectors insubspaces(a)WΓ∩Wsand(b)WΓVWs.

Page 176: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

†Inconsideringvectorspacesofgraphs,isolatedverticesareofnoconsequence.Henceanullgraphoffourverticesisnotdistinguishedfromanullgraphof100vertices.‡The same symbol⊕ has been used for the ring sum of two subgraphs, aswell as for the vector sumbetweenthetwovectorsrepresentingthetwosubgraphs.Thisisdoneasmuchtoeliminateanextrasymbolastoremindthereaderthataringsumbetweentwosubgraphsamountstothesamethingasvectorsumofthecorrespondingvectors.Therewillbenooccasionforambiguity.†Onepossiblesolution(outofinfinitelymany)thatsatisfiesEq.(6-1)is

Page 177: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

7MATRIXREPRESENTATIONOFGRAPHS

Althoughapictorialrepresentationofagraphisveryconvenientforavisualstudy, other representations are better for computer processing, Amatrix is aconvenientandusefulwayofrepresentingagraphtoacomputer.Matriceslendthemselveseasilytomechanicalmanipulations.Besides,manyknownresultsofmatrixalgebracanbereadilyappliedtostudythestructuralpropertiesofgraphsfromanalgebraicpointofview.Inmanyapplicationsofgraphtheory,suchasinelectricalnetworkanalysisandoperationsresearch,matricesalsoturnouttobethenaturalwayofexpressingtheproblem.In this chapter we shall consider two most frequently used matrix

representationsofagraph.Alsoacorrespondencebetweensomegraph-theoreticproperties and matrix properties will be established. In view of the close tiebetweenmatricesandvectorspaces,thischaptershould,infact,belookeduponas a continuationofChapter6.A rudimentaryknowledgeofmatrix algebra isassumed.

7-1.INCIDENCEMATRIX

LetGbeagraphwithnvertices,eedges,andnoself-loops.DefineannbyematrixA=[aij],whosen rowscorrespond to thenverticesand theecolumnscorrespondtotheeedges,asfollows:Thematrixelement

aij=1, ifjthedgeejisincidentonithvertexvi,and

=0, otherwise.

Page 178: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.7-1Graphanditsincidencematrix.

SuchamatrixAiscalledthevertex-edgeincidencematrix,orsimplyincidencematrix.MatrixAforagraphGissometimesalsowrittenasA(G).AgraphanditsincidencematrixareshowninFig.7-1.The incidencematrixcontainsonly twoelements,0and1.Suchamatrix is

calledabinarymatrixora(0,1)-matrix.LetusstipulatethatthesetwoelementsarefromGaloisfieldmodulo2.†GivenanygeometricrepresentationofagraphWithoutself-loops,wecanreadilywriteitsincidencematrix.

Ontheotherhand,ifwearegivenanincidencematrixA(G),wecanconstructits geometric graph G without ambiguity. The incidence matrix and thegeometricgraphcontainthesameinformation†—theyaresimplytwoalternativewaysofrepresentingthesame(abstract)graph.ThefollowingobservationsabouttheincidencematrixAcanreadilybemade:

Page 179: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

1. Sinceeveryedgeisincidentonexactlytwovertices,eachcolumnofAhasexactlytwol′s.

2. The number of l′s in each row equals the degree of the correspondingvertex.

3. Arowwithall0′s,therefore,representsanisolatedvertex.

4. Paralleledgesinagraphproduceidenticalcolumnsinitsincidencematrix,forexample,columns1and2inFig.7-1.

5. IfagraphGisdisconnectedandconsistsoftwocomponentsg1andg2,theincidencematrixA(G)ofgraphGcanbewritteninablock-diagonalformas

whereA(g1)andA(g2)aretheincidencematricesofcomponentsg1andg2.This observation results from the fact that no edge in g1 is incident onvertices of g2, and vice versa. Obviously, this remark is also true for adisconnectedgraphwithanynumberofcomponents.

6. Permutation of any two rows or columns in an incidencematrix simplycorresponds to relabeling the vertices and edges of the samegraph.ThisobservationleadsustoTheorem7-1.

THEOREM7-1

TwographsG1andG2areisomorphicifandonlyiftheirincidencematricesA(G1)andA(G2)differonlybypermutationsofrowsandcolumns.

RankoftheIncidenceMatrix:EachrowinanincidencematrixA(G)mayberegardedasavectoroverGF(2)inthevectorspaceofgraphG.LetthevectorinthefirstrowbecalledA,,inthesecondrowA2,andsoon.Thus

Page 180: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Since there are exactly two 1’s in every column of A, the sum of all thesevectors is 0 (this being a modulo 2 sum of the corresponding entries). ThusvectorsA1,A2,...,Anarenotlinearlyindependent.Therefore,therankofAislessthann;thatis,rankA≤n−1.Nowconsiderthesumofanymofthesenvectors(m≤n−1).Ifthegraphis

connected,A(G)cannotbepartitioned,asinEq.(7-1),suchthatA(g1)iswithmrowsandA(g2)withn−mrows.Inotherwords,nombymsubmatrixofA(G)canbefound,form≤n−1,suchthatthemodulo2sumofthosemrowsisequaltozero.Since there areonly twoconstants 0 and1 in this field, the additionsof all

vectors takenm at a time form=1,2, . . . , n−1exhausts allpossible linearcombinations of n − 1 row vectors. Thus we have just shown that no linearcombination of m row vectors of A (for m ≤ n − 1) can be equal to zero.Therefore,therankofA(G)mustbeatleastn−1.SincetherankofA(G)isnomorethann−1andisnolessthann−1,itmust

beexactlyequalton−1.HenceTheorem7-2.

THEOREM7-2

IfA(G) is an incidencematrix of a connected graphGwithn vertices, therankofA(G)isn−1.

TheargumentleadingtoTheorem7-2canbeextendedtoprovethattherankofA(G)isn−k,ifGisadisconnectedgraphwithnverticesandkcomponents(Problem7-3).Thisisthereasonwhythenumbern−khasbeencalledtherankofagraphwithkcomponents.Ifweremoveanyonerowfromtheincidencematrixofaconnectedgraph,the

remaining(n−1)byesubmatrixisofrankn−1(Theorem7-2).Inotherwords,theremainingn−1rowvectorsarelinearlyindependent.Thusweneedonlyn−1rowsofanincidencematrixtospecifythecorrespondinggraphcompletely,forn−1rowscontainthesameamountofinformationastheentirematrix.(Thisisobvious, since given n − 1 rows we can easily reconstitute the missing row,becauseeachcolumninthematrixhasexactlytwo1’s.)Suchan(n−1)byesubmatrixAfofAiscalledareducedincidencematrix.

ThevertexcorrespondingtothedeletedrowinAfiscalledthereferencevertex.Clearly,anyvertexofaconnectedgraphcanbemadethereferencevertex.Sinceatreeisaconnectedgraphwithnverticesandn−1edges,itsreduced

incidencematrixisasquarematrixoforderandrankn−1.Inotherwords,

Page 181: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

COROLLARY

Thereducedincidencematrixofatreeisnonsingular.

Agraphwithnverticesandn−1edgesthatisnotatreeisdisconnected.Therankoftheincidencematrixofsuchagraphwillbelessthann−1.Therefore,the (n − 1) by (n − 1) reduced incidencematrix of such a graph will not benonsingular. In other words, the reduced incidence matrix of a graph isnonsingularifandonlyifthegraphisatree.

7-2.SUBMATRICESOFA(G)

Letg be a subgraph of a graphG, and letA(g) andA(G) be the incidencematricesofgandG,respectively.Clearly,A(g)isasubmatrixofA(G)(possiblywith rowsorcolumnspermuted). In fact, there isaone-to-onecorrespondencebetween eachn by k submatrix ofA(G) and a subgraph ofGwith k edges, kbeinganypositiveintegerlessthaneandnbeingthenumberofverticesinG.Submatrices of A(G) corresponding to special types of subgraphs, such as

circuits, spanning trees, or cut-sets in G, will undoubtedly exhibit specialproperties.Theorem7-3givesonesuchproperty.

THEOREM7-3

LetA(G)beanincidencematrixofaconnectedgraphGwithnvertices.An(n−1)by(n−1)submatrixofA(G)isnonsingularifandonlyifthen−1edgescorrespondingtothen−1columnsofthismatrixconstituteaspanningtreeinG.

Proof:Everysquaresubmatrixofordern−1inA(G)isthereducedincidencematrixof the same subgraph inGwithn−1 edges, andviceversa.From theremarks followingTheorem7-2, it is clear that a square submatrix ofA(G) isnonsingularifandonlyifthecorrespondingsubgraphisatree.Thetreeinthiscase is a spanning tree,because it containsn−1 edgesof then-vertexgraph.Thusthetheorem.

7-3.CIRCUITMATRIX

LetthenumberofdifferentcircuitsinagraphGbeqandthenumberofedges

Page 182: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

inGbee.ThenacircuitmatrixB=[bij]ofGisaqbye,(0,1)-matrixdefinedasfollows:

bij=1, ifithcircuitincludesjthedge,and=0, otherwise.

Toemphasize the fact thatB is a circuitmatrixofgraphG, the circuitmatrixmayalsobewrittenasB(G).ThegraphinFig.7-1(a)hasfourdifferentcircuits,{a,b},{c,e,g},{d,f,g},

and{c,d,f,e}.Therefore,itscircuitmatrixisa4by8,(0,l)-matrixasshown:

The following observations can be made about a circuit matrix B(G) of agraphG:

1. Acolumnofallzeroscorrespondstoanoncircuitedge(i.e.,anedgethatdoesnotbelongtoanycircuit).

2. EachrowofB(G)isacircuitvector.

3. Unlike the incidencematrix, a circuitmatrix is capableof representing aself-loop—thecorrespondingrowwillhaveasingle1.

4. The number of 1’s in a row is equal to the number of edges in thecorrespondingcircuit.

5. If graphG is separable (or disconnected) and consists of two blocks (orcomponents)g1andg2,thecircuitmatrixB(G)canbewritteninablock-diagonalformas

where B(g1) and B(g2) are the circuit matrices of g1 and g2. Thisobservationresultsfromthefactthatcircuitsing1havenoedgesbelongingtog2,andviceversa(Problem4-14).

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

Page 183: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

correspondstorelabelingthecircuitsandedges.

7. TwographsG1andG2willhavethesamecircuitmatrixifandonlyifG1and G2 are 2-isomorphic (Theorem 4-15). In other words, (unlike anincidencematrix)thecircuitmatrixdoesnotspecifyagraphcompletely.Itonly specifies the graph within 2-isomorphism. For instance, it can beeasilyverifiedthatthetwographsinFigs.4-11(a)and(d)havethesamecircuitmatrix,yetthegraphsarenotisomorphic.

Animportanttheoremrelatingtheincidencematrixandthecircuitmatrixofaself-loop-freegraphGis

THEOREM7-4

LetBandAbe,respectively,thecircuitmatrixandtheincidencematrix(ofaself-loop-freegraph)whosecolumnsarearrangedusingthesameorderofedges.TheneveryrowofBisorthogonaltoeveryrowA;thatis,

wheresuperscriptTdenotesthetransposedmatrix.

Proof:ConsideravertexvandacircuitΓinthegraphG.EithervisinΓoritisnot.IfvisnotinΓ,thereisnoedgeinthecircuitΓthatisincidentonv.Ontheotherhand, ifv is inΓ, thenumberof thoseedges in thecircuitΓ thatareincidentonvisexactlytwo.With this remark inmind, consider the ith row inA and the jth row in B.

Since the edges are arranged in the same order, the nonzero entries in thecorrespondingpositionsoccuronly if theparticular edge is incident on the ithvertexandisalsointhejthcircuit.Iftheithvertexisnotinthejthcircuit,thereisnosuchnonzeroentry,andthe

dotproductofthetworowsiszero.Iftheithvertexisinthejthcircuit,therewillbeexactlytwo1’sinthesumoftheproductsofindividualentries.Since1+1=0(mod2),thedotproductofthetwoarbitraryrows−onefromAandtheotherfromB−iszero.Hencethetheorem.

Asanexample,letusmultiplytheincidencematrixandtransposedcircuitofthegraphinFig.7-1(a),aftermakingsurethattheedgesareinthesameorderinboth.

Page 184: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

7-4.FUNDAMENTALCIRCUITMATRIXANDRANKOFB

Asetoffundamentalcircuits(orbasiccircuits)withrespecttoanyspanningtree in a connected graph, as discussed in Chapters 3 and 6, are the onlyindependentcircuitsinagraph.Therestofthecircuitscanbeobtainedasringsums(i.e.,linearcombinations)ofthesecircuits.Thus,inacircuitmatrix,ifweretain only those rows that correspond to a set of fundamental circuits andremoveallotherrows,wewouldnotloseanyinformation.Theremainingrowscan be reconstituted from the rows corresponding to the set of fundamentalcircuits.Forexample,inthecircuitmatrixinEq.(7-3),thefourthrowissimplythemod2sumofthesecondandthirdrows.A submatrix (of a circuit matrix) in which all rows correspond to a set of

fundamental circuits is calleda fundamentalcircuitmatrixBf.Agraphand itsfundamental circuitmatrixwith respect to a spanning tree (indicatedbyheavylines)areshowninFig.7-2.As in matrices A and B, permutations of rows (and/or of columns) do not

affectBf.Ifnisthenumberofverticesandethenumberofedgesinaconnectedgraph,thenBfisan(e−n+1)byematrix,becausethenumberoffundamentalcircuitsise−n+1,eachfundamentalcircuitbeingproducedbyonechord.

Page 185: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

LetusarrangethecolumnsinBfsuchthatallthee−n+1chordscorrespondtothefirste−n+1columns.Furthermore,letusrearrangetherowssuchthatthe first row corresponds to the fundamental circuitmade by the chord in thefirstcolumn,thesecondrowtothefundamentalcircuitmadebythesecond,andsoon.This indeedishowthefundamentalcircuitmatrix isarrangedinFig.7-2(b).

Fig.7-2Graphanditsfundamentalcircuitmatrix(withrespecttothespanningtreeshowninheavylines).

AmatrixBfthusarrangedcanbewrittenas

whereIµisanidentitymatrixoforderµ=e−n+1,andBtistheremainingµby(n−1)submatrix,correspondingtothebranchesofthespanningtree.FromEq.(7-5)itisclearthatthe

rankofBf=µ=e−n+1.

SinceBfisasubmatrixofthecircuitmatrixB,the

rankofB≥e−n+1.

Infact,wecanproveTheorem7-5.

Page 186: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

THEOREM7-5

IfBisacircuitmatrixofaconnectedgraphGwitheedgesandnvertices,

rankofB=e−n+1.

Proof:IfAisanincidencematrixofG,fromEq.(7-4)wehave

A.BT=0(mod2).

Therefore,accordingtoSylvester′stheorem(AppendixB),

rankofA+rankofB≤e;

thatis,

rankofB≤e−rankofA.

Since rankofA=n−1

wehave rankofB≤e−n+1.

But rankofB≥e−n+1.

Therefore,wemusthave

rankofB=e−n+1.

An Alternative Proof: Theorem 7-5 can also be proved by considering thecircuitsubspaceWΓinthevectorspaceWGofagraph,asdiscussedinChapter6.Every row in circuitmatrix B is a vector inWΓ and since the rank of any

matrixisequal tothenumberof linearlyindependentrows(orcolumns)inthematrix,wehave.

rankofmatrixB=numberoflinearlyindependentrowsinB;

but the number of linearly independent rows in B ≤ number of linearlyindependentvectorsinWΓ,andthenumberoflinearlyindependentvectorsinWΓ= dimension ofWΓ =µ. Therefore, rank ofB ≤ e −n + 1. Sincewe alreadyshowedthatrankofB≥e−n+1,Theorem7-5follows.

Page 187: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Notethat intalkingofspanningtreesofagraphG it isnecessarytoassumethatG is connected. In the case of a disconnected graph, we would have toconsideraspanningforestandfundamentalcircuitswithrespecttothisforest.Itis not difficult to show (considering component by component) that ifG is adisconnectedgraphwithkcomponents,eedges,andnvertices,

rankofB=µ=e−n+k.

7-5.APPLICATIONTOASWITCHINGNETWORK

Supposeyouaregivenaboxthatcontainsaswitchingnetworkconsistingofeightswitchesa,b,c,d,e,f,g,andh.Theswitchescanbeturnedonorofffromoutside.Youareaskedtodeterminehowtheswitchesareconnectedinsidethebox,withoutopeningthebox,ofcourse.Onewaytofindtheansweristoconnectalampattheavailableterminalsin

serieswithabatteryandanadditionalswitchk,asshowninFig.7-3.Andthenfindoutwhichofthevariouscombinationslightupthelamp.

Fig.7-3Blackboxwithaswitchingnetwork.

In this experiment, suppose youdiscover that the combinations that turn onthelampareeight:

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

Solution:Consider the switching network as a graphwhose edges representswitches.Wecanassumethatthegraphisconnected,andhasnoself-loop.Sincealitlampimpliestheformationofacircuit,wecanregardtheprecedinglistasapartiallistofcircuitsinthecorrespondinggraph.Withthislistweformacircuitmatrix:

Page 188: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Next, to simplify the matrix, we should remove the obviously redundantcircuits. Observe that the following ring sums of circuits give rise to othercircuits:

(a,b,g,k)⊕(c,f,h,k)⊕(c,g,k)=(a,b,h,k),(a,b,g,k)⊕(a,e,h,k)⊕(c,g,k)=(b,c,e,h,k),(a,e,h,k)⊕(c,f,a,k)⊕(c,g,k)=(a,e,f,g,k).

Therefore,wecandelete thefirst, third,andfifthrowsfrommatrixB,withoutanylossofinformation.Remainingisa5by9matrixB1:

Our next goal is to bring matrix B1 to the form of Eq. (7-5). For this weinterchangecolumnstogetB2:

Page 189: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

AddingthefourthrowinB2tothefirst,wegetB3.

We note that there are no redundant circuits in matrix B3, and B3 is afundamental circuitmatrix of the requiredgraph.Since the rankofB3 is five,and the network was assumed to be connected, we have the followinginformationaboutthegraph:

numberofedgese=9,nullityµ=5,rankr=4,

numberofverticesn=5.

Constructingagraph from its incidencematrix is simple,but constructingagraph from its fundamental circuit matrix is difficult. We shall, therefore,constructanincidencematrixfromB3.Since the rows in the incidence matrix are orthogonal to those in B3—

accordingtoEq.(7-4)—wemustfirst lookfora4by9matrixM,whoserowsarelinearlyindependentandareorthogonaltothoseofB3.Since,

B3=[I5¦F],

Page 190: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

anorthogonalmatrixtoB3is

M=[—FT¦I4]=[FT¦I4],

becauseinmod2arithmetic−1=1,[i.e.,inGF(2)theadditiveinverseof1is1].Thus

Clearly,therankofMisfour,anditiseasytocheckthat

B3·MT=0.BeforeMcanberegardedasareducedincidencematrix,itmusthaveatmost

two1′sineachcolumn.Thiscanbeachievedbyadding(mod2)thethirdrowtothefourthinM,whichgivesusM′.

MatrixM′ is the reduced incidencematrix. The incidencematrixA can beobtainedbyaddingafifthrowtoM′suchthatthereareexactlytwo1′ineverycolumn;thatis,

Page 191: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

FromtheincidencematrixAwecanreadilyconstructthegraphandhencethecorrespondingswitchingnetwork,asshowninFig.7-4.

Fig.7-4Graphandthecorrespondingswitchingnetwork.

Page 192: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

7-6.CUT-SETMATRIX

Analogoustoacircuitmatrix,wecandefineacut-setmatrixC=[cij]inwhichtherowscorrespondtothecut-setsandthecolumnstotheedgesofthegraph,asfollows:

cij=1, ifithcut-setcontainsjthedge,and=0, otherwise.

Forexample,agraphanditscut-setmatrixareshowninFig.7-5.Thefollowingremarksmaybemadeaboutacut-setmatrixC(G)ofagraph

G.

1. Asinthecaseoftheincidencematrix,apermutationofrowsorcolumnsina cut-set matrix corresponds simply to a renaming of the cut-sets andedges,respectively.

2. EachrowinC(G)isacut-setvector.

3. Acolumnwithall0’scorrespondstoanedgeformingaself-loop.

4. Parallel edges produce identical columns in the cut-setmatrix (e.g., firsttwocolumnsinFig.7-5).

5. Inanonseparablegraph,everysetofedgesincidentonavertexisacut-set(Problem4-8).Therefore,everyrowofincidencematrixA(G)isincludedas a row in the cut-set matrix C(G). In other words, for a nonseparablegraphG,C(G)containsA(G).Foraseparablegraph,theincidencematrixofeachblockiscontainedinthecut-setmatrix.Forexample,theincidencematrixoftheblock{c,d,e,f,g}inFig.7-5isthe4by5submatrixofCleftafterdeletingrowsa,b,andhandcolumns1,2,5,and8.

6. Inviewofobservation5,

rankofC(G)≥rankofA(G).Hence,foraconnectedgraphofnvertices,

7. Since the number of edges common to a cut-set and a circuit is alwayseven,everyrowinCisorthogonaltoeveryrowinB,providedtheedgesinbothBandCarearrangedinthesameorder.Inotherwords,

Page 193: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.7-5Graphanditscut-setmatrix.

OnapplyingSylvester’stheoremtoEq.(7-7),

rankofB+rankofC≤e.

andsinceforaconnectedgraph

rankofB=e−n+1

Page 194: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

CombiningEqs.(7-6)and(7-8),

rankofC=n−1.

ThuswehavethefollowingimportanttheoremforaconnectedgraphG.

THEOREM7-6

Therankofcut-setmatrixC(G) isequal to the rankof the incidencematrixA(G),whichequalstherankofgraphG.

As in the case of the circuit matrix, the cut-set matrix generally has manyredundant (or linearly dependent) rows.Therefore, it is convenient to define afundamentalcut-setmatrix,Cf,asfollows:Afundamentalcut-setmatrixCf(ofaconnectedgraphGwitheedgesandn

vertices)isan(n−1)byesubmatrixofCsuchthattherowscorrespondtothesetoffundamentalcut-setswithrespecttosomespanningtree.Asinthecaseofafundamentalcircuitmatrix,afundamentalcut-setmatrixCf

canalsobepartitionedintotwosubmatrices,oneofwhichisanidentitymatrixIn−1,ofordern−1.Thatis,

wherethelastn−1columnsformingtheidentitymatrixcorrespondtothen−1branches of the spanning tree, and the first e − n + 1 columns forming Cccorrespondtothechords.A connected graph and a fundamental cut-set matrix with respect to a

spanningtree(showninheavylines)aregiveninFig.7-6.Againnote that in talkingofcut-setmatriceswehaveconfinedourselves to

connected graphs only. This treatment can be generalized to includedisconnectedgraphsbyconsideringonecomponentatatime.

7-7.RELATIONSHIPSAMONGAf,Bf,ANDCf

InthissectionweshallexploretherelationshipsamongthereducedincidencematrixAf,thefundamentalcircuitmatrixBf,andthefundamentalcut-setmatrixCfofaconnectedgraph.Ithasbeenshownthat

Page 195: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

where subscript t denotes the submatrix corresponding to the branches of aspanning tree, and subscript c denotes the submatrix corresponding to thechords.LetthespanningtreeTinEqs.(7-5)and(7-9)bethesame,andlettheorder

of the edges in both equations be the same. Furthermore, in the reducedincidencematrixAf−ofsize(n−1)bye−lettheedges(i.e.,thecolumns)bearrangedinthesameorderasinBfandCf.PartitionAfintotwosubmatrices:

Fig.7-6Spanningtreeinagraphandthecorrespondingfundamentalcut-setmatrix.

whereA, consists of then − 1 columns corresponding to the branches of thespanningtreeT,andAcistheremainingsubmatrixcorrespondingtothee−n+1chords.

Page 196: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

SincethecolumnsinAfandBfarearrangedinthesameorder,fromEq.(7-4)wehave(inmod2arithmetic)

SinceAtisnonsingular,itsinverse exists.PremultiplyingbothsidesofEq.(7-11)by ,weget

Sinceinmod2arithmetic−1=1,

Similarly, since the columns in Bf and Cf are arranged in the same order,accordingtoEq.(7-4),wehave(inmod2arithmetic)

Forexample,letuslookatthefollowingthreematricesforthegraphusedinFigs.7-1,7-5,and7-6.Using{a,e,f,g,h}asthespanningtree,anddroppingthesixthrowfrommatrixAinFig.7-1togetAf,wehave

Page 197: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

isimmediate.Itcanalsobereadilyverifiedthat

Thisleadstothreeconclusions:

1. Given A or Af, we can readily construct Bf and Cf, starting from anarbitraryspanningtreeanditssubgraphA,inAf.

2. GiveneitherBforCf,wecanconstructtheother.ThussinceBfdeterminesagraphwithin2-isomorphism,sodoesCf.

3. GiveneitherBforCf,Afingeneralcannotbedeterminedcompletely.

7-8.PATHMATRIX

Page 198: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Another (0, l)-matrix often convenient to use in communication andtransportationnetworksisthepathmatrix,Apathmatrixisdefinedforaspecificpairofverticesinagraph,say(x,y),andiswrittenasP(x,y).TherowsinP(x,y)correspond to different paths between vertices x and y, and the columnscorrespondtotheedgesinG.Thatis,thepathmatrixfor(x,y)verticesisP(x,y)=[pij],where

pij=1, ifjthedgeliesinithpath,and=0, otherwise.

Asan illustration, consider all pathsbetweenverticesv3 andv4 inFig. 7-1(a).Therearethreedifferentpaths;{h,e},{h,g,c},and{h,f,d,c}.Letusnumberthem1,2,and3,respectively.Thenwegetthe3by8pathmatrixP(v3,v4):

SomeoftheobservationsonecanmakeatonceaboutapathmatrixP(x,y)ofagraphGare

1. Acolumnof all0’s corresponds toanedge thatdoesnot lie in anypathbetweenxandy.

2. Acolumnofall1’scorrespondstoanedgethatliesineverypathbetweenxandy.

3. Thereisnorowwithall0’s.

4. The ring sum of any two rows in P(x, y) corresponds to a circuit or anedge-disjointunionofcircuits.

THEOREM7-7

If the edges of a connected graph are arranged in the same order for thecolumnsoftheincidencematrixAandthepathmatrixP(x,y),thentheproduct(mod2)

A·PT(x,y)=M,

Page 199: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

wherethematrixMhasl′sintworowsxandy,andtherestofthen−2rowsareall0’s.

Proof:Theproofisleftasanexerciseforthereader(Problem7-14).

As an example,multiply the incidencematrix in Fig. 7-1 to the transposedP(v3,v4),justdiscussed.

Otherpropertiesofthepathmatrix,suchastherank,areleftforthereadertoinvestigate on his own. It should be noted that a path matrix contains lessinformationaboutthegraphingeneralthananyofthematricesA,B,orCdoes.

7-9.ADJACENCYMATRIX

Asanalternativetotheincidencematrix,itissometimesmoreconvenienttorepresentagraphby itsadjacencymatrixorconnectionmatrix.TheadjacencymatrixofagraphGwithnverticesandnoparalleledgesisannbynsymmetricbinarymatrixX=[xij]definedovertheringofintegerssuchthat

xij=1, ifthereisanedgebetweenithandjthvertices,and

Page 200: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

=0, ifthereisnoedgebetweenthem.

Fig.7-7Simplegraphanditsadjacencymatrix.

AsimplegraphanditsadjacencymatrixareshowninFig.7-7.ObservationsthatcanbemadeimmediatelyabouttheadjacencymatrixXofa

graphGare

1. TheentriesalongtheprincipaldiagonalofXareall0′s ifandonlyif thegraphhasnoself-loops.Aself-loopattheithvertexcorrespondstoxij=1.

Page 201: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

2. Thedefinitionofadjacencymatrixmakesnoprovisionforparalleledges.ThisiswhytheadjacencymatrixXwasdefinedforgraphswithoutparalleledges.†

3. Ifthegraphhasnoself-loops(andnoparalleledges,ofcourse),thedegreeofavertexequalsthenumberof1′sinthecorrespondingroworcolumnofX.

4. Permutationsofrowsandof thecorrespondingcolumnsimplyreorderingthevertices.Itmustbenoted,however,thattherowsandcolumnsmustbearranged in the sameorder.Thus, if two rowsare interchanged inX, thecorrespondingcolumnsmustalsobe interchanged.Hence twographsG1,andG2withnoparalleledgesareisomorphicifandonlyiftheiradjacencymatricesX(Gt)andX(G2)arerelated:

X(G2)=R−1·X(G1)·R,whereRisapermutationmatrix.

5. AgraphGisdisconnectedandisintwocomponentsg1andg2ifandonlyifitsadjacencymatrixX(G)canbepartitionedas

whereX(g1)istheadjacencymatrixofthecomponentg1andX(g2)isthatofthecomponentg2.This partitioning clearly implies that there exists no edge joining anyvertexinsubgraphg1toanyvertexinsubgraphg2.

6. Givenanysquare,symmetric,binarymatrixQofordern,onecanalwaysconstructagraphGofnvertices(andnoparalleledges)suchthatQistheadjacencymatrixofG.

Powers of X: Let us multiply by itself the 6 by 6 adjacency matrix of thesimple graph in Fig. 7-7. The result, another 6 by 6 symmetricmatrix X2, isshown below (note that this is ordinary matrix multiplication in the ring ofintegersandnotmod2multiplication):

Page 202: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Thevalueofanoff-diagonalentryinX2,thatis,ijthentry(i8800;j)inX2,= numberof1′sinthedotproductofithrowandjthcolumn(orjthrow)ofX.

= numberofpositionsinwhichbothithandjthrowsofXhave1′s.= numberofverticesthatareadjacenttobothithandjthvertices.= numberofdifferentpathsoflengthtwobetweenithandjthvertices.

Similarly,theithdiagonalentryinX2isthenumberof1‛sintheithrow(orcolumn) ofmatrixX. Thus the value of each diagonal entry inX2 equals thedegreeofthecorrespondingvertex,ifthegraphhasnoself-loops.Sinceamatrixcommuteswithmatricesthatareitsownpower,

X·X2=X2·X=X3.

Andsincetheproductoftwosquaresymmetricmatricesthatcommuteisalsoasymmetricmatrix,X3isasymmetricmatrix.(Againnotethatthisisanordinaryproductandnotmod2.)ThematrixX3forthegraphofFig.7-7is

Page 203: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

LetusnowconsidertheijthentryofX3.

ijthentryofX3=dotproductofithrowX2andjthcolumn(orrow)ofX.= ikthentryofX2·kjthentryofX.= numberalldifferentedgesquencesofthreeedgesfromith

jthvertexviakthvertex.=numberofdifferentedgesequences†ofthreeedgesbetween

ithandjthvertices.

Forexample,considerhowthe1,5thentryonX3forthegraphofFig.7-7isformed.Itisgivenbythedotproduct

row1ofX2·row5ofX=(3,1,0,3,1,0)·(l,1,0,1,0,0)

=3+1+0+3+0+0=7.

Thesesevendifferentedgesequencesofthreeedgesbetweenv1andv5are

{e1,e1,e2}{e2,e2,e2}{e6,e6,e2}{e2,e3,e3}{e6,e5,e7}{e2,e5,e5}{e1,e4,e5}

Clearlythislistincludesallthepathsoflengththreebetweenv1andv5,thatis,{e6,e7,e5}and{el,e4,e5}.Itisleftasanexerciseforthereadertoshow(Problem7-19)thatthenthentry

inX3equalstwicethenumberofdifferentcircuitsoflengththree(i.e.,triangles)inthegraphpassingthroughthecorrespondingvertexvi.ThegeneralresultthatincludesthepropertiesofX,X2,andX3discussedso

Page 204: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

farisexpressedinTheorem7-8.

THEOREM7-8

LetXbetheadjacencymatrixofasimplegraphG.ThentheijthentryinXristhenumberofdifferentedgesequencesofredgesbetweenverticesviandvj.

Proof:The theoremholds forr=1, and ithasbeenproved forr=2and3also.Itcanbeprovedforanypositiveintegerr,byinduction.Inotherwords,assumethatitholdsforr−1,andthenevaluatetheijthentry

inX,withthehelpoftherelation

Xr=Xr−1·X,aswasdoneforX3.

Therestoftheproofisleftasanexercise(Problem7-17).

COROLLARYA

Inaconnectedgraph,thedistancebetweentwoverticesviandvj(fori≠j)isk,ifandonlyifhisthesmallestintegerforwhichtheijthentryinxkisnonzero.Thisisausefulresultindeterminingthedistancesbetweendifferentpairsof

vertices.

COROLLARYBIfXistheadjacencymatrixofagraphGwithnvertices,and

Y=X+X2+X3+...+Xn-1, (intheringofintegers),

thenG isdisconnectedifandonlyifthereexistsatleastoneentryinmatrixYthatiszero.

RelationshipBetweenA(G)andX(G):Recall that if a graphG hasno self-loops,itsincidencematrixA(G)containsalltheinformationaboutG.Likewise,ifGhasnoparalleledges,itsadjacencymatrixX(G)containsalltheinformationaboutG.Therefore,ifagraphGhasneitherself-loopsnorparalleledges(i.e.,Gisasimplegraph),bothA(G)andX(G)containtheentireinformation.Thusitisnaturaltoexpectthateithermatrixcanbeobtaineddirectlyfromtheother,inthecaseofasimplegraph.ThisrelationshipisgiveninProblem7-23.

Page 205: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

SUMMARY

The theoryofmatriceshasbeenbrought tobearupon the theoryofgraphs.The use of matrices in studying graphs has been amply demonstrated in thischapter.We have seen that there are severalmatriceswhich can be associatedwith

graphs. Two of these, the incidence matrix A and the adjacency matrix X,describeasimplegraphcompletely,thatis,uptoisomorphism.Twoothers,thecircuitmatrixBandthecut-setmatrixC,displaysomeimportantfeaturesofthegraphanddescribethegraphonlywithin2-isomorphism.ThepathmatrixP(x,y)containsevenlessinformationthanBorCdoes.Toseefurtherintothestructureofthegraph,weinvestigatedthesematrices,

pulledoutsubmatricesAf,Bf,Cf, Iµ, In−1,Bt,Bc,Ct,andCc,andstudied themandtheirinterrelationships.Theproperties brought out in this chapter donot by anymeans exhaust the

list.Many interesting and useful results are contained in the problems of thischapter:Theconverseproblemoffindingagraphtorepresentagivenmatrixhasbeen

touchedupon lightly inSection7-5.Theproblemof realizability, that is,whatconditionsmust a givenmatrixB satisfy so that a graph can be foundwhosecircuit matrix is B, is very useful and interesting. We shall encounter thisproblemofrealizabilityagaininChapter12.

REFERENCES

Someknowledgeofelementarymatrixalgebrawasassumed in thischapter.Forthosenotfamiliarwithmatrices,dozensofgoodbooksareavailable.Outofthese we have listed two, [7-1] and [7-3]. Two somewhat special results, theBinet-CauchytheoremandSylvester′s lawofnullity,areexplainedandprovedinAppendicesAandB,respectively.Most textbooks referred to earlier have some portion devoted to matrices

associated with graphs. Particularly recommended readings are Chapter 13 ofHarary [1-5],Chapter4ofSeshuandReed [1-13], andChapter5ofBusackerand Saaty [1-2]. Gould′s paper [6-4] referred to in the last chapter is alsorelevant to this chapter. A survey paper by Harary [7-2] proves some of theresultsgiveninthischapter.7-1. AITKEN,A.C,“DeterminantsandMatrices,”9thed.,Oliver&BoydLtd.,

Page 206: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Edinburgh,1956.7-2. HARARY, F., “Graphs and Matrices,” SIAM Rev., Vol. 9, No. 1, Jan.,

1967,83-90.7-3. HOHN, F. E., Elementary Matrix Algebra, The Macmillan Company,

NewYork,1958.

PROBLEMS7-1. Write the incidence matrices for the labeled simple graphs shown in

Figs.1-12and4-1(b).PuttheincidencematrixofthegraphofFig.4-1(b)intheblock-diagonalformofEq.(7-1).

7-2. ConsiderthegraphinFig.4-3.Withrespecttothespanningtree{b,c,e,h,k},writematricesAf,Bf,andCfintheformsofEqs.(7-10),(7-5),and(7-9),respectively.VerifybyactualcomputationEqs.(7-13)and(7-15).

7-3. Showthatforasimpledisconnectedgraphofkcomponents,nvertices,andeedgestheranksofmatricesA,B,andCaren−k,e−n+k,andn−k,respectively.

7-4. LabeltheedgesofthegraphinFig.4-8,andwritedownitscircuitmatrixB.Verifyobservations1-5made inSection7-3about thepropertiesofmatrixB.

7-5. Draw two nonisomorphic, connected, simple, and nonseparable graphsG1 andG2,with as small a number of edges as you can, such that thecircuitmatricesB(G1)=B(G2).(Hint:G1andG2are2-isomorphic,andmustbe2-connected.)

7-6. Ablackboxcontainingaswitchingnetworkofsevenswitches−1,2,3,4,5,6,and7−wassubjectedtotheexperimentshowninFig.7-3.Thelampwaslitwheneachofthefollowingcombinationsofswitcheswasturnedon,inadditiontotheexternalswitchk,ofcourse:(1,4,5),(1,4,6,7),(2,5, 7), (2, 6), (3, 5), and (3, 6, 7). Show the switching networkconfiguration.

7-7. In Section 7-5 a graph was obtained corresponding to a givenfundamentalcircuitmatrix.Similarly,sketchaprocedureforobtainingagraph if its fundamental cut-set matrix Cf is given. Can you get twodifferent(nonisomorphic)graphsforthesameCf?Ifyes,howarethesedifferentgraphsrelated?

7-8. Showthatyoucandetermineagraphwithin2-isomorphismifyouweregiven the set of all spanning trees. (Hint: From the set of all spanningtreeseverycut-setcanbedetermined,usingTheorem4-2.Andthesetof

Page 207: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

allcut-setsdeterminesagraphwithin2-isomorphism.)7-9. IfthefollowingisthelistofallspanningtreesofagraphG,determine

G.

{a,c,d,e},{a,c,d,f},{b,c,d,e},{b,c,d,f},{a,c,e,f},{b,c,e,f},{a,d,e,f},{b,d,e,f},{a,b,d,e},{a,b,d,f},{a,b,e,f}.

7-10. Expresstherelationshipofdualismbetweentwoplanar,simplegraphsintermsofappropriatematrices.

7-11. Characterizesimple,self-dualgraphsintermsoftheircircuitandcut-setmatrices.

7-12. Provethat

7-13. Write down the pathmatrix P(v1, v6) for the graph in Fig. 4-3.Verifyobservations1-4inSection7-8andTheorem7-7.

7-14. ProveTheorem7-7.7-15. Characterize Af, Bf, Cf, and X matrices of the complete graph of n

vertices.7-16. AfterhavinglabeledthegraphinFig.4-8(asrequiredinProblem7-4),

write its adjacency matrix X. How does the fact that the graph isseparable reflect in X? Characterize the adjacency matrix X of aseparablegraph,ingeneral.

7-17. CompletetheproofofTheorem7-8.7-18. Thediameterofaconnectedgraphisdefined(Chapter3)asthelargest

distancebetween twovertices in thegraph.Given theadjacencymatrixX, how will you determine the diameter of the corresponding graph?(Hint:ConsiderasumofthepowersofX.)

7-19. ShowthateachdiagonalentryinX3equalstwicethenumberoftrianglespassingthroughthecorrespondingvertex.

7-20. Provethatthenumberofspanningtreesinaconnectedgraphequalsthevalueof

whereAfisthereducedincidencematrixofthegraph,andthearithmeticoperationsarecarriedoutintherealfieldandnotmod2.

Page 208: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

7-21. Similartothecircuitorcut-setmatrix,defineaspanning-treematrixforaconnectedgraph,andobservesomeofitsproperties.

7-22. LetCbethecut-setmatrixofanonseparablegraphG,andletC(x,y)bethesubmatrixofC,containingonly those rowsofC that representcut-sets with respect to vertices x and y. Show that C(x, y) contains afundamentalcut-setmatrixCfofG.

7-23. ForalabeledgraphGofnvertices,defineannbyndiagonalmatrixD(called the degree matrix ofG) such that the ith diagonal entry in Dequals the degree of the ith vertex in G. Define another matrix E,obtainedfromtheincidencematrixAofGbyarbitrarilyreplacingoneofthe two l′s in every column by a −1. Show that if G is a simple,connectedgraphthefollowingholds(thecomputationsareintheringofintegersandnotmod2):(a)E·ET=D-X.(b)AllcofactorsofthematrixD−Xareequal.(c)Each cofactor ofD−X equals the number of spanning trees inG,

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

(Theorem3-10).7-25. LetxandybeapairofverticesinasimplenonseparablegraphG,and

P(x,y)bethecorrespondingpathmatrixofG.ProvethateverycircuitinG isobtainedasamod2sumof tworowsofP(x,y).Fromthis result,provethatapathmatrixinasimple,nonseparablegraphdeterminesthegraphwithin2-isomorphism.[Hint:EverycircuitГ inGfalls inoneofthreecategories:(1)Гpassesthroughbothxandy;(2)Tpassesthroughneitherxnory;or(3)Tpasses througheitherxory.Considerall threecases,anduseTheorem4-11.]

7-26. Provethatforaconnected,self-loop-freegraphG,subspacesWГandWsareorthogonalcomplementsofWGoverGF(2)ifandonlyifthenumberofspanningtreesinGisodd.[Hint:DefineanewebyematrixCompute det(MMT), using the identity , and the Binet-Cauchytheorem(seeAppendixA).Showthatdet(MMT)=1(mod2)ifandonlyifGhasanoddnumberofspanningtrees.]

†Althoughmatricesarecustomarilydefinedoveracommutative ringwith identity,whichneednotbeafield (such as the ring of integers), we have definedmatrixA over a field, GF(2), in keepingwith ourdefinitionofthevectorspaceWGinChapter6.† Just as in any two alternative methods of representation, some properties are more evident in one

Page 209: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

representation than in the other. For example, the fact that the graph is planar is obvious in Fig. 7-1(a),whereasitisnotatallobviousfromthematrixinFig.7-1(b).†Someauthors(seeBusackerandSaaty[1-2],page109,forexample)definexijasequaltothenumberofedgesincidentonbothverticesiandj,andthustakeintoaccountparalleledges.†Anedgesequenceisasequenceofedgesinwhicheachedge(except,ofcourse,thefirstandthelast)hasonevertexincommonwiththeedgeprecedingitandonevertexincommonwiththeedgefollowingit.Apath,acircuit,andawalkareall specialexamplesofanedgesequence.Anedgemayappearmore thanonceinanedgesequence.

Page 210: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

8COLORING,COVERING,ANDPARTITIONING

SupposethatyouaregivenagraphGwithnverticesandareaskedtopaintitsvertices such that no two adjacent vertices have the same color.What is theminimumnumberofcolorsthatyouwouldrequire?Thisconstitutesacoloringproblem.Havingpaintedthevertices,youcangroupthemintodifferentsets—one set consisting of all red vertices, another of blue, and so forth. This is apartitioningproblem.Thecoloringandpartitioningcan,ofcourse,beperformedonedgesorverticesofagraph.Inthecaseofaplanargraph,onemayevenbeinterested in coloring the regions. These are the types of questions to beconsideredinthischapter.Earlierwecameacrossthesubjectofpartitioningtheedgesofagivengraph

intosetswithsomespecifiedproperties.Forexample,findingaspanningtreeinaconnectedgraphisequivalenttopartitioningtheedgesintotwo-sets—onesetconsistingoftheedgesincludedinthespanningtree,andtheotherconsistingofthe remaining edges. Identification of a Hamiltonian circuit (if it exists) isanotherpartitioningofthesetofedgesinagivengraph.The coloring and partitioning of vertices (or edges) is not performedout of

mere playfulness, as it may appear from this introduction. Partitioning isapplicable to many practical problems, such as coding theory, partitioning oflogicindigitalcomputers,andstatereductionofsequentialmachines.

8-1.CHROMATICNUMBER

Painting all the vertices of a graph with colors such that no two adjacentverticeshavethesamecoloriscalledthepropercoloring(orsometimessimplycoloring)ofagraph.Agraph inwhicheveryvertexhasbeenassignedacoloraccording to a proper coloring is called a properly colored graph. Usually agivengraphcanbeproperlycoloredinmanydifferentways.Figure8-1showsthreedifferentpropercoloringsofagraph.

Page 211: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.8-1Propercoloringsofagraph.

Thepropercoloringwhichisofinteresttousisonethatrequirestheminimumnumber of colors. A graph G that requires κ different colors for its propercoloring,andnoless,iscalledaκ-chromaticgraph,andthenumberκiscalledthe chromatic number ofG. You can verify that the graph in Fig. 8-1 is 3-chromatic.Incoloringgraphsthereisnopointinconsideringdisconnectedgraphs.How

wecolorverticesinonecomponentofadisconnectedgraphhasnoeffectonthecoloringoftheothercomponents.Therefore,itisusualtoinvestigatecoloringofconnectedgraphsonly.Allparalleledgesbetweentwoverticescanbereplacedby a single edge without affecting adjacency of vertices. Self-loops must bedisregarded. Thus for coloring problems we need to consider only simple,connectedgraphs.Someobservationsthatfollowdirectlyfromthedefinitionsjustintroducedare

1. Agraphconsistingofonlyisolatedverticesis1-chromatic.

2. Agraphwithoneormoreedges(notaself-loop,ofcourse) isat least2-chromatic(alsocalledbichromatic).

3. A complete graph of n vertices is n-chromatic, as all its vertices areadjacent. Hence a graph containing a complete graph of r vertices is atleastr-chromatic.Forinstance,everygraphhavingatriangleisatleast3-chromatic.

4. Agraphconsistingofsimplyonecircuitwithn≥3verticesis2-chromaticifn isevenand3-chromatic ifn isodd. (Thiscanbeseenbynumberingvertices1,2,...,ninsequenceandassigningonecolortooddverticesand

Page 212: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

anothertoeven.Ifniseven,noadjacentverticeswillhavethesamecolor.Ifnisodd,thenthandfirstvertexwillbeadjacentandwillhavethesamecolor,thusrequiringathirdcolorforpropercoloring.)

Propercoloringofagivengraphissimpleenough,butapropercoloringwiththeminimumnumberofcolorsis, ingeneral,adifficult task.Infact, therehasnot yet been found a simpleway of characterizing a κ-chromatic graph. (Thebrute-forcemethodofusingallpossiblecombinationscan,ofcourse,alwaysbeapplied, as in any combinatorial problem. But brute force is highlyunsatisfactory, because it gets out of hand as soon as the size of the graphincreasesbeyondafewvertices.)Chromaticnumbersofsomespecifictypesofgraphswillbediscussedintherestofthissection.

THEOREM8-1

Everytreewithtwoormoreverticesis2-chromatic.

Proof:Selectanyvertexv inthegiventreeT.ConsiderTasarootedtreeatvertexv.Paintvwithcolor1.Paintallverticesadjacenttovwithcolor2.Next,paint the vertices adjacent to these (those that just have been coloredwith 2)usingcolor1.ContinuethisprocesstilleveryvertexinThasbeenpainted.(SeeFig.8-2).NowinTwefindthatallverticesatodddistancesfromvhavecolor2,whilevandverticesatevendistancesfromvhavecolor1.NowalonganypathinTtheverticesareofalternatingcolors.Sincethereis

one and only one path between any two vertices in a tree, no two adjacentverticeshavethesamecolor.ThusThasbeenproperlycoloredwithtwocolors.Onecolorwouldnothavebeenenough(observation2inthissection).

Though a tree is 2-chromatic, not every 2-chromatic graph is a tree. (Theutilitiesgraph,forinstance,isnotatree.)Whatthenisthecharacterizationofa2-chromatic graph? Theorem 8-2 (due toKönig) characterizes all 2-chromaticgraphs.

Page 213: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.8-2Propercoloringofatree.

THEOREM8-2

Agraphwithatleastoneedgeis2-chromaticifandonlyifithasnocircuitsofoddlength.

Proof: Let G be a connected graph with circuits of only even lengths.ConsideraspanningtreeTinG.UsingthecoloringprocedureandtheresultofTheorem8-1,letusproperlycolorTwithtwocolors.NowaddthechordstoTone by one. SinceG had no circuits of odd length, the end vertices of everychord being replaced are differently colored inT. ThusG is coloredwith twocolors, with no adjacent vertices having the same color. That is, G is 2-chromatic.Conversely, ifG has a circuit of odd length, we would need at least three

colorsjustforthatcircuit(observation4inthissection).Thusthetheorem.

AnupperlimitonthechromaticnumberofagraphisgivenbyTheorem8-3,whoseproofisleftasanexercise(Problem8-1).

THEOREM8-3IfdmaxisthemaximumdegreeoftheverticesinagraphG,

chromaticnumberofG≤1+dmax.

Brooks [8-1] showed that thisupperboundcanbe improvedby1 ifG hasnocompletegraphofdmax+1vertices.Inthatcase

chromaticnumberofG≤dmax.

Page 214: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

AgraphG iscalledbipartite if itsvertexsetVcanbedecomposedinto twodisjointsubsetsV1andV2suchthateveryedgeinGjoinsavertexinV1withavertexinV2.Thuseverytreeisabipartitegraph.SoarethegraphsinFigs.8-6and 8-8. Obviously, a bipartite graph can have no self-loop. A set of paralleledges between a pair of vertices can all be replaced with one edge withoutaffectingbipartitenessofagraph.Clearly, every 2-chromatic graph is bipartite because the coloring partitions

thevertexsetintotwosubsetsV1andV2suchthatnotwoverticesinV1(orV2)are adjacent. Similarly, every bipartite graph is 2-chromatic, with one trivialexception;agraphoftwoormoreisolatedverticesandwithnoedgesisbipartitebutis1-chromatic.Ingeneralizingthisconcept,agraphGiscalledp-partiteifitsvertexsetcan

bedecomposed intop disjoint subsetsV1,V2, . . . ,Vp, such thatnoedge inGjoinstheverticesinthesamesubset.Clearly,aκ-chromaticgraphisp-partiteifandonlyif

κ≤p.

With this qualification, the results of this sectiononκ-chromatic graphs areapplicabletoκ-partitegraphsalso.

8-2.CHROMATICPARTITIONING

Aproper coloringof agraphnaturally induces apartitioningof theverticesinto different subsets. For example, the coloring in Fig. 8-1(c) produces thepartitioning

{v1,v4},{v2},and{v3,v5}.

No twovertices inanyof these three subsets areadjacent.Sucha subsetofverticesiscalledanindependentset;moreformally:A set of vertices in a graph is said to be an independent set of vertices or

simplyan independentset (oran internallystableset) ifnotwovertices in theset are adjacent. For example;’ in Fig. 8-3, {a, c,d} is an independent set.Asinglevertexinanygraphconstitutesanindependentset.A maximal independent set (or maximal internally stable set) is an

independent set towhich no other vertex can be addedwithout destroying its

Page 215: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

independenceproperty.Theset{a,c,d,f}inFig.8-3isamaximalindependentset.Theset{b,f}isanothermaximalindependentset.Theset{b,g}isathirdone.Fromtheprecedingexample,it isclearthatagraph,ingeneral,hasmanymaximal independent sets; and they may be of different sizes. Among allmaximal independent sets, onewith the largest number of vertices is often ofparticularinterest.Suppose that thegraph inFig.8-3describes thefollowingproblem.Eachof

the seven vertices of the graph is a possible code word to be used in somecommunication. Some words are so close (say, in sound) to others that theymightbeconfusedforeachother.Pairsofsuchwordsthatmaybemistakenforoneanotherarejoinedbyedges.Findalargestsetofcodewordsforareliablecommunication. This is a problem of finding amaximal independent setwithlargestnumberofvertices.Inthissimpleexample,{a,c,d,f}isananswer.

Fig.8-3

Thenumberofvertices in the largest independentsetofagraphG iscalledtheindependencenumber(orcoefficientofinternalstability),β{G).Consideraκ-chromaticgraphGofnverticesproperlycoloredwithκdifferent

colors. Since the largest number of vertices inG with the same color cannotexceedtheindependencenumberβ(G),wehavetheinequality

Finding a Maximal Independent Set: A reasonable method of finding amaximalindependentsetinagraphGwillbetostartwithanyvertexvofGintheset.Addmoreverticestotheset,selectingateachstageavertexthatisnotadjacenttoanyofthosealreadyselected.Thisprocedurewillultimatelyproducea maximal independent set. This set, however, is not necessarily a maximalindependentsetwith.alargestnumberofvertices.

Page 216: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

FindingAllMaximal Independent Sets:A reasonable (but not very efficientforlargegraphs)methodforobtainingallmaximalindependentsetsinanygraphcanbedevelopedusingBooleanarithmeticonthevertices.Leteachvertexinthegraphbe treatedasaBooleanvariable.Let the logical(orBoolean)suma+bdenote the operation of including vertex a or b or both; let the logicalmultiplicationabdenotetheoperationofincludingbothverticesaand6,andlettheBooleancomplementa′denotethatvertexaisnotincluded.ForagivengraphGwemustfindamaximalsubsetofverticesthatdoesnot

includethetwoendverticesofanyedgeinG.Letusexpressanedge(x,y)asaBooleanproduct,xy,ofitsendverticesxandy,andletussumallsuchproductsinGtogetaBooleanexpression

φ=Σxyforall(x,y)inG.

LetusfurthertaketheBooleancomplementφ′ofthisexpression,andexpressitasasumofBooleanproducts:

φ′=f1+f2+...+fk.

Avertexsetisamaximalindependentsetifandonlyifφ=0(logicallyfalse),whichispossibleifandonlyifφ′=1(true),whichispossibleifandonlyifatleastonefi.=1,whichispossibleifandonlyifeachvertexappearinginf1,(incomplementedform)isexcludedfromthevertexsetofG.Thuseachfiwillyieldamaximalindependentset,andeverymaximalindependentsetwillbeproducedby thismethod.This procedure can be best explained by an example. For thegraphGinFig.8-3,

φ=ab+bc+bd+be+ce+de+ef+eg+fg,φ′=(a′+b′)(b′+c′)(b′+d′)(b′+e′)(c′+e′)(d′+e′)

(e′+f′)(e′+g′)(f′+g′).

MultiplyingtheseoutandemployingtheusualidentitiesofBooleanarithmetic,suchas

Page 217: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

weget

φ′=b′e′f+b′e′g′+a′c′d′e′f+a′c′d′e′g+b′c′d′f′g′.

Now ifwe exclude from the vertex set ofG vertices appearing in any one ofthese five terms, we get a maximal independent set. The five maximalindependentsetsare

acdf,acdg,bg,bf,andae.

Theseareallthemaximalindependentsetsofthegraph.

Finding Independence and Chromatic Numbers: Once all the maximalindependentsetsofGhavebeenobtained,wefindthesizeoftheonewiththelargest number of vertices to get the independence number β(G). TheindependencenumberofthegraphinFig.8-3isfour.To find the chromatic number ofG,wemust find theminimumnumber of

these(maximal independent)sets,whichcollectively includeall theverticesofG. For the graph inFig. 8-3, sets {a,c,d, f}, {b,g}, and {a,e}, for example,satisfythiscondition.Thusthegraphis3-chromatic.

Chromatic Partitioning: Given a simple, connected graph G, partition allvertices ofG into the smallest possible number of disjoint, independent sets.This problem, known as the chromatic partitioning of graphs, is perhaps themostimportantprobleminpartitioningofgraphs.Byenumeratingallmaximalindependentsetsandthenselectingthesmallest

numberofsetsthatincludeallverticesofthegraph,wejustsolvedthisproblem.The following four are somechromatic partitionsof thegraph inFig. 8-3, forexample.

{(a,c,d,f),(b,g),(e)},{(a,c,d,g),(b,f),(e)},{(c,d,f),(b,g),(a,e)},{(c,d,g),(b,f),(a,e)}.

Page 218: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.8-4A3-chromaticgraph.

Thismethodofchromaticpartitioning(requiringenumerationofallmaximalindependent sets) is inefficient and needs prohibitively large amounts ofcomputer memory. A more efficient method for computer implementation isproposedin[8-6].

UniquelyColorableGraphs:Agraphthathasonlyonechromaticpartitioniscalled a uniquely colorable graph. The graph in Fig. 8-3 is not a uniquelycolorablegraph,but theone inFig.8-4 is (Problem8-2).Forsome interestingpropertiesofuniquelycolorablegraphs, the reader is referred toChapter12of[1-5].Aconceptrelatedtothatoftheindependentsetandchromaticpartitioningis

thedominatingset,tobediscussednext.

DominatingSets:Adominatingset(oranexternallystableset)inagraphGisasetofverticesthatdominateseveryvertexvinGinthefollowingsense:Eithervisincludedinthedominatingsetorisadjacenttooneormoreverticesincludedinthedominatingset.Forinstance, thevertexset{b,g}isadominatingset inFig.8-3.Soistheset{b,g,b,g,f}adominatingset.Adominatingsetneednotbeindependent.Forexample,thesetofall itsverticesistriviallyadominatingsetineverygraph.In many applications one is interested in finding minimal dominating sets

definedasfollows:Aminimaldominating set is a dominating set fromwhichnovertex canbe

removedwithout destroying its dominance property. For example, inFig. 8-3,{b, e} is a minimal dominating set. And so is {a, c, d, f}. Observations thatfollowfromthesedefinitionsare

Page 219: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

1. Anyonevertexinacompletegraphconstitutesaminimaldominatingset.

2. Everydominatingsetcontainsatleastoneminimaldominatingset.

3. Agraphmayhavemanyminimaldominatingsets,andofdifferentsizes.[ThenumberofverticesinthesmallestminimaldominatingsetofagraphGiscalledthedominationnumber,α(G).]

4. Aminimaldominatingsetmayormaynotbeindependent.

5. Everymaximalindependentsetisadominatingset.Forifanindependentsetdoesnotdominatethegraph,thereisatleastonevertexthatisneitherinthesetnoradjacenttoanyvertexintheset.Suchavertexcanbeaddedto the independent setwithout destroying its independence.But then theindependentsetcouldnothavebeenmaximal.

6. An independent set has the dominance property only if it is a maximalindependent set. Thus an independent dominating set is the same as amaximalindependentset.

7. InanygraphG,

α(G)≤ß(G).

Finding Minimal Dominating Sets: A method for obtaining all minimaldominatingsetsinagraphwillnowbedeveloped.Themethod,liketheoneforfindingallmaximalindependentsets,alsousesBooleanarithmetic.To dominate a vertex vi we must either include vi or any of the vertices

adjacent toviAminimum set satisfying this condition for everyvertexvi is adesiredset.Therefore,foreveryvertexviinGletusformaBooleanproductofsums(vi+vi1+vi2+...+vi3),wherevi1,vi2,...,vi3aretheverticesadjacenttovi,anddisthedegreeofvi

θ=Π(vi+vi1+vi2+...vi3)forallviinG.

When θ is expressed as a sum of products, each term in it will represent aminimaldominatingset.LetusillustratethisalgorithmusingthegraphofFig.8-3:ConsiderthefollowingexpressionθforFig.8-3:

θ=(a+b)(b+c+d+e+a)(c+b+e)(d+b+e)(e+b+c+d+f+g)(f+e+g)(g+e+f).

Page 220: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

SinceinBooleanarithmetic(x+y)x=x,

θ=(a+b)(b+c+e)(b+d+e)(e+f+g)=ae+be+bf+bg+acdf+acdg.

Each of the six terms in the preceding expression represents a minimaldominatingset.Clearly,α(G)=2,forthisexample.

8-3.CHROMATICPOLYNOMIAL

In general, a given graphG of n vertices can be properly colored inmanydifferentways using a sufficiently large number of colors. This property of agraph is expressed elegantly by means of a polynomial. This polynomial iscalledthechromaticpolynomialofGandisdefinedasfollows:ThevalueofthechromaticpolynomialPn(λ)ofagraphwithnverticesgives

thenumberofwaysofproperlycoloringthegraph,usingλorfewercolors.Letci be thedifferentwaysofproperly coloringG using exactly i different

colors.Sinceicolorscanbechosenoutofλcolorsin

thereare differentwaysofproperlycoloringGusingexactlyicolorsoutofλcolors.Sinceicanbeanypositiveintegerfrom1ton(itisnotpossibletousemore

thanncolorsonnvertices), thechromaticpolynomialisasumoftheseterms;thatis,

Eachcihastobeevaluatedindividuallyforthegivengraph.Forexample,anygraphwithevenoneedge requiresat least twocolors forpropercoloring, and

Page 221: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

therefore

c1=0.

Agraphwithnverticesandusingndifferentcolorscanbeproperlycoloredinn!ways;thatis,

cn=n!.Asanillustration,letusfindthechromaticpolynomialofthegraphgivenin

Fig.8-4.

SincethegraphinFig.8-4hasatriangle,itwillrequireatleastthreedifferentcolorsforpropercoloring.Therefore,

c1=c2=0andc5=5!.

Moreover,toevaluatec3,supposethatwehavethreecolorsx,y,andz.Thesethreecolorscanbeassignedproperlytoverticesv1,v2,andv3in3!=6differentways.Havingdonethat,wehavenomorechoices left,becausevertexv5musthavethesamecolorasv3,andv4musthavethesamecolorasv2.Therefore,

c3=6.

Similarly,withfourcolors,v1,v2,andv3canbeproperlycoloredin4·6=24differentways.Thefourthcolorcanbeassignedtov4orv5,thusprovidingtwochoices.Thefifthvertexprovidesnoadditionalchoice.Therefore,

c4=24·2=48.

SubstitutingthesecoefficientsinP5(λ),weget,forthegraphinFig.8-4,

P5(λ)=λ(λ−1)(λ−2)+2λ(λ−1)(λ−2)(λ−3)+λ(λ−1)(λ−2)(λ−3)(λ−4)

Page 222: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

=λ(λ−1)(λ−2)(λ2−5λ+7).

Thepresenceoffactorsλ–1andλ–2indicatesthatGisatleast3-chromatic.Chromaticpolynomialshavebeenstudiedingreatdetailintheliterature.The

interested reader is referred to [8-5] for a more thorough discussion of theirproperties.Theorems8-4,8-5,and8-6shouldprovideaglimpseintothecolorfulworldofchromaticpolynomials.

THEOREM8-4

A graph of n vertices is a complete graph if and only if its chromaticpolynomialis

Pn(λ)=λ(λ−1)(λ−2)...(λ−n+1).

Proof:Withλcolors,thereareλdifferentwaysofcoloringanyselectedvertexofagraph.Asecondvertexcanbecoloredproperlyinexactlyλ–1ways,thethirdinλ–2ways,thefourthinλ–3ways,...,andthenthinλ–n+1waysifand only if every vertex is adjacent to every other. That is, if and only if thegraphiscomplete.

THEOREM8-5

Ann-vertexgraphisatreeifandonlyifitschromaticpolynomial

Pn(λ)=λ(λ−1)n−1

Proof:Thatthetheoremholdsforn=1,2isimmediatelyevident.Itisleftasanexercisetoprovethetheorembyinduction(Problem8-9).

THEOREM8-6

Let a and b be two nonadjacent vertices in a graphG. LetG′ be a graphobtainedbyaddinganedgebetweenaandb.LetG″beasimplegraphobtainedfromG by fusing the vertices a and b together and replacing sets of paralleledgeswithsingleedges.Then

Pn(λ)ofG=Pn(λ)ofG′+Pn−1(λ)ofG″.

Proof:ThenumberofwaysofproperlycoloringGcanbegrouped into twocases,onesuchthatverticesaandbareofthesamecolorandtheothersuchthat

Page 223: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

aandbareofdifferentcolors.SincethenumberofwaysofproperlycoloringGsuch thataandbhavedifferentcolors=numberofwaysofproperlycoloringG′,andnumberofwaysofproperlycoloringGsuchthataandbhavethesamecoloi=numberofwaysofproperlycoloringG″,

Fig.8-5Evaluationofachromaticpolynomial.

P(λ)ofG=Pn(λ)ofG′+Pn−1(λ)ofG″.

Theorem8-6isoftenusedinevaluatingthechromaticpolynomialofagraph.Forexample,Fig.8-5illustrateshowthechromaticpolynomialofagraphGisexpressedasasumofthechromaticpolynomialsoffourcompletegraphs.Thepair of nonadjacent vertices shown enclosed in circles is the one used forreductionatthatstage.Inthelastthreesectionswehavebeenconcernedwithpropercoloringofthe

vertices inagraph.Suppose thatweare interested incoloring theedgesratherthanthevertices.Itisreasonabletocalltwoedgesadjacentiftheyhaveoneend

Page 224: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

vertexincommon(butarenotparallel).Apropercoloringofedgesthenrequiresthat adjacent edges should be of different colors. Some results on propercoloring of edges, similar to the results given inSections 8-1 and 8-2, can bederived(Problem8-19).Moreover, a set of edges in which no two are adjacent is similar to an

independentsetofvertices.Suchasetofedgesiscalledamatching,thesubjectofthenextsection.

8-4.MATCHINGS

Fig.8-6Bipartitegraph.

Supposethatfourapplicantsa1,a2,a3,anda4areavailabletofillsixvacantpositionsp1,p2,p3,p4,p5,andp6.Applicanta1isqualifiedtofillpositionp2orp5.Applicanta2canfillp2orp5.Applicanta3isqualifiedforp1,p2,p3,p4,orp6.Applicanta4canfilljobsp2orp5.ThissituationisrepresentedbythegraphinFig. 8-6. The vacant positions and applicants are represented by vertices. Theedgesrepresentthequalificationsofeachapplicantforfillingdifferentpositions.Thegraphclearlyisbipartite,theverticesfallingintotwosetsV1={a1,a2,a3,a4}andV2={p1,p2,p3,p4,p5,p6}.

Fig.8-7Graphandtwoofitsmaximalmatchings.

Page 225: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Thequestionsone ismost likely toask in thissituationare: Is itpossible tohirealltheapplicantsandassigneachapositionforwhichheissuitable?Iftheanswerisno,whatisthemaximumnumberofpositionsthatcanbefilledfromthegivensetofapplicants?This is a problem ofmatching (or assignment) of one set of vertices into

another.Moreformally,amatchinginagraphisasubsetofedgesinwhichnotwoedgesareadjacent.Asingleedgeinagraphisobviouslyamatching.Amaximal matching is a matching to which no edge in the graph can be

added.Forexample, inacompletegraphof threevertices (i.e., a triangle)anysingleedgeisamaximalmatching.TheedgesshownbyheavylinesinFig.8-7aretwomaximalmatchings.Clearly,agraphmayhavemanydifferentmaximalmatchings,andofdifferentsizes.Amongthese,themaximalmatchingswiththelargestnumberofedgesarecalledthelargestmaximalmatchings.InFig.8-7(b),alargestmaximalmatchingisshowninheavylines.Thenumberofedgesinalargestmaximalmatchingiscalledthematchingnumberofthegraph.Althoughmatchingisdefinedforanygraph,itismostlystudiedinthecontext

ofbipartitegraphs,assuggestedbytheintroductiontothissection.InabipartitegraphhavingavertexpartitionV1andV2,acompletematchingofverticesinsetV1intothoseinV2isamatchinginwhichthereisoneedgeincidentwitheveryvertexinV1.Inotherwords,everyvertexinV1ismatchedagainstsomevertexinV2.Clearly,acompletematching(ifitexists)isalargestmaximalmatching,whereastheconverseisnotnecessarilytrue.FortheexistenceofacompletematchingofsetV1 intosetV2,firstwemust

haveatleastasmanyverticesinV2asthereareinV1.Inotherwords,theremustbe at least as many vacant positions as the number of applicants if all theapplicants are to be hired. This condition, however, is not sufficient. Forexample, in Fig. 8-6, although there are six positions and four applicants, acompletematchingdoesnot exist.Of the three applicantsa1,a2; anda4, eachqualifies for the same two positionsp2 andp5, and therefore one of the threeapplicantscannotbematched.Thisleadsustoanothernecessaryconditionforacompletematching;Every

subsetofrverticesinV1mustcollectivelybeadjacenttoatleastrverticesinV2,forallvaluesofr=1,2,..., |V1 |.ThisconditionisnotsatisfiedinFig.8-6.Thesubset{a1,a2,a4}ofthreeverticeshasonlytwoverticesp2andp5adjacentto them. That this condition is also sufficient for existence of a completematching is indeedsurprising.Theorem8-7 isa formalstatementandproofofthisresult.

Page 226: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

THEOREM8-7

AcompletematchingofV1 intoV2 in abipartitegraphexists if andonly ifeverysubsetofrverticesinV1iscollectivelyadjacenttorormoreverticesinV2forallvaluesofr.

Proof: The “only if” part (i.e., the necessity of a subset of r applicantscollectively qualifying for at least r jobs) is immediate and has already beenpointedout.Thesufficiency(i.e.,the“if”part)canbeprovedbyinductiononr,as the theorem trivially holds for r = 1. For a complete proof, the student isreferredtoTheorem11-1in[8-3],Theorem5-19in[4-5],orChapter4in[1-9].

Letusillustratethisimportanttheoremwithanexample.

Problem of Distinct Representatives: Five senators s1, s2, s3, s4, and s5 aremembersofthreecommittees,c1,c2,andc3.ThemembershipisshowninFig.8-8.Onememberfromeachcommitteeistoberepresentedinasuper-committee.Isitpossibletosendonedistinctrepresentativefromeachofthecommitteest†?ThisproblemisoneoffindingacompletematchingofasetV1intosetV2ina

bipartite graph. Let us use Theorem 8-7 and check if r vertices from V1 arecollectivelyadjacenttoatleastrverticesfromV2,forallvaluesofr.TheresultisshowninTable8-1(ignorethelastcolumnforthetimebeing).Thusforthisexampletheconditionfortheexistenceofacompletematching

is satisfied as stated in Theorem 8-7. Hence it is possible to form the super-committeewithonedistinctrepresentativefromeachcommittee.

Fig.8-8Membershipofcommittees.

V1 V2 r–q

–1

Page 227: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

r=1 {c1} {s1,s2}–1

{c2} {s1,s3,s4} –2

{c3} {s3,s4,s5} –2

r=2 {c1,c2} {s1,s2,s3,s4} –2

{c2,c3} {s1,s3,s4,s5} –2

{c3,c1} {s1,s2,s3,s4,s5} –3

r=3 {c1,c2,c3} {s1,s2,s3,s4,s5} –2

Table8-1

Theproblemofdistinctrepresentativesjustsolvedwasasmallone.Alargerproblemwouldhavebecomeunwieldy.IfthereareMverticesinV1,Theorem8-7requiresthatwetakeall2M–1nonemptysubsetsofV1andfindthenumberofverticesofV2adjacentcollectivelytoeachofthese.Inmostcases,however,thefollowing simplified version of Theorem 8-7 will suffice for detection of acompletematchinginanylargegraph.

THEOREM8-8

InabipartitegraphacompletematchingofV1intoV2existsif(butnotonlyif)thereisapositiveintegermforwhichthefollowingconditionissatisfied:

degreeofeveryvertexinV1≥m≥degreeofeveryvertexinV2.

Proof:ConsiderasubsetofrverticesinV1.Theserverticeshaveatleastm·redgesincidentonthem.Eachm·redgeisincidenttosomevertexinV2.SincethedegreeofeveryvertexinsetV2isnogreaterthanm,thesem·redgesareincidentonatleast(m·r)/m=rverticesinV2.Thus any subset of r vertices in V1 is collectively adjacent to r or more

vertices in V2. Therefore, according to Theorem 8-7, there exists a completematchingofV1intoV2.InthebipartitegraphofFig.8-8,

degreeofeveryvertexinV1≥2≥degreeofeveryvertexinV2.

Page 228: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Therefore,thereexistsacompletematching.InthebipartitegraphofFig.8-6nosuchnumberisfound,becausethedegree

ofp2=4>degreeofa1.It must be emphasized that the condition of Theorem 8-8 is a sufficient

conditionandnotnecessaryfortheexistenceofacompletematching.Itwillbeinstructive for the reader to sketch a bipartite graph that does not satisfyTheorem8-8andyethasacompletematching(Problem8-15).Thematchingproblemortheproblemofdistinctrepresentativesisalsocalled

themarriage problem (whose solution, unfortunately, is of little use to thosewithrealmaritalproblems!)SeeProblem8-16.Ifonefailstofindacompletematching,heismostlikelytobeinterestedin

findingamaximalmatching,thatis,topairoffasmanyverticesofV1withthoseinV2 aspossible.For thispurpose, letusdefineanew termcalleddeficiency,δ(G),ofabipartitegraphG.AsetofrverticesinV1iscollectivelyincidenton,say,qverticesofV2.Then

themaximumvalueofthenumberr–qtakenoverallvaluesofr=1,2,...andallsubsetsofV1iscalledthedeficiencyδ(G)ofthebipartitegraphG.Theorem 8-7, expressed in terms of the deficiency, states that a complete

matchinginabipartitegraphGexistsifandonlyif

δ(G)≤0.

Forexample,thedeficiencyofthebipartitegraphinFig.8-7is–1(thelargestnumberinthelastcolumnofTable8-1).ItissuggestedthatyouprepareatableforthegraphofFig.8-6,similartoTable8-1,andverifythatthedeficiencyis+1forthisgraph(Problem8-17).Theorem8-9givesthesizeofthemaximalmatchingforabipartitegraphwith

apositivedeficiency.

THEOREM8-9

ThemaximalnumberofverticesinsetV1thatcanbematchedintoV2isequalto

numberofverticesinV1–δ(G),

The proof of Theorem 8-9 can be found in [8-3], page 288. The size of amaximalmatchinginFig.8-6,usingTheorem8-9,isobtainedasfollows:

Page 229: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

numberofverticesinV1–δ(G)=4–1=3.

Matching and Adjacency Matrix: Consider a bipartite graph G withnonadjacent sets of verticesV1 andV2, having number of vertices n1 and n2,respectively, and let n1 ≤ n2, n1 + n2 = n, the number of vertices inG. TheadjacencymatrixX(G)ofGcanbewrittenintheform

wherethesubmatrixX12isthen1byn2,(0,l)-matrixcontainingtheinformationastowhichofthen1verticesofV1areconnectedtowhichofthen2verticesofV2.Matrix isthetransposeofX12.Clearly,alltheinformationaboutthebipartitegraphGiscontainedinitsX12

matrix.AmatchingV1intoV2correspondstoaselectionofthel’sinthematrixXI2

suchthatnoline(i.e.,aroworacolumn)hasmorethanone1.The matching is complete if the n1 by n2 matrix made of selected 1’s has

exactlyone1ineveryrow.Forexample,theX12matrixforFig.8-8is

AcompletematchingofV1intoV2isgivenby

Amaximalmatchingcorrespondstotheselectionofalargestpossiblenumber

Page 230: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

of1’sfromX12suchthatnorowinithasmorethanone1.Therefore,accordingtoTheorem8-9,inmatrixX12thelargestnumberof1’s,notwoofwhichareinonerow,isequalto

numberofverticesinV1–δ(G),

Matchingproblemsinbipartitegraphscanalsobeformulatedintermsoftheflowproblem(seeSection14-5).Alledgesareassumedtobeofunitcapacity,and the problem of finding amaximalmatching is reduced to the problem ofmaximizingflowfromthesourcetothesink(alsosee[8-3]).

8-5.COVERINGS

InagraphG,asetgofedgesissaidtocoverGifeveryvertexinGisincidentonatleastoneedgeing.AsetofedgesthatcoversagraphG issaidtobeanedgecovering,acoveringsubgraph,orsimplyacoveringofG.Forexample,agraphGistriviallyitsowncovering.Aspanningtreeinaconnectedgraph(oraspanning forest in an unconnected graph) is another covering. AHamiltoniancircuit(ifitexists)inagraphisalsoacovering.Justanycoveringistoogeneraltobeofmuchinterest.Wehavealreadydealt

with some coverings with specific properties, such as spanning trees andHamiltoniancircuits.Inthissectionweshallinvestigatetheminimalcovering–acovering fromwhichnoedgecanbe removedwithoutdestroying its ability tocoverthegraph.InFig.8-9agraphandtwoofitsminimalcoveringsareshowninheavylines.

Fig.8-9Graphandtwoofitsminimalcoverings.

Thefollowingobservationsshouldbemade:

Page 231: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

1. A covering exists for a graph if and only if the graph has no isolatedvertex.

2. Acoveringofann-vertexgraphwillhaveatleast⌈n/2⌉edges.(⌈n⌉denotesthesmallestintegernotlessthanx.)

3. Everypendantedgeinagraphisincludedineverycoveringofthegraph.

4. Everycoveringcontainsaminimalcovering.

5. Ifwedenotetheremainingedgesofagraphby(G–g),thesetofedgesgisacoveringifandonlyif,foreveryvertexV,thedegreeofvertexin(G–g)≤(degreeofvertexvinG)–1.

6. Nominimalcoveringcancontainacircuit, forwecanalwaysremoveanedge from a circuit without leaving any of the vertices in the circuituncovered.Therefore,aminimalcoveringofann-vertexgraphcancontainnomorethann–1edges.

7. A graph, in general, has many minimal coverings, and they may be ofdifferentsizes(i.e.,consistingofdifferentnumbersofedges).Thenumberofedgesinaminimalcoveringof thesmallestsize iscalledthecoveringnumberofthegraph.

THEOREM8-10

Acoveringgofagraphisminimalifandonlyifgcontainsnopathsoflengththreeormore.

Fig.8-10Stargraphsofone,two,three,andfouredges.

Proof:Supposethatacoveringgcontainsapathoflengththree,anditis

v1e1v2e2v3e3v4.

Edgee2 canbe removedwithout leaving its endverticesv2 andv3 uncovered.Therefore,gisnotaminimalcovering.

Page 232: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Conversely, if a coveringg containsnopathof length threeormore, all itscomponentsmustbestargraphs (i.e.,graphs in the shapeof stars; seeFig.8-10). From a star graph no edge can be removed without leaving a vertexuncovered.Thatis,gmustbeaminimalcovering.

SupposethatthegraphinFig.8-9representsthestreetmapofapartofacity.Each of the vertices is a potential trouble spot and must be kept under thesurveillanceofapatrolcar.Howwillyouassignaminimumnumberofpatrolcarstokeepeveryvertexcovered?Theanswerisasmallestminimalcovering.ThecoveringshowninFig.8-9(a)

isananswer,anditrequiressixpatrolcars.Clearly,sincethereare11verticesand no edge can cover more than two, less than six edges cannot cover thegraph.

MinimizationofSwitchingFunctions†:Animportantstepinthelogicaldesignof a digital machine is to minimize Boolean functions before implementingthem. Suppose we are interested in building a logical circuit that gives thefollowingfunctionFoffourBooleanvariablesw,x,y,andz.

where+denoteslogicalOR,xydenotesxANDy,and denotesNOTx.LetusrepresenteachoftheseventermsinFbyavertex,andjoineverypair

ofverticesthatdifferonlyinonevariable.SuchagraphisshowninFig.8-11.Anedgebetweentwoverticesrepresentsatermwiththreevariables.A minimal cover of this graph will represent a simplified form of F,

performingthesamefunctionasF,butwithlesslogichardware.Thependantedges1and7mustbeincludedineverycoveringofthegraph.

Therefore,theterms

Page 233: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.8-11GraphrepresentationofaBooleanfunction.

Fig.8-12

andxyzareessential.

Twoadditionaledges3and6(or4and5or3and5)willcovertheremainder.ThusasimplifiedversionofFis

Thisexpressioncanagainberepresentedbyagraphoffourvertices,asshowninFig.8-12.The essential terms and xyz cannot be covered by any edge, and hence

cannotbeminimizedfurther.OneedgewillcovertheremainingtwoverticesinFig.8-12.ThustheminimizedBooleanexpressionis

Page 234: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Dimer Problem: In crystal physics, a crystal is represented by a three-dimensional lattice.Eachvertex in the lattice represents an atom, and an edgebetweenverticesrepresentsthebondbetweenthetwoatoms.Inthestudyofthesurfacepropertiesofcrystals,oneisinterestedintwo-dimensionallattices,suchasthetwoshowninFig.1-10.To obtain an analytic expression for certain surface properties of crystals

consistingofdiatomicmolecules(alsocalleddimers),oneisrequiredtofindthenumberofways inwhichallatomsona two-dimensional latticecanbepairedoff asmolecules (each consistingof twoatoms).Theproblem is equivalent tofinding all different coverings of a given graph such that every vertex in thecovering isofdegreeone.Suchacovering inwhicheveryvertex isofdegreeone is called adimer covering or a1-factor.A dimer covering is obviously amatchingbecausenotwoedgesinitareadjacent.Moreover,adimercoveringisa maximal matching. This is why a dimer covering is often referred to as aperfectmatching.TwodifferentdimercoveringsareshowninheavylinesinthegraphinFig.8-

13.Clearly, a graph must have an even number of vertices to have a dimer

covering.Thiscondition,however,isnotenough(Problem8-21).

Fig.8-13Twodimercoveringsofagraph.

Page 235: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

8-6.FOUR-COLORPROBLEM

Sofarwehaveconsideredpropercoloringofverticesandpropercoloringofedges.Letusbrieflyconsider thepropercoloringof regions inaplanargraph(embeddedonaplaneorsphere).Justas incoloringofverticesandedges, theregionsofaplanargrapharesaidtobeproperlycoloredifnotwocontiguousoradjacent regions have the same color. (Two regions are said to be adjacent ifthey have a common edge between them. Note that one or more vertices incommondoesnotmaketworegionsadjacent.)Thepropercoloringofregionsisalsocalledmapcoloring,referringtothefactthatinanatlasdifferentcountriesarecoloredsuchthatcountrieswithcommonboundariesareshownindifferentcolors.Once againwe are not interested in just properly coloring the regions of a

givengraph.Weare interested inacoloring thatuses theminimumnumberofcolors. This leads us to the most famous conjecture in graph theory. Theconjectureis thateverymap(i.e.,aplanargraph)canbeproperlycoloredwithfourcolors.Thefour-colorconjecture,alreadyreferredtoinChapter1,hasbeenworkedonbymanyfamousmathematiciansforthepast100years.Noonehasyetbeenabletoeitherprovethetheoremorcomeupwithamap(inaplane)thatrequiresmorethanfourcolors.Thatatleastfourcolorsarenecessarytoproperlycoloragraphisimmediate

from Fig. 8-14, and that five colors will suffice for any planar graph will beshownshortly.Tworemarksmaybemadehereinpassing.Paradoxically,forsurfacesmore

complicated than the plane (or sphere) corresponding theorems have beenproved. For example, it has been proved that seven colors are necessary andsufficient forproperlycoloringmapson thesurfaceofa torus.†Second, ithasbeen proved that all maps containing less than 40 regions can be properlycolored with four colors. Therefore, if in general the four-color conjecture isfalse,thecounterexamplehastobeaverycomplicatedandlargeone.

Vertex Coloring Versus Region Coloring: From Chapter 5 we know that agraphhasadualifandonlyifit isplanar.Therefore,coloringtheregionsofaplanar graphG is equivalent to coloring the vertices of its dualG*, and viceversa.Thus the four-color conjecture can be restated as follows:Every planargraphhasachromaticnumberoffourorless.

Page 236: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.8-14Necessityoffourcolors.

Five-Color Theorem: We shall now show that every planar map can beproperlycoloredwithfivecolors:

THEOREM8-11

Theverticesofeveryplanargraphcanbeproperlycoloredwithfivecolors.

Proof: The theorem will be proved by induction. Since the vertices of allgraphs (self-loop-free, of course†)with 1, 2,3,4, or 5 vertices can be properlycoloredwithfivecolors,letusassumethatverticesofeveryplanargraphwithn–1verticescanbeproperlycoloredwithfivecolors.Then,ifweprovethatanyplanargraphGwithn verticeswill requirenomore than five colors,we shallhaveprovedthetheorem.ConsidertheplanargraphGwithnvertices.SinceGisplanar,itmusthaveat

leastonevertexwithdegreefiveorless(Problem5-4).Letthisvertexbev.LetG′beagraph(ofn–1vertices)obtainedfromGbydeletingvertexv(i.e.,

v and all edges incident on v). GraphG′ requires no more than five colors,accordingtotheinductionhypothesis.SupposethattheverticesinG′havebeenproperly colored, and now we add to it v and all edges incident on v. If thedegreeofvis1,2,3,or4,wehavenodifficultyinassigningapropercolortov.This leaves only the case inwhich the degree of v is five, and all the five

colorshavebeenusedincoloringtheverticesadjacenttov,asshowninFig.8-15(a).(NotethatFig.8-15ispartofaplanarrepresentationofgraphG′.)

Page 237: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.8-15Reassigningofcolors.

SupposethatthereisapathinG′betweenverticesaandccoloredalternatelywithcolors1and3,asshowninFig.8-15(b).Thenasimilarpathbetweenbandd, colored alternately with colors 2 and 4, cannot exist; otherwise, these twopathswill intersectandcauseGtobenonplanar.(ThisisaconsequenceoftheJordancurvetheorem,usedinSection5-3,also.)If there is nopathbetweenb andd colored alternatelywith colors2 and4,

starting from vertex b we can interchange colors 2 and 4 of all verticesconnected tob throughverticesofalternatingcolors2and4.This interchangewillpaintvertexbwithcolor4andyetkeepG′properlycolored.Sincevertexdisstillwithcolor4,wehavecolor2leftoverwithwhichtopaintvertexv.Hadweassumedthat therewasnopathbetweenaandcofverticespainted

alternatelywithcolors1and3,wewouldhavereleasedcolor1or3insteadofcolor2.Andthusthetheorem.

Regularization of a Planar Graph: Removing every vertex of degree one(togetherwiththependantedge)fromthegraphGdoesnotaffecttheregionsofa planar graph. Nor does the elimination of every vertex of degree two, bymerging the twoedges inseries (Fig.5-6),haveanyeffecton theregionsofaplanargraph.Nowconsideratypicalvertexvofdegreefourormoreinaplanargraph.Let

us replace vertex v by a small circle with as many vertices as there wereincidencesonv.This results inanumberofverticeseachofdegree three (seeFig.8-16).Performing this transformation on every vertex of degree four ormore in a

planargraphGwillproduceanotherplanargraphHinwhicheveryvertexisofdegree three. When the regions of H have been properly colored, a proper

Page 238: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

coloringoftheregionsofGcanbeobtainedsimplybyshrinkingeachofthenewregionsbacktotheoriginalvertex.Suchatransformationmaybecalledregularizationofaplanargraph,because

it converts a planar graph G into a regular planar graph H of degree three.Clearly,ifHcanbecoloredwithfourcolors,socanG.Thus,formap-coloringproblems,itissufficienttoconfineoneselfto(connected)planar,regulargraphsofdegreethree.Andthefour-colorconjecturemayberestatedasfollows:

Fig.8-16Regularizationofagraph.

The regions of every planar, regular graph of degree three can be coloredproperlywithfourcolors.If,inaplanargraphG,everyvertexisofdegreethree,itsdualG*isaplanar

graphinwhicheveryregionisboundedbythreeedges;thatis,G*isatriangulargraph. Thus the four-color conjecture may again be restated as follows: Thechromaticnumberofeverytriangular,planargraphisfourorless.

SUMMARY

In the first three sections of this chapter, we were concerned with propercoloringof theverticesofagraph.This ledus to thechromaticpartitioningofthevertices.Intheprocesswealsodevelopedtheconceptofanindependentsetof vertices and a dominating set of vertices.Associated in a naturalwaywiththesesetswefoundmaximalindependentsets,largestmaximalindependentsets,and the independence number; minimal dominating sets, smallest minimaldominatingsets,andthedominationnumber.Thechromaticpolynomial,studiedinSection8-3,wasalsoadirectconsequenceofpropercoloringofvertices.Sections8-4 and8-5 contain developments parallel to those inSections8-1

and8-2,exceptthatSections8-4and8-5areconcernedwithpropercoloringof

Page 239: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

theedgesofagraphratherthanthevertices.Amatchingisanindependentsetofedges,thatis,asetofedgesnotwoofwhichareadjacent.Amaximalmatchingisamaximalsetofindependentedges.Anedgecoveringissomewhatsimilartoadominatingsetofedgesinthesensethateveryedgeinthegraphiseitherinacovering or is adjacent to it. A dimer covering is a perfect matching. Anindependentsetisalsoadominatingsetifandonlyifitismaximal.Likewise,amatching isalsoacovering ifandonly if it isperfect.Thesketch inFig.8-17summarizes the relationships among these concepts. The arrows indicate thedirectionofincreasingrestriction.Thelastsectiondealswithpropercoloringofregionsinaplanargraphrather

thanverticesoredges.

REFERENCES

Agooddealofresearchhasbeendoneandpublishedoncoloring,covering,matching,andpartitioningoftheverticesaswellasedgesofgraphs.Thesurveypaper of Mirsky and Perfect [8-4] is an excellent source of material andreferences for most of this chapter. Read’s survey paper [8-5] on chromaticpolynomials is very readable. Wilkov and Kim [8-6] present an efficientalgorithmforchromaticpartitioningofgraphs.Amongtextbooks,recommendedreadingsareChapters4,10,11,and18ofBerge [1-1];Chapters10and12ofHarary[1-5];andChapters9and11ofLiu[8-3].RouseBall[1-12]givestheinterestingearlyhistoryofthefour-colorproblem.Foranentirebookdevotedtothisunsolvedproblem,seeOre[1-11].

Page 240: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.8-17Structureofterms.8-1. BROOKS,R.L.,“OnColoringtheNodesofaNetwork,”Proc.Cambridge

Phil.Soc.,Vol.,37,1941,194-197.8-2. KASTELEYN, P. W., “Graph Theory and Crystal Physics,” in Graph

Page 241: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

TheoryandTheoreticalPhysics (F.Harary, ed.),NewYork,AcademicPress,Inc.,1967,43-110.

8-3. LIU, C. L., Introduction to Combinatorial Mathematics, McGraw-HillBookCompany,NewYork,1968.

8-4. MIRSKY, L., and H. PERFECT, “Systems of Representatives,” J. Math.Anal.Appl.,Vol.3,1966,520-568.

8-5. READ, R. C, “An Introduction to Chromatic Polynomials,” J.CombinatorialTheory,Vol.4,No.1,1968,52-71.

8-6. WILKOV,R.S.,andW.H.KIM,“APracticalApproachtotheChromaticPartitionProblem,”J.Franklin Inst.,Vol. 289,No. 5,May1970, 333-349.

PROBLEMS

8-1. Provethatthechromaticnumberofagraphwillnotexceedbymorethanonethemaximumdegreeoftheverticesinagraph.

8-2. ShowthatthegraphinFig.8-4hasonlyonechromaticpartition.Whatisit?

8-3. Show that the chromatic number of a graph G cannot exceed thediameter(i.e.,thelengthofthelongestpath)ofGbymorethanone.

8-4. Show that a simple graphwith n vertices andmore than ⌊n2/4⌋ edgescannotbeabipartitegraph.

8-5. AbipartitegraphissaidtobeacompletebipartitegraphifthereisoneedgebetweeneveryvertexofsetV1toeveryvertexofsetv2.Showthatthemaximumnumberofedgesinacompletebipartitegraphofnverticesis⌊n2/4⌋.

8-6. Showthatifabipartitegraphhasanycircuits, theymustallbeofevenlengths.

8-7. Inachessboard,showthepositionsof(a) Theminimum number of queens that collectively dominate all 64

squares(anexampleofaminimaldominatingwithsmallestnumberofvertices).

(b) Themaximumnumberof queens such that noneof themcan takeanother (an example of a maximal independent set with largestnumberofvertices).

Page 242: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

8-8. FindthechromaticpolynomialofthegraphinFig.8-7.

8-9. Usinginductiononn,proveTheorem8-5.(Hint:UseatechniquesimilartooneusedinprovingTheorem3-3.)

8-10. Showthatthechromaticpolynomialofagraphofnverticessatisfiestheinequality

Pn(λ)≤λ(λ−1)n−1.(Hint:UseTheorem8-5.)

8-11. Show that the chromatic polynomial of a graph consisting of a singlecircuitoflengthn(i.e.,ann-gon)is

Pn(λ)=(λ−1)n+(λ−1)(λ−1)n.

8-12. Show that the absolute value of the second coefficient of λn − 1 in thechromaticpolynomialPn(λ)ofagraphequalsthenumberofedgesinthegraph.

8-13. Sketch two different (i.e., nonisomorphic) graphs that have the samechromaticpolynomial.

8-14. Suppose thatyouare required tomakea class schedule in auniversity.There are a total ofn courses to be taught inm available hours of theweek.Therearepairsofcourses thatcannotbe taughtat thesame timebecause some students might like to take both. Explain how you willmaketheschedule.Statetheconditionwhenitwillbeimpossibletomakea compatible schedule. (Hint: Try properly coloring n vertices withmavailablecolors.)

8-15. SketchabipartitegraphthatdoesnotsatisfytheconditioninTheorem8-8andyethasacompletematching.

8-16. Inavillagethereareanequalnumberofboysandgirlsofmarriageableage.Eachboydatesacertainnumberofgirlsandeachgirldatesacertainnumberofboys.Underwhatcondition is itpossible thateveryboyandgirl gets married to one of their dates? (Polygamy and polyandry notallowed.)

8-17. Make a complete table (like Table 8-1) for the graph of Fig. 8-6 todeterminewhetherornotacompletematchingexists.Findthedeficiencynumberfromthistable.

8-18. Show that a nonnull graph is 2-chromatic if and only if, for all odd r,

Page 243: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

everydiagonalentryinmatrixXriszero.ThematrixXistheadjacencymatrixofthegraph.(Hint:UseTheorem8-2.)

8-19. Just aswith an independent set of vertices (or simply independent set),define an independent set of edges in a graph as a set of nonadjacentedges (not incident on a common vertex). Make some observationsparalleltothoseinSection8-2.Observethatmatchingisanindependentsetof edges.Whatarecompletematchings,maximalmatchings, and soon?

8-20. ExplorehowthecoveringnumberofagraphGwithnverticesisrelatedtothediameterofG.

8-21. Sketch a graph with an even number of vertices that has no dimercovering.

8-22. ShowthattheregionsofasimpleplanargraphGcanbecoloredproperlywithtwocolorsifandonlyifeveryvertexinGisofevendegree.(Hint:UseTheorem8-2andProblem4-28.)

8-23. Fromv distinct objects one can selectv!/[k!(v –k)!] combinations ofkobjects. Two such combinations arem-related if they havem or moreobjectsincommon,m≤k.Thisrelationshipcanbeexpressedbymeansofagraphwithv!/[k!(v–k)!]verticesandwithedgesbetweeneverypairofm-relatedcombinations.Makeobservationsonthepropertiesofsuchagraph.Give conditions for which this graph is (a) a null graph; (b) acompletegraph.Howwillyouselectalargestsetofcombinationsthatarenotm-related?Illustrateyourmethodbysketchingthegraphforv=6,k=3,andm=2.

8-24. AnNbyNsquareinwhichobjectsa1,a2,....,aNarearrangedinsuchawaythateachobjectappearsexactlyonceineachrowandexactlyonceineach column is called a Latin square. A Latin square can also berepresentedbyacompletebipartitegraphof2Nvertices.Whatisthetotalnumber of different matchings in such a graph? How many of thesematchingsareedgedisjoint?

8-25. CallasubsetofverticesthatincludesatleastonevertexincidentoneveryedgeofG avertexcoverofG.Show that thenumberofvertices in thesmallestvertexcoverisequaltoorlessthanthedominationnumberofG.

†Thisproblem,knownastheproblemofdistinctrepresentatives,wasfirstformulatedandstudiedbytheEnglishmathematician,PhilipHall,in1935.

Page 244: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

†Thosenotfamiliarwithswitchingfunctionsmayskipthissubsection.†Infact,theHeawoodmap-coloringtheoremgivestheexactnumberofcolorsrequiredforeveryorientablesurfacemorecomplicatedthanthatofasphere.Seepage136,[1-5],orpage94,[1-2].†See“RegularisationofaPlanarGraph”inthissection.

Page 245: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

9DIRECTEDGRAPHS

The graphs studied in this book so far have been undirected graphs. Nodirectionwasassigned to theedges inagraph.Anedgeekbetweenverticesviandvjcouldbeconsideredasgoingfromvertexvitovertexvjorfromvjtovi.Inthis chapter we shall consider directed graphs–graphs in which edges havedirections.Manyphysicalsituationsrequiredirectedgraphs.Thestreetmapofacitywith

one-waystreets,flownetworkswithvalvesinthepipes,andelectricalnetworks,forexample,arerepresentedbydirectedgraphs.Directedgraphsareemployedin abstract representations of computer programs,where the vertices stand forthe program instructions and the edges specify the execution sequence. Thedirectedgraphisaninvaluabletoolinthestudyofsequentialmachines.Directedgraphsintheformofsignal-flowgraphsareusedforsystemanalysisincontroltheory.Mostoftheconceptsandterminologyofundirectedgraphsarealsoapplicable

to directed graphs. For example, the planarity of a graph does not depend onwhetherthegraphisdirectedorundirected,andthereforeChapter5isapplicabletobothdirectedandundirectedgraphs.The same is true formostother topicscoveredsofar.Itwouldbewastefultodevoteanothereightchapterstothestudyofdirectedgraphs,mostlyrepeating,withminorchanges,whathasalreadybeensaid. In this chapter, therefore, we shall mainly bring out those properties ofdirectedgraphsthatarenotsharedbyundirectedgraphs.

9-1.WHATISADIRECTEDGRAPH?Adirectedgraph (oradigraph forshort)GconsistsofasetofverticesV=

{v1,v2,...},asetofedgesE={e1,e2,...},andamappingΨthatmapseveryedge onto some ordered pair of vertices (vi, vj). As in the case of undirectedgraphs,avertexisrepresentedbyapointandanedgebyalinesegmentbetween

Page 246: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

vi and vjwith an arrow directed from vi to vj. For example, Fig. 9-1 shows adigraph with five vertices and ten edges. A digraph is also referred to as anorientedgraph.†

Fig.9-1Directedgraphwith5verticesand10edges.

Inadigraphanedgeisnotonlyincidentonavertex,butisalsoincidentoutofavertexandincidentintoavertex.Thevertexvi,whichedgeekisincidentoutof, is called the initial vertex ofek.Thevertexvj,whichek is incident into, iscalledtheterminalvertexofek.InFig.9-1,v5istheinitialvertexandv4istheterminalvertexofedgee7.Anedgeforwhichtheinitialandterminalverticesarethesameformsaself-loop,suchase5.(Someauthorsreservethetermarcforanorientedordirectededge.Weusethetermedgetomeaneitheranundirectedoradirectededge.Wheneverthereisapossibilityofconfusion,weshallexplicitlystatedirectedorundirectededge.)Thenumberof edges incidentoutof avertexvi is called theout-degree (or

out-valenceoroutwarddemidegree)ofvi and iswrittend+(vi).Thenumberofedgesincidentintoviiscalledthein-degree(orinvalenceorinwarddemidegree)ofv1andiswrittenasd−(vi).InFig.9-1,forexample,

d+(v1)=3, d−(v1)=1,

d+(v2)=1, d−(v2)=2,

d+(v5)=4, d−(v5)=0.

Page 247: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Itisnotdifficulttoprove(Problem9-1)thatinanydigraphGthesumofallin-degrees is equal to the sumof all out-degrees, each sumbeing equal to thenumberofedgesinG;thatis,

An isolatedvertex is avertex inwhich the in-degreeand theout-degreearebothequaltozero.Avertexvinadigraphiscalledpendantifitisofdegreeone,thatis,if

d+(v)+d−(v)=1.

Twodirectededgesaresaidtobeparallel if theyaremappedontothesameordered pair of vertices. That is, in addition to being parallel in the sense ofundirectededges,paralleldirectededgesmustalsoagreeinthedirectionoftheirarrows.InFig.9-1,edgese8,e9,ande10areparallel,whereasedgese2ande3arenot.Sincemanypropertiesofdirectedgraphsarethesameasthoseofundirected

ones, it isoftenconvenient todisregard theorientationsofedges inadigraph.Such an undirectedgraphobtained froma directed graphGwill be called theundirectedgraphcorrespondingtoG.Ontheotherhand,givenanundirectedgraphH,wecanassigneachedgeofH

some arbitrary direction. The resulting digraph, designated by is called anorientation of H (or a digraph associated with H). Note that while a givendigraphhasaunique(withinisomorphism)undirectedgraphcorrespondingtoit,agivenundirectedgraphmayhave”different“orientationspossible.Thisiswhywesaytheundirectedgraphcorrespondingtoadigraph,butanorientationofagraph.Thisbringsus to thequestion:When are twodigraphs considered tobe the

sameorisomorphic?

Page 248: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.9-2Twononisomorphicdigraphs.

Isomorphic Digraphs: Isomorphic graphs were defined such that they haveidenticalbehaviorintermsofgraphproperties.Inotherwords,iftheirlabelsareremoved, two isomorphicgraphs are indistinguishable.For twodigraphs to beisomorphicnotonlymusttheircorrespondingundirectedgraphsbeisomorphic,butthedirectionsofthecorrespondingedgesmustalsoagree.Forexample,Fig.9-2shows twodigraphs thatarenot isomorphic,although theyareorientationsofthesameundirectedgraph.Figure 9-2 immediately suggests a problem.What is the number of distinct

(i.e.,nonisomorphic)orientationsofagivenundirectedgraph?TheproblemwassolvedbyF.HararyandE.M.Palmerin1966.Somespecificcasesareleftasanexercise(Problem9-3).

9-2.SOMETYPESOFDIGRAPHS

Liketheirundirectedsisters,digraphscomeinmanyvarieties.Infact,duetothe choice of assigning a direction to each edge, directed graphs have morevarietiesthanundirectedones.

SimpleDigraphs:Adigraphthathasnoself-looporparalleledgesiscalledasimpledigraph(Figs.9-2and9-3,forexample).

AsymmetricDigraphs:Digraphsthathaveatmostonedirectededgebetweenapairofvertices,but areallowed tohave self-loops, arecalledasymmetric orantisymmetric.

Symmetric Digraphs: Digraphs in which for every edge (a, b) (i.e., fromvertexatob)thereisalsoanedge(b,a).

A digraph that is both simple and symmetric is called a simple symmetricdigraph. Similarly, a digraph that is both simple and asymmetric is simple

Page 249: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

asymmetric. The reason for the terms symmetric and asymmetric will beapparentinthecontextofbinaryrelationsinSection9-3.

Complete Digraphs: A complete undirected graph was defined as a simplegraphinwhicheveryvertexisjoinedtoeveryothervertexexactlybyoneedge.For digraphs we have two types of complete graphs. A complete symmetricdigraph is a simple digraph inwhich there is exactly one edge directed fromeveryvertextoeveryothervertex(Fig.9-3),andacompleteasymmetricdigraphisanasymmetricdigraphinwhichthereisexactlyoneedgebetweeneverypairofvertices(Fig.9-2).Acompleteasymmetricdigraphofnverticescontainsn(n–l)/2edges,buta

completesymmetricdigraphofnverticescontainsn(n–1)edges.Acompleteasymmetricdigraph is alsocalleda tournament or acomplete tournament (thereasonforthistermwillbemadeclearinSection9-10).Adigraphissaidtobebalancedifforeveryvertexvithein-degreeequalsthe

out-degree;thatis,d+(vi)=d−(vi).(Abalanceddigraphisalsoreferredtoasapseudosymmetric digraph, or an isograph.) A balanced digraph is said to beregular if every vertex has the same in-degree and out-degree as every othervertex.

Fig.9-3Completesymmetricdigraphoffourvertices.

9-3.DIGRAPHSANDBINARYRELATIONS

The theoryofgraphsand thecalculusofbinary relationsareclosely related(somuchsothatsomepeopleoftenmistakenlycometoregardgraphtheoryasabranchofthetheoryofrelations).

Page 250: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Inasetofobjects,X,where

X=(x1,x2,...},

abinaryrelationRbetweenpairs(xi,xj)mayexist.Inwhichcase,wewrite

xiRxj

andsaythatxihasrelationRtoxj.Relation R may for instance be “is parallel to,” “is orthogonal to,” or “is

congruentto”ingeometry.Itmaybe“isgreaterthan,”“isafactorof,”“isequalto,”andsoon,inthecasewhenXconsistsofnumbers.Ontheotherhand,ifthesetXiscomposedofpeople,therelationRmaybe“issonof,”“isspouseof,”“isfriend of,” and so forth. Each of these relations is defined only on pairs ofnumbersoftheset,andthisiswhythenamebinaryrelation.Althoughtherearerelationsotherthanbinary(xi“isaproductof”xjandxk,forexample,willbeatertiaryrelation),binaryrelationsarethemostimportantinmathematics,andtheword“relation”impliesabinaryrelation.AdigraphisthemostnaturalwayofrepresentingabinaryrelationonasetX.

Eachxi∈XisrepresentedbyavertexxiIfxihasthespecifiedrelationRtoxj,adirectededgeisdrawnfromvertexxitoxj,foreverypair(xixj).Forexample,thedigraphinFig.9-4representstherelation“isgreaterthan”onasetconsistingoffivenumbers(3,4,7,5,8}.Clearly,everybinaryrelationonafinitesetcanberepresentedbyadigraph

withoutparalleledges.Conversely,everydigraphwithoutparalleledgesdefinesabinaryrelationonthesetofitsvertices.

Fig.9-4Digraphofabinaryrelation.

Page 251: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.9-5Graphsofsymmetricbinaryrelation.

ReflexiveRelation:ForsomerelationRitmayhappenthateveryelementisinrelationRtoitself.Forexample,anumberisalwaysequaltoitself,oralineisalwaysparalleltoitself.SucharelationRonsetXthatsatisfies

xiRxi

foreveryxi∈Xiscalledareflexiverelation.Thedigraphofareflexiverelationwill have a self-loop at every vertex. Such a digraph representing a reflexivebinaryrelationonitsvertexsetmaybecalledareflexivedigraph.Adigraphinwhichnovertexhasaself-ioopiscalledanirreflexivedigraph.

SymmetricRelation:ForsomerelationRitmayhappenthatforallxiandxiif

xiRxjholds,thenxjRxjalsoholds.

Sucharelationiscalledasymmetricrelation.“Isspouseof”isasymmetricbutirreflexiverelation.“Isequalto”isbothsymmetricandreflexive.Thedigraphofasymmetricrelationisasymmetricdigraphbecauseforevery

directededgefromvertexxitoxjthereisadirectededgefromxjtoxi.Figure9-5(a)showsthegraphofanirreflexive,symmetricbinaryrelationonasetoffourelements. The same relation can also be represented by drawing just oneundirectededgebetweeneverypairofverticesthatarerelated,asinFig.9-5(b).Thus every undirected graph is a representation of some symmetric binaryrelation(onthesetof itsvertices).Furthermore,everyundirectedgraphwitheedgescanbethoughtofasasymmetricdigraphwith2edirectededges.(Atwo-waystreetisequivalenttotwoone-waystreetspointedinoppositedirections.)

Transitive Relation: A relation R is said to be transitive if for any threeelementsxi,xj,andxkintheset,

Page 252: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

xiRxjandxjRxk

alwaysimply

xiRxk.

Thebinaryrelation“isgreaterthan,”forexample,isatransitiverelation.Ifxi>xjandxi>xk,clearlyxi>xk.“Isdescendentof”isanotherexampleofatransitiverelation.Thedigraphofatransitive(butirreflexiveandasymmetric)binaryrelationis

shown in Fig. 9-4. Note the triangular subgraphs. A digraph representing atransitiverelation(onitsvertexset)iscalledatransitivedirectedgraph.

EquivalenceRelation:Abinaryrelationiscalledanequivalencerelationifitisreflexive,symmetric,andtransitive.Someexamplesofequivalencerelationsare“isparallelto,”“isequalto,”“iscongruentto,”“isequaltomodulom,”and“isisomorphicto.”Thegraphrepresentinganequivalencerelationmaybecalledanequivalence

graph.What does an equivalencegraph look like?Let us look at an example,consistingoftheequivalencerelation“iscongruenttomodulo3”definedonthesetof11 integers,10 through20.Thegraph is shown inFig.9-6. (Recall thateachundirectededgeinFig.9-6representstwoparallelbutoppositelydirectededges.)InFig.9-6weseethatthevertexsetofthegraphisdividedintothreedisjoint

classes, each in a separate component. Each component is an undirectedsubgraph(duetosymmetry)withaself-loopateachvertex(duetoreflexivity).Furthermore, in each component every vertex is related to (i.e., joined by anedgeto)everyothervertex.

Fig.9-6Equivalencegraph.

Ingeneral,anequivalencerelationonasetpartitionstheelementsof theset

Page 253: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

intoclasses(calledequivalenceclasses)suchthattwoelementsareinthesameclassifandonlyiftheyarerelated.Symmetryensuresthatthereisnoambiguityregarding membership in the equivalence class; otherwise, xi may have beenrelatedtoxjbutnotviceversa.Transitivityensuresthatineachcomponenteveryvertexisjoinedtoeveryothervertex,becauseifaisrelatedtobandbisrelatedtoc,aisalsorelatedtoc.Transitivityalsoguaranteesthatnoelementcanbeinmorethanoneclass.Reflexivityallowsanelementtobeinaclassbyitself,ifitisnotrelatedtoanyotherelementintheset.

RelationMatrices:AbinaryrelationRonasetcanalsoberepresentedbyamatrix, called a relation matrix. It is a (0, 1), n by n matrix, where n is thenumberofelementsintheset.Thei,jthentryinthematrixis1ifxiRxjistrue,and is0,otherwise.Forexample, the relationmatrixof the relation“isgreaterthan”onthesetofintegers(3,4,7,5,8]is

WeshallseeinSection9-8that this ispreciselytheadjacencymatrixof thedigraphrepresentingthebinaryrelation.

9-4.DIRECTEDPATHSANDCONNECTEDNESS

Walks,paths,andcircuitsinadirectedgraph,inadditiontobeingwhattheyare in the corresponding undirected graph, have the added consideration oforientation.Forexample,inFig.9-1,thesequenceofverticesandedgesv5e8v3e6 v4 e3 v1 is a path “directed” from v5 to v1z, whereas v5 e7 v4 e6 v3 e1 v1(althoughapath in thecorrespondingundirectedgraph)hasnosuchconsistentdirectionfromv5 tov1Adistinctionmustbemadebetweenthesetwotypesofpaths. It is natural to call the first one a directed path from v5 to v1, and thesecond one a semipath. The word “path” in a digraph could mean either adirectedpathorasemipath,andsimilarlyforwalks,circuits,andcutsets.More

Page 254: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

precisely:Adirectedwalk fromavertexvi tovj is an alternating sequenceofvertices

andedges,beginningwithvi.andendingwithvj,suchthateachedgeisorientedfromthevertexprecedingit to thevertexfollowingit.Ofcourse,noedgeinadirectedwalkappearsmorethanonce,butavertexmayappearmorethanonce,justasinthecaseofundirectedgraphs.Asemiwalkinadirectedgraphisawalkin thecorrespondingundirectedgraph,but isnot adirectedwalk.Awalk in adigraphcanmeaneitheradirectedwalkorasemiwalk.The definitions of circuit, semicircuit, and directed circuit can be written

similarly.Let us turn toFig. 9-1oncemore.The set of edges (e1,e6,e3} is adirectedcircuit.But{e1,e6,e2}isasemicircuit.Bothofthemarecircuits.

ConnectedDigraphs:InChapter2agraph(i.e.,undirectedgraph)wasdefinedasconnected if therewasat leastonepathbetweeneverypairofvertices. Inadigraph there are two different types of paths. Consequently, we have twodifferenttypesofconnectednessindigraphs.AdigraphGissaidtobestronglyconnectedifthereisatleastonedirectedpathfromeveryvertextoeveryothervertex. A digraph G is said to be weakly connected if its correspondingundirectedgraphisconnectedbutGisnotstronglyconnected.InFig.9-2oneofthedigraphsisstronglyconnected,andtheotheroneisweaklyconnected.Thestatement that a digraphG is connected simply means that its correspondingundirectedgraphisconnected;andthusGmaybestronglyorweaklyconnected.Adirectedgraphthatisnotconnectedisdubbedasdisconnected.Since there are two typesof connectedness in adigraph,wecandefine two

types of components also. Each maximal connected (weakly or strongly)subgraphofadigraphGwillstillbecalledacomponentofG.Butwithineachcomponent ofG themaximal strongly connected subgraphswill be called thefragments(orstronglyconnectedfragments)ofG.For example, the digraph in Fig. 9-7 consists of two components. The

component g1 contains three fragments {e1, e2}, {e5, e6, e7, e5}, and {e10}.Observethate3,e4,ande9donotappearinanyfragmentofg1.

Page 255: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.9-7Disconnecteddigraphwithtwocomponents.

Fig.9-8CondensationofFig.9-7.

Condensation:ThecondensationGcofadigraphGisadigraphinwhicheachstronglyconnectedfragmentisreplacedbyavertex,andalldirectededgesfromonestronglyconnectedcomponent toanotherare replacedbyasingledirectededge.ThecondensationofthedigraphGinFig.9-7isshowninFig.9-8.Twoobservationscanbemadefromthedefinition:

1. Thecondensationofastronglyconnecteddigraphissimplyavertex.

2. Thecondensationofadigraphhasnodirectedcircuit.

Accessibility: In adigraphavertexb is said tobeaccessible (or reachable)from vertex a if there is a directed path from a to b. Clearly, a digraphG isstronglyconnectedifandonlyifeveryvertexinGisaccessiblefromeveryother

Page 256: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

vertex.

9-5.EULERDIGRAPHS

ThenotionoftheEulergraphcanbeextendedtodigraphsalso.InadigraphGa closed directed walk (i.e., a directed walk that starts and ends at the samevertex)whichtraverseseveryedgeofGexactlyonceiscalledadirectedEulerline.AdigraphcontainingadirectedEulerlineiscalledanEulerdigraph.ThegraphinFig.9-9isanEulerdigraph,inwhichthewalkabcdef isanEulerline.WhenisadigraphanEulerdigraph?Clearly,thedigraphmustbeconnected,

withthepossibleexceptionofisolatedvertices;otherwise,everyedgecannotbetraversed in one walk. In fact, an Euler digraph must be strongly connected,although every strongly connected digraph need not be an Euler digraph(Problem9-13).Theorem9-1 (whose proof follows the proof ofTheorem2-4almost verbatim)provides avery simple test for determiningwhetheror not adigraphhasanEulerline.

Fig.9-9Eulerdigraph.

THEOREM9-1

AdigraphGisanEulerdigraphifandonlyifGisconnectedandisbalanced[i.e.,d−(v)=d+(v)foreveryvertexvinG].

Let us now consider an application of the Euler digraph for solving animportant problem in communication theory. The problem, which is oftenreferredtoastheteleprinter’sproblem,wassolvedin1940byI.G.Goodusingthedigraph,andwaspresentedinaclassicpaperin1946[9-2].

Page 257: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Teleprinter’sProblem:Howlongisalongestcircular(orcyclic)sequenceofl’s and 0’s such that no subsequence of r bits appearsmore than once in thesequence?Constructonesuchlongestsequence.

Solution:Sincethereare2rdistinctr-tuplesformedfrom0and1,thesequencecan be no longer than 2r bits long. Using Theorem 9-1, we shall construct acircularsequence2rbitslongwiththerequiredpropertythatnosubsequenceofrbitsberepeated.Construct a digraphG whose vertices are all (r − l)-tuples of 0’s and l’s.

Clearly,thereare2r−1verticesinG.Letatypicalvertexbe

α1α2...αr−1, whereαi=0or1.

Drawanedgedirectedfromthisvertex(α1α2...αr−1)toeachoftwovertices(α2α3...αr−10)and(α2α3...αr−11);labelthesedirectededgesα1α2...αr−10andα1α2...αr−11,respectively.Drawtwosuchedgesdirectedfromeachofthe2r−lvertices.(Aself-loopwillresultineachofthetwocaseswhenα1=α2=⋯=αr−1=0or1.)The resulting digraph is an Euler digraph because for each vertex the in-

degreeequalstheout-degree(eachbeingequaltotwo).AdirectedEulerlineinGconsistsofthe2redges,eachwithadistinctr-bitlabel.ThelabelsofanytwoconsecutiveedgesintheEulerlineareoftheformα1α2...αr−1αr;α2α3...αrαr+1 ; that is, the r − 1 trailingbits of the first edge are identical to the r − 1leadingbitsofthesecondedge.Thusinthesequenceof2rbits,madeofthefirstbitofeachof theedges in theEuler line,everypossiblesubsequenceofrbitsoccursasthelabelofanedge;andsincenotwoedgeshavethesamelabel,nosubsequence occursmore than once. The circular arrangement is achieved byjoiningthetwoendsofthesequence.)

Page 258: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.9-10Eulerdigraphformaximum-lengthsequence.

Forr=4,thegraphinFig.9-10illustratestheprocedureofobtainingsuchamaximum-length sequence. One such sequence is 0000101001101111correspondingtothewalke1e2e3e4e5e6e7e8e9e10e11e12e13e14e15e16.Thisproblem isalsoencountered in locating thepositionofa rotatingdrum

(Problem 9-19) with the surface carrying two different types of marks. Theproblemoftherotatingdrumissimilartothatofafeedbackshiftregister(tobediscussedinChapter12).Thequestforawordinwhicheacharrangementofrlettersofagivenalphabetappearsexactlyonce,encounteredincryptography,isalsothesameproblem(Problem9-20).It isnotdifficult tosee that thealphabetsizeneednotbe2. Itcouldbeany

numberm.Inthatcase,themaximum-lengthsequenceismrsymbolslong.Thein-degree and out-degree of each vertex in the corresponding Euler digraphequalsm,ratherthantwo.

NumberofEulerLines:InFig.9-10thereismorethanoneEulerline.Infact,thedigraphhas16distinctEulerlines.(Notethatrotationsofthesamesequenceof edges are not considered distinct.) Finding the number of distinct directedEulerlinesinagivenEulerdigraphisalsoofinterestinmanyapplications.ThisproblemofenumerationwassolvedbyN.G.deBruijnin1946forthoseregular

Page 259: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Euler digraphs in which the in-degree and out-degree of every vertex wereexactly two, the digraph in Fig. 9-10, for example. In 1951 van Aardeniie-Ehrenfest anddeBruijn [9-9] solved themoregeneralproblemof counting thenumberofdistinctdirectedEulerlinesinanyEulerdigraph.ThenumberofdistinctEulerlinesinabalanced,connecteddigraphGcanbe

obtainedbycountingcertaintypesofspanningtrees inG, tobecoveredinthenextsection.

9-6.TREESWITHDIRECTEDEDGES

Atree(forundirectedgraphs)wasdefinedasaconnectedgraphwithoutanycircuit. The basic concept as well as the term “tree” remains the same fordigraphs.A tree isaconnecteddigraph thathasnocircuit−neitheradirectedcircuitnorasemicircuit.Atreeofnverticescontainsn−1directededgesandhaspropertiessimilartothosewithundirectededges.Treeswithdirectededgesareofgreatimportanceinmanyapplications,suchaselectricalnetworkanalysis,game theory, theory of languages, computer programming, and countingproblems,tonameafew.In addition to being trees in the undirected sense, trees in digraphs have

additionalpropertiesandvariationsresultingfromtherelativeorientationsoftheedges. One such particularly useful type of rooted treewith directed edges iscalledanarborescenceandisdefinedasfollows:

Arborescence:AdigraphGissaidtobeanarborescenceif

1. Gcontainsnocircuit−neitherdirectednorsemicircuit.

2. InGthereispreciselyonevertexvofzeroin-degree.

Thisvertexviscalledtherootofthearborescence.AnarborescenceisshowninFig.9-11.

Page 260: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.9-11Arborescence.

THEOREM9-2

Anarborescenceisatreeinwhicheveryvertexotherthantheroothasanin-degreeofexactlyone.

Proof:Anarborescencewithnverticescanhaveatmostn−1edgesbecauseofcondition1.Therefore,thesumofin-degreesofallverticesinG

d−(v1)+d−(v2)+⋯+d−(vn)≤n−l.

Ofthentermsontheleft-handsideofthisequation,onlyoneiszerobecauseofcondition2;othersmustallbepositiveintegers.Therefore,theymustallbe1’s.Now,sincethereareexactlyn−1verticesofin-degreeoneandonevertexofin-degree zero, digraphG has exactlyn − 1 edges. SinceG is also circuitless, itmustbeconnected,andhenceatree.

An arborescence is in a sense a tree directed out of the root. Therefore, anarborescenceissometimesreferredtoasanout-tree.(Reversingthedirectionofeveryedgeinanarborescencewillproducewhatmaybecalledanin-tree.)

THEOREM9-3

In an arborescence there is a directed path from the rootR to every othervertex.Conversely,acircuitlessdigraphGisanarborescenceifthereisavertexvinGsuchthateveryothervertexisaccessiblefromv,andvisnotaccessiblefromanyothervertex.

Proof:(a)InanarborescenceconsideradirectedpathPstartingfromtherootR and continuing as far as possible. P can end only at a pendant vertex;

Page 261: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

otherwise,wegetavertexwhosein-degreeistwoormore.Acontradiction.Sinceanarborescence is connected, everyvertex lieson somedirectedpath

fromtherootRtoeachofthependantvertices.(b)Conversely, since every vertex inG is accessible from v, andG has no

circuit,Gisatree.Moreover,sincevisnotaccessiblefromanyothervertex,d−(v)=0.Everyothervertexisaccessiblefromv,andthereforethein-degreeofeachoftheseverticesmustbeatleastone.Thein-degreecannotbegreaterthanonebecausethereareonlyn−1edgesinG(nbeingthenumberofverticesinG).

The following is an important application of arborescences to the theory ofcomputeralgorithms.

PolishNotation:Considerthearithmeticexpression

Inaprocedurallanguage(suchasFORTRANorALGOL)thisexpressionmightbewrittenas

where↑denotesexponentiation.In evaluating this expression the computer must perform the arithmetic

operations in a certainorder; otherwise, itwill produce awrong result.Let usnumber the operations in this expression in the order inwhich theymight beperformed.

Toevaluatesuchanexpression,themachinewillhavetoscantheexpressionbackandforthtofindthesequenceofoperationstobeperformed.To avoid scanning back and forth, the computer niakes a preliminary

translationofexpressionssuchas(9-2)intothePolishnotation(inventedbythePolish logician, Lukasiewicz). Polish notation is also called parenthesis-freenotation,becauseitcontainsnoparentheses.Thisnotationhastheadvantagethattheoperationsappearexactlyinthesameorderastheyareperformed.ThebasicideainPolishnotationisthatabinaryoperatorappearsjusttothe

leftofthetwooperandsratherthaninbetweenthetwooperands.Thusx+yis

Page 262: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

written as + xy. The translation of expressions from procedural language intoPolishnotationisextremelyimportantincompilingandcanbeaccomplishedbyfirstrepresentingthegivenexpressionbymeansofanarborescenceasfollows:Each variable (or constant) appearing in the expression is represented by apendantvertex.Eachinternalvertexrepresentsabinaryoperatorhavingthetwosubarborescencesasitsoperands.Anarborescenceforexpression(9-2)isshowninFig.9-12.

To obtain the expression in Polish notation, we traverse the arborescencestartingfromtherootfromlefttorightandfromtoptobottom,asindicatedbythedottedlineinFig.9-12.Eachtimewecomeacrossavertexthathasnotbeentraversedbefore,weappenditslabeltotheexistingstring.ThisprocessinFig.9-12yields

Fig.9-12Arborescencefora+b−c·d÷(g↑x–f).

AnexpressioninPolishnotationisevaluatedasfollows:Westartattherightextremeandmovetotheleft.Wheneveranoperatorisencounteredtheoperationisperformedbetweenthetwooperandsimmediatelyto therightof it.Afteranoperation is performed, the resultant is regarded as one operand for the nextoperation.Youcanverifythatunderthisprocedureexpression(9-4)isequalto(9-2).Theadvantageofexpression(9-4)over(9-2)isthatin(9-4)therearenoparentheses and theoperators appear in theorder (from right to left) inwhichthey are to be acted upon. Therefore, no back and forth scanning is required

Page 263: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

duringthecomputation.

OrderedTrees:YoumusthavenoticedthatintheexpressionarborescenceofFig.9-12therelativepositionsoftheverticesintheplaneofthepaper—leftorright,upordown—are importantandmustbepreserved. In thissense it isa“rigid”graph,andagraphisomorphictoitmaynotpreserveitsproperties.Thisinfactisnotpurelyagraph-theoreticproblem;andthisisthefirstandonlytimeinthisbookweshallconsidersuchastructure.Incomputerliteratureatreeinwhichtherelativeorderofsubtreesmeetingat

eachvertexmustbepreservediscalledanorderedtreeoraplanartree(becausethe tree can be visualized as rigidly embedded in the plane of the paper). Incomputersciencethetermtreeusuallymeansanorderedtree,andbyconventionatreeisdrawnhangingdownwiththerootatthetop.

Spanning Arborescence: A spanning tree in an nvertex connected digraph,analogous toaspanning tree inanundirectedgraph,consistsofn−1directededges.Aspanningarborescenceinaconnecteddigraphisaspanningtreethatisanarborescence.Forexample,aspanningarborescenceinFig.9-13is{f,b,d}.There is a striking relationshipbetween a spanning arborescence and anEulerline.ThisisbroughtoutbyTheorems9-4and9-5.

Fig.9-13Eulerdigraph.

THEOREM9-4

Inaconnected,balanceddigraphGofnverticesandmedges,letW=(e1,e2,...,em)beanEulerline,whichstartsandendsatavertexv(i.e.,vistheinitialvertexofe1andtheterminalvertexofem).AmongthemedgesinWtherearen−1edgesthat“enter”eachofn−1vertices,otherthanv,forthefirsttime.Thesubdigraph g of these n − 1 directed edges together with the n vertices is aspanningarborescenceofG,rootedatvertexv.

Page 264: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Illustration:Beforeprovingthetheorem,letuslookatanexample.InFig.9-13,W=(bdce fgha) isanEuler line,startingandendingatvertex2.Thesubdigraph{b,d,f}isaspanningarborescencerootedatvertex2.

Proof: In the subdigraph g, vertex v is of in-degree zero, and every othervertexisofin-degreeone;forgincludesexactlyoneedgegoingtoeachofthen−1vertices,andnoedgegoingtov.Moreover,thewaygisdefinedinW,gisconnected and contains n − 1 directed edges. Therefore, g is a spanningarborescenceinGandisrootedatv.

Theorem9-4providesamethodofobtainingaspanningarborescencerootedat any specified vertex, provided the digraph is Eulerian. Conversely, given aspanning arborescence in an Euler digraph, an Euler line can be constructedusing Theorem 9-5. This important result discovered by T. van Aardenne-EhrenfestandN.G.deBruijnin1951isusedincountingthenumberofdistinctEulerlines.For the sake of traversing the edges alongwith rather than opposite to the

directionofedges,itisbettertoexpressTheorem9-5intermsofanin-tree,thatis, an arborescence inwhich the direction of every edgehas been inverted. InFig.9-14thesubdigraph{e2,e3,e7,e10,e11}isaspanningin-tree.

THEOREM9-5

LetGbeanEulerdigraphandTbeaspanningin-treeinG,rootedatavertexR.Lete1beanedgeinGincidentoutofthevertexR.ThenadirectedwalkW=(e1,e2,...,em)isadirectedEulerline,ifitisconstructedasfollows:

Fig.9-14Spanningin-treerootedatR.

Page 265: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

1. NoedgeisincludedinWmorethanonce.

2. Inexitingavertex theoneedgebelongingtoT isnotuseduntilallotheroutgoingedgeshavebeentraversed.

3. Thewalkisterminatedonlywhenavertexisreachedfromwhichthereisnoedgeleftonwhichtoexit.

Proof:ThewalkWmustterminateatR,becauseallverticesmusthavebeenentered asoften as theyhavebeen left (becauseG is balanced).Nowsupposethere isanedgea inG thathasnotbeen included inW.Letvbe the terminalvertexofa.SinceGisbalanced,vmustalsobetheinitialvertexofsomeedgebnotincludedinW.EdgebgoingoutofvertexvmustbeinT,accordingtorule1.Thisomittededge leads toanotheromittededgec inT,andsoon.Ultimately,we arrive at R, and find an outgoing edge there not included in W. Thiscontradictsrule3.

ThenumberofdistinctEulerlinesformedfromagivenin-treeT,andstartingwithedgee1atR,canbecomputedbyconsideringall thechoicesavailableateachvertex,afterstartingwithe1.SincethereisexactlyoneoutgoingedgeinTateachvertexandthisedgeisto

beselectedlast(rule2),theremainingd+(vi)−1edgesatvertexvicanbechosenin

[d+(vi)−1]!ways.

Andsincetheseareindependentchoices,wehavealtogether

differentEulerlinesthatmeetthethreerulesinTheorem9-5.LetusapplythesethreerulestoobtaindifferentdirectedEulerlinesinFig.9-

14, from the in-tree {e2, e3, e7, e10, e11}, starting with edge e1. We get thefollowingtwodirectedEulerlines:

(e1e12e5e6e7e8e9e10e11e2e4e3),

and

Page 266: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

(e1e12e8e9e10e11e5e6e7e2e4e3).

Thevalueofexpression(9-5)forFig.9-14is2.Notethat thesearenotall thedirected Euler lines in the digraph, but only those that are generated by thespecificin-treeinaccordancewiththerulesinTheorem9-5.Theresult inTheorem9-5mayseemcontrivedat firstsight,but it isavery

naturalstepincountingthenumberofdistinctdirectedEulerlinesinadigraph,whichwillbeundertakeninSection9-9.

9-7.FUNDAMENTALCIRCUITSINDIGRAPHS

TheedgesofaconnecteddigraphnotincludedinaspecifiedspanningtreeTarealsocalledchordswithrespecttoT.Justasinthecaseofundirectedgraphs,everychordciwhenaddedtothespanningtreeTproducesafundamentalcircuit(whichmaybeadirectedcircuitorasemicircuit).Acut-setinaconnecteddigraphG(justasinanundirectedgraph)inducesa

partitioningoftheverticesofGintotwodisjointsubsetsV1andV2suchthatthecut-setconsistsofallthoseedgesthathaveoneendvertexinV1andtheotherinV2.Alledgesinthecut-setmaybedirectedfromV1toV2,orviceversa,orsomeedgesmaybedirectedfromV1toV2andothersfromV2toVj.†Theconceptsofspanningtrees,fundamentalcircuits,andfundamentalcutsets

areillustratedinFig.9-15.Aspanningtreeisshowninheavylines.Observethatsomeofthefundamentalcircuitsaredirectedcircuitsandothersaresemicircuits.The five fundamental cutsets, each corresponding to an edge in the spanningtree,arealsoshown.

RingSumofCircuits:Justas inundirectedgraphs,wecandefineoperationsbetweensubgraphsofadigraph.Inparticular,theringsumoftwosubdigraphsg1⊕g2 isanothersubdigraphconsistingofedges thatareeither ing1or ing2butnotinboth.Asinundirectedgraphs,theringsumoftwocircuits(directedorsemicircuit)

inadigraphiseitherathirdcircuitoraunionofedge-disjointcircuits.Forifwedisregard the directions of edges in the circuits, the earlier results fromundirectedgraphsarealsoapplicabletodigraphs.Underthering-sumoperation,⊕,circuitsandunionsofedge-disjointcircuitsformagroup.Everyelementofthisgroupcanbeexpressedasa ringsumofsomeof the fundamentalcircuitswithrespecttoaspanningtree.Thesameholdsforcutsetsalso.

Page 267: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

SetofDirectedCircuitsOnly:Themostimportantpropertyofasetofμ(=e−n+1) fundamental circuits in a connectedgraphG (directedorundirected) isthat these circuits form a basis for all circuits inG. Any circuit (directed orsemicircuitinadigraph)canbeobtainedasaringsumofsomeofthesecircuits.Butinmanyapplicationsweareinterestedonlyinthesetofdirectedcircuitsinadigraph.Isthereasimilarbasisforalldirectedcircuits?Theanswer,unfortunately,isno.Theringsumoftwodirectedcircuitsisnot

necessarily another directed circuit or edge-disjoint union of directed circuits.Forexample,inFig.9-15theringsumofdirectedcircuitsacb⊕adgb=dgc, a semicircuit. In fact, it can be shown that there exists no binary operationunderwhichalldirectedcircuits (andedge-disjointunionsofdirectedcircuits)formagroup,letaloneavectorspace.

Fig.9-15Directedgraphandaspanningtree.

Page 268: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

The practical significance of this situation is to be discussed in connectionwithacyclicdigraphs,thetopicofSection9-11.

9-8.MATRICESA,B,ANDCOFDIGRAPHS

ThematricesassociatedwithadigrapharequitesimilartothosediscussedinChapter7foranundirectedgraph,withthefollowingbasicdifference.Inorderto account for the orientation of the edges, the incidence, circuits, and cut-setmatricesconsistof+1,0,−1(insteadofonly0and1forundirectedgraphs).Thenumbers+1,0,−1 are regardedasordinary realnumbers.Their additionandmultiplication are interpreted as in ordinary arithmetic (and notmodulo 2arithmetic as in the case of undirected graphs).Consequently, the vectors andvectorspacesassociatedwithadigraphanditssubdigraphsareoverthefieldofallrealnumbers,andnotGF(2).

IncidenceMatrix:Theincidencematrixofadigraphwithnvertices,eedges,and no self-loops is an n by n matrix A = [aij], whose rows correspond toverticesandcolumnscorrespondtoedges,suchthat

aij=1, ifjthedgeisincidentoutofithvertex,=−1, ifjthedgeisincidentintoithvertex,=0, ifjthedgeisnotincidentonithvertex.

Adigraphand its incidencematrixare shown inFig.9-16.Observe that ifwedisregard theorientationsof theedgesandcorrespondinglychange−1 to1 intheincidencematrix,Fig.9-16becomesidenticaltoFig.7-1.Observations 1-6 made in Section 7-1 on the properties of the incidence

matrixofanundirectedgraph,withminorchanges,alsoholdfordigraphs.Since the sum (in the real field) of each column is zero, the rank of the

incidencematrixofadigraphofn vertices is less thann. In fact,wehave thefollowingtheorem,identicaltoTheorem7-2,whichcanbeprovedalongsimilarlines.

THEOREM9-6

IfA(G)istheincidencematrixofaconnecteddigraphofnvertices,therankofA(G)=n−1.

DeletinganyonerowfromAwegetAf, the(n−1)bye reducedincidencematrix. The vertex corresponding to the deleted row is called the reference

Page 269: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

vertex.

UnimodularityofA: Itwasobserved inChapter7 that ifA is the incidencematrixofanundirectedgraph,thedeterminantofeverysquaresubmatrixofAiseither0or1.Thiswasa resultof the fact that thedeterminantwasdefined inmodulo2arithmeticand,therefore,couldhavenoothervalue.Inthecaseofdigraphs,theincidencematrixAisintherealfield,andonfirst

sight it would appear that the determinants of its square submatrices couldacquire any integral value. This, however, is not the case, as shown in thefollowingimportanttheorem.

THEOREM9-7

The determinant of every square submatrix ofA, the incidencematrix of adigraph,is1,−1,or0.

Proof:Thetheoremcanbeproveddirectlybyexpandingthedeterminantofasquare submatrix of A. Consider a k by k submatrix M of A. If M has anycolumnorrowconsistingofallzeros,detMisclearlyzero.AlsodetM=0ifeverycolumnofMcontainsthetwononzeroentries,a1anda−1.

Page 270: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.9-16Digraphanditsincidencematrix.

Now if detM ≠ 0 (i.e.,M is nonsingular), then the sum of entries in eachcolumnofMcannotbezero.Therefore,Mmusthaveacolumninwhichthereisasinglenonzeroelementthatiseither+1or−1.Letthissingleelementbeinthe(i,j)thpositioninM.Thus

detM=±l.detMij,

whereMijisthesubmatrixofMwithitsithrowandjthcolumndeleted.The(k−1) by (k − 1) submatrix Mij is also nonsingular (because M is nonsingular);therefore,ittoomusthaveatleastonecolumnwithasinglenonzeroentry,say

Page 271: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

in the (p, q)th position. Expanding det Mij about this element in the (p,q)thposition,

detMij=±[determinantofanonsingular(k−2)by(k−2)submatrixofM].

Repeatedapplicationofthisprocedureyields

detM=±1.Hencethetheorem.

Anymatrixwitheverysquaresubmatrixhavingadeterminantof1,−1,or0iscalledaunimodularmatrix.(Unimodularmatricesalsoplayanimportantroleinlinearprogramming.)

CircuitMatrixofaDigraph:LetGbeadigraphwitheedgesandqcircuits(directed circuits or semicircuits). An arbitrary orientation (clockwise orcounterclockwise)isassignedtoeachoftheqcircuits.ThenacircuitmatrixB=[bij]ofthedigraphGisaqbyematrixdefinedas

bij=1, ifithcircuitincludesjthedge,andtheorientationsoftheedgeandcircuitcoincide,=−1, ifithcircuitincludesjthedge,buttheorientationsofthetwoareopposite,=0, ifithcircuitdoesnotincludethejthedge.

Forexample,acircuitmatrixofthedigraphinFig.9-16is

Note that the orientation assigned to each of the four circuits is entirelyarbitrary. The circuit in the first row is assigned clockwise orientation, in thesecond row counterclockwise, the third counterclockwise, and the fourthclockwise.Changingtheorientationofanycircuitwillsimplychangethesignofeverynonzeroentryinthecorrespondingrow.Alsonotethatifwesubtractthefirstrowfromthesecond,wegetthethirdrow.Thustherowsarenotalllinearlyindependent(intherealfield,ofcourse).

Page 272: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Observations1-7madeinSection7-3aboutthecircuitmatrixofanundirectedgraphareapplicabletothecircuitmatrixofadigraphalso—withsomeobviousminorchanges.Justasforundirectedgraphs,therowsofthecircuitmatrixareorthogonal to the rows of the incidencematrix (this time in the real field), asprovedinTheorem9-8.

THEOREM9-8

LetBandAbe,respectively,thecircuitmatrixandincidencematrixofaself-loop-freedigraphsuchthatthecolumnsinBandAarearrangedusingthesameorderofedges.Then

A·BT=B·AT=0,

wheresuperscriptTdenotesthetransposedmatrix.

Proof:ConsiderthemthrowinBandthekthrowinA.Ifthecircuitmdoesnotincludeanyedgeincidentonvertexk,theproductofthetworowsisclearlyzero.If,ontheotherhand,vertexk isincircuitm, thereareexactlytwoedges(sayxandy)incidentonkthatarealsoincircuitm.Thissituationcanoccurinonlyfourdifferentways,asshowninFig.9-17.(Theotherfourcaseswiththeorientationofmreversedareidenticaltothesewhenxandyareinterchanged.)ThepossibleentriesinrowkofAandrowmofBincolumnpositionsxandy

aretabulatedforeachofthesefourcases.

Ineachcase,thedotproductiszero.Therefore,thetheorem.

UsingSylvester’stheorem(AppendixB)andTheorem9-8,itcanbeshown

Page 273: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.9-17Vertexkincircuitm.

thatinadigraphwitheedges

rankofB+rankofA=e.

Morever,foraconnectedgraph

rankofA=n−1,

andtherefore

rankofB=e−n+1.

ThefollowingtwoimportantpropertiesofmatricesAandBholdfordigraphsalso,andcanbeprovedaswasdoneforundirectedgraphsinChapter7(exceptthat here we are working in ordinary real arithmetic and not in modulo 2arithmetic).

1. The nonsingular submatrices of order n − 1 of A are in one-to-onecorrespondence with the spanning trees of the connected digraph of nvertices.

Page 274: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

2. ThenonsingularsubmatricesofBoforderµ(=e−n+1)areinone-to-onecorrespondencewiththechordset(complementofthespanningtree)oftheconnecteddigraphofnverticesandeedges.

Sign of a Spanning Tree: For a digraph the determinant of the nonsingularsubmatrixofAcorrespondingtoaspanningtreeTcanassumeeitheravalueof+1or−1.ThisisreferredtoasthesignofT.Asweshallsee inChapter13, in theanalysisofacertainclassofelectrical

networks it isnecessary toknow thesignsof thespanning trees.Note that thesignofaspanningtree isdefinedonlyforaparticularorderingofverticesandedgesinA(becauseinterchangingtworowsorcolumnsinamatrixchangesthesignof its determinant).Thus the signof a spanning tree is relative.Once thesignofonespanningtreeisarbitrarilychosen,thesignofeveryotherspanningtreeisdeterminedaspositiveornegativewithrespecttothisspanningtree.

Number of Spanning Trees: We have Theorem 9-9 for determining thenumber of spanning trees in a connected digraph. (An identical result forundirectedgraphswasgiveninProblem7-20.)

THEOREM9-9

Let Af be the reduced incidence matrix of a connected digraph. Then thenumberofspanningtreesinthegraphequalsthevalueof

Proof:AccordingtotheBinet-Cauchytheorem(AppendixA)

EverymajorofAfor iszerounlessitcorrespondstoaspanningtree,inwhichcaseitsvalueis1or−1.SincebothmajorsofAfand havethesamevalue+1or−1,theproductis+1foreachspanningtree.

Fundamental Circuit Matrix: The μ fundamental circuits each made by achord(withrespecttosomespecifiedspanningtree)defineafundamentalcircuitmatrixBf for a digraph. The orientation assigned to each of the fundamental

Page 275: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

circuits is chosen to coincide with that of the chord. Therefore, Bf, a μ by ematrix,canbeexpressedexactlyinthesameformasinthecaseofanundirectedgraphinSection7-4:

Bf=[Iμ¦Bt],

whereIμ is theidentitymatrixoforderμ,andthecolumnsofB,correspondtotheedgesinaspanningtree.ThisisillustratedinFig.9-18.

Fig.9-18Digraphanditsfundamentalcircuitmatrix.

The cut-setmatrixCof a digraphG is also similarly defined.And so is itssubmatrixCf, the fundamental cut-setmatrixwith respect to a given spanningtreeinG.

9-9.ADJACENCYMATRIXOFADIGRAPH

Anotherimportantmatrixusedintherepresentationandstudyofdigraphsistheadjacencymatrix defined as follows :LetG be a digraphwithn vertices,

Page 276: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

containingnoparalleledges.ThentheadjacencymatrixX=[xij]ofthedigraphGisannbyn(0,l)-matrixwhoseelement

xij=1, ifthereisanedgedirectedfromithvertextojthvertex,=0, otherwise.

AdigraphanditsadjacencymatrixareshowninFig.9-19.Theadjacencymatrixoccursinmanydifferentdisciplines,andthereforehas

differentnames. In the theoryof sequentialmachines it iscalled the transitionmatrix.Inthecalculusofrelationsitiscalledtherelationmatrix.(ObservethattherelationmatrixdefinedinSection9-3isthesameastheadjacencymatrixofthecorrespondingdigraph.)Innetworkflowsitiscalledtheconnectionmatrix.It is also known as the precedence matrix or preference matrix in somesociologicalapplications.Inschedulingandcritical-pathanalysis theadjacencymatrixisknownasthepredecessormatrix.Let us make the following observations on the properties of the adjacency

matrixXofadigraphG.

Fig.9-19Digraphanditsadjacencymatrix.

1. XisasymmetricmatrixifandonlyifGisasymmetricdigraph.

2. Everynonzeroelementon themaindiagonal representsaself-loopat thecorrespondingvertex.

3. ThereisnowayofshowingparalleledgesinX.Thisiswhytheadjacencymatrixisdefinedonlyforadigraphwithoutparalleledges.

4. The sumof each row equals the out-degree of the corresponding vertex,and the sum of each column equals the in-degree of the correspondingvertex.ThenumberofnonzeroentriesinXequalsthenumberofedgesinG.

5. Permutation of any two rows accompanied by a permutation of the

Page 277: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

corresponding columnsdoesnot alter thegraph.Thepermutationmerelycorresponds to a reordering of the vertices. Thus two digraphs areisomorphic if and only if their adjacency matrices differ only by suchpermutations.

6. IfXistheadjacencymatrixofadigraphG,thenthetransposedmatrixXT

istheadjacencymatrixofadigraphGRobtainedbyreversingthedirectionofeveryedgeinG.

7. Foranysquare(0,l)-matrixQofordern,thereexistsauniquedigraphGofnvertices,suchthatQistheadjacencymatrixofG.

The adjacency matrix is used as a tool to investigate the properties of adigraph, specially by means of a digital computer. For example, theconnectednessofadigraphisreflectedinitsadjacencymatrixinthefollowingfashion.

Connectedness and theAdjacencyMatrix:A digraph is disconnected if andonlyifitsverticescanbeorderedinsuchawaythatitsadjacencymatrixXcanbeexpressedasthedirectsumoftwosquaresubmatricesX1andX2asfollows:

Such a partitioning is possible if and only if the vertices in the submatrixX1havenoedgegoingtoorcomingfromthevertexsetinX2.Similarly, a digraph is weakly connected if and only if its vertices can be

orderedinsuchawaythatitsadjacencymatrixXcanbeexpressedintheform(9-7)or(9-8):

whereX1andX2aresquaresubmatrices.Form(9-7) represents thecasewhenthereisnodirectededgegoingfromthesubdigraphcorrespondingtoX1totheone corresponding to X2. Form (9-8) represents the case when there is nodirectededgegoingtothesubdigraphcorrespondingtoX1.

Page 278: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

A digraph that is neither unconnected nor weakly connected is stronglyconnected.Therefore,weconcludethatadigraphGisstronglyconnectedifandonlyiftheverticesofGcannotbeorderedsuchthatitsadjancencymatrixXisexpressibleintheform(9-6),(9-7),or(9-8).

NumberofEdgeSequences:Wehavethefollowingresult,similartoTheorem7-8,concerningthepowersoftheadjacencymatrixXofadigraphG.

THEOREM9-10

The(i,j)thentryinXrequalsthenumberofdifferent,directededgesequencesofredgesfromtheithvertextothejth.

Proof:(Byinduction)Thetheoremistriviallytrueforr=1.Astheinductivehypothesis, assume that the theorem holds for Xr-1. The (i, j)th entry inXr(=Xr−1.X)

according to the induction hypothesis. In (9-9), xkj = 1 or 0, depending onwhetherornotthereisadirectededgefromktoj.Thusaterminthesum(9-9)isnonzeroifandonlyifthereisadirectededgesequenceoflengthrfromitoj,whoselastedgeisfromktoj.Ifthetermisnonzero,itsvalueequalsthenumberofsuchedgesequencesfromitojviak.Thisholdsforeveryvertexk,1≤k≤n.Therefore, (9-9) isequal to thenumberofallpossibledirectededgesequencesfromitoj.

AsinthecaseofTheorem7-7,itmustbekeptinmindthatthe(i,j)thentryinXrgivesthenumberofalldirectededgesequencesfromvertexitoj.Theseedgesequencesfallinthreedifferentcategories:

1. Directed paths from i to j: Those directed edge sequences in which novertexistraversedmorethanonce.

2. Directed walks from i to j: Those directed edge sequences in which avertexmay be traversedmore than once, but no edge is traversedmorethanonce.

Page 279: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

3. Those directed edge sequences in which an edge may also be traversedmorethanonce.

Unfortunately,thereisnoeasywayofseparatingthese,say,category1from2and 3. This is why this simple method cannot be employed for enumeratingdirectedpathsordirectedcircuitsofaspecifiedlength.Forexample,examinethefourthpoweroftheadjacencymatrixofthedigraph

inFig.9-19:

The entry in the second row and third column represents two directed edgesequencesoflengthfour:cbgf(adirectedwalkfrom2to3)andddcb(notawalk).Thethirddiagonalentryrepresentstwodirectededgesequencesoflengthfourbeginningandendingatvertex3:gecb(adirectedcircuit)andgfgf(notadirectedcircuit).ThereadershouldalsoexaminetheremainingentriesinX4.

Number of Arborescences: A method of counting the number of spanningtrees ina labeled,undirectedgraphwassuggested inProblem7-23.There isasimilarformulaforcountingthenumberofspanningarborescencesinalabeled,connected, simple digraph. (Counting of the spanning arborescences in anyconnecteddigraphisatrivialextensionofcountingtheminasimple,connecteddigraph.Theself-loopscanbediscarded rightaway,andadditionofaparalleledgebtoanexistingedgeasimplydoublesthenumberofthearborescences−repeatingthesamearborescenceswithareplacedbyb.)In preparation for the arborescence counting formula, let us define, for a

simple digraphG of n vertices, an n by n matrix called theKirchhoff matrixK(G)orK=[kij]:

kii=d−(vi), in-degreeoftheithvertex,

kij=−xij, (i,j)thentryintheadjacencymatrix,withanegativesign.

Forexample,adigraphanditsKmatrixareshowninFig.9-20.

Page 280: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

ThesumoftheentriesineachcolumninaKmatrixisequaltozero,whichmeansthatthenrowsarelinearlydependent;therefore,

detK=0.

NextweexplorethespecialpropertyoftheKmatrixofanarborescence.

THEOREM9-11

AsimpledigraphGofnverticesandn−1directededgesisanarborescencerootedatv1ifandonlyifthe(1,1)cofactorofK(G)isequalto1.

Proof:(a)LetGbeanarborescencewithnverticesandrootedatvertexv1.Relabeltheverticesasv1,v2, . . . ,vnsuchthatverticesalongeverydirected

pathfromtherootv1haveincreasingindices.PermutetherowsandcolumnsofK(G)toconformwiththisrelabeling.Since the in-degree of v1 equals zero, the first column contains only zeros.

OtherentriesinK(G)are

kij=0, i>j,

kij=−xij, i<j,

kii=1, i<1.

ThentheKmatrixofanarborescencerootedatv1isoftheform

Clearly,thecofactorofthe(1,1)entryis1;thatis,detK11=1.(b)Conversely,letGbeasimpledigraphofnverticesandn−1edges,andlet

the(1,1)cofactorofitsKmatrixbeequalto1;thatis,detK11=1.Since det K11 ≠ 0, every column in K11 has at least one nonzero entry.

Page 281: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Therefore,

d−(vi)≥1, fori=2,3,...,n.

Thereareonlyn−1edgestogoaround.Therefore,

d−(vi)=1, fori=2,3,...,n,

and

d−(v1)=0.

Nowsincenovertex inGhasan in-degreeofmore thanone, ifGcanhaveany circuit at all, it has to be a directed circuit. Suppose that such a directedcircuitexists,whichpassesthroughverticesvi1,vi2,...,vir.Thenthesumofthecolumns i1, i2, . . . , ir in k11 is zero. (This is because each of these columnscontainsexactlytwononzeroentries,a1onthemaindiagonal,anda−1fortheincomingedgefromthevertexprecedingitinthedirectedcircuit.)Thusthesercolumns in K11 are linearly dependent. Hence det K11 = 0, a contradiction.Therefore,Ghasnocircuits.IfGhasn−1edgesandnocircuits,itmustbeatree.Sinceinthistree

d−(v1)=0,

and

d−(vi)=1,fori=2,3,...,n,

Gmustbeanarborescencerootedatvertexv1.

Theargumentsin(a)and(b)arevalidforanarborescencerootedatanyvertexvq.AnyreorderingoftheverticesinGcorrespondstoidenticalpermutationsofrowsandcolumnsinK(G).Suchpermutationsdonotalterthevalueorsignofthedeterminant.

Nextwecome toan important result,whichwasfirstdiscoveredbyR.BottandJ.P.MayberryandwasprovedbyW.T.Tutte.

Page 282: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

THEOREM9-12

LetK(G)betheKirchhoffmatrixofasimpledigraphG.Thenthevalueofthe(q,q)cofactorofK(G)isequaltothenumberofarborescencesinGrootedatthevertexvq.

Proof:TheproofdependsontheresultofTheorem9-11andonthefactthatthe determinant of a square matrix is a linear function of its columns.Specifically, if P is a square matrix consisting of n column vectors, each ofdimensionn,thatis,

then

IngraphGsupposethatvertexvjhasin-degreeofdj.ThejthcolumnofK(G)can be regarded as the sum of dj different columns, each corresponding to agraphinwhichvjhasin-degreeone.Andthen(9-10)canberepeatedlyapplied.After this, splitting of columns can be carried out for each y, j ≠ q, and detKqq(G)canbeexpressedasasumofdeterminantsofsubgraphs;thatis,

wheregisasubgraphofG,withthefollowingproperties:

1. Everyvertexinghasanin-degreeofexactlyone,exceptvq.

2. ghasn−1vertices,andhencen−1edges.FromTheorem9-11,

detKqq(g)=1, ifandonlyifgisanarborescencerootedatq,

=0, otherwise.

Thus the summation in (9-11) carried over all g’s equals the number ofarborescencesrootedatvq.

Page 283: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Theorem9-12 is illustrated in Fig. 9-20.The cofactor of every entry in thesecond row of the K matrix is 3. The digraph does indeed have threearborescencesrootedatvertex2.ForanEulerdigraphG,allcofactorsofK(G)areequal,because thesumof

eachrowandthesumofeachcolumnequalszero.LetthiscommonvalueofallcofactorsofK(G)beσ.ThisσisthenumberofdifferentarborescencesrootedatanygivenvertexinG.ThenumberofdifferentEulerlinesassociatedwitheachofthesedistinctarborescencesisgivenbyEq.(9-5).Therefore,Theorem9-13isobtained.

Fig.9-20DigraphG,itsKmatrix,andallarborescencesrootedat2.

THEOREM9-13

InanEulerdigraphthenumberofEulerlinesis

From this theorem we can compute the number of Euler lines in anyconnectedbalanceddigraph.Asanexample,letuscomputethenumberofEulerlinesinFig.9-10.ItsKmatrixis

Page 284: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

(In this matrix, vertices appear in the order as they do in the directedHamiltonianpathe2e3e4e11e12e14e15.)Thecofactorofanyterminthismatrixis16,andthereforeσ=16inTheorem

9-13.Sinced−(vt)=2foreachviinFig.9-10,

Therefore,thenumberofEulerlinesinFig.9-10is16.

However,foraregularEulerdigraph,suchastheoneinFig.9-10,itisofteneasiertocomputethenumberofEulerlinesbyothermethods(Problem9-18).

9-10.PAIREDCOMPARISONSANDTOURNAMENTS

Inmanyexperiments,speciallyinthesocialsciences,oneisrequiredtorankanumber of given objects by comparing only two at a time. This is called themethod of paired comparisons, and is used in situations where a numericalmeasurementisdifficult,forexample,individualpreferenceforpiecesofmusic.The itemsarepresented twoata time toa subjectandhe isasked to statehispreference. After having noted the results of all possible n(n − l)/2 pairedcomparisonsof then objects, the experimenter ranks then objects in order ofpreference.Adigraphisanaturalwayofrepresentingtheresultsofapaired-comparison

experiment.The results of a classic experiment ofKendall [9-5] are shown inFig.9-21.Sixdifferentdogfoods{1,2,...,6}weretoberanked.Eachdaytwoofthesixdelicacieswereservedtoadog,andthedogestablishedpreferenceforone food over the other according to which plate he finished first. The

Page 285: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

experimentwasconductedfor15days,sothatallpossiblepairscouldbetried.Inthegraphrepresentation,anedgeisdrawnfromthepreferreddishtothelesspreferred.Forexample,1waspreferredto2inFig.9-21.Suchagraphiscalledapreferencegraph.Establishingarankfromagivenpreferencegraphis,ingeneral,noteasy.In

Fig.9-21,forexample,duetosomecanineinconsistency,thedogpreferredfood1over2,2over4,andthen4over1.Sowhichofthethreeisthebest?

Fig.9-21Resultsofapaired-comparisonexperiment.

On Tournaments: A similar situation is encountered in tournaments. Theresults of a round-robin tournament in which every player has played againsteveryothermayalsoberepresentedbyadigraphinwhichanedgedirectedfromvertex a to b represents the victory of player a over player b. This is why acompleteasymmetricdigraphwascalledatournamentoracompletetournamentinSection9-2.ThedigraphinFig.9-21canalsobeviewedastheresultofasix-playertournament.Theproblemofrankingplayersinatournamentisidenticaltothatofrankinginapaired-comparisonexperiment.

RankingbyScore:Astraightforwardmethodofranking,andtheonethathasbeentraditionallyusedinround-robintournaments,istorankeachplayerbyhisscore.Thescoreisthenumberofgamestheplayerhaswon.Intermsofthedogfood,thenumberoftimestheparticulardishwaspreferredisitsscore.Thescoreofaplayerinatournamentequalstheout-degreeofthecorrespondingvertexinthedigraph.Thusifweusethescoresforranking,wewouldrankthesixdogfoodsas

(1,3),(2,5,6),and4.

Thatis,foods1and3aretiedforthefirstrank;thereisathree-waytieforthesecondrank;andfood4istheleastpreferred.

Page 286: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Rankingtheverticesaccordingtotheirout-degreesisnotalwaysasatisfactorymethod,althoughitistheeasiest.Inparticular,thismethodlosessignificanceifthe tournament is incomplete (that is, the players do not compete in the samenumberofgames).

RankingbyHamiltonianPath:Anothermethodsometimesusedistoranktheplayers in a directedHamiltonian path, such that each player has defeated hissuccessor.Onesuch ranking inFig.9-21 is132564. In thiscontext, letusprovethefollowingresultregardingHamiltonianpathsinatournament.

THEOREM9-14

EverycompletetournamenthasadirectedHamiltonianpath.

Proof:Thetheoremwillbeprovedbyinductiononthenumberofvertices.Byactualsketching,thetheoremcanbeshowntoholdforallcompletetournamentsof1,2,3,and4vertices.Letusmaketheinductiveassumptionthatthetheoremis true for all complete tournaments of n vertices, and then prove that it alsoholdsforalltournamentsofn+1vertices.LetG be any complete tournament of n + 1 vertices. Let g be an nvertex

complete subtournament of G. By inductive assumption, g has a directedHamiltonianpath.Letthatpathbev1v2 . . .vn.LetthevertexpresentinGbutnotingbecalledvn+1.SinceGisacompletetournamentofn+1vertices,thevertexvn+1inGhasa

directed edge either to or from each of the other vertices v1 v2 . . . , vi. Thefollowingthreecasesarepossible.

Case1:Theedgebetweenvn+1andv1isdirectedtowardv1.ThenwehaveaHamiltonian path vn + 1 v1 v2 . . . vn inG, and the proof is complete [Fig. 9-22(a)].

Page 287: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.9-22ThreecasesofTheorem9-14.

Case 2: There is an edge, directed from vn to vn + 1. Then also we have aHamiltonianpathinG,whichisv1v2...vnvn+1andtheproofiscomplete[Fig.9-22(b)].Case3:Instead,boththeseedgesaredirectedfromv1tovn+1andfromvn+1

tovn.Inthiscase,aswemovefromv1tovn,weencounterareversalofdirectionintheedgesincidentonvn+1.Thisreversalmustoccurbecauseedge(v1,vn+1)isdirectedtowardvn+1butedge(vn,vn+1)isdirectedawayfromvn+1.Callthevertexatwhichthefirstsuchreversaloccursvi(vimaybevnitself).Thenedge(vn−1,vn+1)mustbedirectedtowardvn+1.SeeFig.9-22(c).Inthiscasewehave a directedHamiltonian path v1 v2 . . . vi − 1 vn + 1 vi vi + 1 . .. vn inG.Therefore,thetheorem.

Comingback to theoriginalproblemof ranking thevertices,wenowknowthatifthedigraphisacompletetournament,atleastoneHamiltonianrankingisalwayspossible.However,thismethodofrankingalsosuffersfromsomedrawbacks.Forone,

theremaybediscrepanciesbetweensucharankingandthescoresoftheplayers.Second,a tournamentmayhavemore thanonedirectedHamiltonianpath,and

Page 288: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

thereforeseveraldifferentrankingsarepossible.InFig.9-21,forinstance,132564and135624aretwodifferentHamiltonianrankings.

RankingwithMinimumViolations: For a given ranking of then vertices inany tournament (complete or incomplete), a violation is defined as an edgedirectedfromvitovjifvjprecedesviintheranking.Forexample,inFig.9-21theorder132564hasthefollowingtwoviolations−edges4to1and6to2.Theorder325641hasfiveviolations,edges1to3,1to2,6to2,1to5,and1to6.Ranking with the minimum number of violations represents the fewest

possible upsets for a given tournament. It can be shown that a ranking withminimumviolations automatically includes the rankingaccording to scores, aswellasaHamiltonianranking.Moreover,aminimum-violationranking isalsomeaningful for incomplete tournaments. Thus thismay be considered the bestmethodofranking.However,outofalln!possibleordersofnvertices,tofindonewithminimum

violations is computationally difficult.Amethod using dynamic programminghasbeenusedandisthebestavailablesofar,butitiscomputationallyslowandcumbersome.Aminimumnumberofviolationsamongalln!rankingsrepresentsasmallest

setofedgeswhoseremovalfromthedigraphwilleliminatealldirectedcircuits,that is, make the digraph acyclic. Acyclic digraphs are discussed in the nextsection.

9-11.ACYCLICDIGRAPHSANDDECYCLIZATIONInmanysituations semicircuits areofno significance, andone is concerned

onlywithwhetherornotagivendigraphhasadirectedcircuit.Adigraphthathasnodirectedcircuitiscalledacyclic.Letusmakethefollowingobservationsaboutacyclicdigraphs:

1. Everytree(withdirectededges)isanacyclicdigraph,buttheconverseisnottrue.Forexample,thedigraphinFig.9-4isacyclic,butitisnotatree.

2. Anacyclicdigraphcannotbecondensed.That is, thecondensationGcofanacyclicdigraphGisGitself.Theconverseisalsotrue,becauseifGc=G,obviouslyGhasnodirectedcircuit.

3. Anacyclicdigraphrepresentsan irreflexive,asymmetricrelation.But thedigraph of an irreflexive, asymmetric relation is not necessarily acyclic.

Page 289: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

(Why?)

4. A digraphG is acyclic if and only if every directedwalk inG is also adirectedpath.

5. Observation 4 has a significant implication: If a digraph is acyclic, the(i,j)th entry inXk gives the number of distinct directed paths of lengthkfromtheithvertextothejthvertex.

THEOREM9-15

Every acyclic digraphG has at least one vertexwith zero in-degree and atleastonevertexwithzeroout-degree.Proof:Consideranymaximaldirectedpath(i.e.,apathwhoselengthcannot

beincreasedbyanedgeateitherend)PinG.LetvbethevertexwherePstartsandwbethevertexwhereitends.SinceGisacyclic,vandwmustbedistinct.NowtheverticesinGcanbedividedintotwoclasses:ThesetV1ofverticesthatareonP,andthesetV2oftheremainingvertices.ThereisnoedgeincidentintovertexvfromanyvertexinV1 .Otherwise,G

wouldhaveadirectedcircuit.Also, there canbenoedge incident intov fromanyvertexinV2;otherwise,thelengthofPcouldhavebeenincreasedbyaddingthis edge.Thus the in-degree ofv,d−(v) = 0. Similarly, vertexw has no edgeincidentoutofit;thatis,d+(w)=0.

THEOREM9-16

AdigraphGisacyclicifandonlyifitsverticescanbeorderedsuchthattheadjacencymatrixXisanupper(orlower)triangularmatrix.

Proof:(a)LetusassumethatXisuppertriangular;thatis,

xij=0 fori≥j.

ItcanbeseenbydirectmultiplicationthatX2isalsouppertriangular,andsoareX3,X4, . . . ,allpowersofX.SinceeverydiagonalentryinallpowersofXiszero,Ghasnodirectedcircuit.Thatis,Gisacyclic.(b) For the second part of the theorem, assume thatG is acyclic and then

reorder the vertices ofG, as follows: According to Theorem 9-15, there is atleastonevertexinGwhosein-degreeiszero.Inthereorderingoftheverticesletthisbethefirstvertexv1.Now,removev1andedgesincidentonv1fromG.The

Page 290: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

remaining digraph G − v1 must also be acyclic, because G was acyclic.Therefore,G−v1hasalsoatleastonevertex,whosein-degreeinG−v1iszero.Letv2bethissecondvertexinthereordering.Nextremovev2fromG−v1.Bycontinuingthisprocessalltheverticesarereordered†asv1,v2,....NowconsidertheadjacencymatrixXofGwiththeverticesappearinginthis

order.Thefirstcolumn(correspondingtov1)hasallzeros.Thesecondcolumnbelow the first row represents vertex v2 inG − v1, and therefore contains allzeros.Andsoforth.Thus the adjacency matrix is upper triangular. This proves part (b) of the

theorem.The lower triangular portion of the theorem can also be proved either by

reorderingoftheverticeswithzeroout-degrees,orbyconsideringXTandGR.

Given the adjacencymatrixX of a digraphG, the following result is quiteusefulinfindingoutwhetherornotGisacyclic.

THEOREM9-17

DigraphGisacyclicifandonlyifdet(l−X)isnotequaltozero,whereIistheidentitymatrixofthesamesizeasX.

Proof:Det(l−X)≠0ifandonlyiftheinverse(l−X)−1exists.But

Thisinverse(1−X)−1existsifandonlyiftheinfiniteseries(9-13)converges;thatis,X*=0forallk≤someN(becauseXcontainsonlynonnegativeentries).However, Xk = 0 for all k ≥N if and only ifG contains no directed edge

sequenceoflengthNorlarger.AndthisispossibleifandonlyifGcontainsnocycleofanylength.

Decyclization: Acyclic digraphs are of enormous importance in manyapplications.Itwaspointedoutthatdirectedcircuitsrepresentinconsistenciesinranking by paired comparisons. Directed circuits may represent undesirablefeedbackpathsinanelectricalnetwork.IntheprojectgraphofaCPM(criticalpath method) or PERT (program evaluation and review technique) a directedcircuit represents a serious error, and must be eliminated. This is because adirected circuit, say abca, implies that activity a must be completed beforeactivity b, and b before c, and c before a. Obviously, this is an impossible

Page 291: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

situation and nothing will get done. A similar situation in computerprogrammingoftenarisesandisjustifiablyknownasthedeadlyencounterorthedeadlyembrace(Problem9-26).Indeductivelogic(whereverticesrepresentaxiomsorstatementsanddirected

edges represent the theorems or derivation of one statement from others), adirectedcircuitimpliescircularreasoningandhenceafallacy.Thus it is important to know how to break these vicious cycles with a

minimumofeffort.Inotherwords,findasmallestsetofdirectededgeswhoseremovalwillrenderthegivendigraphGacyclic.Consider, for example, Fig. 9-2(a). The digraph contains several directed

circuits: e1 e2 e3, e4 e6 e3, and e4e5e2e3. In this simple case, one can tell byinspectionthattheremovalofedgee3willeliminatealldirectedcircuits.Thisisthe smallest setofedgeswhose removalmakes the remainingdigraphacyclic.Such a smallest set of edges whose removal destroys all directed circuit in adigraphGisknownasaminimum-feedbackarcsetinelectricalengineering.Ingeneral, a digraphmay possess severalminimum-feedback arc sets.Obtainingonesuchsmallestsetofedgesmaybecalledminimaldecyclizationofadigraph.Minimaldecyclizationofanarbitrarydirectedgraphisatbestatediousaffair.

Nosimplemethodhasbeenfoundsofar.Onemethodproposedintheliterature(in1969)usesTheorem9-16, as follows:Make the adjacencymatrixXuppertriangular as much as possible by interchanging rows (and correspondingcolumns).The l’s remainingbelow (andon) theprincipaldiagonal represent aminimum-feedbackarcset.Anothermethodcanbe

1. Obtain all directed circuits in the given digraphG (using the result ofProblem9-11,say).

2. ExpresseachdirectedcircuitasaBooleansumofitsedges.

3. Take the Boolean product of all directed circuit expressions obtained instep2.(TheabsorptionlawsofBooleanalgebraareapplied,suchasa·a=a,a+a=a,anda+ab=a.)

4. Eachof theresulting terms in thesumof theproducts representsasetofedges whose removal will destroy all directed circuits. Pick a term thatconsistsofthesmallestnumberofedges; thisisaminimum-feedbackarcset.

Toillustratetheprocedure,letusconsiderthedigraphinFig.9-2(a).Allthedirectedcircuitsare

Page 292: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

e1e2e3,e3e4e6,ande2e3e4e5.

Expressing these as a product of Boolean sums and multiplying out andsimplifying,weget

(e1+e2+e3)(e3+e4+e6)(e2+e3+e4+e5)=e1e4+e1e6e5+e2e4+e2e6+e3.

Clearly,anyoneofthesetermsrepresentsthesetofedgeswhoseremovalwouldbreak all directed circuits in Fig. 9-2(a). The set with the smallest number ofedges,{e3},istheanswerwewereseeking.Boththesemethodsareimpracticalforlargedigraphs.

SUMMARY

Most of the important and fundamental features of directed graphs wereinvestigated in this chapter. We saw that there are two different aspects ofdigraphs:oneinwhichtheirpropertiesaresimilartothoseofundirectedgraphs,suchasplanarity,thickness,spanningtrees,fundamentalcircuits,andcutsets;intheirsecondaspect,digraphshavepropertiesaltogetherdifferent fromthoseofundirected graphs, such as strong connectedness, arborescence, decyclization,andsoon.The close relationship between binary relations and digraphswas explored.

Applicationsofdigraphsarevirtuallyunlimited.Some importantones,suchasin sequence generation in telecommunications and paired comparisons, weredealtwithindetail.Othersweresimplymentioned.

Undoubtedly, agreatdealmore remains tobe said.Additionalpropertiesofdigraphsarepresentedintheformofproblemsattheendofthischapter.Fortherestthereadermustexploreonhisown,usingthetoolsandresultspresentedinthechapter.

REFERENCESAnentire400-pagebookhasbeenwrittenbyHarary,Norman,andCartwright

[9-3]onthetheoryofdigraphs.Itisatextbookwrittenspeciallyforthosewithlittlemathematicalbackground.Thisbookisrecommendedreadingformanyofthe topics not covered in this chapter. Specializing even further, a 100-page

Page 293: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

monographwaswritten byMoon [9-7] on tournaments (complete asymmetricdigraphs) alone. This is a compactly written definitive book and is highlyrecommended for those wishing to know all about complete, asymmetricdigraphs.Forapplicationsofdirectedgraphsinoperationsresearch,Kaufmann’sbook [9-4] is a good source. In particular, Chapter 4 contains an excellentpresentation of the properties of digraphs. (Be prepared for slightly differentterminology.) For methods of paired comparison, Kendall’s book [9-5] isrecommended.Other books recommended are Chapters 5-7 in Ore [1-10] as very

introductoryreading;Chapters13-17ofBerge[1-1],intermediate-levelreading;Chapters8-10ofOre[1-9];andChapter16ofHarary[1-5]asamoreadvancedlevelofreadingondigraphs.The classicworks ofGood,Kendall, vanAardenne-Ehrenfest and deBruijn,

and Tutte have already been referred to. Chen and Wing [9-1] give someproperties and interesting applications of acyclic digraphs. MinimaldecyclizationofadigraphwasthesubjectofthedoctoralthesisbyLempel[9-6].9-1. CHEN, Y. C, and O. WING, “Some Properties of Cycle-Free Directed

GraphsandtheIdentificationoftheLongestPath,”J.FranklinInst.,Vol.281,No.4,April1966,293−301.

9-2. GOOD, I.G.,“NormalRecurringDecimals,”J.LondonMath.Soc,Vol.21(part3),1946,167−172.

9-3. HARARY,F.,R.Z.NORMAN,andD.CARTWRIGHT,StructuralModels:AnIntroductiontotheTheoryofDirectedGraphs,JohnWiley&Sons,Inc.,NewYork,1965.

9-4. KAUFMANN, A., Graphs, Dynamic Programming and Finite Games,AcademicPress,Inc.,NewYork,1967.(OriginallypublishedinFrenchin1964,DunodEditeur,Paris.)

9-5. KENDALL,M. G.,Rank CorrelationMethods, Charles Griffin and Co.,London, 1948; 3rd ed., Hafner Publishing Company, Inc., New York,1962.

9-6. LEMPEL, A., “Minimum Feedback Arc and Vertex Sets of a DirectedGraph,”IEEETrans.CircuitTheory,Vol.CT-13,No.4,Dec.1966,399−403.

9-7. MOON,J.W.,TopicsonTournaments,Holt,RinehartandWinston,Inc.,NewYork,1968.

9-8. TUTTE,W.T.,“TheDissectionofEquilateralTriangles intoEquilateralTriangles,”Proc.CambridgePhil.Soc,Vol.44,1948,463−482.

9-9. VANAARDENNE-EHRENFEST,T.,andN.G.deBruijn,“CircuitsandTreesinOrientedGraphs,”SimonStevin,Vol.28,1951,203−217.

Page 294: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

PROBLEMS9-1. Prove that in any digraph the sum of the in-degrees of all vertices is

equaltothesumoftheirout-degrees;andthissumisequaltothenumberofedgesinthedigraph.

9-2. Sketch all different (nonisomorphic) simple digraphs with 1,2, and 3vertices.

9-3. Sketchall distinct (nonisomorphic)orientationsof a completegraphoffour vertices. Characterize each of the resulting digraphs in terms ofbinaryrelations.

9-4. An irreflexive, asymmetric, transitive relationona set is calledastrictpartialorder.Give twoexamplesof strictpartialorders.Show that thedigraphofastrictpartialorderisacyclic.Istheconversealsotrue?

9-5. Thecombinationsofreflexivity,symmetry,andtransitivitydefineeight(23=8)typesofbinaryrelations.Twosuchrelationsareequivalenceandpartialorder.Listtheothersixandsketchadigraphforeach.

9-6. DefineandstudythedirectedHamiltoniancircuitandsemi-Hamiltoniancircuitinadigraph.

9-7. Provethateveryedgeinadigraphbelongseithertoadirectedcircuitoradirectedcut-set.

9-8. For annvertexdigraph,define ann bynaccessibility (or reachability)matrixR=[rij]asfollows:

rij=1, if thereisadirectedpathoflengthoneormorefromitoj,

=0, otherwise.DeviseamethodofobtainingRfromthepowersoftheadjacencymatrixX.(Notethatthisreachabilitymatrixisslightlydifferentfromthatin[9-3], because we do not include paths of zero length; i.e., rij is notnecessarilyone.)

9-9. Is it possible for two nonisomorphic digraphs to have the samereachabilitymatrixR?Explain.

9-10. ShowthatifRisthereachabilitymatrixofadigraphG,thevalueoftheith entry in the principal diagonal of R2 gives the number of verticesincludedinthestronglyconnectedfragmentcontainingtheithvertex.

9-11. ShowthatthefollowingprocedureappliedtotheadjacencymatrixX=[xij]ofadigraphGwillyieldthereachabilitymatrixRofG.Step1:Letx1i,x1j, . . . . ,x1mbe thenonzeroelements in thefirstrow.

Page 295: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Add the ith, jth, . . . ,mth rows to the first row.Replaceeachnonzeroelementbya1(Booleansum).Step2:Supposethattherearekadditionalnonzeroelementsp,q,...,rgeneratedinthefirstrowasaresultofstep1.Addthepth,qth,...,rthrowstothefirstrow,andreplaceeachnonzeroelementbya1.Step3:Repeatstep2untilnoadditionall’scanbeaddedtothefirstrowbythisprocess.Step4:RepeattheprocessoneveryrowofX.

9-12. Prove that ann-vertex digraph is strongly connected if and only if thematrixM,definedby

M=X+X2+X3+...+Xn,hasnozeroentry.Xistheadjacencymatrix.

9-13. Prove that every Euler digraph (without isolated vertices) is stronglyconnected. Also show, by constructing a counterexample, that theconverseisnottrue.

9-14. Listall16distinctdirectedEulerlinesinFig.9-10.9-15. TheEuler digraph in Fig. 9-10 is called the teleprinter diagram or the

Gooddiagramforr=4[abbreviatedasGD(4)].SketchandlabelGD(3)andGD(5). Find one directedEuler line and one directedHamiltoniancircuitineach.[Hint:GD(r)has2r−1verticesand2redges.AvertexinGD(r+1)correspondstoanedgeinGD(r).]

9-16. An edge digraph or a line digraph L(G) of a digraphG is defined asfollows:1. ThereisexactlyonevertexviinL(G)foreveryedgeeiinG.2. Wheneveredgeseiandej(foraself-loopej=ei)aresuchthatei is

incidentintoavertexvandejisincidentoutofthesamevertexv,anedgeisdrawnfromthecorrespondingvitovjinL(G).

ShowthatGD(r+1)isalinedigraphofGD(r).9-17. IfE|G|isthenumberofEulerlinesinann-vertexEulerdigraphG,show

that2n−1·E|G|isthenumberofEulerlinesinL(G).9-18. ProvethatthenumberofdirectedEulerlinesinGD(r)is

22r−1−r(Hint:UsetheresultsofProblem9-16oruseTheorem9-13.)

9-19. Adrumrotatesindiscretestepsofθdegrees,andyouaretodetermineitsprecisepositionasfollows.Dividethesurfaceofthedrumintok=360°/θ sectors, and paint each sector black or white (or conducting or

Page 296: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

nonconducting).Mount r consecutive reading heads − each capable ofdetectingthecolorofthesector.

Given some 0, express k and r in terms of θ. Sketch one sucharrangementofcolorsonthedrumfork=16.

9-20. What is the longest circular sequence formed out of three symbols(1etters)x,y,andzsuchthatnosubsequence(words)offoursymbolsisrepeated.Giveone such sequence. [Hint:Forma regularEulerdigraphwithd−(vi)=d+(vt)=3,inthemannerofFig.9-10.]

9-21. ProvethatanyacyclicdigraphGisanarborescenceifandonlyifthereisavertexvinGsuchthateveryvertexisaccessiblefromv.

9-22. Prove that for every n ≤ 3 there exists at least one acyclic completetournamentofnvertices.(Hint:Useinduction.)

9-23. LetR(G)bethereachabilitymatrixofadigraphG,andlettheverticesinGbeorderedsuchthatthesumsoftherowsinR(G)arenonincreasing;thatis,

Showwith thisorderingofvertices inR(G) thatdigraphG isacyclic ifandonlyifR(G)isanuppertriangularmatrix.

9-24. Prove that a digraphG is acyclic if and only if every element on theprincipal diagonal of its reachability (or accessibility) matrix R(G) iszero. 9-25. Prove that an acyclic digraphG ofn vertices has a uniquedirectedHamiltonianpathifandonlyifthenumberofnonzeroelementsinR(G)isn(n−l)/2.

9-26. Thereare15computerprogramsthatmustbeprocessedaccordingtothefollowingsetoforders:

1>2,7,13,

2>3,8,14,

3>9,15,

4>3,

5>4,11,

6>5,12,

7>6,

8>7,9,14,

Page 297: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

9>15,

10>4,9,

11>10,

12>11,

13>7,12,

14>13,15,where1>2,7,13means thatprograms2,7, and13canbeprocessedonlyafterprogram1hasbeenprocessed.Isitpossiblefortheprogramsto be processed? If so, give a processing sequence. [Hint:WriteX(G);deriveR(C)fromX(G)usingProblem9-11.UseProblem9-23tocheckifGisacyclic]

9-27. A digraph defined on the relation “is a parent of” is called a geneticdigraph. (Genetic digraphs are useful in biology.) Investigate thepropertiesofgeneticdigraphs.

9-28. Usedigraphstosolvetheclassicalproblemof“threecannibalsandthreeediblemissionariesseekingtocrossariverinaboatthatcanholdatmosttwopeople,andallthemissionariesandoneofthecannibalscanrowtheboat.Also, atno time should the cannibalsoutnumber themissionariesoneithershore.” (Hint:Representeachstatebyavertexandapossibletransitionbyadirectededge.)

†Someauthorsmakeadistinctionbetweentheterms“orientedgraph”and“directedgraph”byreservingtheformerforonlythosedigraphswhichhaveatmostonedirectededgebetweenapairofvertices.Thisoftenleadstoconfusion;therefore,weusethesetwotermssynonymously.†Acut-setinwhichalledgesareorientedinthesamedirectioniscalledadirectedcut-set.†Thisiscalledatopologicalsorting.SeeSection14-8also.†Thisidentitycanbeseenbypremultiplyingbothsidesof(9-13)withthematrix(I−X).

Page 298: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

10ENUMERATIONOFGRAPHS

ArthurCayley (1857), one of the founding fathers of graph theory, becameinterested in graph theory for the purpose of counting trees. The number ofdifferent trees of n vertices gave him the number of isomers of the saturatedhydrocarbonwithncarbonatoms,thatis,CnH2n+2.SinceCayley’sclassicpaper,a great deal of work has been done on counting (also called enumeration) ofdifferent types of graphs, and the results have been applied in solving somepracticalproblems.Someenumerationproblemshavealreadybeenintroducedinearlierchapters.

Forexample, inChapter2 thenumberofedge-disjointHamiltoniancircuits inthecompletegraphofnverticeswasdiscussed.EnumerationoftreesinSection3-6; finding all spanning trees in Section 3-9; the number of different edgesequences of length r between a specified pair of vertices (Theorem 7-8);Problems7-20,7-23,and7-24;thenumberofdifferentarborescencesrootedatagivenvertexinChapter9;andthenumberofdifferentdirectedEulerlinesinadigraph,alsoinChapter9,wereallproblemsofcountinggraphs.Inthischaptera more unified approach to enumerating graphs will be taken. Certainenumerativetechniqueswillbedevelopedandusedforcountingcertaintypesofgraphs.AthoroughexpositionofPólya’scounting theorem, themostpowerfultoolingraphenumeration,isthecentralfeatureofthischapter.

10-1. TYPESOFENUMERATION

Allgraph-enumerationproblemsfallintotwocategories:

1. Countingthenumberofdifferentgraphs(ordigraphs)ofaparticularkind,for example, all connected, simple graphs with eight vertices and twocircuits.

2. CountingthenumberofsubgraphsofaparticulartypeinagivengraphG,

Page 299: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

suchas thenumberof edge-disjointpathsof lengthk betweenverticesaandbinG.

ThesecondtypeofproblemusuallyinvolvesamatrixrepresentationofgraphGandmanipulationsofthismatrix.Suchproblems,althoughoftenencounteredin practical applications, are not as varied and interesting as those in the firstcategory.Weshallnotconsidersuchproblemsinthischapter.Inproblemsoftype1theword“different”isofutmostimportanceandmust

be clearlyunderstood. If thegraphs are labeled (i.e., eachvertex is assignedanamedistinctfromallothers),allgraphsarecounted.Ontheotherhand,inthecaseofunlabeledgraphs theword “different”meansnonisomorphic, and eachsetofisomorphicgraphsiscountedasone.Asanexample,letusconsidertheproblemofconstructingallsimplegraphs

withnverticesandeedges.Therearen(n−1)/2unorderedpairsofvertices.Ifweregardtheverticesasdistinguishablefromoneanother(i.e.,labeledgraphs),thereare

waysof selectinge edges to form thegraph.Thusexpression (10-1)gives thenumberofsimplelabeledgraphswithnverticesandeedges.Many of these graphs, however, are isomorphic (that is, they are the same

except for the labelsof theirvertices).Hence thenumberof simple,unlabeledgraphsofnverticesandeedgesismuchsmallerthanthatgivenby(10-1).Among a collection of graphs, isomorphism is an equivalence relation

(Problem 10-1). The number of different unlabeled graphs (of a certain type)equals the number of equivalence classes, under isomorphism, of the labeledgraphs.Forexample,wehave16differentlabeledtreesoffourvertices(Fig.3-15),andthesetreesfallintotwoequivalenceclasses,underisomorphism.InFig.3-15the4treesinthetoprowfallintooneequivalenceclass,andtheremaining12intoanother.Thuswehaveonlytwodifferentunlabeledtreesoffourvertices(Fig.3-16).Letusnowproceedwithcountingcertainspecifictypesofgraphs.

THEOREM10-1

Thenumberofsimple,labeledgraphsofnverticesis

Page 300: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Proof:Thenumbersofsimplegraphsofnverticesand0,1,2,...,n(n−1)/2edgesareobtainedbysubstituting0,1,2,...,n(n−1)/2foreinexpression(10-1). The sum of all such numbers is the number of all simple graphs with nvertices.Thentheuseofthefollowingidentityprovesthetheorem:

10-2. COUNTINGLABELEDTREES

Expression(10-1)canbeusedtoobtainthenumberofsimplelabeledgraphsofnverticesandn−1edges.Someofthesearegoingtobetreesandotherswillbe unconnected graphs with circuits. Let us now prove Theorem 3-10, whichgivesthenumberoftrees.

THEOREM3-10

Therearenn-2labeledtreeswithnvertices(n≥2).

ProofofTheorem3-10:LetthenverticesofatreeTbelabeled1,2,3,...,n.Remove the pendant vertex (and the edge incident on it) having the smallestlabel,whichis,say,a1.Supposethatb1wasthevertexadjacenttoa1.Amongtheremainingn−1verticesleta2bethependantvertexwiththesmallestlabel,andb2 be the vertex adjacent to a2. Remove the edge (a2, b2). This operation isrepeatedontheremainingn−2vertices,andthenonn−3vertices,andsoon.Theprocessisterminatedaftern−2steps,whenonlytwoverticesareleft.ThetreeTdefinesthesequence

uniquely.Forexample,forthetreeinFig.10-1thesequenceis(1,1,3,5,5,5,9).Notethatavertexiappearsinsequence(10-3)ifandonlyifitisnotpendant(seeProblem10-2).Conversely,givenasequence(10-3)ofn−2labels,ann-vertextreecanbe

Page 301: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.10-1Nine-vertexlabeledtree,whichyieldssequence(1,1,3,5,5,5,9).

constructeduniquely,asfollows:Determinethefirstnumberinthesequence

thatdoesnotappearinsequence(10-3).Thisnumberclearlyisa1.Andthustheedge(a1,b1)isdefined.Removeb1fromsequence(10-3)anda1from(10-4).Inthe remainingsequenceof (10-4) find the firstnumber thatdoesnotappear intheremainderof(10-3).Thiswouldbea2,andthustheedge(a2,b2)isdefined.The construction is continued till the sequence (10-3) has no element left.Finally,thelasttwoverticesremainingin(10-4)arejoined.Forexample,givenasequence

(4,4,3,1,1),

we can construct a seven-vertex tree as follows: (2, 4) is the first edge. Thesecondis(5,4).Next,(4,3).Then(3,1),(6,1),andfinally(7,1),asshowninFig.10-2.

Page 302: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.10-2Treeconstructedfromsequence(4,4,3,1,1).

Foreachofthen−2elementsinsequence(10-3)wecanchooseanyoneofnnumbers,thusforming

(n−2)-tuples,eachdefiningadistinctlabeledtreeofnvertices.Andsinceeachtree defines one of these sequences uniquely, there is a one-to-onecorrespondencebetweenthetreesandthenn-2sequences.Hencethetheorem.

RootedLabeledTrees:Inarootedgraphonevertexismarkedastheroot.Foreachofthenn-2labeledtreeswehavenrootedlabeledtrees,becauseanyofthenverticescanbemadearoot.Therefore,

THEOREM10-2

Thenumberofdifferentrooted,labeledtreeswithnverticesis

Allrootedtreesforn=1,2,and3aregiveninFig.10-3.

10-3. COUNTINGUNLABELEDTREES

Theproblemofenumerationofunlabeledtreesismoreinvolvedandrequiresfamiliaritywiththeconceptsofgeneratingfunctionsandpartitions.

Page 303: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.10-3Rootedlabeledtreesofone,two,andthreevertices.

GeneratingFunctions

One of the most useful tools in enumeration techniques is the generatingfunction.Ageneratingfunctionf(x)isapowerseries

insomedummyvariablex.Thecoefficientakofxkisthedesirednumber,whichdepends on a collection of k objects being enumerated. For example, in thegeneratingfunction

the coefficient of xk gives the number of distinct combinations of n differentobjectstakenkatatime.Asanotherexample,considerthefollowinggeneratingfunction:

Page 304: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

The coefficient of xk in (10-9) gives the ways of selecting k objects from n(distinct) objects with unlimited repetitions.† Note that the variable x has nosignificance.Weareinterestedonlyinthecoefficients.The generating function is used as a counting device and is therefore also

calledacountingseriesoranenumerator.Anoperationonageneratingfunctionissimpler than thecorrespondingoperationon thesequenceofcoefficientsa0,a1, a2, . . . . For a detailed treatment of generating functions, the reader isreferredtoChapter2in[3-11]orChapter3in[10-1].

Partitions

Anotherusefulandimportantconceptinenumerativecombinatoricsisthatofapartitionofapositiveinteger.Whenapositiveintegerpisexpressedasasumofpositiveintegers

theq-tupleiscalledapartitionofintegerp.Forexample,(5),(41),(32),(311),(221),(211l),and(11111)arethesevendifferentpartitionsoftheinteger5.Theintegers,λi′s,arecalledpartsofthepartitionednumberp.Itisconvenient

torepresenttherepeatedpartsbymeansofexponents;forexample,partition(2111)iswrittenas(213).The partitions of an integer p may be unrestricted or may have some

restrictionsonthem,suchasnorepetitionofanypart[i.e.,λi≠λjin(10-10)],ornopartgreaterthankisallowed.Thenumberofpartitionsofagivenintegerpisoften obtained with the help of some generating function. For example, thecoefficientofxkinthepolynomial

givesthenumberofpartitions,withoutrepetition,ofanintegerk≤p(seepage111,[3-11]).

Page 305: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Partitionsareimportanttousbecausemanygraph-enumerationproblemscanbeexpressedintheformofpartitionproblems.

RootedUnlabeledTrees

Comingbacktocountingtrees,letusrecallthatarooted,unlabeledtreeisoneinwhichallverticesexcepttherootareassumedalike.Letunbethenumberofunlabeled,rootedtreesofnvertices,andletun(m)bethenumberofthoserootedtreesofnverticesinwhichthedegreeoftherootisexactlym.Then

Fig.10-4Rootedtreedecomposedintorootedsubtrees.

Any rooted treeT ofn vertices andwith rootR of degreem canbe lookeduponascomposedofmrootedsubtrees,eachattachedtoRbymeansofanedgebetween its root andR. For example, in Fig. 10-4 an 11-vertex, rooted tree iscomposedoffourrootedsubtrees.Inann-vertextreeTthen−1verticesaredistributedamongthemsubtrees,

andthusTdefinesanm-partpartitionofthenumbern−1.Supposethatkjisthenumberofsuchsubtrees(inT)withjvertices.Then

and

NotethatEqs.(10-12)and(10-13)representanm-partpartitionofintegern−

Page 306: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

1,inwhichintegeriappearskitimes(0≤ki≤n−1).InFig.10-4,forexample,

One can construct uj distinct rooted trees with j unlabeled vertices. Out ofthese trees we select kj trees to form subtrees ofT. Since the same treemayappearmore than once as a subtree ofT,we have the problem of finding thenumberofwaysofselectingkjobjectsoutofujobjectswithunlimitedrepetition.AccordingtoEq.(10-9),thisnumberis

Since each such selection can bemade independently, the possible number ofdistincttreesforthisspecificpartitionis

where un(k1, k2, . . . , kn-1) stands for the number of n-vertex, rooted treescorrespondingtothepartition

1k12k23k3...(n-1)kn-1

Additionofun(k1,k2,...,kn-1)overallpossiblepartitionsofn−1yieldsthetotalnumberofspanningtrees.Thatis,

Whatwehaveobtainedin(10-16)isarecurrencerelation−asolutiontypicalofmany combinatorial problems. It gives un, the number of rooted, unlabeled

Page 307: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

treesofnvertices,intermsofu1,u2,...,un-1.Tousethisrelation,onebuildsupnumericaltablesinastep-by-stepfashion.Forexample,

Toevaluateu4,wefirsthavetofindallpartitionsofinteger3.Theseare

(3),(2,1),and(1,1,1).

Thesumoftherespectivetermscontributedbythesepartitionsis

Similarly, to evaluate u5 we observe that the integer 4 has five differentpartitions,andtheseare

(4),(3,1),(2,2),(2,1,1),and(1,1,1,1).

Fig.10-5Rooted,unlabeledtreesofone,two,three,andfourvertices.

The number of rooted trees corresponding to each of these five partitions isobtainedusing(10-15).Thesumyieldsu5:

Page 308: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Andsoon.InFig.10-5,allrooted,unlabeledtreesofone,two,three,andfourverticesareshown.Clearly,computationofunfor,say,n=20,using(10-16)isextremelytedious

andinvolved.Itrequiresobtainingallpossiblepartitionsofinteger19(thereare490 partitions of 19), computing u19, u18, . . . , u2, u1 evaluation of thecombinatorialproductterm

foreachpartition,andthentakingthesumofall490suchterms.

Counting Series for un: To circumvent some of these difficulties incomputationofun, let us find its counting series (i.e., thegenerating function)u(x),where

Substitutionof(10-16)in(10-17)andsubstitutionofn−1byitspartitionasin(10-12)yields

Observingthateverysequenceofpositiveintegersformsapartitionofsomeinteger,(10-18)canberearrangedas

Page 309: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Substitutingtheidentity

in(10-19)givesusthedesiredcountingseries.Thatis,

Calculationofunfrom(10-20)involvesbuildingupatableofuifori=1,2,3,...,n−1,andsubstitutingthevaluesin(10-20).Thefirst10termsintheseries(10-20)are

Thereadershouldverify(10-20a)himselfandextendtheexpansion throughanother10terms.The generating function u(x) can be expressed in an alternative form as

follows:TakingthenaturallogarithmsofbothsidesofEq.(10-20),weget

Page 310: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Therefore,

Form(10-21)isduetoGeorgePólya,whereas(10-20)isArthurCayley’s.To obtain the generating function for (free) unlabeled trees from rooted

unlabeledtrees,onecanlookata(free)treeascomposedofsubtrees,rootedatsomesortofcentralvertexdistinctfromallotherverticesinthetree.Forthis,weshallusetheconceptofcentroidinatree.

Centroid

InatreeT,atanyvertexvofdegreed,therearedsubtreeswithonlyvertexvincommon.Theweightofeachsubtreeatvisdefinedasthenumberofbranchesin the subtree.Then theweight of the vertex v is defined as theweight of theheaviestofthesubtreesatv.AvertexwiththesmallestweightintheentiretreeTiscalledacentroidofT.Justasinthecaseofcentersofatree(Section3-4),itcanbeshownthatevery

treehaseitheronecentroidortwocentroids.Itcanalsobeshownthatifatreehastwocentroids,thecentroidsareadjacent.InFig.10-6atreewithacentroid(called a centroidal tree) and a tree with two centroids (called a bicentroidaltree)areshown.Thecentroidsareshownenclosed incircles,and thenumbersnexttotheverticesaretheweights.

FreeUnlabeledTrees

Let t′(x)bethecountingseriesforcentroidal trees,and t″(x)bethecountingseries for bicentroidal trees. Then t(x), the counting series for all (unlabeled,free)trees,isthesumofthetwo.Thatis,

Toobtain t″(x),observethatann-vertexbicentroidaltreecanberegardedasconsisting of two rooted trees eachwith n/2 =m vertices, and joined at theirroots by an edge. (A bicentroidal tree will always have an even number ofvertices;why?)Thusthenumberofbicentroidaltreeswithn=2mverticesis

Page 311: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.10-6Centroidandbicentroids.givenby

andtherefore

Thenumberofvertices,n,inacentroidaltreecanbeoddoreven.Ifnisodd,the maximum weight the centroid could have is . This maximum isachievedonlywhenthetreeconsistsofapathofn−1edges.Ontheotherhand,ifn is evenand the tree iscentroidal, themaximumweight thecentroidcouldpossibly have is . This maximum is achieved when the degree of thecentroidisthree,andoneofthesubtreesconsistsofjustoneedge.Thus, regardlesswhethern is oddor even, it is clear that ann-vertex (free)

centroidaltreecanberegardedascomposedofseveralrootedtrees,rootedatthecentroid, andnoneof these rooted trees canhavemore than ⌊n −1)/2⌋ edges,where ⌊x⌋ denotes the largest integer no greater than x. In view of thisobservation,aninvolvedmanipulationofEq.(10-21)leadstothefollowing(formissingstepssee[10-3]):

Adding(10-23)and(10-24),wegetthedesiredcountingseries:

Page 312: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

This relation, which gives the tree-counting series in terms of the rooted-treecounting series,was first obtained byRichardOtter in 1948 and is known asOtter’sformula.Thefirst10termsof(10-25)are

t(x)=x+x2+x3+2x4+3x5+6x6+11x7

+23x8+47x9+106x10+...

Thereaderisencouragedtoextenditbyanother10terms.Thefirst26termsofbothu(x)andt(x)aregiveninRiordan’sbook[3-11],page138.By now you must have the impression that enumeration of graphs is an

involvedsubject.Andindeeditis.Sofarwehaveenumeratedonlyfourtypesofgraphs−rootedandfreetrees,bothlabeledandunlabeledvarieties.Itisdifficulttoproceedfurtherwithoutsomeadditionalenumerativetool.ThisisprovidedbyageneralcountingtheoremduetoPólya.WeshallfirststateanddiscussPólya’stheoremandthenshowhowitcanbeappliedforcountinggraphs.

10-4. POLYA’SCOUNTINGTHEOREM

To understand Pólya’s theorem, we need a few additional concepts incombinatorialtheory.Inthissectionweshallfirstdefineapermutationandseehow it canbe represented indifferentways.Thenweshall showhowa setofpermutationsP can form a group (called a permutation group) under a binaryoperationcalledcomposition.Thenwe shall introduceapolynomial called thecycleindexofapermutationgroupP.Finally,weshallshowthatallmappingsfi’sfromadomainD toarangeR (bothDandRbeingfinite)aredividedintoequivalenceclassesbyanypermutationgroupPactingonthedomainD.After introducing these concepts we shall define figure-counting series and

configuration-countingseries.Andthiswillbefollowedbythestatementofthecelebrated theoremofPólya,whichexpresses theconfiguration-countingseriesin terms of the figure-counting series and the cycle index of the permutationgroup. The statement of the theoremwill be followed by discussion and twoillustrativeexamples.IfPólya’s theoremand thebuildup to itdonotappearvery intuitive toyou,

don’tworry;youarenotalone.Whatisimportantistounderstandthetheoremandbeabletouseitforcountingdifferenttypesofgraphs.

Page 313: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Permutation

Ona finite setA of someobjects, a permutationπ is a one-to-onemappingfromAontoitself.Forexample,consideraset{a,b,c,d}.Apermutation

takesaintob,bintod,cintoc,anddintoa.Alternatively,wecouldwrite

π1(a)=b,π1(b)=d,π1(c)=c,π1(d)=a.

Thenumberofelementsintheobjectsetonwhichapermutationactsiscalledthedegreeofthepermutation.Thedegreeofπ1intheaboveexampleisfour.A permutation can also be represented by a digraph, in which each vertex

represents an element of the object set and the directed edges represent themapping. For example, the permutation π1 = is representeddiagrammaticallybyFig.10-7.

Fig.10-7Digraphofapermutation.

Observethatthein-degreeandtheout-degreeofeveryvertexinthedigraphofapermutationisone.Suchadigraphmustdecomposeintooneormorevertex-disjointdirectedcircuits(why?).Thissuggestsyetanotherwayofrepresentingapermutation−as a collection of the vertex-disjoint, directed circuits (called thecyclesof thepermutation).Permutation can thusbewrittenas (abd)(c).Thiscompactandpopularrepresentationiscalledthecyclicrepresentationofapermutation.Thenumberofedgesinapermutationcycleiscalledthelengthofthecycleinthepermutation.

Page 314: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Often theonly informationof interest about apermutation is thenumberofcyclesofvariouslengths.Apermutationπofdegreekissaidtobeoftype(σ1,σ2, . . . ,σk) ifπ hasσi cycles of length i for i = 1, 2, . . . , k. For example,permutation(abd)(c)isoftype(1,0,1,0)andpermutation(abf)(c)(deh)(g)isoftype(2,0,2,0,0,0,0,0).Clearly,

Anotherusefulmethodforindicatingthetypeofapermutationistointroducekdummyvariables,say,yl,y2,...,yk,andthenshowthetypeofpermutationbytheexpression

Expression (10-27) is called the cycle structure of π. For example, the cyclestructureoftheeight-degreepermutation(abf)(c)(deh)(g)is

Notethatthedummyvariableyihasnosignificanceexceptasasymboltowhichsubscripts (indicating the lengths) and exponents (indicating the number ofcycles)areattached.Twodistinctpermutations (actingon thesameobject set)mayhavethesamecyclestructure(page149in[10-1]).So far we have discussed only the representation and properties of a

permutationindividually.Letusnowexamineasetofpermutationscollectively.On a set A with k objects, we have a total of k! possible permutations—

including the identity permutation, which takes every element into itself. Forexample,thefollowingarethesixpermutationsonasetofthreeelements{a,b,c}:

(a)(b)(c),(ab)(c),(ac)(b),(a)(bc),(abc),(acb).

Theircyclestructures,respectively,are

CompositionofPermutations

Considerthetwopermutationsπ1andπ2onanobjectset{1,2,3,4,5}:

Page 315: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Acompositionof these twopermutationsπ2π1 is anotherpermutationobtainedbyfirstapplyingπ1andthenapplyingπ2ontheresultant.Thatis,

Thusamongacollectionofpermutationsonthesameobjectset,compositionisabinaryoperation.

PermutationGroup

AcollectionofmpermutationsP={π1,π2,...,πm}actingonaset

A={a1,a2,...,ak}

forms a group under composition, if the four postulates† of a group, that is,closure,associativity,identity,andinverse(seeSection6-1),aresatisfied.Suchagroupiscalledapermutationgroup.Forexample,itcanbeeasilyverifiedthatthesetoffourpermutations

actingontheobjectset{a,b,c,d}formsapermutationgroup.Thenumberofpermutationsminapermutationgroupiscalleditsorder,and

thenumberofelementsintheobjectsetonwhichthepermutationsareactingiscalled thedegreeof thepermutationgroup. In theexample justcited,both thedegreeandorderofthepermutationgroupisfour.Itcanbeshownthatthesetofallk!permutationsonasetAofkelementsformsapermutationgroup.Suchagroup,oforderk!anddegreek,iscalledthefullsymmetricgroup,Sk.

Page 316: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

CycleIndexofaPermutationGroup

ForapermutationgroupP,oforderm,ifweaddthecyclestructuresofallmpermutationsinPanddividethesumbym,wegetanexpressioncalledthecycleindexZ(P)ofP.Forexample,thecycleindexofS3,thefullsymmetricgroupofdegreethree,accordingto(10-28)comesouttobe

Similarly, the cycle index of the permutation group (of degree four and orderfour)shownin(10-29)is

Since the cycle index is the most important concept in this section, let usillustrateitwithanotherexample.LetusfindZ(S4).Table 10-1 gives the different types of permutations possible inS4, the full

symmetricgroupofdegreefour.Table10-1iseasytounderstandandtoconstruct.Forexample,wehavesix

permutationsoftype(2,1,0,0)ontheobjectset{a,b,c,d}:

(a)(b)(cd),(a)(c)(bd),(a)(d)(bc),(b)(c)(ad),(b)(d)(ac),(c)(d)(ab).

PermutationType NumberofSuchPermutations CycleStructures(4,0,0,0) 1(2,1,0,0) 6(1,0,1,0) 8 y1y3(0,2,0,0) 3(0,0,0,1) 6 y4

Table10-1

To get the cycle index ofS4 fromTable 10-1,wemultiply the correspondingentries in the second and third columns, add theproducts, and thendivide thesumby4!,theorderofthegroup.Thus

Page 317: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Todisplaythevariablesinvolved,thecycleindexofapermutationgroupPisoftenwrittenas

Z(P)=Z(P;yl,y2,...,yk)

It is evident that computationof thecycle indexofanarbitrarypermutationgroupcanbecomequiteinvolvedandlaborious.Therearecertaingroups,suchasSk,whosecycleindiceshavebeenderivedinclosedforms.Thesearerelatedto the partitions of integer k satisfying Eq. (10-26). For more on methods ofobtainingcycleindices,thereadershouldsee[10-1]and[1-5].

CycleIndexofthePairGroup

WhenthenverticesofagraphGaresubjectedtopermutation,then(n−1)/2unorderedvertexpairsalsogetpermuted.Forexample,letV={a,b,c,d}bethesetofverticesofafour-vertexgraph.Thepermutation

on the vertices induces the following permutation on the six unordered vertexpairs:

Thediagramsofpermutationß and the inducedpermutationareshown inFig.10-8.Noticethatay1y3permutationonthevertexsetinducesa permutationon

thevertex-pairset.

Page 318: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.10-8Permutationonvertexsetandtheinducedpermutationonvertex-pairset.

Similarly, each of then! possible permutations on then vertices of a graphresultsinsomepermutationofthen(n−1)/2,unordered,vertexpairs(orn(n−1)orderedvertexpairs, in thecaseofdigraphs).Furthermore, itcanbeshownthat if a set of permutations on the vertices forms a group, the induced set ofpermutationsonthepairofverticeswillalsoformagroup(Problem10-5).Forinstance,thefullsymmetricgroupSnonnverticesofagraphinducesagroupRnofn!permutationsonthepairsofvertices.†Suchaninducedgroupiscalledthepair group Rn. Let us work out the pair group R4 induced by S4, the fullsymmetricgroupontheverticesofafour-vertexgraph.Theidentitypermutationonthefourverticesofagraphproducesanidentity

permutationonthesixpairsofvertices.Apermutationwithtwocyclesoflengthone and one cycle of length two produces two cycles of length one and twocyclesoflengthtwo.Andsoon.ThecyclestructuresofpermutationsinS4andthe corresponding cycle structures of the inducedpermutations on the pairs ofverticesareshowninTable10-2.

TerminZ(S4) InducedTerminZ(R4) No.ofPermutations

16

y1y3 8

3y4 y2y4 6

Table10-2

Therefore,thecycleindexofthepairgroupR4(inducedonthepairsofverticesbyS4)is

ForageneralexpressionforZ(R)see[10-2].

EquivalenceClassesofFunctions

AsafurtherpreliminarytodescribingPólya’stheorem,letusintroducesome

Page 319: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

additionalconcepts.ConsidertwosetsDandR,withthenumberofelements|D| and | R |, respectively. Let f be a mapping (or function) which maps eachelementdfromdomainDtoauniqueimagef(d)inrangeR.Sinceeachofthe|D | elements can be mapped into any of the | R | elements, the number ofdifferentfunctionsfromDtoRis|R||D|.NowlettherebeapermutationgroupPontheelementsofsetD.Thendefine

twomappingsf1andf2asP-equivalentifthereissomepermutationπinPsuchthatforeverydinDwehave

That the relationship defined by (10-33) is an equivalence relation can beshownasfollows:

1. SinceP is a permutation group, it contains the identity permutation, andthus(10-33)isreflexive.

2. IfP contains permutationπ, it also contains the inverse permutationπ-1.Therefore,therelationissymmetricalso.

3. Furthermore,ifPcontainspermutationsπ1andπ2,itmustalsocontainthepermutationπ1π2.ThismakesP-equivalenceatransitiverelation.

Since an equivalence relation divides a set into equivalence classes, allmappings fromD toR are divided into equivalence classes by a permutationgroupPactingonsetD.Asanexample,letD={a,b,c}andR={s,t}.Thereare23=8mappingsf1,f2,...,f8fromDtoR,asshowninTable10-3.

Table10-3

NowsupposeapermutationgroupP={(a)(b)(c),(abc),(acb)}isactingonD.ThereadercanverifythattheeightmappingsinTable10-3willbedividedintofourequivalenceclasses.Theyare

Page 320: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

{f1},{f2,f3,f4},{f5,f6,f7},{f8}.

Pólya′sCountingTheorem

Let us consider two finite sets, domain D and range R, together with apermutationgroupPonD.Toeachelementρ∊Rletusassignaquantityw[ρ]andcall it thecontent (orweight) of the elementρ.Theweightw[ρ] canbe asymbol or a real number. A mapping f fromD to R can be described by asequenceof |D|elementsofsetRsuchthattheithelementinthesequenceisthe imageof the ith elementof setD under f.Therefore the contentW(f) of amappingfcanbedefinedastheproductofthecontentsofallitsimages.Thatis,

Clearly,allfunctionsbelongingtothesameequivalenceclassdefinedby(10-33) have identical weights. Therefore, we define the weight of an entireequivalenceclass(offunctionsfromdomainDtorangeR)tobethe(common)weight of the functions in this class. Our problem is to count the number ofequivalenceclasseswithvariousweights,givenD,R,permutationgroupPonD,andweightsw[ρ]foreachρ∊R.ThisisexactlywhatPólya’scountingtheoremgives.InPólya’sterminology,elementsρofsetRarecalledfigures,andfunctionsf

fromD toR are calledconfigurations.Often theweightsof theelementsofRcanbeexpressedaspowersofsomecommonquantityx.InthatcasetheweightassignmenttoelementsofsetRcanbeneatlydescribedbymeansofacountingseriesA(x)

where aq is the number of elements in set R with weight xq.† Likewise, thenumber of configurations can be expressed in terms of another series, calledconfigurationcountingseriesB(x),suchthat

wherebm is thenumberofdifferentconfigurationshavingweightxm.NowwecanstatethefollowingpowerfulresultknownasPólya’scountingtheorem.

Page 321: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

THEOREM10-3

Theconfiguration-countingseriesB(x) isobtainedbysubstitutingthefigure-countingseriesA(xi) foreachyi in thecycle indexZ(P;y1,y2, . . . ,yk)of thepermutationgroupP.Thatis,

The proof of Pólya’s theorem, although not complicated, is not particularlyilluminatingandisthereforeleftout.Thereadercanfinditin[10-1],page157.Our interest ismainly in theapplicationof the theorem;letus illustrate itwithsomeexamples.

Example 1: Suppose thatwe are given a cube and four (identical) balls. Inhow many ways can the balls be arranged on the corners of the cube? Twoarrangementsareconsideredthesameifbyanyrotationofthecubetheycanbetransformedintoeachother.The answer is seven, as can be seen by inspection in Fig. 10-9. In Pólya’s

termsthedomainDisthesetoftheeightcornersofthecube,andtherange

Fig.10-9Attachingfourballstocornersofacube.

Rconsistsof twoelements(i.e., figures),“presenceofaball”or“absenceofaball,”withcontentsx1andx0,respectively.Thefigure-countingseriesis

since a0, the number of figures with content 0, is one, and a1 the number offigures with content 1, is also one. The configurations are 28 = 256 differentmappingsthatassignballstothecornersofthecube.ThepermutationgroupP

Page 322: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

onDisthesetofallthosepermutationsthatcanbeproducedbyrotationsofthecube.Thesepermutationswiththeircyclestructuresare

1. Oneidentitypermutation.Itscyclestructureis .

2. Three180°rotationsaroundlinesconnectingthecentersofoppositefaces.Itscyclestructureis .

3. Six 90° rotations (clockwise and counterclockwise) around linesconnectingthecentersofoppositefaces.Thecyclestructureis .

4. Six180°rotationsaroundlinesconnectingthemidpointsofoppositeedges.Thecorrespondingcyclestructureis .

5. Eight120°rotationsaroundlinesconnectingoppositecornersinthecube.Thecyclestructureofthecorrespondingpermutationis .

Thecycleindexofthisgroupconsistingofthese24permutationsis,therefore,

UsingPólya’stheorem,wenowsubstitutethefigure-countingseries,thatis1+x for y1, 1 + x2 for y2, 1 + x3 for y3, and 1 + x4 for y4. This yields theconfiguration-countingseries.

Thecoefficientofx4 inB(x)givesthenumberofP-inequivalentconfigurationsof content x4 (i.e., with four balls). This verifies the answer obtained byexhaustiveinspectioninFig.10-9.ThetotalnumberofP-inequivalentconfigurations(withcontentsx0,x1,x2,..

. ,x8) isobtainedbyaddingallcoefficients in (10-39),which is23. Itmaybeobservedthatthisisthenumberofdistinctwaysofpaintingtheeightverticesofacubewithtwocolors(onecolorcorrespondstothe“presenceofaball”andtheotherwiththe“absenceofaball”).

Example 2: In example 1wewere given four identical balls.Now supposethatwearegiventworedballsandtwoblueballs,andareagainaskedtofindthenumberofdistinctarrangementson thecornersof thecube.Clearly,D,P,andZ(P)willremainthesameastheywereinexample1.OnlytherangeRandthe figure-counting series A(x) will change. The range will contain threeelements:(1)presenceofnoball,(2)presenceofaredball,and(3)presenceofa

Page 323: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

blueball.Choosingxtoindicatethepresenceofaredballandx′toindicatethepresence of a blue ball, the three elements in the rangementioned abovewillhave the contents x0x′0, x1x′0, and x0x′1, respectively. Therefore the figure-countingseriesis

A(x,x′)=x0x′0+x1x′0+x0x′1=1+x+x′.

Substituting this figure-counting series in (10-38), we get the configuration-countingseries

Thecoefficientofx′x′bin(10-40)isthenumberofdistinctarrangementswithrred balls, b blue balls and 8 − r − b corners with no balls. The number ofarrangementswithtworedandtwoblueballsis,therefore,22.For some other non-graph-theoretic examples of the applications of Pólya’s

theorem,thereadershouldworkoutProblems10-10,10-11,10-14,and10-15.Letusnowreturntothecountingofgraphs.

10-5. GRAPHENUMERATIONWITHPOLYA’sTHEOREM

EnumerationofSimpleGraphs:Letusconsider theproblemofcountingallunlabeled,simplegraphsofnvertices.AnysuchgraphGcanberegardedasamapping (i.e., configuration) of the set D of all unordered pairs ofvertices (for digraphs n(n − 1) pairs of vertices). Range R consists of twoelementssandt,withcontentsx1andx0,respectively.Ifavertexpairisjoined

Page 324: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

by an edge in G, the vertex pair maps into s, an element with content x1 ;otherwise,intot,anelementwithcontentx0=1.Thusthefigure-countingseriesis

A(x)=∑aqxq=1+x

Therelevantpermutationgroupin thiscase isRn, thegroupofpermutationsonthepairsofverticesinducedbySn(thefullsymmetricgrouponthenverticesof the graph).† Therefore, the configuration-counting series is obtained bysubstituting1+xfory1,1+x2fory2,1+x3fory3,andsooninZ(Rn).Somespecificcasesare(1)Forn=3,

Therefore,theconfiguration-countingseriesis

Thecoefficientofxi inB(x) is thenumberofconfigurationswithcontentxi.Thecontentofaconfigurationhereisthenumberofedgesinthecorrespondinggraph.Thusthenumberofnonisomorphicsimplegraphsofthreeverticeswith0,1,2,and3edgesiseachone.Thisishowitshouldbe,asshowninFig.10-10.(2)Forn=4,thecycleindexZ(R4)isgivenin(10-32).Substituting1+xifor

yiin(10-32),weget

In (10-41) the coefficient of xr gives the number of simple graphs with fourverticesandredges.Thevalidityofseries(10-41)isverifiedinFig.10-11.

Page 325: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.10-10Simpleunlabeledgraphsofthreevertices.

Fig.10-11Simpleunlabeledgraphsoffourvertices.

(3)Forn=5,thecycleindexZ(R5)isgiveninProblem10-9.Substituting1+xi for yi in Z(R5), we get the counting series B(x) for simple graphs of fivevertices,asfollows:

Again,foreachr thecoefficientofxr in(10-42)givesthenumberofsimplegraphsoffiveverticesandredges.The number of simple, unlabeled graphs with n vertices for any n can be

countedsimilarly.

Enumeration of Multigraphs: Suppose that we are interested in countingmultigraphsofnvertices,inwhichatmosttwoedgesareallowedbetweenapairofvertices.Inthiscasethedomainandthepermutationgrouparethesameastheywere

Page 326: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

for simplegraphs.The range,however, isdifferent.Apairofverticesmaybejoined by (1) no edge, (2) one edge, or (3) two edges.Thus rangeR containsthreeelements, say,s, t,u,withcontentsx0,xl, andx2, respectively; that is,xiindicatesthepresenceofiedgesbetweenavertexpair,fori=0,1,2.Threfore,thefigure-countingseriesbecomes

Substitutionof1+xr+x2r foryr inZ(Rn)willyieldthedesiredconfiguration-countingseries.Forn=4,usingthecycleindexfrom(10-32),weget

The coefficient of xi in (10-44) is the number of distinct, unlabeled,multigraphsoffourverticesandiedges(suchthatthereareatmosttwoparalleledgesbetweenanyvertexpair).Forexample,thecoefficientofx3is5,andthesefivemultigraphsareshowninFig.10-12.Insteadofallowingatmosttwoparalleledgesbetweenapairofvertices,had

weallowedanynumberofparalleledgesthefigure-countingserieswouldbetheinfiniteseries

Fig.10-12Unlabeledmultigraphsoffourvertices,threeedges,andatmosttwoparalleledges.

EnumerationofDigraphs:Forenumeratingdigraphswehavetoconsideralln(n − 1) ordered pairs of vertices as constituting the domain. The relevantpermutationgroupwill consistofpermutations inducedonallorderedpairsofverticesbySn.Thecycleindexofthispermutationgroup,Mn,canbeobtainedinthesamefashionaswasdoneinthecaseofRn.Forexample,forn=4,Table10-4givesthetermsinZ(Mn)inducedbyeachterminZ(Sn).

Page 327: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Table10-4

Therefore,thecycleindexis

For a simple digraph the figure-counting series A(x) = 1 + x is applicable,becauseagivenorderedpairofvertices (a,b)eitherdoesordoesnothaveanedge(directed)fromatob.Onsubstituting1+xiforeveryyiin(10-46),wegetthefollowingconfiguration-countingseriesforfour-vertex,simpledigraphs.

Fig.10-13Simpleunlabeleddigraphsoffourverticesandtwoedges.

The coefficient of xj in (10-47) is the number of simple digraphs with fourverticesand jedges.Forexample,thefivedigraphsoftwoedgesareshowninFig.10-13.Thegeneralexpressionfor thecycle index,Z(Mn),of thepermutationgroup

onn(n−1)orderedpairs inducedbySn isgiven in [1-5], page180.Digraphswith parallel edges can be enumerated by substituting the appropriate figure-

Page 328: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

countingseries,say(10-43),inZ(Mn).

SUMMARY

Enumerationofgraphsisoneofthemostinvolvedareasingraphtheoryanddeserves an entire volume to itself. In this chapter,we have briefly presentedsome enumerative techniques−the most important of them being Pólya’scounting theorem.Themajor problem in using Pólya’s theorem is finding theappropriatepermutationgroupandthenobtainingitscycleindex.Onecould thinkofahundreddifferent typesofgraphs tobecounted—each

presenting a special problem.We have, in this chapter, counted the followingfive typesofunlabeledgraphs (enumerationof labeledgraphs ismucheasier):(1)rootedtrees,(2)freetrees,(3)simplegraphs,(4)multigraphs,and(5)simpledigraphs. Importantas these typesofgraphsare, theywereenumeratedmainlyasillustrations.Onecould,forexample,beinterestedincountingallunlabeled,simple graphs with n vertices that are (1) connected, or (2) planar, or (3)nonseparable,or(4)self-dual,andsoon.Many such types of graphs have been enumerated and reported as research

papers in the literature,but therearemany typesofgraphs thathaveyet tobecounted.

REFERENCES

Chapters1,3,4,5,and6of[10-1]arestronglyrecommendedtosupplementthematerialpresentedinthischapter.Foranexhaustivesurveyoftheliteratureingraphenumeration,seethepaper

byHarary [10-4], as well as Chapter 15 of [1-5], which contains a list of 66solved problemswith the appropriate referenceswhere the solutions are to befound.Thelatestlistof27unsolvedproblemsingraphenumerationisdiscussedinanother articlebyHarary [10-5].Fora lucidexpositionofPólya’s countingtheorem,seethepaperbydeBruijn,whichappearsasChapter5in[10-1],orseeChapter 5 of the book by Liu [8-3]. For some excellent illustrations ofapplicationsofPólya’stheoremtographenumeration,see[10-2],[10-6],[10-7],[10-8],andChapter6of[3-11].Manycountingproblems inchemistry,physics,biology, information theory,

and so on, can be regarded as graph-enumeration problems.A survey of such

Page 329: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

applicationsisgiveninChapter6of[10-1]andin[10-4].Adetailedtreatmentofan application to a problem in statistical mechanics is given in [10-9]. Anapplicationtocountingofdistinctautomataisgivenin[12-5].ThepioneeringpapersofCayley,Redfield,andPólyaarenotincludedinthe

followinglist.Theyhavebeenreferredtoinmostofthefollowing:10-1. BECKENBACH, E. F. (ed.), Applied Combinatorial Mathematics, John

Wiley&Sons,Inc.,NewYork,1964.10-2. HARARY, F., “TheNumber of Linear,Directed,Rooted andConnected

Graphs,”Trans.Am.Math.Soc,Vol.78,1955,445–463.10-3. HARARY, F., “Note on the Pólya and Otter Formulas for Enumerating

Trees,”MichiganMathJournal,Vol.3,1956,109–112.10-4. HARARY, F., “GraphicalEnumerationProblems,” inGraphTheory and

Theoretical Physics (F.Harary, ed.),Academic Press, Inc.,NewYork,1967,1–41.

10-5. HARARY,F.,“EnumerationUnderGroupAction:UnsolvedProblemsinGraphicalEnumeration IV,”J.CombinatorialTheory,Vol.8,1970,1–11.

10-6. PALMER,E.M.,“Methods for theEnumerationofMultigraphs,” inTheMany Facets of Graph Theory (G. Chartrand and S. F. Kapoor, eds.),Springer-VerlagNewYork,Inc.,NewYork,1969,251–261.

10-7. READ, R. C, “On the Number of Self-Complementary Graphs andDigraphs,”J.LondonMath.Soc,Vol.38,1963,99–104.

10-8. ROBINSON, R. W., “Enumeration of Nonseparable Graphs,” J.CombinatorialTheory,Vol.9,No.4,Dec.1970,327–356.

10-9. UHLENBECK, G. E., and G. W. FORD, “Theory of Linear Graphs withApplicationstotheTheoryoftheVirialDevelopmentofthePropertiesofGases,”inStudiesinStatisticalMechanics,Vol.1(J.deBoerandG.E.Uhlenbeck, eds.), North-Holland Publishing Company, Amsterdam,1962,123–211.

PROBLEMS10-1. Satisfy yourself that for a set of graphs isomorphism (as defined in

Section 2-1) is indeed an equivalence relation. That is, the relation isreflexive,symmetric,andtransitive.

10-2. Prove thatavertexvappears insequence(10-3)m times ifandonly ifdegreeofv=m−1.

Page 330: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

10-3. Provethatadigraphinwhichthein-degreeaswellastheout-degreeofeveryvertexisonecanbedecomposedintooneormorevertex-disjointdirectedcircuits.(Hint:Insuchadigrapheverycomponentisadirectedcircuit.)

10-4. Prove that a subsetA of a finite group forms a subgroup if the subsetsatisfiestheclosurepostulate.(Hint:Showtheexistenceoftheinverseofanelementa∊Aasfollows:Elementsa,a2,a3,...cannotallbedistinctbecause the group is finite, but they must all be in A because of theclosureproperty.Supposethatap=aq,wherep>q.Therefore,ap-q=1ora-1=ap-q-1.)

10-5. ProvethatifasetofpermutationsPonanobjectsetSformsagroup,thesetRofallpermutationsinducedbyPonsetSxSalsoformsagroup.[Hint: Prove closure by showing that the composition of twopermutationsonSxS inducedbyanytwopermutationsπ1,π2 (inP) isthe permutation induced by the composition (π2·π1).Then useProblem10-4.]

10-6. Show that the cycle index of a group consisting of the identitypermutationonlyis ,kbeingthenumberofelementsintheobjectset.

10-7. Show that the cycle indexof the inducedpair groupR3 is the sameasthatofS3.Thatis,

10-8. ShowthatthecycleindexofS5,thefullsymmetricgroupofdegreefive,is

10-9. ShowthatthecycleindexoftheunorderedpairgroupR5(onthesetof10unorderedpairsinducedbyS5)is

Page 331: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

(Hint:UsetheresultofProblem10-8.)

10-10. Findthedifferentwaysofpaintingthesixverticesofanoctahedronwiththree colors. Two octahedrons are colored distinctly if they cannot bemadetocoincidebyanyrotation.[Hint:Firstshowthatthecycleindexofthepermutationgroupis

Thensubstitutethefigure-countingseries1+x+x′.]

10-11. Listallpartitionsof5,andusethemtofindu6,thenumberofunlabeledtreesofsixvertices.(Youmayusethevaluesofu1,u2,...u5,giveninthischapter.)

10-12. Given a square, show that there are exactly eight distinct motions(combinations of rotations and reflections)which bring the square intocoincidence with itself. Show that these motions form a group (calleddihedralgroupD4).Furthermore,showthatthecycleindexofthisgroupis

10-13. ShowthattheorderofDn,thegroupofsymmetriesofaregularn-sidedpolygon,is2n.FindthecycleindexofDn.

10-14. Supposethatweare tomakenecklaceswithfourbeads−someblueandsomegreen.Howmanydistinctnecklacesarepossible?Twonecklacesareconsideredindistinguishableifonecanbemadeidenticaltotheotherbyanycombinationofrotationandflipping.[Hint:UseZ(D4)andfollowtheprocedureofexample1.]

10-15. Findthenumberofdifferentwaysofpaintingthefourfacesofapyramidwithtwocolors.

10-16. Find the counting series for unlabeled, simple, connected graphs withexactlyonecircuit.[Hint:UseZ(Dn)andconsiderthegraphasconsistingofasinglecircuitwithoneormoretreesattachedtoitsvertices.]

10-17. Find thecountingseries for thestructural isomersofsaturatedalcoholsCnH2n+1OH.(Hint:Considerthecompoundasann-vertexrootedtreein

Page 332: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

whicheachvertex is a carbonatom.Thecarbonatomcarrying theOHradical corresponds to the root. Then find the counting series forunlabeled, rooted trees inwhich the root isatmostofdegree threeandthenonrootverticesareatmostofdegreefour.)

10-18. Apermutationπ applied on the vertex setV of a graphG is called anautomorphism of G, if π preserves the adjacency. That is, anautomorphismofGisanisomorphismwithitself.Provethatthesetofallautomorphisms Ω(G) on G forms a group. (Hint: This group willobviously be a subgroup of Sn. Use the result of Problem 10-4, afterobserving that an automorphism followed by another is also anautomorphism.)

10-19. FindtheautomorphismgroupΩ(G)ofagraphG ifG is(a)acompletegraphofnyertices,and (b)acircuitwithnvertices.Findagraphwithminimumnumberofverticesn>1 inwhichΩ(G) consistsofonly theidentitypermutation.

10-20. Prove that the number of ways an unlabeled n-vertex graph can belabeledisn!/|Ω(G)|,where|Ω(G)|istheorderoftheautomorphismgroupΩ(G) ofG. (Hint:Theproblem requires someadditional knowledgeofgrouptheory.Theproofcanbefoundonpage180in[1-5].)

†Theresultcanbeprovedasfollows:Letthenobjectsbelabeled1,2,3,...,n,andletaspecificselectionbealistofkintegersa1,a2,...,akarrangedinnondecreasingorder.Theai′sarenotnecessarilydistinct.Fromthislistwegetanewlista1,a2+1,a3+2,...,ak+k−1byadding0toa1,1toa2,andsoon.Each term in the new list is distinct. Thus every selection with unlimited repetitions can be identifieduniquelyasaselectionofkdistinctintegersfromintegers1,2,...,n+k−1.†In fact, it can be shown that if a collection of permutations is closedwith respect to composition, theremainingthreepostulatesareautomaticallysatisfied(Problem10-4).†Exceptforn=2,inwhichcasethenumberofpossiblepermutationsonthepairis1,ratherthan2.†If thecontentassigned to figurescannotbeexpressedaspowersofa singlequantityx, then the figure-countingserieswillbeamultinomialindifferentvariables,ratherthaninjustonevariablex.†Becauseinanunlabeledgraph,allnverticesareindistinguishable.Werewetocountlabeledgraphsthepermutationgroupwouldhaveconsistedofonlytheidentitypermutation.Substitutionof1+xinitscycleindexwouldhaveyieldedthesimpleresultofexpression(10-1).

Page 333: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

11GRAPH-THEORETICALGORITHMSANDCOMPUTERPROGRAMS

To be able to use a digital computer in solving graph-theoretic problems isundoubtedly an important part of learning graph theory, especially for thoseinterested in applications.Most of the practical problemswhich call for graphtheory involve large graphs—graphs that are virtually impossible for handcomputation.Infact,oneofthereasonsfortherecentgrowthofinterestingraphtheoryhasbeenthearrivalofthehigh-speedelectroniccomputer.Problemsthathitherto were of academic interest only are suddenly being solved by thecomputer, and their solutions are applied to practical situations. Computerprogramshavebeenwritten tohandlesuccessfully largegraphsencountered inPERT, flow problems, transportation networks, electrical networks, circuitlayouts,andthelike.Wemust hasten to add, however, that althoughour computers are very fast

andoperateatnanosecond(10-9second)speeds,theyquicklyreachtheirlimitifusedasabruteforcetosolvegraph-theoryproblems(infact,anycombinatorialproblem). Consider, for example, the problem of finding a lowest-weightHamiltonian circuit in a weighted complete graph of n vertices, that is, thetraveling salesman problem. There are different Hamiltonian circuits.OnemaybetemptedtousebruteforceandgenerateallHamiltoniancircuitsandcomparetheirweights.Foragraphwith10vertices,thenumberofHamiltoniancircuits is !=181,440, and thismethodmaybeall right.But for agraphof20vertices,wehave

and toperform operationsat therateofevenoneoperationpernanosecondwouldrequireabout

Page 334: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Thusitisamplyclearthatwithouttheaidofmathematicaltoolsonecannothopeto get the desired numerical answer, regardless of the speed of the electroniccomputer.Thepowerof thecomputermustbecombinedwith the ingenuityofmathematicaltechniques.Asisthecasewithallcombinatorialproblems,themanipulationandanalysis

ofgraphsandsubgraphsisessentiallynonnumerical.Thatis,ingraph-theoreticprogramsitisprimarilythedecision-makingabilityofthecomputerthatisusedratherthanitsabilitytoperformarithmeticoperations.In this chapter it is assumed that the reader has some familiarity with

computerprogramming.

11-1.ALGORITHMS

An algorithm is, in essence, a recipe for solving a certain mathematicalproblem.Itconsistsofasetofinstructionsthatwhenfollowedstepbystepwilllead to the solutions of.the problem. Every step in an algorithm must beprecisely and unambiguously defined, and an algorithm must terminate afterhavingsolvedthegivenprobleminafinitenumberofsteps.AspointedoutbyKnuth [11-39], page 4, every algorithm must have five important features:finiteness,definiteness,input,output,andeffectiveness.An algorithm can be expressed in different for ms: (1) the steps may be

written inEnglish; (2) itmaybe in theformofacomputerprogramwritten incompletedetailinthelanguageunderstandablebythemachineinuse;or(3)thealgorithmmay be expressed in a formbetween these two extremes, such as aflow chart. Each form has certain advantages and shortcomings. Usually, analgorithm is first expressed in ordinary language, then converted into a flowchart,andfinallywritteninthedetailedandpreciselanguagesothatamachinecanexecuteit.For our purpose the flow chart is the best. It is the most popular form of

expressinganalgorithm.Itisindependentoftheprogramminglanguageandofthe computer the student may have at his disposal. As examples of actualprograms, listings of several tested programs are provided at the end of thischapter.One of the programs is inAPL (AProgramming Language), and theothersareinFORTRAN.

Page 335: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

EfficiencyofAlgorithms:Analgorithmmustnotonlydowhatitissupposedto do, but must do it efficiently. The two main criteria for efficiency of analgorithmare thememoryandcomputation-time requirementsasa functionofthesizeoftheinput.Inourcasetheinputisagraph,anditssizeisthenumberofvertices,n, and thenumberof edges,e.Formostgraphproblems thememoryrequirementisgenerallynotthebottleneck,butthecomputationtimecanbe(aswesawintheopeningremarksofthischapter).In evaluating the figure ofmerit of an algorithm onemay seek the “worst-

case“executiontime(i.e.,thetimetakenfortheworstpossiblechoiceofagraphofthegivensize),orthe“best-case“executiontimeorthe“average-case.“Often,morethanonealgorithmisavailableforonegraph-theoreticproblem.

Sometimesonealgorithmcaneasilybeseentobemoreefficientthanothers,forall nontrivial graphs. Inmany cases, however, the relative efficiencies can becompared only in the context of the size and structure of the graph, detailedimplementationofthealgorithms,andthecomputerused.A detailed analysis of the performance of a graph-theoretic algorithm is

extremelyinvolved.Wewillnotindulgeinsuchanalyses,asthatwouldrequirea chapter in itself. We will, however, make some gross observations oncomplexities of the algorithms; namely how the computation time grows as afunctionofnore,asnandebecomevery large,assumingthat theworst-casegraphisprovidedastheinput.Suchanindexofperformance,toounrealistictobe useful in estimating the expected computation time of a program, is oftenvaluableinclassifyingalgorithmsandintheirtheoreticalstudies.

11-2.INPUT:COMPUTERREPRESENTATIONOFAGRAPH

Analgorithmhassomeinputs—thedatawithwhichthealgorithmbegins(justas a recipe for a dish calls for raw ingredients). Naturally, the input for ouralgorithmsherewillbeoneormoregraphs(ordigraphs).Agraphisgenerallypresented to and is stored in a digital computer in one of the following fiveforms. Each has advantages and disadvantages. The choice depends on thegraph, theproblem, the language, the typeofmachine,andwhetherornot thegraphismodifiedduringthecourseofthecomputation.

(a)AdjacencyMatrix:Themostpopularforminwhichagraphordigraphisfedtoacomputerisitsadjacencymatrix.Forexample,algorithmsdescribedin[11-25]and[11-47]usetheadjacencymatrix.Afterassigningadistinctnumberto eachof then vertices of thegivengraph (or digraph)G, then byn binary

Page 336: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

matrixX(G)isusedforrepresentingGduringinput,storage,andoutput.Sinceeachofthen2entriesiseithera0ora1,theadjacencymatrixrequiresn2bitsofcomputermemory.Bitscanbepackedintowords.Letwbethewordlength(i.e.,thenumberofbits inacomputerword)andnbe thenumberofvertices in thegraph.Theneachrowoftheadjacencymatrixmaybewrittenasasequenceofnbits in [n/w]machinewords. ([x] denotes the smallest integernot less thanx.)Thenumberofwordsrequiredtostoretheadjacencymatrixis,therefore,n[n/w].The adjacency matrix of an undirected graph is symmetric, and therefore

storingonlytheuppertriangleissufficient.Thisrequiresonlyn(n−1)/2bitsofstorage.Thissavinginstorage,however,oftencostsinincreasedcomplexityandcomputationtime.Insomeproblemsitisworthit.Itmustbekeptinmindthattheadjacencymatrixisdefinedforgraphswithout

paralleledges.AsdiscussedinChapter7,itisnotpossibletorepresentparalleledgesinanadjacencymatrix.

(b) Incidence Matrix: Occasionally, an incidence matrix is also used forstoringandmanipulationofagraph.Thealgorithmin[11-68],forexample,usesthe incidence matrix A(G). An incidence matrix requires n·e bits of storage,whichmightbemore than then2bitsneededforanadjacencymatrix,becausethenumberofedgeseisusuallygreaterthanthenumberofverticesn.Onrareoccasions it may be advantageous to use the incidencematrix rather than theadjacencymatrix, in spite of the increased requirements in storage. Incidencematricesareparticularlyfavoredforelectricalnetworksandswitchingnetworks.

(c)EdgeListing:Anotherrepresentationoftenusedis tolistalledgesof thegraph asvertexpairs, havingnumbered then vertices in somearbitraryorder.For example, the digraph in Fig. 11-1would appear as a set of the followingorderedpairs:(1,2),(2,1),(2,4),(3,2),(3,3),(3,4),(4,1),(4,1),(5,2).Hadthisgraphbeenundirected,wewouldsimplyignoretheorderingineachvertexpair.Clearly,paralleledgesandself-loopscanbeincludedinthisrepresentationof

agraphordigraph.Thenumberofbitsrequiredtolabel(1throughn)eachvertexisb,where

2b−1<n≤2b.

And since each of the e edges requires storing two such numbers, the totalstoragerequiredis

2e·bbits.

Page 337: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Comparingthiswithn2,weseethatthisrepresentationismoreeconomicalthantheadjacencymatrixif

2e·b<n2.

Inotherwords,foragraphwhoseadjacencymatrixissparse†,edgelistingisamoreefficientmethodofstoringthegraph.Edgelistingisaveryconvenientformforinputtingagraphintothecomputer,

but the storage, retrieval, and manipulation of the graph within the computerbecome quite difficult. For example, extensive search techniques would berequired for finding out whether or not a graph is connected (Algorithm 1 inSection11-4).

(d)TwoLinearArrays:A slight variationof edge listing is to represent thegraphbytwolineararrays,sayF=(f1,f2,...,fe)andH=(h1,h2,...,he).Eachentryinthesearraysisavertexlabel.TheithedgeeiisfromvertexfitovertexhiifG isadigraph.(IfG isundirected,justconsidereiasbetweenfiandhi.)Forexample,thedigraphinFig.11-1wouldberepresentedbythetwoarrays

Fig.11-1Adigraph.

F=(5,2,1,3,2,4,4,3,3),H=(2,1,2,2,4,1,1,4,3).

This representation,whichwasused in thealgorithmin[11-58], lends itself toconvenientsortinginweightedgraphs.Thestoragerequirementsarethesameasin(c).

(e)SuccessorListing:Anotherefficientmethodusedfrequentlyforgraphsinwhichtheratioe/nisnotlargeisbymeansofnlineararrays.Afterassigningthe

Page 338: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

vertices,inanyorder,thenumbers1,2,...,n,werepresenteachvertexkbyalinear array, whose first element is k and whose remaining elements are thevertices that are immediate successors of k, that is, the verticeswhich have adirected path of length one from k. (In an undirected graph these are simplyvertices adjacent to k.) The five-vertex digraph in Fig. 11-1 will appear asfollowsinthisrepresentation.

1:22:1,43:2,3,44:1,15:2

For an undirected graph the neighbors (rather than the successors) of everyvertexarelisted.Therefore,eachedgeappearstwice−anobviousredundancy.Tocompareitsstorageefficiencywiththatoftheadjacencymatrix,letdavbe

theaveragedegree (out-degrees in thecaseofadigraph)of thevertices in thegraph.Assumingthatonecomputerwordisneededforthelabelofeachvertex,thetotalstoragerequirementforannvertexgraphisn(1+dav)words.Thusthesuccessorlistingismoreefficientthantheadjacencymatrixif

wbeingthewordlength.The successor or neighbor listing form is extremely convenient for path-

findingalgorithms,andforadepth-firstsearchonthegraph[11-61].

Youmusthaveobserved that the foregoingmethodsofgraph representationarenotentirelydifferent.Infact,theyarenecessarilyrelatedinthattheyconveythesameinformation.Simpleprogramscanbewrittentoconvertoneformintoanother (Problem 11-2). Additional variations in these representations can bemade to suit the requirements at hand. For instance, aweighted graph can berepresented by an n by n weight matrix (also called cost matrix or distancematrix),whichisliketheadjacencymatrixexceptthatinsteadof1’stheweightsof theedgesappearas theentries in thematrix. It should,however,bekept inmindthatinmanyproblemstheefficiencyofthealgorithmmaydependontheform in which the graph is presented. Thus the proper choice of the datastructureisimportant.

Page 339: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

11-3.OUTPUT

Everyalgorithmhasanoutput—thecookeddishfromtherecipe.Unlike theinput, which is one or more graphs, the output will vary from problem toproblem.Iftheoutputconsistsofsubgraphs,wemaymaketheprogramprinttheappropriateadjacencymatrices.Ontheotherhand,ifanoutputis,forinstance,ayesornotothequestionofplanarityofagivengraph,wemayasktheprogramtosimplyprintYESorNO.Inaddition,iftheanswerisYES,wemaychoosetogettheplanarrepresentationofthegraph;oriftheanswerisNO,wemayaskforthethicknessofthegraph.Forashortest-pathalgorithm,wemaysimplywishtoprintthedistance(shortest)betweenapairofspecifiedverticesxandy.Oronemaydesiretooutputasequenceofedges(orvertices)whichdescribesashortestpathbetweenxandy.Andsoforth.Theoutputsareasvariedasthealgorithms.Letusnowproceedwithsomespecificalgorithms.

11-4.SOMEBASICALGORITHMS

Algorithm1:ConnectednessandComponents

ThefirstquestionsoneismostlikelytoaskwhenencounteringanewgraphGwillbe:IsGconnected?IfGisnotconnected,whatarethecomponentsofG?Therefore,ourfirstalgorithmwillbeonethatdeterminestheconnectednessandcomponentsofagivengraph.In addition to being an important question in its own right, the question of

connectedness and components arises inmany other algorithms. For example,beforetestingagraphGforseparability,planarity,orisomorphismwithanothergraph,itmaybebetterforthesakeofefficiencytodeterminethecomponentsofGand thensubjecteachcomponent to thedesiredscrutiny.Theconnectednessalgorithmisverybasicandmayserveasasubroutineinmoreinvolvedgraph-theoreticalgorithms.(Thereadermayberemindedherethatalthoughindrawingagraphonemightseewhetheragraphisconnectedornot,theconnectednessisbynomeansobvioustoacomputerorhumanbeingifthegraphispresentedinotherforms,suchasthosediscussedinSection11-2.)GiventheadjacencymatrixXofagraph,itispossibletodeterminewhether

or not the graph is connected by trying various permutations of rows and thecorrespondingcolumnsofX,andthencheckingifitisinablock-diagonalform.(See observation 5 in Section 7-9.) This, however, is an inefficient method,because itmay involven! permutations.Amore efficientmethodwouldbe to

Page 340: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

useCorollaryBofTheorem7-8,andcheckforzerosinthematrix

Y=X+X2+...+Xn-1.

This too is not very efficient, as it involves a large number of matrixmultiplications.Thefollowingisanefficientalgorithm:

DescriptionoftheAlgorithm:Thebasicstepinthisalgorithmisthefusionofadjacentvertices(recallSection2-7).Westartwithsomevertexinthegraphandfuseallverticesthatareadjacenttoit.Thenwetakethefusedvertexandagainfusewithitallthoseverticesthatareadjacenttoitnow.Thisprocessoffusionisrepeated until no more vertices can be fused. This indicates that a connectedcomponenthasbeen“fused”toasinglevertex.If thisexhaustseveryvertexinthegraph, thegraph is connected.Otherwise,we startwithanewvertex (inadifferentcomponent)andcontinuethefusingoperation.In the adjacency matrix the fusion of the jth vertex to the ith vertex is

accomplishedbyOR-ing, that is, logicallyadding the jthrowto the ithrowaswellasthejthcolumntotheithcolumn.(Rememberthatinlogicaladding1+0=0+1=1+1=1and0+0=0.)Then the jth rowand the jthcolumnarediscarded from thematrix. (If it is difficult or time consuming to discard thespecified rows and columns, one may leave these rows and columns in thematrix,takingcarethattheyarenotconsideredagaininanyfusion.)Note that a self-loop resulting from a fusion appears as a 1 in the main

diagonal,butparalleledgesareautomaticallyreplacedbyasingleedgebecauseofthelogicaladdition(orOR-ing)operation.These,ofcourse,havenoeffectontheconnectednessofagraph.The maximum number of fusions that may have to be performed in this

algorithmisn−1,nbeingthenumberofvertices.Andsinceineachfusiononeperformsatmostn logicaladditions, theupperboundon theexecution time isproportionalton(n−1).

Page 341: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.11-2Algorithm1:ComponentsofG.

Aproperchoiceoftheinitialvertex(towhichadjacentverticesarefused)ineach component would improve the efficiency, provided one did not pay toomuchofapriceforselectingthevertexitself(seeProblem11-6).Aflowchartofthe“ConnectednessandComponentsAlgorithm”isshownin

Fig.11-2.

Page 342: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

A complete computer program, ready to be executed, written in APL\360,togetherwiththelegendidentifyingthevariablesusedintheprogram,isgivenatthe end of the chapter.Note that the program selects a vertexwithmaximumdegreeastheinitialvertexineachcomponent.To illustrate the program, an input and the resulting output are shown as

follows: The input is a 20 by 20 adjacency matrix representing a 20-vertexgraph,andtheoutputisalistofcomponents(COMP)followedbythenamesofvertices (VERT) included in each component. Vertex i corresponds to the ithrowandcolumninX.

Aslightlymodifiedprogram(withoutselectingverticesofmaximumdegreeastheinitialverticesandwithoutdiscardingtherowsandcolumnsaftertheyareOR-ed with the initial row) took 35 FORTRAN statements to write. Theexecution timeof thisFORTRANprogramfora typical50-vertexgraph (withvaryingnumberofedgesandcomponents)ontheIBM7044was second.

Page 343: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Algorithm2:ASpanningTree

Perhapsthebestknownandmostfrequentlyusedalgorithmsingraphtheoryarethespanning-treealgorithms.Initssimplestformaspanning-treealgorithmyields one spanning tree in a given connected graph. If the graph isdisconnected, thealgorithmshouldproducea spanning forestcontainingn−pedges, where p > 1 is the number of components in the disconnected graph.Clearlythen,asaby-productofsuchanalgorithm,wecanfindoutwhetherornotthegraphisconnected,andifthegraphisdisconnected,itscomponentscanbe identified. In fact, sometimes a spanning-tree algorithm is used for testingconnectednessofagraph.If,ontheotherhand,thegivengraphhasaweightordistance associated with each edge (weighted graph), we may wish to find aspanningtreewithsmallestpossibleweight.Thesignificanceofanalgorithmforsuchatree(calledminimalorshortestspanningtree)wasdiscussedinSection3-10.Aspanningtreeisalsoneededforobtainingafundamentalsetofcircuits.AswesawinSection3-9,somealgorithmsforgenerationofallspanningtrees(amuch more difficult task) in a given connected graph G also start by firstobtainingonespanningtree.

Description of theAlgorithm: Let the given undirected self-loop-free (if thegraphhasanyself-loops,theymaybediscarded)graphGcontainnverticesandeedges.Lettheverticesbelabeled1,2,...,n,andthegraphbedescribedbytwolineararraysFandH[i.e.,intheform(d)ofSection11-2]suchthatf1,∈Fandh1∈HaretheendverticesoftheithedgeinG.Ateachstageinthealgorithmanewedgeistestedtoseeifeitherorbothof

itsendverticesappearinanytreeformedsofar.†Atthekthstage,1≤k≤e,inexaminingtheedge(fk,hk)fivedifferentconditionsmayarise:

1. IfneithervertexfknorhkisincludedinanyofthetreesconstructedsofarinG, the kth edge is named as a new tree and its end vertices fk,hk aregiventhecomponentnumberc,afterincrementingthevalueofcby1.

2. IfvertexfkisinsometreeTi(i=1,2,...,c)andhkintreeTj(j=1,2,...,c,andi≠j),thekthedgeisusedtojointhesetwotrees;therefore,everyvertex inTj is nowgiven the component numberofTiThevalueofc isdecrementedby1.

3. Ifbothverticesareinthesametree,theedge(fk,hk)formsafundamentalcircuitandisnotconsideredanyfurther.

Page 344: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

4. IfvertexfkisinatreeTiandhkisinnotree,theedge(fk,hk)isaddedtoTibyassigningthecomponentnumberofTttohkalso.

5. IfvertexfkisinnotreeandhkisinatreeTjtheedge(fk,hk)isaddedtoTjbyassigningthecomponentnumberofTjtofkalso.

These five cases are marked by circled numbers in the flow chart of thealgorithmshowninFig.11-3.Theefficiencyofacomputerprogrambasedonthisalgorithmdependsmainly

onthespeedwithwhichwecantestwhetherornottheendverticesoftheedgeunderconsiderationhaveoccurredinanytreeformedsofar.Forthistesting,wemaintainalineararray(calledVERTEXintheprogramlisting)ofsizen.Whenanedge(i,j)isincludedinthecthtree,theithandjthentriesinthisarrayaresettoc.Subsequently,whenanotheredge(fk,hk)isexamined,itisonlynecessarytocheckifthefkthandthehkthentriesinarrayVERTEXarenonzero.Azerointheqthpositioninthearrayindicatesthatthevertexqhasnotsofarbeenincludedin any tree. At the end of the execution, this array VERTEX identifies thecomponentsofthegraph.Unlike a component, a tree cannot be described by a set of vertices alone.

Therefore,wemusthaveanarrayofedgesastheoutput.Letthislineararraybecalled EDGE. If the kth edge (in the original order in which the edges wereplaced)isinthecthtree,EDGE(k)=c;otherwise,itiszero.Allzeroentriesinarray EDGE correspond to the chords (i.e., the edges not included in thespanning tree or forest). This array, together with arrays F and H, uniquelyidentifiesthespanningtree(orforest)generatedbythisalgorithm.In this algorithm themain loop is executed e times (e being the number of

edges).Thetimerequiredtotestwhetherornottheendverticeshaveappearedinanytreeisconstant−independentofbotheandn.Thusthetimeboundfortheexecutionof the algorithm is proportional toe. † In case the ratioe/n is high,execution timecanbe reducedby introducinganewvariable tokeepcountoftheedgesincludedinthetree.Whenthisvariablereachesthevalueofn−1,theprogramwould terminate (only if the graph is connected; otherwise,wemustexamineeveryedge).A ready-to-be-executed program in FORTRAN language, based on this

algorithm,isgivenattheendofthischapter.ForanALGOLlistingofthesameprogram,see[11-58].Arandomlygeneratedgraphof50verticestook secondontheIBM7044,usingFORTRANIV.

Page 345: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.11-3Algorithm2:Spanningtree/forest.

Minimal-Spanning-TreeAlgorithms:AsdiscussedinSection3-10,wecanusethealgorithmsuggestedbyKruskaltofindashortestspanningtreeinagraphG

Page 346: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

inwhicheveryedgehasadistance (orweight) associatedwith it.This canbeaccomplished with the algorithm just described. The only additional workrequired is to first sort the edges in a nondecreasing order of their weights,before representing them by F and H arrays. That is, the following set ofinequalitiesmustbesatisfied:

wtofedge(fi,hi)≤wtof(fi+1,hi+1), forall1≤i≤e−1.

Becauseofthesortinginvolved,Kruska’salgorithmisnotasefficientastheone due to Prim [3-10] (whichwas also discovered independently byDijkstra[11-16]). The latter algorithm, as outlined in Sec. 3-10, requires no sorting ofedges, but builds up a minimal spanning tree by successively connecting thepartially formed tree to its nearest neighbor. For a FORTRAN listing of anefficient implementation of Prim’s minimal-spanning-tree algorithm, see [11-70].The computation time of this algorithm is proportional ton2,n being thenumberofvertices,[11-22].Minimalspanningtreehasbeenfoundquiteusefulinprovidingalowerbound

onthelengthofthetravelingsalesman’sroute[11-28].

SpanningTreeswithDesiredProperties: Insteadofashortestspanningtree,onemaywishtofindalongestspanningtree.Oronemaybeinterestedintreeswith other desired properties and constraints, such as a spanning tree with aspecifiedmaximumdegreeordiameter.Algorithm2withappropriateadditionalsortingortestingcanbeusedforsuchpurposesalso.

Generating All Spanning Trees: Aswe shall see inChapter 13, analysis ofelectrical networks basically reduces to finding all spanning trees in graphs.Becauseofthisimportantapplication,morethanadozendifferentalgorithmsforgenerationofallspanningtreeshavebeenproposed.InSection3-9wediscussedone of thesemethods, themethod of cyclic interchange. Since the number ofspanning trees even in a small graph is very large, the efficiency of thesealgorithmsisofparamountimportance.AsurveyofthesemethodswasdonebyChaseinhisPh.D.thesis[11-8].Heconcludesthatthemostefficientalgorithmis of the type suggested by Minty [11-43], which essentially consists ofsuccessivelyreducingagraphbyoperationsofdeletionofanedgeandfusionofits end vertices. From the spanning trees of reduced graphs (which are muchsmaller)thespanningtreesoftheoriginalgraphareobtained.Toensurethatthealgorithm terminates, graphs below a certain size are not reduced any further;instead theirspanning treesareobtaineddirectly.AcompactALGOLprogrambasedonthismethodisgivenin[11-42].

Page 347: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Algorithm3:ASetofFundamentalCircuits

Sometimeswe are required to find a set of fundamental circuits in a givengraph. The spanning-tree algorithm just described can be used for generatingfundamentalcircuitsifthefollowingadditionalworkisperformed:While examining the kth edge (fk, hk) inAlgorithm 2, if condition 3 arises

(i.e., both vertices fk andhk occur in the same treeTi), then instead of simplyrejectingthisedgewemustfindthoseedgesinTtthatformthepathbetweenfkandhk.Thispathandtheedge(fk,hk)constituteafundamentalcircuit.Findingthispathisthemainproblemhere.In[11-52]atree-fellingprocedurehasbeensuggested,wheretheedge(fk,hk)isaddedtoTi,andallpendantverticesoftheresulting graph are deleted iteratively. This method, however, turns out to beinefficient. More efficient methods have been proposed by Welch [11-68],Gottlieb and Corniel [11-25], and Paton [11-47]. Among these three, Paton’salgorithmappearstobethemostefficient,andisasfollows:

DescriptionoftheAlgorithm:Herealsoeachedgeistestedtoseeifitformsacircuit with the tree constructed so far; but instead of taking the edgesthemselvesinanarbitraryorder(aswasdoneinAlgorithm2),weselectavertexzandexaminethisvertexbylookingateveryedgeincidentonz.(Vertexz,aswe shall shortly see, is the vertex addedmost recently to the partially formedtree.)LettheverticesofthegivenconnectedgraphG=(V,E)belabeled1,2,...,n,andthegraphbegivenbyitsadjacencymatrixX.LetTbethecurrentsetofverticesinthepartiallyformedtree,andletWbethesetofverticesthatareyettobeexamined(i.e.,thosevertices,inTaswellasnotinT,whichhaveoneormoreunexaminededgesincidentonthem).Initially,T=∅andW=V,theentiresetofvertices.WestartthealgorithmbysettingT=1,thefirstvertex,andW=V.Vertex1

will be regarded as the root of the tree to be formed. After initialization, thefollowingprocedureisused:

1. IfT∩W=∅,thenthealgorithmisterminated.

2. IfT∩W≠∅,chooseavertexzinT∩W.

3. Examinezbyconsideringeveryedgeincidentonz.Ifthereisnosuchedgeleft,removezfromW,andgotostep1.

4. Ifthereissuchanedge(z,p),testifvertexpisinT.

5. Ifp∈T,findthefundamentalcircuitconsistingofedge(z,p)togetherwith

Page 348: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

theuniquepathfromz top inthetree(formedsofar).Deleteedge(z,p)fromthegraph,andgotostep3.

6. Ifp∈T,addedge(z,p)tothetreeandvertexptosetT.Deleteedge(z,p)fromthegraph,andgotostep3.

Asmentionedearlier,theonlytrickypartinthisalgorithmisinstep5.Howdowe find the unique path from z to p in the tree? The following procedureprovidesananswer:We maintain a pushdown list (a stack) TW = T ∩W, which stores those

vertices in the tree that havenot yet been examined.Themost recently addedvertexisatthetopofthestack.Eachtimeavertexistakenforexaminationitistaken from the top of this stack, and is removed from the stack. Two lineararraysof lengthnareemployed:LEVEL(i)beingthedistanceofvertexifromtherootofthespanningtree(i.e.,vertex1),andPRED(i)beingavertexvsuchthat(i,v)isanedgeinthetreewithvnearertheroot.Inotherwords,PRED(i)isthepredecessorofiinthepathfromtheroottoi.LEVEL(i)=−1ifandonlyifvertexiisnotinsetT,thecurrentsetoftreevertices.Initially,LEVEL(1)issetto0andLEVEL(i)to−1fori=2,3,...,n.

Instep5vertexzisunderexaminationandanedge(z,p)hasbeenfoundsuchthatvertexp∈T.Tofindthefundamentalcircuitformedby(z,p)withthetree,we trace the unique path from z to p in the tree by successively finding thepredecessorsPRED(z),PRED(PRED(z)), . . . , tillweencounterPRED(p), thepredecessorofp.Inotherwords,asshowninFig.11-4,thefundamentalcircuitgeneratedis

Page 349: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.11-4Generationofafundamentalcircuit.

z,PRED(z),PRED(PRED(z)),...,PRED(p),p,z.

Themost important thing to note is that the predecessor PRED(k) of everyvertexkinTisavertexwhichiseitheralreadyexaminedorisbeingexamined.Thatis,ifk∈T∩W,then

PRED(k)∉W but PRED(k)∈T.

AflowchartofthealgorithmisgiveninFig.11-5,andaready-to-be-executedFORTRANprogramisprovidedattheendofthechapter.Theexecutiontimeisboundedbynv,2≤v≤3,andthevalueofvdependson

thestructureofthegraphandalsoonthelabelingofvertices[11-47].

Page 350: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.11-5Algorithm3:Fundamentalcircuits.

Althoughforsimplicityweassumedthatthegraphisconnected,thealgorithm

Page 351: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

will work for disconnected graphs also. First, it will produce all fundamentalcircuits in the component containing the starting vertex 1. After havingexhaustedthefirstcomponent,weselectavertexysuchthatLEVEL(y)=−1,and startwith y as the root of a spanning tree in the second component. Thisprocedurecontinuestillthereisnovertexleftwith—1asitsLEVEL.Typically for a graph of 50 vertices and 132 edges the IBM 7044 (using

FORTRANIV)took secondtogenerateasetoffundamentalcircuits.

AllCircuitsinanUndirectedGraph:Allcircuitsofanundirectedgraphmightbe foundbyfirst forming thesetofall linearcombinations (i.e., ringsums)ofthe fundamental circuits and thendiscarding from this set all thosecircuit setsthatcontainothercircuits.(Thisisbecausealinearcombinationofcircuitscanbe either a circuit or a union of edge-disjoint circuits. And a union of edge-disjointcircuitscontainsothercircuits.)Suchanalgorithm,however,wouldbevery inefficient. Fromµ fundamental circuits 2µ −µ − 1 linear combinationsmust bemade, and then each of thesemust be compared pairwisewith everyothertotestforcontainment.Therefore,adifferentapproachhastobetaken.Toreducethestoragerequirementandthenumberofcomparisons,onemay

betemptedtosuggestdiscardingeveryedge-disjointunionofcircuitsassoonasit is generated. This approach, however, is faulty. For we might find that agenuine circuit was a combination of some discarded circuit set and anothercircuitgeneratedlater.Welch[11-68]proposedaschemeoforderingthefundamentalcircuitssothat

one could discard a union of edge-disjoint circuits as it is produced beforegeneratingall2µ−µ−1combinationsandthenmakepairwisecomparisons.Ina more recent paper [11-24], Gibbs has pointed out an error in Welch’salgorithmandhasproposedamodification.Gibbs’salgorithmforgenerationofallcircuitsfromasetoffundamentalcircuitsisessentiallyanexhaustivemethodand requires storage proportional to 2µ. Finding an efficient algorithm foridentifying all circuits in a graph is an open problem.For a survey of circuit-generationalgorithmsseePrabhaker[11-50].

Algorithm4:Cut-VerticesandSeparability

HavingfoundoutthatagraphG isconnected,thenextquestiononeismostlikely to ask is: Is the graphG separable? That is, is there one or more cut-verticesinG?Iftheanswerisyes,onewouldliketofindthecut-verticesandtheblocks(maximalnonseparablesubgraphs)ofG.As pointed out in Section 4-5, cut-vertices are important in the study of

Page 352: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

vulnerabilityofacommunicationnetwork.Moreover, thisalgorithmmayserveasasubroutineforotheralgorithms,suchasforplanarityandisomorphism.Preliminary Simplification: In this algorithm, as in most others, it pays to

performsomepreliminarysimplification.Ifthegivengraphhasthepossibilityofbeingdisconnected,wecouldapplyAlgorithm1andconsidereachcomponentasaconnectedgraph.Itwillbeawasteofcomputermemoryandexecutiontimetodragalongallthecomponentsofadisconnectedgraph.Similarly,ifthegraphisnotsimple,wecanimmediatelydiscardall theself-loopsandparalleledges,sincetheirpresenceorabsencehasnoeffectonseparability.Third,ifthegraphhasanypendantvertices,wecanprunethegraphbyrepeatedlydeletingpendantvertices.(Inthepruningprocesswemustkeepinmindthateveryvertexadjacentto a pendant vertex is a cut-vertex, except in the trivial casewhere the graphconsistsof justoneedge.)Usually thesesimplificationswillhavesubstantiallyreducedthesizeoftheoriginalgraph.†Astraightforwardmethod(whichwasusedin[5-8],forexample)fortesting

separabilityofagraphwouldbetoremoveeachvertexinturn(bydeletingthecorrespondingrowandcolumnfromitsadjacencymatrixX)andthentotesttheresultinggraphforconnectedness,usingAlgorithm1.But this isan inefficientmethod,andwecandobetterusingadifferentapproach,suggestedbyRead[11-53].LetusrecallaresultfromChapter4:Twoedgesareinthesameblockifand

onlyifthereexistsatleastonecircuitthatcontainsboththeseedges(Problem4-10).At first sight itmayappear that touse thischaracterizationofablockwewouldhave togenerate all circuits—anobviously time-and storage-consumingaffair. The following two results, however, reveal that it would suffice togenerateonlyasetoffundamentalcircuits:

LEMMA1

Anonempty intersectionof two fundamental circuits in agraph is always apath.

Proof:With respect to some specified spanning treeT, lete1 ande2 be twochords forming fundamental circuits f1 and f2, respectively. Then if f1 ∩ f2contains two edges,x and y, not connected in f1∩ f2, there is a pathP1 in f1betweenxandy (that is,apathbetweenoneof theendverticesofedgexandone of the end-vertices of edge y); and this path does not contain chord e1.Similarly, there is a pathP2 in f2 betweenx andy that does contain chorde2.

Page 353: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Thenthesubgraph

P1∨P2∨{x,y]

containsacircuitwithoutcontaininganychord,whichisimpossible.

LEMMA2

InagraphGifedgesaandbbelongtoafundamentalcircuitfi,andifedgesbandcbelong toanother fundamentalcircuit fj such thata∉ fjandc∉ fi, thenthereexistssomecircuitΓinGsuchthataandcbothareinT.

Proof:TheprooffollowsfromLemma1,becausefi∩fjisapathcontainingbbut not a or c. Therefore, fi⊕ fj is a circuit (not an edge-disjoint union ofcircuits)containingaandc.

DescriptionoftheAlgorithm:Ifwegeneratefundamentalcircuitsonebyone,andaseachfundamentalcircuitisgeneratedwelabel†(orrelabel)allitsedgesidentically,usingthefollowingprocedure,wewillhaveidentifiedtheblocksinthegraph:Eachedgeinthefirstfundamentalcircuitislabeledwith2’s.Whenthesecond

fundamentalcircuitisfound,itwillhaveeitherallitsedgesunlabeled,orsomeof its edges would be labeled 2. In the former case, label every edge of thesecond fundamentalcircuitwith3’s,and in the lattercasewith2’s.When thisprocessreaches themth (1≤m≤e−n+1) fundamentalcircuit,wemayfindanyoneofthreeconditions:

1. Ifeveryedgeinthemthfundamentalcircuitisunmarked,labelallofthemwithanewintegerq+1.

2. Ifsomeedges in themth fundamentalcircuitaremarkeduandallothersareunmarked,labeleachoftheunlabeledonesasualso.

3. Suppose that some edges in themth fundamental circuit are marked u,othersv,andothersw,...,andsomeareunmarked.Letu<v<w<....Thenrelabelalledgesmarkedv,w,...,inGasu,andlabelallunmarkededgesinthemthfundamentalcircuitasualso.

Whenthisprocessterminates,afterhavinggeneratedfundamentalcircuitsandlabeledtheedgesineachofthem,thefollowinghasbeenaccomplished:

Page 354: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Every edge that belongs to a circuit has been labeled. Moreover, any twoedgeshave the same label if andonly if theyare together in somecircuit (notnecessarily a fundamental circuit). In other words, each set of edges carryingidenticallabelsconstitutesablock.Ifthereismorethanoneblockinthegraph,the graph is separable.Anyvertex incident on edgeswith different labels is acut-vertex.Anedgethathasnotacquiredanylabelisabridge.(Abridgeisanedgewhoseremovaldisconnectsthegraph.)Inthisalgorithmanedgebelongingtoacircuitgetsrelabeledmanytimes−an

obvious source of inefficiency. An improvement suggested by Paton [11-48]reduces the relabelingof edgesby the followingdevices: Insteadof relabelingtheedgesinafundamentalcircuitassoonasitisgenerated,wewaittillavertexzinAlgorithm3hasbeencompletelyexamined,andthenassignidenticallabelsto the fundamental circuits (passing through z) thus generated. Therefore,labelinghastobeperformedonlyn timesandnotµ times.Moreover,weneednot label every edge in the graph (Problem 11-11). It is left for the reader toconstructaflowchartfortheblock-identificationalgorithminwhichAlgorithm3iscompletelyembedded.Remainingdetailscanbefoundin[11-48].Usinganentirelydifferentapproach,HopcroftandTarjan[11-31]andTarjan

[11-61] have given an algorithmwhich is faster than the algorithm describedhere forcertain typesofgraphs.Theiralgorithmusesdepth-first searchon thegraph(tobediscussedlater inthischapter),andthegraphis tobeinput inthesuccessor-listingform.Itsexecutiontimeisproportionaltoe,whereasthetimeboundfortheRead-Patonalgorithmdescribedhereisproportionalionγwhere1≤ γ < 2, dependingon the structure of the graph.Analysis and extensive testsshow that fora typicalgraphofnverticesande edges,Hopcroft andTarjan’salgorithmoutperforms(onIBM7044)Paton’salgorithmaslongase≤5n.Forgraphs of much higher densities (Problem 11-1) Paton’s algorithm performedbetter. Thus for planar graphs (since e ≤ 3n − 6), Hopcroft and Tarjan’salgorithmwillingeneralbefaster.Typically,foran80-vertex400-edgegraph,the IBM7044 took about 7 seconds for block identificationwith either of thetwoalgorithms.

Algorithm5:DirectedCircuits

Oneofthemostimportantthingsaboutadigraphisitsdirectedcircuits(alsocalled cycles). The significance of directed circuits in many applications wasdiscussed in Chapter 9.Unlike the case of undirected graphs, no technique isknownbywhichwecanobtainabasic setofdirectedcircuits such that everydirectedcircuit in thedigraph isobtainedasa linearcombinationof thisbasic

Page 355: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

set.Therefore,Algorithm3isoflittlehelpinobtainingalldirectedcircuitsofadigraph.Wemustgenerateeverydirectedcircuitindividually.Forthiswemustexamineeachedge(unless theedge isknownapriori tobelong tonodirectedcircuit)manytimes.

Preliminary Simplification: Although it is not necessary, in most cases thepriorapplicationofthefollowingtwostepswillsimplifyagivendigraph.First,if the digraph is likely to be disconnected, use Algorithm 1 [with slightmodification for a digraph (Problem 11-7)] to identify the connectedcomponents, and thenconsideronecomponentat a time.Second, successivelydeleteallvertices(andtheedges incidentonthem)thathavezero in-degreeorzeroout-degree.Clearly,suchavertexcannotlieinanydirectedcircuit.Theseverticesareeasytoidentifybecausetheycorrespondtoentirerows[ford+(v)=0]orcolumns[ford-(v)=0]ofzerosintheadjacencymatrixX.Forexample,ifthe digraph given was the one in Fig. 9-16, edges a, b, and h would beeliminated.Theninthenextgo-roundedgeseandcwouldbedeleted,leavingusa digraph of only three edges, d, f, and g. On the other hand, thismethod ofsimplificationwillnotreducethedigraphshowninFig.9-21.

Descriptionof theAlgorithm:This algorithm, firstproposedbyRoberts andFlores [11-56] and subsequently systematized by Tiernan [11-63], uses anexhaustivesearchtofindalldirectedcircuitsinagivendigraphG.Asusual,thevertices ofG are assigned integers 1, 2,. . ., n as their names. The algorithmdependsonstartingfromavertexp1andbuildingadirectedpathP=(P1,P2,...,Pk) until no further vertices (satisfying certain conditions) are “available” atvertexpk.Atpk,whenitisnotpossibletoextendthedirectedpathanyfurther,thealgorithmchecks tosee if there isadirectededge frompk topv If there issuchanedge,adirectedcircuit(p1,p2,...,Pk,P1)hasbeenfoundandisdulyrecorded.Ifthereisnosuchedgeinthedigraphs,wemovebackonevertextopk-1andtryextendingthepathagainfrompk-1alongadifferentedge(ifthereisone).Whetheradirectedcircuit isfoundornot, thealgorithmmakesvertexpkforbidden for thenext extension frompk-1 (thus avoidinggoingover the samepath).Thisprocessoflookingfordirected.circuitsandthenmovingbackavertexis

continuedtillwefinallybacktracktothevertexp1,itself.Thusalldirectedpathsstarting from p1 have been examined and directed circuits recorded. Startingwith the next vertex, the entire process is repeated. The iteration starts withvertexp1=1andendswithp1=n.

Page 356: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

In this exhaustive search for directed paths we must take the followingprecautions:

1. In the process of extending each directed path, going round and round adirected circuit must be avoided. This is achieved by insisting that anyvertexthathasalreadybeenincludedinthedirectedpathis“notavailable”forextendingthepath.

2. Generatingadirectedcircuitofqverticesqtimes—onceateachvertexinthe circuit—must be avoided. This is accomplished by insisting that novertexi≤p1isavailableforpathextension,ifthepathbeginswithvertexp1 This rule assures that the search for a particular directed circuitcommencesonlywhenitslowest-numberedvertexisatthepathinitiation.

3. The same path must not be considered more than once during the pathextension. This is accomplished by keeping an updated list of forbiddenvertices in abinaryn bynmatrixH= [hij].The1 entries in the ith rowcorrespondtotheverticesthatareforbiddenfromvertexi(i.e.,ifvertexjisforbiddenfromvertexi,sethij←1).A0entryindicatesthatthevertexisnotforbidden(i.e.,ifhij=0,thenvertexjisnotforbiddenfromvertexi).MatrixHisreset tozeroeachtimeanewvertexischosenasthestartingvertex.

The digraph is inputted as its adjacency matrix [see Section 11-2(a)]. Theverticesarelabeledasusualwithintegers1,2,...,n.Thedirectedpathunderconsiderationisrepresentedbyalineararray

P=(p1,p2,...,pk-1,pk,0,0,...,0,0)

ofordern.Thefirstvertexofeverypathisp1andthelastoneispk.

Page 357: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.11-6Digraph.

The algorithmcanbe best explainedwith an example.When applied to thedigraphofFig.11-6,thefollowingstepswillbeperformed:

Page 358: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Theflowchartofthisalgorithm,whichisamodifiedversionofthealgorithmgivenin[11-63],isshowninFig.11-7.Youmusthaveobservedthatthisalgorithmisnothingmorethanasystematic

andexhaustivesearchfordirectedcircuits.Asshownintheexample,thesamedirected path is traversed many times. Even a directed circuit is usuallyexamined and rejected several times before its turn to be accepted arrives.Consequently, the algorithm is very slow, and there is room for considerableimprovement. To quote Tiernan [11-63], this algorithm “would be costly toutilize on a graph containingmore than50 arcs or 7 vertices”—a small graphindeed.Thealgorithmcouldbeeasilymodified togeneratealldirectedHamiltonian

circuits.This, in fact,was theoriginalpurposeof thealgorithmas reportedbyRobertsandFlores[11-56].A randomdirectedgraphof20vertices,55edges, and434directedcircuits

took about 17 seconds on the IBM 7044. This indicates that this method,involving a systematic but exhaustive search, is quite inefficient in terms ofexecutiontime.A similar algorithm but somewhat more involved, considerably faster, but

requiringmorestoragewasproposedbyWeinblatt[11-67].Seealso[11-50].

11-5.SHORTEST-PATHALGORITHMS

A large number of optimization problems are mathematically equivalent tofinding shortest paths in a graph. Consequently, shortest-path algorithms havebeenworked overmore thoroughly than any other algorithm in graph theory.Morethan100papershavebeenpublishedanddozensofalgorithmshavebeenproposed.Someofthesealgorithmsarebetterthanothers,somearemoresuitedfor a particular structure than others, and some are only minor variations of

Page 359: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

earlier algorithms. For a good comparative study of various shortest-pathalgorithmsthroughtheyear1968,asurveypaperbyDreyfus[11-17] ishighlyrecommended.

Fig.11-7Algorithm5:Directedcircuits.

There are different types of shortest-path problems. Most frequentlyencounteredamongthesearethefollowingfive,ofwhichweshallsolvethefirstthree:

Page 360: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

1. Shortestpathbetweentwospecifiedvertices.

2. Shortestpathsbetweenallpairsofvertices.

3. Shortestpathsfromaspecifiedvertextoallothers.

4. Shortest path between specified vertices that passes through specifiedvertices.

5. Thesecond,third,andsoon,shortestpaths.

Inaworst-casesituation,type1becomesidenticalto3,because(asweshallseeshortly) in the process of finding the shortest path from a specified vertex toanotherspecifiedvertex,wemayhavetodeterminetheshortestpathstoallothervertices.Letusdealwithtype1first.

Algorithm 6: Shortest Path from a SpecifiedVertex toAnother SpecifiedVertex

Theproblemoffindingtheshortestpathfromaspecifiedvertexstoanotherspecifiedvertext,canbestatedasfollows:Asimpleweighteddigraph†Gofnverticesisdescribedbyannbynmatrix

D=[dij],where

dij=length(ordistanceorweight)ofthedirectededgefromvertexitovertexj,dij≥0,

dii=0

dij=∞,ifthereisnoedgefromitoj(incarryingoutaprogram∞isreplacedbyalargenumber,say9999999).

Ingeneral,dij≠djiandthetriangleinequalityneednotbesatisfied.Thatis,dij+djkmaybelessthandik.[Infact,ifthetriangleinequalityissatisfied,foreveryi,j,andk,theproblemwouldbetrivialbecausethedirectedge(x,y)wouldbetheshortest path from vertex x to vertex y.] The distance of a directed pathP isdefinedtobethesumofthelengthsoftheedgesinP.Theproblemistofindtheshortestpossiblepathanditslengthfromastartingvertexstoaterminalvertext.Among several algorithms that have been proposed for the shortest path

betweenaspecifiedvertexpair,perhaps themostefficientone isanalgorithmduetoDijkstra[11-16].

Page 361: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Description of theAlgorithm:Dijkstra’s algorithm labels the vertices of thegiven digraph. At each stage in the algorithm some vertices have permanentlabels and others temporary labels. The algorithm begins by assigning apermanent label 0 to the starting vertex s, and a temporary label ∞ to theremainingn—1vertices.Fromthenon,ineachiterationanothervertexgetsapermanentlabel,accordingtothefollowingrules:

1. Every vertex j that is not yet permanently labeled gets a new temporarylabelwhosevalueisgivenby

where i is the latestvertexpermanently labeled, in theprevious iteration,and dij is the direct distance between vertices i and j. If i and j are notjoinedbyanedge,thendij=∞.

2. The smallest value among all the temporary labels is found, and thisbecomesthepermanentlabelofthecorrespondingvertex.Incaseofatie,selectanyoneofthecandidatesforpermanentlabeling.

Steps 1 and 2 are repeated alternately until the destination vertex t gets apermanentlabel.Thefirstvertextobepermanentlylabeledisatadistanceofzerofroms.The

secondvertextogetapermanentlabel(outoftheremainingn−1vertices)isthevertex closest to s. From the remaining n − 2 vertices, the next one to bepermanentlylabeledisthesecondclosestvertextos.Andsoon.Thepermanentlabelofeachvertexistheshortestdistanceofthatvertexfroms.Thisstatementcan be proved by induction (Problem 11-13). As an illustration of Dijkstra’sprocedure, letus find thedistancefromvertexB toG in thedigraphshowninFig. 11-8.We shall use a vector of length seven to show the temporary andpermanent labelsof theverticesaswego through thesolution.Thepermanentlabels will be shown enclosed in a square, and the most recently assignedpermanentlabelinthevectorisindicatedbyatick .Thelabelingproceedsasfollows:

Page 362: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.11-8Simpleweighteddigraph.

All steps are easily programmed except for the job of distinguishing thepermanentlylabeledverticesfromthetemporarilylabeledones,whichisslightlytricky.Anefficientmethodofaccomplishingthisistoassociateindices1,2,...,nwith thevertices, andkeep abinaryvectorVECToforder n.When the ithvertex becomes permanently labeled, the ith element in this binary vectorchangesfrom0to1.AflowchartofthisalgorithmisgiveninFig.11-9,andaFORTRANlisting

oftheprogramisprovidedattheendofthechapter.The algorithm described does not actually list the shortest path from the

starting vertex to the terminal vertex; it only gives the shortest distance. Theshortestpathcanbeeasilyconstructedbyworkingbackwardfromtheterminalvertex such that we go to that predecessor whose label differs exactly by thelength of the connecting edge. (A tie indicates more than one shortest path.)Alternatively, the shortest path can be determined by keeping a record of thevertices fromwhich each vertexwas labeled permanently. This record can be

Page 363: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

maintained by another linear array of length n, such that whenever a newpermanent label is assigned to vertex j, the vertex from which j is directlyreachedisrecordedinthejthpositionofthisarray.

Remarks

1. In this algorithm, hadwe continued the labeling until every vertex got apermanent label (rather than stopping at the permanent labeling of thedestinationvertex t),wewouldhavegottenanalgorithm for the shortestpathsfromstartingvertexstoallothervertices.Acomputerprogramforthispurpose,writteninALGOL,isgivenin[11-6].

2. Ifwe take a shortest path from the starting vertex s to each of the othervertices(whichareaccessiblefroms),thentheunionofthesepathswillbeanarborescenceTrootedatvertexs.EverypathinTfromsisthe(unique)shortestpathinthedigraph(orgraph,asthecasemaybe).Suchatreeiscalledtheshortest-distancearborescence(andshortest-distancetreeinanundirected graph−not to be confused with the shortest spanning treeintroduced inChapter3).This arborescencemaybe constructed as aby-productinAlgorithm6,ifthelabelingiscontinuedtilleveryvertexgetsapermanent label, and if each time a vertex is labeled permanently, thecorresponding edge is added to the arborescence. For example, theshortest-distancearborescenceofFig.11-8isgiveninFig.11-10.

Page 364: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.11-9Algorithm6:Shortestdistancefromstot.

Page 365: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.11-10Shortest-distancearborescenceofFig.11-8.

3. Inthisalgorithm,asmoreverticesacquirepermanentlabelsthenumberofadditions and comparisons needed to modify the temporary labelscontinues to decrease. In the case where every vertex gets permanentlylabeled,weneedn(n−1)/2additionsand2n(n−1)comparisons.Thusthecomputationtimeisproportionalton2.

4. Notice that for a given n the computation time is independent of thenumber of edges the digraph may have. This is because it is tacitlyassumedthatthedigraphiscomplete−eachmissingedgeissimplygivenavery large weight. This observation is also borne out by the followingtypical data:On the IBM7044, for a randomdigraphof 80vertices and3200 edges, it took second to find the shortest distance from a givenvertextoallothers.Anotherrandomgraphwith80verticesbutonly1000edgesalsotook secondforthesamecomputation.

5. If thedigraph is sparse [i.e., thenumberofedgese ismuchsmaller thann(n − 1)], it is possible to reduce the time of computation. This can beachievedbyincorporatinganothertestwhichaltersthetemporarylabelsofonly those vertices that are successors of the most recent permanentlylabeledvertex.Thereis,ofcourse,atradeoffherebetweenthetimetakenfor testingand the time that is savedas a result of this test.AnALGOLprogramofDijkstra’salgorithm,which takesadvantageof thesparsenessof thegraph, isgivenin[11-38],pages43-44.Foranother techniquethatreducescomputationtimeinsparsegraphs,seeremark3inAlgorithm7.

6. If thegivendigraphG is notweighted, every edge inG has aweightofone,andmatrixDisthesameastheadjacencymatrix.Thentheproblemissimpler.Weperformlogicaloperationsratherthanrealarithmetic.

7. Wehaveassumedthedistancesdnareallnonnegativenumbers.Ifsomeof

Page 366: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

thedistancesarenegative,Algorithm6willnotwork.(Negativedistancesinanetworkmayrepresentcostsandthepositiveonesprofits.)ThereasonforthefailureofAlgorithm6isthatonceavertexispermanentlylabeledits label cannot be altered. Shortest-path algorithms have, however, beenproposed(see[11-17])thatwillsolvethisproblem,providedthesumofalldijaroundeverydirectedcircuitispositive.(Theproblemhasnosolutionifa negative-weight circuit having a vertex on a directed path from s to texists,becausethenonecouldcontinueminimizingthedistanceto−∞bygoingroundandroundthiscircuit.)Thecomputationtimeof theexistingalgorithmsthatcanhandlenegativedijisn3andnotn2.

8. It was suggested by T. A. J. Nicholson that carrying the shortest-pathalgorithmsimultaneouslyfrombothendssandtwouldimprovethespeed.Dreyfus [11-17] has, however, shown that the double-ended procedurewouldimprovetheefficiencyonlyincertaintypesofdigraphs.Inthecasewhere nearly alln verticesmust be permanently labeled from either oneendortheother,thedouble-endedprocedureisactuallylessefficientthanDijkstra’s one-ended procedure. For an ALGOL listing of Nicholson’sdouble-endedprogramseeAlgorithm22in[11-6].

Algorithm7:ShortestPathBetweenAllPairsofVertices

Sometimesoneisinterestedinfindingtheshortestpathsbetweenalln(n−1)orderedpairsofverticesinadigraph(orn(n−1)/2unorderedpairsofverticesinan undirected graph). If we were to use Algorithm 6 for this purpose, thecomputation time would be proportional to n4. There are several algorithmsavailable thatcandobetter.Among these, twoareconsideredbest,bothbeingequallyefficient.OneisduetoDantzig[11-15]asimprovedbyTabourier[11-60]; the other one is due to Floyd [11-21], based on a procedure byWarshall[11-65].Bothalgorithmsrequirecomputationtimeproportionalton3.WeshalldescribetheWarshall-Floydalgorithm.

DescriptionoftheAlgorithm:Thealgorithmworksbyinsertingoneormoreverticesintopaths,wheneveritisadvantageoustodoso.Starting with the n by n matrix D = [dij] of direct distances, n different

matricesD1,D2,...,Dnareconstructedsequentially.MatrixDk,1≤k≤n,maybethoughtofas thematrixwhose(i, j)thentrygives the lengthof theshortestdirected path among all directed paths from i to j, with vertices 1, 2, . . . , kallowedastheintermediatevertices.MatrixDk= isconstructedfromDk-

Page 367: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

1accordingtothefollowingrule:

Thatis,initeration1,vertex1isinsertedinthepathfromvertexitojifdi1>d1j+dijIniteration2,vertex2isinserted,andsoon.Suppose,forexample,thattheshortestdirectedpathfromvertex7to3is74

1953.Thefollowingreplacementsoccur:

Oncetheshortestdistanceisobtainedin ,thevalueofthisentrywillnotbealteredinsubsequentoperations.TheflowchartofthealgorithmisgiveninFig.11-11andaFORTRANlisting

isgivenattheendofthechapter.ItsALGOLlistingcanbefoundin[11-21].Thealgorithmdescribedsofardoesnotactuallylistthepath;itonlygivesthe

shortest distances. Obtaining the path is slightly more involved than inAlgorithm6,becausenow therearen(n—1)paths required,not justone.Anefficientmethod of obtaining the intermediate vertices in each of the shortestpaths is by constructing a matrix Z = [zij] (referred to as the optimal-policymatrix),suchthatentryzijisthefirstvertexfromialongtheshortestpathfromitoj.Theoptimal-policymatrixZcanbeconstructedasfollows:Initiallyweset

zij=j, ifdij≠∞,=0, ifdij=∞.

Inthekthiterationifvertexkisinsertedbetweeniandj,elementzijisreplacedbythecurrentvalueofzik,foralliandy.ThisupdatingoftheZmatrixisdoneduringeachiterationk,wherek=1,2,...,n.Attheend,theshortestpath(i,v1,

Page 368: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

v2,...,vq,j)fromitojisderivedasasequenceofvertexnumbersfrommatrixZasfollows(seeProblem11-15):

Page 369: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.11-11Algorithm7:Shortestpathbetweeneveryvertex-pair.

Remarks

1. Notice that for computational purposes we needmemory space for onlyonenbynmatrix.Otherconstructedmatricescanbeoverwrittenon thismatrix.

Page 370: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

2. Toestimatetheexecutiontime,notethatwehavetoconstructnmatricesD1,D2,...,Dn,sequentially.ForeachmatrixDkthenumberofelementstobecomputed is (n−1)(n−2),because inEq.(11-2) i≠ j, i≠k, j≠k(although,forsimplicity,intheflowchartwehavenottakenadvantageofthisslightsaving).Thustheexecutiontimeisproportionalton(n−1)(n-2)≃n3.

3. Whenever in Eq. (11-2), it is possible to circumvent n − 1additions and comparisons in exchange for an additional test. This is atradeoffjustasinAlgorithm6,butsincetheexecutiontimeforAlgorithm7 is proportional ton3, it pays to include this extra test for almost everydigraph.(Notethatthetestisnotincludedintheflowchart.)

4. Ifthegraphissparse,thatis,thenumberofedgesarefarfewerthann(n−1), it ispossible to takeadvantageof thespecialstructureandreduce thelabor by decomposing the graph. Shortest paths are obtained in eachsubgraphandtheseareputtogethertoobtaintheshortestpathsintheentiregraph.Asanextremeexample,consider thecaseinwhichàdigraphofnverticesconsistsof the twodigraphsofn/2verticeseach.Thenumberofcomputations reduces fromn3 to2(n/2)3, a reductionof75per cent.SeeHuandTorres[11-33]fordecompositionalgorithms.

5. As in Algorithm 6, if the digraph is unweighted, that is, D = X, thecomputational timecanbereducedbyreplacing thearithmeticoperationswithlogicaloperations.

TransitiveClosureofaDigraph:LetGbeasimple,nvertexdigraph.LetusconstructanothersimplenvertexdigraphbyaddingedgestoGasfollows:Addanedge(i,j)directedfromvertexitojifandonlyifthereisadirectedpath(ofanylength2,3,...,n−1)fromitojinG.DigraphHiscalledthetransitiveclosureofG.Inotherwords,

X(H)=R(G),

where X(H) is the adjacency matrix of H and R(G) is the reachability (oraccessibility)matrixofG.ItiseasytoseethatthetransitiveclosureofagivendigraphGcanbeobtained

byapplyingALGORITHM7totheadjacencymatrixX(G),i.e.bysettingD←X.Thetimetakenbythismethodofobtainingtransitiveclosureisproportionalton3.Wecan,however,dobetter.Fordiscussionsofmoreefficientalgorithms

Page 371: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

fortransitiveclosuresee[11-45].Longest-PathAnalysis:Sometimes,notablyincriticalpathanalysisofactivity

networks(seeChapter14),oneneedsthelongestpaths(ratherthantheshortest)from a specified vertex to all others. One would expect that maximizationprocedures analogous to the minimization procedures in Algorithms 6 and 7wouldyieldthedesiredpaths.Butforanarbitrarydigraphthiswillnotwork.Forintheprocessofmaximization,onecouldgoroundandroundadirectedcircuitand the length would be made arbitrarily large. Another difficulty is thefollowing: In theshortest-pathproblem, if (s, t,u, . . . ,f) isashortestdirectedpathfromstot,thenthesubpath(t,u,...,f)isashortestpathfromttof.Itisthispropertyonwhichtheshortest-pathalgorithmsarebased.Ontheotherhand,if (s, t, u, . . . ,f) is a longestdirectedpath froms to f, theremaywell exist adirectedpathfromttofviasthatislongerthanthesubpath(t,u,...,f).Boththesedifficultiesdisappearif thegivendigraphisacyclic(whichis the

caseforactivitynetworks).Dijkstra’salgorithmcanthenbeusedtofindlongestpathsfromagivenvertextoallothersinanacyclicdigraph.Thedetailsareleftasanexercise(Problem11-16).Inadditiontothethreeshortest-pathproblemsdealtwithinAlgorithms6and

7, there are several other shortest-path problems. For example, one may beinterested in finding the second-shortest path from s to f Or one may beinterested in finding a shortest path from s to f that passes through certainspecified vertices. For these and more, [11-17] and [11-3] are recommended,whilewemoveontoanaltogetherdifferentproblem.

11-6.DEPTH-FIRSTSEARCHONAGRAPH

In this section we shall discuss a powerful technique of systematicallytraversing theedgesofagivengraphsuch thateveryedge is traversedexactlyonceandeachvertex isvisitedat leastonce.This technique, called thedepth-firstsearch(DFS)orbacktrackingonagraphwasfirstformalizedandusedbyHopcroft and Tarjan [11-31] and was subsequently studied in some depth byTarjan[11-61].It isevident that foransweringalmostanynontrivialquestionaboutagiven

graphGwemustexamineeveryedge(andintheprocesseveryvertex)ofGatleastonce.Forexample,beforedeclaringagraphGtobedisconnectedwemusthavelookedateveryedgeinG;forotherwise,itmighthappenthattheoneedgewehaddecidedtoignorecouldhavemadethegraphconnected.Thesamecanbesaidforquestionsofseparability,planarity,andthelike.

Page 372: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Therearetwonaturalwaysofscanningorsearchingtheedgesofagraphaswemovefromvertextovertex:(i)onceatavertexvwescanalledgesincidentonvandthenmovetoanadjacentvertexw.Atwwescanalledgesincidentonw.Thisprocessiscontinuedtillalledgesinthegrapharescanned.Thismethodof fanning out at each vertex is referred to as the breadth-first search of thegraph.ThiswasthemethodusedinAlgorithm3.ItwasalsoemployedimplicitlyinAlgorithms1 and6. (ii)Anopposite approach is insteadof scanning everyedgeincidentonvertexv,wemovetoanadjacentvertexw(avertexnotvisitedbefore) as soon as possible, leaving v with possibly unexplored edges for thetimebeing.Inotherwords,wetraceawalkthroughthegraphgoingontoanewvertexwheneverpossible.Thismethodoftraversingthegraph,calledthedepth-firstsearch(DFS),hasbeenfoundtobeveryusefulinsimplifyingmanygraph-theoretic algorithms, because of the resulting numbering of the vertices andorientationsimposedontheedges.

NumberingVerticesandOrientingEdgesinDFS:DuringaDFSonagraph,whenever a vertex v is visited for the first time we assign it a distinct serialnumberNUM(v),sothatNUM(v)=iifvwastheithvertextobevisitedduringthetraversal.Alsoanorientationisimposedoneachedgealongtherouteofthetraversal.WhenthesearchterminatestheundirectedgraphGonwhichtheDFSwasbeingperformed,becomesadigraph withitsverticesnumbered1,2,...,n.ThedetailsoftheDFSalgorithmcanbebestdescribedbythefollowingsteps:

Description of the DFS Algorithm: Let G be the given undirected graph,inputted asneighbor listings (i.e., representation (e) inSection11-2).Letx bethe specified vertex fromwhich the search is to begin. PALMandFRONaretwodisjointsubsetsintowhichtheedgesofGaretobepartitioned.

Step1:Setv←x,i←0,PALM←Ø,FRON←Ø

Step2:Seti←i+1,NUM(v)←i

Step3:Lookforanuntraversededgeincidentonv.(a) Ifthereisnosuchedge(i.e.,everyedgeincidentonvhasalready

beentraversed),gotoStep5;otherwise,(b) Pick the first untraversed edge at v, say (v,w), and traverse this

edge.Orienttheedge(v,w)fromvtow.Nowyouareatvertexw.Step4:(a) Ifwisavertexwhichhasnotbeenvisitedbeforeduringthissearch

(that is, if NUM(w) is undefined), add edge (v, w) to the setPALM.Setv←wandgotoStep2.

(b) Ifwisavertexwhichhasbeenvisitedearlier(thatis,NUM(w)<

Page 373: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

NUM(v)),addedge(v,w)tothesetFRON.GotoStep3.Youarebackatvertexv.

Step5:Check tosee if thereexistssome traversededge(u,v) insetPALMorientedtowardv.

(a)Ifthereissuchanedgemovebacktovertexu.(Notethatuisthevertexfromwhichvwasvisitedforthefirsttime.)Setv←uandgotoStep2.

(b)Ifthereisnosuchedge(u,v),stop(wearebackatrootx,havingtraversedeveryedgeandvisitedeveryvertexconnectedtox).

TheDFSalgorithmjustdescribedisillustratedbyanexampleinFig.11-12.In the given graphG of five vertices and eight edges, the starting vertex x isspecified.TheorderinwhichtheedgesareexploredisgiveninFig.11-12(b),andforthisorderoftraversal isgiveninFig.11-12(c).

Fig.11-12Depth-firstsearchonagraph.

PalmTreeandFronds:

It isnotdifficult tosee that if thisDFSprocedure isapplied toanyconnected,undirected graph G (with n vertices and e edges), it will terminate afternumberingthevertices1,2,...,nandorientingeveryedgeinG.Let betheresulting digraph. Consider PALM, the set of n − 1 oriented edges, each ofwhichledtoanewvertexduringtheDFS.Thissubdigraph(definedbytheedgeset PALM) is a spanning arborescence in , because every vertex in thissubdigraph,excepttherootx,hasanin-degreeequaltoone,andthein-degreeofx is zero. (Review Sec. 9-6, to recall arborescence and its properties.) Thisspanningarborescenceisreferredtoasapalmtree.Edgesnot in thepalmtree

Page 374: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

(i.e.,edgesbelongingtothesetFRON)arecalledfronds.Sinceforeveryfrond(a,b)vertexbwasvisitedbeforea,NUM(b)<NUM(a).Inotherwords,everyfrondisorientedfromahigher-numberedvertextoalower-numberedvertex.The DFS by itself does not reveal properties of a given graph G (except

whetherornotGisconnected).Whatitdoes,however,istonumbertheverticesinasystematicmannerandpartitiontheedgesintotwosetsPALMandFRON,withpropertiesjustdiscussed.ItisthiswhichmakesDFSapowerfultoolintheconstruction of efficient algorithms for solving a surprisingly large number ofgraph-theory problems. The following are some of the problems for whichalgorithmshavebeenconstructedemployingDFS.(1)Identificationofcomponents.(2)Identificationofblocksandcut-vertices,

[11-61]. (3) Identificationofmaximal subgraphsof connectivity threeormore[11-32]. (4) Planarity [11-31], and [11-62]. (5) Isomorphism of planar graphs[11-32]. (6) Identification of fragments (i.e., maximal strongly connectedsubgraphs)inadigraph[11-61].Ithasbeenshown(seetheappropriatereference)thatthecomputationtimeof

allthesesixalgorithmsisproportionaltoe,thenumberofedges,ifthegraphisgivenintheneighbor-listingformofSec.11-2(e).Andsinceeveryedgemustbeexamined at least once, this is also the lower bound on these algorithms,disregardingmultiplicativeconstants,ofcourse.We shall now sketch the planarity algorithm, a problem towhichDFS has

been applied with spectacular success, resulting in drastic improvements incomputationtimeoverearliermethods.

Algorithm8:PlanarityTesting

The problem of determining whether or not a given graph is planar is animportant one. As pointed out in Chapter 5, the planarity characterizations ofKuratowski, Whitney, or MacLane (although theoretically elegant) areunsuitable for testing by a computer. They are difficult to implement; and,besides,ifagraphisplanar,thesemethodsdonotyieldaplanerepresentation,which is often what is needed. It has been shown, for example, that ifKuratowski’scharacterizationisusedtotestplanarityofann-vertexgraph(n>5),thecomputationtimeisatleastproportionalton6(see[5-8]).Inrecentyearsmanyalgorithmsforplanaritytestinghavebeenproposedand

programmed on computers (see [5-8] for a survey). Most of these methodsemploy the map-construction approach, which works as follows: A planarsubgraph g (in most algorithms g is a circuit) of the given graphG is firstselectedandmappedonaplane.Thengraduallytheremainingedgesareadded

Page 375: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

tog,suchthatnocrossingsoccur.Ifwesucceedinthereconstruction,graphGisobviouslyplanar,andwehaveobtainedaplanerepresentationofG.Ifwefail,Gisnonplanar.The only difficult part of such an algorithm is that in the early stages of

adding edges togwe have choices available (i.e., ambiguity) in placement ofedges.Awrongchoicemadeearliermaylaterpreventusfromaddinganedge,even if the graph is planar. For example, in Fig. 11-13(a), suppose that thestartingsubgraphgwasthecircuit{e1,e2,e3,e4,e5}.Thenweaddedgese6,e7,e8,ande9,withoutanycrossover.Nowwefindthatthelastedgee10cannotbeaddedwithout a crossing. From thiswemight erroneously conclude thatG isnonplanar.Ontheotherhand,hadweselectedadifferentfaceforplacingvertexv,wewouldhaveobtainedaplanarrepresentation,asshowninFig.11-13(b).

Fig.11-13Twomappingsofagraph.

This essentially is the problem in themap-constructionmethod of planaritytesting,anddifferentprocedureshavebeendevisedtosolveit.

PreliminarySimplification:Aspointedout inSection5-5,anarbitrarygraphcan, in general, be reduced to a much smaller graph if subjected to certainsimplifyingsteps.Thesestepsdonotaffecttheplanarity(orthenonplanarity)ofagraph.

1. Apply Algorithm 1 to check for connectedness. If the graph isdisconnected,consideronlyonecomponentatatime.

2. Remove all self-loops, and replace each set of parallel edges by a singleedge.

3. Eliminateeveryvertexofdegreetwobymergingthetwoedgesincidentonthe vertex.Apply steps 2 and 3 alternately and repeatedly, till the graphcannotbereducedanyfurther.

Page 376: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

4. Apply Algorithm 4 to partition the graph into its blocks (i.e., maxima!nonseparablesubgraphs).

5. Subject each block to reduction steps 3 and 2 alternately till no furtherreductionispossible.

6. Eachsimplifiedblockthusobtained,witheedgesandnvertices,istestedfor

Ifanyofthesethreeinequalitiesisnotsatisfied,ourjobisfinished,andwemoveontothenextblock.Everygraphwithn<5ore<9isplanar,andeverysimplegraphwithe>3n−6isnonplanar.

One planarity testing algorithmdue toBruno,Steiglitz, andWeinberg [5-2]goesastepfurtherinsimplification.Eachnonseparablegraphisfurtherbrokendown into its maximum 3-connected subgraphs (called 3-connectedcomponents).Thenthefollowingresult,duetoW.T.Tutte,isused:Agraphisplanar if and only if all of its 3-connected components are planar. Thisalgorithm,however,isnotasefficientastheoneduetoHopcroftandTarjan[11-31],whichwillbedescribednext.

Description of the Algorithm: The planarity-testing algorithm is quiteinvolved.We shall sketch only its essential features. To understand the mainalgorithm, let us consider the following decomposition procedure applied to agivensimple,nonseparablegraphGwithnverticesandeedges:

Circuit-PathDecomposition:Step1:FindsomecircuitKinG.Setg←K.Labeltheverticesandedgesof

gasv1v2,...,ande1,e2,...,respectively.Seti←1.Step2:IfthereisanunlabelededgeinG,findapathpi,thatbeginsandends

at labeledverticesbutconsistsonlyofunlabelededges.Storepi. If there isnounlabelededgeleftinG,gotostep4.Step3:Setg←g⋃piSeti←i+1.Labeltheunlabelededgesandvertices

ing.Returntostep2.Step4:Stop.Printg,p1,p2...,pm.It can be shown ([5-8]) that the procedure just outlined decomposes the

Page 377: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

simple, nonseparable graphG into one circuit andm = e −n paths. Since thecircuitmay be looked upon as two edge-disjoint paths,G is thus decomposedintoe−n+2paths. Itmaybenoted thatalthoughsuchadecompositionofagraphGmaynotbeunique,thenumberofpathsintowhichGisdecomposedisconstant and equals one circuit and e − n paths. For example, in Fig. 11-13considertwodistinctdecompositions,eachwithonecircuitandfour(10−6=4)paths:

{e1,e2,e3,e4,e5},{e6},{e10},{e7,e9},{e8},

and

{e1,e2,e3,e4,e5},{e7,e5},{e9},{e6},{e10}.

In thiscircuit-pathdecomposition,wecanmap thecircuitkonaplane,andcontinue toaddnewpathsp1,p2,.. .,as theyaregenerated.Anewpathpiwilleitherdivideanexistingfaceintotwonewfaces,orwillmakeg⋃pnonplanar,whenaddedtotheplanarmapg.Thismethodofarbitrarilyaddingpathsastheyare generatedmay lead to a situation shown in Fig. 11-13,which has alreadybeendiscussed.Tosolvethisproblem,onecaneither

1. Continueaddingpathstillnopathcanbeadded.Thenbacktracktoexplorethealternativechoiceshecouldhavemadeearlier,or

2. Continue to lookatdifferentpathsbutnotadd them toK, till it is foundwhich face a pathmust be placed in, or it is ascertained that it does notmatterwhichfacethepathisplacedin.

Somealgorithms(see[11-53])useapproach1,butHopcroftandTarjan[11-31]haveusedapproach2andhaveshownthattheiralgorithmismoreefficientbecauseofit.Theyuselistprocessingandhaveanelaborateprogram(985linesofALGOL).Thegistoftheirtechniqueofresolvingambiguityinaddingpaths,isasfollows:Suppose that at any stagewe have a path pi (on top of a pushdown list of

paths)whoseambiguitywearetryingtoresolve.Letaandbbetheendverticesofpi.TheflowchartinFig.11-14showsthedifferentcasesthatmayariseandwhatactionistakenforeach.ThesestepsareexplainedbymeansofFig.11-15.InFig.11-15(a)pathpi,canbeswiveledatverticesaandb,andthereforecan

divideeithertheface“above”or“below”thepathpj.Thisambiguityofpathpi

Page 378: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

mustberesolved.Toresolvethisambiguity,startingfromsomevertexxonpathpianewpathpk isconstructed.(Thepathpkconsistsofunlabelededgesanditterminatesassoonasittouchesalabeledvertex.)Ifbothendverticesxandyofpkareonpathpi,asshowninFig.11-15(b),pk

canbeswiveledatverticesxandyandthusdivideseitherofthetwofaces−one“above“ pi and the other “below.” Thus not only did we not resolve theambiguityinplacementofpathpi,butwehaveanewpathpkwhoseambiguitymust be resolved first. Path pk is put above pi in the stack, and we beginresolvingitsambiguityjustasweweredoingforpi.Anotherpossibilityisthattheendvertexyisneitheronpathpinoronpjbut

onadifferentpath,asshowninFig.11-15(c).Inthiscasepicannotbeswiveled,andthereforethereisnoambiguityastowhichfacepi.dividesAsinFig.11-15(d), ifpathpi.endsonavertexinpathpj.betweenaandb,

thenpi. (togetherwithpk) can still be swiveled abouta andb. Therefore, theambiguity in pi remains. The path pk, however, divides the face a x b y aunambiguously.Therefore,weshallhavetogenerateanotherpathfromavertexonpi.forresolvingambiguityintheplacementofpi.Finallyinthecasewherepathpkendsonavertexonpjbutnotbetweenaand

b, we have the situation shown in Fig. 11-15(e). The path pi. can still beswiveled.But,unlikeFig.11-15(b),thereisnoambiguityinpathpkwithrespecttopi.Therefore, anewpathmustbegenerated to resolveambiguity inpi, andthatpathcanbegeneratedstartingfromanyvertexinpathyaxb,whichispathpiextendeduptovertexyonpj.Insummary,theplanarityalgorithmconsistsofroutines(a)forfindingblocks

(i.e.,maximalnonseparablesubgraphs),(b)forpartitioningeachblock

Page 379: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.11-14Resolutionofambiguityofpathpi.

Page 380: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.11-15Resolutionofambiguityofpathpi.

Thusthetheoreticaltimeboundfortheentirealgorithmisproportionaltonlogn. (Because of Euler’s equation e is proportional to n, in graphs subjected toplanarityalgorithm.)ThisalgorithmhassubsequentlybeenimprovedandwasreportedinTarjan’s

Ph.D.Thesis[11-61].Thetimetakenbytheimprovedversionisproportionaltojust n. A somewhat simplified form of the improved version appeared as aCornellUniversitytechnicalreport[11-61].

11-7.ALGORITHM9:ISOMORPHISM

Page 381: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Thegraph isomorphismproblem is todetermine if thereexists aone-toonecorrespondencebetweentheverticesoftwographsG1andG2thatpreservestheadjacencyofvertices.Theproblemofgraphisomorphismarisesinmanyfields,such as chemistry, switching theory, information retrieval, and linguistics.Consequently, the isomorphism problem has been studied extensively. For asurveyandreferences,seeCorneil’sPh.D.thesis[11-9],and[11-12].Theoretically,itisalwayspossibletodeterminewhetherornottwographsG1

andG2 are isomorphic by keepingG1 fixed and reordering vertices ofG2 tocheckiftheiradjacencymatricesbecomeidentical.Thisprocessmayrequirealln! reordering and comparisons, n being the number of vertices. Such aninefficientprocedure, inwhich the running timegrowsfactoriallywithn, isoflimited use for practical problems. An algorithm guaranteeing a solution inrunning time proportional to a constant power of n is desirable, but no suchalgorithm has been discovered for determining if two arbitrary graphs areisomorphic.†There are, however, efficient isomorphism algorithms available for certain

typesofgraphs.Someoftheseare

1. Isomorphismintrees:[11-9],pagesV-44-V-52.

2. Isomorphisminplanargraphs:[11-32].

3. Isomorphism in graphs containing no k-strongly regular subgraphs forlargek:see[11-9]fordefinitionofak-stronglyregulargraph.

4. Isomorphisminpartiallylabeledgraphswithspecialstructure:[11-59]and[11-64].(SeealsoChapter15inthisbook.)

HeuristicProcedure

IftwogivengraphsGlandG2arearbitrary,theusualapproachisfirsttotrytoshowifG1andG2arenot isomorphic.Thisisdonebyaskingquestionsofthefollowingtype:

1. DoG1andG2havethesamenumberofvertices?

2. DoG1andG2havethesamenumberofedges?

3. Isthenumberofverticesniwithdegreeithesameinboth,fori=1,2,...?

4. Dobothgraphshavethesamenumberofcomponents?

Page 382: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

5. Foreachcomponentarequestions1,2,and3answeredintheaffirmative?

6. Arethecharacteristicpolynomials†oftheiradjacencymatricesX(G1)andX(G2)thesame(takeninthefieldofrealnumbers)?

Andsoon.Clearly, if the answer to any of these questions is no, G1 and G2 arenonisomorphic.Ayesanswer,however,doesnotguaranteeanisomorphism.An invariant of a graph G is a number that is the same for all graphs

isomorphictoG.Someexamplesofinvariantsarenumberofverticesn,numberof edges e, rank R, nullity μ, number of components p, connectivity, andcoefficientsinthecharacteristicpolynomialoftheadjacencymatrix.Acompletesetof invariants isa setof invariants thatcompletelydescribesagraphwithinisomorphism.Theproblemofgraphisomorphismissolvedifwecanfindacompletesetof

invariantsforG1andG2andthenchecktoseeiftheyareidentical.Theproblemoffindingacompletesetofinvariantscanalsobethoughtofas

thecodingofagraph. Ifwecouldfindacompletesetof invariants,wewouldplace them in a sequence. This sequence would contain all the essentialinformationaboutagraph.Twographswouldbeisomorphicifandonlyiftheircodes were the same. The problem of coding trees and some other types ofgraphshasbeensolved,[11-54],[11-66].Butthereexistsnomethodofcodinganarbitrarygraphwithalargenumberofvertices.Numerousheuristicprocedureshavebeenproposed(andprogrammed)based

on the idea that if you computemany invariants, and if they are the same forbothG1andG2,itislikelythatG1andG2areisomorphic.Heuristicapproachesworkwell for graphs of small orders. For example, it can be shown that twosimple, connected graphs with n ⩽ 7 which have affirmative answers forquestions 3 and 6 are isomorphic.But these heuristic algorithms fail for largearbitrarygraphs.Sometimes heuristic procedures are also used for simplifying the last-resort

method involving vertex-by-vertex correspondence between G1 and G2. Forexample,thenumberofcomparisonscanalwaysbereducedfromn!to

where

Page 383: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

This is because in reordering the vertices in G2 it suffices to permute onlyverticeswiththesamedegree.Foragraphthatdoesnothavealargepercentageofitsverticeswiththesamedegree,thenumber∑ni!ismuchsmallerthann!.

11-8.OTHERGRAPH-THEORETICALGORITHMS

Thealgorithmsdescribedsofar,althoughveryimportantandbasic,areonlyafew samples out of scores of graph-theoretic algorithms available in theliterature.Obviously, it is not possible to include them all. Some of the othercommonlyusedalgorithmsforgraphsare

1. Findallfragments(i.e.,maximalstronglyconnectedsubgraphs)inagivendigraphG[11-61].

2. FindaHamiltonianpath(ifthereisone)inagivenundirectedgraph.See[11-49].

3. Find all directed Hamiltonian circuits in a given digraph. See [11-13],pages35-37.

4. Findamaximalcompletesubgraph(clique)inagivengraphG.See[11-1]and[11-44].

5. Findamaximalmatchinginabipartitegraph.Analgorithm,knownastheHungarianmethod,isoftenusedforsolvingthisassignmentproblem.TheHungarianmethodisavailableasastandardsubroutineinmostoperationsresearch computer program packages. See [9-4], pages 265-269. ThecomputationtimefortheHungarianmethod,foragraphofnverticesandeedges,isproportionaltoe·n.Recentlyamoreefficientalgorithmhasbeenproposed by Hopcroft and Karp [11-30]; it takes time proportional to

.

6. Given a connected weighted digraphG in which the weight of an edgerepresentsthemaximumrateofflowthroughthatedge,findthemaximumpossible flow fromavertexx to another vertexy inG.This is thewell-known maximum-flow problem and is solved by the Ford-Fulkersonalgorithm (discussed in Sections 4-6 and 14-1). The Ford-Fulkersonalgorithmisalsoastandardprograminoperationsresearch.See[9-4].For

Page 384: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

amorerecentandimprovedalgorithmseeEdmondsandKarp[11-19].

7. Findthechromaticnumberofagivengraph.See[11-26].

8. Givenanacyclicdigraph,performatopologicalsortingofitsvertices.SeeSection14-8fordefinition,analgorithm,andreferences.

9. Given a connected weighted graph G, partition the vertices of G intosubsets no larger than a given size so as tominimize the totalweight ofedgescut in theprocess.Foraheuristicalgorithmtosolve this importantbutdifficultproblem,see[11-36].Also,see[11-35].

10. Given a connected weighted graph G, find a Hamiltonian circuit withsmallest weight. This is the traveling-salesman problem, for which nosatisfactorysolutionhasbeenfoundsofar.Forheuristicalgorithmssee[2-1].

11. InagivengraphG=(V,E),findasmallestsubset(i.e.,subsetofminimumcardinality)ofedgesE'⊆EsuchthateveryvertexofG is incidentonatleastoneof theedges inE'.Thisproblemof findinga smallest coveringwasdiscussedinSection8-5.See[11-18]foranefficientalgorithm.

12. InagivengraphG=(V,E),findasmallestsubsetofverticesVsuchthateveryvertexofGnotincludedinVisadjacenttoatleastonevertexinV.ThisproblemoffindingasmallestdominatingsetwasdiscussedinSection8-2.Superficiallysimilarto11,thisproblemismuchmoredifficult.

13. InagivendigraphG,findasmallestsetofedgeswhichwhendeletedfromGwoulddestroyalldirectedcircuits.Amethodof finding thisminimumdecyclizationedgeset (orfeedbackareset)wasoutlined inSection9-11,but the computation time grew exponentially with n, the number ofvertices.

14. Inthepreviousprobleminsteadoffindingasmallestsetofedgeswenowwish to find a smallest set of vertices inG whose removal destroys alldirectedcircuitsinG.Justasfor13noefficientalgorithmisknownforthisproblem.

15. GivenaconnectedweightedgraphG=(K,E),andasubsetV'ofV.FindaminimaltreeinGwhichspanstheverticesinV'(andpossiblysomemore).Suchatree,knownasaSteinertree,ismuchmoredifficulttoobtainthanaminimal spanning tree for G. The difficulty arises from the fact thatinclusionofextraverticesmayleadtoadifferenttreewithasmallertotalweight. Although no efficient algorithm has been found for an exactsolution of this problem, an approximate solution can be obtained by anefficientalgorithmgivenbyS.K.Chang(in“TheGenerationofMinimal

Page 385: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Treeswith a SteinerTopology,“ J. ACM,Vol. 19,No. 4,October 1972,699-711).

11-9.PERFORMANCEOFGRAPH-THEORETICALGORITHMS

Asobserved inSection 11-7, for a given graph-theory problem itwould bedesirabletohaveanalgorithmwhichguaranteesasolutioninanexecutiontimeproportionaltosomeconstantpowerofnore(asusual,nandearethenumberof vertices and edges, respectively, in the given graph). In other words, theexecutiontimet(fortheworstpossiblegraph)canbeexpressedas

t≦αnk or t≦ßeq,

and the lower the value of k and q the better. Such an algorithm (whosecomputationtimeisboundedbyapolynomial innore) iscalledapolynomialboundedalgorithm.Forexample,Algorithm1(connectednessandcomponents)is polynomial-bounded, since k = 2. Algorithms 2, 3, 4, 6, 7, and 8 are alsopolynomial-bounded, but Algorithms 5 and 9 are not. Some importantpolynomial-bounded graph-theoretic algorithms along with their bounds andrelevantreferencesareshowninTable11-1.Notethatsinceforasimplegraphe≦n(n—l)/2≦n2/2,boundsintermsofeandnareconvertibleintoeachother.It should also be kept inmind that different algorithms bounded by the samepower of nmay take very different amounts of actual computer time (for thesamegraph)becauseoftheirdifferentmultiplicativeconstants.

Problems Run-TimeBounds RelevantReferencesConnectednessandcomponents n2ore [11-29],[11-61]Spanningtree e [11-58]Minimalspanningtree n2 [11-22],[11-70]Fundamentalcircuit-set nv,2≦v≦3 [11-47]Cut-verticesandblocks n2ore [11-48],[11-61]Bridges n2ore [11-10],[11-61]Shortestpathbetweentwovertices n2 [11-16],[11-73]Shortestpathsbetweenallvertex-pairs n3 [11-21],[11-73]

Page 386: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Transitiveclosure nα2<α<3 [11-45]Strongconnectednessandfragments n2ore [11-29],[11-61]Planarity e [11-62]Topologicalsorting e [11-39]Maximalmatchinginabipartitegraph n5/2 [11-30]Minimalcut nβ2<β<3 [11-19]Minimaledgecover n3 [11-18],[11-46]

Table11-1Polynomial-BoundedAlgorithms

Ontheotherhand, therearegraph-theoreticproblemsforwhich it issimplynot possible to have a polynomial-bounded algorithm. Take, for example, theproblem of generating all spanning trees of a given graph, as discussed inSection11-4.Thenumberofspanningtreesinann-vertexsimple,labeledgraphcanbeashighasnn-2.Therefore,ifeachspanningtreeweregeneratedincunitsoftime,thealgorithmtogenerateallspanningtreeswouldconsumec·nn-2unitsoftime.Thusnopolynomial-boundedalgorithmcanbefoundforthisproblem.Similar arguments hold for problems of generating all cliques, allcircuits/directedcircuits,allpaths,allcut-sets,andsoforth,foragivengraph.There is a third category of graph-theoretic problems, for which so far no

polynomial-boundedalgorithmshavebeendiscovered,norhas itbeenpossibleto show that polynomial-bounded algorithms do not exist for these problems.Detectionofisomorphism(Algorithm9)isonesuchproblem.AlistofimportantproblemsofthistypeisgiveninTable11-2.Thecomputationtimeforsolvingthese problems (using the best available algorithm at present, and the worstpossiblegraph)growsexponentiallyorfactorially(butnotpolynomially)withn.Such inefficient algorithms are obviously of very limited use for practicalproblems.Heuristictechniquesarethemainstayoftheirsolutions.BasedonaremarkableresultofStephenCook(1971),RichardKarp[11-34]

showedthefollowingsurprisingresult:Exceptfortheisomorphismproblem,allother problems in Table 11-2 are polynomially equivalent, that is, if apolynomial-bounded algorithm exists for one, polynomial-bounded algorithmscanbefoundfortheothers.Theproofofthisequivalenceisinvolvedandisnotveryrelevantforushere.(TheCook-Karpclassofproblemsincludesanumberofothercombinatorialandgraph-theoreticproblemsinadditiontothetopnineinTable11-2.)

Problems RelevantReferences

Page 387: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Problems RelevantReferencesChromaticnumber [11-26],[11-41]Smallestdominatingset [11-44]Maximalclique [11-20]Hamiltoniancircuit [11-56]Directedhamiltoniancircuit [11-56]Travelingsalesmanproblem [11-28]Minimalfeedbackedge-set [9-6]Minimalfeedbackvertexset [9-6]Steinertree ChanginSection11-8Isomorphism [11-9],[11-12],[11-64]

Table11-2NonpolynomialAlgorithms

11-10.GRAPH-THEORETICCOMPUTERLANGUAGES

The increasing interest in graph-theoretic computations has led to thedevelopmentofseveralprogramminglanguagesforthesolepurposeofhandlinggraphs. Themajor goal of such a language is to enable the user to formulateoperations on graphs in a compact and natural manner, as if he werecommunicatingwithanothergraphtheorist.Forexample,inonesuchlanguage[11-37], the statement SPANTREE @ G would call the subroutine for aspanningtreeandwouldfindaspanningtreeofthegraphG.AnotherstatementIF (G, PLANAR) 17, 3would transfer control to statement 17 ifG is planar,otherwisetostatement3.Once such a language is developed and implemented, its advantages are

enormous.Itmakes thewritingofgraph-theoryprogramseasyandcompact. Itfreestheuserfromhavingtoconcernhimselfwithmanyunnecessarydetailsandallows him to concentrate on the essential features of his program. Thedisadvantageof sucha language, asof all special-purpose languages, is that ittakes a great deal of time, trouble, and expense to develop such a language,whichcanbeusedonlyforthepurposeofwritingprogramsingraphtheory.Forsuchagraph-theoreticcomputerlanguagetobeusefultomanyusers,with

different problems ingraph theory, the languagemust have a largenumberofprimitives (i.e., basic graph-theoretic statements) such as “remove vertex k ofG”,“addanedgebetweenverticesxandy”,or“findtheshortestdistancefrom

Page 388: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

vertexutovertexvinG”.Moreover,thegraph-theoreticlanguagemusthaveallthecomputingfacilitiesofanexistingsymboliclanguagesuchasFORTRAN,sothattheprogrammercanperformfunctionswhicharenotcoveredbyprimitives.Since there is little tobegainedbydevelopinganentirelynew language fromscratch, all graph-theoretic languages available and being developed areextensionsofsomewell-knownprogramminglanguage.Somegraph-theoreticcomputerlanguagesavailableatpresentare

1. Graph-Theoretic Language (GTPL) at the University of West Indies,Jamaica[11-52],ItisanextensionofFORTRAN.

2. GraphAlgorithm Software Package (GASP) at theUniversity of Illinois[11-7].ItisanextensionofPL/1.

3. HINT at Michigan State University [11-27] is an extension of the list-processinglanguageLISP1.5.

4. GRASPE at the University of Houston, [11-23] and [11-51], is also anextensionofLISP1.5.

5. Directed Graph Processor (DIP) at Carnegie-Mellon University is anextensionofPL/1.(SeeareportbyTerryC.Gleason,1969.)

6. AnInteractiveGraphTheorySystemat theUniversityofPennsylvania isanextensionofFORTRAN[11-71].

7. Graphic Extended ALGOL (GEA) at Instituto di Elettrotecnica edElettronicadelPolitecnicodiMilano,ItalyisanextensionofALGOL:[11-13]and[11-14].

8. AMBIT/G, developedbyC.Christensen formanipulation of digraphs, isanextensionofAMBIT[11-57].

9. GIRL—GraphInformationRetrievalLanguage[11-4].10. FORTRAN Extended Graph Algorithmic Language (FGRAAL) at the

UniversityofMaryland[11-2].

The interested reader should consult the cited references for the details oftheselanguages.

SUMMARY

Computational aspects of graph theory were presented in this chapter. For

Page 389: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

anyoneinterestedinapplyinggraphtheorytosolvephysicalproblems(suchasflow problems, assignment problems, identification of a chemical compound,topological analysis of an electrical network, layout of aprinted-circuit board,etc.),itisessentialtobeabletoenlistthehelpofthedigitalcomputer.Withoutthehelpofhigh-speedelectroniccomputers,hecannothopetohandleagraphofasizegenerallyencounteredinsolvinganontrivialpracticalproblem.Acomputerthathasbeen“taught“elementarygraphtheory(suchas,findout

ifgraphGisseparable,orpickoutaspanningtreeinG)canbeofimmenseaideventoa“pure“graphtheorist.Itcan,forinstance,relievehimofthedrudgeryof finding graphs with special properties to serve as examples andcounterexamples.To be able to teach graph theory to a computer, onemust obviously know

both computer programming and graph theory. In addition, one must findefficient algorithms. The most important prerequisite of any useful graph-theoreticalgorithmisthattherunningtimeofitsprogramonthecomputermustnotrisefactoriallyorevenexponentiallywithn.Itshouldbeproportionaltonk,wherekissomefixednumber—preferablyalownumber.

REFERENCES

As yet, there is no one reference where all or most of the graph-theoreticalgorithmsare available.Eachalgorithmhas tobe lookedup individually in apublishedpaper,thesis,orreport.Consequently,thischaptercontainsalonglistof references. It is unlikely that any one studentwould be interested in all ofthem.For a general introduction to the nature of graph-theoretic computer

algorithms,twopapersofRead[11-52]and[11-53]arerecommended.Lehmer’spaper [11-40] is an excellent treatise on the use of computers for solvingcombinatorialproblems.Amongthefewbooksthatdodiscusssomeaspectsofusing computers to solve graph-theoretic problems are Even [11-20], Berztiss[11-5], Chapters 3, 6, and 8, Knuth [11-39], which is at an advanced level,Knoedel[11-38],whichisinGerman,andBellman,Cooke,andLockett[11-3].A related book on combinatorial computing by Wells [11-69] is alsorecommended.Itdevelopsandusesaspecialprogramminglanguagedevelopedforcombinatorialapplications.11-1. AUGUSTON, J. G., and J. MINKER, “An Analysis of Some Graph-

TheoreticalClusterTechniques,”J.ACM,Vol. 17,No.4,1970,571-588.(Correction:J.ACM,Vol.19,April1972,244-247).

Page 390: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

11-2. BASILI, V. R., C.K.Mesztenyi, andW.C. Reinboldt, “FGRAAL: FortranExtended Graph Algorithmic Language,” University of Maryland,ComputerScienceCenterReportTR-179,March1972.SeealsoReportTR-225,January1973onimplementationofFGRAAL.

11-3. BELLMAN,R.,K.L.COOKEandJ.A.LOCKETT,Algorithms,GraphsandComputers,AcademicPress,Inc.,NewYork,1970.

11-4. BERKOWITZ, S., “GIRL—Graph Information Retrieval Language—Design of Syntax,” in Software Engineering, Vol. 2 (J. T. Tou, ed.),AcademicPress,Inc.,NewYork,1971,119-139.

11-5. BERZTISS,A.T.,DataStructures;TheoryandPractice,AcademicPress,Inc.,NewYork,1971.

11-6. BOOTHROYD, J.,“Algorithm23 :ShortestPathBetweenStartNodeandAllOtherNodesofaNetwork,”TheComputerJournal,Vol.10,No.3,Nov.1967,307-308.AlsoseeAlgorithm22.

11-7. CHASE,S.M.,“GASP—GraphAlgorithmSoftwarePackage,”QuarterlyTechnical Progress Report, Oct., Nov., Dec. 1969, Department ofComputerScience,UniversityofIllinois,Urbana.

11-8. CHASE,S.M.,“AnalysisofAlgorithmsforFindingAllSpanningTreesof a Graph,” Report No. 401, Department of Computer Science,UniversityofIllinois,Urbana,Oct.1970.

11-9. CORNEIL, D. G., “Graph Isomorphism,” Ph.D. Thesis, Department ofComputer Science, University of Toronto, Toronto, Canada, 1968.UpdatedversionTech.Rep.No.18,April1970.

11-10. CORNEIL, D. G., “An n2 Algorithm for Determining the Bridges of aGraph,”InformationProcessingLetters,Vol.1,No.2,1971,51-55.

11-11. CORNEIL, D. G., “An Algorithm for Determining the AutomorphismPartitioning of anUndirectedGraph,”BIT,Vol. 12,No. 2, 1972, 161-171.

11-12. CORNEIL,D.G.,andC.C.GOTLIEB,“AnEfficientAlgorithmforGraphIsomorphism,”J.ACM,Vol.17,No.1,Jan.1970,51-64.

11-13. CRESPI-REGHIZZI, S., and R. MORPURGO, “A Graph-Theory OrientedExtensiontoAlgol,”Calcolo,Vol.5,No.4,1968,1-43.

11-14. CRESPI-REGHIZZI, S., and R. MORPURGO, “A Language for TreatingGraphs,”Comm.ACM,Vol.13,No.5,May1970,319-323.

11-15. DANTZIG,G.B., “All Shortest Routes in aGraph,”Proceedings of theInternationalSymposiumonGraphTheory,Rome,Italy,July1966,91-92.PublishedbyDunodEditeur,Paris.

11-16. DIJKSTRA, E. W., “A Note on Two Problems in Connection withGraphs,”NumerischeMath,Vol.1,1959,269-271.

Page 391: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

11-17. DREYFUS, S. E., “AnAppraisal of Some Shortest-Path Algorithms,” J.OperationsResearch,Vol.17,No.3,1969,395-412.

11-18. EDMONDS, J., “Paths, Trees, and Flowers,”Canadian J. ofMath.,Vol.17,1965,449-467.

11-19. EDMONDS, J., and R. M. KARP, “Theoretical Improvements inAlgorithmic Efficiency for Network Flow Problems,” J.ACM, Vol. 9,No.2,April1972,248-264.

11-20. EVEN, S., Algorithmic Combinatorics, The Macmillan Company, NewYork,1973.

11-21. FLOYD, R. W., “Algorithm 97: Shortest Path,” Comm. ACM, Vol. 5,1962,345.

11-22. FRAZER, W. D., “Analysis of Combinatory Algorithms—A Sample ofCurrentMethodology,”Proc.AFIPS1972S.J.C.C.,483-491.

11-23. FRIEDMAN, D. P., D. C. DICKSON, J. J. FRASER, and T. W. PRATT,“GRASPE1.5—AGraphProcessorandItsApplication,”UniversityofHouston,ReportRS1-69,August,1969.

11-24. GIBBS, N. E., “A Cyclic Generation Algorithm for Finite UndirectedLinearGraphs,”J.ACM,Vol.16,No.4,Oct.1969,564-568.

11-25. GOTLIEB, C. C, and D. G. CORNEIL, “Algorithms for Finding aFundamental Set of Cycles for an Undirected Linear Graph,” Comm.ACM,Vol.10,No.12,Dec.1967,780-783.

11-26. GRAHAM,G.D.,“AnAlgorithmtoDeterminetheChromaticNumberofaGraph,” Technical ReportNo. 47,Department of Computer Science,UniversityofToronto,Canada,Nov.1972.

11-27. HART, R., “HINT: A Graph Processing Language,” Research Report,Computer Institute for Social Science Research, Michigan StateUniversity,EastLansing,Feb.1969.

11-28. HELD, M. and R. M. KARP, “The Traveling-Salesman Problem andMinimum Spanning Trees: Part II,”Mathematical Programming, Vol.1,1971,North-HollandPublishingCompany,6-25.

11-29. HOLT, R. C, and E. M. REINGOLD, “On the Time Required to DetectCyclesandConnectivityinGraphs,”MathematicalSystemsTheory,Vol.6,No.2,1972,103-106.

11-30. HOPCROFT, J. E., and R. M. Karp, “A n5/2. Algorithm for MaximumMatchings in Bipartite Graphs,” IEEE Conf. Record of the TwelfthAnnualSymp.onSwitchingandAutomataTheory,1971,122-125.

11-31. HOPCROFT, J. E., andR. TARJAN, “PlanarityTesting inVlogVSteps,”Computer Science Technical Report No. 201, Stanford University,Stanford, Calif.,March 1971.Also inProc. IFIPCongress, Ljubljana,

Page 392: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

BookletTa-2,August1971,18-23.11-32. HOPCROFT,J.E.andR.E.TARJAN,“IsomorphismofPlanarGraphs,”in

ComplexityofComputerComputation,(R.E.MillerandJ.W.Thatcher,eds.)PlenumPress,NewYork,1972,131-152.

11-33. Hu,T.C,andW.T.TORRES,“ShortcutinDecompositionAlgorithmforShortestPaths inaNetwork,” IBMJ.ofRes.Develop.,Vol.13,No.4,July1969,387-390.

11-34. KARP, R. M., “Reducibility Among Combinatorial Problems,” inComplexityofComputerComputation,(R.E.MillerandJ.W.Thatcher,eds.)PlenumPress,NewYork,1972,85-103.

11-35. KERNIGHAN,B.W.,“OptimalSequentialPartitionsofGraphs,”J.ACM,Vol.18,No.1,1971,34-40.

11-36. KERNIGHAN, B.W., and S. LIN, “An Efficient Heuristic Procedure forPartitioningGraphs,”BellSystemTech.J.,Vol.49,Feb.1970,291-307.

11-37. KING, C. A., “A Graph-Theoretic Programming Language,” inGraphTheoryandComputing, (R.C.Read,ed.),AcademicPress,NewYork,1972,63-74.SeealsoKing’sdoctoralthesis,UniversityofWestIndies,1970.

11-38. KNOEDEL,W.,GraphentheoretischeMethoden und ihre Anwendungen,Springer-Verlag,Berlin,1969.

11-39. KNUTH,D.E.,TheArtofComputerProgramming,Vol.1,FundamentalAlgorithms,Addison-WesleyPublishingCompany,Inc.,Reading,Mass.,1968.

11-40. LEHMER,D.H.,“TeachingCombinatorialTricks toaComputer,”Proc.Symp. Appl. Math., Vol. 10, Combinatorial Analysis, AmericanMathematicalSociety,1960,179-193.

11-41. MATULA, D. W., G. MARBLE, and J. D. ISAACSON, “Graph ColoringAlgorithms,” in Graph Theory and Computing (R. C. Read, ed.),AcademicPress,NewYork,1972,109-122.

11-42. MCILROY,M.D.“Algorithm354:GeneratorofSpanningTrees,”Comm.ACM,Vol.12,No.9,Sept.1969,511.

11-43. MINTY,G.J.,“ASimpleAlgorithmforListingAlltheTreesofaGraph,”IEEETrans.CircuitTheory,Vol.CT-12,No.1,March1965,120.

11-44. MULLIGAN, G. D., “Algorithms for Finding Cliques of a Graph,”TechnicalReportNo. 41,Department ofComputerScience,UniversityofToronto,Canada,May1972.

11-45. MUNRO, J. I., “Efficient Determination of the Transitive Closure of aDirectedGraph,”InformationProcessingLetters,Vol.1,1971,56-58.

11-46. NORMAN,R.Z.,andM.O.RABIN,“AnAlgorithmforaMinimalCover

Page 393: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

ofaGraph,”Proc.Amer.Math.Soc,Vol.10,1959,315-319.11-47. PATON,K.,“AnAlgorithmforFindingaFundamentalSetofCyclesofa

Graph,”Comm.ACM,Vol.12,No.9,Sept.1969,514-518.11-48. PATON, K., “An Algorithm for the Blocks and Cutnodes of a Graph,”

Comm.ACM,Vol.14,No.7,July1971,468-476.11-49. POHL, I., “AMethod for Finding Hamilton Paths and Knight’s Tour,”

Comm.ACM,Vol.10,No.7,July1967,446-449.11-50. PRABHAKER,M., “Analysis of Algorithms for Finding all Circuits of a

Graph,”Master’s Thesis, Department of Electrical Engineering, IndianInstituteofTechnology,Kanpur,India,August1972.

11-51. PRATT,T.W., andD.P.FRIEDMAN, “ALanguageExtension forGraphProcessing and Its Formal Semantics,” Comm. ACM, Vol. 14, No. 7,1971,460-467.

11-52. READ, R. C, “Teaching Graph Theory to a Computer,” in RecentProgressinCombinatorics(W.T.Tutte,ed.),AcademicPress,Inc.,NewYork,1969,161-173.

11-53. READ, R. C, “Graph Theory Algorithms,” in Graph Theory and ItsApplications(B.Harris,ed.),AcademicPress,Inc.,NewYork,1970,51-78.

11-54. READ, R. C, “The Coding of Various Kinds of Unlabeled Trees,” inGraphTheoryandComputing (R.C.Read, ed.)AcademicPress,NewYork,1972,153-182.

11-55. REINGOLD, E. M., “Establishing Lower Bounds on Algorithms—ASurvey,”Proc.AFIPS,S.J.C.C.,1972,471-481.

11-56. ROBERTS,S.M.,andB.FLORES,“SystematicGenerationofHamiltonianCircuits,”Comm.ACM,Vol.9,No.9,1966,690-694.

11-57. ROVNER, P.D., andD.A.HENDERSON, JR., “On the Implementation ofAMBIT/G: A Graphical Programming Language,” Proc. Intern. JointConf.onArtificialIntelligence,1969,9-20.

11-58. SEPPÄNEN,J.J.,“Algorithm399:SpanningTree,”Comm.ACM,Vol.13,No.10,1970,621-622.

11-59. SUSSENGUTH, E. H., JR., “A Graph Theoretic Algorithm for MatchingChemicalStructures,”J.Chem.Doc,Vol.5,No.1,Feb.1965,36-43.

11-60. TABOURIER,Y.,“AllShortestDistancesinaGraph.AnImprovementtoDantzig’s Inductive Algorithm,”Discrete Mathematics, Vol. 4, No. 1,Jan.1973,83-87.

11-61. TARJAN,R.,“Depth-FirstSearchandLinearGraphAlgorithms,”SIAMJ.ComputeVol.1,No.2,June1972,146-160.

11-62. TARJAN, R., “An Efficient Planarity Algorithm,” Computer Science

Page 394: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Department, Report No. CS-244-71, Stanford University, November1971. (A simplified version of this report was published as CornellUniversityComputerScienceTechnicalReportNo.TR73-165, inApril1973byHopcroftandTarjan.)

11-63. TIERNAN, J.C, “AnEfficientSearchAlgorithm toFind theElementaryCircuitsofaGraph,”Comm.ACM,Vol.13,No.12,Dec.1970,722-726.

11-64. UNGER,S.H.,“GIT—AHeuristicProgramforTestingPairsofDirectedLineGraphsforIsomorphism,”Comm.ACM,Vol.7,1964,26-34.

11-65. WARSHALL,S.,“ATheoremonBooleanMatrices,”J.ACM,Vol.9,Jan.1962,11-12.

11-66. WEINBERG, L., “A Simple and Efficient Algorithm for DeterminingIsomorphismofPlanarTriplyConnectedGraphs,” IEEETrans.CircuitTheory,Vol.CT-13,No.2,1966,142-148.

11-67. WEINBLATT, H., “A New Search Algorithm for Finding the SimpleCyclesofaFiniteDirectedGraph,”J.ACM,Vol.19,No.1,Jan.1972,43-56.

11-68. WELCH, J. T., JR., “AMechanical Analysis of the Cyclic Structure ofUndirected LinearGraphs,” J.ACM, Vol. 13,No. 2,April 1966, 205-210.

11-69. WELLS,M.B.,ElementsofCombinatorialComputing,PergamonPress,Inc.,Elmsford,N.Y.,1971.

11-70. WHITNEY,V.K.M.,“Algorithm422:MinimalSpanningTree,”Comm.ACM,Vol.15,No.4,April1972,273.

11-71. WOLFBERG,M.S.,“AnInteractiveGraphTheorySystem,”Ph.D.Thesis,TheMooreSchoolofElectricalEngineering,UniversityofPennsylvania,Philadelphia,1969.AlsoMooreSchoolReportNo.69-125.

11-72. YEN, J. Y., “Finding the K-Shortest Loopless Paths in a Network,”ManagementSci.,Vol.17,No.11,1971,712-716.

11-73. YEN, J. Y., “Finding the Lengths of all Shortest Paths in N-NodeNonnegative Distance Complete Network Using N3 Additions andN3Comparisons,”J.ACM,Vol.19,July1972,423-424.

PROBLEMS

11-1. Forstudyingthebehaviorofanalgorithm,randomgraphsareoftenused.Agraph is randomif itsedgesaredrawnat randomfrom thesetofalldistinct pairs of vertices. Write a subroutine for generating simple

Page 395: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

randomgraphsofagivennanddensity,wheredensityisdefinedastheratio2e/n(n—1)foradirectedgraphand2e/n(n—1)foranundirectedgraph. (Hint:Use an appropriate pseudorandom-number generator, andobtaintheadjacencymatrix.)

11-2. Writesubroutinesforconvertingthefollowinggraphrepresentations:(a) Adjacencymatrixtoincidencematrix.(b) Incidencematrixtoadjacencymatrix.(c) Adjacencymatrixtoedgelisting.(d) Edgelistingtosuccessorlisting.(e) Successorlistingtoadjacencymatrix.

11-3. WriteaprogramintheassemblylanguageofthemachineyoumayhavetopackagivenadjacencymatrixX(n,n).Assumethatthegivenmatrixusesfullwordsforeachentrywhetheritis0or1.

11-4. Write a FUNCTION subprogramAD J,whichwhen suppliedwith thesubscripts(i,j)givesthe(i,j)entryofthe(packed)adjacencymatrixasitsvalue.AssumethatthepackedadjacencymatrixisinaCOMMONarea.

11-5. Thealgorithmforconnectednessgiveninthetextmodifiestheadjacencymatrix.Howwillyourestoreit?(Hint:Observethatonlyonerowoftheadjacencymatrixisgettingchangedatatime.)

11-6. Analyzetodeterminewhenitwouldbeprofitabletodeterminethevertexofmaximum degree in each component before fusion in Algorithm 1.Assumethegraphisgivenintheformofanadjacencymatrix.

11-7. WillAlgorithm1 require anymodification to find the componentsof adigraph?Alsowriteaprogramforidentifyingallfragmentsofadigraph.

11-8. InAlgorithm3,afteranedge(z,p)hasbeenconsidereditisdeletedfromthegraph; that is, in adjacencymatrixXentriesxz,P andxP,Z aremadezero.WhatcouldbedoneifonewantedtoavoidmodifyingX?

11-9. Whileconsidering theedge (z,p) ifwefound thatpwasalready in thetree, we went ahead to discover the fundamental circuit. Let L =LEVEL(z)—LEVEL(p).ProvethatthefundamentalcircuitwillcontainallandonlyedgesonthepathoflengthLfromztotherootofthetree,apartfromthetwoedges(z,p)and(p,PRED(p)).

11-10. Use the following convention in drawing the tree developed byAlgorithm3.Drawthetreedownwardfromtheroot,andaddvertexpatdepthLEVEL(p)below the root.Whenvertexz isbeingexamined, theedges (z, p) are added from left to right. If z is the vertex underexamination,definethetrunkasthepathinthetreeTfromztotheroot.ThenshowthattheverticesinTfallintofourclasses:

Page 396: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

1. Vertexzthatisbeingexamined.2. Verticesbelowz—unexaminedandaddedduring theexaminationof

z.3. Vertices to the“leftof” the trunk—unexaminedandatadistanceof

onefromthetrunk.4. Verticesonand“totherightof”thetrunk—examined.

11-11. In Algorithm 4 let f1 be a fundamental circuit found while examiningvertexz1,andf2beafundamentalcircuitfoundlaterwhileexaminingz2.Iff1⋂f2≠ø,showthatthetreeedge(z1,PRED(z1))isinbothf1andf2.Isthiswhyitwasnotnecessarytolabelthechords?

11-12. InAlgorithm5suggestaquickwayoftestingwhetheravertexv,whichisbeingconsideredforextension,isalreadyinthepatharrayP.[Gettingeveryp(i)fori=1,...,k,wherekisthelengthofthepathbuiltsofar,and comparing with v is obviously bad.] Give a flow chart for thealgorithmincorporatingthis.

11-13. InAlgorithm6supposeyoususpect that thegraph isdisconnectedandthestartingandtheterminalvertexmaynotbein thesamecomponent.TheflowchartgiveninFig.worksforthiscasealso,butitisinefficient.Suggestamethodofspeedingup thedetection in thiscase. (Hint:Youwillhavetoaddatestboxatanappropriateplaceintheflowchart,ontheoutcomeofwhichyouwoulddecidewhetherornottocontinue.)

11-14. ModifyAlgorithm6sothatitlistsallshortestpathsfromstot.11-15. Giventheoptimal-policymatrixZasmentionedinAlgorithm7,writea

subroutinethatreturnstheshortestpath(i,...,j)foraspecifiediandj,asasequenceofvertexnumbers.

11-16. Write a program similar toAlgorithm 6 to obtain the longest distancefrom a vertex s to all vertices accessible from s in a given acyclicdigraph.

11-17. Algorithm7canalsobeusedfordetectingwhetherornotagivengraphisconnected.(An∞inmatrixDkrepresentsnonexistenceofapath.)Aspresented, the algorithm is inefficient for this purpose. RewriteAlgorithm7solelyforthepurposeofidentifyingvariouscomponentsina graph. (Hint:UseX rather thanD and logical operations rather thanarithmeticones.)CompareitsefficiencywiththatofAlgorithm1.

11-18. Giveanalgorithmtofindacut-setwithrespecttoagivenpairofverticesa,b.Assumethat thegraph isgiven in termsof itsF-H representation.YouareallowedtoscantheF-Harraysonlytwice.[Hint:Ifthereisno

Page 397: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

edge(a,b),addone.Choosetheedge(a,b).Shrinkanedgee inGnotparallel to (a, b) by fusing its end vertices. Some edges might nowbecomeparallel;continueshrinking.]

11-19. Given an edge e*, write an efficient algorithm to determine if e* is abridge.(Hint:Edgee*isabridgeifandonlyif{e*}isacut-set.UsetheresultofProblem11-18.)

11-20. Write a program for generating all spanning trees, based on Minty’smethoddescribedinSection

APPENDIXOFPROGRAMS

Program listings of some of the algorithms described are given in thefollowingpages.Program11-1iswritteninAPL\360;therestareinFORTRANIVintheformofsubroutines.Thevariablesinthesubroutinesaredimensionedsuchthatagraphwithnomorethan100verticescanbegivenasinput.

Program11-1:ConnectednessandComponents

X AdjacencymatrixofgN

Page 398: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

NNumberofverticesinG

C Labelofacomponent1 VertexwithmaximumdegreeingVA IthrowofXVN LogicalcomplementofVAR ListofverticesingNA Verticesnotadjacentto1SL Relabeledlistofverticesing

Program11-2:SpanningTree/Forest

SUBROUTINESPTREE(F,H,N.E,EDGE,C) INTEGERC,E,EDGE(E),F(E),H(E),VERTEX(100)V1,V2 DO4L=1,N4 VERTEX(L)=0 DO6L=1,E6 EDGE(L)=0 C=0 M=0 K=010 K=K+1 V1=F(K) I=VERTEX(V1) IF(I.EQ.0)GOTO39 V2=H(K) J=VERTEX(V2) IF(J.EQ.0)GOTO36 IF(I-J)21,50,1818 IJI=J J=I I=IJI21 DO26L=1,N

Page 399: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

21 DO26L=1,N IF(VERTEX(L)-J)26,23,2523 VERTEX(L)=I GOTO2625 VERTEX(L)=VERTEX(L)-126 CONTINUE DO32L=1,E IF(EDGE(L)-J)32,29,3129 EDGE(L)=I GOTO3231 EDGE(L)=EDGE(L)-132 CONTINUE C=C-1 EDGE(K)=I GOTO4936 EDGE(K)=1 VERTEX(V2)=1 GOTO4939 V2=H(K) J=VERTEX(V2) IF(J.EQ.0)GOTO45 EDGE(K)=J VERTEX(V1)=J GOTO4945 C=C+1 EDGE(K)=C VERTEX(V1)=C VERTEX(V2)=C49 M=M+150 IF(M.EQ.(N-1).OR.K.EQ.E)RETURN GOTO10 END

Page 400: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Program11-3:FundamentalCircuits

SUBROUTINEFCRKTS(X,N,NULTY) INTEGERCIRKIT(100),LEVEL(100),P,PRED(100),PREDOP 1,TW(100),X(N,N),Z NULTY=0 DO5L=1,N

5 LEVEL(L)=-1 NROOT=1

7 ITW=1 TW(1)=NROOT LEVEL(NROOT)=010 IF(ITW.EQ.0)GOTO38

Z-TW(ITW) LVLSUC=LEVEL(Z)+1 DO35P=1,N IF(X(Z.P))35,35,1515 IF(LEVEL(P)+1.NE.0)GOTO21

TW(ITW)=P ITW=ITW+1 PRED(P)=Z LEVEL(P)=LVLSUC GOTO3321 NULTY=NULTY+1

PREDOP=PRED(P) M=1 CIRKIT(1)=Z J=Z26 J=PRED(J)

M=M+1CIRKIT(M)=J

Page 401: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

CIRKIT(M)=J

IF(J.NE.PREDOP)GOTO26 M=M+1 CIRKIT(M)=P PRINT1000,NULTY.(CIRKIT(J),J=1,M),CIRKIT(1)33 X(Z,P)=0

X(P,Z)=035 CONTINUE

ITW=ITW-1 GOTO1038 DO39NROOT=NROOT,N39 IF(LEVEL(NROOT).EQ.(-1))GOTO740 RETURN

1000 FORMAT(4HTHEI4,24HFUNDAMENTALCIRCUITIS(20I4))END

Program11-4:ShortestDistancefromstot

SUBROUTINEDYSTRA(D,N,S,T,LABELT)c c 9999999ISOURINFINITYc DIMENSIONLABEL(100) INTEGERD(N,N),P,S,T,VECT(100),Z DO6L=1,N LABEL(L)=99999996 VECT(L)=0 LABEL(S)=0 VECT(S)=1 I=S10 M=9999999 DO18J=1,N

IF(VECT(J).EQ.1)GOTO18

Page 402: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

IF(VECT(J).EQ.1)GOTO18 Z=D(I,J)+LABEL(I) IF(Z.LT.LABEL(J))LABEL(J)=Z IF(LABEL(J).GT.M)GOTO18 M=LABEL(J) P=J18 CONTINUE VECT(P)=1 IF(P.EQ.T)GOTO23 I=P GOTO1023 LABELT=LABEL(T) RETURN END

Program11-5:ShortestPathBetweenEveryVertexPair

SUBROUTINEFLOYD(D,N)c c 9999999ISOURINFINITYc INTEGERD(N,N),S DATAINFNTY9999999 DO12K=1,N DO12I=1,N IF(D(I,K).EQ.INFNTY)GOTO12 DO11J=1,N IF(D(K,J).EQ.INFNTY)GOTO11 S=D(I,K)+D(K,J) IF(S.LT.D(I,J))D(U)=S11 CONTINUE12 CONTINUE

Page 403: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

12 CONTINUE RETURN END

†Amatrixthatcontainsmanyzeroelementsiscalledasparsematrix.Asparseadjacencymatriximpliesasmalle/nratio.†(Initiallythereisnotreeformed.Theveryfirstedge(f1,h1)consideredwillalwaysoccurinaspanningtree(orforest).Thusthespanningtree(orforest)generatedbythisalgorithmisverymuchdependentontheorderingoftheedges.†Thetimerequiredformergingtwopartialtrees(Ti,Tj)asimplementedintheFORTRANprogramisnotindependent of n. There are, however, very efficient set-merging algorithms available which almostaccomplishthis.†Apreliminarysimplificationistobeperformedonlyifitproducesanetsavinginrunningtime.†This labelingcanbeconvenientlyperformedusing theadjacencymatrixXandbywritingover it.Theedgebetweentheithandjthverticesislabeledq(q=2,3,...,e−n+1),simplybyreplacingxijandxjiwithq(xijonly,iftheuppertriangleisused).Entriesthatarestill1’scorrespondtounlabelededges.Otherswillhavelabels2,3,...,andsoon.†lfthegivendigraphisnotsimple,itcanbesimplifiedbydiscardingallself-loops,andreplacingeverysetofparalleledgesbytheshortest(least-weight)edgeamongthem.Also,thegraphneednotbedirected.Foranundirectedgraphdij—djiandeffectivelyeachundirectededgeisreplacedbytwooppositelydirectededgesofthesameweight.Ifthegraphisnotweighted,assumedij=1,andtheadjacencymatrixbecomesthedistancematrix.†Thereareproblemsforwhichonlyfactoriallyorexponentiallygrowingalgorithmsexist,andbetteronesmayneverbefound.Insuchcases,onedoeshavetolivewithaninefficientalgorithmanduseitforsmallgraphs.†It isnotdifficult toshowthat thecharacteristicpolynomial,det(X—λI), is independentof theorder inwhichtheverticesappearintheadjacencymatrixX.

Page 404: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

12GRAPHSINSWITCHINGANDCODINGTHEORY

Theemphasisinthepreviouschaptershasbeenonintroducingmoreconceptsofgraphtheory.Someapplicationsweregiven,butmainlytomaketheconceptsclearer.Intheremainingchaptersweshalldiscussindetailsomeapplications.InSection7-5wesawhowtheconfigurationofaswitchingnetworkinsidea

blackboxcouldbedeterminedwiththehelpofgraphtheory.Again,inSection8-5aminimalcoverofagraphledtotheminimizationofaswitchingfunction.Inthischaptergraphtheorywillbeappliedtostudyswitchingnetworksfurther.Switching theory came into being with the publication of Paul Ehrenfest’s

paper in1910, inwhichhesuggested thatBooleanalgebracouldbeapplied toautomatic telephone exchanges. The first mathematical formulation of thebehaviorofacontactnetwork(aparticulartypeofswitchingnetwork)wasgivenby C. Shannon in 1938. Since 1938, switching theory has developed rapidly.Originally, itwas intended to provide the communications engineerwith toolsfor analysis and synthesis of large-scale relay switching networks, such as atelephoneexchange.Inrecentyears,however,theenormousgrowthofswitchingtheoryhasbeenmainlymotivatedbyitsuseinthedesignofdigitalcomputers.Unlike thesignals inaclassicalelectricalnetwork (say, ina radio receiver),

switching network signals have only two values—designated as 0 and 1.Switchingnetworksaredesignedtoprocessandstoresuchbinarysignals.Aswitchingnetworkcanbeclassifiedaseitheracombinationalnetworkora

sequentialnetwork.Acombinationalswitchingnetworkisonewhoseoutputatagiven time depends only on the input at that time. A sequential switchingnetwork,ontheotherhand,isonewhoseoutputatagiventimeisafunctionofthe input at that time and during its entire past history. In other words, asequentialnetworkhasmemory,whereasacombinationalnetworkdoesnot.Alldigital systems, from the largest multimillion-dollar computer to the smallestdesk calculator, are constructed from these two basic types of circuitry—combinationalandsequential.Acombinationalswitchingnetworkcanfurtherbeclassifiedas(1)acontact

Page 405: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

network,or(2)agatenetwork(see[12-5],page77).Itisinthestudyofcontactnetworksthatgraphsappearasthemostnaturalrepresentationoftheswitchingnetwork,asweshallseeinthenextsection.Althoughattemptshavebeenmade,little has been accomplished by the use of graph theory in gate networks (seeSection9-3of[1-13]).Weshallthereforeconfineourselvestothecontact-typenetworksinthischapter.

12-1. CONTACTNETWORKS

A relay contact (or acontact, for brevity) canbe thought of as anordinaryhousehold switch used for controlling the light. It is a two-terminal devicehaving two states; in the open state there is no conductive path between theterminals; in the closed state there exists a path that will allow the electriccurrenttoflowineitherdirection.Thusacontactisabilateraldevice.Usually,acontactisrepresentedbyoneofthesymbolsshowninFig.12-1.

Fig.12-1Symbolsusedtorepresentaswitchorcontact.

Acontactnetworkisanetworkofinterconnectedcontacts(seeFig.12-2foranexample).Everycontactnetworkcanberepresentedbyagraph,inwhichtheedgesarethecontactsandtheverticesaretheterminals.Infact,forourpurpose,the following is the definition of a contact network: A contact network is anundirected, connected graphG (with no self-loops) inwhich each edge has abinaryvariablexiassociatedwithit,whichcanassumeonlytwovalues,1or0.Thebinaryvariablexiassignedtoacontactis1whenthecontactisclosedandis0whenthecontactisopen.The input-output behavior of a contact network is usually expressed in the

formoffunctions,

fi(x1,x2,...,xk),

of the binary variables. Such a function fi, is called a switching (or Boolean)function and must itself assume a value of 0 or 1. Boolean† (or switching)algebra,which is used in expressing andmanipulating switching functions, isdefinedasfollows:

Page 406: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

ABooleanalgebra(likeringsandfieldsinChapter6)consistsofafinitesetxl,x2,...,xkandtwobinaryoperations+(calledBooleanaddition)and•(calledBooleanmultiplication)satisfyingthefollowingpostulates:

1. Eitherxi=1orxi=0.

2. For every xi there exists another variable , called the complement of xi,suchthatifxi=0, =1,andifxi=1, =0.

With these simplepostulates anumberof interesting results canbederived,which are very useful in the simplification of switching expressions. Forexample,itcanbeeasilyshownthatxi+xixj=xi.In contact networks one encounters two types of problems—the problemof

analysisandtheproblemofsynthesis.InanalysiswearegivenacontactnetworkG and are asked to find conditions under which there will be an electricallyconductingpathbetweenapairofvertices(vi,vj)inG.Insynthesis,ontheotherhand,weareaskedtodesign(ascheaplyaspossible)anetworkthatcanmeetthegiven requirements.We shall dealwith the problem of analysis first and thenwiththatofsynthesis.

12-2. ANALYSISOFCONTACTNETWORKS

ConsideranytwoverticesinacontactnetworkG.SinceGisconnected,thereare oneormore paths between these twovertices.Eachof these paths canbeidentifiedby theBooleanproductof thevariablesassociatedwith theedges inthepath.For example, inFig. 12-2 the eight distinct paths betweenverticesaandbare

EachoftheseproductsiscalledapathproductbetweenverticesaandbinthecontactnetworkG.Clearly,thevalueofapathproductis1ifandonlyifeachvariableinthepath

Page 407: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

producthasavalueof1;otherwise,itis0.Thevalue1ofapathproductimpliesthe existence of an electrically conducting path between a and b through thecorrespondingcontactsinthenetwork.Foranelectricalconductionbetweenthetwovertices,itisnecessaryandsufficientthatatleastoneofthepathproductsbe1.Inotherwords,theBooleansumofallpathproductsbetweenaspecifiedpairofvertices(vi,vj) is1 ifandonlyif the terminalsviandvjareelectricallyconnectedinthecontactnetwork.Therefore,theBooleansumofpathproductsis referred to as the transmission of the contact network between the twospecified vertices. For example, the transmission between vertices a and b inFig.12-2is

Fig.12-2Contactnetworkwithsixverticesandninecontacts.

Finding the transmission between specified vertices in a given contactnetworkconsistsofenumeratingallpathsbetweenthetwovertices,andfindingthe Boolean sum of the path products. Furthermore, possible simplificationsbasedonthepostulatesoftheBooleanalgebraarealsoperformed.Forexample,inthepathproductslistedin(12-1),thefollowingidentitiesareevident:

x1x′3x1 =x1x′3,

x2x3x′3x5 =0,

x2x′1x1 =0

and

Page 408: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

x3x4x′3x5 =0.

Therefore,theswitchingfunctionbetweenverticesaandbinFig.12-2is

Clearly,Fabgivesalldifferentconditionsunderwhichaconductivepathexistsbetweenaandb.

Normal Form: A switching function can be expressed in many differentforms.Forexample,anotherwayofexpressing(12-3)is

ABooleanfunctionF(x1,x2,...,xm)ofmbinaryvariablesx1,x2,...,xmwhenexpressedasasumofproducts(Boolean,ofcourse)ofthevariablesissaidtobeinthenormalornaturalform.FunctionFab in(12-3)isinnormalform,butin(12-4)itisnotinnormalform.Occasionally,oneis interestedinfindingthe transmissionsbetweenallpairs

ofverticesinagivencontactnetworkG.TheresultisbestexpressedasannbynmatrixcalledthetransmissionmatrixT=[tij]ofG,wherenisthenumberofvertices,andtijisthetransmissionbetweenverticesiandjinG.Clearly,Tisasymmetricmatrixwitheverydiagonalentrytii=1.

Fig.12-3Contactnetwork.

ThetransmissionmatrixforthecontactnetworkshowninFig.12-3is

Page 409: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Thedeterminationofatransmissionmatrixinvolvesenumerationofallpathsbetween every vertex pair in a network. A better method of determining atransmissionmatrixisfromtheprimitiveconnectionmatrix,definedasfollows:TheprimitiveconnectionmatrixQ=[qij]ofann-vertexcontactnetworkGis

annbynmatrix,whoseelementsqijaredefinedas

qii=

1,foralli,

qij=

0,ifverticesiandjarenotdirectlyjoinedbyacontact;otherwise,

qij=

Booleansumofthevariablesassociatedwithalledgesdirectlyjoiningverticesiandj.

TheprimitiveconnectionmatricesforthecontactnetworksinFigs.12-3and12-2,respectivelyare

The primitive connection matrix is also symmetric, and it contains thecompleteinformationaboutacontactnetwork.LetQk be the kth Boolean power ofQ (i.e.,Qmultiplied by itself k times,

usingtherulesofBooleanalgebra,asdefinedinSection12-1)forsomepositiveintegerk.Furthermore,leteachentryinQkbesimplified,suchas

Page 410: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

x+1=x+x′=1, xx′=0,and x+x=xx=x+xy=x.

ThenexaminetheijthentryinthesimplifiedQk.Whatwehavedoneamountstotracingalledgesequencesoflength1,2,...,kbetweentheverticesiandj;andby employing the simplification process,wehave eliminated all redundancies,including thatofgoingover thesameedgemore thanonce(xx=x)andgoingoverthesamevertexmorethanonce(x+xy=x).ThustheijthentryinmatrixQk representsallpathsof lengthk or lessbetweenvertices i and jSince inannvertexgraphthelongestpathisoflengthn−1,wehave

THEOREM12-1

The transmission matrix T of an n-vertex contact network, with primitiveconnectionmatrixQ,isgivenby

T=Qn-1.

Incaseoneisinterestedinevaluatingtheswitchingfunctiononlybetweenaspecified pair of vertices, Theorem 12-1, which computes the switchingfunctions between all n(n − l)/2 pairs, is wasteful. Theorem 12-2 is moreefficient:

THEOREM12-2

LetQi jbethe ijthminoroftheprimitiveconnectionmatrixQ(computedinBoolean algebra and simplified using Boolean identities). Then the switchingfunctionFijequalsQij.

Theorem12-2 canbe provedusing arguments similar to thosewhich led toTheorem12-1.Thedetailsoftheproofareleftasanexercise.Even theevaluationof theminorQi j isquite laboriousandcumbersome.A

simpler method, called the node-removal method, is often employed inevaluatingFi j.The interested reader is referred to [12-10],pages315-323, fordetailsonnode-removaltechniques.

12-3. SYNTHESISOFCONTACTNETWORKS

Page 411: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Designing a network from given requirements is the general problem ofnetworksynthesis.Wecanassumethattherequirementsofthecontactnetworktobedesignedaregivenintheformofswitchingfunctions.(Iftheyaregiveninanyotherform,theycanbeconvertedintoswitchingfunctions.)Wecanfurtherassumethattheswitchingfunctionsaregiveninnormalform(i.e.,asaBooleansumofproducts).Two-Terminal Contact Networks: In a two-terminal synthesis we are given

justoneswitchingfunctionF(x1,x2,...,xm)ofmvariables,innormalform,andweare todesignanetwork realizing this functionas the transmissionbetweentwoofitsvertices.Thisproblemistrivialifwearenotconcernedwitheconomizingthenumber

ofcontacts,becauseanyswitchingfunctioninanaturalformcanberealizedbya sufficiently large number of contacts. But such an extravagant realization isusuallynotacceptable.Arealizationtobeusefulshouldcontainasfewcontactsaspossible.It isthisrequirementthatmakesthesynthesisproblemdifficult.InFig.12-4,forexample,areshownthreeofmanypossiblerealizationsofaverysimple switching function (with only four variables). The simplest among thethree networks is the one in Fig. 12-4(c). We may ask if this is the mosteconomicrealizationpossible.Ifso,howcanwebesure?Arethereanymethodsthatwillguaranteeourarrivingatamostefficientcontactnetwork foragivenfunction?Theproblemoffindingacontactnetworkthatrealizesanarbitraryswitching

functionwithaminimumnumberofcontactshasnotbeensolvedyet(exceptbyexhaustive enumeration) and is not likely to be solved in the near future.However, ifwe consider a restricted type of switching network, called single-contactnetworks,theproblembecomesmanageable.

Page 412: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.12-4ThreedifferentrealizationsofFab=wx+wy+wz+xyz.

Single-ContactNetwork:Acontactnetworkinwhicheverybinaryvariablexi(either inuncomplementedorcomplementedform) isassociatedwithonlyoneedge is called a single-contact (or SC) network. Thus each contact in an SCnetwork can be opened or closed independently. For example, the network inFig.12-3isanSCnetwork,butthoseinFigs.12-2and12-4arenot.Any transmission that can be realized by an SC network is called a single-

contact function (or SC function). Since in an SC network a variable appearsonlyonce,itisnotpossibletosimplifythesumofitspathproductsanyfurther[thetypeofsimplificationperformedonexpression(12-2)toproduceexpression(12-3)]. In other words, an SC function contains no redundant terms. Everyproduct term represents a distinct path between the specified terminals, andevery literal in a product term corresponds to a distinct edge in the path. Forexample,switchingfunction isnotanSCfunction.Realizationof anSCFunction:Oncewe are assured that a given switching

functionFab is an SC function, we know unambiguously every path betweenverticesa andb in the networkwe intend to design.The followingprocedureshowshowtodesignanSCnetworkforanSCswitchingfunction.Thenetworkisuniqueupto2-isomorphism.Thisisbecausethesetofallpathsbetweenapairofverticesspecifiesagraphuniquelywithin2-isomorphism(seeSection4-8and

Page 413: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Problem7-25).

ProcedureforRealizingaGivenSCFunctionofmVariablesxl,x2,...,xm:Step1:FromFabobtainthepathmatrixP(a,b)withrespecttothevertexpair

(a,b).Step2:Appendacolumnofall1’stoP(a,b).Thisimpliestheadditionofan

edge(withassociatedvariable,say,x0)betweenaandb, thusconvertingeverypathintoacircuit.LettheresultingcircuitmatrixbedenotedasB.Step3:UseJordan’smethodofelimination(mod2)toeliminatealldependent

rows in B. Rearrange the resulting fundamental circuit matrix Bf into thestandardform(reviewSection7-4,ifnecessary):

Step4:FromBfobtainthefundamentalcut-setmatrixCf,givenby

Step 5 : FromCf obtainAf, the reduced incidencematrix, by appropriatelyperforming modulo 2 sums of rows in Cf. This corresponds to obtaining anonsingulartransformationmatrixRsuchthat

Af=R•Cf,

whereAfhasatmosttwol’sineachcolumn.Instep5weareessentiallytakingdifferent ring sums of fundamental cut-sets so that they produce sets of edgesincidentateachvertex.This is themost laboriousstep in theentireprocedure,andbecomesprohibitiveforlargegraphs(moreonthislater).Step6:FormtheincidencematrixAbyaddingthemissingrowtoAf(sothat

eachcolumnhasexactly two1’s).FrommatrixAdrawthegraph,andremoveedgex0.

Example:Letus apply thisprocedure toobtain agraph that realizes theSCfunction

Page 414: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Step1:Thepathmatrixis

Step2:Appendingacolumnof1’sattheendofmatrixP(a,b)andidentifyingthecolumnbyvariablex0,wegetcircuitmatrixB:

Step 3: This step is somewhat involved. Jordan’s method of eliminationconsists of adding (mod 2) rows to other rows so as to form an identitysubmatrix.Forexample,addingthefirstrowtothesecondaswellastothethirdinBweget

Page 415: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

InB1addingthesecondrowtothefourthandsixthrows,weget

In thisattempt toeliminateallbutone1 inacolumn (makingsure the1 ineachcolumnoccursinadifferentrow),weultimatelyget

Fromthismatrixwegetthefundamentalcircuitmatrixinstandardform:

Page 416: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Nowwehavethefollowinginformationaboutthedesirednetwork:

rankofcircuitmatrixB=μ=e−n+1=4,

numberofedges(includingx0) e=9,

Therefore

numberofverticesn=6,

rankofthecut-setmatrix=n−1=5.

Step4:Thefundamentalcut-setmatrix(withrespecttothesametreeasBfinstep3)isimmediatelyobtainedas

Step 5 : After many trials we find that if we perform the following threeelementaryrowoperationsonCfwegetamatrix thatcontainsatmost two1’spercolumn.Theoperationsare

Add(mod2)row5torow1,

Add(mod2)row3torow5,

Add(mod2)row4torow3.

Page 417: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

TheresultingreducedincidencematrixAfis

Step6:WegettheincidencematrixAbyaddingarowatthebottomsuchthateverycolumnnowhasexactlytwo1’s.

Finally, the required contact network is constructed (see Fig. 12-5) from theincidencematrixA,andthenedgex0isdeleted.

Fig.12-5RealizationofFabinexpression(12-5).

Inthissix-stepsynthesisofanSCswitchingfunction,weseethatsteps1,2,4,and 6 are easy and require no conditions onFab for their completion. Step 3

Page 418: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

involvessomelabor,butitisalsoguaranteedtoterminate.AnymatrixofrankkcanbereducedbyJordan’sprocessofeliminationtooneofthefollowingforms(see[7-3]):

Realizability:Steps1,2,3,and4canalwaysbeperformedwhetherornotthegivenswitchingfunctionFisanSCfunction.Theprocedurewillfailatstep5ifF is not an SC function, and we will not succeed in obtaining a reducedincidencematrix by elementary rowoperations.This leads us to an extremelyimportantquestioningraphtheory:Whencanagiven(0,1)-matrixbeacut-setmatrixofsomegraph?Anarbitrary(0,1)-matrixMmayormaynotbeacut-setmatrix.Forexample,thematrix

cannotbeacut-setmatrixofanygraph.Thiscanbeverifiedbyconsideringallsevenpossible (mod2) sumsof the three rows, andobserving that thismatrixcannotbetransformedbyelementaryrowoperationsintoamatrixwithatmosttwo 1’s per column. In other words, no incidence matrix can be found tocorrespondwithLasacut-setmatrix.ThematrixLisunique.Itcanbeshownthatthisisthesmallest(0,1)-matrix

whichcannotbeacut-setmatrixofanygraph.ItisalsoclearthatanymatrixM,ifitcontainsLasasubmatrix,cannotbeacut-setmatrixeither.Letuslookatanotherfacetofthesituation.Acut-setmatrixofagraphGis

also the circuitmatrix of its dualG* if and only ifG is planar. Suppose thatmatrix containsasubmatrixwhichweknowtobethecircuitmatrixofsomenonplanargraphH;thenMcannotbeacut-setmatrix;otherwise,wehaveasituationwhereanonplanarsubgraphhasadual,whichisimpossible.Thuswehaveasecondnecessarycondition:ifamatrix istobeacut-setmatrix,itmustnotcontainthecircuitmatrixofanynonplanargraph.FromTheorem5-9,weknowthatagraphisnonplanarifandonlyifithasasasubgrapheitherofthe two Kuratowski graphs or any graph homeomorphic to either of them.Therefore,ifM is tobeacut-setmatrix,itmustnotcontainacircuitmatrixofeitherKuratowskigraph,oranygraphhomeomorphictoeitherofthem.

Page 419: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

It has been shown by Tutte in a remarkable paper that the two necessaryconditions discussed so far are also sufficient. The proof of sufficiency isextremely long and is based on the theory of matroids. The realizabilityconditionsforacut-setmatrixarepreciselystatedinTheorem12-3(foraproofsee[12-11]or[12-14]).

THEOREM12-3

Necessary and sufficient conditions for the (0, 1)-matrixM to be a cut-setmatrixarethat

1. MdoesnotcontainLorLTasasubmatrix.

2. Mdoesnotcontain thecircuitmatrixofeitherKuratowskigraph,or anygraphhomeomorphictoeitherofthem.

RealizabilityofMasaCircuitMatrix

Suppose that we want to find whether or not a matrixM = [Ik M2] is thefundamental circuit matrix (rather than cut-set matrix) of some graph. Thefollowingresult, theanalogofTheorem12-3andprovedbyTutte in thesamepaper,hastheanswer.

THEOREM12-4

Necessary and sufficient conditions for the (0, 1)-matrixM, to be a circuitmatrixarethat

1. MdoesnotcontainLorLTasasubmatrix.

2. Mdoesnotcontain thecut-setmatrixofeitherKuratowskigraph,oranygraphhomeomorphictoeitherofthem.

Notethatanarbitrary(0,1)-matrixMfallsintooneoffourcategories:

1. M is a fundamental cut-set matrix of some graphG and a fundamentalcircuitmatrixofanothergraphG*(graphsGandG*areplanar).

2. M is a fundamental cut-setmatrix of some graphG, but is not a circuitmatrixofanygraph(Gisnonplanar).

3. Misacircuitmatrixof somegraphG,but isnotacut-setmatrixofanygraph(Gisnonplanar).

4. Misneitheracut-setmatrixnoracircuitmatrixofanygraph.

Page 420: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

12-4. SEQUENTIALSWITCHINGNETWORKS

So far, we have considered only combinational switching networks. Let usnow study the sequential switching networks (better known as sequentialmachines†). As pointed out earlier in the chapter, the output of a sequentialnetworkdependsnotonlyonthepresentinputsbutalsoontheirpasthistory.Asequentialmachinemust,therefore,beabletoretaininformationaboutthepastinputs.Thisintroducestheconceptof“state”ofasequentialnetwork,wherethe“state” corresponds to the memory of the past inputs. Mathematically, asequentialmachineisdefinedasfollows:AsequentialmachineisamathematicalsystemM,whichconsistsof‡

1. AfinitesetV=[v1,v2,...,vn}ofinternalstates(orsimplystates).

2. AfinitesetX={x1,x2,...,xm}ofinputscalledtheinputalphabet.

3. AfinitesetZ={z1,z2,...,zp}ofoutputscalledtheoutputalphabet.

4. A function ormapping that assigns to every combination of the presentstateandthepresentinput(vi,xj)anextstatevk.ThisfunctioniscalledthetransitionfunctionofM.

5. Anotherfunction,calledtheoutputfunction,assignsanoutputzs toeverycombination(vi,xj)ofthepresentstateandthepresentinput.

There are two equivalentmethodsof describing a sequentialmachine: (1) atabularform,calledthestatetable,and(2)aweighted,directedgraph,calledthestategraph(orstatediagram).Eachvertexinthestategraphcorrespondstoastateofthesequentialmachine,

andeachdirectededgerepresentsatransitionfromthepresentstatetothenext.Every edge (vi, vj) has an ordered pair of weights xk, zq assigned to it. Thisweightpairrepresentsthefactthatifthepresentstateofthemachineisviandifthepresentinputisxkanoutputzqresults,andthenextstatewillbevjThestatetableandthestategraphofasequentialmachinewith

states V={A,B,C,D},

inputs X={1,2},

Page 421: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

outputs Z={a,b,c}

areshowninFig.12-6.InthestategraphtheedgewithweightpairfromvertexAtoB,forexample,indicatesthatwhenthemachineisinstateAandtheinput1isappliedthemachineproducesanoutputaandwillgointostateB.

Fig.12-6Stategraphandstatetableforasequentialmachine.

PropertiesofStateGraphs

Thefollowingobservationscanbemadeaboutthepropertiesofstategraphs:

1. In response to each specified input themachine in a given present stategoesintoaspecificnextstate.Therefore,theout-degreeofeachvertexism,oneforeachinput;andthestategraphhasnmedges.Notethatthereisnosimilarrestrictiononthein-degrees.

2. Since an inputmay leave a sequentialmachine in its present state, self-loopsmayoccurinastategraph.

3. A state graphmay also have parallel edges, but theywill have differentweightpairs.

Page 422: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

4. Inmostcasesoneofthestatesofasequentialmachineisdesignatedasastarting state, and themachine is required to be in this state before anyinput is applied.The state graphof amachinewith a designated startingstateisregardedasarooteddigraph,therootbeingthestartingstate.

5. A state (if any) that themachine cannot leave, nomatterwhich input isapplied,iscalledapersistentstate.Ifasequentialmachinehasapersistentstate,thecorrespondingvertexwillhavenodirectededgegoingfromittoanothervertex.

6. Asequentialmachineissaidtobestronglyconnected if itsstategraphisstronglyconnected.ThusasequentialmachineM isstronglyconnectedifand only ifM can be brought to any state from any other state by anappropriateinputsequence.

Thestategraphofasequentialmachinecontainsalltheinformationaboutthemachine.Therefore,itispossibletostudythepropertiesofagivenmachinebystudying its state graph. Some of the problems that arise in the theory ofsequentialmachinesare

1. Analysis:Inanalyzingthebehaviorofamachine,wemay,forinstance,beinterestedindeterminingtheresponse(nextstatesandoutputs)ofagivenmachine toacertain inputsequence.Orwemaybe interested indrawingsome conclusion about the internal behavior of amachine by applying aseriesof inputsandobserving theoutputs. If amachinehasadesignatedstartingstate,theapplicationofagiveninputsequenceresultsinauniqueoutputsequence.

2. Synthesis: To design amachine having a desired behavior,we startwiththestatementofthedesiredresponseandconstructastategraph.Considerthefollowingexample:

Problem: Design a sequential machine to respond to an arbitrary inputsequenceof0’sand1’s.Themachineshouldproduceanoutputof1wheneverthere appears a set of four consecutive input bits of value greater than 9 in aserial 8-4-2-1BCDcode (the least significant bit comes to themachine first).Wheneverthevalueofafour-bitsequenceis9orless(i.e.,0000,0001,0010,...,1001),theoutputshouldbe0.

Solution:Themachineshouldstorethelastthreeconsecutivebitsandshouldexamineand respond to thenextbit.Therefore,weshould startwithaneight-state(23=8)sequentialmachine.Let theeightstates000,001,010,011,100,

Page 423: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

101,110,and111bedesignatedbyA,B,C,D,E,F,G,andH,respectively.Theinputalphabetconsistsof{0,1},andtheoutputalphabetalsoconsistsof{0,1}.When a newbit arrives at the left, themachine drops the rightmost bit and

storesthenewbittogetherwiththetwooldones.Forexample,ifthemachineisinstateC(i.e.,010)anda1arrives,thenextstateis101(i.e.,F)andtheoutputis 1 (corresponding to 1010). The state table and the state graph of such asequentialmachinecanbeeasilyconstructedandareshowninFig.12-7.

Fig.12-7Statetableandstategraph.

3. Stateequivalenceandreduction:Theeight-statemachinewejustobtainedisnotnecessarilythe“simplest”onetoperformthespecifiedtask.Thenextstep,andaveryimportantstep,istoexaminethestategraphandseeifitcanbereducedtoa“simpler”machine.Thereductioncanbeaccomplishedifwecandeterminewhetherornot twostates inagivenmachine (i.e.,a

Page 424: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

pairofverticesinthestategraph)areequivalent.Iftwostatesproducethesameoutputsandalsogotoapairofequivalentnextstatesforeveryinput,theycanbeconsideredasonestateandgiventhesamelabelwherevertheyoccurinthestatetable.

In the state graphswe can fuse the two equivalent vertices and remove anyredundantedges(paralleledgeswithidenticalweights)thatmayresultfromthefusion. InFig.12-7verticesA andB areequivalent,and therefore theycanbefused.Thisfusingresultsintheseven-statemachineshowninFig.12-8(a).TheprocessofreductionisshowninFig.12-8.Whencompletedityieldsthe

stategraphofFig.12-8(e).StateAinFig.12-8(e)isthereplacementofAandBintheoriginalstategraph,stateCisforCandD,andstateEisforE,F,G,andH.Thethree-statesequentialmachineinFig.12-8(e)performsthesametaskas

theoriginaleight-statemachineinFig.12-7did.Thissimpleexampleillustratestheimportanceofthestate-reductionprocess.

4. State assignment: The next step is the implementation of a sequentialmachine from the reduced state graph. Assuming that binary memorydevices (i.e., two-state devices such as flip-flops or toggle switches) areused,ann-statemachinewillrequireqsuchdevices,where

2q-1<n≤2q.

Theqbinarymemorydevicesallow2qpossiblestates.Howtoassignnofthese2qstatestothenverticesofthestategraphsuchthatwegetthemosteconomicalmachineistheproblemofstateassignment.Ingraph theoretic terms the stateassignmentproblem is the sameas thatof

labelingtheverticesofann-vertexdigraphwithavailable2q (≥n) labels,withcertainoptimizingcriteria.

Findinganefficientalgorithmtoobtainthe“best”assignmentisanimportantunsolved problem in the theory of sequential machines. Listing all possibleassignmentsandthenpickingoutthebestisimpracticalevenformachineswith10states.However,foraverysmallmachine,suchasthethree-statemachineinFig.12-8(e),itispossibletolookatalldistinctassignmentsandcomparethem.Forn=3andq=2,thenumberofdistinctassignmentsis3.Thefollowingtableshowsthreedistinctassignments(y1andy2arethetwomemorydevices).

Page 425: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications
Page 426: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.12-8Reductionofastategraph.

If you are familar with logical devices, design these machines completely,usingflip-flops(ordelaylines)andgates.Youwillnoticethatoneassignmentisdecidedlysuperiortotheothertwo.There are a number of very important but difficult problems in sequential

Page 427: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

machine theory. Graph theory may have potential for solving many of theseoutstandingproblems.

12-5. UNITCUBEANDITSGRAPH

Consider a set ofm switching variables xl, x2, . . . , xm. Eachxt can take avalueofeither0or1.Therefore,wecanform2mdistinctm-tuples.Eachofthesem-tuples can be represented by a vertex of them-dimensional unit cube.Unitcubes for m = 1, 2, and 3 are shown in Fig. 12-9. The extension tom ≥ 4,althoughgeometricallydifficult,issimpleenoughtovisualize.

Fig.12-9One-,two-,andthree-dimensionalcubes.

Theedgesandverticesofanm-dimensionalunitcubeformagraphwith2mvertices.EachvertexislabeledasadistinctbinarySequenceofmbitssuchthattwoverticesareadjacent ifandonly if they (i.e., their labels)differ inexactlyonebit.Suchagraph iscalledanm-cubeandwillbedesignatedbyQm.Onceagain, how we draw the m-cube is immaterial as long as we preserve theadjacencyrelationshipsofitsvertices.Forexample,Q3isdrawninanotherwayin Fig. 12-10(a). The 4-cube is sketched in Fig. 12-10(b). Them-cube is ofinterest in studying switching functions of m binary variables. The state-assignment problem, discussed in the last section, can be looked upon as a

Page 428: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

problemofselectingandlabelingverticesofanm-cube.SeeChapter13of[12-2].

Fig.12-10Graphsof3-cubeand4-cube.

Someobservations thatcanbemadeabout thepropertiesofanm-cube,Qm,are

1. Thereareexactlymdistinctlabelsthatdifferfromagivenlabel(ofmbits)inoneposition.Therefore,eachvertexinQmisofdegreem.ThusQmisaregulargraphofn=2mverticesande=m·2m-1edges.

2. Thedistanceδ(vi,vj)(i.e.,thenumberofedgesinashortestpath)betweentwoverticesviandvj inanm-cubeisequal to thenumberofpositions inwhich the labels of vi and vj differ. For example, inQ3 in Fig. 12-9 thedistance between (011) and (101) is 2. This distance is known as theHammingdistancebetweenthetwobinarywords.Itiseasytoseethat

δ(vi,vj)=numberof1’sinmod2vectorsumofthelabelsofviandvj.

3. Themaximumdistancepossiblebetween twovertices inanm-cube ism,becausetwom-bitsequencescandifferatmostinmpositions.

Subcubes:Ak-dimensionalcubecanbelookeduponasasubcubeofhigher-dimensionalcubes.Similarly,graphQkmayberegardedasasubgraphofQm(k≤m)suchthatQkconsistsofthe2kvertices(ofQm),whoselabelshaveidenticalm − k corresponding bits. For example, the vertices (011), (001), (111), and(101)inFig.12-9havethesamelastbit,andconstituteasubcubeQ2inQ3.Eachvertexisa0-cube,andanyedgeisa1-cube.

Minterms:ABooleanproductcontainingeachofmvariablesxl,x2, . . . ,xm

Page 429: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

exactlyonce,eithercomplementedoruncomplemented,iscalledaminterm(orcanonicproduct)ofmvariables.Forexample,themintermsofthreevariables=a,b,care{a′b′c′),(a′b′c),(a′bc′),(a′bc),(ab′c′),(ab′c),(abc′),and(abc).Thereare2mdistinctmintermsofmvariables,andtheycanbeputintoaone-

to-onecorrespondencewiththeverticesofanm-cube.Theminterm(x′1x′2...x′m)correspondsto(00...0)vertex,(x′1x′2...x′m-1xm)correspondsto(00...01)vertex,andsoon;finally,theminterm(x1x2...xm)correspondstovertex(11...1)ofQm.SwitchingFunctionsonthem-Cube:Anyswitchingfunctionf(x1,x2,...,xm)

ofm variables canbe expresseduniquely as aBoolean sumof a subset of 2mminterms.Thisistermedasthecanonicformoff.Clearly,thefunctionfis1atthoseandonly thoseverticeswhosecorrespondingmintermsarepresent in thecanonicformoff.Atallotherverticesthefunctionfis0.Thevertices†ofQmatwhichfis1arecalledtrueverticeswithrespecttofunctionfandtheverticesatwhich f is 0 are called the false vertices ofQmwith respect to function f. Forexample,considerthefollowingfunctionofthreevariables:

f(x1,x2,x3)=x′1x′2x′3+xlx′2x′3+x′1x2x′3+x′lx2x3.

ThetrueverticesforthisfunctiononQ3areshownencircledinFig.12-11.

Fig.12-11TrueverticesonaQ3foragivenfunction.

Thuseveryswitchingfunctionofmvariablesuniquelypartitionstheverticesof thegraphQm into twosets,oneconsistingof the trueverticesandtheother

consisting of the false vertices. There are 22m such partitions,‡ each

correspondingtoadistinctswitchingfunctionofmvariables.Thusthepropertiesof switching functions can be determined by studying the properties of the

Page 430: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

subgraphofQmdefinedbythetrueverticeswithrespecttothegivenfunction.

12-6. GRAPHSINCODINGTHEORY

GrayCodes:Often,when information is converted from analog form to itsdigitalequivalent,one requiresa listofdistinctbinarym-tuplessuch thateachdiffers from the one preceding it in just one coordinate. For example, todeterminetheangularpositionofarotatingshaft,theanglesinadjacentquantumintervalsareencodedintom-tuples(usingmbrushesonacommutator)ofbinarydigits that differ in just one place. Takingm = 3, for instance, as the angleincreases from 0 to 360°, the binary code for angles might go through thesuccession

000for0−45°,

001for45−90°,

011for90−135°,

010for135−180°,

110for180−225°,

111for225−270°,

101for270−315°,

100for315−360°,

andbackto

000for0−45°.

Suchacode,whichrequiresthechangingofonlyonebitatatime,iscalledtheGraycode,thereflectedbinarycode,circuitcode,orcycliccode.IncontrasttotheGraycode,othercodesmayrequirechangingofseveralbitswhengoingfromonenumbertothenexthighernumber.Forexample,goingfrom7to8in8-4-2-1 BCD (i.e., from 0111 to 1000) involves a change in all four bitssimultaneously.Becauseofvariationsintheconstructionoftheequipment,suchmultiplechangesmaynotregistersimultaneously.Thus,duringthechange,falsecodecombinationsaresupplied.SuchfalsecodewordsareeliminatedinaGraycode, and this is why Gray codes are so important in analog-to-digital

Page 431: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

conversionofinformation.Anm-bitGraycodecorrespondstoacircuitinanm-cube.Forinstance,the3-

bitGraycode just illustratedformeasuring theangularpositionof therotatingshaft isdefinedbytheHamiltoniancircuit inQ3 inFig.12-12showninheavylines.The reason for the term cyclic or circuit code should be clear from thisfigure.Anm-bit code that uses all 2m vertices is called a complete code.A circuit

codeneednotbeacompletecode.Forexample,when4-bitwordsareused torepresentdecimaldigits,weuseonly10outof16vertices.

Fig.12-12GraycodeonQ3.

Snake-in-the-BoxCodes: In selecting an incomplete code from2m availablewords,onewouldliketoselectacodethathascertainerror-checkingproperties.Onesuchcodehas thedesirableproperty thata singlebinaryerror (causedbymalfunctioningof theequipment) inawordresults ineither(1) thenextword,(2)theprecedingword,or(3)awordthatdoesnotappearinthecodeatall.Thelast case indicates adetected error, and the first two cases introduce errors ofrelativelysmallmagnitude.Suchacodeiscalledasnake-in-the-box(SIB)code,orunit-distanceerror-checkingcode.AnSIBcodecorresponds toacircuit inQm such thatno twononsuceessive

verticesonthecircuitareadjacent.A6-word,SIBcodeinQ3 isshowninFig.12-13.

Page 432: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.12-13Snake-in-the-boxcodeonQ3.

The SIB codes can be generalized to codes with additional error-checkingproperties, as follows: In graphQm, a circuitCs is said to be of spread s if apersongoingaroundCscannotfindashortcut(i.e.,apathwithnoedgefromCs)between two vertices ofCs consisting of fewer than s edges ofQm.With thisdefinition,everycircuitinQmisofspread1,andanSIBcodecorrespondstoacircuitofspread2.Foragivenmandaspecifieds,onewouldliketofindaslargeacircuitCsas

possible.AtpresentnorelationshipisknownthatgivesthesizeofthelargestCsinaQmforarbitrarymands.ForasurveyofsuchproblemsoncodesinQm,thereaderisreferredtoapaperbyKlee[12-8].

Huffman Graph-Theoretic Codes: We shall now briefly discuss theapplication of graphs to an entirely different type of coding. A binary groupcode isasetofbinarycodewordswith theproperty that themodulo2sumofarty two codewords in the set is also a codeword in the set.† Binary groupcodes are of importance in information transmission, both for analytic andpracticalreasons.Thegroupstructurefacilitatestheirmathematicalstudyaswellastheirimplementation.Formoredetailsongroupcodessee[12-12].Since the ring sumof twocut-sets in agraph is another cut-set or an edge-

disjointunionofcut-sets,itisevidentthatthesetofallcut-setsandedge-disjointunionofcut-setscanbeusedtodefineabinarygroupcode.Inotherwords,thevectors (2rof them,rbeing the rankof thegraph) in thecut-set subspaceWS,overGF(2),constituteabinarygroupcode.Therowsofafundamentalcut-setmatrixcanbeusedtogeneratethisbinary

groupcode.SuchacodeiscalledaHuffmangraph-theoreticcode.For example, consider a graph and its fundamental cut-setmatrixCf inFig.

Page 433: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

12-14.TherowsofCftheirmodulo2sums,andthezerovectoryieldthe5-bit,8-wordcodeshowninFig.12-14.

Fig.12-14Graphanditscut-setcode.

Analogously,thefundamentalcircuitmatrixofagraphalsogeneratesabinarygroup code. Thus we have two graph-theoretic codes associated with everygraph.

Agraph-theoreticcodeisgenerallyspecifiedbythreenumbers—thenumberofedgeseinthegraph,thedimensionoftheassociatedsubspace,WSorWΓ(i.e.,rankrornullityμ),andthesmallestnumberof1’sinanonzerocodeword.Thusthegraph-theoreticcodegeneratedbythecut-setsofthegraphinFig.12-14isa(5,3,2)code.Nowthatweknowhowtogenerateacode(infacttwocodes)fromanygraph,

wecaninvestigatecodescorrespondingtoimportantkindsofgraphs—suchascompletegraphs,bipartitegraphs,regulargraphs,andplanargraphs.Conversely,we can look for graphs that generate group codes with certain specifiedproperties,suchasefficiencyanderror-correctingcapability.This isanareaofcurrent research. Some relationships between the properties of graphs and theproperties of the associated codes have been investigated byHuffman [12-7],Frazer[12-3],HakimiandBredeson[12-4],andSaltzer[12-13].

Page 434: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

SUMMARY

In this chapter graph theory was applied to switching circuits, automatatheory, and coding theory. The applicability of graphs to digital systems andsignalsisnotsurprising,becausebothoperateinGF(2).For lack of space, only selected applications in switching theory were

discussed. Many related topics, such as the study of series-parallel contactnetworks,planarandnonplanarcontactnetworks,andregularexpressions,werenot even mentioned. Several other topics, such as the graphs of gate-typenetworks, generalized SIB codes, and properties ofHuffman codes,were alsoleftout.Thesearesomeoftheareasofcurrentresearchinswitchingtheory.Itishopedthattheseriousreaderwillgotothereferencescitedforafulleraccountofthisfascinatingapplicationofgraphtheory.

REFERENCES

Certain familiarity with switching theory was assumed in this chapter. Forintroductory switching theory, Caldwell [12-2], one of the earliest books inswitching theory, isstilloneof thebest,andChapters5,8,10,12,and13areparticularlyrelevanttothesubjectofthischapter.Foramoreabstractandformaltreatment of switching theory, Harrison [12-5] is recommended. Chapter 5 ofMiller [12-10] is excellent for graph-theoretic treatment of contact networks.Chapter10inHillandPeterson[12-6]isgoodforunderstandingtheproblemsinsynthesisofsequentialcircuits.Forcodingtheory,theclassicbookofPeterson[12-12] is recommended. Birkhoff and Bartee [12-1] may be read for anappreciationofwhygraph theory shouldbe so readily applicable to switchingtheory and coding. Other sources referred to in the text are included in thefollowinglistofreferences.12-1. BIRKHOFF,G.,andT.C.BARTEE,ModernAppliedAlgebra,McGraw-Hill

BookCompany,NewYork,1968.12-2. CALDWELL,S.H.,SwitchingCircuitsandLogicalDesign,JohnWiley&

Sons,Inc.,NewYork,1958.12-3. FRAZER,W.D.,“AGraph-TheoreticApproach toLinearCodes,”Proc.

SecondAnnualAllertonConf.onCircuitandSystemTheory,1964,888–898.

12-4. HAKIMI, S.L., and J.G.BREDESON, “GraphTheoreticError-CorrectingCodes,”IEEETrans.Inform.Theory,Vol.IT-14,No.4,July1968,584–591.

Page 435: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

12-5. HARRISON, M. A., Introduction to Switching and Automata Theory,McGraw-HillBookCompany,NewYork,1965.

12-6. HILL,F. J., andG.R.PETERSON, Introduction toSwitchingTheoryandLogicalDesign,JohnWiley&Sons,Inc.,NewYork,1968.

12-7. HUFFMAN, D. A., “A Graph-Theoretic Formulation of Binary GroupCodes,”summariesofpaperspresentedat1964ICMCI,pt.3,29–30.

12-8. KLEE,V.,“TheUseofCircuitCodesinAnalog-to-DigitalConversion,”inGraphTheoryandItsApplications (B.Harris,ed.),AcademicPress,Inc.,NewYork,1970,121–131.

12-9. MAYEDA, W., “Synthesis of Switching Functions by Linear GraphTheory,”IBMJ.Res.Develop.,Vol.4,July1960,320–328.

12-10. MILLER, R. E., Switching Theory. Volume I: Combinational Circuits,JohnWiley&Sons,Inc.,NewYork,1965.

12-11. MINTY,G.J.,“OntheAxiomaticFoundationsoftheTheoriesofDirectedLinear Graphs, Electrical Networks, and Network Programming,” J.Math.Mech.,Vol.15,1966,485–520.

12-12. PETERSON, W. W., Error Correcting Codes, The M.I.T. Press,Cambridge,Mass.,1961.

12-13. SALTZER, C, “Topological Codes,” in Error Correcting Codes (H. B.Mann,ed.),JohnWiley&Sons,Inc.,NewYork,1968.

12-14. TUTTE,W.T.,IntroductiontotheTheoryofMatroids,AmericanElsevierPublishingCompany,Inc.,NewYork,1971.

12-15. WELSH, D. J. A., “Matroids and Their Applications,” Seminar Notes,UniversityofMichigan(toappear).

†Switchingalgebra,asdefinedhere, isactuallyaspecialcaseofBooleanalgebra.However, inswitchingtheorythesetwotermsareoftenusedinterchangeably,asitcausesnoconfusion.†Sequentialswitchingnetworksarealsocalledsequentialnetworks,sequentialmachines,sequentialnets,orsequentialcircuits.Thetermsfinite-statemachinesandautomataarealsousedforsequentialswitchingnetworks.Theformsequentialmachineisperhapsthemostcommonlyemployedtermandweshallusethisterm.‡Thisdefinitionofasequentialmachineissomewhatrestricted.ItistheMealymodelofadeterministicandcompletelyspecifiedsequentialmachine.†ThosefamiliarwithKarnaughmapwillrecognizethatavertexinQmcorrespondstoasquareinKarnaughmap.‡Thisincludestwoextremecaseswhenall2mverticesaretrue(i.e.,f=1),andallverticesarefalse(i.e.,f=0).Usually,partitionsdonothaveemptysubsets,butherewehavecalledthesetwocasesalsopartitions.†Notethatweareandhavebeendiscussingonlybinarycodesandonlythosebinarycodesinwhicheachcodewordconsistsof thesamenumberofbits.Suchacode iscalledauniformbinarycodeorabinaryblockcode.Graycodesandbinarygroupcodesareexamplesofbinaryblockcodes.

Page 436: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

13ELECTRICALNETWORKANALYSISBYGRAPHTHEORY

One of the reasons for the recent revival of interest in graph theory amongstudents of electrical engineering is the application of graph theory to theanalysisanddesignofelectricalnetworks(morecommonlyknownaselectricalcircuits). The idea of using graph theory for predicting the behavior of anelectricalnetwork isnotnew. ItoriginatedwithG.Kirchhoff in1847andwasimproved upon by J. C. Maxwell in 1892. However, for hand computations(which were necessarily limited to small networks), the application of graphtheorytonetworkanalysisofferedlittlerealadvantageoverthemoreelementarymethodsofnodeorloopanalysis.Thepicturehas changedand is changing since thearrivalof thehigh-speed

digitalcomputer.Amilestoneingraph-theoreticanalysisofelectricalnetworkswasachievedbyW.S.Percival,whenheextendedtheKirchhoffandMaxwellmethods to networks with active elements. Computer programs are nowavailable for analysis of large networks [13-2] based on the graph-theoreticapproach.Moreefficientandlessuser-orientedcomputerprogramsforanalyzinglargerandmoregeneral typesofnetworksare in theoffing.In thischapterweshallpresenttheunderlyingprincipleofgraph-theoreticanalysisofnetworks—whichishowtousespanningtrees(orchordsets)forevaluatingdeterminantsofamatrix.

Reminder on Terminology: Different disciplines using graph theory havedeveloped somewhat different terminology. In electrical engineering, the termbranch is used for edge, node for vertex, and loop for circuit. An electricalnetwork is more commonly known as an electrical circuit. For the sake ofconsistency, however, the same graph theory terminology has been usedthroughoutthisbook.

Page 437: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

13-1.WHATISANELECTRICALNETWORK?

Anelectricalnetworkisacollectionofinterconnectedelectricalelements(ordevices) such as resistors, capacitors, inductors, diodes, transistors, vacuumtubes,switches,storagebatteries, transformers,delay lines,powersources,andthe like.Thebehavior (suchas the response toaunit impulse)ofanelectricalnetwork is a function of two factors: (1) the characteristics of each of theelectrical elements, and (2) how they are connected together, that is, theirtopology.Itisthelatterfactorthatbringsgraphtheoryintothepicture.

Anelectricalelementcanbe

1. Lumpedordistributed.

2. One-port(i.e.,two-terminal)ormultiport.

3. Linearornonlinear.

4. Timeinvariantortimevarying.

5. Passiveoractive.

6. Bilateralornonbilateral.

Toavoidusingpartialdifferentialequations,adistributedelement,suchasatransmission line, is either approximated by lumped elements or is consideredseparately. Thus an electrical network almost by definition implies a networkconsisting of lumped elements only. Also, a multiport device such as atransformerorapentodecanbereplacedbyasetofinterconnectedtwo-terminalelements,suchasresistors,inductors,anddependentpowersources(seeFig.13-7). Thus we can confine ourselves to a network of lumped, two-terminalelements.A two-terminal electrical element is represented by an edge ek. Associated

witheachedgearetwoedgevariables,vk(t)andik(t).Thevariablevk(t)iscalledthe edge voltage and may be regarded as a cross variable, because it existsacrossthetwoendverticesoftheedge.Theothervariableik(t)iscalledtheedgecurrentandmaybe thoughtofasa throughvariable,because it flowsthroughtheedge.Sincethevariablesaredirectional,everyedgeisassignedanarbitraryorientation (seeFig. 13-1).The characteristics of each element are completelydescribedintermsofthesetwovariables.(Thephysicsofanelectricalelementand itsmathematical description formanother subject in electrical engineering

Page 438: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

andareoflittleconcerntoushere.)Thus an electrical network for us is a connected directed graphG inwhich

eachedgeekisassignedtwovariablesvk(t)andik(t).Theedgevariablesofeachedgesatisfyarelationshipimposedbythenatureofthecorrespondingelement.LetthedirectedgraphGhavenvertices1,2,3,...,nandeedges

Fig.13-1Electricalelementanditsrepresentationasanedgeofadirectedgraph(thevoltage+isalwaysattailofcurrentarrow).

b1,b2,...,be.Letthevaluesofcurrentsflowingthroughtheseedgesatagiventime be represented by a column vector (called the edge-current vector) i(t),where

Similarly,theedgevoltagesacrosstheeedgesarerepresentedbyanothervector(calledtheedge-voltagevector)v(t),where

13-2.KIRCHHOFF’SCURRENTANDVOLTAGELAWS

Itwasmentionedthateachelementinanelectricalnetworkisgovernedbyaspecific relationship imposed upon its two edge variables.When the elementsare interconnected to form a network, is there any additional relationshipimposed on these edge variables collectively? The answer, as every electrical

Page 439: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

engineer knows, is yes. The edge variables must also obey the two laws ofKirchhoff’s:

Kirchhoff’s Current Law (KCL): For any lumped electrical network, at anytimethenetsum(takingintoaccounttheorientations)ofallthecurrentsleavingany node (or vertex) is zero. That is, at the rth vertex of the correspondingdirectedgraphG,wemusthave

wherearkistherkthentryintheincidencematrixAofG,andik(t)istheamountof current flowing through the kth edge of G. Since Eq. (13-1) holdssimultaneouslyforr=1,2,...,n,itcanalsobewritteninthematrixform

Kirchhoff’s Voltage Law (KVL): For any lumped electrical network, at anytimethenetsum(takingintoaccounttheorientations)ofthevoltagesaroundaloop (i.e., circuit) is zero. In terms of the corresponding digraph, for the rthcircuitwemusthave

wherebrkistherkthentryinthecircuitmatrixBofG,andvk(t)istheamountofvoltage across the kth edge. Since Eq. (13-3) holds simultaneously for everycircuitinG,itcanberepresentedinthematrixformas

13-3.LOOPCURRENTSANDNODEVOLTAGES

ConsiderthevectorspaceWG(overthefieldofrealnumbers)associatedwiththe directed graphG. HereG is a connected directed graph of e edges andnvertices, representing an electrical network. From Eq. (13-2), we see that theedge-currentvectori(t)isorthogonaltoeachoftherowvectorsintheincidencematrixA. Since the row vectors inA span the entire cut-set subspaceWs (ofdimension n − 1), i(t) is orthogonal toWs. Therefore, i(t) lies in the-circuitsubspaceWΓ(ofdimensionµ=e−n+l)ofG.

Page 440: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Since i(t) is contained inWΓ, theremust be a set ofμ vectors inWΓwhoselinearcombinationwillproducei(t).AnobviouschoiceforthissetofμlinearlyindependentvectorsinWΓistherowsofthefundamentalcircuitmatrixBfwithrespecttosomespanningtree.(Clearly,BfiscontainedinB.)Letthecoordinates(orcoefficients)ofi(t)inthisbasisformedbytherowsb1,b2, . . .,bμofBfbeiL1(t),iL2(t)...,iLμ(t).Inotherwords,

Thuseachoftheeedgecurrentscanbeexpressedasalinearcombinationofμquantities iL1(t) iL2(t), . . . , iLμ(t). These are called loop currents (or meshcurrents); they represent current flowing in the μ independent circuitscorrespondingtotherowsofBf.SubstitutingEq.(13-5)intoEq.(13-2),weget

Similarly,fromEq.(13-4)weseethatthecolumnvectorv(t)representingtheedgevoltagesisorthogonaltothecircuitsubspaceWΓandis,therefore,incut-setsubspaceWs.Thusv(t)canbeexpressedasalinearcombinationofthen−1rowsofthereducedincidencematrixAf.Thatis,

Page 441: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.13-2Electricalnetworkanditsgraph.

Thatis,

Thuseachofeedgevoltagescanbeexpressedasalinearcombinationofn−1quantitiesvN1(t),vN2(t) . . .,vN(n-1(t).Thesearecallednodevoltages, and theyrepresent thevoltageat eachofn−1 independentverticeswith respect to thereferencevertex.

SubstitutingEq.(13-7)intoEq.(13-4),weget

Page 442: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Letusnowillustratewithanexampletheloopcurrentsandnodevoltagesandhow they are obtained from the edge currents and edgevoltages, respectively.Figure13-2(a)showsanelectricalnetworkwith fiveverticesandsevenedges.The correspondingdirectedgraph is shown inFig. 13-2(b). For this graph thereduced incidence matrix Af with respect to vertex N5 and the fundamentalcircuitmatrixBf,withrespecttothespanningtree{1,4,5,7}(showninheavylines),are

Theedge-currentvectorexpressedintermsofloop-currentvectoris

Theedgevoltagesintermsofthenodevoltages(withrespecttoN5)are

Page 443: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

13-4.RLCNETWORKSWITHINDEPENDENTSOURCES:NODALANALYSIS

In this section we shall restrict ourselves to electrical networks containingresistors, inductors,andcapacitors(RLC)with independentvoltageandcurrentsources.Inspiteofitsinherentsimplicity,theRLCnetworkcoversaverylargeclassofelectricalnetworksinpractice.Infact,ithasbeenshownbyBruneandBott andDuffin that any time-invariant, two-terminal, linear,passiveelectricalelement can be formed by a combination of R, L, andC (with real positivevaluesofR,L,andC).Afurtherstipulationmaybemade,withoutanylossofgenerality, that thevoltage sourcesmayonlybe connected in serieswithRLCelementsandthatcurrentsourcesmayonlybeconnectedinparallelwiththeseelements.Thisstipulationallowsustoconvertalltheenergysourceseitherintoasetofvoltagesourcesorintoasetofcurrentsources.Noda.Analysis:ConsideranRLCnetwork inwhichallenergysourceshave

been converted into current sources. At each node combine all these currentsources.Letthenetcurrententeringfromthecurrentsourcesintotherthnodebejr(t).Forthen−1independentnodes,letthecolumnvector

Page 444: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Then−1linearlyindependentequationsfromKCLcanbeexpressedas

whereAfisthereducedincidencematrixofthecorrespondinggraph,andi(t)istheeby1columnvectorofcurrentsineachoftheepassiveedges.TakingtheLaplacetransformofEq.(13-9),

Butthevoltage-currentrelationinthekthedge,consistingonlyofRLCelements,isgivenby

whereIk(s)istheLaplacetransformofthecurrentthroughthekthedge,Vk(s)isthe Laplace transform of the voltage across the kth edge, and Yk(s) is theadmittance(orself-admittance)of thekthedge.WritingEq. (13-11) forall theedgesinmatrixform,

Morecompactly,

Page 445: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

whereI(s)istheLaplace-transformedcolumnvectoroftheedgecurrents,V(s)isthe Laplace-transformed column vector of the edge voltages, and Y(s) is theedgeadmittancematrix.SubstitutingEq.(13-12)into(13-10),

Eq. (13-7)providedameansofexpressing theedge-voltagevector in termsofthenode-voltagevector.TakingtheLaplacetransformofEq.(13-7),

andsubstitutingEq.(13-14)into(13-13),

The(n−1)by(n−1)matrix iscalledthenodeadmittancematrixandiswrittenasYN(s).Note that inderivingEq.(13-15) itwasassumedthatall theinitialconditionswerezero.Thistooimpliesnolossofgenerality,becauseanyenergystoredincapacitorsorinductorsattimet=0canalwaysbereplacedbyanappropriateenergysourceandhenceincorporatedintoj(t).

Page 446: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.13-3PassiveRLCnetworkanditsgraph.

Letus illustrate theseconceptswithanexample.AnRLCnetworkwith two

Page 447: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

independent sources—one voltage source and one current source—is given inFig. 13-3(a). Figure 13-3(b) shows an equivalent network with only currentsources.AdirectedgraphofthenetworkisshowninFig.13-3(c).ThereducedincidencematrixAf(withvertex4asreference)is

Theedgeadmittancematrixis

Thenodeadmittancematrix is

J(s)columnvectorforthisexampleis

Page 448: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Network Analysis Problem: Let us pause for a moment and focus on theproblem thatwe are solving.The general problemof network analysis can beformallystatedasfollows:GivenanetworkwhosestructuredeterminesmatrixA, given its edge admittancematrixY(s), and given the current source vectorJ(s),findthenodevoltages.[Ifedgevoltagesoredgecurrentsarerequired,theycanbereadilyobtainedusingEqs.(13-7)and(13-12).]This clearly requires solving Eq. (13-15), which involves inversion of the

matrix YN(s). Inversion of a matrix (which must be nonsingular, of course)requirescomputationofitsdeterminantandofallitscofactors.Theconventionaldeterminant technique is inefficient because of extra labor involved incomputingmanytermsthateventuallycancelout.Moreover,theentriesinYN(s)consist of polynomials in s, andmust be carried in literal form until after thematrix inversion. Therefore, the usual methods of matrix inversion arecomputationallydifficulttoimplement.Both theseproblemsarecircumventedbyusinggraphtheory toevaluate the

determinant and cofactors. For this we invoke the Binet-Cauchy theorem(AppendixA)andusethefactthatamajordeterminant(orsimplymajor)ofthereduced incidence matrix Af is nonzero if and only if it corresponds to aspanningtree.

Determinant of the Node Admittance Matrix: Let us denote by ΔN thedeterminantofthenodeadmittancematrixYN(s).Thatis,

UsingtheBinet-Cauchytheorem,

Had every branch in the network been a 1-ohm resistor, Y(s) would be anidentitymatrixanddetYN(s)wouldequaldet ,whichisequal tothetotalnumber of the spanning trees in the network (Chapter 9). But for an RLCnetwork,ingeneral,Y(s)isnotanidentitymatrix.Itis,however,diagonal,andthereforeAfY(s)hasthesamestructureasAfexceptthatthekthcolumninAfismultipliedbyYk(s).EverynonzeromajordeterminantinAfY(s),aswellasAf,stillcorrespondstoaspanningtreeofthenetwork.Ifwe call the product of all n − 1 edges of a specific spanning tree a tree

Page 449: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

admittanceproduct,Eq.(13-16)becomes.

Equation (13-17)wasproposedbyMaxwellandhence isknownasMaxwell’sformula.To calculate the node admittance determinant byMaxwell’s formula,onemust find all the spanning trees of the network,multiply the n − 1 edgeadmittancesof each spanning tree, and then add the resultingproducts.Let usillustrateMaxwell’sformulaforthenetworkofFig.13-3.Thespanningtreesofthisgraphareabd,abe,acd,ace,ade,bcd,bce,andbde.Multiplyingtheedgeadmittances in each spanning treeandadding them,weget thedeterminantofthenodeadmittancematrixΔN

Note that to computeΔNwe do not need towriteYN(s).Also note that noterms are canceled in this method of computing ΔN. The reader is urged tocompute det YN(s) directly from matrix YN(s) and verify that it equals theexpressionforΔNjustobtained.ObservethelargenumberoftermsthatcancelintheprocessofdirectlyevaluatingdetYN(s).AlsonotethatΔNisindependentofthe referencevertexchosenbecause the treesofagraphdonotdependon thereferencevertexinwritingAf.

Page 450: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

CofactorsofYN(s)and2-Trees

EvaluationofcofactorsofthenodeadmittancematrixYN(s)isslightlymoreinvolvedthandetYN(s).LetthecofactoroftheijthentryinYN(s)bedesignatedbyΔij.Thenbydefinition

Since ,deletingtheithrowfromAfandthejthcolumnfromAfwilldelete the ithrowand jthcolumnfromYN(s), respectively.Moreover,deletingthejthcolumnfrom isequivalenttodeletingthejthrowinAfTherefore.

where Af-i denotes the submatrix of Af remaining after its ith row has beendeleted.

If Af is the reduced incidence matrix of a graphG, what does matrix Af-irepresent?MatrixAf—iisthereducedincidencematrixofthegraphGiobtainedfromGbyfusingitsithvertexwiththereferencevertexandremovinganyself-loopresultingfromthefusion(Problem13-14).LetusfirstevaluatesymmetriccofactorsΔii,whichaccordingtoEq.(13-18)

is

Δii=det[Af-iY(s)(Af-i)T],

andtheright-handsideofthisequationissimplythesumofthetreeadmittanceproductsforthegraphGiTherefore,

NowlookataspanningtreeofGtasasubgraphoftheoriginalgraphG.Thissubgraphhasn−2edges,nvertices,andnocircuits.Therefore,itmustconsistof twocomponents (oneofwhichmaypossiblybean isolatedvertex).Suchasubgraphiscalleda2-treeofG.Forexample,inFig.13-4thesubgraphadisa

Page 451: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

spanning tree ofG3 and is a 2-tree inG. (Note thatG3 is obtained by fusingvertex3 to thereferencevertex4andremoving theresultingself-loopofedgee.)

Fig.13-4SpanningtreeofG3isa2-tree(3,4)ofG.

Moreover, in this 2-tree of G, the vertex i and the reference vertex r mustoccur in different components; otherwise, fusing them would yield a circuit.Such2-trees inwhich twospecifiedverticesoccur indifferentcomponentsaredesignatedby2-tree(i,r).Forexample,inFig.13-4subgraphadisa2-tree(3,4).ThusEq.(13-19)canberewrittenas

LetusnowuseEq.(13-20)toevaluatethecofactorΔ33ofthenetworkin

Fig.13-3.Ithasfive2-treesof(3,4)type,andtheseare,asseenfromFig.13-4(b),

ab,ab,ad,bc,andbd.Therefore,

ToevaluateΔij,thecofactorofanoff-diagonalentry,observethatinEq.(13-

Page 452: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

18) the nonzeromajors ofAf-tY(s) correspond to 2-trees (i, r),where r is thereferencenode.ThenonzeromajorsofAf-jcorrespondto2-trees(j,r).ThetermsthatcontributetoΔijinEq.(13-18)mustbeduetoboth2-treesof(i,r)and(j,r).Since a 2-tree has only two components and vertex r must be in one of thecomponents, both i and j vertices must be in the other. Such a 2-tree isdesignatedbya2-tree(ij,r).Thus

InEq.(13-20)wedidnothavetoworryaboutthesignofthenonzeromajors,becausecorrespondingmajorsofbothAf−i and (Af−i)Thad thesamesign.ThesituationinEq.(13-21),however,isdifferent.SinceAf−iandAf−jaredifferentmatrices, we have no assurance that the signs of the products of thecorrespondingmajorswillbepositive.Infact,itcanbeshown(Problem13-15)that

Therefore,

ReturningtotheexampleofFig.13-3,oncemore

Node Voltages: Now we can compute any node voltage required. Forexample,thevoltageatnode3inFig.13-3isgivenby

Page 453: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

NetworkFunctions:Nowthatwehaveformulasforthedeterminantandeverycofactor Δij of the node admittance matrix, any network function that wasoriginallyexpressedintermsofnodeadmittancematrixcannowbeexpressedintermsofvarioustree-admittanceproducts.Forexample,theopen-circuittransferfunctionofathree-terminalnetworkinFig.13-5(a)(alldrivingcurrentszeroedexceptJ1),taking4asthereference,is

Formulaslikethesearecalledtopologicalformulasfornetworks.

Page 454: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.13-5Three-terminalRLCnetwork.

ApplyingthistopologicalformulatothenetworkinFig.13-5(b),whichisthesameasthenetworkinFig.13-3withitsdrivingsourcesremoved,weget

13-5.RLCNETWORKSWITHINDEPENDENTSOURCES:LOOPANALYSIS

Page 455: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

In Section 13-4, had we considered KVL instead of KCL (converting anycurrentsourceintoanequivalentvoltagesource),wewouldhaveobtainedasetofμ=e−n+1simultaneousloopequations,

whereBf isthefundamentalcircuitmatrixofthenetworkwithrespecttosomespanning tree, and is its transpose. The e by e matrix Z(s) is the edgeimpedancematrix, describing the electrical property of each of e edges in thenetwork;thatis.

NotethatforanRLCnetworktheedgeimpedancematrixZ(s)istheinverseofits edge admittance matrix Y(s). IL(s) is the Laplace transform of the loopcurrentvectoriL(t)andE(s)istheLaplacetransformofthevoltagesources(orequivalentvoltagesources)appliedexternallyintheμfundamentalcircuits.Thestep-by-stepderivationofEq.(13-24) issimilar to thederivationofEq.

(13-15)andisleftasanexercise(Problem13-9).Theμbyμmatrix inEq.(13-24)iscalledtheloopimpedancematrix

andisusuallydenotedbyZL(s).ThusEq.(13-24)isrewrittenas

Page 456: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.13-6NetworkofFig.13-3(a)forloopanalysis.

Forexample,consider theelectricalnetworkofFig.13-3(a),onceagain.Byreplacing the current sourcex(t)with an equivalentvoltage source,weget thenetworkasshowninFig.13-6(a)anditsgraphasinFig.13-6(b).

ThesolutionofEq.(13-25)requiresobtainingthedeterminantandcofactorsofZL(s).Theexpression forΔL, thedeterminantofZL(s),according to theBinet-Cauchytheoremisgivenby

Page 457: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

SinceamajorofBfisnonzeroifandonlyifitcorrespondstoachordset,Eq.(13-26)becomes

Equation (13-27) was originally given by Kirchhoff for a purely resistivenetwork.ForthenetworkofFig.13-6(b),allpossiblechordsetsarece,cd,be,bd,bc,ae,ac,andad.Therefore,

TheexpressionsforthecofactorsofZL(s)bothsymmetricalandasymmetricalcanbeobtainedinafashionsimilartothoseforYN(s)(Problems13-11and13-12).Notethedualitybetweenthenodalandloopanalyses(Problem13-16).

13-6.GENERALLUMPED,LINEAR,FIXEDNETWORKS

Topological formulas for ΔN, ΔL, Δij, and so on, derived in the last twosectionsweredependentontwoimportantrestrictionsonthenetwork:

1. ExistenceofedgeadmittancematrixY(s)[oredgeimpedancematrixZ(s)],which implied that the network elements were lumped, linear, and timeinvariant.

2. The edge admittancematrixY(s) [and therefore alsoZ(s)]was diagonal.This implied that there was no mutual coupling between edges of the

Page 458: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

network. Thus three-or four-terminal devices (which produce couplingsbetween two vertex pairs), such as transformers, transistors, tubes, andgyrators,couldnothavebeenincluded.

Inthissectionweshallstillretainrestriction1,butdoawaywith2.Thiswillallow us to handle a general linear network containing lumped, linear, time-invariant,r-terminal(r≥2)elements—passivedevicesliketransformers(whicharebilateralalso)andgyrators(whicharenonbilateral),aswellas

Fig.13-7(a)Networkwithatransformerandatransistor;(b)Itsequivalentnetwork;(c)Graphrepresentationof(b).

Page 459: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

activedevices, suchas tubesand transistors.Anexampleof suchanetwork isshowninFig.13-7.In the network in Fig. 13-7 (which has six edges and five vertices), we

observethatthecurrentthroughedge5isdependentnotonlyonV5butalsoonV4, the voltage across edge 6. Similarly, the currents through 1 and 2 aredependent on the voltage across each other. Thus edges 1 and 2 aremutuallycoupledandsoare5and4.(Edgessuchas3and6thathavenocouplingwithanyotheredgearecalledordinaryedges.)TheedgeadmittancematrixY(s) isshowninthefollowingequation,I(s)=Y(s)V(s)forthenetwork:

where

Clearly,Y(s)isnotdiagonal.

NodeAdmittanceMatrixJust as in Section 13-4, Kirchhoff’s current law in its Laplace transformed

formwillyield

andthereforethenodeadmittancematrixis

Page 460: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

ThedifferencebetweenEqs.(13-15)and(13-28)isonlythat in(13-15)matrixY(s)wasdiagonal,whereasitisnotdiagonalinEq.(13-28).ForthenetworkanditsgraphshowninFig.13-7,

andthenodeadmittancematrix is

DeterminantΔN

Again, our aim is to evaluate the determinant and cofactors of the nodeadmittancematrixYN(s).Wewrite

UsingtheBinet-Cauchytheorem,

wherethesubscriptαdenotesasetofn−1columnsofAfY(s)andAf(sameasaset of n − 1 rows of . Thus a also denotes a set of n − 1 edges of thecorrespondinggraph.InEq.(13-29),Y(s)isnotdiagonal;therefore,theproductAf(s)isnotassimplyrelatedtoAfasitwasinEq.(13-15).Soweapplyagain

Page 461: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

theBinet-Cauchytheoremtoevaluatedet[AfY(s)]α.Andsince

[AfY(s)]α=Af[Y(s)]α,

Weget

where[Af]ßisasetofn−1columnsofAfand isthecorrespondingsetofn− 1 rows of [Y(s)]a. Thus is an (n − 1) by (n − 1) submatrix of Y(s).SubstitutingEq.(13-30)into(13-29),weget

InEq.(13-31)thesummationisoverallpossiblepairsofsetsofn−1edgesof the graph, but det[Af]α and det[Af]β are zero unlessα and ß correspond tospanningtreesofthenetwork,inwhichcasetheyare+1or−1.Therefore,

summedoverallpossiblespanningtreepairs(α,ß).Theterm∊aßistheproductofthesignsofspanningtreesαandβ.Ingeneral,αandßcanrepresentdifferentspanningtrees.IfY(s)isdiagonal,

det =0,unlessα=ß.Butifα=β,ϵaß=1andEq.(13-32)reducesto(13-17).ButifY(s)isnotdiagonal,aspanningtreeα,besidesmakingatreepairwith

itself,maybeableto“pair-up”withsomeotherspanningtrees.ThesetermswillbecontributionstoΔNduetothecouplingsbetweenedges.

Pairs of Spanning Trees: The followingmethod of picking out all pairs ofspanning trees (α,ß) forwhich det ≠ 0 depends on the fact that for any(lumped, linear, time-invariant) electrical network the edge admittance matrixY(s)canbeexpressedas

Page 462: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

where the nonzero submatrices Y1(s), Y2(s), . . ., Yh(s) are relatively smallsquarematrices.See,forexample,theedgeadmittancematrixofthenetworkinFig.13-7.Assuming that we have the list of all spanning trees of the graph, the

following principle determines which spanning tree ß pairs with a givenspanningtreea,suchthatdet ≠0.Thesetofrowsßmustbeselectedsuchthat containsnoroworcolumn

entirelyofzeros.Therefore,ifαcontainsedgeρandcolumnρinY(s)containsnonzeroentriesinrowsx,y,...,thenßmustcontainone(ormore)oftheedgesx,y,....Thus,ifcolumnpfallsinthesubmatrixYk(s)ofY(s),atleastoneoftherowsmustalsobeinthesubmatrixYk(s).Acorollaryoftheobservationjustmadeisthatifspanningtreeαcontainsan

ordinaryedgeu,ßmustalsocontainthatordinaryedgeu.Let us illustrate the selection principle by means of the example of the

networkinFig.13-7.Thegraphhaseightspanningtrees:

(1,2,3,5),(1,2,3,6),(1,2,4,5),(1,2,4,6),(1,2,5,6),(1,3,4,5),(1,3,4,6),(1,3,5,6).

Since3and6areordinaryedges, the followingfiveare theonlycandidatesforpossiblepairingsoutofthetotalof(8×7)/2=28pairsofspanningtrees:

1. {(1,2,3,5)and(1,3,4,5)}:bothhaveedge3.

2. {(1,2,4,6)and(1,2,5,6)}:bothhaveedge6.

3. {(1,2,3,6)and(1,3,4,6)}:bothhave3and6.

4. {(1,2,3,6)and(1,3,5,6)}:bothwith3and6.

5. {(1,3,4,6)and(1,3,5,6)}:bothwith3and6.

Page 463: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Theexistenceof the same set of ordinary edges is only anecessary andnot asufficientconditionforpairing.Letusnowapplythetree-pairselectionprincipletononordinaryedges:

1. IfYk(s)isa2by2squaresubmatrix,itcorrespondstoatransformeroragyrator,anditscontributiontoΔNis

2. IfYk(s) is a 2 by 2 triangularmatrix, it corresponds to a transistor or avacuumtube.Inthatcase

Page 464: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Inlightofthesetwotables,letuslookatthefivetreepairsthatarepossiblecandidatesinthenetworkofFig.13-7.Threeof the fivepairs,1,3, and4,donot formvalid treepairs,because in

eachofthethreeonespanningtreecontainsbothedges1and2,whiletheotheronecontainsonlyedge1.Theremainingtwopairs[(1,2,5,6),(1,2,4,6)]and[(1,3,5,6),(1,3,4,6)]

satisfythetree-pair-solutioncriterion,andtheircontributionstoΔNare

respectively.Thecriterionofselectionofpairsofspanningtreescanbeeasilyextendedto

Yk(s)ofsizeslargerthan2by2(see[13-7]).SignsofTreePairs: In the case of a spanning treeα consistingof ordinary

edgesonly,thespanningtreepairsonlywithitself,andweneednotknowifdet[Af]α=+1or−1because

ϵαα=det[Af]·det[Af]=+1.

Butfortreepairs(α,β)consistingofnonordinaryedges(andthereforeα≠β,wemustknowtherelative(notabsolute)signsofthespanningtreesineachpair.

Page 465: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

AccordingtothemethodofsigndeterminationdiscussedinChapter9,forthetreepairinFig.13-7,

[(1,2,5,6),(1,2,4,6)], ϵαβ,=+1,

andfor

[(1,3,5,6),(1,3,46)], ϵαβ=+l.

ThusΔNasasumoftheeightspanningadmittanceproducts(α,αpairings)andtwoadditionaltermsdueto(α,β)pairingsisexpressedas

Noteonceagainthatthereisnocancellationofterms.ThederivationofcofactorsΔijforactivenetworkscanbecarriedonsimilarly

by a combination of the technique discussed in Section 13-4 and the use ofspanning-treepairs.

SUMMARY

Thetechniquedevelopedinthischaptercanbeextendedtosolveanylinear-systemproblem.Roughlyspeaking,anylinear-systemproblemcanbeexpressedinthefollowingform:

AX*=Y*,

where∧isalinearoperator,Y*aknownvector,andX*anunknownvectorforwhichthesolutionissought.A standard method of solving this equation is to find an operator ∧-1

(assumingitexistsandisunique),theinverseofA,andthentopremultiplybothsidestoobtaintherequiredvector

X*=∧-1Y*.

Page 466: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Inanelectricalnetworkconsistingof lumped, linear, time-invariantdevices,the problem consists of solving a set of simultaneous, linear, differentialequations with constant coefficients. Application of the Laplace transformconverts these differential equations into linear algebraic equations. Thus theoperatorAisamatrixwhoseentriesarefunctionsofs,theLaplacevariable,andY*isthevectorofindependentdrivingvoltages(orcurrents).Thus the electrical network problem (like most linear-system problems)

consistsofmatrixinversion,whichisthesameasfindingthedeterminantsandcofactors.Andallthathasbeendoneinthischapteristoshowhowgraphtheorycanbeused (rather thanalgebra) toevaluatedeterminantsandcofactorsof thenonsingularmatrix∧,if∧couldbeexpressedasatriplematrixproduct

∧=PMPT,

wherePisaunimodular(0,l)-matrix—areducedincidence(orfundamentalcut-setor fundamentalcircuitmatrix)ofagraph—describing the“structure”ofA;andMisamatrixdescribingthevaluesofthenonzeroentriesinA.The same approach can be used for solution of any lumped, linear, time-

invariant system, provided a “system graph” can be found. This has a directbearing on the realizability problem discussed in Section 12-5, as to when agivenunimodularmatrixPcanbethecut-setorcircuitmatrixofagraph.Whether there is any computational advantage in using graph theory for

networkanalysisistotallydependentonwhetheronecangenerateallspanningtrees,2-trees,and the like,ofa largegraph rapidlyandwithoutduplication.Agraph ofmoderate size (20 vertices and 50 edges) could have severalmillionspanningtrees.Eventhestoringofallthetreesinacomputermemorycanbeaproblem.Thealgorithmshouldthereforebesuchthatspanningtreesarerapidlygenerated, one at a time, and its admittance product is added to or subtractedfrom (depending on the sign) the cumulative sum. The algorithm shouldguarantee that no spanning treewill be generated twice, so that one does nothave to check every newly obtained tree against all the trees previouslygenerated.Moreover,thealgorithmmustalsoguaranteethatnospanningtreeinthegraphisleftout.As discussed in Chapter 11, a number of algorithms for generating all

spanningtreesofagraphhavebeenproposedintheliterature.Thebestonesdogenerate one spanning tree at a time without duplication and generate allspanning trees. But the algorithms are still not as efficient as one would likethemtobe.

Page 467: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

REFERENCES

Thebareessentialsoftopologicalanalysisofnetworkshavebeenpresentedinthischapterforthepurposeofintroducingthereadertotheapplicationofgraphtheorytoelectricalnetworkanalysis.Nothing,forinstance,wassaidabouttheapplicationofgraphstothesynthesis

ofelectricalnetworks.Nordidwediscuss theextensionof these techniques tononlinear networks.We confined ourselves to the frequency-domain analysis,anddidnotconsiderthetime-domainanalysisviastate-spacetechniques.Manyother topics, such as theduality in electrical networksor stability of electricalnetworks,werealsonotcovered.Fortheseandmore,thereadermaygotooneofseveralbooksandscoresof

researchandtutorialpapersavailableonthesespecificsubjects.SeshuandReed[1-13]istheclassicandoneofthebestbooks.KimandChien[13-5]isanotherexcellentbook.Chan’sbook[13-3]includesthestate-spaceapproach,whichisnotdealtwithinSeshuandReedorinKimandChien.SomeoftheexcellentsurveypapersarebyBryant[13-1],Dawson[13-4],and

Kuo[13-6].Thesepapersalsoincludealargebibliographyonthesubject.Forthesakeofsimplicityinthecaseofnetworkswithactivedevices,Talbot’s

[13-7] approach of a single graph was used rather thanMayeda’s method ofdealingwithtwodifferentgraphs—voltageandcurrentgraphs.A list of classical papers, such as those of Kirchhoff, Maxwell, Percival,

Mayeda, Bashkow, Bryant, and others, can be found in almost any of thereferencescited.

13-1. BRYANT,P.R.,“GraphTheoryAppliedtoElectricalnetworks,”Chapter3 inGraphTheoryandTheoreticalPhysics (F.Hàrary, ed.),AcademicPress,Inc.,NewYork,1967.

13-2. CALAHAN, D. A., Computer-Aided Network Design, Revised Edition,McGraw-Hill,Inc.,NewYork,N.Y.,1972.

13-3. CHAN, S.P., IntroductoryTopologicalAnalysis ofElectricalNetworks,Holt,RinehartandWinston,Inc.,NewYork,1969.

13-4. DAWSON, D. F., “The Topological Approach to Computer-AidedAnalysis,” Chapter 2 inComputerOrientedCircuitDesign (F. F.KuoandW.G.Magnuson,eds.),Prentice-Hall,Inc.,EnglewoodCliffs,N.J.,1969.

13-5. KIM, W. H., and R. T. CHIEN, Topological Analysis and Synthesis ofCommunicationNetworks,ColumbiaUniversityPress,NewYork,1962.

13-6. KUO,F.F.,“NetworkAnalysisbyDigitalComputer,”Proc.IEEE,Vol.

Page 468: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

54,June1966,820–829.13-7. TALBOT,A.,“TopologicalAnalysisofGeneralLinearNetworks,”IEEE

Trans.CircuitTheory,Vol.CT-12,June1965,170–180.

PROBLEMS

13-1. Show thatKirchhoff’svoltage andcurrent laws imply “conservationofpower.”[Hint:UsingEqs.(13-5)and(13-7),showthat .]

13-2. Anelectricalnetworkwitheedgeshas2eunknowns(thecurrentthroughandvoltageacrosseachedge).Identifythe2eindependentequations,anddiscusstheexistenceanduniquenessofthesolutions.

13-3. Kirchhoff’s current law may be expressed in more general form asfollows:Thenetsum(takingintoaccounttheorientations)ofallcurrentsflowing across a cut-set is zero. Using a cut-set matrix (instead ofincidencematrix) and this form ofKCL, develop equations parallel toEqs.(13-2),(13-7),(13-8),(13-15),and(13-17).

13-4. InFig.13-2(b)listallspanningtreesandall2-trees(N3N1,N5).13-5. InFig.13-4(a)sketchall2-trees(2,4)andall2-trees(23,4).13-6. OfKirchhoff’s andMaxwell’s formulas,whichonewill youprefer for

evaluatingΔNandΔL?Why?13-7. InFig.13-2,assumetheresistancevalueRiorcapacitancevalueCi (as

thecasemaybe)intheithedgeofthenetwork.Letx(t)bethevalueoftheindependentvoltagesourceshown,andletN5bethereferencenode.Convert x(t) into an equivalent current source in parallel withR1. UseMaxwell’s formula toevaluateΔN andΔ31.Using these twoquantities,evaluatethevoltageatnodeN3.

13-8. In Problem 13-7, keep the voltage source in series withR1.Write theloop-impedance matrix Z(s) of the network. Write ZL(s). Evaluate ΔLusingEq.(13-27).EvaluatetheappropriatecofactorofZL(s)requiredforobtainingV2(s).Finally,obtainV2(s),andcomparetheresultwiththatofProblen13-7.

13-9. Inastep-by-stepfashionderiveEq.(13-24).13-10. ForanRLCnetwork,provethat

Page 469: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

[Hint:Yi(s)Zi(s)=1,andthereforeforeachspanningtreeTinthenetwork,

13-11. Similarly to Eq. (13-20), show that the (i,i)th cofactor of the loopimpedancematrixZL(s)ofanRLCnetworkGisequaltothesumofthechord impedance products for all spanning trees of the network G’,obtainedfromGbydeletingtheithchord.

13-12. Attempt an expression for the (i,j)th cofactor of the loop impedancematrixZLofanRLCnetwork.

13-13. In deriving expressions for ΔN and ΔL, we tacitly assumed thenonsingularities ofYN(S) and ZL(s).Discuss the requirements imposedon an electrical network because of the nonsingularity requirements.[Hint: The network should have (1) each voltage source only in serieswithsomepassiveelement,(2)eachcurrentsourceonlyinparallelwithsome passive element, and (3) no perfectly coupled transformer; i.e.,L1L2> .]

13-14. Let Af be the (n − 1) by e reduced incidence matrix of a connected(directedorundirected)graphGofnverticesandeedges,withrespecttosome reference vertex r. And letGt be the graph obtained fromG byfusing its ithvertexwith the referencevertexr,andremovinganyself-loops produced in the process. Prove thatAf-i, the (n − 2) byematrixobtainedfromAfbydeletingitsithrow,isthereducedincidencematrix(withthefusedvertexasthereferencevertex)ofGi.[Hint:InGithen−2 vertices have exactly the same incidences as they had in G.Correspondingly, then−2 rowsofAf are left intact inAf-i.Theedgesincident between r and i are gone, but the edges thatwere incident oneitherroributnotonbothhaveoneendincidentonthefusedvertex.]

13-15. In Problem 13-14, show that the product of any two correspondingnonzeromajorsof(n−2)byeunimodularmatricesAf-iandAf-jisequalto (−1)i+j, providing the rows and columns of both these matrices arearrangedinthesameorder.

13-16. DrawadualelectricalnetworktotheoneinFig.13-2,andthenstudythedual relationshipbetweenvariousquantitiesbetween the twonetworks,suchastheloopequationsinonebeingthenodeequationintheother.

Page 470: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

13-17. For a one-port RLC network, shown in Fig. 13-8(a), show that thedrivingpointadmittanceatterminals(1,r)is

Fig.13-8One-andtwo-portRLCnetworks.

13-18. A two-port network has four short-circuit admittance functions.Derivethe topological formula for each in the two-port RLC network withcommonreferencevertexrshowninFig.13-8(b).

Page 471: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

14GRAPHTHEORYINOPERATIONSRESEARCH

Graphtheoryisaverynaturalandpowerfultoolincombinatorialoperationsresearch.Inearlierchapterswehavealreadyappliedgraphtheorytooperations-research problems. The traveling-salesman problem (Chapter 2), finding theshortest spanning tree in a weighted graph (Chapter 3), obtaining an optimalmatchingof jobs andmen (Chapter 8), and locating the shortest pathbetweentwo vertices in a graph (Chapter 11) are some examples of the uses of graphtheory in operations research. This chapterwill be devoted entirely to solvingproblems in operations researchusinggraph-theoretic tools.We shall considerthree related areas of operations research in which graph theory is usedmostfrequently and profitably. They are transport networks, activity networks, andthetheoryofgames.

14-1.TRANSPORTNETWORKS

InSection4-6wesawhowagraphcanbeusedasamodelforanetworkofpipelines through which some commodity is transported from one place toanother. The general problem in such a transport network (also called a flownetwork)istomaximizethefloworminimizethecostofaprescribedflow.Thisisanoperations-researchproblemandcanbesolvedbylinearprogramming,butthe graph-theoretic approach has been found to be computationally moreefficient. In this section we shall see how network-flow problems can beformulatedandsolvedusinggraphs.Letusfirstdefinesometerms.

Transport Network: A simple, connected, weighted, digraphG is called atransport(orflow)networkiftheweightassociatedwitheverydirectededgeinG is a nonnegative number. In a transport network this number represents thecapacityoftheedgeandisdesignatedascijfortheedgedirectedfromvertexitovertexj.AtransportnetworkisshowninFig.14-1,wherethenumberswritten

Page 472: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

besidetheedgearetheedgecapacities.

Fig.14-1Transportnetwork.

Thecapacitycijofanedge(i,j)canbethoughtofasthemaximalamountofsomecommodity(suchaswater,gas,electricalenergy,numberofcars,bitsofinformation,etc.)thatcanbetransportedfromstationitoj,alongtheedge(i,j),perunitoftimeinasteadystate.Thenanaturalquestionis:Whatisthemaximalamountofthecommodityflowfromagivenvertexstoanotherspecifiedvertextviatheentirenetwork?Letusfirstformulatethequestionmathematically.

Maximalflow:InagiventransportnetworkG,a.flow(orastaticflow)isanassignmentofanonnegativenumberfijtoeverydirectededge(i,j)suchthatthefollowingconditionsaresatisfied:

1. Foreverydirectededge(i,j)inG

2. ThereisaspecifiedvertexsinG,calledthesource,forwhich

wherethesummationsaretakenoverallverticesinG.Quantitywiscalledthevalueoftheflow.

3. ThereisanotherspecifiedvertextinG,calledthesink,forwhich

4. All other vertices are called intermediate vertices. For each intermediatevertexj,

Page 473: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Condition (14-1) states that the flow through any edge does not exceed itscapacity.Theotherthreeconditionsstatethatthenetflowoutofthesourceisw,thenet flow into the sink isw, and the flow isconservedat each intermediatevertex.Thisiswhywiscalledthevalueoftheflowfromstot.Condition(14-3)can,infact,bederivedfrom(14-2)and(14-4),andisthereforenotindependent.Itisunderstoodthatifthereisnoedgefromvertexptoq,fpq=0.Anedge(i,j)forwhichfij=cijissaidtobesaturated.Asetofflowsfij’sforall(i,j)’sinGiscalledaflowpattern.Aflowpattern

that maximizes the quantity w is called a maximal flow pattern. The firstproblem one encounters in a transport network is: GivenG, s, and t, find amaximalflowpattern.

Linear Programming Formulation: Those familiarwith linear programming(LP)will recognize this as an LP problem.As an example, take the transportnetworkinFig.14-1.Thevariablesaretheflowsthrougheachofthe10edges.Althoughw= fab+ fsd− fcs,wecanregardwasanothervariable.Let theflowpatternbedenotedbyacolumnvectorf:

andlet

denotethevariablevectoroftheLPproblem.Lethdenotetherowvector

(1,0,0,0,0,0,0,0,0,0,0).

Page 474: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

(1,0,0,0,0,0,0,0,0,0,0).

Thentheproblemistomaximizeh·f′subjecttotheconstraints

A′·f′=0,f≤c,andf′≥0,

where

and

ObservethatA′istheincidencematrixofadigraphobtainedbyaddinganedgefromttosinthetransportnetworkofFig.14-1.Alsonotethattheedgesinf,c,andA′mustappearinthesameorder.Clearly,amaximalflowcanbeobtainedbysolvingthisLPproblem,but,as

mentioned earlier, the graph-theoretic approach is more efficient. Using thegraph-theoretic concept, we shall now state and prove the max-flow mincuttheorem,themostimportantresultinthetheoryoftransportnetworks.

CutandItsCapacity:Ignoringthedirectionsofedgesinatransportnetwork,letusconsideracut-setwithrespecttoverticessandt,thatis,acut-setwhich

Page 475: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

separatesthesourcesfromsinkt.Suchasetofedgesinatransportnetworkiscalledacut.Thenotation(P, )isusedtodenoteacutthatpartitionstheverticesintotwosubsetsPand ,wherePcontainssandPcontainst.Thecapacityofacutdenotedbyc(P, ) isdefinedtobethesumofthecapacitiesofthoseedgesdirectedfromtheverticesinsetPtotheverticesin ;thatis,

Forexample,inFig.14-1thecut(dashedline)separatingP={s,b}from ={c,d,t}hasacapacityof5+5+2=12.

THEOREM14-1

InagiventransportnetworkG,thevalueofflowwfromsourcestosinktislessthanorequaltothecapacityofanycutseparatingsfromt.

Proof:Let(P, )beanarbitrarycutsuchthatthesourcesisinvertexsetPandthesinktisinvertexset .LetuswriteEq.(14-4)forallintermediateverticesinPandaddthemtoEq.(14-2).Thisyields

whichcanberewrittenas

But

Therefore,

Since isalwaysanonnegativequantity,wehave

Page 476: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Inthefollowingtheoremweshallprovethatitispossibletoachieveavalueoftheflowwhichequalsthecapacityofthesmallestcutseparatingsfromt.

THEOREM14-2(MAX-FLOWMIN-CUTTHEOREM)

Inagiven transportnetworkG, themaximumvalueofa flowfroms to t isequaltotheminimumvalueofthecapacitiesofallthecutsinGthatseparatesfromt.

Proof:InviewofTheorem14-1weneedonlytoprovethatthereexistsaflowpatterninGsuchthatthevalueofthefloww0fromstotisequaltoc(P0 )thecapacityofsomecut(P0, )separatingsfromt.LettherebesomeflowpatterninGsuchthatthevalueoftheflowfromstot

isat itsmaximumpossiblevaluew0.DefineavertexsetP inG recursivelyasfollows:(a)s∈P.(b)Ifvertexi∈Pandeitherfij<cijorfji>0,thenj∈P.AnyvertexnotinP

belongsto .NowvertextcannotbeinP.Ifitwere,therewouldbeapathρ(seeFig.14-2)

froms to t,say,s,v1v2, . . .,vj,vj+1 . . . ,vk, t,forwhichineveryedgeeitherflowfvjvj+1<Cvjvj+1orfvj+1vj>0.Inpathρanedge(vjvj+1)directedfromvjtovj+1iscalledaforwardedgeandanedge(vj+1,vj)directedfromvj+1tovjiscalledabackwardedge(Fig.14-2).

Fig.14-2PathρintheproofofTheorem14-2.

Inpathρletδ1betheminimumofalldifferences[cVjvj+1−fvjvj+1]inforwardedgesandδ2betheminimumofallflowsinbackwardedges.Bothδ1andδ2arepositivequantities.Letδ=mjn(δ1,δ2).Then the flow in thenetworkG canbeincreasedbyincreasingtheflowineachforwardedgeanddecreasingtheflowineachbackwardedgebyanamountδ.[Conditions(14-1),(14-2),(14-3),and(14-4)arestillsatisfied.]Thiscontradictstheassumptionthatw0wasthemaximumflow.

Page 477: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Thus tmust be in thevertex set . Inotherwords, the cut (P, ) separates sfromt.Furthermore,accordingtocondition(b),foreachvertexpinPandiin ,wehave

fpi=cpiandfip=0.

Therefore,fromEq.(14-5)wegetthevalueoftheflow:

whichprovesthetheorem.

Asanexample,letusconsiderthetransportnetworkofFig.14-1,onceagain.Ithaseight(23)cutsthatseparatesfromt.Thesecuts(identifiedbyvertexsetP)andtheircapacitiesare

VertexSetP c(P, ){s}{s,b}{s,c}{s,d}{s,b,c}{s,b,d}{s,c,d}{s,b,c,d}

9121971110168

ThecutwithminimumcapacityamongtheseistheoneinwhichP={s,d}andis{b,c, t}.Themaximumflowpossible ins to t in thenetwork is therefore7units.The proof does not include an algorithm for finding the actual value of the

maximal flowwmax.Nordoes itgivea flowpattern that realizes thismaximalflow.Ifwewereinterestedonlyinfindingwmax,wewouldtakesomealgorithmfor generating aminimal cut (see, for instance, Plisch [14-19] for an efficientcomputer code togenerate allminimal cuts in agiven transport network), andthencomputeitscapacity.Forthosewantingtoconstructamaximalflowpattern,analgorithmbasedon

Page 478: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

theforegoingproofofthemax-flowmin-cuttheoremisalsoavailable.Thisisanefficient algorithm, and it uses a vertex-labeling process for constructing amaximal flow pattern. However, the proof that this algorithm terminates in afinitenumberofstepsdependsontheedgecapacitiesbeingintegers.Formoreonthislabelingalgorithmanditsmodifications,see[14-7],[14-9],or[14-12].

14-2.EXTENSIONSOFMAX-FLOWMIN-CUTTHEOREM

Themax-flowmin-cuttheoremasstatedisapplicabletoatransportnetwork(simple,weighted,connecteddigraph)withonesourceandonesink.Thereare,however, many other types of network-flow problems that can be solved byextending the max-flow min-cut theorem appropriately. Some of theseextensions are straightforward and others are quite involved. Let us considertheminincreasingorderofdifficulty.

1. MultipleSourcesandSinks:Ifthereareseveralsourcess1,s2,...,skandseveralsinkst1,t2,...trandiftheflowfromanysourcecanbesenttoanysink, then this problem can be converted immediately into a one-sourceandone-sinkproblemasfollows:Introduceasupersourceswithedges(ofunlimited capacity) directed to sl, s2, o.., sk and a supersink twith edges(alsoofunlimitedcapacity)directedfromt1,t2...,tr,asshowninFig.14-3.Theproblemofmaximizingthetotalvalueoftheflowfromallsourcesisthenthesameasthatofmaximizingthevalueoftheflowfromstot.

Fig.14-3Multi-sourcemulti-sinktransportnetwork.

However,iftherestrictionismadethattheflowfromaspecifiedsourcesimustbesenttoaspecifiedsinkti,theproblembecomesmuchmoredifficult.Suchaflow,knownasthemulticommodityflow,willbediscussedshortlyasaseparatetopic.

2. Vertices with Specified Capacity: Suppose that we have a transportnetworkinwhichsome(orall)verticesalsohavespecifiedcapacities.The

Page 479: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

totalflowintoavertexvmustnotexceeditscapacityc(v),arealpositivenumber.Thisnetworkcanbeconvertedintoanordinarytransportnetworkby replacing each suchvertexvwith twoverticesv′ andv″ and an edgefrom v′ to v″with capacity c(v). All edges originally incident into v aremade incident intov′ and all edges originally incident out ofv aremadeincidentoutofv″,asillustratedinFig.14-4.

Fig.14-4Replacementofavertexvwithv′andv″.

3. NetworksContainingUndirectedEdges:Oftenoneencounterstheproblemofmaximizingaflowthroughanetworkinwhichsomeoralloftheedgesare undirected. In such a network an undirected edge between verticespandqofcapacitycpqimpliesthattheflowcanoccurineitherdirection,and

fpq≤Cpq,fqp≤Cpq.

Moreover,sincesimultaneousflowsinoppositedirectionscanceleachother,theflowisassumedtobeinonlyonedirection.Thatis,

fpq·fqp=0.

Thusthemaximum-flowprobleminanetworkcontainingundirectededgescanbesolvedby replacingeachundirectededgewithapairofoppositelydirectededges,eachhavingacapacityoftheoriginaledge.†

4. Lower Bound on Edge Flows: So far we have assumed that the lowerbound on a flow through an edge in a transport network is zero.Occasionally,oneencountersapracticalsituationthatrequiresaminimumflowbijthroughanedge(forinstance,anoilpipelineinAlaskamayneeda

Page 480: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

specifiedminimumflowtokeepitfromfreezing).Thatis,conditions

replace(14-1),wherebijisanonnegativerealnumbernolargerthancij.Forsomenetworktheremaynotevenexistafeasibleflowpattern,thatis,one

whichsatisfiestheconstraints(14-2),(14-3),(14-4),and(14-6).Forexample,allfij=0isnotafeasibleflowpattern,unlikeinthecasewithnolowerboundsontheedge flows.Therefore,wehave to firstdetermine if indeed there is a flowpatterninG thatsatisfiesalltheupperandlowerbounds,andifsohowdowegetaflow.ItcanbeshownusingtheargumentsofTheorem14-1thatthevaluewforany

feasible flowpatternmust satisfy the following simultaneous requirements foreverycut(P, )inGseparatingsandt:

where

Furthermore,analogoustoTheorem14-2,itcanbeshownthatifthereexistsaflow pattern satisfying the lower and upper bounds, a maximum flow can beachieved,andthevalueoftheflowequalstheminimumvalueofthequantity

taken over all cuts (P, ) separating vertices s and t. Similarly, the minimumvalueofaflowequalsthemaximumvalueof

takenoverallcuts(Q, )separatingverticessandt.The problem of determining conditions under which a flow pattern exists

satisfyingconstraints(14-2),(14-3),(14-4),and(14-6)isslightlymoreinvolved.The reader is referred to Liu [8-3], pages 270-275, or Chapter 2 of Ford andFulkerson[4-3]forfurtherdiscussions.

Page 481: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

5. LossyNetworks:Sofarwehaveassumedthattheflowdoesnotvaryalongan edge. In many practical transport networks, however, the flow doessuffer lossduringtransmission,dueto leakage,evaporation,andsoforth,Suchnetworksarecalledlossytransportnetworks(orlossynetworks).

Alossynetworkhasanadditionalparameter,calledefficiency,λij,associatedwitheachdirectededge(i, j).Foreachedge(i, j) therearetwoflows:flow fijentering the edge and flow leaving the edge.These quantities are related asfollows:

The efficiency λij is a positive number. It is less than unity if there is a lossduring transmission and is more than unity of there is a gain (for instance,improvementinthesignalduetorepeatersinacommunicationline).Ateachintermediatevertexthetotaloutgoingflowmuststillbeequatedtothe

total incoming flow. The larger of the two quantities fij and must still notexceed cip the capacity of the edge (i, j).As in the case of ordinary transportnetworks (inwhich λij = 1, for every edge), the goal is tomaximize the flowarrivingat the sink t.Moreover, for the samevalueof the flowarrivingat thesink, we may have different values of flow leaving the source. Therefore,anothergoalistofindaflowpatternthatgivesthemaximumflowarrivingatthesinkforaminimumamountleavingthesource.Thisiscalledanoptimalflowinalossynetwork.The max-flow min-cut theorem has been extended to lossy networks.

Conditionsforoptimalityhavebeenobtained,andalgorithmsforoptimalflowshavebeendevised.Fordetails,seethepaperbyOnaga[14-18]orpages277-288in[14-7].

14-3.MINIMAL-COSTFLOWS

Supposethatassociatedwitheachedge(i,j)inatransportnetworkGthereisan additional number dij, which may be thought of as the cost of unit flowthrough(i,j).Itisdesiredtoconstructaflowpatternsendingaspecifiedvaluewfromsources tosink t satisfyingconstraints (14-1), (14-2), (14-3),and(14-4),whichminimizesthetotalflowcost,

Page 482: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

overallflowsthatsendwunitsfromstot.Thisisoneofthemostpracticalproblemsinnetworkflows.Itisalsoaclassic

problem in linear programming and is known as the transportation problem.Many problems in operations research can be formulated as a transportationproblem.Tofinda flowpattern thatminimizes thecost,westartwithaminimal-cost

directedpathfromstotandsaturatethispath(i.e.,assignaflowtothepathsuchthat at least one edge in the path reaches its capacity). Then by using thefollowing theorem recursively we obtain the minimal-cost flow pattern ofdesiredvalue.LetuscallapathfromstotunsaturatedforagivenflowinGiffij≤cijforeveryforwardedge(i,j)andfij≥0foreverybackwardedge(seeFig.14-2).

THEOREM14-3

Let fbetheminimal-costflowpatternofvaluew froms to t.Thentheflowpattern f′, obtained from f by adding δ ≤ 0 to the flow in forward edges of aminimal-costunsaturatedpath,andsubtractingδfromtheflowinthebackwardedgesofthepath,isaminimal-costflowofvaluew+δ.

This theorem is of central importance in constructing minimal-cost flowpatterns. For a formal proof of this intuitively obvious result, the reader isreferredtoFordandFulkerson[4-3],pages121-122.Theorem14-3statesthatateverystageofconstructioneachadditionalunitofflowistobesentthroughtheleast-cost available path.All unsaturated paths from s to t are available paths,andincomputingthecostofanavailablepathponetakesintoaccountnotonlythecostofaddingtheflowtotheforwardedgesinpbutalsothesavingsduetoreduction of existing flows in the backward edges of p. Let us illustrate theapplicationofthetheoremwithanexample.InFig.14-5wehaveatransportnetwork.Ofthepairofnumberswrittennext

toanedge,thefirstnumberisthecapacitycijandthesecondoneisthecostdtjofaunitflow.Tofindaminimal-costmaximalflowfromstot,wegothroughthefollowingsteps.

Page 483: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.14-5Minimal-costflow.

1. The minimal-cost path is syxt, and total path cost is 4. We can send amaximumpossibleflowof11unitsthroughthispath,thussaturatingedge(y,x)inthispath.

2. Wemodifythenetworkbysubtracting11fromthecurrentcapacitiesofalledgesinsyxt.Setdyx=∞.

3. Inthemodifiednetwork,theminimal-costpathfromstotissxt.Thecostis 5.We sent themaximum possible flow of 3 units through sxt, whichsaturatesedge(x,t)inthepath.

4. Wefurtherupdatethenetworkbysendingthecapacitiesinthepathsxtandsettingdxt=∞.

5. Intheresultingnetworktheminimal-costpathissyztofcost6andcapacity5.Sending5unitsofflowthroughsyztsaturates(s,y).

6. AppropriateupdatingyieldsthenetworkinFig.14-5(b).

7. InFig.14-5(b)theminimal-costpathissxyztwithacostof4–2+3+2=7.Sending3unitsalongthispathsaturatesacut-setandthusthealgorithmterminates.ThedesiredflowpatternobtainedisgiveninFig.14-5(c).Thevalueoftheflowfromstotis11+3+5+3=22units,andthecostis4×

Page 484: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

11+5×3+6×5+7×3=110.

14-4.MULTICOMMODITYFLOW

Insomepracticalsituationsitbecomesnecessarytodealwithseveraldistinctcommodities flowing simultaneously through a given transport network. Eachcommodity has its own source and its own sink. All flows share the edgecapacity, and therefore, as in the single-commodity case, the sumof all flowsthroughanedgemustnotexceedthecapacityoftheedge.Foreachcommoditytheflowispreservedateveryintermediatevertex.For illustration, let us consider the transport network in Fig. 14-6 through

whichcommodities1and2areflowing.Commodity1istobetransportedfroms1tot1andcommodity2froms2tot2.Foratwo-commoditycase,let and betheflowsofcommodities1

Fig.14-6Two-commoditytransportnetwork.

and2, respectively, throughanedge (i, j) inG.Then,analogous to thesingle-commoditycase,theconstraintsinFig.14-6are

and

Page 485: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Theseconstraintscanbeeasilywrittendownforak-commodityflow.Insuchflows two problems are usually raised: (1) Construct patterns for all k-commoditiessuch that the total sumof the flowvaluesw1+w2+ . . .+wk ismaximized;(2)Giventheflowvaluesw1,w2,...,wkforeachcommodityandanetworkG,findoutifthesevaluesofflowscanbeachievedsimultaneously.Simplysendingthemaximumamountofeachcommoditywillnotingeneral

maximizethetotalvalue.ThiscanbeseeneveninthesimplecaseofFig.14-6.Ifwemaximizew1 alone,wegetw1=15andw2=0.On theotherhand, themaximum value of w1 + w2 is obtained with w1 = 5 and w2 = 20. Thus tomaximize the total value,wemustknowhow to allocate commodities to eachedge.There is no result similar to the max-flow min-cut theorem for the

multicommodityflowingeneral.Onlyinsomespecialcases(suchaswhenGisundirected and there are only two commodities) has it been possible to get atheoremanalogoustothemax-flowmin-cuttheorem.Forfurtherreadinginthisspecializedandratherinvolvedtopic,theinterested

reader is referred toChapter11ofHu’sbook[14-12],Chapter3ofFrankandFrisch[14-7],andthePh.D.dissertationofSakarovitch[14-20].

14-5.ADDITIONALAPPLICATIONS

We have been discussing how various types of shipping problems can besolved bymeans of network-flow techniques. In addition to these, there are asurprisinglylargenumberofcombinatorialproblemsinoperationsresearchthatcan be formulated (and then solved) as network-flow problems. Take forinstancethematchingorassignmentproblemdiscussedinSection8-4.WehavepmenMl,M2,...,MpandqjobsJ1,J2,...,Jqanditisknownwhichmenarequalifiedforwhichjobs.Whenisitpossibletofillalljobswithqualifiedmenorwhenisitpossibletoassigneachmanajobheisqualifiedfor?Theproblemcanbeformulatedasanetwork-flowproblem,asshowninFig.

14-7.Constructap-sourceq-sinkflownetwork,suchthatanedge(Mi,Jk)existsifandonlyifmanMiisqualifiedforjobJk.Joinallsourcestoasupersourcesandallsinkstoasupersinkt.Assigncapacitiesofoneunittoeach(s,Mi)andtoeach (Ji, t).The capacities of the remaining edges aremade infinite.Then theoptimal assignment problem becomes that of constructing a flow patternwithmaximumvaluefromstot.

Page 486: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.14-7Flownetworkforanassignmentproblem.

Observethatinsuchaflowpattern

fsMi=1, ifithmanisassignedtoajob,

=0, otherwise,fJki=1, ifkthjobhasbeenassigned,

=0, otherwise,fMiJk=1 ifithmanisassignedtothekthjob,

=0, otherwise.

More complicated personnel assignment problems have been formulated intermsofnetworkflow.Numerousothertypesofproblemshavealsobeensolvedas flow problems. For these the reader is referred to the bibliography in thesurveypaperbyFulkerson[14-9].

14-6.MOREONFLOWPROBLEMS

Flow problems may be looked upon as a generalization of connectivityproblems,studiedinChapter4.Thestudyofconnectivityinvolvesasearchforpathsbetweenpairsofverticesinagraph.Apathfromavertexxtoavertexyimpliesthatsomeamountofflowcanbesentfromxtoy.Tofindhowmuch,wehavetoconsiderthecapacitiesoftheedgesinthepath.Themaximumnumberofedge-disjointpathsbetweenapairofverticesx,yis

equaltotheminimumnumberofedgesthatwhenremovedfromthegraphleavenopathbetweenx andy.Thisnumber isprecisely thenumberofedges in thesmallestcut-setwithrespect toxandy.Thisconcept,whenapplied toagraph

Page 487: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

withedgecapacities,becomesthemax-flowmin-cuttheorem.Itequatesthesumofmaximumcapacitiesofpathsbetweenxandytothecapacityoftheminimumcut-setwithrespecttoxandy.

Fig.14-8Sometypesofflownetworks.

Page 488: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

It is natural to seek results as elegant as themax-flowmin-cut theorem formoregeneral networks.Somegeneralizations are easilymade.Others, such asforthemulticommodityflow,havenotbeenpossiblesofar.AsummaryofsomecommontypesofflownetworksisgiveninFig.14-8.It is interesting to compare transport networks with electrical networks,

studiedinChapter13.Atransportnetworkcanbethoughtofasaspecialtypeofresistornetwork thatobeysKirchhoff’scurrent law(KCL),butnot thevoltagelaw(KVL).Moreover, theresistorshavenoresistanceforcurrents(i.e., flows)up to a certain value cij and then have an infinite resistance for current largerthan that. In such a network no voltage (potential, pressure, or tension) existsacrossanybranch.Conversely, an electricalnetworkproblemcanalsobe formulatedas a flow

problem.ConsideraresistornetworkGwithcurrentsourcesinwhichwewishtofind currents (i.e., flows) fij flowing through every edge (i, j). The upper andlowerboundsonthecurrentsare

ctj=∞,btJ=–∞.

TheflowpatternmustsatisfyKCL;thatis,

foreveryvertexjinG.TheflowpatternmustalsosatisfyKVL.ItwasobservedbyJ.C.Maxwellin1893thatamongallflowpatternssatisfying(14-4)theonethatminimizesthepowerdissipation

istheonethatsatisfiesKirchhoff’svoltagelawalso.Quantityrijistheelectricalresistance of the edge (i, j). [That minimization of (14-8) is equivalent tosatisfyingKVL, assumingKCL, in a resistive networkwith current sources isleftasanexercise.]Thusanelectricalnetworkproblemcanbeviewedasaflowproblem,which

minimizesaquadraticflow-costfunction(14-8)subjecttolinearconstraints(14-4).Obviously,then,anelectricalnetworkproblem(subjecttoKCLandKVL)isnotanLPproblem.

Page 489: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

14-7.ACTIVITYNETWORKSINPROJECTPLANNING

Oneofthemostpopularandsuccessfulapplicationsofnetworksinoperationsresearchisintheplanningandschedulingoflargecomplicatedprojects.Thetwobest-knownnamesinthisconnectionareCPM(CriticalPathMethod)andPERT(Program Evaluation and Review Technique). A project is divided intomanywell-defined and nonoverlapping individual jobs, called activities. Due totechnical restrictions, some jobsmust be finished before others can be started(suchaswashingbeforedrying,puttingfoundationbeforeerectingwalls,etc.).In addition to this precedence relationship among the activities, each activityalsorequiresacertaintime,calledthedurationoftheactivity.Giventhelistofactivitiesinaproject,thelistofimmediateprerequisites(i.e.,predecessors)foreachactivity,andthedurations,aweighteddigraphcanbedrawntodepicttheproject, as follows:Each edge represents an activity, and itsweight representsthe duration of the activity. The vertices represent beginnings and endings ofactivities and are called events ormilestones in the project. An activity (i, j)cannotbestartedbeforeallactivitiesleadingtotheeventihavebeencompleted.Each event in the project is a well-defined occurrence in time (such as wallserected, shipment arrived, etc.). Such a weighted, connected digraphrepresentingactivitiesinaprojectiscalledanactivitynetwork.Let us take an extremely simple example. Suppose that we have a project

consistingofsixactivitiesA,B,C,D,E;andF,withtherestrictionthatAmustprecedeCandD;BandDmustprecedeE;andCmustprecedeF.ThedurationsfortheactivitiesA,B,C,D,E,andFare5,7,6,4,15,and2days,respectively.TheactivitynetworkofthisprojectisshowninFig.14-9.

Fig.14-9Activitynetwork.

Observethatanactivitynetworkmustbeacyclic;otherwise,wewouldhavean impossible situation in which no activity in the directed circuit could beinitiated—aviciouscycle.Alsoobservethatthevertexdenotingthestartoftheproject must have zero in-degree, since no activity precedes this vertex.

Page 490: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Likewise,thevertexdenotingtheterminationoftheprojectmusthavezeroout-degree,asnoactivityfollowsthisvertex.

DummyActivity:IntheexampleoftheactivitynetworkconsideredinFig.14-9, supposewehadanadditional restriction that activityF couldnotbe startedbeforeBandDwerecompleted.Wecanincorporatethisprecedencerelationshipbydrawinganedgefromvertexxtoy(Fig.14-10).Suchan

Fig.14-10Dummyactivityinanetwork.

edge, which represents only a precedence relationship and not any job in theproject, is called adummy activity.Dummy activities become necessarywhenthe existing activities are not enough to portray all precedence relationshipsaccurately.Alldummyactivitiesareofzerodurationandareusuallyshowninbrokenlines.Twoparalleledges(i.e.,activitieshavingthesameimmediatepredecessorand

the same immediate successor) may be replaced by a single edge, combiningbothactivitiesintoone[Fig.14-11(a)].If,however,theactivitiesaretobekepttrackofseparately,thenadummyactivityandadummyeventmustbecreated[Fig.14-11(b)].And,astherecanbenoself-loopinanactivitynetwork,wehaveonlysimpledigraphsforanactivitynetwork.

Page 491: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.14-11Replacementofparalleledges.

Anactivitynetworkcanbeassumedtohaveexactlyonevertexwithzeroin-degree and exactly one vertexwith zero out-degree. If there ismore than onevertex having zero in-degree, one arbitrarily selects one of these for the startevent anddrawsdummyactivities from this to theothervertices.Theverticeswithzeroout-degreesarehandledsimilarly.Inbrief,anactivitynetworkisarepresentationoftwoaspectsofaproject:(1)

precedence relationships among the activities, and (2) their durations. It is aconnected,weighted,simple,acyclicdigraphwithexactlyonevertexofzeroin-degreeandexactlyonevertexofzeroout-degree.

14-8.ANALYSISOFANACTIVITYNETWORK

Anewlyconstructednetworkshouldfirstbecheckedforanydirectedcircuit.Adirectedcircuitimpliesinconsistencyinthenetwork,whichmustbecorrected.AlthoughTheorem9-17givesanalgorithmforfindingwhetherornotadigraphhasadirectedcircuit,amoreefficientmethodisprovidedbytopologicalsortingofvertices,definedasfollows:TopologicalSorting:TheverticesofadigraphGaresaidtobeintopological

Page 492: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

orderiftheyarelabeled1,2,3,...,nsuchthateveryedgeinGleadsfromasmallernumberedvertex toa largerone.That is, foreveryedge (i, j) inGwehave i < j. The process of relabeling the vertices such that they are in atopological order is called topological sorting.Clearly, if a digraph contains adirectedcircuit, it isnotpossible toput itsvertices ina topologicalorder.Thefollowing construction procedure shows that the vertices of every acyclicdigraphGcanbeputinatopologicalorder.Startwithavertexwithzeroin-degreeandlabelit1.Deletevertex1fromG,

andintheremainingdigraph(G−1)findavertexwithzeroin-degreeandlabelit 2. From (G − 1) delete vertex 2 and repeat the process, till either (1) everyvertexislabeled,or(2)wefindasubdigraphginwhichthereisnovertexwithzeroin-degree.InviewofTheorem9-15,case(2)ispossibleonlyifgcontainsadirectedcircuit.Thuswecanstate

THEOREM14-4

Theverticesinadigraphcanbearrangedinatopologicalorderifandonlyifthedigraphisacyclic.

Topological sorting performs two functions in an activity network: (1) itdetects directed circuits, if any, in the network, and (2) it puts the events in atopological order 1, 2, 3, . . . , n, where 1 is the start event and n is thecompletioneventoftheproject.

Topologicalsortingisanimportantprocessinmanyproblemsbesidesactivitynetworkanalysis.Forexample,ifwewanttoarrangethewordsinaglossarysothatnotermisusedbeforeithasbeendefined,weresorttoatopologicalsorting.Weshallthereforepresentanalgorithmforthisimportantprocessinastep-by-stepfashion.

AlgorithmforTopologicalSorting

1. Seti←1.

2. Findanunlabeledvertexwithzeroin-degree,andlabelthisvertexi.Ifnosuchvertexexists,gotostep4.

3. Seti←i+1;andgotostep2.

4. IfeveryvertexinGhasbeenlabeled,stop.Otherwise,gotostep5.

5. Iftheout-degreeofanyvertexlabeledsofarisnonzero,removealledgesincident out of every labeled vertex and go to 2. If there are some

Page 493: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

unlabeled vertices and the out-degree of each of the labeled vertices iszero,wehaveadirectedcircuitinthenetwork,stop.

Notethattheremaybemorethanonetopologicalorderingoftheverticesinagivenacyclicdigraph,becauseat step2 in thealgorithm it ispossible tohavemorethanonevertexwithzeroin-degree.

Critical Path: Having made sure that the activity network G contains nodirected circuits and (in the process) having placed the vertices of G in atopologicalorder1,2,...,n,ournexttaskistodeterminetheprojectduration.Theminimumtimerequiredtocompletetheentireprojectisequaltothelength(i.e.,sumoftheactivitydurations)ofthelongestdirectedpathinG.(Thelongestdirected path is, of course, from1 ton.) The longest directed path is called acriticalpath(CP).TheverticesandedgesinaCParecalledthecriticaleventsandthecriticalactivities,becauseanydelayinthemwilldelaytheentireproject.InFig.14-9thecriticalpathisADEandtheprojectdurationis5+4+15=24days.Theremaybemorethanonecriticalpathinagivenactivitynetwork.Insteadofdeterminingthelongestpathonlyfrom1ton,letusdeterminethe

longestpathsfromvertex1toeveryvertexk inG,wherek=2,3, . . .,n.Thelengthofthelongestpathfrom1tokiscalledtheearliesteventtimeforeventk,becausethisistheearliestpossibletimeatwhicheventkcanberealized.Since digraphG is acyclic, the method of obtaining shortest paths from a

specified vertex to all others, given inChapter 11, can be easilymodified forfinding the longest paths. In fact, since the vertices are already topologicallyordered,thetaskisevensimpler.Let

tij=durationofactivity(i,j)inG,

andlet

T(k)=length(i.e.,time)oflongestpathfrom1tok, fork=1,2,3,...,n.

Clearly,T(1)=0.Vertex2canbe reachedonly fromvertex1 (becauseof thetopologicalorder),andtherefore

T(2)=T(1)+t12=t12.

Vertex3cannotbereachedfromanyvertexexceptfrom1and2.Therefore,

Page 494: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

T(3)=max[T(1)+t13T(2)+t23].

Similarly,vertex4canpossiblybereachedonlyfrom1,2,and3.Therefore,

T(4)=max[T(1)+t14,T(2)+t24,T(3)+t34].

Andsoon.Thegeneralexpressioncanthusbewrittenas

wherethemaximumisoverallverticesifromwhichthereisadirectededge(i,k)tovertexk.Thesolutionsoftheseequationscanbeperformedonebyone,andT(1),T(2),

...,T(n)obtainedsuccessively.Letustakeasimpleexample:

Fig.14-12Activitynetwork.

An activity network consisting of 8 events, 12 activities, and 1 dummyactivity is shown in Fig. 14-12. The event labels are shown inside the smallcircles representing thevertices.Theyare in topologicalorder1,2,3, . . . ,8.(Since the vertices are identified and the digraph is simple, the activity labelshavebeendispensedwith.)Thedurationsofactivities(insomeunitoftime)areshownnexttotheedges.LetuscomputetheearliesteventtimesT(i)fori=l,2,3,...,8.

T(1)=0,T(2)=t12=8,T(3)=10.

WithsuccessiveapplicationofEq.(14-9),weget

Page 495: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Similarly,

T(6)=21, T(7)=16, T(8)=28.

Thus the project duration T(8) = 28. The critical path is 1, 3, 5, 6, 8, and isshowninheavylinesinFig.14-12.Thiscomputationofearliesttimesoftopologicalorderedeventsbytracingthe

longestpathsfromvertex1tovertices2,3,...,n,successively,isreferredtoasforwardcalculation.

LatestEventTime:ToensurethattheprojectisfinishedattimeT(n),wehavetomakesurethatnoneofthecriticalactivitiesisdelayed.Thereis,however,acertain amount of latitude in scheduling noncritical activities. A noncriticalactivitymaybeallowedtoslip(andtherebysavemoneyornerves)toacertainextent without delaying the project completion. The latest time by which anevent k must be realized without increasing the project duration is called thelatesteventtimeT′(k).Forexample,inFig.14-12event7mayberealizedlatestby time unit 22 (and no later) without affecting the completion time of theproject.Itisnotdifficulttoseethatthelatesteventtimeisgivenbytherelation

T′(k)=T(n)–timetakenalonglongestpathfromvertexkton.Ifwereversethedirectionofeveryedgeinthenetwork,theverticeswillstill

be topologically sorted, but the orderwould be reversed,n, n − 1, . . . , 2, 1.Startingfromvertexn,onecouldmovetowardvertex1andcomputethetimestaken along the longest paths, using Eq. (14-9) successively in the reversednetwork.Startingwithrelation

T′(n)=T(n),

wegetthefollowingrecursiverelationforthelatesteventtimeforvertexk:

where theminimization isoververtices i towhich there isdirectededge (k, i)fromvertexk.Forexample,inFig.14-12,

Page 496: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

T′(7)=28−6=22,T′(6)=28−7=21,T′(5)=min[T′(7)−0,T′(6)−5]=16,

and so on. Table 14-1 shows all earliest and latest event times in the activitynetworkofFig.14-12.NotethatT(i)=T′(i)ifandonlyifvertexiisinacriticalpath.

Table14-1EarliestandLatestEventTimes

Slacks:Asameasureofmaximumlatitudeavailableinanoncriticalactivity,letuslookatthefollowingquantitycalledtotalslack(orfloat)ofactivity(i,j).

Quantitysijrepresentsthemaximumpermissibledelayinactivity(i,j),whichispossible when i is realized as early as possible, and j is delayed as much aspossible.Since each activity has two end vertices, each one of which has two time

values, it is possible todefine fourdifferent slacks for each activity.Wehaveconsidered only the most important one, the total slack. The second mostimportantslackisthefreeslack,vijdefinedas

Thisistheamountbywhichanactivity(i,j)canbedelayedwithoutdelayingtheearlystartofanyotheractivity.TotalslacksandfreeslacksforallactivitiesinthenetworkofFig.14-12areshowninTable14-2.Observe that the total slack sij = 0 if and only if (i, j) is a critical activity,

Page 497: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

whereasvijmaybezeroevenif(i,j)isnotacriticalactivity.Alsonotethatsij≥vij≥0.

Activity TotalSlack FreeSlack(1,2)(1,3)(1,4)(2,4)(2,5)(2,6)(3,5)(3,7)(4,5)(5,6)(5,7)(6,8)(7,8)

4064640840606

0020640240006

Table14-2TotalandFreeSlacksofActivitiesinNetworkofFig.14-12

Intheforegoinganalysisofanetwork,calledthecriticalpathmethod(CPM),wehaveaccomplishedthefollowing:

1. Checkedfordirectedcircuits.

2. Arrangedeventsintopologicalorder.

3. Identifiedcriticalpath(orpaths)andcomputedtheprojectduration.

4. ComputedearliesteventtimeT(k)foreachevent.

5. ComputedlatesteventtimeT′(k)foreachevent.

6. Computedslacksforeachactivity.

Havingidentifiedthecriticalactivities,wecanconcentrateonlyontheseandbyexpeditingthemreducethetotalprojectduration.Second, theslackscanbeutilizedtoreducethepeakdemandsforcertainmachinesorskilledworkers.

ProjectCostCurve:Althoughwehaveassumedaconstantdurationforeachactivity,inpracticeallocationofmoremoneycanusuallygetajobdonefaster.Givenafixedbudgetfortheproject,howshouldthemoneybeallocatedamongtheactivitiessothattheprojectiscompletedattheearliestpossibledate?Iffor

Page 498: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

eachactivitythetime-costrelationislinear,thisproblemcanbeshowntobeaminimal-costflowproblem(seepages151-162of[4-3]or[14-8]).Thesolutionoftheproblemwillbeacurveshowingprojectcostversusprojectduration,and,dependingonthebudget(orthetargetcompletiondate),onewouldpickapointonthiscurve.Suchacurveisknownastheprojectcostcurve.Often in activity networks, in addition to time and cost, there may be otherparameters, such as personnel required, shop facilities necessary, and so forth,associatedwitheachedge.InCPMnetworksactivitydurationswereassumedtobepreciselyknown.If

theactivitydurationsarerandomvariableswithgivenprobabilitydistributions,the network goes by the acronym PERT (Program Evaluation and ReviewTechnique).WhereasCPMfocusesonoptimizingthetotalprojectcost,PERTismore concerned with estimates of completion dates, scheduling requirements,and so forth. Activity networks with variations of these two are alsoencountered.

14-9.FURTHERCOMMENTSONACTIVITYNETWORKS

In this chapter vertices were used to represent events and the edges torepresentactivities.Thereisanotherrepresentationoftenusedintheliteratureinwhichtheverticesdenoteactivitiesandtheedgesrepresentonlytheprecedencerelationshipsamongtheactivities.Obviously,foragivensetofactivities thesetwowillyielddifferentgraphs.Forexample, theprojectactivitiesofFig.14-9areshowninbothrepresentationsinFig.14-13.

Fig.14-13Tworepresentationsforthesameactivities.

Itisnotdifficulttotransformtheevent-vertexrepresentationintotheactivity-vertex representation and vice versa (see [14-5]). In fact, the activity-vertex

Page 499: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

representation is the edge digraph (see Problem 9-16) of the event-vertexrepresentation, if we disregard the dummy activities in the latter. There is noneed of dummy activities in the activity-vertex representation. Both types ofrepresentations are widely used in the literature. Each has its own slightadvantageovertheother,butthereisnobasicdifferencebetweenthetwoasfarastheiranalysesareconcerned.The activity network and its application in project planning have been in

existenceonlysince1957. In these fewyears its successhasbeenspectacular.Computer programs for analyzing CPM and PERT networks are part of thestandard program library of almost every computing center. Large networksconsistingofthousandsofactivitiesareoftenanalyzed.Generally,thenetworkisconstructedfromalistofactivitiesandaprecedence

table.Generationof aprecedence table is amanual jobbecause it involves anintimate knowledge of the processes in the project. The construction of theactivitynetwork,includingthedummyactivities,fromtheprecedencetablecanbe relegated to the computer, although it is still done mostly manually.Constructionofacompositenetworkfromsubnetworkscanalsobeprogrammed[14-22].Atypicalcomputerprogramforcritical-pathanalysisconsistsofthreephases:

(1) cycle-checking and topological-sorting phase, (2) forward-time-calculationphase,and(3)backward-time-calculationphase.Shortcutshavebeensuggestedthat can complete the critical-path analysis in a single phase, and savecomputationtimeinthecaseoflargenetworks[14-17].Wehavepresentedthebareessentialsoftheactivitynetworkanalysis.Much

morecanbedonewithgraphtheoryinprojectplanning.

14-10.GRAPHSINGAMETHEORY

ThetheoryofgameshasbecomeanimportantfieldofmathematicalresearchsincethepublicationofthefirstbookonthesubjectbyJohnvonNeumannandOskarMorgensternin1944.Gametheoryisappliedtoproblemsinengineering,economics,andwarsciencetofindtheoptimalwayofperformingcertaintasksinacompetitiveenvironment.The general idea of game theory is the same as the one we associate with

parlor games such as chess, bridge, and checkers. The distinction between apuzzle and a game is that in a game one plays against one or more humanopponents,whereasapuzzleinvolvesasolitaryefforttosolveaproblem.Agamemaybeplayedbetweentwopersons,suchaschess,oramongmore

Page 500: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

thantwopersons,suchaspoker.Theformeriscalledatwo-persongameandthelatterann-persongame.Anotherclassificationofgamesisbasedonwhetherornot an elementof randomness is introduced, suchasbydiceor cards.A thirdelement in categorizing a game is whether or not a player has completeinformationonthepositionofagameateverymove.Agamesuchaschess,inwhich each player knows exactly where the game stands is called a perfect-information game. Bridge, in which one does not know what cards the otherplayershave, isan imperfect-informationgame.Agameiscalled finite ifeachplayerhasafinitenumberofchoicesavailableateachmoveandthegamemustendafter a finitenumberofmoves.An infinite game isone inwhichaplayerchoosesamovefromaninfinitesetofmoves.Weshallconfineourselvestothestudyoftwo-person,perfect-information,finitegameswithout chancemoves.A digraph is a natural representation of such agame.Thevertices represent thepositions (alsocalledstates) in thegameandtheedgesrepresentthemoves.Thereisadirectededgefromvertexvitovjifandonly if the game can be transformed from position (state) vi to vj by amovepermissible under the rules of the game.As an example, let us look at a verysimplegame.Itisasimplifiedversionofagamecallednim.

SimplifiedNim:TwopilesofsticksaregivenandplayersAandBtaketurns,each takinganynumberofsticks fromanyonepile.Theplayerwho takes thelaststickwins,andsincethefinitequantityofstickswilleventuallybeexhusted,it is obvious that the game allows no draw.As a further simplification, let usstartwithtwopilescontainingtwostickseach.ThecompletegameisdescribedbythedigraphinFig.14-14.Eachstateofthegameisdescribedbyanorderedpairof labels (x,y), indicating thenumberofsticks in the firstand thesecondpile,respectively.

Fig.14-14Simplifiedgameofnim.

Page 501: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Let us observe some properties of such a game digraph (a digraphrepresenting a two-person, perfect-information, finite game without chancemoves):

1. The digraph has a unique vertex with a zero in-degree. This vertexrepresents the starting position in the game and is therefore called thestartingvertex.Vertex(2,2)inFig.14-14isthestartingvertex.

2. Thereareoneormoreverticeswithzeroout-degree.Thesecorrespondtothe closing positions in the game, and are called the closing vertices.Vertex(0,0)istheclosingvertexinFig.14-14.

3. Agamedigraphisaconnected,acyclicdigraph.Adirectedcircuitwouldimplythatthegamecouldgoonindefinitely.(Inpractice,inagamesuchas chess, where the game may return to a state, endless matches arepreventedbymeansofarule thatafteracertainnumberofrepetitionsofthesamemove,thegameisdeclaredstalemated.)

4. Eachdirectedpath from the startingvertex toaclosingvertex representsonecompleteplayofthegame.Thispathconsistsofedgesrepresentingthemovesofthetwoplayersalternately.

Themostimportantquestioninagameisthefollowing:Whenandhowcanaplayerchoosehismovessothatheiscertainofwinning?WeshallfirstanswerthisquestionforthespecificgameinFig.14-14,andthengeneralizeit.

Let us call a position “won” if the player who brought the game to thispositioncanforceavictory.Conversely,apositionisdubbed“lost”iftheplayerwhobroughtthegametothispositioncanbeforcedtolose.Inkeepingwiththischaracterizationofvertices, theclosingvertexinFig.14-14is tobemarkedaswon, because the playerwho brought the game to this position is thewinner.Havingmarked thisvertexaswon, letususe the followingprocedure tomarktheremainingverticesaswonorlost.Markanunmarkedvertexwonifallitssuccessorsaremarkedlost,andmark

anunmarkedvertexlostifatleastoneofitssuccessorsismarkedwon.(Thisisbecauseitisassumedthateachplayerisintelligentandmakesthebestpossiblemove at each stage.) This results in vertices (0, 0), (1, 1), and (2, 2) beingmarkedaswonand the remainingas lost.And thus theplayerwhomakes thesecondmovehasthewinningstrategy,sincehecanforcehisopponenttomovetotheverticesmarkedaslost.To generalize the foregoing method of finding a winning strategy, let us

introducetheconceptofkernelinadigraph.

Page 502: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

KernelofaDigraph:AsetofverticesKinadigraphGiscalledakernel(ornucleus)ofGif

1. NotwoverticesinKarejoinedbyanedge.

2. EveryvertexvnotinKhasanedgedirectedfromvtosomevertexinK.

Conditions1and2correspondrespectivelytodefinitionsofanindependentsetandadominatingset inanundirectedgraph(recallChapter8).Whataresometypesofdigraphsthathavekernels?Theorem14-5characterizesonesuchtype.

THEOREM14-5

Everyacyclicdigraphhasauniquekernel.

Proof:Thetheoremwillbeprovedbyaconstructiveprocedure,attheendofwhich all vertices forming the kernelwill be painted red. LetG be the givenacyclic digraph.According toTheorem9-15,Gmust have at least one vertexwithzeroout-degree.LetV1bethesetofallverticesinGwithzeroout-degree.SincetheseverticesmustallbeinthekernelofG,paintthemred.Next,letW1bethesetofall thoseverticesinGfromwhichthereisatleast

onedirectededgetosomevertexinV1.Clearly,novertexinW1canbeincludedinthekernel.DeletefromGallverticesinW1(togetherwiththeedgesincidentonthem,ofcourse),andthusobtainsubgraph(G−W1).Subgraph(G−W1)isalsoacyclic.LetV2bethesetofallverticeswithzero

out-degreein(G−W1).SinceintheoriginaldigraphGnovertexinsetV2hadazeroout-degree,everyvertexinV2hadtohaveatleastoneedgegoingtosomevertexinW1.Moreover,indigraphGnovertexinV2couldhavebeenadjacenttoanyvertexinV1.NorcouldanyvertexinV2havebeenadjacenttoanyothervertexinV2,becausetheout-degreeofeachvertexinsetV2of(G−W1)iszero.ThusweconcludethateveryvertexinV2mustalsobeincludedinthekernel

ofGandthereforebepaintedred.ThisprocedureiscontinuedtilleveryvertexinGiseitherdeletedorpainted

red.Theuniquesetofverticespaintedredconstitutesthekernelofthedigraph.

Asanillustration,letusfindthekernelintheacyclicdigraphinFig.14-14.Itiseasilyseenthatthesetofthreeverticesmarked(0,0),(1,1),and(2,2)is thekernel.LetAbetheplayerwhomakesthefirstmoveinthegameandBbetheplayer

Page 503: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

whomakesthesecondmove.Assumingthattheruleofthegameissuchthattheplayerwho is able tomake the last possiblemove in the game is always thewinner,wehavethefollowingimportantresult.

THEOREM14-6

InthegamedigraphifthestartingvertexisnotinthekernelK,thenplayerAisassuredofawin,andAcanwinbyalwaysselectingverticesinK.

Proof:SincethestartingvertexisnotinsetK,playerAcanmovethegametoavertexx inK. If thisvertexx isaclosingvertex,A is thewinner. Ifnot, thesecondplayerBwillhavetomovetosomevertexy,whichisnotinthekernelK.InhisnextmoveAcantakethegametosomevertexinK.Thegamecontinues,withBforcedtotakeitoutofKandAbringingitbackintoK.Eventually,theplaywillbebroughttoaclosingvertexbyA,becauseallclosingverticesareinK.ThusAwinsthegame.

COROLLARY

It follows from theproofof this theorem that if the startingvertex is in thekernel,thesecondplayerBhasthewinningstrategy;andBcanwinbyalwaysselectingverticesinthekernel.

Intheforegoinganalysistherulesofthegamewereassumedtobesuchthatthe playerwhomade the last possiblemovewas always thewinner. Inmanygames(suchaschessortic-tac-toe)someoftheclosingverticesrepresentadrawand others awin. In such a game choosing vertices from the kernelwill onlyassureaplayerawinoradraw.Therearealsogamesinwhichtheruleissuchthattheplayerwhoisforcedto

make the last move is the loser rather than the winner. From such a gamedigraph, ifweremovealledgescorrespondingtothelastmoves, thegamecanbeconvertedtothetypeinwhichthewinneristheplayermakingthelastmove.Inotherwords,thegameisdecidedatthetimethesecond-to-the-lastmovesaremade. For example, let us modify the nim game of Fig. 14-14 such that theplayerforcedtotakethelaststickistheloser.Thenerasingthelastmovesfromthe digraph, we get Fig. 14-15. The three verticesmarkedwon constitute thekernelinthisdigraph.EveninthisgameplayerBhasthewinningstrategy.

Page 504: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.14-15Gamedigraph.

Thus, at least in theory, it ispossible to construct thegamedigraph for anytwo-person,perfect-information, finitegamewithnochancemoves,and, sincethedigraphisacyclic, it isalsopossible toobtainitskernel.Therefore, ifeachplayerplaysaccordingtohisbeststrategy,theoutcomeispredetermined.Itwillbeeitheradraworacertainwinfortheplayerwhomakesthefirstmoveifthestartingvertexisnotinthekernel,orfortheplayerwhomakesthesecondmoveif the startingvertex is in the kernel. In this sense, everygameof this type iseither“unfair”or“futile.”Inrealitythesituationisnotsobleakasitappears.Inmostnontrivialgames,

suchascheckersorchess,thenumberofpositions(i.e.,theverticesinthegamedigraph) is so enormous that the game digraph cannot even be stored in thememoryunitofanyexistingorcontemplatedcomputer.This is preciselywhy in real problems in operations research the theory of

games provides an approach rather than a complete analysis.Moreover, graphtheoryisapplicableonlytoaveryspecialbutimportantclassofgames.

SUMMARY

We have considered three important classes of problems in combinatorialoperations research: transportation problems, activity networks, and gametheory.Theseproblemscanbeexpressedandsolvedelegantlyasgraph-theoryproblems involvingconnectedandweighted (mostlyacyclic)digraphs.Froma

Page 505: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

practicalpointofview,alltheseproblemsaretrivial(andsoisanycombinatorialproblem)if thenetworkissmall.Manyreal-lifesituations,however,consistofhugenetworks,andthereforeitisimportanttolookatthesenetworkproblemsintermsofsolvingthemoncomputers.

REFERENCES

Thereisanimpressiveliteratureonthesubjectofflowsinnetworks.Severalbooks are devoted entirely to network-flow problems. Ford and Fulkerson’sbook[4-3],thefirstonetobewrittenonthesubject,isaclassic.Followingthepublicationofthisbook,agooddealofworkhasbeenreportedintheliterature,particularly on the problems of two-commodity and multicommodity flows,probabilistic flows, flows through lossy network, flows with queues, andsynthesisofflownetworks.Hu[14-12]andFrankandFrisch[14-7]covermuchof theseareas.Otherbookson thesubjectareBergeandGhouila-Houri [14-4]and Iri [14-14].Of several excellent survey papers, Fulkerson [14-9],Hu [14-13],andBeckenbach[14-2]areparticularlyrecommended.Thesepapersprovidea list of important references. Chapters on flow problems in Berge [1-1],BusackerandSaaty[1-2],andLiu[8-3]arealsorecommended.Asanexampleof a good computer program for a typical flow problem see [14-3], whichdeterminestheleast-costflowforanetworkwithbothupperandlowerboundsonedgecapacities.Many books and hundreds of articles have been written on critical-path

methods.SomeofthebooksrecommendedarebyBattersby[14-1],Elmaghraby[14-6], andModer and Phillips [14-16]. Papers byKlein [14-15],Montalbano[14-17],andSchurmann[14-22]discusscomputeralgorithmsandprogramsforactivitynetworks.BusackerandSaaty[1-2]alsocontainsasection(pages128-135)onactivitynetworks.For a brief and succinct historical survey of nim-like games (also called

disjunctiveortake-awaygames),seeGardner[14-10].Alucidgeneralarticleongames is [14-23]. Two other papers on games, [14-11] and [14-21], are alsorecommended.Berge[1-1],BusackerandSaaty[1-2],Kaufmann[9-4],andIri[14-14]eachcontainasectiondealingwithgraphrepresentationofgames.

14-1. BATTERSBY,A.,NetworkAnalysisforPlanningandScheduling,2nded.,St.MartinsPress,Inc.,NewYork,1967.

14-2. BECKENBACH, E. F., “Network FlowProblems,”Chapter 12 inAppliedCombinatorial Mathematics (E. F. Beckenbach, ed.), John Wiley &

Page 506: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Sons,Inc.,NewYork,1964.14-3. BRAY,T.A.,andC.WITZGALL,“Algorithm336:Netflow,”Comm.ACM,

Vol.11,Sept.1968,631-632;correctedinVol.12,1969.14-4. BERGE, C., and A. GHOUILA-HOURI, Programming, Games and

Transportation Networks (translated by M. Merrington and C.Ramanujacharyula),JohnWiley&Sons,Inc.,NewYork,1965.

14-5. DIMSDALE,B., “ComputerConstruction ofMinimalProjectNetworks,”IBMSystemsJ.,Vol.2,March1963,24–36.

14-6. ELMAGHRABY, S. E., Some Network Models in Management Science,Springer-Verlag New York, Inc., New York, 1970. Also appeared asarticlesinManagementSci.,Vol.17,Sept.andOct.1970.

14-7. FRANK, H., and I. T. FRISCH, Communications, Transmission, andTransportation Networks, Addison-Wesley Publishing Company, Inc.,Reading,Mass.,1971.

14-8. FULKERSON, D. R., “A Network Flow Computation for Project CostCurves,”ManagementSci.,Vol.7,1961,167–178.

14-9. FULKERSON, D. R., “Flow Networks and Combinatorial OperationsResearch,”Am.Math.Monthly,Vol.73,1966,115–138.

14-10. GARDNER,M., “MathematicalGames,”Sci. Am.,Vol. 226,No. 1, Jan.1972,104–107.

14-11. GRUNDIG, P. M., and C. A. SMITH, “Disjunctive Games with the LastPlayerLosing,”Proc.CambridgePhil.Soc.,Vol.52,part2,1956,527-533.

14-12. Hu,T.C., IntegerProgramming andNetworkFlows,Addison-WesleyPublishingCompany,Inc.,Reading,Mass.,1969.

14-13. Hu, T. C., “The Development of Network Flow and Related Areas inProgramming,” University ofWisconsinM.R.C. Technical Report No.1096, Aug. 1970; also in the Proceedings of the 7th InternationalMathematicalProgrammingSymposiumattheHague,Sept.1970.

14-14. IRI,M.,NetworkFlow,TransportationandScheduling,AcademicPress,Inc.,NewYork,1969.

14-15. KLEIN,M.M., “Scheduling Project Networks,”Comm. ACM, Vol. 10,1967,225–231.

14-16. MODER, J. J., andC.R. PHILLIPS,ProjectManagementwithCPMandPERT,VanNostrandReinholdCompany,NewYork,1970.

14-17. MONTALBANO, M., “High-Speed Calculation of the Critical Paths ofLargeNetworks,”IBMSystemsJ.,Vol.6,1967,163–191.

14-18. ONAGA, K., “Optimal Flows in General Communication Networks,” J.FranklinInst.,Vol.283,No.4,April1967,308–327.

Page 507: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

14-19. PLISCH,D.C.,“NewResultsConcerningSeparationTheoryofGraphs,”Ph.D.Thesis,UniversityofWisconsin,MadisonWisc,1970.

14-20. SAKAROVITCH, M., “The Multicommodity Flow Problem,” Ph.D.Dissertation, Operations Research Centre, University of California,Berkeley,1966.

14-21. SMITH,C.A.,“GraphsandCompositeGames,”J.CombinatorialTheory,Vol.1,1966,51–81.

14-22. SCHURMANN,A.,“GAN,aSystemforGeneratingandAnalyzingActivityNetworks,”Comm.ACM,Vol.11,No.10,Oct.1968,675–679.

14-23. WANG,H., “Games,LogicandComputers,”Sci.Am.,Vol.213,No.5,Nov.1965,98–106.

†In the case of a multicommodity flow, where two or more commodities flow through the networksimultaneously,thisreplacementisnotvalid.Theproductfpq·fqp≠0,becausedifferentcommoditiescanflow in opposite directions without canceling each other. This is one of the major difficulties inmulticommodityflowproblems.

Page 508: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

15SURVEYOFOTHERAPPLICATIONS

In the last three chapters we have explored in considerable detail theapplication of graph theory to three disciplines, switching and coding theory,electricalnetworks,andoperationsresearch.Inthisfinalchapterweshallbrieflydescribe how graph theory is used in a number of other areas. The first threesections are somewhat related. They all deal with representation of a systemstructurebymeansofaweighted,connecteddigraphandsubsequentanalysisofthesystemthroughanappropriatestudyofthedigraph.InSection15-1alinearsystemismodeledasaweighteddigraph,whichhasprovedtobeaconvenienttoolforanalysis.Section15-2dealswithrepresentationofastochasticprocess(adiscreteMarkovprocess)byadigraphandmakesuseofSection15-1foritsanalysis. Section 15-3 uses weighted digraphs for the analysis of computerprograms. A discrete Markov process is an appropriate model for manyprograms,andthusSection15-2ismadeuseofinSection15-3.Section 15-4, in which graph theory is used as a tool for identification of

chemical compounds, is an isolated section. It is, however, an importantapplication of graph theory. Finally, Section 15-5 lists some miscellaneousapplications,withrelevantreferences.

15-1.SIGNAL-FLOWGRAPHS

Mostproblemsinanalysisofalinearsystemareeventuallyreducedtosolvinga set of simultaneous, linear algebraic equations.Thisproblem,usually solvedby matrix methods, can also be solved via graph theory. The graph-theoreticapproachisoftenfaster,and,moreimportantly,itdisplayscause-effectrelationshipsbetweenthevariables—somethingtotallyobscuredinthematrixapproach.Thisgraph-theoreticanalysisofalinearsystemconsistsoftwo parts: (1) constructing a labeled, weighted digraph called the signal-flow

Page 509: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

graph,and(2)solvingfortherequireddependentvariablefromthesignal-flowgraph.Inasignal-flowgrapheachvertexrepresentsavariableandis labeledso.A

directededgefromxitoxjimpliesthatvariablexjdependsonvariablexi(butnotthereverse).Thecoefficientsintheequationsareassignedastheweightsoftheedgessuchthatthevariablexkisequaltothesumofallproductswikxi,wherewikistheweightoftheedgecomingintoxkfromxi.Asanexample,letusconstructasignal-flowgraphforthesystemgivenbythesetofthreeequations,

whichcanberewrittenas

Thesignal-flowgraphrepresentingEqs.(15-2)isgiveninFig.15-1.

Fig.15-1Signal-flowgraphforEqs.(15-2).

Page 510: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Clearly,thein-degreeofavertexvinasignal-flowgraphiszeroifandonlyifv represents an independent variable. Also note that a signal-flow graph isconnected; otherwise, we have two uncoupled (unrelated) systems throwntogether.A signal-flow graph can be compared to a signal transmission network, in

whichtheverticescorrespondingtotheindependentvariablesaresignalsources,and the other vertices are repeaters, which act as receiving, summing, andtransmitting devices. The signals travel along the edges and are multiplied(amplifiedorattenuated)bytheweightsoftheedgestraversed.Thelabelxiofavertexequalsthesumofallincomingsignals,andisthestrengthofthesignalineachoutgoing edge fromxi It is from this analogy that the name “signal-flowgraph”comes.Forthesamereasontheedgeweightsarecallededgegains,andindependentvariableverticesarereferredtoassourcevertices.Notethatasignal-flowgraphcontainsthesameinformationastheequations

fromwhich it isderived;but theredoesnotexistaone-to-onecorrespondencebetween the system of equations and the digraph. From the same set of nequationswecanobtainn!differentsignal-flowgraphs(someofwhichmaybeisomorphic), dependingon theorder inwhich thevariablesxi’s arewrittenontheright-handside,say,inEqs.(15-2).Now,givenasetofalgebraicequations

howdoweobtaintheweightmatrixofthesignal-flowgraphwithoutfirsthavingto draw the digraph? (Like any weighted digraph, the signal-flow graph iscompletelydescribedbyitsweightmatrix.)

THEOREM15-1

TheweightmatrixW=[wij]of thesignal-flowgraphcorresponding toEqs.(15-3)isgivenby

where I is the identity matrix of the same order as C, and the superscript Tdenotesthetransposedmatrix.

Thetheoremisnotdifficult toproveandisleftasanexercise.Notethatthecolumns of all zeros in W correspond to the y vertices (i.e., independent

Page 511: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

variables).Although signal-flow graphs can always be constructed from a set of

equations,inmanyphysicalproblems,particularlyinelectricalsystems,signal-flow graphs are drawn directly without first writing the equations. Usually, asignal-flowgraphcanbedrawnaseasilyastheequationsareformulated.Also,writing equations from a signal-flow graph is a simple matter, because eachvertexxkrepresentsoneequationofthesysteminwhichxkisequaltothesumoftheproductsofweightsofallincomingedgesandthelabelsoftheinitialverticesoftheseedges.Forexample,thesystemofequationsforthesignal-flowgraphofFig.15-2canbeimmediatelywrittendownas

Fig.15-2Signal-flowgraph.

ThesecanberewritteninthesameformasEq.(15-3),where

Page 512: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

ReductionofSignal-FlowGraphs

The signal-flow graphmethod of analysis is most useful whenwewant tosolve foronlyoneunknownvariable, sayxj, as a functionofone independentvariable, sayyk.We solveby eliminating all otherverticesonebyone, takingcare that this elimination process does not alter the net product of the edgeweightsofdirectedpathsfromyktoxj.Thisgraphreductioncorrespondsexactlyto the algebraic method of eliminating all other variables by systematicsubstitution. Some elementary reductions of a signal-flow graph are shown inFig. 15-3.Repeated application of such reduction steps, selected visually,willeventually lead to elimination of all intermediate vertices. (Apply thesereductionstepssuccessivelytoFig.15-2toeliminateallverticesexcepty1andx3.)

Page 513: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.15-3Reductionsofsignal-flowgraphs.

Althoughourabilitytoreducethedigraphbysimpleinspectionaddsmuchtothepowerandflexibilityofsignal-flowgraphs, it isoftenbetter touseamoremethodical technique that does not depend on visual inspection. And such amethodisprovidedbyMason’sgainformula.

Mason’sGainFormula: Letρ be a directed path from a vertexa tob in a

Page 514: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

signal-flowgraphG.Thentheproductoftheweightsofalledgesinthispathiscalled the path gain of ρ (same as path product defined in Section 12-2 forundirected graphs). Similarly, the product of the weights of all edges in adirectedcircuit(orcycle)ΓiscalledthecyclegainofΓ.Forexample,alistofalldirectedcircuitsandtheirgainsinFig.15-2is

DirectedCircuit CycleGainx2x2(self-loopatx2)x1x2x1x1x3x1x3x4x3x4x5x4x1x2x3x1

fabcdghijbed

Furthermore,foragivensignal-flowgraphGletusdefinethefollowing:

t1 =sumofcyclegainsofalldirectedcircuitst2 =sumofproductsofcyclegainsofallvertex-disjointdirectedcircuitstaken

twoatatimet3 =sumofproductsofcyclegainsofallvertex-disjointdirectedcircuitstaken

threeatatime...

tk =sumofproductsofcyclegainsofallvertex-disjointdirectedcircuitstakenkatatime.

Thus,forthesignal-flowgraphofFig.15-2wehave

t1 =f+ab+cd+gh+ij+bed,t2 =fcd+fgh+fij+abgh+abij+cdij+bedij,t3 =fcdij,

and

t4 =t5=···=0,

asthemaximumnumberofvertex-disjointdirectedcircuitsinFig.15-2isonlythree.

Page 515: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Now we are ready to state and illustrate two theorems, which togetherconstitutethemostimportantresultconcerningsignal-flowgraphs.

THEOREM15-2

Letasignal-flowgraphGcharacterizeasetofequationsCx=y;thenΔ,thedeterminantofmatrixC,isgivenby

whereqisthemaximumnumberofvertex-disjointdirectedcircuitsinG.

THEOREM15-3

Letasignal-flowgraphGcharacterizeasetofequationsCx=y;thentheijthcofactorofC,Cij,isgivenby

wherePk is thepathgainof thekthdirectedpath fromvertex i to j,Δk is thevalue of Δ in Eq. (15-6) for that part of the digraph having no vertices incommonwiththekthdirectedpath,andthesummationisoveralldirectedpathsfromitoj.

Combining Theorems 15-2 and 15-3, we getMason’s gain formula, whichgivestheresponsexduetotheforcingfunctionyias

whereCijandΔarecomputedfromthesignal-flowgraphG,usingEqs.(15-6)and(15-7).Besides the original proofs given by S. J.Mason,many different proofs of

Theorems 15-2 and 15-3 have been published. All are involved—some morethanothers.Aparticularlyelegantproof,duetoR.Ash,isgivenin[13-5],pages102–109.WeshallsimplyillustratetheapplicationofMason’sgainformulabymeansofanexample.ForFig.15-2,

Page 516: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

ThatthisindeedisthedeterminantofthecorrespondingmatrixCasgiveninEq.(15-5)canbeeasilyverifiedbydirectcomputation.Therearetwodirectedpathsfromy1tox3:

ρ1=y1x1x3 withpathweightp1=cand ρ2=y1x1x2x3 withpathweightp2=be.

Correspondingly,

Δ1=1−f−ij+fijand Δ2=1−ij.

Therefore,accordingtoTheorem(15-3),the(1,3)thcofactoris

C13=Δ1P1+Δ2P2=(1−f−ij+fij)c+(1−ij)be.

Thistoocaneasilybeverifiedbydirectlycomputingthe(1,3)thcofactorofthematrixinEq.(15-5).Thusthegain

is obtained purely by graph-theoretic computation. The result can be easilyverifiedbyinvertingthecorrespondingmatrixCasgiveninEq.(15-5).

RemarksandReferences

Thechiefadvantageofusingsignal-flowgraphs(oversubstitutionmethodormatrixmethod)liesintheirabilitytohighlightthecause-effectrelationshipsinthesystem.Forexample,thefeedbackedgesshownareindeedthefeedbacksinthe actual system. A signal-flow graph can also be used very effectively forsimplifyingthesystemofequationsbeforesolvingthroughmatrixmethods.Thesimplification is accomplishedby flow-graph reductions.As canbe seen from

Page 517: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

the literature cited in the next section, signal-flow graphs have been widelyappliedinthestudyofMarkovsystems.For a computerized solution of a general problem, perhapsmatrixmethods

would be faster. For in usingMason’s gain formula, an important step is thegeneration of all directed circuits in the signal-flow graph; and as we saw inChapter 11, the algorithms (suitable for computers) available for this are notveryefficient.Several variations of signal-flow graphs have been proposed and studied in

the literature, following Mason’s pioneering papers, [15-4] and [15-5]. For asurvey of different variations, see [15-1]. Some of these variationsmay offerslight computational advantage, but they do so by sacrificing the cause-effectrelationship,which issonicelybroughtout insignal-flowgraphs,aspresentedhere. Consequently, not much has come out of these other types of graphrepresentations,andMason’soriginalgraphsarewidelyusedincontroltheory,electricalnetworkanalysis,electricalmachinetheory,heattransfer,andanalysisofmechanicalstructures.An elementary but thorough treatment of signal-flow graphs with many

applicationscanbefoundinanyofthefollowingthreemonographs:[15-1],[15-3], and [15-6]. All three use the original signal-flow graphs as proposed byMason,withoutthelatervariations.

15-1. ABRAHAMS,J.R.andG.P.COVERLEY,SignalFlowAnalysis,PergamonPress,Inc.,Elmsford,N.Y.,1965.

15-2. GHOSH, S. N., and P. K. GHOSH, “Flow Graphs and Linear Systems,”Intern.J.Control,Vol.14No.5,Nov.1971,961-975.

15-3. LORENS, C. S.,Flowgraphs: For theModeling and Analysis of LinearSystems,McGraw-HillBookCompany,NewYork,1964.

15-4. MASON, S. J., “Feedback Theory: Some Properties of Signal FlowGraphs,”Proc.I.R.E.,Vol.41,No.9,Sept.1953,1144-1156.

15-5. MASON, S. J., “Feedback Theory: Further Properties of Signal FlowGraphs,”Proc.I.R.E.,Vol.44,No.7,July1956,920-926.

15-6. ROBICHAUD,L.P.A.,M.BOISVERT,andJ.ROBERT,SignalFlowGraphsandApplications,Prentice-Hall,Inc.,EnglewoodCliffs,N.J.,1962.

15-2.GRAPHSINMARKOVPROCESSES

Thesimplestrandomprocessisoneinwhichtheoutcomesofsuccessivetrialsare independent of each other. In a coin-tossing experiment, for example, the

Page 518: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

outcome of the kth tossing is independent of the outcome of all previoustossings.Manyphenomena,however,cannotbedescribedbythissimplemodel.There are random processes in nature in which the outcome depends on theoutcome of previous trials. For example, the probability of an offspringinheriting a genetic feature does depend on the presence (or absence) of thisfeatureinhisancestors.AMarkovprocessis thesimplestgeneralizationthatpermits theoutcomeof

any trial tobedependenton theoutcomeof the trial immediatelypreceding it,and on no other.† This simple but powerful generalization gives theMarkovprocess an ability to describe random processes in such diverse areas asstatistical information theory, control theory, genetics, inventory control,analysis of computer proprams, and the study of social mobility of differentclasses,tonameafew.AMarkovprocessisastochasticsystemcapableofassumingoneofnstates

s1,s2,...,sn,andthestateschangeonlyatdiscretepointsintime.Thestateatthekthinstantdependsonlyonthestateofthe(k−1)thinstantandnotonanyofthe previous states. In other words, in a successive sequence of trials theoutcomeofthekthtrialdependsonlyontheoutcomeofthe(k−l)thtrial,andnotonanyoftheprecedingones.†

TransitionProbabilities:TodescribeaMarkovprocess,wemustspecifyforeachstate,si,theprobabilityofmakingthenexttransitiontoeachofthenstates.The transition probability pij is the probability that if the present state of theprocessissi,thenextstatewillbesj.Theseprobabilities,pij,mustsatisfy

the latter because the sum of probabilities of transitions to all possible statesfromagivenstatemustbeunity.(Notethatwehaveassumedthatthetransitionprobabilitiesareconstants,anddonotvarywithtime.Suchaprocessiscalledastationaryprocessoratime-invariantprocess†).

TransitionMatrix:Then2transitionprobabilitiesdescribingaMarkovprocesscanmostconvenientlybegivenin theformofannbyntransitionmatrixP=[pij],subject,ofcourse, tothetwoconditionsinEq.(15-8).Anysquarematrixwith real, nonnegative elements inwhich the sumof each row is1 is called astochasticmatrix.ThuseverystochasticmatrixisthetransitionmatrixofsomeMarkovprocess,andviceversa.Letus lookatsomepropertiesofastochastic

Page 519: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

matrixP.

1. IfPisastochasticmatrix,itskthpowerPkisalsoastochasticmatrix,fork=0,1,2,...(matrixP°=I,theidentitymatrix).

2. IfallrowsofPareidentical,then

P=P2=P3=P4=....

3. Since each rowof a stochasticmatrix adds up to 1, onlyn − 1 columnsneedbegiven:theremainingcolumncanbederivedfromthem.

In addition to the transition matrix, we also need to know the initialprobabilities

π(0)=[π1(0),π2(0),...,π(0)],

whereπj(0)istheprobabilityoftheMarkovprocessbeinginstateSjatthestart,that is, at the time instant 0.Clearly, the probabilities inπ(0)must satisfy thefollowingconditions:Fori=1,2,...,n,

Anyreal-valuedvectorwhosecomponentssatisfytheconditionsinEq.(15-9)iscalledaprobabilityvector.Theinitialprobabilityvectorπ(0)andthetransitionmatrixcompletelydetermineaMarkovprocess.Theyaresufficienttopredicttheprobabilityoftheprocessbeinginanystateatanytimeinstantk.Stochastic Graph: An alternative means of describing an n-state Markov

process is an n-vertex, weighted, connected digraph G. The vertices of Gcorrespondtothestates,andanedge(si,sj)withanonzeroweightpijrepresentsthe nonzero transition probability from state si to sj. Such a digraph, called atransitiongraph,isnotonlyofgreatvalueinvisualizingaMarkovprocess,butisalsoapowerfulanalytic tool instudyingtheprocess.Clearly, theweightsoftheedgesinthetransitiongraphGmustsatisfytheconditionsinEqs.(15-8).Adigraphinwhichtheedgeweightsarepositivequantitiesandthesumofweightsofedgesemanatingfromavertexisunityiscalledastochasticgraph.

Page 520: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.15-4TransitionmatrixanddiagramforaMarkovprocess.

AsanexampleofaMarkovprocess,letusconsiderthefollowingversionoftheclassicproblemofrandomwalk:Supposethataparticlemoves,accordingtoaprobabilisticmechanism,along

a straight line n = 2m units long between two walls. At each transition theparticlemoveseitheroneunitleftoroneunitright,eachwiththeprobability .Iftheparticlehits the leftwall, it gets reflected;but if ithits the rightwall, it isabsorbedintothewall.Atagiventimetheprocessisinoneofn=2mstates(i.e.,theparticleisatone

ofthenpointsalongtheline).Onlythepresentstateisrelevanttowhatthenextstate may be and not any of the previous states. This is an n-state Markovprocess. For n = 6, the transition matrix and the transition diagram for thisprocessaregiveninFig.15-4.Note the similarities between a Markov process and a sequential machine,

discussed inSection12-8.Bothhaveafinitenumberofstates,and inboth thestatetransitionsoccuratdiscretepointsintime.ThemaindifferencebetweenthetwoisthatinMarkovprocesseswedealwithprobabilities,whicharereal-valued

Page 521: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

quantities instead of a set of symbols, as in the case of sequential machines.Transitions in aMarkov process do not depend on any (externally controlled)inputs, but are governed by probability distributions. Moreover, there are nooutputsassociatedwithaMarkovprocess.

MultistepTransitionProbabilities

An important question regarding aMarkov process is the following: Giventhat the processwas initially in state si,what is the probability of its being instate sj after exactly k transitions? This probability ϕij(k), called the k-steptransitionprobabilityfromstatesitosj,isgivenby

THEOREM15-4

InaMarkovprocessthek-steptransitionprobabilityϕij(k)fromstatesitosjisequaltotheijthentryinmatrixPk,thekthpowerofthetransitionmatrixP.

Proof: Consider the transition digraph. Theweightpij of edge (si, sj) is theprobability of going from vertex si to sj in one step. Since the transitionprobabilitiesateachsteparestochasticallyindependent,theproduct

Pir·Prj

givestheprobability that theprocesswillgofromstatesi tosr in thefirststepand then from sr to sj in the second step. Continuing this argument, theprobabilityofgoingfromvertexsitosjalongadirectededgesequenceoflengthk isgivenby theproductof theweightsof theseedges.But theprobabilityofgoingfromsitosjinexactlykstepsisthesumoftheprobabilitiesofgoingfromsi to sj along all directed edge sequences of lengthk in the transition digraph.That this sum is given by the ijth entry in matrix Pk can be easily seen byargumentsusedinTheorem9-10.

Page 522: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.15-5Three-stateMarkovProcess.

To illustrate Theorem 15-4, let us consider a three-state Markov processwhosetransitiondigraphisgiveninFig.15-5.Thetransitionmatrixandsomeofitspowersare

The ijth entry inP4, for example, is theprobability that the processwill gofromstatesitosjinexactlyfoursteps.Letus,forinstance,examinealldirectededgesequencesoflengthfourfroms3tos2inFig.15-5.Theseare

s3s2s2s2s2 withprobabilityoftraversing(.5)(.6)3=.108,s3s2s1s3s2 withprobabilityoftraversing(.5)2(.4)(1)=.1,s3s1s3s2s2 withprobabilityoftraversing(.5)(1)(.5)(.6)=.15.

Thesumoftheirprobabilities,.358,isexactlytheentryinthe(3,2)positionofP4.Forthisexample, letusmakesomefurtherobservationsonthepropertiesof

matrixPk.

1. Beyondacertainvalueofk,Pkcontainsonlynonzeroentries.Thisimpliesthatthereisatleastonedirectededgesequenceoflengthk(andthereforeadirectedpathoflengthkorless)fromeveryvertextoeveryothervertexinFig.15-5.

Page 523: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

2. AllrowsofPktendtobecomeidenticalaskincreases.Thismeansthatthek-step transition probabilityϕij(k) becomes independent of i for large k.Thisresultshouldnotcomeasasurprise,becausetheeffectofthestartingstatesishouldwearoffaftersufficientlymanytransitions.

3. As a direct consequence of item 2, the higher powers of P becomeidentical;thatis,

pk=p·pk=p·pk+1=...

becausePisastochasticmatrixandPkhasidenticalrows.

DoesPkofeveryMarkovprocessexhibittheseproperties,oristhisexampleaspecial case? To answer this question, let us take a closer look at stochasticdigraphs,andtrytoclassifythem.

ClassificationofStates

AsetSofstatesissaidtobeclosed,trapping,orabsorbingifnostateoutsideScanbereachedfromanystatesiinS.Inotherwords,thereisnodirectededgefromanyvertexsiinStoanyvertexoutsideS.Forexample,{s4,s5,s3}inFig.15-6 is a closed set of states. So is {s4}.A single state sk is an absorbing ortrappingstateifandonlyifithasaself-loopwithweightone,suchass4inFig.15-6.Clearly,theentiresetofstatesinaMarkovprocesstriviallyconstitutesaclosed set. If there exists no other closed set of states except the entire set ofstates of theMarkov process, the process is called ergodic or irreducible. Inotherwords, a process is ergodic if andonly if its transitiongraph is stronglyconnected;thatis,thereisanonzeroprobabilityofgoingfromanystatetoanyother state. For example, in Fig. 15-5 the process is ergodic, but the processshowninFig.15-6isnot.Astronglyconnectedclosedsetofstatesiscalledanergodicorirreducibleset.

Page 524: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.15-6NonergodicMarkovprocessshowingclosedsets.

Regular Process: Of special interest among ergodic Markov processes arethose in which there exists a directed edge sequence exactly of length k (forsomepositive integerk) fromeveryvertex to everyother vertex inG. Such aprocess is called a regular Markov process. Clearly, every regular process isergodic,buttheconverseisnottrue.Forexample,inFig.15-7(a)theprocessisergodicbutnot regular.For there is nodirected edge sequenceof even lengthfrom s1 to s2 andnodirected sequenceofodd length from s1 to s3; thus thereexists nok forwhich there is adirected edge sequenceofk edges fromeveryvertextoeveryothervertex.

Page 525: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.15-7Someergodicstochasticdigraphs.

The significance of a regularMarkov process lies in the fact that for someintegerk there isanonzeroprobabilityofgoingfromeachstate toeveryotherstateinexactlyksteps.Intermsofthek-steptransitionmatrixPk=Φ(k),wecanmake the following statement :AMarkovprocess is regular if andonly if forsomeintegerkeveryentryinthek-steptransitionmatrixΦ(k)ispositive.Given the transition digraph G of an ergodic process (i.e., G is strongly

connected),howcanwetelliftheprocessisregular?Toanswerthisquestion,letus introduce the followingdefinition :Astronglyconnected subdigraphg inadigraphGissaidtobeaminimalifghasnopropersubdigraphoftwoormoreverticesthatisstronglyconnected.

THEOREM15-5

LetGbeastronglyconnectedstochasticdigraph,andletg1,g2,...,grbeitsminimal strongly connected subdigraphs, having n1, n2, . . . , nr vertices,respectively. ThenG represents a regular Markov process if and only if thegreatestcommondivisor(g.c.d.)ofn1,n2,...,nris1.

For a proof of this theorem, see Rosenblatt’s paper [15-14]. Let us simply

Page 526: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

illustrate itwith someexamples.Thedigraph inFig. 15-7(c) has twominimalstrongly connected subdigraphs, with vertex sets {s3, s4) and {s1, s2, s3, s4}.Sincetheg.c.d.(4,2)=2,theprocessisnotregular.Ontheotherhand,Fig.15-7(f) also has two minimal, strongly connected subdigraphs, one with fivevertices and the other with three. Since the g.c.d. (5, 3) = 1, the process isregular.Clearly, if a strongly connected transition digraph contains a self-loop, the

g.c.d. is 1 ; therefore, the process is regular [e.g., Fig. 15-7(d)]. The reader isencouragedtowritedownthetransitionmatrixPforeachofthesixdigraphsinFig.15-7,andverifyTheorem15-5bydirectlycomputingPk(forappropriatek).

PeriodicMarkovProcess:Anergodicprocessissaidtobeperiodic ifeverystatecanonlybeenteredatcertainperiodicintervals.Thesimplestexampleofacyclicprocessisonewithtwostatess1ands2inwhichonlythetransitionss1→s2→s1→s2 . . .arepossible.The transitionmatrixPand itspowers for thisprocessare

Asanotherexample,considertheprocessinFig.15-7(c).Itstransitionmatrixis

forkoddandverylarge.

AMarkovprocessisperiodicifandonlyifitsstatescanbepartitionedintoqsubsets (q > 1) such that the process dwells in each of these q subsets in qconsecutivetransitions.

Page 527: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

It canbe shown thateveryergodicprocess iseither regularorperiodic [15-11].

Markov Processes with Transient States: So far we have been consideringergodic Markov processes (i.e., those in which the transition digraphs arestronglyconnected).Letusnowexaminetheprocessesforwhichthetransitiondigraphisweaklyconnected.AweaklyconnecteddigraphGconsistsoftwoormorefragments(i.e.,maximalstronglyconnectedsubdigraphs).Let us consider a fragmentg ofG (remember fragmentg could be a single

vertex).Ifthereisnoedgedirectedoutofg,thenghastohaveatleastoneedgegoingintoit,andtheverticesingareclosed.Inthatcase,wecandeletealledgesgoing into g, and then studyg independently as an ergodic process [the edgeweightswillsatisfyEqs.(15-8)].Ontheotherhand,ifthereisanedgegoingoutof g, the vertices of g cannot constitute an ergodic process, because (g beingmaximal stronglyconnected)onceexited,g cannotbe reentered.Sucha setofstates, which once left cannot be entered and which among themselves areaccessiblefromeachother,iscalledatransientsetofstates.Sets{s1,s2,s6}and{s3,s5}inFig.15-6aretransientsets.The vertices of a weakly connected stochastic digraph can be uniquely

partitionedintosetsT,V1,V2,...,VqsuchthatTisthesetofalltransientstatesandeachViisirreducible,thatis,thereisnoedge(a,b)fora∈Vi,b∉Vi,andthevertexsetViisstronglyconnected.Forexample,inFig.15-6

T={s1,s2,s6,s3,s5],V1={s7,S8},V2={s4}.

Clearly,a(weaklyconnected)stochasticdigraphcannotconsistofsetTalone—theremustbeatleastonesetVi.Inotherwords,itisnotpossiblethatallstatesof a Markov process are transient (remember we are only considering finiteMarkovprocesses).Afteralargenumberoftransitions,aMarkovprocesswithtransientstateswill

eventuallysettledownintooneofitsirreduciblesubsets.Suchasystemhastwotypesofdistinctbehavior, andonemaybe interested ineitherorboth: (1) thebehaviorof the systembefore it enters an irreducible setof states, and (2) thebehavior of the system after it enters an irreducible set. Behavior 2 is nodifferent from that of an ergodic system. For once the system enters anirreducibleset,itcanneverleaveit,andthustheexistenceofstatesoutsidethisset is immaterial. Behavior 1 will be studied briefly in Section 15-3 whileanalyzingcomputerprograms.

Page 528: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

ThusasfarastheasymptoticbehaviorofMarkovprocessesisconcerned,weneed tostudyonlyergodicprocesses.Amongergodicprocesses,also,only theregular processes are of importance.†Therefore, in the rest of this sectionweshallstudytheasymptoticbehaviorofaregularMarkovprocess.

AsymptoticBehaviorofaRegularMarkovProcess

OneofthemostimportantquestionsaboutaMarkovprocessiswhathappenstoitaftermanymanytransitions?Thatis,afterthetransientsdiedown,doesthesystemreachasteadystate,independentoftheinitialprobabilities?Ifso,whatisthesteady-stateprobabilityvectorπ(∞)andhowdowecomputeit?TheanswerliesinthebehaviorofPkasktendstoinfinity,andTheorem15-6providesitforaregularMarkovprocess:

THEOREM15-6

IfPisatransitionmatrixofaregularMarkovprocess,thenitspowers,Pk,asktends to infinity,approachastochasticmatrixΦ= [ϕij]having identical rows,andeachrowwofΦisaprobabilityvector.

OutlineoftheProof:WefirstnotethatsincetheprocessisregularthereexistssomepositiveintegerrsuchthatPr=Mcontainsonlypositiveentries.Second,we observe that premultiplying any column vector y by a stochastic matrixhavingonlypositiveentrieshasanaveragingeffecton theelementsofy.Thisaveraging effect applied again and again would eventually smooth outdifferences that may have existed among the elements of y. That is, allcomponentsofvectorMhy=Prhy=Pkywillhaveidenticalelements,ash(andtherefore k) becomes very large. Finally, let us observe that this condition isequivalent to Pk approaching a limitΦ ask tends to infinity, and the rows ofmatrixΦare identical—eachaprobabilityvector.The reader isencouraged tofillinthedetails.

Theorem15-6 is perhaps themost important result in the theoryofMarkovprocesses. Many interesting and useful results for a regular Markov processdependontheexistenceofthislimitforPk,ask→∞.SinceP∞(whichisashorthandnotationforlimPkask→∞)exists,wecan

expressthesteady-stateprobability

Page 529: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Writingthisequationintermsofitselements,

Now,sinceallrowsofΦareidentical,eachelementϕijisequaltoavalueWjthatdependsonlyonthecolumnindexj.Thus

Thus a regular Markov process approaches the same limiting probabilitydistribution w regardless of where it started. Moreover, this final probabilityvector,π(∞)=w,istheonethatappearsasrowsofmatrixΦ.ForagivenregularMarkovprocess,howdoesonecomputethisfixedvector

w,thatis,thevectorthatmakesupalltherowsofΦandisalsoequaltoπ(∞)?Several methods are available. Raising the transition matrix P to higher andhigherpowersisone,butitisobviouslynotagoodmethod.Amostfrequentlyusedmethodisthefollowing:Successivestateprobabilityvectorsmustsatisfy

If the stateprobabilityvectorhasattained its limitingvalueπ(∞), itmust thensatisfy

andsinceπ(∞)=w,accordingtoEq.(15-12),itcanberewrittenas

Equation(15-15)impliesnsimultaneousequations,whichcanberewrittenas

But sinceP is a stochasticmatrix, the sumof rowsofmatrix I−P is zero.Therefore,I−Pisasingularmatrix;thatis, thenequationsinEq.(15-16)are

Page 530: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

not linearly independent. It can be shown, however, that any n − 1 of theseequationsarelinearlyindependent,andthusweneedonlyonemoreequationtosolve for thenunknowns in the rowvectorw.This is readilyprovidedby therelation

ThusinEq.(15-16)ifwereplaceanyonecolumn,saythejth,ofthematrixI−Pontheleft-handsideandchangethejthentryfrom0to1intheright-handside,wewouldincorporateEq.(15-17)intoEq.(15-16).Letthisnewequationbedenotedby

wherevj,isarowvectoroflengthnwithallzeroentriesexceptthejth,whichis1.Equation(15-18)canbesolvedbyeitherdirectlyinvertingthematrix orby using signal-flow graphs, as shown in Section 15-1. For illustration, let usconsider the three-state regularMarkov process given in Fig. 15-5. ApplyingEqs.(15-15)and(15-17)directly,weget

whichis

w1=.4w2+.5w3,

w2=.6w2+.5w3,

w3=w1.

Hence w1=w3=.8w2,

whichcombinedwith

w1+w2+w3=1,

immediatelyyieldsthelimitingprobabilityvector .Thisindeedistheresultwehadobtainedearlierbytrying17thandhigherpowersofP.SolvingthesameproblemusingtheformofEq.(15-18)gives

Page 531: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Replacinganyoneofthecolumns,saythesecond,withalll’sweget

whichoninvertingyields

Finally,

whichcheckswiththevalueofwobtainedearlier.InsteadofsolvingEq.(15-18)byalgebraicinversionofmatrix ,oftenitis

moreefficienttouseasignal-flowgraphtosolveEq.(15-20),particularlywhenmatrixPisrelativelysparse.Thesignal-flowgraphcorrespondingtoEq.(15-18)isdirectlyobtainedfrom

thetransitiongraphoftheprocessbyasimplemodification:

1. Replacethevertexlabelssi’swithwi’s.

2. Removealledgesincomingintothespecifiedvertexsj.

3. Putedgesofweight−1fromeveryothervertextosj.

4. Reverse the direction of every edge. [Inverting the edge directioncorrespondstotransposingthematrix—asrequiredbyEq.(15-4).]

5. Add a new vertexwith label 1 to the digraph and draw an edge of unitweightfromthisnewvertextosj.

Page 532: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

In thissignal-flowgraphwecanobtain thegainfromv toeveryvertex,whichwillgivetheelementsofw.

Fig.15-8Signal-flowgraphforaMarkovsystem.

Onceagain,modifyingFig.15-5wegettheappropriatedigraph,asshowninFig.15-8.Forthissignal-flowgraph[usingEq.(15-5)]thedeterminantisgivenby

Δ=1−t1+t2−t3+...=1−t1=1−(.5−.4−.4)=1.3,

andthethreerelevantcofactorsneededinEq.(15-6)are

Δ12=.4,Δ22=.5,Δ32=.4,

whichagaincheckswiththeresultsobtainedearlier.Medvedev [15-12] has a different method of obtaining vector w from the

signal-flowgraph,andthroughsomeexampleshehasshownthattherearecaseswhen graph-theoretic methods are superior to algebraic ones. Anothercomputationalformulausingtransitiondigraphsisgivenin[15-7].Formoreoncomputingvectorwviatransitiongraphs,see[15-8].

TransientAnalysisofaMarkovProcess

Matrix Φ = P∞ for a regular Markov process gives us the steady-statedistribution,butitdoesnotrevealthetransientbehavioroftheprocess.ItdoesnottellushowfastPkconvergestothelimitΦ,nordoesitgivethefrequencieswith which various states in the system were visited before the steady-state

Page 533: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

conditionwasreached.TheanswertothesequestionsliesinthebehaviorofthesequenceP,P2,P3,P4,Theproblemisthentofindaclosed-formexpressionformatrixPk(asafunctionofk).Thiscanbeobtainedusingz-transforms:FromEq.(15-13)weknowthat

π(k+1)=π(k)P.

Takingthez-transformofbothsidesofthisequation,weget

whereΠ(z)isthez-transformofπ(k).RearrangingEq.(15-19),weget

Applicationofinversez-transformtobothsidesofEq.(15-20)gives

Thus

Equation(15-21)givestheprobabilityvectorafterktransitionshavetakenplace,fork=1,2,...,andEq.(15-22)providesthevalueofPk,asafunctionofk,inaclosedformforanyMarkovprocess(notnecessarilyregular).Matrix I− zPcanbe invertedbydirectmatrixmethods, but the flow-graph

method,asusedforinverting(I−P)*inEq.(15-18),isoftenfoundtobemoreefficient. The weight of each edge ptj is now multiplied by z. Informallyspeaking, z is the transform of the unit delay, andmultiplying each transitionprobabilitybyzcorresponds to thedelayassociatedwitheach transition.Forathorough treatment of transient analysis of a Markov process via signal-flowgraphs,seeChapters3and4of[15-9].Forillustration,letusconsidertheMarkovprocessdepictedinFig.15-5.we

have

Page 534: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Letusnowcomputetheinverse(I−zP)−1byasignal-flowgraphratherthanalgebraically.Thesignal-flowgraphisnothingbutthetransitiongraphinwhicheachedgeismultipliedbyz,andthedirectionofeveryedgeisreversed.SeeFig.15-9,whichisobtaineddirectlyfromFig.15-5.

Fig.15-9Signal-flowgraphcorrespondingtoFig.15-5.

From Fig. 15-9we immediately obtain the cycle product terms [as used inEqs.(15-6)and(15-7)]asfollows:

Acofactor

Page 535: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Δ13=.5z(1−.6z)+.2z2

=z(.5−.1z),

whichisinagreementwiththe3,1entryinEq.(15-23).Nowtakingtheinversez-transformofbothsidesofEq.(15-23),weget

RemarksandReferences

As the brief exposition in this section shows,weighted digraphs enter verynaturally into the study of finiteMarkov chains; in particular, the asymptoticbehaviorofaMarkovchaincanbederivedswiftlyfromitsdigraph.Agreatdealmore on Markov chains remains unsaid in this section. Recommendedintroductory readings on Markov chains are [15-11] and [15-13]. For z-transformsandapplicationsofsignal-flowgraphstothestudyofMarkovchains,[15-9]isanexcellentsource.ThefollowingisalistofselectedreadingformoreontheinteractionofMarkovprocessesandgraphtheory.

15-7. BIONDI, E., G. GUARDABASSI, and S. RINALDI, “On the Analysis ofMarkovian Discrete Systems by Means of Stochastic Graphs,”AutomationandRemoteControl,Vol.28,No.2,Feb.1967,275–277.

15-8. GUARDABASSI,G.,andS.RINALDI,“TWOProblemsinMarkovChains:ATopological Approach,”Operations Res., Vol. 18, No. 2,March-April1970,324–333.

15-9. HOWARD,R.A.,DynamicProbabilisticSystems,Vol.I:MarkovModels,JohnWiley&Sons,Inc.,NewYork,1971.

15-10. HUGGINS, W. H., “Signal Flow Graphs and Random Signals,” Proc.I.R.E.,Vol.45,1957,74–86.

15-11. KEMENY, J. G. and J. L. SNELL,FiniteMarkov Chains, Van NostrandReinholdCompany,NewYork,1960.

15-12. MEDVEDEV,G.A.,“AnalysisofDiscreteMarkovSystemsbyMeansof

Page 536: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Stochastic Graphs,” Automation and Remote Control, Vol. 26, No. 3,March1965,481–485.

15-13. PARZEN, E., Stochastic Processes, Holden-Day, Inc., San Francisco,1965,Chapter6.

15-14. ROSENBLATT, D., “On the Graphs and Asymptotic Forms of FiniteBoolean Relation Matrices and Stochastic Matrices,” Naval ResearchLogisticsQuarterly,Vol.4,1957,151–161.

15-15. SITTLER,R.W.,“SystemAnalysisofDiscreteMarkovProcesses,”I.R.E.Trans.CircuitTheory,Vol.CT-3,No.1,1956,257.

15-3.GRAPHSINCOMPUTERPROGRAMMING

Analysisof agivencomputerprogramhasbeenan importantproblem fromtheearlydaysofcomputerprogramming.Thepurposeofsuchananalysiscouldbe to estimate the running time or storage requirement of a program, tosubdividealargeprogramintoanumberofsubprograms,todetectcertaintypesof structural errors in the program, to document a program, or simply tounderstandaprogramwrittenbysomeoneelse.Forallthesepurposesitisveryconvenient to represent a program as a digraph. Each vertex represents aprogramblock,thatis,asequenceofcomputerinstructionshavingthepropertythateachtimeanyinstructioninthesequenceisexecutedallareexecuted.Eachprogramblockhasoneentrypoint(thefirstinstructioninthesequence)andoneexit point (the last instruction in the sequence).Each edge (νi,νj) represents apossible transferofcontrol from the last instruction in theprogramblockνi tothefirstinstructionintheprogramblockνj.Suchadigraphiscalledaprogramdigraph.Aprogramdigraphcanalsobe thoughtofasanabstractionofaflowchart inwhich the boxes are shrunk to vertices and arrowsbecome the edges.Forexample,Fig.15-10showstheprogramdigraphoftheflowchartinFig.11-9.[Ignoredashedline(ν14,ν1fornow.]

Page 537: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Fig.15-10ProgramdigraphofFig.11-9.

Notethattheremaybemorethanoneprogramdigraphforagivenprogram,because one program block may be split into several. Also observe thatprogramsthatmodifytheirowncontrolandprocessinginstructionsinthecourseofexecutioncannotberepresentedinthisfashion.(Declarativestatements,suchasformatsanddimensionstatements,areignoredinprogramdigraphs.)Some obvious but important properties of a digraph representing any valid

computerprogramare

1. Aprogramdigraphmustbeconnected.

2. Ithaspreciselyonevertexofzeroin-degree,andthisvertexcorrespondstothe start of the program. (If the program has several starting points, anadditionalstartvertexcanbeintroducedfromwhichdirectededgescanbedrawntoallofthesevertices.)

3. There is precisely one vertex of zero out-degree, and this vertexcorresponds to the end of the program.We shall call it the stop vertex.(Existence ofmore than one stopping point in the program can be takencareofasinitem2.)

4. Every vertex in the program digraph must be accessible from the start

Page 538: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

vertex.

5. The stop vertex must be accessible from every vertex in the programdigraph.

DetectionofProgrammingErrors

Todetectandreportcertaintypesofstructuralerrorsinasourceprogramisanessential part of a compiler’s job. The most common of these errors can becheckedbytracingdirectedpathsfromthestartvertextothestopvertexintheprogramdigraph.Pathtracingwilldetectprogramblocksthatareneverentered,or program blocks from which there is no exit leading to the stop vertex, ordisjointparts,suchasasubroutinethatisnevercalled[15-33].

EstimationofProgramRunningTime

Given a computer program and the execution time for each of the programblocks,weareoftenrequiredtoestimatetherunningtimeoftheprogram.Thesituationisrepresentedbyaprogramdigraphhavingaweighttiassociatedwitheach vertex νi, where ti is the execution time of the corresponding programblock. Ifwe can estimate thenumberof times eachvertex is entered (i.e., theprogramblockisexecuted),therunningtimeoftheprogramcanbedetermined(foraparticularcomputer,ofcourse).In the program digraph let each directed edge ei be assigned a nonnegative

integer fi,where fi is thenumberof times edgeei is traversed.Thenumberoftimesavertexisenteredmustequalthenumberoftimesitisexited,exceptforthestartvertexandthestopvertex.Thesetwoexceptionscanalsobetakencareofbyaddinganedgeofunitweightdirectedfromthestopvertexνntothestartvertex ν1 (see the dashed edge in Fig. 15-10). Now the edge weights in thismodified digraph satisfy the Kirchhoff current law (KCL) at every vertex.(Quantity fimay be looked upon as a flow through the ith edgeei.Recall theelectricalnetworksinChapter13andtheflownetworksinChapter14.)IfweapplyKCLtoaweighted,connecteddigraphofnverticesandeedges,

wegetn−1linearlyindependentequationsineunknowns,theunknownsbeingthe weights of (i.e., the flows through) the edges. Thus we can chooseindependentlyonlyasetofμ=e−n+1flows,correspondingtothechordswithrespecttoanyspanningtreeinthedigraph.Theremainingn−1flowsthroughthetreebranchescanbeexpressedintermsoftheseμflows.Forexample,intheprogramdigraphofFig.15-10,μ=18−14+1=5.Therefore,theflowthrough

Page 539: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

every edge can be expressed in terms of five unknowns. Thus the iterationcounts through14boxes in the flow chart are expressed in termsof only fiveunknowns.Thesefiveunknownscanalsobechosenconvenientlybypickingaspanningtree.Forexample,inFig.11-9weknowthattheiterationcountoftheedge(ν4,ν7)isN−1,whereNisthenumberofverticesintheoriginalgraphonwhich Algorithm 6 was being applied. The flows through the remaining fourchordsaredatadependentinamoreinvolvedfashion.Theminimum,maximum,and average running times of the program can be estimated by assumingappropriateprobablevaluesofthesefourunknowns.Atthispointtheproblemofestimatingtherunningtimebecomesquitedifficult.Forsomesimpleexamples,thereaderisreferredto[15-25],[15-26],andpages95–102and364–369of[11-39].Inthisconnectionaninterestingquestionisasfollows:GivenaconnecteddigraphGwithverticesν1,ν2,...,vnandeedges,having

weightsf1,f2,...,feassociatedwiththeedges,whatarenecessaryandsufficientconditionsthatGcorrespondstosomeprogramdigraphsuchthatν1isthestartvertexandvnisthestopvertex?Somenecessaryconditionsareobvious:Eachfi,mustbeanonnegativeinteger.Thein-degreeofν1=0=out-degreeofvn.Also,thefi’smustsatisfyKCLateachvertexexceptatv1andvn.Moreover,thesumofweights of edges goingout ofν1 shouldbe equal to the sumofweights ofedges going intoνn, both being equal to unity.Are these conditions sufficientalso?Theanswer,asgivenbythefollowingconstruction,isyes.Fromthegiven,weighteddigraphGletusconstructanunweighteddigraphH

asfollows:Replaceeveryedgeejwithfjparalleledges,wherefjistheweightoftheedgeejinthedigraphG.Clearly,thedigraphHwillbebalanced[i.e.,d+(ν)=d−(ν)foreveryvertexνinH]ifandonlyifKCLissatisfiedateveryvertexinG.Now, from Theorem 9-1, a digraph is balanced if and only if it is an Eulerdigraph; that is, there exists a directedEulerwalk from ν1 to vn inH. This ispossibleifandonlyifthereexistsadirectededgesequenceinGfromvertexν1tovnsuchthateveryedgeekappearsinitexactlyfktimes,andtheedge(vn,ν1)doesnotappearinthisdirectededgesequence.ThelaststatementisequivalenttoGbeingaprogramdigraphwithν1asstartvertexandvnasstopvertex.Thuswehave.

THEOREM15-7

Page 540: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

LetGbeaconnected,weighteddigraphwithnverticesandeedges.Letalltheedgeweightsf1,f2,...,febenonnegativeintegers,andsuchthattheysatisfyKCLateachvertex,exceptν1andvn.Furthermore,letthein-degreeofν1=0=out-degreeofvn,andthesumoftheweightsoftheedgesgoingoutofv1=thesum of the weights of the edges going into vn = 1. ThenG corresponds to aprogram digraph inwhich ν1 is the start vertex, vn is the stop vertex, and theweight fi of the ith edge is the number of times that edge is traversed in theprogram.

ProgramSegmentation

Sometimes one comes across a program so large that it cannot beaccommodated in its entirety into the working memory of the availablecomputer.Insuchacasetheprogrammustbesegmentedbeforeexecution.Thenthe segments (pieces) of theprogramarebrought from the slowbulkmemory(drum,disk,ortape)andexecutedoneatatime.Thesizeofeachsegmentmustbesmallenoughtobeaccommodatedintotheworkingmemoryandyetmustbelarge enough so that there would not be too many transfers between the fastworkingmemoryandtheslowbulkmemory.Thuswehaveaproblemoffindingan optimal partitioning of the program digraph into subdigraphs such that thesum of weights of vertices (here the weight si of vertex vi is the amount ofstorage space required by the ith program block) does not exceed a specifiedvalue. A similar problem arises in a multiaccess, timesharing environment,where each user is given a burst of service of fixed duration. The programsegments have to be chosen judiciously, not so large that its execution willexceed the allotted time and yet not too short to require inefficient transfersbetweenmemories.Iftheprogramdigraphisacyclic(i.e.,theprogramhasnoloops,whichisrare

foranynontrivialcomputerprogram),thepartitioningproblemissolvedeasily.Wesorttheverticesinatopologicalorder,andstartingfromthefirstvertex,wepartition the sequence into largestpossible (topologically sorted) subsequencessuchthatthetotalvertexweightofnosubsequenceexceedsthespecifiedvalue.The difficulty in segmentation arises because of directed circuits in the

program digraphs (i.e., loops in the program). A cut made across a directedcircuit impliesinterchangesbetweenthetwosegments,andhencebetweenfastand slow memory. Thus one would like to avoid a segmentation that causesverticesofonedirectedcircuittobelongtomorethanonesegment.Thesimplestmethod to accomplish this is to identify all fragments (i.e., maximal strongly

Page 541: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

connected subdigraphs) in the program digraph. Then compute the memoryrequirement of each fragment by adding the weights of all its vertices. If thelargestof thesememory requirementsdoesnotexceed the sizeof theworkingmemory, then theproblem is solved.Forweneednotcut anydirectedcircuit,andsmall fragmentscanalwaysbecombined toyieldasegmentof reasonablesize.Inpractice,however,itisfoundthatthelargestfragmentisusuallytoolarge

to fit in the working memory. For example, in Fig. 15-10 almost the entireprogram digraph forms a fragment. In such a case, cutting across directedcircuits is unavoidable.The simplest approach suggested in the literature is tofindapartitionthatseverstheleastnumberofdirectedcircuits.Thisisadifficultproblem. To enumerate all strongly connected subdigraphs in the programdigraphand thenconsidereachasapossiblesegment,althoughsuggestedasasolution in the literature [15-32], is a horrendous task. Even generation of alldirected circuits in a digraph is extremely time consuming, aswe observed inChapter 11. Another method suggested for program segmentation is by firstorderingtheverticesinacertainfashion[15-20].Thismethodofsegmentationinvolvesmorelaborthanfindingallfragments,butlesslaborthangeneratingallstronglyconnectedsubdigraphsoftheprogramdigraph.Segmentationofaprogramisaverydifficultproblem,tosaytheleast.Weare

quite far from having found a procedure for an efficient solution for thisimportantandinterestinggraph-theoreticproblem.Even ifwewere able toobtain apartitioning thatminimized thenumberof

severed directed circuits, the solution might not be optimal. Every directedcircuitisnottraversedthesamenumberoftimes.Obviously,cuttingadirectedcircuitwithhigheriterationcountisworsethancuttingonewithloweriterationcount. We must have the iteration count of each loop—information rarelyavailableabinitio,becauseofitsdatadependence.Astochasticanalysisoftheprogram, assuming that it behaves as aMarkov system, isoften the answer tothisproblem.

StochasticModelofaProgram

Onemethodusedtoestimatetherelativefrequenciesoftraversalofdifferentedgesandverticesistoassumetheprogramdigraphtobeastochasticdigraph,inwhich theweightpij of edge (νi, νj) is the conditional probability† that theprogram executionwill go to program block νj given that it has executed theprogramblockνi.Oncetheprogramreachesνn, thestopvertex,theprobability

Page 542: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

ofitsbranchingtoanyothervertexiszero.TosatisfytheconditionsinEq.(15-8),weaddaself-loopofweightoneatvertexνn.Thusνnisanabsorbingstate,theonlyabsorbingstateinthesystem,andtheremainingverticescorrespondtotransient states. A very simple stochastic program digraph and its transitionmatrixPareshowninFig.15-11.

Fig.15-11Stochasticprogramdigraphanditstransitionmatrix.

ThetransitionmatrixPofanystochasticprogramdigraphcanbeexpressedintheform

whereQisan(n−1)by(n−1)submatrixcorrespondingtothetransientstates,Tisan(n−1)by1columnvector,and0istherowvectorofn−1zeros.Letus lookatmatrixPk,which represents thek-step transitionprobabilities.

Clearly,

Page 543: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

(T′isamatrixthatweneednotcomputehere.)TheijthentryinQkistheprobabilityofbeingintransientstateνjafterexactly

k transitionsfromthestartingstateνi (alsotransient).LetusfirstshowthatQk

becomes0askbecomeslarge.In thestochasticprogramdigraphGwithnvertices, letpibe theprobability

thatstartingfromvertexνi theprogramwillnotreachνnstopvertexinnsteps(or less).Since there exists at least onedirectedpath (of lengthn−1or less)withanonzeropathproductfromνitoνn,quantitypi<1.Letpbethelargestofallpi’s.Theprobabilityofnotreachingνninnstepsislessthanp,in2nstepsitislessthanp2,andsoon.Sincep<1,theseprobabilitiestendtozero.Thatis,thesumoftheentriesintheithrowofQkask→∞becomeszero,fori=1,2,...,n−1.NowsinceQk=0forsomelargek,wecanwrite

whichcanbeeasilyverifiedbymultiplyingbothsideswithI−Q.Equation(15-26)saysthatmatrixI−Qisnonsingular.Forbrevity,letusdenotematrix(I−Q)−1byR=[rij].Thesumofprobabilitiesofreachingνjfromνiin1step,2steps,3steps,...,

andk−1stepsisequaltorij,theijthentryin(I−Q)−1,accordingtoEq.(15-26).This is precisely the averagenumberof timesvertexνj appears in the randompathsstartingfromνi.Inaprogram,sincewealwaysstartfromν1andendatνn,the first row of R gives us the average iteration counts of all n − 1 transientvertices.Thatis,

r1j = the average number of times program block νj will be executed in atypicalrun.

Matrix R = (I −Q)−1, besides giving the average number of occurences ofdifferentvertices, isastorehouseofa lotofotheruseful informationabout thetransientbehaviorofthestochasticprogramdigraph.Forexample,lethijdenotetheprobabilitythattheprogramwilleverexecuteνjhavingexecutedνi.Clearly,

rij= hij·(averagenumberoftimesνjoccurs,giventhatthesystemstartedinνj)

=hij·rjj.

Page 544: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Therefore,

To extract another piece of information from matrix R, let βj denote theprobabilitythattheprogramstartingfromνjwillneverreturntoνj.Now,topassrjjtimesthroughavertexνj,theprocessmustreachνjonceandthenreturnthererjj−1times.Therefore,theprobabilityofreturningtoνjafterleavingitonceisgivenby

Hencetheprobability,βj,ofneverreturningtoνjafterleavingitonceis

Finally, let αj denote the probability that νj is executed exactly k times(startingfromthestartvertexν1).Then

ForillustrationletuscontinuewiththeexampleofFig.15-11.TheQmatrixis

andmatrixR=(I−Q)−1comesouttobe

Page 545: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Therefore,

r12= istheaveragenumberoftimesvertexν2getsexecuted,

h12= istheprobabilitythatν4willbeexecuted,

β3= is theprobability thatν3willneverbeexecutedgiven that ithas justbeenexecuted.

Andsoon.Havingcomputedtheaveragenumberofexecutionsofeachvertexνj,onecan

immediatelygettheexpectedexecutiontimefortheentireprogramas

wheretjistheexecutiontimeoftheprogramblockνj.Equation(15-30)assumesthat there is no parallel processing (i.e., no two program blocks are executedsimultaneously).For thepurposeofsegmentingafragmentg in theprogramdigraph,wecan

compute the least frequently used edge in g, delete it from the fragment, andcheck if the resulting digraph can be partitioned into appropriate sizesubfragments.Ifnot,weremovetheleastfrequentlyusededgeintheremainingdigraph. This process is continued till subfragment g is segmented into therequired size subfragments. This is the stochastic segmentation proceduresuggestedin[15-33].Themost difficult part of stochastic analysis of a program is the labor and

inaccuracies involved in the evaluation of the transitionmatrix P, because thebranchingprobabilitiesaredatadependent.Theycan,however,beestimatedbysimulationmethodsusing sample input data [15-33].Another difficulty is thatfor many programs the assumption about the weights pij’s being statisticallyindependentisnotvalid.

RemarksandReferences

Inanalysisanddesignofapplicationprogramsandsystemsoftwareyouarelikely to encounter graph theory more often than any other branch ofmathematics.Aswehave just seen,aweighteddigraph isanaturalandusefulrepresentationofacomputerprogram,andisofimmenseaidintiminganalysis,segmentation, and in detecting certain common types of structural errors. In

Page 546: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

addition,thereareotherprogrammingapplicationsthatwerenotdiscussedhere.Someoftheseare

1. Programoptimization,[15-16].

2. Automaticflowcharting,[15-19]and[11-4],page245.

3. Graphsasdatastructures,[15-34].

4. Parallel-processingdesignandevaluation,[15-23].

5. Inprovingequivalenceoftwoprograms,orprovingvalidityofaprogrambytransformingtheprogramdigraphintocanonicalforms.

Thefollowinglistofpapersisasampleofthegrowingliteratureonutilizationofgraphsintheartofcomputerprogramming.

15-16. ALLEN, F. E., “Program Optimization,” Ann. Rev. AutomaticProgramming, Vol. 5, 1969, 239–307.M. I. HALPERN and C. J. SHAW(eds.),PergamonPress,Inc.,Elmsford,N.Y.,1969.

15-17. BAER, J. L., and R. CAUGHEY, “Segmentation and Optimization ofProgramsfromCyclicStructureAnalysis,”Proc.AFIPSConf.,Vol.40,1972,SJCC,23–35.

15-18. BEIZER, B., “Analytic Techniques for the Statistical Evaluation ofProgramRunningTime,”AFIPSConf.,Vol.37,1970,FJCC,519–524.

15-19. BERZTISS,A. T., andR. P.WATKINS, “DirectedGraphs andAutomaticFlowcharting,”Proc. 4th Austral. Comput. Conf. Adelaide, 1969, 495–499.

15-20. EARNEST,C.P.,K.G.BALK,andJ.ANDERSON,“AnalysisofGraphsbyOrderingofNodes,”J.ACM,Vol.19,No.1,Jan.1972,23–42.

15-21. HAMBURGER,P.,“OnanAutomatedMethodofSymbolicallyAnalyzingTimesofComputerPrograms,”Proceedingsof the21stACMNationalConference,ThompsonBookCo.,Washington,D.C.,1966,321–330.

15-22. KARP, R. M., “A Note on Application of Graph Theory to DigitalComputerProgramming,” InformationandControl,Vol.3,1960,179–190.

15-23. KARP, R. M., and R. E. MILLER, “Properties of a Model of ParallelComputations: Determinancy, Termination, Queueing,” SIAM J. Appl.Math.,Vol.14,1966,1390–1411.

15-24. KERNIGHAN,B.W.,“OptimalSequentialPartitionsofGraphs,”J.ACM,Vol.18,No.1,1971,34–40.

Page 547: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

15-25. KNUTH, D. E., “Mathematical Analysis of Algorithms,” Proc. IFIPCongress71,Ljubljana,Aug.1971,1135–1143.

15-26. KNUTH, D. E., “The Analysis of Algorithms,” Proc. InternationalCongressofMathematics,Nice,Sept.1970.

15-27. KRAL,J.,“OneWayofEstimatingFrequenciesofJumpsinaProgram,”Comm.ACM,Vol.11,1968,475–480.

15-28. KREIDER,L.,“AFlowAnalysisAlgorithm,”J.ACM,Vol.11,No.4,Oct.1964,429–436.

15-29. LOWE, T. C, “Automatic Segmentation of Cyclic Program StructuresBased on Connectivity and Processor Timing,”Comm. ACM, Vol. 13,No.1,Jan.1970,3–9.

15-30. MARIMONT, R. B., “Applications of Graphs and Boolean Matrices toComputerProgramming,”SIAMRev.,Vol.2,1960,259–268.

15-31. MARTIN, D., andG. ESTRIN, “Models of Computations and Systems—EvaluationofVertexProbabilitiesinGraphModelsofComputations,”J.ACM,Vol.14,No.2,April1967,281–299.

15-32. PROSSER, R. T., “Applications of BooleanMatrices to the Analysis ofFlow Diagrams,” Proceedings of the Eastern Joint ComputerConference,Dec.1959,SpartanBooks,NewYork,133–138.

15-33. RAMAMOORTHY,C.V.,“TheAnalyticDesignofaDynamicLookAheadand Program Segmenting Scheme for Multiprogrammed Computers,”Proceedingsofthe21stACMNationalConference,ThompsonBookCo.,Washington,D.C.,1966,229–239.

15-34. ROSENBERG,A.L.,“DataGraphsandAddressingSchemes,”J.ComputerandSystemSci.,Vol.5,No.3,June1971,193–238.

15-35. SCHURMANN, A., “The Application of Graphs to the Analysis ofDistribution ofLoops in a Program,” Information andControl,Vol. 7,1964,275–282.

15-36. VERHOFF,E.W., “AutomaticProgramSegmentationBasedonBooleanConnectivity,”SJCCProc.,Vol.38,1971,491–495.

15-4.GRAPHSINCHEMISTRY

Although Arthur Cayley used trees to represent the structures of organicmolecules100yearsago(and,indeed,muchoftheearlyinterestinthestudyoftrees was motivated by this representation), it is only recently that graph-theoretic techniques are coming intouse for characterizationand identificationofchemicalcompounds.Thisisdueto(1)theadventoftheelectroniccomputer

Page 548: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

with its ability to handle graphs, and (2) the ever-intensifying need of thechemist to have amechanized information retrieval system capable of dealingwiththemillionsoforganiccompoundsknowntoday.Given a chemical substance and some of its properties (such as molecular

weight, chemical composition,mass spectrum, etc.), the chemistwould like tofind out if this substance is a known compound. If he is able to identify thiscompound,hemayliketoknowsomeadditionalpropertiesofthecompound,orifthecompoundis“new”hewouldliketoknowitsstructure,andthenincludeitin the dictionary of known compounds. It is essential, therefore, to have astandardrepresentationforacompound,andtherepresentationmustbecompact,unambiguous,andamenabletoclassification.ItwasshowninSection3-6howachemicalcompoundcanberepresentedby

means of a connected graph, with the atoms as the vertices and the bondsbetweenthemasedges.Forcompactnessthehydrogenatomsareomittedfromthe representation, as they are implied by every unused valence of the otheratoms.Forexample, thestructuralgraphofaminoacetoneC3H7NO,with itsHatomsstrippedoff, is shown inFig.15-12. [Recall that thevalence forcarbon(C)is4,fornitrogen(N)itis3,andforoxygen(O)itis2.]

Fig.15-12Structuralgraphofaminoacetone.

Thestructuralgraphofachemicalcompound,ingeneral,containsmuchmoreinformation than the molecular formula does. For example, the molecularformula C10H22 can denote any of its 75 isomers (75 being the number ofunlabeled trees with 10 vertices and with no vertex of degree five or more),while the graph specifies the exact isomer. Itmust be kept inmind, however,thatastructuralgraphdoesnotcontainalltheinformationcontainedinthethree-dimensional model of the chemical compound. The structural graph does notspecify thebonddistancesor thebondanglesof themolecule.Since theseareknownonlyforasmallnumberoforganicmoleculesanyway,thisisnotmuchofahandicap.Aslightlymoreseriousshortcomingofagraphisitsinabilitytodistinguish between stereoisomers [15-40]. Thus, except for stereochemistry

Page 549: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

purposes, the structural graph gives a reasonably adequate description of achemicalcompound.

CanonicalRepresentationofaMolecule

As pointed out above, a standard representation of chemical structures is aprecondition for a computerized information retrieval system. From thestructuralpointofview,organicmoleculescanbedividedintotwoclasses:(1)thealiphaticcompounds,and(2)theringcompounds.Thestructuralgraphofanaliphaticcompoundhasnocircuit,exceptpossiblycircuitsoflengthtwoarisingoutofmultiplebonds,whicharerepresentedbyparalleledges,asshowninFig.15-12.Thegraphofaringcompoundcontainsatleastonecircuitoflengththreeormore.Since the graph of an aliphatic compound is a tree (if we ignore parallel

edges), itcaneasilybegivenacanonical representationas follows:Every treehas a unique centroid or a pair of centroids (parallel edges are considered assingleedgesforthepurposesoflocatingthecentroid).Thecentroidcanbeusedastherootofthetree(recallSection10-3),andeachsubtreeattachedtotherootisaradical.Thesubtreescanbeorderedbythenumberofverticestheycontainin a nondecreasing order. Each radical is further subdivided into subradicals,which are ordered in the same fashion. This process produces a unique linearcodeforeachtree—astring.Forexample,thecodeforthetreeinFig.15-12isC(C)(=O)(C(N)).Formoredetailsoncodingofaliphaticcompounds,see[15-42].Cyclic compounds are less tractable, because nounique centroid (or pair of

centroids)canbedefinedinagraphwithcircuits.Fortunately,thechemistneednot be concernedwith thegeneral problemof coding agraph (averydifficultproblem,asdiscussedinChapter11).Thestructuralgraphofalmosteveryringcompoundis (1)planar, (2)a regulargraphofdegree three,and(3)containsaHamiltoniancircuit.Itisnotverydifficulttofindauniquelinearcodeforsuchagraph. There exists an n-sided polygon in such a graph of n vertices, and adescriptionofthegraphrequiresonlysomenotationfortheremainingn/2edges.Theseedgesmayberepresentedbyasequenceofnnumbersconsistingoftheirend vertices. For details on this coding scheme formost ring compounds, see[15-42].

MatchingofChemicalStructure

Theproblemofdeterminingwhetherornottwochemicalcompounds(having

Page 550: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

thesamechemicalformula)areidenticalisthesameasthegraphisomorphismproblem,considerablysimplifiedbythelabelsofthevertices.Findingauniquecode for a graph implies the solution of the isomorphism problem as well,because two graphs would be isomorphic if and only if their codes were thesame.Forchemicalstructures,however,itisgenerallyeasiertoperformadirectvertex-by-vertexmatching than to first find aunique code for eachgraph.WeshalldescribeonesuchalgorithmformatchingofchemicalstructuresbasedonSussenguth’spaper[11-59],Theunderlyingideabehindthisalgorithmistousevariousproperties(suchas

labels,degrees,adjacencies,etc.)ofverticesinthetwographstogeneratepairsof vertex subsets, which must match if the graphs are to be isomorphic. Anincreasing number of properties are used to partition vertices into smaller andsmallersubsets.Eventually,eithereveryvertexinonegraphisuniquelypairedoffwithavertexintheothergraph,ortwosubsetsofverticescharacterizedbyidenticalpropertiesinthetwographsdonothavethesamenumberofvertices.(A third case ariseswhenmore than one isomorphism exists between the twographs.)Theprocesscanbebestexplainedwithanexample:

Fig.15-13Structuralgraphsoftwomolecules.

LetusdeterminewhetherornotthetwomoleculesinFig.15-13areidentical(Hatomsarenotshown,asusual).Theverticesarearbitrarilynamed(1),(2),...,(8)inGand(a),(b),...,(h)inJ.The process of generating matching subsets with common properties is

outlined in Table 15-1. For instance, vertices representing carbon atoms inGmustcorrespondtothoserepresentingcarbonatomsinJ.Ofthese,thependantCverticesinGmustcorrespondtopendantCverticesinJ,andsoon.(NotethatTable 15-1 shows only a part of the subsets that are actually generated andmatched.)FromTable15-1,weconclude thatG andJ are isomorphicand thevertexcorrespondenceis

Page 551: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Asimilar procedure canbeused to identifyonegivengraph as a subgraphofanother.

Table15-1MatchingofChemicalStructures

ComputerizedChemicalIdentification

Giventhechemicalformulaofa“new”substanceandthevalencerules,onecan generate the list of all distinct chemical structures possible, using graphenumeration techniques.Computerprogramshavebeenwritten toperformthisoperation. (It is necessary, of course, tohave a coding scheme that provides aunique representation for a structural graph.) This method of producing anexhaustivelistofallpossibleisomersgetsoutofhandasthenumberofatomsinthemoleculeincreases.Forexample,thereareover millionstructurespossiblefor C20H41OH. It is therefore necessary to provide additional chemical

Page 552: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

information(suchasthetypeofradicalsruledoutasunstable)tokeepthelisttoamanageablesize.Acomputerprogramcanbewrittentocompareeachofthestructures in the list against various sets of analytical data, particularly massspectra.Asapartofthecontinuingefforttowardasystemofautomatedidentification

of chemical compounds, a computer language, called DENDRAL, has beendevelopedatStanfordUniversity.See[15-38]and[15-39].OneoftheprogramsinDENDRALgeneratesthelistofalltree-typepotentialisomersfromaninputof molecular formula and mass spectrum. The program, written in LISPlanguage,consistsof40,000words,andisrunonaPDP-6timesharingsystematStanford.Oneof the long-termgoalsof suchaneffort is todevelopa tool forautomatedchemicalexplorationoftheplanets[15-42].

RemarksandReferences

LederbergandFeigenbaumand their teamatStanfordUniversityhavedonethepioneeringworkincomputerizedchemicalidentificationviagraphtheory.Anumber of technical reports and papers (four of them referenced in [15-44])describe various aspects of the DENDRAL program. See also [15-37]. For avery readable description of the essentials of DENDRAL, see the paper byFeigenbaum and Lederberg [15-38]. Another paper by Lederberg [15-40] isrecommended as a well-written exposition of how graphs can be used forrepresentingstructuresoforganicmolecules—bothtreetypeandringtype.Sussenguthinhisdoctoralthesisandinasubsequentpaper[11-59]hasgiven

analgorithmformatchingchemicalstructures.Hereports that thecomputationtimeinhisalgorithmvariesonlyasthesquareofthenumberofvertices;andthathis computer program when run on an IBM 7090 took 6 to 7 seconds formatching50-vertexgraphsandonlyafewthousandthsofasecond todetect ifthegraphswerenotmatched.Asurveyofcomputermethodsinhandlingchemicalstructuresisavailablein

[15-44], which includes most of the relevant references through 1966. Otherpapers recommended are [15-38], [15-43], and [11-59].The search for a goodcodingsystemisfarfromover.PapersproposingalternativenotationalsystemscontinuetoappearintheJournalofChemicalDocumentation.

15-37. BUCHANAN, B. G., G. L. SUTHERLAND, and E. A. FEIGENBAUM,“HEURISTIC DENDRAL: A Program for Generating ExplanatoryHypotheses in Organic Chemistry,” Machine Intelligence, Vol. 4(Meltzer andD.Michie, eds.), EdinburghUniversity Press, Edinburgh,

Page 553: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

1969.15-38. FEIGENBAUM, E. A., and J. LEDERBERG, “Mechanization of Inductive

Inference in Organic Chemistry,” inFormal Representation of HumanJudgement (B.Kleinmuntz, ed.), JohnWiley&Sons, Inc.,NewYork,1968,187–218.

15-39. GLUCK, D. J., “A Chemical Structure Storage and Search SystemDevelopedatDuPont,”J.Chem.Doc,Vol.5,No.1,Feb.1965,43–51.

15-40. LEDERBERG,J.,“TopologyofMolecules,”inTheMathematicalSciences,TheM.I.T.Press,Cambridge,Mass.,1969,37–51.

15-41. LYNCH,M.F.,J.M.HARRISON,W.G.TOWN,andJ.E.ASH,ComputerHandling of Chemical Structure Information, Elsevier PublishingCompany,Amsterdam,1971.

15-42. MEETHAM, A. R., “Partial Isomorphisms in Graphs and StructuralSimilarities in Tree-Line Organic Molecules,” Proc. IFIP Congress,1968.

15-43. PENNY, R. H., “A Connectivity Code for Use in Describing ChemicalStructures,”J.Chem.Doc,Vol.5,No.2,May1965,113–117.

15-44. TATE,F.A.,“HandlingChemicalCompoundsinInformationSystems,”Ann.Rev.Inf.,Sci.Tech.Vol.2(C.A.Cuadra,ed.),JohnWiley&Sons,Inc.,NewYork,1967,285–309.

15-5.MISCELLANEOUSAPPLICATIONS

Thereisvirtuallynoendtothelistofproblemsthatcanbesolvedwithgraphtheory. In addition to applications covered in the last four chapters, manyapplicationswerementionedinearlierchapters,forexample,binarysearchtreesfor file organization (Chapter 3), design of printed-circuit board (Chapter 5),dimersproblemincrystalphysics(Chapter8),teleprinter’sproblem(Chapter9),and rankingproblem(Chapter9).The followingaresomeadditionalexamplesofapplications.

Information Retrieval: In a modern information retrieval system eachdocumentcarriesanumberof index terms (alsocalleddescriptors).The indexterms are represented as vertices, and if two index terms νt and νj are closelyrelated (suchas“graph”and“tree“), theyare joinedwithanedge (νn,νj).Thesimple, undirected (and possibly disconnected) large graph thus produced iscalled thesimilaritygraph.Components (i.e.,maximallyconnectedsubgraphs)of thisgraphproduceaverynaturalclassificationofdocuments in thesystem.

Page 554: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

For retrieval, one specifies some relevant index terms, and the maximalcomplete subgraph that includes the corresponding vertices will give thecomplete listof indextermswhichspecify theneededdocuments.Establishinggraph isomorphism is needed in a situation such as an information retrievalsystem for chemical compounds. The reader is referred to Salton [15-60] formoreonthesubject.Reference[11-1]isalsorecommended.

Analysis ofLumpedPhysical Systems: InChapter 13we sawhowa systemconsistingoftwo-terminalelectricalcomponentswasrepresented(andanalyzed)bymeansofagraph.Inthatcasethegraphlookedverymuchlikethenetworkschematicdiagram.Thisapproachcanbegeneralizedsothatagraph(calledthesystemgraph)isusedtomodelanyphysicalsystembuiltfromafinitenumberofinterconnectedcomponents,giventhemodelofeachcomponent,ofcourse.Thesystemgraphisaconvenienttoolinanalysisoftheentirephysicalsystem.SeeTrent[15-61]orKoenig,Tokad,andKesavan[15-57]formoredetails.

MatrixInversion:Forinvertingalarge(say,100by100)sparsematrixMbyacomputer,thestraightforwardapplicationoftheGaussianeliminationmethodisinefficient, is susceptible to poor accuracy, and causes storage problems. Thefollowinggraph-theoreticmethodhasbeenfoundtobebetter:

1. Replaceeachnonzeroentry in thegivenmatrixMwitha1,andpermutetherowsand thecorrespondingcolumnsof theresultingbinarymatrix tomakealldiagonalentriesasl’s.

2. ThematrixX so obtained is now regarded as the adjacencymatrix of adigraph G (the self-loops corresponding to l’s along the diagonal aredeleted).

3. Theresultingdigraphispartitionedintoitsfragments.

4. A fragment, if too large, is “torn” further into smaller fragments byremovinganappropriateedge.

5. The smaller matrices are inverted, and from them the inverse of theoriginalmatrixM−1isobtained.

ForfurtherdetailsseeHarary[15-54]andIyer[15-56].

Graphs of Groups: Cayley showed that every group of order n can berepresentedbyastronglyconnecteddigraphofnvertices,inwhicheachvertexcorresponds toagroupelementandedgescarry the labelofageneratorof thegroup (originally, Cayley used edges of different colors to show different

Page 555: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

generators).Thusthegraphofacyclicgroupofordernisadirectedcircuitofnverticesinwhicheveryedgehasthesamelabel.Thedigraphofagroupuniquelydefinesthegroupbyspecifyinghoweveryproductofelementscorrespondstoadirectededgesequence.Thisdigraph,knownastheCayleydiagram,isusefulinvisualizingandstudyingabstractgroups.Formoredetailsongraphsofgroups,see[15-52].

Linguistics:Graphshavebeenusedinlinguisticstodepictparsingdiagrams.The vertices representwords andword strings and the edges represent certainsyntacticalrelationshipsbetweenthem.Asetofwords(vocabulary)andasetofrules(grammar)forformingstrings(sentences)characterizealanguage.Inotherwords, the language then is a set of all legal strings so generated. (Naturallanguages,becauseof their complexity, havedefied attempts at suchcompletespecifications.)Oneproblemincomputational linguisticsis toidentifywhetherornotagivenstringbelongstoalanguage,whosevocabularyandgrammararegiven.Formoreongraphsincomputationallinguistics,see[15-55].

SociologicalStructures:Digraphsunderthenamesociogramshavebeenusedto represent relationships among individuals in a society (or group).Membersare represented by vertices and the relationship (admiration, association,influence, etc.) by directed edges. Connectedness, separability, completesubdigraphs, size of fragments, and so forth, in a sociogram can be givenimmediatesignificance.Anumberoftribeshavebeenstudiedbyanthropologistsandareclassifiedaccording to theirkinshipstructures.Formoreon this topic,seeFlament[15-51],Harary[15-53],andChapter8ofAnderson[15-45].Graphtheoryhasalsobeenusedineconomics[15-46],logistics,cybernetics,

artificial intelligence, pattern recognition, genetics, reliability theory, faultdiagnosis in computers, studying the structure of computer memory, and thestudy ofMartian canals [15-63].Amathematicalmodel of disarmament [1-2]hasbeenattemptedwithgraphtheoryandsohavetheconflictintheMiddleEastand the structureofMozart’s opera,Cosi fan tutte [15-53].And thusgoes theever-increasinglistofapplicationsofgraphtheory.Admittedly,insomeoftheseapplications a graph is used only as ameans of visual representation, and nomore than a trivial use ismade of graph theory itself. There aremany cases,however, where important and not-so-obvious results are obtained through adeeperuseofgraphtheory.

BibliographiesandFurtherReading:Although throughout the textwehaveprovided selected readings, thenumberofpublishedpapersongraph theory ismuchlarger(over3000).Thereareseveralgoodbibliographiesavailable,where

Page 556: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

mostof thepublishedmaterialon thesubject is listed.Thebestknownamongthese are Zykov [15-64], Turner andKautz [15-63], Turner [15-62], andDeo[15-49].Aninformativearticlecontainingasystematic listofdefinitionsandabibliographyofgraph theoryasapplied tophysics is [15-50].SomeadditionalbooksrecommendedareMayeda[15-59],Chen[15-48],Marshall [15-58],andBehzad and Chartrand [15-47]. I hope your interest in graph theory has beenarousedsufficientlysothatyouwillgoexploringinthecitedliteratureonyourown.

15-45. ANDERSON, S., Graph Theory and Finite Combinatorics, MarkhamPublishingCompany,Chicago,1970.

15-46. AVONDO-BODINO, G.,Economic Applications of the Theory of Graphs,GordonandBreach,SciencePublishers,Inc.,NewYork,1962.

15-47. BEHZAD,M.,andG.CHARTRAND,IntroductiontotheTheoryofGraphs,AllynandBacon,Inc.,Boston,1972.

15-48. CHEN,W.,AppliedGraphTheory,North-HollandPublishingCompany,Amsterdam,1971.

15-49. DEO, N., “An Extensive English Language Bibliography on GraphTheory and Its Applications,” National Aeronautics and SpaceAdministration/JPL (California Institute of Technology) TechnicalReport32-1413,October1969;Supplement1,April1971.

15-50. ESSAM, J. W., and M. E. FISHER, “Some Basic Definitions in GraphTheory,”Rev.Mod.Phys.,Vol.42,No.2,April1970,272–288.

15-51. FLAMENT,C,ApplicationsofGraphTheorytoGroupStructure,Prentice-Hall,Inc.,EnglewoodCliffs,N.J.,1963.

15-52. GROSSMAN,I.,andW.MAGNUS,GroupsandTheirGraphs,TheRandomHouse/SingerSchoolDivision,NewYork,1964.

15-53. HARARY, F., “Graph Theory as a Structural Model in the SocialSciences,” in Graph Theory and Its Applications (B. Harris, ed.),AcademicPress,Inc.,NewYork,1970,1–16.

15-54. HARARY,F.,“SparseMatricesandGraphTheory,”inLargeSparseSetsofLinearEquations (J.K.Reid,ed.),AcademicPress,Inc.,NewYork,1971,139–150.

15-55. HARRIS, Z.,Mathematical Structure of Language, JohnWiley&Sons,Inc.(InterscienceDivision),NewYork,1968.

15-56. IYER, C, “Computer Analysis of Large-Scale Systems,” Ph.D. Thesis,Department of Electrical Engineering,University ofHawaii,Honolulu,May1971.

15-57. KOENIG, H. E., Y. TOKAD, and H. K. KESAVAN, Analysis of Discrete

Page 557: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

PhysicalSystems,McGraw-HillBookCompany,NewYork,1967.15-58. MARSHALL, C. W., Applied Graph Theory, John Wiley & Sons, Inc.,

(InterscienceDivision),NewYork,1971.15-59. MAYEDA, W., Graph Theory, John Wiley & Sons, Inc., (Interscience

Division),NewYork,1972.15-60. SALTON, G., Automatic Information Organization and Retrieval,

McGraw-HillBookCompany,NewYork,1968.15-61. TRENT, H. M., “Isomorphism Between Oriented Linear Graphs and

LumpedPhysicalSystems,”J.Acoust.Soc.Am.,Vol.27,1955,500–527.15-62. TURNER, J., “Key-Word Indexed Bibliography of Graph Theory,” in

Proof Techniques in Graph Theory (F. Harary, ed.), Academic Press,Inc.,1969,189–330.

15-63. TURNER,J.,andW.H.KAUTZ,“ASurveyofProgressinGraphTheoryintheSovietUnion,”SIAMRev.,SupplementIssue,Vol.12,1970,1–68.

15-64. ZYKOV, A. A., “Bibliography of Graph Theory,” in Theory of GraphsandItsApplications(M.Fiedler,ed.),AcademicPress,Inc.,NewYork,1964.

†ThismodeloriginatedbyAndreiAndreivichMarkov(in1907)isalandmarkinprobabilitytheory.Unlikepreviousmathematicians,whohadmodeledarandomprocessasasequenceofindependenttrials,Markovsawtheadvantageofintroducingdependenceofeachtrialontheoutcomeofitspredecessor.Attemptshaveofcoursebeenmadetostudymodelswithmoreinvolveddependencyofthepresenttrialontheoutcomeofthepasttrials,butsuchstudiesgenerallyhaveledtointractableresults.†AMarkovprocess isoftencalledaMarkovchain if thenumberof states iscountable.A finiteMarkovchainisoneinwhichthenumberofstatesisfinite.Inthisbookweareconsideringonlystationary,finiteMarkov chains in which the time also changes in discrete steps (and not continuously). As there is nopossibilityofconfusion,suchaprocesswillsimplybereferredtoasaMarkovprocesshereafterwards.†To quote Feller, “The classification into persistent and transient states is fundamental, whereas theclassificationintoperiodicandaperiodicstatesconcernsatechnicaldetail.Itrepresentsanuisanceinthatitrequires constant reference to trivialities;” W. Feller, An Introduction to Probability Theory and ItsApplications,VolumeI,3rded.,JohnWiley&Sons,Inc.,NewYork,1968,387.†Notethattheseweightspij’shavenothingtodowithweightsfκ’sassignedinthepreviousanalysisoftheprogramdigraph.Whilefk’sobeyKCLateachvertex,pij’sobeyEq.(15-8).

Page 558: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

APPENDIXABINET-CAUCHYTHEOREM

Thefollowingclassicalresult,knownastheBinet–Cauchytheorem,isusefulincalculatingthedeterminantoftheproductoftwomatrices:IfQandRarekbym andm by kmatrices, respectively,with k <m, then the determinant of theproductdet(QR)= thesumoftheproductsofcorrespondingmajordeterminantsofQandR.

The term major determinant (or simply major) means the determinant of thelargestsquaresubmatrixofQ(orR)formedbytakinganykcolumns(orrows)outofm.Thetermcorrespondingimpliesthatifcolumnsi1,i2,...,ikofQarechosenforaparticularmajor,thecorrespondingmajorofQmustconsistofrowsi1,i2,...ikofQ.Clearly,thereare suchproductterms.Beforeprovingthetheorem,letusillustratewithanexample:Let

Proof:Toevaluatedet(QR),letusdeviseandmultiplytwo(m+k)by(m+k)

Page 559: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

partitioned matrices:

whereImandIkareidentitymatricesofordermandk,respectively.Therefore,

Thatis,

LetusnowapplyCauchy’sexpansionmethodtotheright-handsideofEq.(A-1),andobservethattheonlynonzerominorsofanyorderinmatrix−Imareitsprincipalminorsofthatorder.WethusfindthattheCauchyexpansionconsistsoftheseminorsoforderm−kmultipliedbytheircofactorsoforderkinQandRtogether.

Page 560: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

APPENDIXBNULLITYOFAMATRIXANDSYLVESTER’SLAW

IfQisannbynmatrix,thenQx=0hasanontrivialsolutionx≠0ifandonlyifQ issingular; that is,detQ=0.Thesetofallvectorsx thatsatisfyQx=0forms a vector space called the null space of matrix Q. The rank of the nullspace is called the nullity of Q. Furthermore, it can be shown that

These definitions and Eq. (B-1) also holdwhenQ is not square but a k bynmatrix,k<n.AnimportantresultinvolvingnullityofmatricesisSylvester’slawofnullity,

whichcanbestatedasfollows:Sylvester’sLaw:IfQisakbynmatrixandRisannbypmatrix, then thenullityof theproductcannotexceed thesumof thenullities of the factors; that is,

Proof:SinceeveryvectorxthatsatisfiesRx=0mustcertainlysatisfyQRx=0, we have

LetsbethenullityofmatrixR.Thenthereexistsasetofslinearlyindependentvectors{x1,x2,...,xs}

formingabasisofthenullspaceofR.Thus

Now let s + t be the nullity ofmatrixQR.Then theremust exist a set of tlinearlyindependentvectors{xs+1,xs+2,...xs+t}

Page 561: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

suchthattheset

{x1,x2,...xs,xs+1,xs+2,...,xs+t}

forms a basis for the null space of matrix QR. Thus

Inotherwords,ofthes+tvectorsxiformingabasisofthenullspaceofQR,thefirstsvectorsaresenttozerobymatrixRandtheremainingnonzeroRxi’s(i=s+1,s+2,...,s+t)aresenttozerobymatrixQ.VectorsRxs+1,Rxs+2,...,Rxs+t

arelinearlyindependent;forif

0=a1Rxs+1+a2Rxs+2+...+atRxs+t=R(a1xs+1+a2xs+2+...+atxs+t),thenvector(a1xs+1+a2xs+2+...+atxs+t)mustbethenullspaceofR,whichispossibleonlyifa1=a2=...=at=0.

ThuswehavefoundthatthereareatleasttlinearlyindependentvectorswhicharesenttozerobymatrixQ,andthereforenullityofQ≥t.

Butsince

t=(s+t)−s=nullityofQR−nullityofR,

Eq.(B-2)follows.Substituting Eq. (B-1) into Eq. (B-2), we find that

Furthermore, in Eq. (B-6) if the matrix product QR is zero, then

Page 562: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

SUBJECTINDEX

A

Abeliangroup,114,116Abelianmonoid,114Abeliansemigroup:definition,113withidentityelement,114

Absorbingstate,429Abstractgraph,88-89Accessible,203Activities:critical,403definition,400dummy,401durationof,400

Activitynetwork,400Activity-vertexrepresentation,408Acyclicdigraph,230,410Acyclicnetwork,400Adjacencymatrix,157-161,220-227asdatastructureinalgorithms,270powersof,159,222propertiesof,158,220relationshipwithothermatrices,161

Adjacent:definition,7edges,177

Algebra(seeAlgebraicsystem)

Page 563: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Algebraicsystem:definition,113withoneoperation,114withtwooperations,118

Algorithms,268-327bridge-finding,323chromaticnumber,313circuitgeneration,287connectednessandcomponents,274cut-verticesandblocks,284definition,269efficiencyof,269feedbackedge-set,313feedbackvertex-set,313fundamentalcircuits,280fragment-finding,304generatingalldirectedcircuits,287Hamiltoniancircuit,313isomorphism,310minimalcut,312minimaledgecover,313minimal spanning tree (see Algorithms, shortest spanning tree) maximalclique,312

maximalmatching,312planarity-testing,304shortest-path,290shortestpathbetweenallpairsofvertices,297shortestpathfromspecifiedvertextoanothervertex,292shortestpathfromspecifiedvertextoallothers,292shortestspanningtree,62,279smallestdominatingset,313spanning-tree,277Steinertree,313transitiveclosure,300travelingsalesmanproblem,313topologicalsorting,403

AMBIT/G,317Arbitrarilytraceablegraphs,29Arborescence,206

Page 564: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

numberof,223,238rootof,206

Articulationpoint(seeCut-vertex)Assignmentproblem,178,396Automata(seeSequentialmachines)Automaticflowcharting,448Automorphism,267

B

Backtrack,288,301Balanceddigraph,197Basesofcircuitsubspace,126Basesofcut-setsubspace,127Basiccut-set(seeFundamentalcut-sets)Basisvectors,124BCDcode,344Bicenters,47Bicentroidaltrees,248Bichromaticgraph,166Binaryoperation,113Binarygroupcode,352Binarymatrix,138Binaryrelation,198Binarytree,49Binet-cauchytheorem,219,366,373,458Bipartite,complete,192Bipartitegraph,168Block,80,284Block-diagonalform,274Booleanaddition,330Booleanalgebra,328Booleanarithmetic,170,173Booleanfunction,329Booleanmultiplication,330Branch,3(seealsoEdge)Branchoftree,56Breadth-firstsearch,302Bridge,286

Page 565: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

C

Canonicformofswitchingfunction,350Canonicformofprogramdigraph,448Canonicalrepresentationofmolecules,450Cayleydiagram,456Cayley’stheorem,54,164Centeroftree,45Centraltree,60Centroidaltree,248Chain(seeWalk)Characteristicpolynomial,311Chemicalidentification,451,453Chord,56,212,278Chord-set,56Chromaticnumber,166,171,313Chromaticpartitioning,169,171Chromaticpolynomial,174,177Circuit,20directed,202fundamental,57Hamiltonian,30subspace,126,130

Circuitcorrespondencebetweengraphs,84Circuit-generationalgorithms,284Circuitmatrix,141-145,216-217,337,359,380Circuit-pathdecomposition,306Circuitvector,125Classificationofgraphsaccordingtoconnectivity,85Clique,32,312Closedstate,429Cocycle(seeCut-set)Codingagraph,311Coefficient of internal stability (see Independence number) Coloring problem,165

Combinatorialdual,104,106Combinatorialgraph(seeAbstractgraph)Combinatorialoptimizationproblem,396Commutativefield,117

Page 566: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Commutativegroup,114Commutativering,117Commutativesemigroup,113Completegraph,32Completematching,178Completelyregulargraph,111Completelyspecifiedmachine,342Component,21,55,202,274,275,278Computationtimeofalgorithms,270Computerlogic,partitioningof,165Computerprogramsasdigraphs,194,439Condensation,203,230Configurations:countingseries,257definition,257

Connectedness:definition,21indigraph,202,221minimal,42strong,202weak,202

Connectednessandcomponentsalgorithm,274

Connectionmatrix(seeAdjacencymatrix)Contactnetwork,329Cook-Karpclassofalgorithms,316Cotree(seeChord-set)Countingseries,243,257Countingtrees(seeEnumeration,oftrees)Covering(seeEdge-covering)Coveringsubgraph(seeEdge-covering)Coveringnumber,183Criticalpathmethod(CPM),400-408Crossvariable,357Cut,387Cut-node(seeCut-vertex)Cut-set,68-71

capacity,80minimal,68

Page 567: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

proper,68propertiesof,69-71simple,68subspace,130

Cut-setmatrix,151,153,220,380Cut-setvector,125Cut-vertex,76,284Cycle(seeCircuit,Directedcircuits)Cyclegain,421Cycleindex,253-254Cyclestructure,252Cycliccode,351Cyclicexchange,59Cyclicinterchange(seeCyclicexchange)Cyclicrepresentationofpermutation,251Cyclomaticnumber(seeNullity)

D

Datastructureingraphalgorithms,270-273Decantingproblem,13Decisiontree,41Decyclization,232Deficiency,181Degree:matrix,139,164ofapermutation,251ofavertex,7

Degree-constrainedshortestspanningtree,63Deletionofedge,27Deletionofvertex,27DENDRAL,453Depth-firstsearch,301-304Deterministicsequentialmachine,342Diameter:

ofagraph,163ofatree,48

Digraph,194-237

Page 568: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

acyclic,301,410adjacencymatrixof,220asymmetric,197balanced,197complete,197definition,194disconnected,202edge,236Euler,203game,410irreflexive,199kernelof,411pseudosymmetric,197reflexive,199regular,197representationofpermutations,251simple,197stronglyconnected,202symmetric,197,199transitive,200weaklyconnected,202weighted,400

Dihedralgroup,266Dimensionofvectorspace,124Dimerproblem,185-186DIP,317Directedcircuits,202,212,230,232,287,291,421,443Directedgraph(seeDigraph)DirectedHamiltoniancircuits,312Directedpath,231,288,403,423Disconnectedgraph,21,139,159,161Distance matrix, 61, 273 (see also Weight matrix) Distance between twospanningtrees,59

Distinctrepresentatives,179Divisionring,117Dominatingset,172-173Dominationnumber,173Dummyactivity,401Dualofgraph,103,105,190

Page 569: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

E

Eccentricityofvertex,46Edge,1adjacent,177backward,389capacityof,79,385covering,182-183current,357directed,195edge-currentvector,358edgedigraph,236,408forward,389gain,418incidentintoavertex,195incidentoutofavertex,195initialvertexof,195isomorphism,87listing,271parallel,2pendant,183sequencesof,160,222,333series,9terminalvertexof,195train,20(seealsoWalk)variables,357voltage,357weightof,61

Edge,connectivity,75Edgecovering,182-183Edgecurrent,357Edgedigraph,236,408Edgegain,418Edgeisomorphism,87

Edgelisting,271Edgetrain,20(seealsoWalk)Edgevariables,357Edgevoltage,357Edge-currentvector,358

Page 570: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Edge-disjointHamiltoniancircuits,32Edge-disjointsubgraphs,17Edge-disjointunionofcircuits,115,212Edge-disjointunionofcut-sets,71Edge-voltagevector,358Electricalnetwork:applicationofgraphtheoryto,356-383asflowproblems,399useofcomputersin,268useofincidencematricesin,271

Elementaryreduction,99Elementarytreetransformation(seeCyclicexchange)Embedding:ofgraph,90onsphere,94

Enumeration:ofdigraphs,263ofmultigraphs,262ofsimplegraphs,260oftrees,52,240-250

Enumerator,243Equivalenceclasses,201Equivalencerelation,239Ergodicprocess,429Error-checkingcode,352,354Eulergraph,23,115,210Eulerlines:directed,203,210,225,227numberof,205,226,238inspanningarborescence,210

Euler’sformula,96Events:critical,403inprojects,400

Event-vertexrepresentation,408Executiontime(seeComputationtime)Exteriorregion,94

F

Page 571: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Faces(seeRegions)Falsevertices,350Fary’stheorem,93Field,117Figurecountingseries,258Finitefields,119Finite-statemachines(seeSequentialmachines)FirstBettinumber(seeNullity)Five-colortheorem,188Floatofactivity,406Flow,385Flowchart,269Flownetwork,384,398Flowproblem,384-399matchingproblem,as,182,396

useofcomputersin,268Forest,55FortranExtendedGraphTheoreticLanguage(FGRAAL),317Forwardcalculation,405Four-colorconjecture,10,187-190Fragments:definition,202findingall,312inprogramsegmentation,443

Freetrees:definition,48numberofunlabeled,248

Fronds,303Fullsymmetricgroup,253Function:definition,256equivalenceclassesof,256

Fundamentalcircuits:

algorithm,280-284andcut-sets,73definition,57,71fordigraph,212matrix,144

Page 572: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

applicationinelectricalnetworks,359derivingof,144fordigraph,219

Fundamentalcut-sets:

definition,71fordigraph,212matrix,153relationshipwithothermatrices,153insynthesisofcontactnetworks,336-339

Fusionofvertices,28,274

G

Galoisfield:modulom,118-119modulo2,138

Game,409-413comparisonwithpuzzle,409digraphof,410finite,409perfect-information,409statesin,410two-person,409

Generatingfunctions,241Geometricdualofagraph,103Geometricrepresentationofagraph,89GraphInformationRetrievalLanguage(GIRL),317GraphAlgorithmSoftwarePackage(GASP),316GraphExtendedAlgol(GEA),317Graphs:arbitrarilytraceable,29asdatastructures,448bipartite,168bichromatic,166circuit-free,55incodingtheory,351-353complementof,56,76complete,32

Page 573: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

completebipartite,192connected,21decompositionof,26definition,1directed(seeDigraph)disconnected,21drawingof,2equivalence,200Euler,23,28finite,7ingametheory,409-413general,2infinite,7isomorphic,14,139Kuratowski,90,93labeled,53linear,1nonplanar,90nonseparable,151null,9nullityof,57,60operationson,26oriented,195(seealsoDigraph)planar,90rankof,57regular,8“rigid“,209ringsumof,26separable,142selfdual,107signal-flow,416-423similarity,455simple,2stochastic,426subspacesof,133transition,426tree,60two-connected,83unionof,26unicursal,24

Page 574: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

uniquelycolorable,172universal,32unlabeled,53numberof,239

vertex,9weighted,34,61-63

Graph-theoreticalgorithms,269-316performance,270

Graph-theoreticlanguages,316-317GRASPE,317Graycodes,351Group:abelian,114definition,113permutation,250ofsubgraphs,115

GraphTheoreticProgrammingLanguage(GTPL),316

H

Hamiltoniancircuit,30-34numberof,268originof,10

Hamiltonianpath,30-34finding,inagraph,312shortest,63(seealsoTravelingsalesmaiproblem)Hammingdistance,349

Heightofatree,50

Heuristicprocedure,310HINT,317Homeomorphicgraphs,100Huffmangraph-theoreticcodes,352

I

Identificationofchemicalcompounds,449Identityelement,113,116Identitypermutation,252Immediatesuccessors,272

Page 575: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Impedancematrix,371Incidence,7Incidencematrix,137-140fordigraph,214inelectricalnetworks,359asinputinalgorithms,271rankof,140reduced,141,214relationshipwithothermatrices,161insynthesisofcontactnetworks,336

In-degree,195,287,400Independencenumber,170-171Independentcircuits,144Independentsetofvertices,169-170Independentsetofedges,193Infinitegraph,7Infiniteregion,94Informationretrieval,449,454InstantInsanity,18Intermediatevertices,386Internalstates,342Internalvertices,49Internallystableset,169Intersectionofgraph,26Intersectionofsubspaces,131In-tree,207(seealsoArborescence)In-valence(seeIn-degree)Invariantofagraph,311Inwarddemidegree(seeIn-degree)Isograph(seeBalanceddigraph)Isolatedvertex,8Isomorphicgraphs,14,139Isomorphicdigraphs,196Isomorphism,14,53,159,209,239,274,284,310,451

J

Join,132Jordancurvetheorem,91,189Jordan’smethodofelimination,337

Page 576: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

K

κ-chromaticgraph,166k-connectedgraph,78Kernel,411Kirchhoffmatrix,223Kirchhoff’scurrentlaw,358,441Kirchhoffsvoltagelaw,359Kōnigsbergbridgeproblem,3,23Kruska’salgorithm,62,280Kuratowskigraphs,90,93,341Kuratowski’stheorem,100

L

Labeledgraph,53Labeledtrees,240Latinsquare,193Levelofvertex,49Linedigraph,236Line:Euler,23unicursal,24(SeealsoEdge)

Linearcombination,123Linearcomplex,3(teealsoGraphs)Lineardependence,123Linearprogramming,216,386Linearlyindependent,123,216Linguistics,graphsin,456Link(seeChord)Longest-pathanalysis,301Loop:definition,1,21inelectricalnetworks,360

Loopimpedancematrix,371Lossynetworks,392Lowerboundonedgecapacity,392Lumpedphysicalsystems,455

Page 577: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

M

Mapcoloring,187Map-constructionapproach,304Markovchain,425Markovprocess,424-439asymptoticbehavior,433definition,424periodic,431transientanalysis,437withtransientstates,432

Marriageproblem,180Mason’sgainformula,421-422Matching,177-182inbipartitegraphs,182definition,177maximal,178perfect,186

Matchingnumber,178Matchingproblem(seeAssignmentproblem)Matrix:adjacency,157-159circuit,142-143cut-set,151,153incidence,137,139inversion,455relation,201representingagraph,137stochastic,425transition,425transmission,332weight,61

Max-flowmin-cuttheorem,86,387-388Maximalcompletesubgraph,312Maximalflow,312,385-386Maximalmatching,178,312Maximalplanargraph,111Maximalstronglyconnectedsubgraphs(seeFragments)Maxwell’sformula,366

Page 578: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Meshes(seeRegions)Methodofpairedcomparisons,227Minimalcostflow,393-395Minimalcovering,184,328Minimaldecyclization,232,313Minimalspanningtree,61,277-279Minimum-feedbackarcs,232Monoid,113Multicommodityflow,395-396Multiplesourcesandsinks,390

N

Networkanalysisproblem,305Network:activity,400-409contact,329-341electrical,5,356-381inplanningandscheduling,400synthesisof,334transport,384-389

Networkflows,79Networkfunctions,370Nim,410Nodalanalysis,362Node(seeVertex)Nodeadmittancematrix,363Node-removalmethod,334Nodevoltages,361,370Nonplanargraph,90,306,341Nonpolynomialalgorithms,315Nonseparablegraph,76,284Nullgraph,9,122Nullityofagraph,57,60Numberofdifferentarborescences,238NumberofdifferentdirectedEulerlines,238Numberoffreeunlabeledtrees,248Numberoflabeledgraphs,239Numberoflabeledtrees,240

Page 579: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Numberofrootedlabeledtrees,241Numberofrootedunlabeledtrees,243Numberofunlabeledgraphs,239

O

1-connectedgraph,781-factor(seeMatching,perfect)1-isomorphic,81Onesimplex,3(seealsoEdge)Operationongraphs,26Operationsresearch,graphsin,384-414Optimal-policymatrix,298Orderedtrees,209Orientationofgraph,195-196Orthogonalcomplements,132Orthogonalvectors,130Otter’sformula,249Out-degree,195,287,343,400Outerregion(seeInfiniteregion)Out-tree,207(seealsoArborescence)Out-valence(seeOut-degree)Outwarddemidegree(seeOut-degree)

P

Pairgroup,255Palmtree,303Paralleledges,2,271,401Parallelprocessingdesign,448Parenthesis-freenotation(seePolishnotation)p-partite,168Partitioningalgorithm,313Partitioningproblem,165Partitions,243Passiveedges,363Path:critical,403comparedwithwalkandcircuit,21directed,201Hamiltonian,31

Page 580: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

lengthof,20Pathlength,51Pathmatrix,156,336Pathproduct,330Path-findingalgorithm,273Paton’salgorithm,281Pendantvertex,9,43,196Performanceofgraph-theoreticalgorithms,314Permutation,250-255degreeof,253

Permutationgroup,250,253,256Persistentstate,344PERT,232,268,400-409Planargraph,90,108,165Planaritytestingalgorithm,99,304-310Planerepresentation,90,95,97,273Planningandschedulingofnetworks,400-409Point(seeVertex)Polishnotation,208Pólya’scountingtheorem,238,250,257-264Polynomial-boundedalgorithms,314Precedencematrix,220Precedencerelationship,400Predecessormatrix,220Preferencegraph,227Primitiveconnectionmatrix,332Prim’salgorithm,62,279Probabilityvector,426Program:errordetectionin,441optimizationof,448segmentationof,443

Programblock,440Programdigraph,440,445Projectcostcurve,406Propercoloring,165-168definition,165ofedges,177ofregions,186

Page 581: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Q

Quadraticflow-costfunction,399

R

Radiusofatree,48Randomdigraph,296Randomgraph,278,321Randomprocesses,424Randomwalk,427Randomlygeneratedgraph(seeRandomgraph)Rank:

ofgraph,57,60ofincidencematrix,214

RankingbyHamiltonianpath,228Rankingbyscore,228Rankingwithminimumviolations,229Reachabilityalgorithm,300Reachabilitymatrix,235Reachablevertex,203Realizability:ofacircuitmatrix,341ofmatrices,162ofasingle-contactfunction,335,340

Reducedincidencematrix,153,339Referencevertex,214Reflectedbinarycode,351Regions,93adjacent,187coloring,187

Regulargraph,92RegularMarkovprocess,430Regularizationofplanargraph,189Relation,198-201digraphof,220equivalence,200matrixof,201reflexive,199

Page 582: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

symmetric,199transitive,200

Relaycontact,329Ring,117Ringsum,26ofcircuits,115,212ofcut-sets,72

RLCnetwork,362Rootedtree,48,241,243numberofunlabeled,243

Runningtime,439,441

S

s-fîeld(seeSkewfield)Scaffolding(seeSpanningtree)Searchtechniques,271Seatingproblem,6,32Second-shortestpath,301Self-dualgraphs,107Self-loop,1,195,271Semicircuits,202,212Semigroup,113Semipath,201Semiwalk,201Separablegraph,76,284Sequentialcircuits,342Sequentialmachines,165,194,342,344Seriesedges,99Set:ofbasiccircuits,107definition,112empty,112null,112withoneoperation,112-116withtwooperations,116-119

Shiftregister,205Shortest-distancearborescence,294Shortest-distancetree,294

Page 583: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Shortest-pathalgorithms,290Signal-flowgraph,194,416-423,436Signaltransmissionnetwork,418Single-contactnetwork,335Sink,385Skeletonofgraph(seeSpanningtree)Skewfield,117Slack:free,406total,406

Snake-in-the-boxcode,352Sociograms,456Source,385Sourcevertices,418Spanningarborescence,209,303Spanningforest,55,146,277Spanningtree:algorithmfor,277-279all,inagraph,55,58,238,277,280,376applicationtoelectricalnetworks,356,359computerrunningtime,useinestimating,442definition,55,73,209,277degree-constrainedshortest,63minimal,61,279numberof,218rootof,281shortest(seeMinimalspanningtree)signof,218,376weightof,61

Spanningtreematrix,164Sparsegraph,300Sparsematrix,271Stargraph,184Startvertex,441Startingstate,344State:absorbing(seeClosedstate)closed,429ergodic,429

Page 584: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

persistent,344transient,432trapping(seeClosedstate)

Stateassignmentproblem,346Statediagram(seeStategraph)Stateequivalence,345Stategraph:definition,342properties,343reductionof,347

Statetable,342Staticflow,385Stationaryprocess,425Steady-stateprobabilities,434Steinertree,313Stereographicprojection,95Stochasticgraph,426Stochasticmatrix,425Stochasticprogram-digraph,445Stochasticsystem,425Stochasticallyindependenttransitionprobabilities,427Stopvertex,441Storagerequirementofprogram,439Stronglyconnected,202,203,222,312Structuralisomers,53Subgraph,16,21,141,273Submatrix,141Subnetworks,408Subsequence,largestmonotonicallyincreasing,44

Subset,112Subspace,125Successorlisting,272Supersink,390Supersource,390Switchingfunction,184,329Switchingnetwork,146,271,328Sylvester’slaw,146,152,460Systemgraph,380,455

Page 585: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

T

Teleprinter’sproblem,204-205Terminalvertexofpath,20Thickness,109Three-terminaldevices,373Throughvariable,357Tie(seeChord-set)Time-invariantprocess,425Topologicalorder,402,443Topologicalsorting,231,313,402Tournament,197,227-230Transientvertices,446Transitionfunction,342Transitionmatrix,220,425,444Transitionprobabilities,425,427multistep,427

Transitiveclosureofdigraph,300Transitivity(seeRelation)Transmission,331Transmissionmatrix,332Transportnetwork,384-389Transportationproblem,393Trappingstate(seeClosedstate)Travelingsalesmanproblem,34,280,313Tree,39-54binary,48centersina,45central,60decisionaldiameterof,48indigraphs,206-211externalpathlengthof,51family,41free,48heightof,50labeled,54null,39numberof,238

Page 586: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

ordered,209pathlengthof,51radiusof,48rooted,48sorting(seeDecisiontree)shortest-distance,294spanning,55unlabeled,54

Treeadmittanceproduct,366Treegraph,60Treepairs,379Tree-fellingprocedure,280Truevertices,350Tutte’smap-constructionmethod,108Two-connectedgraphs,83Two-chromaticgraph,166-167Two-isomorphicgraphs,104,143,336Two-persongames,409Two-terminalcontactnetwork,334Two-tree,368

U

Unicursalgraph,24Unicursalline,24Unimodularmatrix,214,380Unionofgraphs,26Uniquecodeforgraph,451Uniqueembedding,98Uniquelycolorablegraphs,172Uniquenessofdualgraphs,103Universalgraph,32Unlabeledgraphs,numberof,239Utilitiesproblem,4,88

V

Valency(seeDegree)Vector:

Page 587: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

definition,120orthogonal,130

Vectorspace,120-121applicationinanalysisofnetworks,359ofgraph,121-122

Vertex,1closing,410degreeof,7eccentricityof,46end,9even,22forbidden,288

Vertex,fusionof,28intermediate,20internal,49isolated,8labelof,15levelof,49merged(seeVertex,fusionof)odd,22pendant,9,43,196reference,141starting,410

Vertexcoloring,165-169,187Vertexconnectivity,75,78Vertexcover,193Vertexgraph,9(seealsoNullgraph)Vertex-disjointsubgraphs,17Vertex-edgeincidencematrix(seeIncidencematrix)Vertex-labelingprocess,390Violationinranking,229Vulnerability,77,284

W

Walk,19-21closed,20comparedwithpathandcircuit,21differenttypesof,35directed,201

Page 588: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

open,20Weight:ofedge,61ofspanningtree,61ofsubtree,248ofvertex,248

Weightmatrix,61,273,418Weightedgraph,61-63complete,34

Whitney’stheorem,98,106Windows(seeRegions)

Page 589: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

AUTHORINDEX

A

vanAardenne-Ehrenfest,T.,234Abrahams,J.R.,424Aitken,A.C.,162Allen,F.E.,448Amoia,V.,64Anderson,J.,448Anderson,S.,457Ash,J.E.,454Auguston,J.G.,318Avondo-Bodino,G.,457

B

Baer,J.L.,448Balk,K.G.,448Bartee,T.C.,354Basili,V.R.,318Battersby,A.,414Beckenbach,E.F.,265,414Behzad,M.,457Beizer,B.,448Bellman,R.,318Bellmore,M.,36Benedict,C.P.,110Berge,C.,11,415Berkowitz,S.,318

Page 590: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Berztiss,A.T.,318,448Biondi,E.,439Birkhoff,G.,354Boisvert,M.,424Boothroyd,J.,318Bott,R.,225Bray,T.A.,414Bredeson,J.G.,354,355Brooks,R.L.,192deBruijn,N.G.,206,234Bruno,J.,110Bryant,P.R.,381Buchanan,B.G.,454Busacker,R.G.,11,414

C

Calahan,D.A.,381Caldwell,S.H.,354Cartwright,D.,234Caughey,R.,448Cayley,A.,10,11,52,54,164,238,248,449,456Chan,S.P.,381Chartrand,G.,457Chase,S.M.,318Chen,W.K.,135,457Chen,Y.C.,234Chien,R.T.,86,381Collins,N.L.,65Cook,S.A.,316Cooke,K.L.,318Corneil,D.G.,318,319Cottafava,G.,64Coverley,G.P.,424Crespi-Reghizzi,S.,318Cummins,R.L.,65

D

Page 591: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Dantzig,G.B.,319Dawson,D.F.,381Dean,R.A.,135Deo,N.,36,65,110,457Dickson,D.C.,319Drjkstra,E.W.,280,292,319Dimsdale,B.,415Dirac,G.A.,36Dreyfus,S.E.,319

E

Earnest,C.P.,448Edmonds,J.,319Elias,P.A.,86Elmaghraby,S.E.,415Essam,J.W.,457Estrin,G.,449Euler,L.,3,11,23,96,115,203,210,226Even,S.,319

F

Fary,I.,93,110Feigenbaum,E.A.,454Feinstein,A.,86Fisher,M.E.,457Flament,C.,457Flores,B.,320Floyd,R.W.,297,319Frank,H.,415Fraser,J.J.,319Frazer,W.D.,319,355Friedman,D.P.,319,320Frisch,I.T.,415Ford,G.W.,265Ford,L.R.,86Fulkerson,D.R.,86,415

Page 592: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

G

Gardner,M.,415Ghosh,P.K.,424Ghosh,S.N.,424Ghouila-Houri,A.,415Gibbs,N.E.,319Gluck,D.J.,454Goldman,J.,135Good,I.G.,204,234Gotlieb,C.C.,318,319Gould,R.,135Graham,G.D.,319Grossman,I.,457Grundig,P.M.,415Guardabassi,G.,439

H

Hakimi,S.L.,36,354,355Halmos,P.R.,135Hamburger,P.,448Hamilton,W.R.,10,30,31,63,165,312Harary,F.,11,36,162,234,265,457Harris,Z.,457Harrison,J.M.,454Harrison,M.A.,355Hart,R.,319.Held,M.,319Henderson,D.A.,Jr.,320Herstein,I.N.,135Hill,F.J.,355Hobbs,A.M.,110Hohn,F.E.,162Holt,R.C.,319Hopcroft,J.E.,319Howard,R.A.,439Hu,T.C.,65,319,415Huffman,D.A.,65,352,354,355

Page 593: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Huggins,W.H.,439

I

Iri,M.,415Isaacson,J.D.,320Iyer,C.,457

K

Karl,J.,449Karp,R.M.,316,319,448Kasteleyn,P.W.,192Kaufmann,A.,234Kautz,W.H.,457Kemeny,J.G.,439Kendall,M.G.,234Kernighan,B.W.,319,320,449Kesavan,H.K.,457Kim,W.H.,86,192,381King,C.A.,320Kirchhoff,G.,10,11,58,223,356,358,359,381,383,441Klee,V.,355Klein,M.M.,415Knoedel,W.,320Knuth,D.E.,65,320,449Koenig,H.E.,457König,D.,11Kreider,L.,449Kruskal,J.B.Jr.,62,65,280Kuo,F.F.,381Kuratowski,K.,90,93,100,304,341

L

Lederberg,J.,454Lehmer,D.H.,320Lempel,A.,234Lietzmann,W.,11

Page 594: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Lin,S.,36,320Liu,C.L.,192Lockett,J.A.,318Lorens,C.S.,424Lowe,T.C.,449Lukasiewicz,J.,208Lynch,M.F.,454

M

MacLane,S.,107,110,304Magnus,W.,457Marble,G.,320Marimont,R.B.,449Markov,A.A.,423,424,425,431,432,433,437Marshall,C.W.;457Martin,D.,449Mason,S.J.,421,422,424Matula,D.W.,320Maxwell,J.C.,356,366,382Maxwell,L.M.,9,135Mayberry,J.P.,225Mayeda,W.,355,457Mcllroy,M.D.,320Medvedev,G.A.,439Meetham,A.R.,454Menger,K.,86Mesztenyi,C.K.,318Michie,D.,65Miller,K.S.,135Miller,R.E.,355,448Minker,J.,318Minty,G.J.,280,320,355Mirsky,L.,192Moder,J.J.,415Montalbano,M.,415Moon,J.W.,65,234Morpurgo,R.,318Mulligan,G.D.,320

Page 595: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Munro,J.I.,320

N

Nemhauser,G.L.,36Norman,R.Z.,234,320

O

Onaga,K.,415Ore,O.,11,36Otter,R.,249

P

Palmer,E.M.,265Parson,T.D.,110Parzen,E.,439Paton,K.,281,287,320Penny,R.H.,454Percival,W.S.,356Perfect,H.,192Peterson,G.R.,355Peterson,W.W.,355Phillips,C.R.,415Plisch,D.C.,415Pohl,I.,320Pōlya,G.,238,248,250,257Prabhaker,M.,320Pratt,T.W.,319,320Prim,R.C.,62,65,280Prosser,R.T.,449

R

Rabin,M.O.,320Ramamoorthy,C.V.,449Read,R.C.,192,265,318,320Reed,M.B.,9,12,381Reinboldt,W.C.,318

Page 596: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Reingold,E.M.,319,320Rinaldi,S.,439Riordan,J.,65Robert,J.,424Roberts,S.M.,288,320Robichaud,L.P.A.,424Robinson,R.W.,265Rosenberg,A.L.,449Rosenblatt,D.,439Rota,G.C.,135RouseBall,W.,12Rovner,P.D.,320

S

Saaty,T.L.,11Sakarovitch,M.,415Salton,G.,457Saltzer,C.,354,355Schurmann,A.,415,449Seppänen,J.J.,320Seshu,S.,12,381Shannon,C.E.,86,328Shirey,R.W.,110Sittler,R.W.,439Smith,C.A.B.,36,415Snell,J.L.,439Steiglitz,K.,110Steiner,J.,313Sussenguth,E.H.Jr.,321Sutherland,G.L.,454

T

Tabourier,Y.,321Talbot,A.,381Tarjan,R.287,301,319,321Tate,F.A.,454Tiernan,J.C.,288,321

Page 597: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Tokad,Y.,457Torres,W.T.,319Town,W.G.,454Trent,H.M.,457Tucker,A.C.,65Turner,J.,457Tutte,W.T.,36,108,110,225,234,341,355

U

Uhlenbeck,G.E.,265Unger,S.H.,321

V

Verhoff,E.W.,449

W

Wang,H.,415Warshall,S.,297,321Watkins,R.P.,448Weinberg,L.,110,321Weinblatt,H.,321Welch,J.T.Jr.,321Wells,M.B.,321Welsh,D.J.A.,355Whitney,H.,86,98,106,110,304Whitney,V.K.M.,321Wilcox,G.W.,36Wilkov,R.S.,192Williams,T.W.,135Wing,O.,234Witzgall,C.,414Wolfberg,M.S.,321

Y

Yen,J.Y.,321

Page 598: Graph Theory with Applications to Engineering and Computer ......Library of Congress Cataloging-in-Publication Data Names: Deo, Narsingh 1936– Title: Graph theory with applications

Z

Zykov,A.A.,457


Recommended