Package com.jgalgo.alg.shortestpath
Interface ShortestPathSingleSource.Builder
- All Superinterfaces:
AlgorithmBuilderBase
- Enclosing interface:
ShortestPathSingleSource
A builder for
ShortestPathSingleSource
objects.- Author:
- Barak Ugav
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Create a new algorithm object for single source shortest path computation.cardinality
(boolean cardinalityWeight) Enable/disable the support for cardinality shortest paths only.dag
(boolean dagGraphs) Enable/disable the support for directed acyclic graphs (DAG) only.integerWeights
(boolean enable) Enable/disable integer weights.maxDistance
(double maxDistance) Set the maximum distance that should be supported.negativeWeights
(boolean enable) Enable/disable the support for negative numbers.Methods inherited from interface com.jgalgo.alg.common.AlgorithmBuilderBase
setOption
-
Method Details
-
build
ShortestPathSingleSource build()Create a new algorithm object for single source shortest path computation.- Returns:
- a new single source shortest path algorithm
-
integerWeights
Enable/disable integer weights.More efficient and accurate implementations may be supported if the edge weights are known to be integer.
- Parameters:
enable
- iftrue
, the builtShortestPathSingleSource
objects will support only integer weights- Returns:
- this builder
-
negativeWeights
Enable/disable the support for negative numbers.More efficient and accurate implementations may be supported if its known in advance that all edge weights will be positive (which is the default).
- Parameters:
enable
- iftrue
, the builtShortestPathSingleSource
objects will support negative numbers- Returns:
- this builder
-
maxDistance
Set the maximum distance that should be supported.This method may be used as a hint to choose an
ShortestPathSingleSource
implementation.- Parameters:
maxDistance
- a maximum distance upper bound on the distance from the source to any vertex- Returns:
- this builder
-
dag
Enable/disable the support for directed acyclic graphs (DAG) only.More efficient algorithm may exists if we know in advance all input graphs will be DAG. Note that if this option is enabled, ONLY directed acyclic graphs will be supported.
- Parameters:
dagGraphs
- iftrue
, the builtShortestPathSingleSource
objects will support only directed acyclic graphs- Returns:
- this builder
-
cardinality
Enable/disable the support for cardinality shortest paths only.More efficient algorithm may exists for cardinality shortest paths. Note that if this option is enabled, ONLY cardinality shortest paths will be supported.
- Parameters:
cardinalityWeight
- iftrue
, only cardinality shortest paths will be supported by algorithms built by this builder- Returns:
- this builder
-