Class TLcdShortestRouteAlgorithm
java.lang.Object
com.luciad.network.algorithm.routing.TLcdShortestRouteAlgorithm
- All Implemented Interfaces:
ILcdShortestRouteAlgorithm
Implementation of a shortest route algorithm. The algorithm is based on the
well-known Dijkstra algorithm, but is adapted to work with complex edge
value functions.
- Since:
- 5.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<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 anILcdRoutedescribing the shortest route betweenaPrecedingRouteandaSucceedingRoute.
-
Constructor Details
-
TLcdShortestRouteAlgorithm
public TLcdShortestRouteAlgorithm()Constructs a newTLcdShortestRouteAlgorithm.
-
-
Method Details
-
getShortestRoute
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) Description copied from interface:ILcdShortestRouteAlgorithmReturns anILcdRoutedescribing the shortest route betweenaPrecedingRouteandaSucceedingRoute.- Specified by:
getShortestRoutein interfaceILcdShortestRouteAlgorithm- Parameters:
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 lastnedges of this route will have an influence on the result, wherenis equal to the order of the givenILcdEdgeValueFunction.aSucceedingRoute- the route succeeding the shortest route, i.e. where the last edge of the shortest route should connect to. Only the firstnedges of this route will have an influence on the result, wherenis equal to the order of the givenILcdEdgeValueFunction.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 benull.- Returns:
- The shortest route between the two given routes, or
nullif no such route is found.
-