N
- node classE
- edge class@ParametersAreNonnullByDefault public class FloydWarshallAPSP<N,E> extends Object implements APSPResult<N,E>
Constructor and Description |
---|
FloydWarshallAPSP(Graph<N,E> graph,
EdgeWeights<E> ew) |
Modifier and Type | Method and Description |
---|---|
void |
findAPSP() |
static <N,E> APSPResult<N,E> |
findAPSP(Graph<N,E> graph,
EdgeWeights<E> edgeWeights) |
List<E> |
getShortestPath(N src,
N tgt)
Retrieves the shortest path between the given nodes, or
null if there exists no such path. |
float |
getShortestPathDistance(N src,
N tgt)
Retrieves the length of the shortest path between the given nodes.
|
public FloydWarshallAPSP(Graph<N,E> graph, EdgeWeights<E> ew)
@Nonnull public static <N,E> APSPResult<N,E> findAPSP(Graph<N,E> graph, EdgeWeights<E> edgeWeights)
public void findAPSP()
public float getShortestPathDistance(N src, N tgt)
APSPResult
getShortestPathDistance
in interface APSPResult<N,E>
src
- the source nodetgt
- the target nodesrc
to tgt
, or Graphs.INVALID_DISTANCE
if there exists no such path.public List<E> getShortestPath(N src, N tgt)
APSPResult
null
if there exists no such path.getShortestPath
in interface APSPResult<N,E>
src
- the source nodetgt
- the target nodesrc
to tgt
, or null
if there exists no such path.Copyright © 2018. All rights reserved.