Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSC 252: Algorithms October 28, 2000 Homework #5: Graphs Victoria Manfredi (252a-ad) notes: -Definitions for each of the graph concepts are those presented.

Similar presentations


Presentation on theme: "CSC 252: Algorithms October 28, 2000 Homework #5: Graphs Victoria Manfredi (252a-ad) notes: -Definitions for each of the graph concepts are those presented."— Presentation transcript:

1 CSC 252: Algorithms October 28, 2000 Homework #5: Graphs Victoria Manfredi (252a-ad) notes: -Definitions for each of the graph concepts are those presented in class. -LEDA was used to draw the graphs and SnagIt was used to obtain the gifs.

2 Vertices and Edges. Vertices are the blue circles, edges are the lines connecting the vertices. Credit: demo/graph_alg/gw_basic_graph_algorithms

3 Multiple Edges and Loops. Multiple edges are more than one edge between two vertices. Loops are edges starting and ending at the same vertex. Credit: demo/graph_alg/gw_basic_graph_algorithms

4 Undirected Graph. Edges between vertices are not directed (do not have arrows). Credit: demo/graph_alg/gw_scc

5 Directed Graph. Edges between vertices are directed (do have arrows). Credit: demo/graph_alg/gw_scc

6 Simple Graph. A simple graph has no loops and no multiple edges. Credit: demo/graph_alg/gw_scc

7 An example of a graph. Credit: demo/graphwin/graphwin

8 Another example of a graph. Credit: demo/graphwin/graphwin

9 An example of a multigraph. A multigraph has some vertices such that more more than one edge connects the same two vertices. Credit: demo/graphwin/graphwin

10 Another example of a multigraph. A multigraph has some vertices such that more than one edge connects the same two vertices. Credit: demo/graphwin/graphwin

11 Complete Graph. A graph which has an edge between every vertex and every other vertex. Credit: demo/graph_alg/gw_scc

12 Bipartite Graph. A graph which can have its vertices divided into two classes and there are no edges between vertices in the same class. Credit: demo/graph_alg/gw_scc

13 Path in an undirected graph. There is a path from a vertice x to a vertice y in an undirected graph if it is possible to get from x to y by traversing edges and vertices. For example, in this graph there is a path from vertex 1 to vertex 5. Credit: demo/graphwin/graphwin

14 Path in a directed graph. There is a path from a vertex x to a vertex y in a directed graph if it is possible to get from x to y by traversing vertices and directed edges. To go from a vertex i to a vertex j joined by a directed edge, the arrow on the edge must point from i to j. For example, in this graph there is no path from vertex 1 to vertex 5 but there is a path from vertex 2 to vertex 5. Credit: demo/graphwin/graphwin

15 Hamilton path in an undirected graph. A Hamilton path is a path that goes through every vertex of the graph. There is a Hamilton path in this graph from vertex 0 to vertex 4. Credit: demo/graphwin/graphwin

16 Hamilton path in a directed graph. A Hamilton path is a path that goes through every vertex of the graph. In a directed graph, the Hamilton path must also go through every vertex on edges pointing in the proper direction. There is a Hamilton path starting at vertex 0 and ending at vertex 4 in this graph. Credit: demo/graphwin/graphwin

17 Cycle in an undirected graph. A cycle occurs when it is possible to start at a vertex and return to that vertex by traversing edges, with each edge being traversed exactly once. There is a cycle in this graph starting at vertex 0, going through vertices 1, 2, 3, and 6, and then returning to 0. Credit: demo/graphwin/graphwin

18 Cycle in a directed graph. A cycle occurs when it is possible to start at a vertex and return to that vertex by traversing edges pointing in the proper direction, with each edge being traversed exactly once. There is a cycle in this graph starting at vertex 0, going through vertices 1, 2, 3, and 6, and then returning to 0. Credit: demo/graphwin/graphwin

19 Hamilton cycle in an undirected graph. A Hamilton cycle occurs when it is possible to start at a vertex and cover all of the other vertices in the graph, finally returning to the original vertex. In this graph there is a Hamilton cycle starting at vertex 0 and going through vertices 1, 2, 3, 4, 5, and 6, and then returning to vertex 0. Credit: demo/graphwin/graphwin

20 Hamilton cycle in a directed graph. A Hamilton cycle in a directed graph occurs when it is possible to start at a vertex and cover all of the other vertices in the graph, traversing edges pointing in the proper direction, and finally returning to the original vertex. In this digraph there is a Hamilton cycle starting at vertex 0 and going through vertices 1, 2, 3, 4, 5, and 6, and then returning to vertex 0. Credit: demo/graphwin/graphwin

21 Cyclic graph. A graph with cycles is cyclic. In this graph there is a cycle formed the edges connecting vertices 3, 4, 5, and 6. Credit: demo/graphwin/graphwin

22 Acyclic graph. A graph with no cycles is acyclic. There is no cycle in this graph. Credit: demo/graphwin/graphwin

23 The decomposition of a digraph into strongly connected components. Strongly connected components of a digraph are those subgraphs in which there is a directed path between any pair of vertices in each subgraph and it is not possible to add any vertices from outside the subgraph while still maintaining this property. The strongly connected components are those vertices that are the same color and have same number along with their corresponding edges. Credit: demo/graph_alg/gw_scc

24 An undirected tree. An undirected tree is a connected graph with no cycles that contains n-1 edges where n is the number of vertices. Credit: demo/graphwin/graphwin

25 Forest. A forest is a graph composed only of unconnected trees. Credit: demo/graphwin/graphwin


Download ppt "CSC 252: Algorithms October 28, 2000 Homework #5: Graphs Victoria Manfredi (252a-ad) notes: -Definitions for each of the graph concepts are those presented."

Similar presentations


Ads by Google