public interface WeightedGraph extends Graph
| Modifier and Type | Method and Description |
|---|---|
WeightedEdge |
addEdge(Vertex v1,
Vertex v2,
double weight)
Convenience method to add a WeightedEdge with a specified weight
into the WeightedGraph.
|
Vertex |
getClosest(Vertex v)
Determines the Vertex that is 'closest' to the Vertex specified.
|
WeightedGraph |
minimumSpanningTree()
Determine a minimum spanning tree for the weighted graph.
|
WeightedGraph |
shortestPath(Vertex vertex)
Determine a shortest path spanning tree for the weighted graph.
|
add, addEdge, addEdge, addGraphAddEdgeListener, addGraphAddVertexListener, addGraphRemoveEdgeListener, addGraphRemoveVertexListener, addListener, cloneVertices, getAdjacentVertices, getAdjacentVertices, getConnectedSet, getConnectedSet, getDegree, getDegree, getEdges, getEdgesCount, getEdgeSet, getGraphFactory, getTraversal, getVertexSet, getVertices, getVerticesCount, getVerticesIterator, isConnected, remove, removeEdge, removeEdges, removeGraphAddEdgeListener, removeGraphAddVertexListener, removeGraphRemoveEdgeListener, removeGraphRemoveVertexListener, removeListener, setGraphFactory, setTraversal, traverseWeightedEdge addEdge(Vertex v1, Vertex v2, double weight) throws Exception
ExceptionVertex getClosest(Vertex v)
WeightedGraph minimumSpanningTree()
WeightedGraph shortestPath(Vertex vertex)
Also note that the graph returned by this method is a new instance of WeightedGraph. However, its vertices and edges will be the same instance as those of this WeightedGraph. Therefore, do not modify the contents of the returned WeightedGraph such that any of its vertices or edges are removed.
vertex - The Vertex in the weighted graph that we want to get
the shortest paths to all other vertices.Copyright © 2019 JULIE Lab, Germany. All rights reserved.