Click or drag to resize
DepthFirstDirectedPaths Class

The DepthFirstDirectedPaths class represents a data type for finding directed paths from a source vertex S to every other vertex in the digraph.

This implementation uses depth-first search. The constructor takes time proportional to V + E, where V is the number of vertices and E is the number of edges. It uses extra space (not including the graph) proportional to V.

Inheritance Hierarchy
SystemObject
  Algs4NetDepthFirstDirectedPaths

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class DepthFirstDirectedPaths

The DepthFirstDirectedPaths type exposes the following members.

Constructors
  NameDescription
Public methodDepthFirstDirectedPaths
Computes a directed path from s to every other vertex in digraph G.
Top
Methods
  NameDescription
Public methodHasPathTo
Is there a directed path from the source vertex s to vertex v?
Public methodStatic memberMainTest
Demo test the DepthFirstDirectedPaths data type.
Public methodPathTo
Returns a directed path from the source vertex s to vertex v, or null if no such path.
Top
Remarks

For additional documentation, see Section 4.2 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

This class is a C# port from the original Java class DepthFirstDirectedPaths implementation by the respective authors.

See Also