Defined in File SSSP.hpp
public NetworKit::Algorithm
(Class Algorithm)
public NetworKit::BFS
(Class BFS)
public NetworKit::Dijkstra
(Class Dijkstra)
public NetworKit::DynSSSP
(Class DynSSSP)
public NetworKit::ReverseBFS
(Class ReverseBFS)
Abstract base class for single-source shortest path algorithms.
Subclassed by NetworKit::BFS, NetworKit::Dijkstra, NetworKit::DynSSSP, NetworKit::ReverseBFS
Public Functions
Creates the SSSP class for G and source s.
G – The graph.
source – The source node.
storePaths – Paths are reconstructable and the number of paths is stored.
storeNodesSortedByDistance – Store a vector of nodes ordered in increasing distance from the source.
target – The target node.
Computes the shortest paths from the source to all other nodes.
Returns a vector of weighted distances from the source node, i.e. the length of the shortest path from the source node to any other node.
The weighted distances from the source node to any other node in the graph.
Returns the distance from the source node to t.
t – Target node.
The distance from source to target node t.
Returns the number of shortest paths between the source node and t.
t – Target node.
The number of shortest paths between source and t.
Returns the number of shortest paths between the source node and t as a double value. Workaround for Cython
t – Target node.
The number of shortest paths between source and t.
Returns the predecessor nodes of t on all shortest paths from source to t.
t – Target node.
The predecessors of t on all shortest paths from source to t.
Returns a shortest path from source to t and an empty path if source and t are not connected.
t – Target node.
forward – If true
(default) the path is directed from source to t, otherwise the path is reversed.
A shortest path from source to t or an empty path.
Returns all shortest paths from source to t and an empty set if source and t are not connected.
t – Target node.
forward – If true
(default) the path is directed from source to t, otherwise the path is reversed.
All shortest paths from source node to target node t.
Returns a vector of nodes ordered in increasing distance from the source.
For this functionality to be available, storeNodesSortedByDistance has to be set to true in the constructor. There are no guarantees regarding the ordering of two nodes with the same distance to the source.
vector of nodes ordered in increasing distance from the source
Returns the number of nodes reached by the source.
Number of nodes reached by the source.
Sets a new source.
newSource – The new source node.
Returns the sum of distances from the source node node to the reached nodes.
Protected Attributes
if true, paths are reconstructable and the number of paths is stored
if true, store a vector of nodes ordered in increasing distance from the source