SlideShare a Scribd company logo
Graphs: Hamiltonian Path
and Circuits
By Prof. Liwayway Memije-Cruz
Irish mathematician
who contributed to the
development of optics,
dynamics, and algebra
—in particular,
discovering thealgebra
of quaternions. His
work proved significant
for thedevelopment of
quantum mechanics.
William Rowan Hamilton
https://youtu.be/AamHZhAmR7o
Hamiltonian Path and Circuit
A Hamiltonian path isapath that visits
each vertex of thegraph exactly once.
A Hamiltonian circuit isapath that uses
each vertex of agraph exactly onceand
returnsto thestarting vertex. A graph that
containsaHamiltonian circuit iscalled
Hamiltonian.
 In Euler circuits, welooked at closed pathsthat use
every edgeexactly once, possibly visiting avertex
morethan once.
 In Hamiltonian circuits, welook at pathsthat visit
each vertex exactly once, possibly not passing
through someof theedges.
 But unliketheEuler circuit, wheretheEulerian
Graph Theorem isused to determinewhether it
containsan Euler circuit or not, wedo not havea
straightforward criterion to determinewhether or not
aHamiltonian circuit existsin agraph.
Finding Hamilton circuit
Determine whether the graph below is Hamiltonian
or not. If it is, find a Hamiltonian circuit. If it is not,
explain why?
Answer: A – B – C – E – D – F – G – A.
Dirac’s Theorem
https://www.youtube.com/watch?
v=OGh5JKso0y4
Dirac’s Theorem
Consider aconnected graph with at least threeverticesand no
multipleedges. Let n bethenumber of verticesin thegraph. If
every vertex hasdegreeof at least n/2, then thegraph must be
Hamiltonian.
Application of Hamiltonian Circuit
Thegraph below shows
theavailableflightsof a
popular
airline. An edgebetween
two verticesindicatesthat
there
isadirect flight between
thetwo cities. Determine
whether
thegraph isHamiltonian.
If it is, find aHamiltonian
circuit.
Solution
 Thereareten verticesin thegraph, and n/2 =5 . Now,
vertex Manilahas9 edges, Tokyo 5, Seoul 5, Taipei 6,
Hongkong 7, Macau 9, Ho Chi Minh 5, KualaLumpur 5,
and Singapore5. Using Dirac’stheorem, thegraph is
Hamiltonian.
 Thismeansthat thegraph containsacircuit that visitseach
vertex and return to itsstarting point without visiting a
vertex morethan once.
 By trial and error, oneHamiltonian circuit isManila–
Tokyo – Seoul – Taipei – Hongkong – Macau – Bangkok –
Ho Chi Minh – KualaLumpur – Singapore– Manila.
Remember:
If thegraph doesnot meet therequirements
of theDirac’sTheorem, it still might be
Hamiltonian.
Exercises:
(Aufmann) UseDirac’stheorem to verify that the
graph isHamiltonian. Then find aHamiltonian
circuit.
Weighted Graph
A weighted graph isagraph in which each
edgeisassociated with avalue, called a
weight.
Travelling Salesman Problem
The travelling salesman problem (TSP) asksthe
following question: "Given alist of citiesand the
distancesbetween each pair of cities, what isthe
shortest possibleroutethat visitseach city exactly
onceand returnsto theorigin city?“
Thetravelling salesman problem consistsof a
salesman and aset of cities. Thesalesman hasto
visit each oneof thecitiesstarting from acertain
one(e.g. thehometown) and returning to thesame
city. Thechallengeof theproblem isthat the
travelling salesman wantsto minimizethetotal
length of thetrip.
Example: Travelling Salesman Problem
Thetablebelow listsdown thedistances(miles) between
thecitieshaving direct routesaswell asthecorresponding
distancesbetween them.
Draw agraph therepresentsthisinformation and find two
different routesthat visit each of theplacesand return to its
starting point without visiting any city twice.
Example: Travelling Salesman Problem
Example: Travelling Salesman Problem
TheGreedy Algorithm
A method of finding aHamiltonian circuit in acomplete
weighted graph isgiven by thefollowing greedy algorithm.
1.Chooseavertex to start at, then travel along theconnected
edgethat hasthesmallest weight.
2.After arriving at thenext vertex, travel along theedgeof
smallest weight that connectsto avertex not yet visited.
Continuethisprocessuntil you havevisited all vertices.
3.Return to thestarting vertex.
Take Note:
Thegreedy algorithm attemptsto giveacircuit of
minimal total weight, although it doesnot always
succeed.
Example
Aaron, Belle, Carol, Donna, Eric, and Fearebest of
friends. Thefigurebelow showsthedistances(km)
from afriend’splaceto another. If Aaron wantsto
visit each of hisfriends’ housesexactly once, what is
theshortest routethat hemust take?
Solution
TheEdge-Picking Algorithm
Another method of finding aHamiltonian circuit in
acompleteweighted graph isgiven by the
following edge-picking algorithm.
1.Mark theedgeof smallest weight in thegraph.
2.Mark theedgeof thenext smallest weight in the
graph, aslong asit doesnot completeacircuit and
doesnot add athird marked edgeto asinglevertex.
3.Continuetheprocessuntil you can no longer mark
any edges. Then mark thefinal edgethat completes
theHamiltonian circuit.
TheEdge-Picking Algorithm
Aaron, Belle, Carol, Donna, Eric, and Fearebest of friends.
Thefigurebelow showsthedistances(km) from afriend’s
placeto another. If Aaron wantsto visit each of hisfriends’
housesexactly once, what istheshortest routethat hemust
take?
Solution
 First wemark thelinesegment from Aaron’shouseto Belle’s
house, of weight 1.
 Next wemark thesegment from Belle’sto Carol’shouse, of
weight 2, followed by Carol’sto Donna’shouse, of weight 3,
followed by Eric’sto Fe’shouse, of weight 6.
 Takenotethat wecannot mark thesegment from Eric’shouseto
Aaron’sbecauseit can completeacircuit. Also, wecannot mark
thesegment from Carol’sto Fe’shousebecauseit can makethe
third marked edgeon avertex.
 Finally to completethecircuit, wemark thelinesegment from
Fe’shouseback to Aaron’s.
 Thefinal Hamiltonian circuit, of total weight
1+2+3+6+9+12=33, isAaron’shouse– Belle’shouse– Carol’s
house– Donna’shouse– Eric’shouse– Fe’shouseand back to
Aaron’s.
Theedge-picking algorithm attempts
to giveacircuit of minimal total
weight, although it doesnot always
succeed.
Remember
Application
Thetableshowsthelengthsof cablesneeded to
connect computersto createanetwork. Find the
minimum length of cablematerial needed using the
edge-picking algorithm.
A B C D E F
A -- 10 22 9 15 8
B 10 -- 12 14 16 5
C 22 12 -- 14 9 15
D 9 14 14 -- 7 16
E 15 16 9 7 -- 13
F 8 5 16 15 13 --
Planar Graphs
A planar graph isagraph that can bedrawn so
that no edgesintersect each other (except at
vertices).
Platonic solids
Subgraphs
A part of agraph G iscalled asubgraph of G.
Subgraph Theorem
“If agraph G hasasubgraph that isnot planar, theG isalso not
planar. In particular, if containstheUtilitiesGraph or K5 asa
subgraph, G isnot planar.”
Nonplanar Graph Theorem
A graph isnonplanar if and only if it hastheUtilitiesGraph or
K5 asasubgraph, or it hasasubgraph that can becontracted to
theUtilitiesGraph or K5.
https://youtu.be/Cxdyh7A4-Ho
Euler’sFormula
Euler’sFormula
In aconnected planar graph drawn with no
intersecting edges, let v bethenumber of vertices, e
thenumber of edges, and f thenumber of faces.
Then v + f = e+ 2.
Graph Coloring
If themap isdivided into regionsin somemanner, what is
theminimum number of colorsrequired if theneighboring
regionsareto becolored differently?
Thereisaconnection between map coloring and graph
theory. Mapscan bemodeled by graphsusing the
countriesastheverticesand two vertices(countries) are
adjacent if they shareacommon boundary.
In graph coloring, each vertex of agraph will beassigned
onecolor in such away that no two adjacent verticeshave
thesamecolor. Theinteresting ideahereisto determine
theminimum number of (distinct) colorsto beused so that
wecan color each vertex of agraph with no two adjacent
verticeshavethesamecolor
Four-Color Theorem
Theminimum number of colorsneeded to color a
graph so that no edgeconnectsverticesof thesame
color iscalled thechromatic number.
Four-Color Theorem
Thechromatic number of aplanar graph isutmost 4.
2-ColorableGraph Theorem
A graph is2-colorableif and only if it hasno circuits
that consist of an odd number of vertices
Determinewhether thegraph is2-colorable
Scheduling Problem
Six collegeaccreditation committeesneed to hold
meetingson thesameday, but someteachers
belong to morethan onecommittee. In order to
avoid membersmissing meetings, themeetings
need to bescheduled during different timeslots.
An “X” in thetableindicatesthat thetwo
corresponding committeesshareat least one
member. Usegraph coloring to determinethe
minimum number of timeslotsnecessary to
ensurethat all faculty memberscan attend all
meetings.
Table
Committee Faculty
Instruction
(FI)
Faculty
Development
(FD)
Outreach
Program
(OP)
Physica
l
Facility
(PF)
Library
Facility
(LF)
Student
Welfare
(SW)
Faculty Instruction X X X
Faculty
Development
X X X X
Outreach Program X X X X
Physical Facility X X X
Library Facility X X X X
Student Welfare X X X X
Solution
First wedraw agraph representing thesix committeesusing six
verticesor nodesin any configuration. An edgeconnectstwo
committeesthat shareat least onemember.
Then assign each vertex of thegraph with onecolor in such a
way that no two adjacent verticeshavethesamecolor.
Conclusion
Obviously, thegraph isnot 2-colorablebecausewe
can find circuitsof odd length but thegraph is3-
colorable. Hence, theminimum number of timeslots
necessary to ensurethat all faculty memberscan
attend all meetingsis3.
Scheduleof Meetings
First timeslot: Faculty Instruction, Student
Welfare
Second timeslot: Faculty Development,
Outreach
Program
Third timeslot: Library Facility, Physical Facility
References:
 https://www.coursera.org/lecture/discrete-mathematics/hamilton-c
 https://www.britannica.com/biography/William-Rowan-Hamilton
 http://math.gmu.edu/~tlim/DiracTheorem.pdf
Baltazar, Ethel CecilleM. Mathematicsin theModern World by C & E
Publishing Inc. 2018
Aufmann et al, Mathematical Excursions(2013)
Baltazar, Ethel CecilleM.
Mame, Neil (BatangasStateUniversity),
Manalang, Rodman (UE Manila),
Maquiling Rene(Xavier University),
Mocorro, Ronald (LeyteNormal University) – Powerpoint
Presentation (2017)

More Related Content

What's hot

Greedy algorithm
Greedy algorithmGreedy algorithm
Graph coloring
Graph coloringGraph coloring
Graph coloring
Rashika Ahuja
 
Graph coloring problem
Graph coloring problemGraph coloring problem
Graph coloring problem
V.V.Vanniaperumal College for Women
 
Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph Theory
Yosuke Mizutani
 
Graph Basic In Data structure
Graph Basic In Data structureGraph Basic In Data structure
Graph Basic In Data structure
Ikhlas Rahman
 
Approximation Algorithms
Approximation AlgorithmsApproximation Algorithms
Approximation Algorithms
Nicolas Bettenburg
 
Graph theory
Graph theoryGraph theory
Graph theoryKumar
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
Nv Thejaswini
 
Design and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxDesign and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptx
Syed Zaid Irshad
 
21 monotone sequences x
21 monotone sequences x21 monotone sequences x
21 monotone sequences x
math266
 
Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data Structure
Meghaj Mallick
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
sandeep54552
 
Dijkstra's Algorithm
Dijkstra's Algorithm Dijkstra's Algorithm
Dijkstra's Algorithm
Rashik Ishrak Nahian
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentation
Subid Biswas
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
Rajendran
 
N queen problem
N queen problemN queen problem
N queen problem
Ridhima Chowdhury
 
Graph theory presentation
Graph theory presentationGraph theory presentation
Graph theory presentation
Aliul Kadir Akib
 
Abstract Algebra
Abstract AlgebraAbstract Algebra
Abstract Algebra
Yura Maturin
 
15 puzzle problem using branch and bound
15 puzzle problem using branch and bound15 puzzle problem using branch and bound
15 puzzle problem using branch and bound
Abhishek Singh
 
GRAPH COLORING AND ITS APPLICATIONS
GRAPH COLORING AND ITS APPLICATIONSGRAPH COLORING AND ITS APPLICATIONS
GRAPH COLORING AND ITS APPLICATIONS
Manojit Chakraborty
 

What's hot (20)

Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
 
Graph coloring
Graph coloringGraph coloring
Graph coloring
 
Graph coloring problem
Graph coloring problemGraph coloring problem
Graph coloring problem
 
Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph Theory
 
Graph Basic In Data structure
Graph Basic In Data structureGraph Basic In Data structure
Graph Basic In Data structure
 
Approximation Algorithms
Approximation AlgorithmsApproximation Algorithms
Approximation Algorithms
 
Graph theory
Graph theoryGraph theory
Graph theory
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
 
Design and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxDesign and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptx
 
21 monotone sequences x
21 monotone sequences x21 monotone sequences x
21 monotone sequences x
 
Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data Structure
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Dijkstra's Algorithm
Dijkstra's Algorithm Dijkstra's Algorithm
Dijkstra's Algorithm
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentation
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
N queen problem
N queen problemN queen problem
N queen problem
 
Graph theory presentation
Graph theory presentationGraph theory presentation
Graph theory presentation
 
Abstract Algebra
Abstract AlgebraAbstract Algebra
Abstract Algebra
 
15 puzzle problem using branch and bound
15 puzzle problem using branch and bound15 puzzle problem using branch and bound
15 puzzle problem using branch and bound
 
GRAPH COLORING AND ITS APPLICATIONS
GRAPH COLORING AND ITS APPLICATIONSGRAPH COLORING AND ITS APPLICATIONS
GRAPH COLORING AND ITS APPLICATIONS
 

Similar to Graphs: Hamiltonian Path and Circuit

burton_discrete_graph theory
burton_discrete_graph theoryburton_discrete_graph theory
burton_discrete_graph theoryguest63f42b
 
burton_discrete_graphtheory
burton_discrete_graphtheoryburton_discrete_graphtheory
burton_discrete_graphtheoryguest5d4128
 
distructweek15graphstheoryupdated-160227143444.pdf
distructweek15graphstheoryupdated-160227143444.pdfdistructweek15graphstheoryupdated-160227143444.pdf
distructweek15graphstheoryupdated-160227143444.pdf
ansariparveen06
 
Distruct week 15 graphs theory (updated)
Distruct week 15 graphs theory (updated)Distruct week 15 graphs theory (updated)
Distruct week 15 graphs theory (updated)
Robert Almazan
 
CST 504 Graphs
CST 504 GraphsCST 504 Graphs
CST 504 Graphs
Neil MacIntosh
 
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycleBacktracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
varun arora
 
Final Report
Final ReportFinal Report
Final ReportCan Liu
 
Lecture co4 math21-1
Lecture co4 math21-1Lecture co4 math21-1
Lecture co4 math21-1
Lawrence De Vera
 
SimultaneousEquationsFINAL2.pdf
SimultaneousEquationsFINAL2.pdfSimultaneousEquationsFINAL2.pdf
SimultaneousEquationsFINAL2.pdf
CyprianObota
 
Presentation on Graph
Presentation on GraphPresentation on Graph
Presentation on Graph
Salim Hosen
 
The Traveling Salesman Problem
The Traveling Salesman ProblemThe Traveling Salesman Problem
The Traveling Salesman ProblemMaryam Alipour
 
Fractals, Geometry of Nature and Logistic Model
Fractals, Geometry of Nature and Logistic ModelFractals, Geometry of Nature and Logistic Model
Fractals, Geometry of Nature and Logistic Model
Osman Villanueva
 
Graph theory
Graph theoryGraph theory
Graph theory
manikanta361
 
nossi ch 6
nossi ch 6nossi ch 6
nossi ch 6
lesaturner
 
Question 1
Question 1Question 1
Question 1
inner4zn
 
acoa
acoaacoa
Geom 3point6and7
Geom 3point6and7Geom 3point6and7
Geom 3point6and7herbison
 
Lesson 13 algebraic curves
Lesson 13    algebraic curvesLesson 13    algebraic curves
Lesson 13 algebraic curvesJean Leano
 

Similar to Graphs: Hamiltonian Path and Circuit (20)

burton_discrete_graph theory
burton_discrete_graph theoryburton_discrete_graph theory
burton_discrete_graph theory
 
burton_discrete_graphtheory
burton_discrete_graphtheoryburton_discrete_graphtheory
burton_discrete_graphtheory
 
Na ch02
Na ch02Na ch02
Na ch02
 
distructweek15graphstheoryupdated-160227143444.pdf
distructweek15graphstheoryupdated-160227143444.pdfdistructweek15graphstheoryupdated-160227143444.pdf
distructweek15graphstheoryupdated-160227143444.pdf
 
Distruct week 15 graphs theory (updated)
Distruct week 15 graphs theory (updated)Distruct week 15 graphs theory (updated)
Distruct week 15 graphs theory (updated)
 
CST 504 Graphs
CST 504 GraphsCST 504 Graphs
CST 504 Graphs
 
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycleBacktracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
 
Final Report
Final ReportFinal Report
Final Report
 
Lecture co4 math21-1
Lecture co4 math21-1Lecture co4 math21-1
Lecture co4 math21-1
 
SimultaneousEquationsFINAL2.pdf
SimultaneousEquationsFINAL2.pdfSimultaneousEquationsFINAL2.pdf
SimultaneousEquationsFINAL2.pdf
 
Presentation on Graph
Presentation on GraphPresentation on Graph
Presentation on Graph
 
Problem baupc 2004
Problem baupc 2004Problem baupc 2004
Problem baupc 2004
 
The Traveling Salesman Problem
The Traveling Salesman ProblemThe Traveling Salesman Problem
The Traveling Salesman Problem
 
Fractals, Geometry of Nature and Logistic Model
Fractals, Geometry of Nature and Logistic ModelFractals, Geometry of Nature and Logistic Model
Fractals, Geometry of Nature and Logistic Model
 
Graph theory
Graph theoryGraph theory
Graph theory
 
nossi ch 6
nossi ch 6nossi ch 6
nossi ch 6
 
Question 1
Question 1Question 1
Question 1
 
acoa
acoaacoa
acoa
 
Geom 3point6and7
Geom 3point6and7Geom 3point6and7
Geom 3point6and7
 
Lesson 13 algebraic curves
Lesson 13    algebraic curvesLesson 13    algebraic curves
Lesson 13 algebraic curves
 

More from Liwayway Memije-Cruz

Second-level Digital Divide and experiences of Schools and Teachers
Second-level Digital Divide and experiences of Schools and TeachersSecond-level Digital Divide and experiences of Schools and Teachers
Second-level Digital Divide and experiences of Schools and Teachers
Liwayway Memije-Cruz
 
Human flourishing in science and technology: Technology as a Mode of Revealing
Human flourishing in science and technology: Technology as a Mode of RevealingHuman flourishing in science and technology: Technology as a Mode of Revealing
Human flourishing in science and technology: Technology as a Mode of Revealing
Liwayway Memije-Cruz
 
Intellectual Revolutions
Intellectual RevolutionsIntellectual Revolutions
Intellectual Revolutions
Liwayway Memije-Cruz
 
Historical Antecedents of Science and Technology
Historical Antecedents of Science and TechnologyHistorical Antecedents of Science and Technology
Historical Antecedents of Science and Technology
Liwayway Memije-Cruz
 
Ribonucleic acid or RNA
Ribonucleic acid or RNARibonucleic acid or RNA
Ribonucleic acid or RNA
Liwayway Memije-Cruz
 
Hydrocarbon and its derivatives
Hydrocarbon and its derivativesHydrocarbon and its derivatives
Hydrocarbon and its derivatives
Liwayway Memije-Cruz
 
Types of Organic Reactions
Types of Organic ReactionsTypes of Organic Reactions
Types of Organic Reactions
Liwayway Memije-Cruz
 
Functional groups
Functional groupsFunctional groups
Functional groups
Liwayway Memije-Cruz
 
General view of organic chemistry and iupac
General view of organic chemistry  and iupacGeneral view of organic chemistry  and iupac
General view of organic chemistry and iupac
Liwayway Memije-Cruz
 
Historical antecedents of science and technology
Historical antecedents of science and technologyHistorical antecedents of science and technology
Historical antecedents of science and technology
Liwayway Memije-Cruz
 
Isomerism
IsomerismIsomerism
Apportionment and Voting
Apportionment and VotingApportionment and Voting
Apportionment and Voting
Liwayway Memije-Cruz
 
Lipid metabolism
Lipid metabolismLipid metabolism
Lipid metabolism
Liwayway Memije-Cruz
 
Carbohydrate Metabolism
Carbohydrate  MetabolismCarbohydrate  Metabolism
Carbohydrate Metabolism
Liwayway Memije-Cruz
 
Body tissues
Body tissuesBody tissues
Body tissues
Liwayway Memije-Cruz
 
Cell division
Cell divisionCell division
Cell division
Liwayway Memije-Cruz
 
Enzymes
EnzymesEnzymes
Vitamins
VitaminsVitamins
Cell division
Cell divisionCell division
Cell division
Liwayway Memije-Cruz
 
Problem Solving and Reasoning
Problem Solving and ReasoningProblem Solving and Reasoning
Problem Solving and Reasoning
Liwayway Memije-Cruz
 

More from Liwayway Memije-Cruz (20)

Second-level Digital Divide and experiences of Schools and Teachers
Second-level Digital Divide and experiences of Schools and TeachersSecond-level Digital Divide and experiences of Schools and Teachers
Second-level Digital Divide and experiences of Schools and Teachers
 
Human flourishing in science and technology: Technology as a Mode of Revealing
Human flourishing in science and technology: Technology as a Mode of RevealingHuman flourishing in science and technology: Technology as a Mode of Revealing
Human flourishing in science and technology: Technology as a Mode of Revealing
 
Intellectual Revolutions
Intellectual RevolutionsIntellectual Revolutions
Intellectual Revolutions
 
Historical Antecedents of Science and Technology
Historical Antecedents of Science and TechnologyHistorical Antecedents of Science and Technology
Historical Antecedents of Science and Technology
 
Ribonucleic acid or RNA
Ribonucleic acid or RNARibonucleic acid or RNA
Ribonucleic acid or RNA
 
Hydrocarbon and its derivatives
Hydrocarbon and its derivativesHydrocarbon and its derivatives
Hydrocarbon and its derivatives
 
Types of Organic Reactions
Types of Organic ReactionsTypes of Organic Reactions
Types of Organic Reactions
 
Functional groups
Functional groupsFunctional groups
Functional groups
 
General view of organic chemistry and iupac
General view of organic chemistry  and iupacGeneral view of organic chemistry  and iupac
General view of organic chemistry and iupac
 
Historical antecedents of science and technology
Historical antecedents of science and technologyHistorical antecedents of science and technology
Historical antecedents of science and technology
 
Isomerism
IsomerismIsomerism
Isomerism
 
Apportionment and Voting
Apportionment and VotingApportionment and Voting
Apportionment and Voting
 
Lipid metabolism
Lipid metabolismLipid metabolism
Lipid metabolism
 
Carbohydrate Metabolism
Carbohydrate  MetabolismCarbohydrate  Metabolism
Carbohydrate Metabolism
 
Body tissues
Body tissuesBody tissues
Body tissues
 
Cell division
Cell divisionCell division
Cell division
 
Enzymes
EnzymesEnzymes
Enzymes
 
Vitamins
VitaminsVitamins
Vitamins
 
Cell division
Cell divisionCell division
Cell division
 
Problem Solving and Reasoning
Problem Solving and ReasoningProblem Solving and Reasoning
Problem Solving and Reasoning
 

Recently uploaded

EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
AlguinaldoKong
 
filosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptxfilosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptx
IvanMallco1
 
Lateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensiveLateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensive
silvermistyshot
 
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
muralinath2
 
justice-and-fairness-ethics with example
justice-and-fairness-ethics with examplejustice-and-fairness-ethics with example
justice-and-fairness-ethics with example
azzyixes
 
Large scale production of streptomycin.pptx
Large scale production of streptomycin.pptxLarge scale production of streptomycin.pptx
Large scale production of streptomycin.pptx
Cherry
 
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCINGRNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
AADYARAJPANDEY1
 
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
NathanBaughman3
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
Richard Gill
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
AlaminAfendy1
 
ESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptxESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptx
muralinath2
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
muralinath2
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
ChetanK57
 
Mammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also FunctionsMammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also Functions
YOGESH DOGRA
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
muralinath2
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
muralinath2
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Sérgio Sacani
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
Sérgio Sacani
 
insect morphology and physiology of insect
insect morphology and physiology of insectinsect morphology and physiology of insect
insect morphology and physiology of insect
anitaento25
 
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Erdal Coalmaker
 

Recently uploaded (20)

EY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptxEY - Supply Chain Services 2018_template.pptx
EY - Supply Chain Services 2018_template.pptx
 
filosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptxfilosofia boliviana introducción jsjdjd.pptx
filosofia boliviana introducción jsjdjd.pptx
 
Lateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensiveLateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensive
 
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
Circulatory system_ Laplace law. Ohms law.reynaults law,baro-chemo-receptors-...
 
justice-and-fairness-ethics with example
justice-and-fairness-ethics with examplejustice-and-fairness-ethics with example
justice-and-fairness-ethics with example
 
Large scale production of streptomycin.pptx
Large scale production of streptomycin.pptxLarge scale production of streptomycin.pptx
Large scale production of streptomycin.pptx
 
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCINGRNA INTERFERENCE: UNRAVELING GENETIC SILENCING
RNA INTERFERENCE: UNRAVELING GENETIC SILENCING
 
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
Astronomy Update- Curiosity’s exploration of Mars _ Local Briefs _ leadertele...
 
Richard's entangled aventures in wonderland
Richard's entangled aventures in wonderlandRichard's entangled aventures in wonderland
Richard's entangled aventures in wonderland
 
In silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptxIn silico drugs analogue design: novobiocin analogues.pptx
In silico drugs analogue design: novobiocin analogues.pptx
 
ESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptxESR_factors_affect-clinic significance-Pathysiology.pptx
ESR_factors_affect-clinic significance-Pathysiology.pptx
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
 
Mammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also FunctionsMammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also Functions
 
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptxBody fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
Body fluids_tonicity_dehydration_hypovolemia_hypervolemia.pptx
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
 
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
Observation of Io’s Resurfacing via Plume Deposition Using Ground-based Adapt...
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
 
insect morphology and physiology of insect
insect morphology and physiology of insectinsect morphology and physiology of insect
insect morphology and physiology of insect
 
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
 

Graphs: Hamiltonian Path and Circuit

  • 1. Graphs: Hamiltonian Path and Circuits By Prof. Liwayway Memije-Cruz
  • 2. Irish mathematician who contributed to the development of optics, dynamics, and algebra —in particular, discovering thealgebra of quaternions. His work proved significant for thedevelopment of quantum mechanics. William Rowan Hamilton
  • 4. Hamiltonian Path and Circuit A Hamiltonian path isapath that visits each vertex of thegraph exactly once. A Hamiltonian circuit isapath that uses each vertex of agraph exactly onceand returnsto thestarting vertex. A graph that containsaHamiltonian circuit iscalled Hamiltonian.
  • 5.  In Euler circuits, welooked at closed pathsthat use every edgeexactly once, possibly visiting avertex morethan once.  In Hamiltonian circuits, welook at pathsthat visit each vertex exactly once, possibly not passing through someof theedges.  But unliketheEuler circuit, wheretheEulerian Graph Theorem isused to determinewhether it containsan Euler circuit or not, wedo not havea straightforward criterion to determinewhether or not aHamiltonian circuit existsin agraph.
  • 7. Determine whether the graph below is Hamiltonian or not. If it is, find a Hamiltonian circuit. If it is not, explain why? Answer: A – B – C – E – D – F – G – A.
  • 9. Dirac’s Theorem Consider aconnected graph with at least threeverticesand no multipleedges. Let n bethenumber of verticesin thegraph. If every vertex hasdegreeof at least n/2, then thegraph must be Hamiltonian.
  • 10. Application of Hamiltonian Circuit Thegraph below shows theavailableflightsof a popular airline. An edgebetween two verticesindicatesthat there isadirect flight between thetwo cities. Determine whether thegraph isHamiltonian. If it is, find aHamiltonian circuit.
  • 11. Solution  Thereareten verticesin thegraph, and n/2 =5 . Now, vertex Manilahas9 edges, Tokyo 5, Seoul 5, Taipei 6, Hongkong 7, Macau 9, Ho Chi Minh 5, KualaLumpur 5, and Singapore5. Using Dirac’stheorem, thegraph is Hamiltonian.  Thismeansthat thegraph containsacircuit that visitseach vertex and return to itsstarting point without visiting a vertex morethan once.  By trial and error, oneHamiltonian circuit isManila– Tokyo – Seoul – Taipei – Hongkong – Macau – Bangkok – Ho Chi Minh – KualaLumpur – Singapore– Manila.
  • 12. Remember: If thegraph doesnot meet therequirements of theDirac’sTheorem, it still might be Hamiltonian.
  • 13. Exercises: (Aufmann) UseDirac’stheorem to verify that the graph isHamiltonian. Then find aHamiltonian circuit.
  • 14. Weighted Graph A weighted graph isagraph in which each edgeisassociated with avalue, called a weight.
  • 15. Travelling Salesman Problem The travelling salesman problem (TSP) asksthe following question: "Given alist of citiesand the distancesbetween each pair of cities, what isthe shortest possibleroutethat visitseach city exactly onceand returnsto theorigin city?“ Thetravelling salesman problem consistsof a salesman and aset of cities. Thesalesman hasto visit each oneof thecitiesstarting from acertain one(e.g. thehometown) and returning to thesame city. Thechallengeof theproblem isthat the travelling salesman wantsto minimizethetotal length of thetrip.
  • 16. Example: Travelling Salesman Problem Thetablebelow listsdown thedistances(miles) between thecitieshaving direct routesaswell asthecorresponding distancesbetween them. Draw agraph therepresentsthisinformation and find two different routesthat visit each of theplacesand return to its starting point without visiting any city twice.
  • 19. TheGreedy Algorithm A method of finding aHamiltonian circuit in acomplete weighted graph isgiven by thefollowing greedy algorithm. 1.Chooseavertex to start at, then travel along theconnected edgethat hasthesmallest weight. 2.After arriving at thenext vertex, travel along theedgeof smallest weight that connectsto avertex not yet visited. Continuethisprocessuntil you havevisited all vertices. 3.Return to thestarting vertex. Take Note: Thegreedy algorithm attemptsto giveacircuit of minimal total weight, although it doesnot always succeed.
  • 20. Example Aaron, Belle, Carol, Donna, Eric, and Fearebest of friends. Thefigurebelow showsthedistances(km) from afriend’splaceto another. If Aaron wantsto visit each of hisfriends’ housesexactly once, what is theshortest routethat hemust take?
  • 22. TheEdge-Picking Algorithm Another method of finding aHamiltonian circuit in acompleteweighted graph isgiven by the following edge-picking algorithm. 1.Mark theedgeof smallest weight in thegraph. 2.Mark theedgeof thenext smallest weight in the graph, aslong asit doesnot completeacircuit and doesnot add athird marked edgeto asinglevertex. 3.Continuetheprocessuntil you can no longer mark any edges. Then mark thefinal edgethat completes theHamiltonian circuit.
  • 23. TheEdge-Picking Algorithm Aaron, Belle, Carol, Donna, Eric, and Fearebest of friends. Thefigurebelow showsthedistances(km) from afriend’s placeto another. If Aaron wantsto visit each of hisfriends’ housesexactly once, what istheshortest routethat hemust take?
  • 24. Solution  First wemark thelinesegment from Aaron’shouseto Belle’s house, of weight 1.  Next wemark thesegment from Belle’sto Carol’shouse, of weight 2, followed by Carol’sto Donna’shouse, of weight 3, followed by Eric’sto Fe’shouse, of weight 6.  Takenotethat wecannot mark thesegment from Eric’shouseto Aaron’sbecauseit can completeacircuit. Also, wecannot mark thesegment from Carol’sto Fe’shousebecauseit can makethe third marked edgeon avertex.  Finally to completethecircuit, wemark thelinesegment from Fe’shouseback to Aaron’s.  Thefinal Hamiltonian circuit, of total weight 1+2+3+6+9+12=33, isAaron’shouse– Belle’shouse– Carol’s house– Donna’shouse– Eric’shouse– Fe’shouseand back to Aaron’s.
  • 25. Theedge-picking algorithm attempts to giveacircuit of minimal total weight, although it doesnot always succeed. Remember
  • 26. Application Thetableshowsthelengthsof cablesneeded to connect computersto createanetwork. Find the minimum length of cablematerial needed using the edge-picking algorithm. A B C D E F A -- 10 22 9 15 8 B 10 -- 12 14 16 5 C 22 12 -- 14 9 15 D 9 14 14 -- 7 16 E 15 16 9 7 -- 13 F 8 5 16 15 13 --
  • 27. Planar Graphs A planar graph isagraph that can bedrawn so that no edgesintersect each other (except at vertices).
  • 29. Subgraphs A part of agraph G iscalled asubgraph of G. Subgraph Theorem “If agraph G hasasubgraph that isnot planar, theG isalso not planar. In particular, if containstheUtilitiesGraph or K5 asa subgraph, G isnot planar.” Nonplanar Graph Theorem A graph isnonplanar if and only if it hastheUtilitiesGraph or K5 asasubgraph, or it hasasubgraph that can becontracted to theUtilitiesGraph or K5.
  • 31. Euler’sFormula In aconnected planar graph drawn with no intersecting edges, let v bethenumber of vertices, e thenumber of edges, and f thenumber of faces. Then v + f = e+ 2.
  • 32. Graph Coloring If themap isdivided into regionsin somemanner, what is theminimum number of colorsrequired if theneighboring regionsareto becolored differently? Thereisaconnection between map coloring and graph theory. Mapscan bemodeled by graphsusing the countriesastheverticesand two vertices(countries) are adjacent if they shareacommon boundary. In graph coloring, each vertex of agraph will beassigned onecolor in such away that no two adjacent verticeshave thesamecolor. Theinteresting ideahereisto determine theminimum number of (distinct) colorsto beused so that wecan color each vertex of agraph with no two adjacent verticeshavethesamecolor
  • 33. Four-Color Theorem Theminimum number of colorsneeded to color a graph so that no edgeconnectsverticesof thesame color iscalled thechromatic number. Four-Color Theorem Thechromatic number of aplanar graph isutmost 4.
  • 34. 2-ColorableGraph Theorem A graph is2-colorableif and only if it hasno circuits that consist of an odd number of vertices Determinewhether thegraph is2-colorable
  • 35. Scheduling Problem Six collegeaccreditation committeesneed to hold meetingson thesameday, but someteachers belong to morethan onecommittee. In order to avoid membersmissing meetings, themeetings need to bescheduled during different timeslots. An “X” in thetableindicatesthat thetwo corresponding committeesshareat least one member. Usegraph coloring to determinethe minimum number of timeslotsnecessary to ensurethat all faculty memberscan attend all meetings.
  • 36. Table Committee Faculty Instruction (FI) Faculty Development (FD) Outreach Program (OP) Physica l Facility (PF) Library Facility (LF) Student Welfare (SW) Faculty Instruction X X X Faculty Development X X X X Outreach Program X X X X Physical Facility X X X Library Facility X X X X Student Welfare X X X X
  • 37. Solution First wedraw agraph representing thesix committeesusing six verticesor nodesin any configuration. An edgeconnectstwo committeesthat shareat least onemember. Then assign each vertex of thegraph with onecolor in such a way that no two adjacent verticeshavethesamecolor.
  • 38. Conclusion Obviously, thegraph isnot 2-colorablebecausewe can find circuitsof odd length but thegraph is3- colorable. Hence, theminimum number of timeslots necessary to ensurethat all faculty memberscan attend all meetingsis3. Scheduleof Meetings First timeslot: Faculty Instruction, Student Welfare Second timeslot: Faculty Development, Outreach Program Third timeslot: Library Facility, Physical Facility
  • 39. References:  https://www.coursera.org/lecture/discrete-mathematics/hamilton-c  https://www.britannica.com/biography/William-Rowan-Hamilton  http://math.gmu.edu/~tlim/DiracTheorem.pdf Baltazar, Ethel CecilleM. Mathematicsin theModern World by C & E Publishing Inc. 2018 Aufmann et al, Mathematical Excursions(2013) Baltazar, Ethel CecilleM. Mame, Neil (BatangasStateUniversity), Manalang, Rodman (UE Manila), Maquiling Rene(Xavier University), Mocorro, Ronald (LeyteNormal University) – Powerpoint Presentation (2017)