Package com.graphhopper.routing
Class AlternativeRoute
java.lang.Object
com.graphhopper.routing.AbstractBidirAlgo
com.graphhopper.routing.AbstractNonCHBidirAlgo
com.graphhopper.routing.AStarBidirection
com.graphhopper.routing.AlternativeRoute
- All Implemented Interfaces:
EdgeToEdgeRoutingAlgorithm,RoutingAlgorithm
This class implements the alternative paths search using the "plateau" and partially the
"penalty" method described in the following papers.
- Choice Routing Explanation - Camvit 2009: http://www.camvit.com/camvit-technical-english/Camvit-Choice-Routing-Explanation-english.pdf
- and refined in: Alternative Routes in Road Networks 2010: http://www.cs.princeton.edu/~rwerneck/papers/ADGW10-alternatives-sea.pdf
- other ideas 'Improved Alternative Route Planning', 2013: https://hal.inria.fr/hal-00871739/document
- via point 'storage' idea 'Candidate Sets for Alternative Routes in Road Networks', 2013: https://algo2.iti.kit.edu/download/s-csarrn-12.pdf
- Alternative route graph construction 2011: http://algo2.iti.kit.edu/download/altgraph_tapas_extended.pdf
Note: This algorithm can be slow for longer routes and alternatives are only really practical in combination with CH, see #2566
- Author:
- Peter Karich
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.graphhopper.routing.AbstractNonCHBidirAlgo
additionalEdgeFilter, edgeExplorer, graph, nodeAccess, weightingFields inherited from class com.graphhopper.routing.AbstractBidirAlgo
bestBwdEntry, bestFwdEntry, bestWeight, bestWeightMapFrom, bestWeightMapOther, bestWeightMapTo, currFrom, currTo, finishedFrom, finishedTo, from, fromOutEdge, maxVisitedNodes, timeoutMillis, to, toInEdge, traversalMode, updateBestPath -
Constructor Summary
ConstructorsConstructorDescriptionAlternativeRoute(Graph graph, Weighting weighting, TraversalMode traversalMode, PMap hints) -
Method Summary
Modifier and TypeMethodDescriptioncalcAlternatives(int from, int to) calcAlternatives(Path bestPath, int maxPaths, double maxWeightFactor, double weightInfluence, double maxShareFactor, double shareInfluence, double minPlateauFactor, double plateauInfluence) calcPaths(int from, int to) Calculates multiple possibilities for a path.booleanfinished()getName()searchBest(int from, int to) Methods inherited from class com.graphhopper.routing.AStarBidirection
calcWeight, createEntry, createStartEntry, getApproximation, setApproximationMethods inherited from class com.graphhopper.routing.AbstractNonCHBidirAlgo
accept, createEmptyPath, createPathExtractor, extractPath, fillEdgesFromUsingFilter, fillEdgesToUsingFilter, getInEdgeWeight, postInitFrom, postInitTo, toStringMethods inherited from class com.graphhopper.routing.AbstractBidirAlgo
bwdSearchCanBeStopped, calcPath, calcPath, checkAlreadyRun, fromEntryCanBeSkipped, fwdSearchCanBeStopped, getCurrentFromWeight, getCurrentToWeight, getIncomingEdge, getVisitedNodes, initCollections, initFrom, initTo, isMaxVisitedNodesExceeded, isTimeoutExceeded, postInit, runAlgo, setMaxVisitedNodes, setTimeoutMillis, setUpdateBestPath, setupFinishTime, toEntryCanBeSkipped, updateBestPathMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.graphhopper.routing.EdgeToEdgeRoutingAlgorithm
calcPathMethods inherited from interface com.graphhopper.routing.RoutingAlgorithm
calcPath, getVisitedNodes, setMaxVisitedNodes, setTimeoutMillis
-
Constructor Details
-
AlternativeRoute
-
-
Method Details
-
calcAlternatives
-
calcPaths
Description copied from interface:RoutingAlgorithmCalculates multiple possibilities for a path.- Specified by:
calcPathsin interfaceRoutingAlgorithm- Overrides:
calcPathsin classAbstractBidirAlgo- See Also:
-
getName
- Specified by:
getNamein interfaceRoutingAlgorithm- Overrides:
getNamein classAStarBidirection- Returns:
- name of this algorithm
-
finished
public boolean finished()- Overrides:
finishedin classAStarBidirection
-
searchBest
-
calcAlternatives
public List<AlternativeRoute.AlternativeInfo> calcAlternatives(Path bestPath, int maxPaths, double maxWeightFactor, double weightInfluence, double maxShareFactor, double shareInfluence, double minPlateauFactor, double plateauInfluence) - Returns:
- the information necessary to handle alternative paths. Note that the paths are not yet extracted.
-