1package aud.example.graph;
21 public double d = Double.POSITIVE_INFINITY;
24 public double f = Double.POSITIVE_INFINITY;
29 String fAsString(String prefix) {
30 if (Double.isInfinite(
f))
return "";
31 else return prefix+((int)
f*10);
35 return super.toString()+
36 " [p="+(
p!=
null?
p.
getLabel():
"null")+
", d="+
d+fAsString(
", ")+
"]";
node with all possible attributes that we require ;-)
MyNode create()
Create new node instance.
double f
priority for A*-algorithm
MyNode p
node from which node was reached (defines spanning tree)
String color
color as string
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)
String getLabel()
get text description
Graph data structures and algorithms.
AuD lecture: Data structures, algorithms, examples.