Data structures and algorithms lab8
Upcoming SlideShare
Loading in...5
×
 

Data structures and algorithms lab8

on

  • 1,043 views

 

Statistics

Views

Total Views
1,043
Views on SlideShare
384
Embed Views
659

Actions

Likes
0
Downloads
19
Comments
0

2 Embeds 659

http://biancatesila.wordpress.com 658
http://www.slideee.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Data structures and algorithms lab8 Data structures and algorithms lab8 Presentation Transcript

  • 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.