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 |
clone, equals, finalize, 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)
- Calling this will not reset the marks.
- Parameters:
vertex
- 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.
doSearch
public boolean doSearch(VertexType vertex,
PreWorkPostWorkHandler<VertexType> handler,
boolean resetMarks)
throws InvalidVertexException,
InvalidGraphException
- 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:
vertex
- 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.resetMarks
- If the search should reset vertex visit marks.
- Returns:
- Whether the traversal has stopped at the middle by the handler.
- Throws:
InvalidVertexException
InvalidGraphException
doAlgorithm
public void doAlgorithm()
- Specified by:
doAlgorithm
in interface AutomatedAlgorithm