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.
Namespace: Algs4Net
public class DepthFirstDirectedPaths
The DepthFirstDirectedPaths type exposes the following members.
Name | Description | |
---|---|---|
![]() | DepthFirstDirectedPaths |
Computes a directed path from s to every other vertex in digraph G. |
Name | Description | |
---|---|---|
![]() | HasPathTo |
Is there a directed path from the source vertex s to vertex v? |
![]() ![]() | MainTest |
Demo test the DepthFirstDirectedPaths data type. |
![]() | PathTo |
Returns a directed path from the source vertex s to vertex v, or
null if no such path. |
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.