1 / 21

Graph Concepts Illustrated Using The Leda Library

Graph Concepts Illustrated Using The Leda Library. Amanuel Lemma CS252 Algorithms. Vertices and Edges. Vertices or nodes store information and each edge connects a pair of vertices. Drawn from: ../../handout/demo/graphwin/gw. Multiple Edges and Loops.

Download Presentation

Graph Concepts Illustrated Using The Leda Library

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Graph ConceptsIllustrated 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( K5) and a bipartite graph • Drawn from : ../../handout/demo/graphwin/gw

  9. Path in undirected graph • A sequence of vertices (v1,v2,…,vn) where there is an edge b/n vi and vi+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 vi and vi+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 (v0 = vn) • 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 (v0 = vn) • 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

More Related