public class TLcdShortestRouteAlgorithm extends Object implements ILcdShortestRouteAlgorithm
Constructor and Description |
---|
TLcdShortestRouteAlgorithm()
Constructs a new
TLcdShortestRouteAlgorithm . |
Modifier and Type | Method and Description |
---|---|
<N,E> ILcdRoute<N,E> |
getShortestRoute(ILcdGraph<N,E> aGraph,
ILcdRoute<N,E> aPrecedingRoute,
ILcdRoute<N,E> aSucceedingRoute,
ILcdEdgeValueFunction<N,E> aEdgeValueFunction,
ILcdDistanceFunction<N,E> aDistanceFunction)
Returns an
ILcdRoute describing the shortest route between
aPrecedingRoute and aSucceedingRoute . |
public TLcdShortestRouteAlgorithm()
TLcdShortestRouteAlgorithm
.public <N,E> ILcdRoute<N,E> getShortestRoute(ILcdGraph<N,E> aGraph, ILcdRoute<N,E> aPrecedingRoute, ILcdRoute<N,E> aSucceedingRoute, ILcdEdgeValueFunction<N,E> aEdgeValueFunction, ILcdDistanceFunction<N,E> aDistanceFunction)
ILcdShortestRouteAlgorithm
ILcdRoute
describing the shortest route between
aPrecedingRoute
and aSucceedingRoute
.getShortestRoute
in interface ILcdShortestRouteAlgorithm
aGraph
- the graph for which the route is to be calculated.aPrecedingRoute
- the route preceding the shortest route, i.e. where the first
edge of the shortest route should connect to. Only the last
n
edges of this route will have an influence on
the result, where n
is equal to the order of the
given ILcdEdgeValueFunction
.aSucceedingRoute
- the route succeeding the shortest route, i.e. where the last
edge of the shortest route should connect to. Only the first
n
edges of this route will have an influence on
the result, where n
is equal to the order of the
given ILcdEdgeValueFunction
.aEdgeValueFunction
- a function that associates a cost with each edgeaDistanceFunction
- a distance function, indicating the estimate cost to travel
from one node to another. This function can be used to
accelerate the search process. Note that this estimate
should always be an underestimate of the real remaining
distance, in order to result in an optimal solution. A
heuristic function, although it can greatly increase the performance
is not required for the algorithm to
work - it may be null
.null
if no such route is found.