LN7 - Lecture Note 7 The SCC Algorithm : A shorter Proof...

This preview shows pages 1–2. Sign up to view the full content.

COSC3101 The SCC Algorithm : A shorter Proof The subject is the Strongly Connected Components algorithm of Kosaraju and Sharir [1978] that appears in section 22.5 of [CLRS], and its proof of correctness. Fo rthe sakeo fcompleteness, we repeat the algorithm below(slightly rephrased). STRONGLY-CONNECTED-COMPONENTS ( G ) 1. initialize stack S to empty ,and call DFS(G) with the following modi±cation: push vertices onto stack S in the order they±nish their DFS-VISIT calls. That is, at the end of the procedure DFS-VISIT( u )add the statement PUSH ( u , S )(there is no need to compute d [ u ]and f [ u ]values explicitly). 2. construct the adjacency-list structure of G T from that of G . 3. call DFS( G T )with the following modi±cation: initiate DFS-roots in stack-S-order ,ie, in the main DFS algorithm instead of ‘‘ for each u V [ G T ] do if color [ u ]= white then DFS-VISIT( u )’’ perform the following: while S ≠∅ do u POP ( S ) if color [ u ]= white then DFS-VISIT( u ) end {

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/17/2010 for the course CSE 3101 taught by Professor Andy during the Winter '10 term at York University.

Page1 / 4

LN7 - Lecture Note 7 The SCC Algorithm : A shorter Proof...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online