public class DepthFirstSearch extends AbstractGraphPathSearch
Modifier and Type | Class and Description |
---|---|
static class |
DepthFirstSearch.EdgeType
Classification of edges.
|
class |
DepthFirstSearch.SpanningTreeResult
Graph search result which includes edge classification for building
a spanning tree.
|
AbstractGraphPathSearch.DefaultResult
GraphPathSearch.Result
E_GRAPH_NULL, E_NOT_IN_GRAPH, E_SRC_NULL
Constructor and Description |
---|
DepthFirstSearch() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
isForwardEdge(AbstractGraphPathSearch.DefaultResult gsr,
Edge e)
Determines whether the specified edge is a forward edge using the
currently accrued set of vertex parent edges.
|
GraphPathSearch.Result |
search(Graph g,
Vertex src,
Vertex dst,
EdgeWeight ew)
Search the graph producing a set of paths.
|
buildPaths, validate
public GraphPathSearch.Result search(Graph g, Vertex src, Vertex dst, EdgeWeight ew)
GraphPathSearch
g
- graph to be searchedsrc
- source node; implementations may leave this as optionaldst
- destination node; implementations may leave this as optionalew
- optional edge weight functionprotected boolean isForwardEdge(AbstractGraphPathSearch.DefaultResult gsr, Edge e)
gsr
- search resulte
- edge to be classifiedCopyright © 2015. All Rights Reserved.