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

CommuteTimeDistance edge centrality. More...

#include <CommuteTimeDistance.h>

Public Member Functions

 CommuteTimeDistance (const Graph &G, double tol=0.1)
 Constructs the CommuteTimeDistance class for the given Graph G. More...
 
virtual ~CommuteTimeDistance ()=default
 Destructor. More...
 
virtual void run ()
 Computes ECTD exactly. More...
 
void runApproximation ()
 Computes approximation by projection. More...
 
void runParallelApproximation ()
 Computes approximation by projection, in parallel. More...
 
uint64_t getSetupTime () const
 
double distance (node u, node v)
 Returns the commute time distance between node u and node v. More...
 
double runSinglePair (node u, node v)
 Returns the commute time distance between node u and node v. More...
 
double runSingleSource (node u)
 Returns the the sum of the distances from node u. More...
 
- 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...
 
virtual std::string toString () const
 Returns a string with the algorithm's name and its parameters, if there are any. More...
 
virtual bool isParallel () const
 

Protected Attributes

const GraphG
 
double tol
 
Lamg< CSRMatrixlamg
 
uint64_t setupTime
 
std::vector< std::vector
< double > > 
distances
 
std::vector< Vectorsolutions
 
bool hasRun = false
 
bool exactly
 
count k
 
- Protected Attributes inherited from NetworKit::Algorithm
bool hasRun
 A boolean variable indicating whether an algorithm has finished its computation or not. More...
 

Detailed Description

CommuteTimeDistance edge centrality.

Constructor & Destructor Documentation

NetworKit::CommuteTimeDistance::CommuteTimeDistance ( const Graph G,
double  tol = 0.1 
)

Constructs the CommuteTimeDistance class for the given Graph G.

Parameters
GThe graph.
tolThe tolerance used for the approximation
virtual NetworKit::CommuteTimeDistance::~CommuteTimeDistance ( )
virtualdefault

Destructor.

Member Function Documentation

double NetworKit::CommuteTimeDistance::distance ( node  u,
node  v 
)

Returns the commute time distance between node u and node v.

Returns
commute time distance between the two nodes. Needs to call run() or runApproximation() first.
uint64_t NetworKit::CommuteTimeDistance::getSetupTime ( ) const
Returns
The elapsed time to setup the solver in milliseconds.
void NetworKit::CommuteTimeDistance::run ( )
virtual

Computes ECTD exactly.

Implements NetworKit::Algorithm.

void NetworKit::CommuteTimeDistance::runApproximation ( )

Computes approximation by projection.

void NetworKit::CommuteTimeDistance::runParallelApproximation ( )

Computes approximation by projection, in parallel.

double NetworKit::CommuteTimeDistance::runSinglePair ( node  u,
node  v 
)

Returns the commute time distance between node u and node v.

This method does not need the initial preprocessing (no need to call the run() method).

Returns
commute time distance between the two nodes.
double NetworKit::CommuteTimeDistance::runSingleSource ( node  u)

Returns the the sum of the distances from node u.

This method does not need the initial preprocessing.

Returns
commute sum of the distances from the node.

Member Data Documentation

std::vector<std::vector<double> > NetworKit::CommuteTimeDistance::distances
protected
bool NetworKit::CommuteTimeDistance::exactly
protected
const Graph& NetworKit::CommuteTimeDistance::G
protected
bool NetworKit::CommuteTimeDistance::hasRun = false
protected
count NetworKit::CommuteTimeDistance::k
protected
Lamg<CSRMatrix> NetworKit::CommuteTimeDistance::lamg
protected
uint64_t NetworKit::CommuteTimeDistance::setupTime
protected
std::vector<Vector> NetworKit::CommuteTimeDistance::solutions
protected
double NetworKit::CommuteTimeDistance::tol
protected

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