public class DepthFirstSearch<V extends Vertex,E extends Edge<V>> extends AbstractGraphPathSearch<V,E>
| Modifier and Type | Class and Description |
|---|---|
static class |
DepthFirstSearch.EdgeType
Graph edge types as classified by the DFS algorithm.
|
class |
DepthFirstSearch.SpanningTreeResult
Graph search result which includes edge classification for building
a spanning tree.
|
AbstractGraphPathSearch.DefaultResultGraphPathSearch.Result<V extends Vertex,E extends Edge<V>>ALL_PATHS| Constructor and Description |
|---|
DepthFirstSearch() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
isForwardEdge(AbstractGraphPathSearch.DefaultResult result,
E edge)
Determines whether the specified edge is a forward edge using the
accumulated set of parent edges for each vertex.
|
DepthFirstSearch.SpanningTreeResult |
search(Graph<V,E> graph,
V src,
V dst,
EdgeWeight<V,E> weight,
int maxPaths)
Searches the specified graph for paths between vertices.
|
checkArguments, samenessThreshold, setSamenessThresholdpublic DepthFirstSearch.SpanningTreeResult search(Graph<V,E> graph, V src, V dst, EdgeWeight<V,E> weight, int maxPaths)
GraphPathSearchgraph - graph to be searchedsrc - optional source vertexdst - optional destination vertex; if null paths to all vertex
destinations will be searchedweight - optional edge-weight; if null cost of each edge will be
assumed to be 1.0maxPaths - limit on number of paths; GraphPathSearch.ALL_PATHS if no limitprotected boolean isForwardEdge(AbstractGraphPathSearch.DefaultResult result, E edge)
result - search resultedge - edge to be classified