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

`#include "base/base.h"`

`#include "../untimed/graph.h"`

## Functions | |

void | dfs (SDFgraph *g, v_int &d, v_int &f, SDFactor **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(), SDFgraph::getActors(), getNextActor(), and SDFgraph::nrActors().