All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
NetworKit::APSP Class Reference

Class for all-pair shortest path algorithm. More...

#include <APSP.h>

Public Member Functions

 APSP (const Graph &G)
 Creates the APSP class for G. More...
 
virtual ~APSP ()=default
 
void run () override
 Computes the shortest paths from each node to all other nodes. More...
 
virtual std::string toString () const override
 
std::vector< std::vector
< edgeweight > > 
getDistances () const
 Returns a vector of weighted distances between node pairs. More...
 
edgeweight getDistance (node u, node v) const
 Returns the distance from u to v or infinity if u and v are not connected. More...
 
virtual bool isParallel () const override
 
- Public Member Functions inherited from NetworKit::Algorithm
 Algorithm ()
 Constructor to the algorithm base class. More...
 
virtual ~Algorithm ()=default
 Virtual default destructor. More...
 
bool hasFinished () const
 Indicates whether an algorithm has completed computation or not. More...
 
void assureFinished () const
 Assure that the algorithm has been run, throws a std::runtime_error otherwise. More...
 

Protected Attributes

const GraphG
 
std::vector< std::vector
< edgeweight > > 
distances
 
- Protected Attributes inherited from NetworKit::Algorithm
bool hasRun
 A boolean variable indicating whether an algorithm has finished its computation or not. More...
 

Detailed Description

Class for all-pair shortest path algorithm.

Constructor & Destructor Documentation

NetworKit::APSP::APSP ( const Graph G)

Creates the APSP class for G.

Parameters
GThe graph.
virtual NetworKit::APSP::~APSP ( )
virtualdefault

Member Function Documentation

edgeweight NetworKit::APSP::getDistance ( node  u,
node  v 
) const
inline

Returns the distance from u to v or infinity if u and v are not connected.

std::vector<std::vector<edgeweight> > NetworKit::APSP::getDistances ( ) const
inline

Returns a vector of weighted distances between node pairs.

Returns
The shortest-path distances from each node to any other node in the graph.
virtual bool NetworKit::APSP::isParallel ( ) const
inlineoverridevirtual
Returns
True if algorithm can run multi-threaded.

Reimplemented from NetworKit::Algorithm.

void NetworKit::APSP::run ( )
overridevirtual

Computes the shortest paths from each node to all other nodes.

Implements NetworKit::Algorithm.

Reimplemented in NetworKit::DynAPSP.

std::string NetworKit::APSP::toString ( ) const
overridevirtual
Returns
string representation of algorithm and parameters.

Reimplemented from NetworKit::Algorithm.

Member Data Documentation

std::vector<std::vector<edgeweight> > NetworKit::APSP::distances
protected
const Graph& NetworKit::APSP::G
protected

The documentation for this class was generated from the following files: