1package aud.example.graph;
23 @Override
public String
name() {
return "iterative DFS (close to DFS)"; };
38 System.out.println(
"open="+open.
toString());
59 System.err.println(e);
Implementation of a stack based on aud.Vector.
void push(T x)
Push x onto stack.
boolean is_empty()
Is stack empty?
T pop()
Pop element from stack.
String toString()
Get string representation "|a|b|c".
Iterative implementation of DFS.
void start(MyNode s0)
start traversal at node s0
String name()
get traversal name
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
boolean hasWeight()
determine if edge weight is defined
Vector< Edge > getOutEdges(Node node)
Edge getEdge(Node source, Node destination)
double getWeight()
set edge weight
AuD lecture: Data structures, algorithms, examples.