1package aud.example.graph;
21 @Override
public String
name() {
return "recursive DFS"; }
23 private int count_ = 0;
41 System.out.println(
"s="+s);
46 System.err.println(e);
53 t.
d=s.
d+(e.hasWeight() ? e.getWeight() : 1.0);
Standard recursive implementation of depth first search.
String name()
get traversal name
void start(MyNode s0)
start traversal at node s0
DepthFirstSearch(MyGraph g)
edge with all possible attributes that we require ;-)
graph based on aud.graph.GraphAM
node with all possible attributes that we require ;-)
MyNode p
node from which node was reached (defines spanning tree)
double d
distance to start node (sum of weighs or edge count if no weights defined)
int ord
time when node is (first marked/put into front)
interface for traversals of MyGraph
int verbose
set verbosity (extra output if >0)
void initialize()
initialize graph for traversal (reset all attributes), provided for convenience to be called by start
void showMark(MyNode node)
callback to give visual feedback on marking a node
Vector< Edge > getOutEdges(Node node)