NodeNameType - The type used to specify nodespublic interface DirectedWeightedNodeEdgeGraph<NodeNameType> extends DirectedNodeEdgeGraph<NodeNameType>
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(NodeNameType left,
NodeNameType right)
Adds a directed edge from left to right.
|
void |
addEdge(NodeNameType left,
NodeNameType right,
double weight)
Adds a directed edge from left to right with the input weight.
|
double |
getEdgeWeight(int id)
This returns the weight of edge id (where id is [0 ...
|
java.util.Collection<Pair<NodeNameType,java.lang.Double>> |
getSuccessorsWithWeights(NodeNameType node)
Returns all the nodes this node connects to with edge weights (outgoing
edges only).
|
addNode, clear, containsNode, getEdgeEndpointIds, getNode, getNodeId, getNodes, getNumEdges, getNumNodes, getSuccessorsvoid addEdge(NodeNameType left, NodeNameType right)
addEdge in interface DirectedNodeEdgeGraph<NodeNameType>left - The source of the edgeright - The destination of the edgevoid addEdge(NodeNameType left, NodeNameType right, double weight)
left - The source of the edgeright - The destination of the edgeweight - The weight to assign this edgejava.util.Collection<Pair<NodeNameType,java.lang.Double>> getSuccessorsWithWeights(NodeNameType node)
node - The node whose successors and weights are wanteddouble getEdgeWeight(int id)
id - The id of the edge whose weight is desired