Class KatzCentrality

Inheritance Relationships

Base Type

Class Documentation

class KatzCentrality : public NetworKit::Centrality

Computes the Katz centrality of the graph. NOTE: There is an inconsistency in the definition in Newman’s book (Ch. 7) regarding directed graphs; we follow the verbal description, which requires to sum over the incoming edges (as opposed to outgoing ones).

Public Functions

KatzCentrality(const Graph &G, double alpha = 0, double beta = 0.1, double tol = 1e-8)

Constructs a KatzCentrality object for the given Graph G. tol defines the tolerance for convergence. Each iteration of the algorithm requires O(m) time. The number of iterations depends on how long it takes to reach the convergence.

  • G[in] The graph.

  • alpha[in] Damping of the matrix vector product result, must be non negative. Leave this parameter to 0 to use the default value 1 / (max_degree + 1).

  • beta[in] Constant value added to the centrality of each vertex

  • tol[in] The tolerance for convergence.

virtual void run() override

Computes katz centrality on the graph passed in constructor.

Public Members

EdgeDirection edgeDirection = EdgeDirection::IN_EDGES

Protected Attributes

const double alpha
const double beta
const double tol

Protected Static Functions

static double defaultAlpha(const Graph &G)