All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
NetworKit::AlgebraicTriangleCounting< Matrix > Class Template Reference

Implements a triangle counting algorithm for nodes based on algebraic methods. More...

#include <AlgebraicTriangleCounting.h>

Public Member Functions

 AlgebraicTriangleCounting (const Graph &graph)
 Creates an instance of AlgebraicTriangleCounting for the given Graph graph. More...
 
void run () override
 Computes the number of triangles each node is part of. More...
 
count score (node u) const
 Returns the score of node u. More...
 
std::vector< countgetScores (bool moveOut=false)
 Returns the scores for all nodes of the graph. 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
 

Additional Inherited Members

- Protected Attributes inherited from NetworKit::Algorithm
bool hasRun
 A boolean variable indicating whether an algorithm has finished its computation or not. More...
 

Detailed Description

template<class Matrix>
class NetworKit::AlgebraicTriangleCounting< Matrix >

Implements a triangle counting algorithm for nodes based on algebraic methods.

Constructor & Destructor Documentation

template<class Matrix >
NetworKit::AlgebraicTriangleCounting< Matrix >::AlgebraicTriangleCounting ( const Graph graph)
inline

Creates an instance of AlgebraicTriangleCounting for the given Graph graph.

Parameters
graph

Member Function Documentation

template<class Matrix >
std::vector<count> NetworKit::AlgebraicTriangleCounting< Matrix >::getScores ( bool  moveOut = false)
inline

Returns the scores for all nodes of the graph.

If moveOut is set to true (false by default) then the scores are std::moved such that no copy is constructed.

Parameters
moveOut
template<class Matrix >
void NetworKit::AlgebraicTriangleCounting< Matrix >::run ( )
overridevirtual

Computes the number of triangles each node is part of.

A triangle is considered as a set of nodes (i.e. if there is a triangle (u,v,w) it only counts as one triangle at each node).

Implements NetworKit::Algorithm.

template<class Matrix >
count NetworKit::AlgebraicTriangleCounting< Matrix >::score ( node  u) const
inline

Returns the score of node u.

Parameters
u

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