Download presentation
Presentation is loading. Please wait.
Published bySharon Horn Modified over 8 years ago
1
Graph Concepts Illustrated Using The Leda Library Amanuel Lemma CS252 Algorithms
2
Vertices and Edges Vertices or nodes store information and each edge connects a pair of vertices. Drawn from:../../handout/demo/graphwin/gw
3
Multiple Edges and Loops Multiple edges(i.e parallel edges) and loops have the same beginning and end vertices Drawn from :../../handout/demo/graphwin/gw
4
Undirected Graph Def: set of vertices and a set of edges (each is a set of two vertices) Drawn from :../../handout/demo/graphwin/gw
5
Directed Graph(digraph) Def: A set of vertices and a set of edges(each is an ordered pair of vertices) Drawn from :../../handout/demo/graphwin/gw
6
Simple Graph Def : A graph with out loops and multiple edges From left to right: a simple undirected graph and a simple directed graph Drawn from :../../handout/demo/graphwin/gw
7
Examples of Graphs and Multigraphs Multigraph as opposed to a simple graph has multiple edges b/n any two nodes From left to right : a normal graph and a multigraph Drawn from :../../handout/demo/graphwin/gw
8
Special Classes of Graphs : Complete and Bipartite Complete graphs : each vertex has at least one edge going to every other vertex. Bipartite graphs : vertices can be divided into two classes with no edges with in class. From left to right : a complete graph on 5 vertices( K 5 ) and a bipartite graph Drawn from :../../handout/demo/graphwin/gw
9
Path in undirected graph A sequence of vertices (v 1,v 2,…,v n ) where there is an edge b/n v i and v i+1 Drawn from :../../handout/demo/xlman/graphwin
10
Path in a Directed graph A sequence of vertices where there is an out-going edge b/n v i and v i+1 Drawn from :../../handout/demo/graphwin/gw
11
Hamilton Path in an Undirected Graph A path in an undirected graph that spans or visits all the vertices Drawn from :../../handout/demo/xlman/graphwin
12
Hamilton Path in a Directed Graph A path in a directed graph that spans or visits all the vertices Drawn from :../../handout/demo/graphwin/gw
13
Cycle in an Undirected Graph A path in an undirected graph where the start and end vertex is the same (v 0 = v n ) Drawn from :../../handout/demo/graphwin/gw
14
Cycle in a Directed Graph A path in a directed graph where the start and end vertices are the same (v 0 = v n ) Drawn from :../../handout/demo/graphwin/gw
15
Hamilton Cycle in an Undirected Graph A Hamilton path in an undirected graph where the start and end vertices are the same. Drawn from../../handout/demo/graphwin/gw
16
Hamilton cycle in a Directed Graph A Hamilton path in a directed graph where the start and end vertices are the same Drawn from :../../handout/demo/graphwin/gw
17
Cyclic and Acyclic Digraph A digraph containing at least one cycle is a cyclic digraph. A digraph containing no cycles at all is an acyclic digraph. From left to right : an acyclic digraph and a cyclic digraph Drawn from :../../handout/demo/graphwin/gw
18
**A Graph Which is not strongly Connected** There exsist a pair of vertices which have no directed path b/n them. Or A graph which can be decomposed in to two or more strongly connected components Drawn from :../../handout/demo/graphwin/gw
19
More on strongly connected components The program at “../../handout/demo/graph_alg/gw_scc” illustrates strongly connected components(scc) by coloring the nodes and giving the same number.
20
Tree A connected graph with out cycles, loops and multi-edges. Drawn from :../../handout/demo/graphwin/gw
21
Forest A collection of trees(defined earlier). Or A graph with out cycles, loops and multiedges Drawn from :../../handout/demo/graphwin/gw
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.