Interface ShortestPathSingleSource.Builder
-
- Enclosing interface:
- ShortestPathSingleSource
public static interface ShortestPathSingleSource.BuilderA builder forShortestPathSingleSourceobjects.- Author:
- Barak Ugav
- See Also:
ShortestPathSingleSource.newBuilder()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ShortestPathSingleSourcebuild()Create a new algorithm object for single source shortest path computation.ShortestPathSingleSource.BuildersetCardinality(boolean cardinalityWeight)Enable/disable the support for cardinality shortest paths only.ShortestPathSingleSource.BuildersetDag(boolean dagGraphs)Enable/disable the support for directed acyclic graphs (DAG) only.ShortestPathSingleSource.BuildersetIntWeights(boolean enable)Enable/disable integer weights.ShortestPathSingleSource.BuildersetMaxDistance(double maxDistance)Set the maximum distance that should be supported.ShortestPathSingleSource.BuildersetNegativeWeights(boolean enable)Enable/disable the support for negative numbers.default BuilderTypesetOption(String key, Object value)[TL;DR Don't call me!] Set an option.
-
-
-
Method Detail
-
build
ShortestPathSingleSource build()
Create a new algorithm object for single source shortest path computation.- Returns:
- a new single source shortest path algorithm
-
setIntWeights
ShortestPathSingleSource.Builder setIntWeights(boolean enable)
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 builtShortestPathSingleSourceobjects will support only integer weights- Returns:
- this builder
-
setNegativeWeights
ShortestPathSingleSource.Builder setNegativeWeights(boolean enable)
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 builtShortestPathSingleSourceobjects will support negative numbers- Returns:
- this builder
-
setMaxDistance
ShortestPathSingleSource.Builder setMaxDistance(double maxDistance)
Set the maximum distance that should be supported.This method may be used as a hint to choose an
ShortestPathSingleSourceimplementation.- Parameters:
maxDistance- a maximum distance upper bound on the distance from the source to any vertex- Returns:
- this builder
-
setDag
ShortestPathSingleSource.Builder setDag(boolean dagGraphs)
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 builtShortestPathSingleSourceobjects will support only directed acyclic graphs- Returns:
- this builder
-
setCardinality
ShortestPathSingleSource.Builder setCardinality(boolean cardinalityWeight)
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
-
setOption
default BuilderType setOption(String key, Object value)
[TL;DR Don't call me!] Set an option.The builder might support different options to customize its implementation. These options never change the behavior of the algorithm, only its internal implementation. The possible options are not exposed as 'public' because they are not part of the API and may change in the future.
These options are mainly for debug and benchmark purposes.
- Parameters:
key- the option keyvalue- the option value- Returns:
- this builder
-
-