1package aud.example.graph;
12 @Override
public String
name() {
return "BFS"; };
28 System.out.println(
"open="+open.
toString());
37 System.err.println(e);
46 t.
d=s.
d+(e.hasWeight() ? e.getWeight() : 1.0);
Implementation of AbstractQueue as a (dynamically resized) circular buffer based on array.
void enqueue(T x)
Enqueue element at end of queue.
boolean is_empty()
Is queue empty?
String toString()
Get string representation.
T dequeue()
Remove front element from queue.
void start(MyNode s0)
start traversal at node s0
String name()
get traversal name
BreadthFirstSearch(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)
AuD lecture: Data structures, algorithms, examples.