9
Modern Applications using Discrete Mathematical Structures Unit 10 Sikkim Manipal University Page No: 225 Unit 10 Traversability Structure 10.1 Introduction Objectives 10.2 Eulerian Graphs 10.3 Hamiltonian Paths and Circuits 10.4 Traveling Salesman problem Self Assessment Questions 10.5 Summary 10.6 Terminal Questions 10.7 Answers 10.1 Introduction In this unit, we discuss Euler graphs, Hamiltonian paths and Hamiltonian circuits in a graphs G with special properties. A given graph G can be characterized and studied in terms of the presence or absence of these sub graphs. Many physical problems can be represented by graphs and solved by observing the relevant properties of the corresponding graphs. Objectives In this unit, we shall be dealing with Euler graph Characteristics of Euler graphs Hamiltonian paths, circuits and Graphs Travelling Sales persons problem. 10.2 Eulerian Graphs Graph theory was born in 1736 with Euler’s famous paper. In the same paper, Euler posed (and then solved) a more general problem.

MC0063(B)-Unit10-fi

Embed Size (px)

DESCRIPTION

File

Citation preview

  • ModernApplicationsusingDiscreteMathematicalStructures Unit10

    SikkimManipalUniversity PageNo:225

    Unit10 TraversabilityStructure

    10.1 Introduction

    Objectives

    10.2 EulerianGraphs

    10.3 HamiltonianPathsandCircuits

    10.4 TravelingSalesmanproblem

    SelfAssessmentQuestions

    10.5 Summary

    10.6 TerminalQuestions

    10.7 Answers

    10.1IntroductionIn this unit, we discuss Euler graphs, Hamiltonian paths and Hamiltonian

    circuits in a graphs G with special properties. A given graph G can be

    characterizedandstudiedintermsofthepresenceorabsenceofthesesub

    graphs.Manyphysicalproblemscanberepresentedbygraphsandsolved

    byobservingtherelevantpropertiesofthecorrespondinggraphs.

    ObjectivesInthisunit,weshallbedealingwith

    Eulergraph

    CharacteristicsofEulergraphs

    Hamiltonianpaths,circuitsandGraphs

    TravellingSalespersonsproblem.

    10.2EulerianGraphsGraph theory was born in 1736 with Eulers famous paper. In the same

    paper,Eulerposed(andthensolved)amoregeneralproblem.

  • ModernApplicationsusingDiscreteMathematicalStructures Unit10

    SikkimManipalUniversity PageNo:226

    WestatethefollowingresultsbeforegivingtheformaldefinitionsofEulers

    graphs.

    10.2.1 Problem: A graph G is disconnected its vertex set V can be

    partitioned into two nonempty disjoint subsets V1 and V2 such that there

    exists no edge in G, whose one endvertex is in V1 and the other end

    vertexisinV2.

    10.2.2Problem: Ifagraph(eitherconnectedordisconnected)hasexactly

    two vertices of odd degree, then there exists a path joining these two

    vertices.

    10.2.3Theorem:A simplegraphwith n verticesand k components can

    haveatmost(nk)(nk+1)/2edges.[orthemaximumnumberofedges

    inasimplegraphwithnverticesandkcomponentsis(nk)(nk+

    1)/2].

    10.2.4Definition:LetGbeagraph.Aclosedwalkrunningthroughevery

    edgeofthegraph GexactlyonceiscalledanEulerline.AgraphGthat

    containsEulerlineiscalledanEulergraph.

    10.2.5 Example:Thegraphsgiven intheFig.10.2.5.Aand fig10.2.5B

    areEulergraphs.

    4

    6

    8

    1

    2

    35

    7910

    11

    12

    Fig10.2.5A

    10

    4

    8 69

    3

    5

    1 2

    11

    7

    Fig10.2.5B

  • ModernApplicationsusingDiscreteMathematicalStructures Unit10

    SikkimManipalUniversity PageNo:227

    i. ConsiderFigA,123456789(10)(11)(12)13579(11)1isanEularline.

    ii. ConsiderFigB,23456789(10)12(11)357(11)8(10)2isanEulerline.

    AnEulergraphmaycontains isolatedvertices. IfG isEulergraphand it

    containsno isolated vertices, then it is connected.Hereafter,we consider

    onlythoseEulergraphs thatdonotcontain isolatedvertices.So theEuler

    graphsthatweconsiderareconnected.

    10.2.6 Characterization:

    AgivenconnectedgraphGisanEulergraph alltheverticesofGare

    ofevendegree.

    Proof:SupposeGisanEulergraph.ThenGcontainsanEulerline.So

    thereexistsaclosedwalkrunningthroughalltheedgesofGexactlyonce.

    Letv VbeavertexofG.Nowintracingthewalkitgoesthroughtwo

    incidentedgesonvwithoneenteredvandtheotherexited.

    Thisistruenotonlyforalltheintermediateverticesofthewalk,butalsotrue

    fortheterminalvertexbecauseweexitedandenteredatthesamevertexat

    thebeginningandendingofthewalk.Thereforeifvoccursktimesinthe

    Eulerline,thend(v)=2k.ThusifGisanEulergraph,thenthedegreeof

    eachvertexiseven.

    Converse:SupposealltheverticesofGareofevendegree.Nowtoshow

    thatGisaEulergraph,wehavetoconstructaclosedwalkstartingatan

    arbitraryvertexvandrunningthroughalltheedgesofGexactlyonce.To

    finda closedwalk, letus start from the vertex v.Sinceevery vertex isof

    evendegree,wecanexistfromeveryvertexweentered,thetracingcannot

    stopat any vertexbut at v.Since v isalsoofevendegree,we shall

    eventuallyreachvwhenthetracingcomestoanend.Ifthisclosedwalk

    vFig10.2.6

  • ModernApplicationsusingDiscreteMathematicalStructures Unit10

    SikkimManipalUniversity PageNo:228

    (h,say)includesalltheedgesofG,thenGisanEulergraph.Suppose

    the closed walk h does not include all the edges. Then the remaining

    edges forma subgraph h1 of G. Sinceboth G and h haveall their

    verticesofevendegree,thedegreesof theverticesof h1 arealsoeven.

    Moreover, h1 must touch h at least one vertex a becauseG is

    connected.Startingfromawecanagainconstructanewwalkingraphh1.

    Sincealltheverticesofh1 areofevendegree,andthiswalkinh1 must

    terminatesatthevertexa.Thiswalkinh1 combinedwithhformsanew

    walkwhichstartsandendsatvertexvandhasmoreedgesthanthose

    areinh.

    Werepeatthisprocessuntilweobtainaclosedwalkthattravelsthroughall

    theedgesof G. Inthisway,onecangetanEuler line.ThusG isan

    EulerGraph.

    10.2.7 Konigsberg Bridges Problem: In the graph of the Konigsberg

    bridgesproblem,thereexistverticesofodddegree.Soalltheverticesare

    notofevendegree.Henceby theTheorem10.2.6,we conclude that "the

    graphrepresentingtheKonigsbergbridgesproblem"isnotanEulergraph.

    Soweconcludethatitisnotpossibletowalkovereachofthesevenbridges

    exactlyonceandreturntothestartingpoint.

    A

    B

    DC Fig10.2.7

  • ModernApplicationsusingDiscreteMathematicalStructures Unit10

    SikkimManipalUniversity PageNo:229

    10.2.8Theorem:AconnectedgraphGisanEulergraphifandonlyifitcan

    bedecomposedintocircuits.

    Proof: SupposegraphG canbedecomposed into circuits that is,G isa

    unionofedgedisjointcircuits.Sincethedegreeofeveryvertexinacircuit

    istwothedegreeofeveryvertexinGiseven.HenceGisanEulergraph.

    Conversely,letGbeanEulergraph.Consideravertexv1.Thereareatleast

    two edges incident at v1. Let one of these edges be between v1 and v2.

    Sincevertexv2 isalsoofevendegree, itmusthaveat leastanotheredge,

    saybetweenv2andv3.Proceedinginthisfashion,weeventuallyarriveata

    vertexthathaspreviouslybeentraversed, thusformingacircuit . Letus

    remove from G. All vertices in the remaining graph (not necessarily

    connected)mustalsobeofevendegree.Fromtheremaininggraphremove

    anothercircuitinexactlythesamewayasweremoved fromG.Continue

    thisprocessuntilnoedgesareleft.Hencethetheorem.

    10.2.9ArbitrarilyTraceableGraphs:

    ConsiderthegraphinFig.10.2.9,whichisanEulergraph.Supposethatwe

    startfromvertexaandtracethepathabc.

    Fig.10.2.9:Arbitrarilytraceablegraphfromc

    Nowatcwehavethechoiceofgoingtoa,dore.Ifwetookthefirstchoice,

    wewouldonly trace the circuitab ca,which is not anEuler line. Thus,

    a b

    c

    d e

  • ModernApplicationsusingDiscreteMathematicalStructures Unit10

    SikkimManipalUniversity PageNo:230

    startingfroma,wecannottracetheentireEulerlinesimplybymovingalong

    anyedgethathasnotalreadybeentraversed.

    Such a graph is called an arbitrarily traceable graph from vertex v. For

    instance,theEulergraphinFig.10.2.9isanarbitrarilytraceablegraphfrom

    vertexC,butnotfromanyothervertex.

    AnEulergraphGisarbitrarilytraceablefromvertexvinGifandonlyif

    everycircuitinGcontainsv.

    10.3HamiltonianPathsandCircuitsAnEuler line of a connected graph was characterized by the property of

    beingaclosedwalkthattraverseseveryedgeofthegraph(exactlyonce).

    10.3.1DefinitionAHamiltoniancircuitinaconnectedgraphisdefinedasaclosedwalkthattraverses every vertex of G exactly once, except of course the starting

    vertex,atwhichthewalkalsoterminates.

    AcircuitinaconnectedgraphGissaidtobeHamiltonianitincludesevery

    vertexofG.HenceaHamiltoniancircuitinagraphofnverticesconsistsof

    exactlynedges.Obviously,noteveryconnectedgraphhasaHamiltonian

    circuit.

    The resemblance between the problem of as Euler line and that of a

    Hamiltonian circuit is deceptive. The latter is infinitely more complex.

    AlthoughonecanfindHamiltoniancircuitsinmanyspecificgraphs.

    10.3.2DefinitionHamiltonianPath:IfweremoveanyoneedgefromaHamiltoniancircuit,

    we are left with apath. This path is calledaHamiltonianpath.Clearly, a

    Hamiltonian path in a graph G traverses every vertex of G. Since a

    Hamiltonianpath isasubgraphofaHamiltoniancircuit(which in turn isa

    subgraphofanothergraph)everygraphthathasaHamiltoniancircuitalso

  • ModernApplicationsusingDiscreteMathematicalStructures Unit10

    SikkimManipalUniversity PageNo:231

    hasaHamiltonianpath.TherearemanygraphwithHamiltonianpathsthat

    havenoHamiltoniancircuitsthelengthofaHamiltonianpath(ifitexists)in

    aconnectedgraphofnverticesisn1.

    InconsideringtheexistenceofaHamiltoniancircuit(orpath),weneedonly

    consider simple graphs. This is because a Hamiltonian circuit (or path)

    traverseseveryvertexexactlyonce.Henceitcannotincludeaselfloopora

    setofparalleledges.Thusageneralgraphmaybemadesimplebyremoving

    paralleledgesandselfloopsbeforelookingforaHamiltoniancircuitinit.

    AgivengraphmaycontainmorethanoneHamiltoniancircuit. Of interest

    areall theedgedisjointHamiltoniancircuits inagraph.Thedetermination

    of the exact number of edgedisjoint Hamiltonian circuits (or paths) in a

    graph in general is also an unsolved problem. However, the number of

    edgedisjointHamiltonian circuits ina completegraphwithoddnumberof

    vertices.

    10.3.3Theorem:

    Inacompletegraphwitha vertices thereareedgedisjointHamiltonian

    circuits,ifnisanoddnumber 3.

    10.4TravellingSalesmanProblemA problem closely related to the question of Hamiltonian circuits is the

    travellingsalesman problem, stated as follows: A salesman is required to

    visitanumberofcitiesduringatrip.Giventhedistancesbetweenthecities,

    inwhatorder shouldhe travel soas to visitevery city preciselyonceand

    returnhome,withtheminimummileagetraveled?

    Representing the citiesby verticesand the roadbetween thembyedges,

    wegetagraph.Inthisgraph,witheveryedgeei thereisassociatedareal

    number(thedistancesinmiles,say), w(ei).Suchagraphiscalledweighted

    graphw(ei)beingtheweightofedgeeI .

  • ModernApplicationsusingDiscreteMathematicalStructures Unit10

    SikkimManipalUniversity PageNo:232

    Inourproblem, ifeachofthecitieshasaroadtoeveryothercity,wehaveacompleteweightedgraph.ThisgraphhasnumerousHamiltoniancircuits,andwearetopicktheonethathasthesmallestsumofdistances(orweights).

    ThetotalnumberofdifferentHamiltoniancircuits inacompletegraphofn

    verticescanbeshowntobe2

    )!1n( .Thisfollowsfromthefactthatstarting

    fromanyvertexwehaven1edgestochoosefromthefirstvertex,n2fromthesecond,n3fromthethirdandsoon.Thesebeingindependentchoices,weget(n1)!possiblenumberofchoices.Thisnumberis,however,dividedby2,becauseeachHamiltoniancircuithasbeencountedtwice.

    Theoretically, theproblemofthe travelingsalesmancanalwaysbesolvedby enumerating all (n1)!/2 Hamiltonian circuits, calculating the distancetraveled in each, and thenpicking the shortest one. However, for a largevalueofn,thelaborinvolvedistoogreatevenforadigitalcomputer.

    SelfAssessmentQuestionsStateTrueorFalse.1) AgivenconnectedgraphGisanEulergraphifandonlyifallverticesof

    Gareofodddegree.2) A connected graph G is an Euler graph if and only if it can be

    decomposedintocircuits.3) IfweremoveanyonevertexfromHamiltoniancircuit,weareleftwitha

    path.ThispathiscalledHamiltonianpath.

    10.5Summary Ifsomeclosedwalkinagraphcontainsalltheedgesofthegraph,then

    thewalkiscalledanEulerlineandthegraphanEulergraph. A connected graph G is an Euler graph if and only if it can be

    decomposedintocircuits.

  • ModernApplicationsusingDiscreteMathematicalStructures Unit10

    SikkimManipalUniversity PageNo:233

    AHamiltoniancircuit inaconnectedgraphsisdefinedinaclosedwalkthattraverseseveryvertexofGexactlyonce.

    10.6TerminalQuestions1. ProvethataconnectedgraphGisanEulergraphifandonlyifitcan

    bedecomposedintocircuits.

    2. WriteshortnotesonTravellingSalesmanProblem.

    10.7AnswersSelfAssessmentQuestionsi)False ii)True iii)True

    TerminalQuestions1. RefertoSection10.2.82. RefertoSection10.4