1package aud.example.graph;
11 assert(!Double.isInfinite(node.
d));
15 @Override
public String
name() {
return "PFS (Prim MST)"; }
edge with all possible attributes that we require ;-)
graph based on aud.graph.GraphAM
node with all possible attributes that we require ;-)
double d
distance to start node (sum of weighs or edge count if no weights defined)
implements Prim's algorithm by defining priority
String name()
get traversal name
double priority(MyNode node, MyEdge e)
Compute priority of a node:
PrimMinimumSpanningTree(MyGraph g)
Priority first search implementation.
boolean hasWeight()
determine if edge weight is defined
double getWeight()
set edge weight