Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::kosaraju_detail Namespace Reference

Depth-first search that computes finish times in postorder (Phase 1). More...

Classes

struct  Frame
 A node that waits for the one that it visits, and the next of its outgoing arcs to look at. More...
 

Functions

template<class GT , class Enter , class Leave >
void search (const GT &g, typename GT::Node *p, Enter enter, Leave leave)
 

Detailed Description

Depth-first search that computes finish times in postorder (Phase 1).

Performs a DFS traversal starting from node p, marking visited nodes and arcs with the Depth_First bit. Nodes are appended to the df array in postorder (after all descendants have been visited).

This is the first phase of Kosaraju's algorithm.

Template Parameters
GTGraph type.
Parameters
[in]gThe directed graph.
[in]pStarting node for the DFS.
[out]dfArray where nodes are stored in postorder (finish time order).

Function Documentation

◆ search()