0% found this document useful (0 votes)
36 views

Graph Primitives: An O (M+N) Algorithm For Computing Strong Components

The document discusses algorithms for computing strongly connected components in a graph, including Kosaraju's two-pass algorithm and DFS-Loop subroutine. It provides pseudocode for the algorithms and walks through an example application of Kosaraju's algorithm on a sample graph, identifying the possible finishing times that could result from running DFS-Loop on the graph.

Uploaded by

navediitr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Graph Primitives: An O (M+N) Algorithm For Computing Strong Components

The document discusses algorithms for computing strongly connected components in a graph, including Kosaraju's two-pass algorithm and DFS-Loop subroutine. It provides pseudocode for the algorithms and walks through an example application of Kosaraju's algorithm on a sample graph, identifying the possible finishing times that could result from running DFS-Loop on the graph.

Uploaded by

navediitr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Graph

Primitives
Design and
Analysis of
Algorithms I

An O(m+n)
Algorithm for
Computing Strong
Components

Strongly Connected
Components

Tim Roughgarden

Why Depth-First Search?

Tim Roughgarden

Kosarajus Two-Pass
Algorithm

Tim Roughgarden

DFS-Loop

Tim Roughgarden

Only one of the following is a possible set of finishing


times for the nodes 1,2,3,,9, respectively, when
the DFS-Loop subroutine is executed on the graph
below. Which is it?
9,8,7,6,5,4,3,2,1
1,7,4,9,6,3,8,2,5

7,3,1,8,2,5,9,4,6

Example (2nd Pass)

Tim Roughgarden

You might also like