edu.berkeley.guir.lib.graphs
Class SearchDepthFirst
java.lang.Object
|
+--edu.berkeley.guir.lib.graphs.SearchDepthFirst
- All Implemented Interfaces:
- GraphConst, GraphSearch, Serializable
- public class SearchDepthFirst
- extends Object
- implements GraphConst, GraphSearch, Serializable
A depth first search for Graph.
This software is distributed under the
Berkeley Software License.
Revisions: - GUIRLib-v1.0-1.0.0, Dec 20 1997, JH
Created class
- GUIRLib-v1.0-1.1.0, Feb 24 2000, JH
Updated for JDK1.3RC1 to use the Collections
- GUIRLib-v1.2-1.0.0, Jun 22 2000, JH
Touched for GUIRLib release
- GUIRLib-v1.3-1.0.0, Aug 11 2000, JH
Touched for GUIRLib release
- GUIRLib-v1.4-1.0.0, Aug 31 2000, JH
Touched for GUIRLib release
- Since:
- 1.1.4
- Version:
- GUIRLib-v1.4-1.0.0, Aug 31 2000
- Author:
- Jason Hong (
jasonh@cs.berkeley.edu)
- See Also:
- Serialized Form
Method Summary |
Path |
search(Graph g,
String strFrom,
String strTo)
Perform a depth-first search on the graph, with the specified start
and target nodes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SearchDepthFirst
public SearchDepthFirst()
search
public Path search(Graph g,
String strFrom,
String strTo)
- Perform a depth-first search on the graph, with the specified start
and target nodes.
- Specified by:
search
in interface GraphSearch
- Parameters:
strFrom
- is the name of the starting node.strTo
- is the name of the target node.- Returns:
- Returns the first successful Path found from the start node
to the target node. The Path is empty if no successful Path
is found, or if either the start or target node does not
exist in the Graph.