|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jgrapht.alg.FloydWarshallShortestPaths<V,E>
public class FloydWarshallShortestPaths<V,E>
The Floyd-Warshall algorithm finds all shortest paths (all n^2 of them) in O(n^3) time. This also works out the graph diameter during the process.
| Constructor Summary | |
|---|---|
FloydWarshallShortestPaths(Graph<V,E> graph)
|
|
| Method Summary | |
|---|---|
double |
getDiameter()
|
Graph<V,E> |
getGraph()
|
GraphPath<V,E> |
getShortestPath(V a,
V b)
Get the shortest path between two vertices. |
java.util.List<GraphPath<V,E>> |
getShortestPaths(V v)
Get shortest paths from a vertex to all other vertices in the graph. |
int |
getShortestPathsCount()
|
double |
shortestDistance(V a,
V b)
Get the length of a shortest path. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FloydWarshallShortestPaths(Graph<V,E> graph)
| Method Detail |
|---|
public Graph<V,E> getGraph()
public int getShortestPathsCount()
public double shortestDistance(V a,
V b)
a - first vertexb - second vertex
public double getDiameter()
public GraphPath<V,E> getShortestPath(V a,
V b)
a - From verticeb - To vertice
public java.util.List<GraphPath<V,E>> getShortestPaths(V v)
v - the originating vertex
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||