Class NodeDistance

Inheritance Relationships

Derived Types

Class Documentation

class NodeDistance

Abstract base class for node distance measures.

Subclassed by NetworKit::AdamicAdarDistance, NetworKit::AlgebraicDistance, NetworKit::JaccardDistance

Public Functions

inline NodeDistance(const Graph &G)

Constructs the NodeDistance class for the given Graph G.

Parameters:

G – The graph.

virtual ~NodeDistance() = default

Default destructor

virtual void preprocess() = 0

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

virtual double distance(node u, node v) = 0

Return the distance between two nodes. The distance must be normed to return a distance between 0 and 1.

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

Returns the distances between all connected pairs of nodes.

Returns:

Vector containing the distances between all connected pairs of nodes.

Protected Attributes

const Graph *G