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

Assortativity computes a coefficient that expresses the correlation of a node attribute among connected pairs of nodes. More...

#include <Assortativity.h>

Public Member Functions

 Assortativity (const Graph &G, const std::vector< double > &attribute)
 Initialize Assortativity with a graph G and an array of numerical node values. More...
 
 Assortativity (const Graph &G, const Partition &partition)
 Initialize Assortativity with a graph G and a partition of the node set. More...
 
void run () override
 The generic run method which calls runImpl() and takes care of setting to the appropriate value. More...
 
double getCoefficient () const
 Return the assortativity coefficient. More...
 
std::string toString () const override
 Returns a string with the algorithm's name and its parameters, if there are any. More...
 
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...
 

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

Assortativity computes a coefficient that expresses the correlation of a node attribute among connected pairs of nodes.

Constructor & Destructor Documentation

NetworKit::Assortativity::Assortativity ( const Graph G,
const std::vector< double > &  attribute 
)

Initialize Assortativity with a graph G and an array of numerical node values.

Parameters
GThe graph.
attributenumerical node value array
NetworKit::Assortativity::Assortativity ( const Graph G,
const Partition partition 
)

Initialize Assortativity with a graph G and a partition of the node set.

Parameters
GThe graph.
partitionpartition of the node set

Member Function Documentation

double NetworKit::Assortativity::getCoefficient ( ) const

Return the assortativity coefficient.

bool NetworKit::Assortativity::isParallel ( ) const
overridevirtual
Returns
True if algorithm can run multi-threaded.

Reimplemented from NetworKit::Algorithm.

void NetworKit::Assortativity::run ( )
overridevirtual

The generic run method which calls runImpl() and takes care of setting to the appropriate value.

Implements NetworKit::Algorithm.

std::string NetworKit::Assortativity::toString ( ) const
overridevirtual

Returns a string with the algorithm's name and its parameters, if there are any.

Subclasses should override it.

Returns
The string representation of the algorithm.

Reimplemented from NetworKit::Algorithm.


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