# csdf/base/algo/dfs.h File Reference

`#include "base/base.h"`

`#include "../../csdf.h"`

## Functions | |

void | dfs (CSDFgraph *g, v_int &d, v_int &f, CSDFactor **pi, bool transpose=false) |

## Function Documentation

dfs () The function performs a depth first search on the graph. The discover time (d), finish time (f) and predecessor tree (pi) are passed back. The graph is transposed if the argument 'transpose' is 'true'. Vertices are considered in decreasing order of f[u].

Note: enough memory space must be allocated for the d, f, and pi vectors by the calling function.

dfs () The function performs a depth first search on the graph. The discover time (d), finish time (f) and predecessor tree (pi) are passed back. The graph is transposed if the argument 't' is 'true'. Vertices are considered in decreasing order of f[u].

The function derives an 'order' vector from the vector 'f'. Actors are considered in decreasing order according to this vector. When an actor is visited, its order is set to -1. At the end, all actors must have order -1 (i.e. all actors are visited).

References a, color, dfsVisit(), CSDFgraph::getActors(), getNextActor(), and CSDFgraph::nrActors().

Referenced by stronglyConnectedComponents().