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, weighting
Fields 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.boolean
finished()
getName()
searchBest
(int from, int to) Methods inherited from class com.graphhopper.routing.AStarBidirection
calcWeight, createEntry, createStartEntry, getApproximation, setApproximation
Methods inherited from class com.graphhopper.routing.AbstractNonCHBidirAlgo
accept, createEmptyPath, createPathExtractor, extractPath, fillEdgesFromUsingFilter, fillEdgesToUsingFilter, getInEdgeWeight, postInitFrom, postInitTo, toString
Methods 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, updateBestPath
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.graphhopper.routing.EdgeToEdgeRoutingAlgorithm
calcPath
Methods inherited from interface com.graphhopper.routing.RoutingAlgorithm
calcPath, getVisitedNodes, setMaxVisitedNodes, setTimeoutMillis
-
Constructor Details
-
AlternativeRoute
-
-
Method Details
-
calcAlternatives
-
calcPaths
Description copied from interface:RoutingAlgorithm
Calculates multiple possibilities for a path.- Specified by:
calcPaths
in interfaceRoutingAlgorithm
- Overrides:
calcPaths
in classAbstractBidirAlgo
- See Also:
-
getName
- Specified by:
getName
in interfaceRoutingAlgorithm
- Overrides:
getName
in classAStarBidirection
- Returns:
- name of this algorithm
-
finished
public boolean finished()- Overrides:
finished
in 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.
-