Book contents
- Frontmatter
- Dedication
- Contents
- List of Algorithms
- Table of Notation
- Foreword
- Preface
- 1 Introduction
- 2 Deliberation with Deterministic Models
- 3 Deliberation with Refinement Methods
- 4 Deliberation with Temporal Models
- 5 Deliberation with Nondeterministic Models
- 6 Deliberation with Probabilistic Models
- 7 Other Deliberation Functions
- 8 Concluding Remarks
- Appendix A Search Algorithms
- Appendix B Strongly Connected Components of a Graph
- Bibliography
- Index
Appendix B - Strongly Connected Components of a Graph
Published online by Cambridge University Press: 05 August 2016
- Frontmatter
- Dedication
- Contents
- List of Algorithms
- Table of Notation
- Foreword
- Preface
- 1 Introduction
- 2 Deliberation with Deterministic Models
- 3 Deliberation with Refinement Methods
- 4 Deliberation with Temporal Models
- 5 Deliberation with Nondeterministic Models
- 6 Deliberation with Probabilistic Models
- 7 Other Deliberation Functions
- 8 Concluding Remarks
- Appendix A Search Algorithms
- Appendix B Strongly Connected Components of a Graph
- Bibliography
- Index
Summary
Let G = (V,E) be a directed graph. A strongly connected component of G is a subset C of V such that every vertex of C is reachable from every other vertex of C. The relation ∼ on vertices can be defined as follows: υ ∼ υ' iff either υ = υ' or υ is reachable from υ' and υ' is reachable from υ. It is an equivalence relation on V. It partitions V into equivalence classes, each being a strongly connected component of G. Furthermore, the set of strongly connected components of G is a directed acyclic graph that has an edge from C to C' when there is a vertex in C' reachable from a vertex in C.
The Tarjan algorithm [560] finds in a single depth-first traversal of G its strongly connected components.Each vertex is visited just once.Hence the traversal organizesG as a spanning forest.Some subtrees of this forest are the strongly connected components of G. During the traversal, the algorithm associates two integers to each new vertex υ it meets:
• index(υ): the order in which υ is met in the traversal, and
• low(υ) = min﹛index(υ') |υ' reachable from υ﹜
It is shown that index(υ)=low(υ) iff υ and all its successors in a traversal subtree are a strongly connected component of G.
This is implemented in Algorithm B.1 as a recursive procedure with a stack mechanism. At the end of a recursion on a vertex υ, if the condition index(υ)=low(υ) holds, then υ and all the vertices above υ in the stack (i.e., those below υ in the depth-first traversal tree) constitute a strongly connected component of G.
With the appropriate initialization (i ← 0, stack ← ∅ and index undefined everywhere), Tarjan(υ) is called once for every υ ∈ V such that index(υ) is undefined. The algorithm run in 0(|V| + |E|). It finds all the strongly connected components of G in the reverse order of the topological sort of the DAG formed by the components, that is, if (C,C') is an edge of this DAG, then C' will be found before C.
- Type
- Chapter
- Information
- Automated Planning and Acting , pp. 318 - 320Publisher: Cambridge University PressPrint publication year: 2016