graphlab.library.algorithms.traversal
Class DepthFirstSearch<VertexType extends BaseVertex,EdgeType extends BaseEdge<VertexType>>
java.lang.Object
graphlab.library.algorithms.Algorithm
graphlab.library.algorithms.traversal.DepthFirstSearch<VertexType,EdgeType>
- All Implemented Interfaces:
- AlgorithmInterface, AutomatedAlgorithm
- Direct Known Subclasses:
- DFSAnim
public class DepthFirstSearch<VertexType extends BaseVertex,EdgeType extends BaseEdge<VertexType>>
- extends Algorithm
- implements AutomatedAlgorithm
- Author:
- Omid Aladini
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DepthFirstSearch
public DepthFirstSearch(BaseGraph<VertexType,EdgeType> graph)
DepthFirstSearch
public DepthFirstSearch()
doSearch
public boolean doSearch(VertexType vertex,
PreWorkPostWorkHandler<VertexType> handler)
throws InvalidVertexException
- Runs Depth First Search (DFS) algorithm on the graph starting from vertex vertexId.
A reference to a PreWorkPostWorkHandler is supplied that contains implementation
of pre-work and post-work operations that depends on the application of DFS.
- Parameters:
vertexId - Index of the starting vertex of the traversal.handler - A reference to a PreWorkPostWorkHandler that contains implementation
of pre-work and post-work operations that depends on the application of DFS.
- Returns:
- Whether the traversal has stopped at the middle by the handler.
- Throws:
InvalidVertexException
doAlgorithm
public void doAlgorithm()
- Specified by:
doAlgorithm in interface AutomatedAlgorithm