Tracing An Algorithm for Strongly Connected Components that uses Depth First Search Graph obtained from Text, page 273 252a-al: Geetika Tewari.

Slides:



Advertisements
Similar presentations
Minimum Spanning Tree Sarah Brubaker Tuesday 4/22/8.
Advertisements

Breadth-First Search Seminar – Networking Algorithms CS and EE Dept. Lulea University of Technology 27 Jan Mohammad Reza Akhavan.
TECH Computer Science Graphs and Graph Traversals  // From Tree to Graph  // Many programs can be cast as problems on graph Definitions and Representations.
Graphs Chapter 30 Carrano, Data Structures and Abstractions with Java, Second Edition, (c) 2007 Pearson Education, Inc. All rights reserved X.
Graphs Graphs are the most general data structures we will study in this course. A graph is a more general version of connected nodes than the tree. Both.
Graphs CS-240/341. Graphs Used for representing many-to-many relationships –can take two forms directed (digraph) - a finite set of elements called vertices.
Graph Traversals Reading Material: Chapter 9. Graph Traversals Some applications require visiting every vertex in the graph exactly once. The application.
Testing for Connectedness and Cycles
CSE 780 Algorithms Advanced Algorithms Graph Alg. DFS Topological sort.
Spring 2010CS 2251 Graphs Chapter 10. Spring 2010CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs.
Breadth First Search (BFS) Part 2 COMP171. Graph / Slide 2 Shortest Path Recording * BFS we saw only tells us whether a path exists from source s, to.
Fall 2007CS 2251 Graphs Chapter 12. Fall 2007CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs To.
CS 206 Introduction to Computer Science II 03 / 30 / 2009 Instructor: Michael Eckmann.
Graphs Chapter 28 Copyright ©2012 by Pearson Education, Inc. All rights reserved.
Trees and Tree Traversals Prof. Sin-Min Lee Department of Computer Science San Jose State University.
ساختمانهای گسسته دانشگاه صنعتی شاهرود – اردیبهشت 1392.
Chapter 2 Graph Algorithms.
Module 5 – Networks and Decision Mathematics Chapter 23 – Undirected Graphs.
Algorithm for obtaining the connected components of a graph Samia Qader 252a-az HW # 6 all examples obtained from LEDA software in directory: 252a/handout/demo/graphwin/graphwin.
Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.
Homework #5 Due: October 31, 2000 Christine Kang Graph Concepts and Algorithms.
Strongly Connected Components for Directed Graphs Kelley Louie Credits: graphs by /demo/graphwin/graphwin.
Graph Concepts and Algorithms Using LEDA By Caroline Moore and Carmen Frerichs (252a-at and 252a-ao) each graph in the presentation was created using gw_basic_graph_algorithms.
Graph Concepts Illustrated Using The Leda Library Amanuel Lemma CS252 Algorithms.
CSC 252: Algorithms October 28, 2000 Homework #5: Graphs Victoria Manfredi (252a-ad) notes: -Definitions for each of the graph concepts are those presented.
Hw. 6: Algorithm for finding strongly connected components. Original digraph as drawn in our book and in class: Preorder label : Postorder label Nodes:
Graph Terms By Susan Ott. Vertices Here are 7 vertices without any edges Each Vertex is labeled a different color and number.
CSC 213 – Large Scale Programming Lecture 31: Graph Traversals.
Code: BCA302 Data Structures with C Prof. (Dr.) Monalisa Banerjee By.
Representing Graphs Depth First Search Breadth First Search Graph Searching Algorithms.
Graph Search Applications, Minimum Spanning Tree
Breadth-First Search (BFS)
Depth First Search Neil Tang 4/1/2010
Undirected versus Directed Graphs
Main algorithm with recursion: We’ll have a function DFS that initializes, and then calls DFS-Visit, which is a recursive function and does the depth first.
Chapter 3. Decompositions of Graphs
CSC 172 DATA STRUCTURES.
Minimum Spanning Tree Chapter 13.6.
Lecture 12 Graph Algorithms
CS120 Graphs.
Graph Algorithms Using Depth First Search
Spanning Trees Longin Jan Latecki Temple University based on slides by
CSC 172 DATA STRUCTURES.
Spanning Trees Discrete Mathematics.
CSC 172 DATA STRUCTURES.
Graphs Graph transversals.
Graph Algorithms – 2 DAGs Topological order
Connected Components Minimum Spanning Tree
Advanced Algorithms Analysis and Design
Advanced Algorithms Analysis and Design
Graph Algorithms What is a graph? V - vertices E µ V x V - edges
Graphs Part 2 Adjacency Matrix
Depth-First Search Graph Traversals Depth-First Search DFS.
Spanning Trees Longin Jan Latecki Temple University based on slides by
Graphs Examples on some basic graph concepts and definitions All graphics are taken from the LEDA demos: basic_graph_algorithms, gw_shortest_paths, graphwin.
Depth-First Search D B A C E Depth-First Search Depth-First Search
Algorithms Lecture # 30 Dr. Sohail Aslam.
Depth First Search Neil Tang 4/10/2008
Depth-First Search CSE 2011 Winter April 2019.
Breadth-First Search L0 L1 L2 C B A E D F Breadth-First Search
Depth-First Search CSE 2011 Winter April 2019.
GRAPHS G=<V,E> Adjacent vertices Undirected graph
Chapter 16 1 – Graphs Graph Categories Strong Components
Spanning Trees Longin Jan Latecki Temple University based on slides by
Chapter 14 Graphs © 2011 Pearson Addison-Wesley. All rights reserved.
Applications of BFS CSE 2011 Winter /17/2019 7:03 AM.
Podcast Ch24b Title: Strongly Connected Components
Algorithms CSCI 235, Spring 2019 Lecture 33 Graphs II
Lecture 11 Graph Algorithms
Graph Traversals Some applications require visiting every vertex in the graph exactly once. The application may require that vertices be visited in some.
Presentation transcript:

Tracing An Algorithm for Strongly Connected Components that uses Depth First Search Graph obtained from Text, page 273 252a-al: Geetika Tewari

Initial Graph: Directed, multiple edges

DFS started: All vertices are labeled sequentially in postorder Above, finished visiting vertex 1 first

Finished visiting vertex 2

Finished visiting vertex 3

Finished visiting vertex 4

Finished visiting vertex 5 Finished visiting vertex 5. Now have to pick a new vertex to start DFS from.

Started DFS at a new vertex. Now finished visiting vertex 6

Finished visiting vertex 7

Finished visiting vertex 8

Finished visiting vertex 9

Finished visiting vertex 10. Notice: Entire graph has been visited and all nodes are labeled in post order

Inverse Digraph: all directed edges have been reversed

Start DFS in the reverse graph, starting at the highest numbered vertex. Above: DFS started at vertex 10. Could only visit 2 other nodes. Have to choose the next highest numbered vertex

Next started DFS at vertex labeled 7. Could only visit one other vertex. Have to resume DFS on the next highest numbered vertex.

Resumed DFS on vertex 5. Could visit 3 other vertices

Resumed DFS on vertex 1. Finished traversing the entire graph.

The result is a forest. In this case, a forest of 4 trees, each is a strongly connected component of the original graph. Strongly connected means every two vertices are reachable from each other. Strongly connected components only exist in the context of directed graphs. 1 3 A Forest 2 4