1package aud.example.graph;
31 @Override
public String
name() {
return "iterative DFS (decently cheating)"; }
46 System.out.println(
"open="+open.
toString());
55 System.err.println(e);
64 t.
d=s.
d+(e.hasWeight() ? e.getWeight() : 1.0);
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 Traversal like DepthFirstSearch but as for IterativeDFS1 the order of...
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
Vector< Edge > getOutEdges(Node node)
AuD lecture: Data structures, algorithms, examples.