SlideShare ist ein Scribd-Unternehmen logo
1 von 14
DATA STRUCTURES AND ALGORITHMS
LAB 8
Bianca Tesila
FILS, April 2014
OBJECTIVES
 Connected Graph
 Hamiltonian Graph
 Eulerian Graph
CONNECTED GRAPH
 An undirected graph G = (V, A) is said to be
connected if, for any vertices u and v of S, there is
a chain from u to v.
CONNECTED GRAPH – CONNECTED
COMPONENTS
 A connected component (or just component) of
an undirected graph is a subgraph in which any
two vertices are connected to each other by paths,
and which is connected to no additional vertices
in the supergraph.
CONNECTED GRAPH
 Classic problems:
 Check whether a graph is connected or not
 Find all the connected components of a graph
!! DFS is used to determine if a graph is connected
or not.
CONNECTED GRAPH
!! Exercise:
Check whether a graph is connected or not.
HAMILTONIAN GRAPH
 Hamiltonian Path (or traceable path): a path in an
undirected or directed graph that visits
each vertex exactly once.
 Hamiltonian Cycle (or Hamiltonian circuit): a
Hamiltonian path that is a cycle. That
 is, it begins and ends on the same vertex.
 Hamiltonian Graph: a graph that contains a
Hamiltonian cycle
!! Any Hamiltonian cycle can be converted to a
Hamiltonian path by removing one of its edges.
HAMILTONIAN GRAPH
https://sites.google.com/site/poggiolidiscretemath/graph-
theory/hamiltonian-graphs
HAMILTONIAN GRAPH
!! Exercise:
Check whether a graph is Hamiltonian or not.
Hint:
If G is a non-oriented with n> = 3 vertices, such
that every vertex of G has the degree greater or
equal to N / 2, then G is Hamiltonian graph.
EULERIAN GRAPH
 Eulerian Trail (or Eulerian path): a trail in a
graph which visits every edge exactly once. It
can end on a vertex different from the one on
which it began.
 Eulerian Cycle: an Eulerian trail which starts
and ends on the same vertex.
 Eulerian Graph: a graph that contains an
Eulerian cycle
EULERIAN GRAPH
 A graph G, without isolated vertices, is Eulerian
if and only if it is connected and the degrees of all
vertices are even numbers.
 Classic problem: find the Eulerian cycle in a
graph.
https://sites.google.com/site/poggiolidiscretemath/gr
aph-theory/eulerian-graphs
EULERIAN GRAPH
!! Exercise:
Check whether a graph is Eulerian or not.
Hint:
A connected graph G is an Euler graph if and only
if all vertices of G are of even degree.
EULERIAN VS. HAMILTONIAN GRAPHS
!! An Eulerian circuit traverses every edge in a
graph exactly once, but may repeat vertices, while
a Hamiltonian circuit visits each vertex in a
graph exactly once but may repeat edges.
HOMEWORK
Finish all the lab assignments.

Weitere ähnliche Inhalte

Was ist angesagt?

Posiciones de rectas y planos
Posiciones de rectas y planosPosiciones de rectas y planos
Posiciones de rectas y planosssuser72b7e1
 
Square Root Function Transformation Notes
Square Root Function Transformation NotesSquare Root Function Transformation Notes
Square Root Function Transformation Notescmorgancavo
 
Notes of matrices and determinants
Notes of matrices and determinantsNotes of matrices and determinants
Notes of matrices and determinantsKarunaGupta1982
 
Limits and the motion of objects ii
Limits and the motion of objects iiLimits and the motion of objects ii
Limits and the motion of objects iibgustin53
 
Trace of Matrix - Linear Algebra
Trace of Matrix - Linear AlgebraTrace of Matrix - Linear Algebra
Trace of Matrix - Linear AlgebraSiddhantDixit6
 
Graph standard form examples
Graph standard form examplesGraph standard form examples
Graph standard form examplesJessicaBiemiller
 
Quarulaterals BY RAMBABU SIRIPURAPU
Quarulaterals BY RAMBABU SIRIPURAPUQuarulaterals BY RAMBABU SIRIPURAPU
Quarulaterals BY RAMBABU SIRIPURAPURAMBABU SIRIPURAPU
 
Vector Addition
Vector AdditionVector Addition
Vector Additionrinisma5
 
Planar graph( Algorithm and Application )
Planar graph( Algorithm and Application )Planar graph( Algorithm and Application )
Planar graph( Algorithm and Application )Abdullah Moin
 
Lesson 1: Vectors and Scalars
Lesson 1: Vectors and ScalarsLesson 1: Vectors and Scalars
Lesson 1: Vectors and ScalarsVectorKing
 
MATRICES
MATRICESMATRICES
MATRICESdaferro
 

Was ist angesagt? (20)

Geometry
GeometryGeometry
Geometry
 
Poster KH & SH
Poster KH & SHPoster KH & SH
Poster KH & SH
 
Posiciones de rectas y planos
Posiciones de rectas y planosPosiciones de rectas y planos
Posiciones de rectas y planos
 
Square Root Function Transformation Notes
Square Root Function Transformation NotesSquare Root Function Transformation Notes
Square Root Function Transformation Notes
 
Notes of matrices and determinants
Notes of matrices and determinantsNotes of matrices and determinants
Notes of matrices and determinants
 
Limits and the motion of objects ii
Limits and the motion of objects iiLimits and the motion of objects ii
Limits and the motion of objects ii
 
Trace of Matrix - Linear Algebra
Trace of Matrix - Linear AlgebraTrace of Matrix - Linear Algebra
Trace of Matrix - Linear Algebra
 
Graph standard form examples
Graph standard form examplesGraph standard form examples
Graph standard form examples
 
Integral calculus
Integral calculusIntegral calculus
Integral calculus
 
Quarulaterals BY RAMBABU SIRIPURAPU
Quarulaterals BY RAMBABU SIRIPURAPUQuarulaterals BY RAMBABU SIRIPURAPU
Quarulaterals BY RAMBABU SIRIPURAPU
 
matricesMrtices
matricesMrticesmatricesMrtices
matricesMrtices
 
Vector Addition
Vector AdditionVector Addition
Vector Addition
 
Planar graph( Algorithm and Application )
Planar graph( Algorithm and Application )Planar graph( Algorithm and Application )
Planar graph( Algorithm and Application )
 
Ds lec 5_chap4
Ds lec 5_chap4Ds lec 5_chap4
Ds lec 5_chap4
 
Lesson 1: Vectors and Scalars
Lesson 1: Vectors and ScalarsLesson 1: Vectors and Scalars
Lesson 1: Vectors and Scalars
 
ppt of VCLA
ppt of VCLAppt of VCLA
ppt of VCLA
 
Planar graph
Planar graphPlanar graph
Planar graph
 
Application of derivatives
Application of derivativesApplication of derivatives
Application of derivatives
 
MATRICES
MATRICESMATRICES
MATRICES
 
Vectors
VectorsVectors
Vectors
 

Andere mochten auch

Data structures and algorithms lab3
Data structures and algorithms lab3Data structures and algorithms lab3
Data structures and algorithms lab3Bianca Teşilă
 
Data structures and algorithms lab11
Data structures and algorithms lab11Data structures and algorithms lab11
Data structures and algorithms lab11Bianca Teşilă
 
Difference between c# generics and c++ templates
Difference between c# generics and c++ templatesDifference between c# generics and c++ templates
Difference between c# generics and c++ templatesUmar Ali
 
Data structures and algorithms lab2
Data structures and algorithms lab2Data structures and algorithms lab2
Data structures and algorithms lab2Bianca Teşilă
 
Data structures and algorithms lab1
Data structures and algorithms lab1Data structures and algorithms lab1
Data structures and algorithms lab1Bianca Teşilă
 
Introduction to computer architecture and organization
Introduction to computer architecture and organizationIntroduction to computer architecture and organization
Introduction to computer architecture and organizationMuhammad Ishaq
 
Data structures and algorithms lab5
Data structures and algorithms lab5Data structures and algorithms lab5
Data structures and algorithms lab5Bianca Teşilă
 
Graph theory 1
Graph theory 1Graph theory 1
Graph theory 1Tech_MX
 
Chapter 1 introduction to computers
Chapter 1   introduction to computersChapter 1   introduction to computers
Chapter 1 introduction to computershaider ali
 
0. Course Introduction
0. Course Introduction0. Course Introduction
0. Course IntroductionIntro C# Book
 

Andere mochten auch (13)

Data structures and algorithms lab3
Data structures and algorithms lab3Data structures and algorithms lab3
Data structures and algorithms lab3
 
Data structures and algorithms lab11
Data structures and algorithms lab11Data structures and algorithms lab11
Data structures and algorithms lab11
 
Difference between c# generics and c++ templates
Difference between c# generics and c++ templatesDifference between c# generics and c++ templates
Difference between c# generics and c++ templates
 
Data structures and algorithms lab2
Data structures and algorithms lab2Data structures and algorithms lab2
Data structures and algorithms lab2
 
Data structures and algorithms lab1
Data structures and algorithms lab1Data structures and algorithms lab1
Data structures and algorithms lab1
 
Introduction to computer architecture and organization
Introduction to computer architecture and organizationIntroduction to computer architecture and organization
Introduction to computer architecture and organization
 
Data structures and algorithms lab5
Data structures and algorithms lab5Data structures and algorithms lab5
Data structures and algorithms lab5
 
Graph theory 1
Graph theory 1Graph theory 1
Graph theory 1
 
USMLE and Canadian Exams
USMLE and Canadian ExamsUSMLE and Canadian Exams
USMLE and Canadian Exams
 
Chapter 1 introduction to computers
Chapter 1   introduction to computersChapter 1   introduction to computers
Chapter 1 introduction to computers
 
0. Course Introduction
0. Course Introduction0. Course Introduction
0. Course Introduction
 
Ppt 1
Ppt 1Ppt 1
Ppt 1
 
DSA-2012-Lect00
DSA-2012-Lect00DSA-2012-Lect00
DSA-2012-Lect00
 

Ähnlich wie Data structures and algorithms lab8

Ähnlich wie Data structures and algorithms lab8 (20)

Graph ds
Graph dsGraph ds
Graph ds
 
burton_discrete_graph theory
burton_discrete_graph theoryburton_discrete_graph theory
burton_discrete_graph theory
 
08_Euler and hamiltonian.pptx
08_Euler and hamiltonian.pptx08_Euler and hamiltonian.pptx
08_Euler and hamiltonian.pptx
 
ISOMORFISME, CONNECTIVITY EULER HAMILTON.pdf
ISOMORFISME, CONNECTIVITY EULER HAMILTON.pdfISOMORFISME, CONNECTIVITY EULER HAMILTON.pdf
ISOMORFISME, CONNECTIVITY EULER HAMILTON.pdf
 
Mithfh lecturenotes 9
Mithfh lecturenotes 9Mithfh lecturenotes 9
Mithfh lecturenotes 9
 
Umap traversabilityin graph
Umap traversabilityin graphUmap traversabilityin graph
Umap traversabilityin graph
 
FCS (graphs).pptx
FCS (graphs).pptxFCS (graphs).pptx
FCS (graphs).pptx
 
Graph theory
Graph theory Graph theory
Graph theory
 
Unit V - ppt.pptx
Unit V - ppt.pptxUnit V - ppt.pptx
Unit V - ppt.pptx
 
distructweek15graphstheoryupdated-160227143444.pdf
distructweek15graphstheoryupdated-160227143444.pdfdistructweek15graphstheoryupdated-160227143444.pdf
distructweek15graphstheoryupdated-160227143444.pdf
 
Final-term Coverage.pptx. ..............
Final-term Coverage.pptx. ..............Final-term Coverage.pptx. ..............
Final-term Coverage.pptx. ..............
 
Distruct week 15 graphs theory (updated)
Distruct week 15 graphs theory (updated)Distruct week 15 graphs theory (updated)
Distruct week 15 graphs theory (updated)
 
Graphs: Cycles
Graphs: CyclesGraphs: Cycles
Graphs: Cycles
 
UNIT III.pptx
UNIT III.pptxUNIT III.pptx
UNIT III.pptx
 
A glimpse to topological graph theory
A glimpse to topological graph theoryA glimpse to topological graph theory
A glimpse to topological graph theory
 
Graph Theory
Graph TheoryGraph Theory
Graph Theory
 
Elements of Graph Theory for IS.pptx
Elements of Graph Theory for IS.pptxElements of Graph Theory for IS.pptx
Elements of Graph Theory for IS.pptx
 
Graphs.pptx
Graphs.pptxGraphs.pptx
Graphs.pptx
 
nossi ch 6
nossi ch 6nossi ch 6
nossi ch 6
 
Discrete-Chapter 11 Graphs Part III
Discrete-Chapter 11 Graphs Part IIIDiscrete-Chapter 11 Graphs Part III
Discrete-Chapter 11 Graphs Part III
 

Mehr von Bianca Teşilă

Akka Streams - An Adobe data-intensive story
Akka Streams - An Adobe data-intensive storyAkka Streams - An Adobe data-intensive story
Akka Streams - An Adobe data-intensive storyBianca Teşilă
 
Data structures and algorithms lab10
Data structures and algorithms lab10Data structures and algorithms lab10
Data structures and algorithms lab10Bianca Teşilă
 
Data structures and algorithms lab9
Data structures and algorithms lab9Data structures and algorithms lab9
Data structures and algorithms lab9Bianca Teşilă
 
Data structures and algorithms lab7
Data structures and algorithms lab7Data structures and algorithms lab7
Data structures and algorithms lab7Bianca Teşilă
 
Data structures and algorithms lab6
Data structures and algorithms lab6Data structures and algorithms lab6
Data structures and algorithms lab6Bianca Teşilă
 
Data structures and algorithms lab4
Data structures and algorithms lab4Data structures and algorithms lab4
Data structures and algorithms lab4Bianca Teşilă
 

Mehr von Bianca Teşilă (6)

Akka Streams - An Adobe data-intensive story
Akka Streams - An Adobe data-intensive storyAkka Streams - An Adobe data-intensive story
Akka Streams - An Adobe data-intensive story
 
Data structures and algorithms lab10
Data structures and algorithms lab10Data structures and algorithms lab10
Data structures and algorithms lab10
 
Data structures and algorithms lab9
Data structures and algorithms lab9Data structures and algorithms lab9
Data structures and algorithms lab9
 
Data structures and algorithms lab7
Data structures and algorithms lab7Data structures and algorithms lab7
Data structures and algorithms lab7
 
Data structures and algorithms lab6
Data structures and algorithms lab6Data structures and algorithms lab6
Data structures and algorithms lab6
 
Data structures and algorithms lab4
Data structures and algorithms lab4Data structures and algorithms lab4
Data structures and algorithms lab4
 

Kürzlich hochgeladen

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Kürzlich hochgeladen (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

Data structures and algorithms lab8

  • 1. DATA STRUCTURES AND ALGORITHMS LAB 8 Bianca Tesila FILS, April 2014
  • 2. OBJECTIVES  Connected Graph  Hamiltonian Graph  Eulerian Graph
  • 3. CONNECTED GRAPH  An undirected graph G = (V, A) is said to be connected if, for any vertices u and v of S, there is a chain from u to v.
  • 4. CONNECTED GRAPH – CONNECTED COMPONENTS  A connected component (or just component) of an undirected graph is a subgraph in which any two vertices are connected to each other by paths, and which is connected to no additional vertices in the supergraph.
  • 5. CONNECTED GRAPH  Classic problems:  Check whether a graph is connected or not  Find all the connected components of a graph !! DFS is used to determine if a graph is connected or not.
  • 6. CONNECTED GRAPH !! Exercise: Check whether a graph is connected or not.
  • 7. HAMILTONIAN GRAPH  Hamiltonian Path (or traceable path): a path in an undirected or directed graph that visits each vertex exactly once.  Hamiltonian Cycle (or Hamiltonian circuit): a Hamiltonian path that is a cycle. That  is, it begins and ends on the same vertex.  Hamiltonian Graph: a graph that contains a Hamiltonian cycle !! Any Hamiltonian cycle can be converted to a Hamiltonian path by removing one of its edges.
  • 9. HAMILTONIAN GRAPH !! Exercise: Check whether a graph is Hamiltonian or not. Hint: If G is a non-oriented with n> = 3 vertices, such that every vertex of G has the degree greater or equal to N / 2, then G is Hamiltonian graph.
  • 10. EULERIAN GRAPH  Eulerian Trail (or Eulerian path): a trail in a graph which visits every edge exactly once. It can end on a vertex different from the one on which it began.  Eulerian Cycle: an Eulerian trail which starts and ends on the same vertex.  Eulerian Graph: a graph that contains an Eulerian cycle
  • 11. EULERIAN GRAPH  A graph G, without isolated vertices, is Eulerian if and only if it is connected and the degrees of all vertices are even numbers.  Classic problem: find the Eulerian cycle in a graph. https://sites.google.com/site/poggiolidiscretemath/gr aph-theory/eulerian-graphs
  • 12. EULERIAN GRAPH !! Exercise: Check whether a graph is Eulerian or not. Hint: A connected graph G is an Euler graph if and only if all vertices of G are of even degree.
  • 13. EULERIAN VS. HAMILTONIAN GRAPHS !! An Eulerian circuit traverses every edge in a graph exactly once, but may repeat vertices, while a Hamiltonian circuit visits each vertex in a graph exactly once but may repeat edges.
  • 14. HOMEWORK Finish all the lab assignments.