annas.graph.util.traversal
Class DepthFirst<N,A extends ArcInterface<N>>
java.lang.Object
annas.graph.util.traversal.DepthFirst<N,A>
- Type Parameters:
N
- Node typeA
- Arc type
public class DepthFirst<N,A extends ArcInterface<N>>
- extends java.lang.Object
Performs a depth first traversal
- Author:
- Sam Wilson
Method Summary |
GraphInterface<N,A> |
getG()
|
java.util.Iterator<N> |
run(N s)
Performs a Depth first traversal on the graph from the source node |
java.util.Iterator<N> |
run(N s,
N tar)
Performs a Depth first traversal on the graph from the source node to the
destination node |
void |
setG(GraphInterface<N,A> g)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DepthFirst
public DepthFirst()
DepthFirst
public DepthFirst(GraphInterface<N,A> g)
run
public java.util.Iterator<N> run(N s)
- Performs a Depth first traversal on the graph from the source node
- Parameters:
s
- Source node
- Returns:
- Iterator of the traversal
run
public java.util.Iterator<N> run(N s,
N tar)
- Performs a Depth first traversal on the graph from the source node to the
destination node
- Parameters:
s
- Source nodetar
- destination node
- Returns:
- Iterator of the traversal
getG
public GraphInterface<N,A> getG()
setG
public void setG(GraphInterface<N,A> g)