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

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

View Full Document Right Arrow Icon
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 {
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
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 Right Arrow Icon
Ask a homework question - tutors are online