Class AlgebraicDistance

Inheritance Relationships

Base Type

Class Documentation

class AlgebraicDistance : public NetworKit::NodeDistance

Algebraic distance assigns a distance value to pairs of nodes according to their structural closeness in the graph. Algebraic distances will become small within dense subgraphs.

Public Functions

AlgebraicDistance(const Graph &G, count numberSystems = 10, count numberIterations = 30, double omega = 0.5, index norm = 0, bool withEdgeScores = false)
  • G – The graph.

  • numberSystems – Number of vectors/systems used for algebraic iteration.

  • numberIterations – Number of iterations in each system.

  • omega – attenuation factor influencing convergence speed.

  • norm – The norm factor of the extended algebraic distance.

  • withEdgeScores – calculate array of scores for edges {u,v} that equal ad(u,v)

virtual void preprocess() override

Perform preprocessing work. Needs to be called before distances are requested.

virtual double distance(node u, node v) override

algebraic distance between the two nodes.

virtual const std::vector<double> &getEdgeScores() const override

Returns the distances between all connected pairs of nodes.


Vector containing the distances between all connected pairs of nodes.