Class KatzIndex

Inheritance Relationships

Base Type

Class Documentation

class KatzIndex : public NetworKit::LinkPredictor

Implementation of the Katz index. Katz index assigns a pair of nodes a similarity score that is based on the sum of the weighted number of paths of length l where l is smaller than a given limit.

Public Functions

explicit KatzIndex(count maxPathLength = 5, double dampingValue = 0.005)
Parameters:
  • maxPathLength – Maximal length of the paths to consider

  • dampingValue – Used to exponentially damp every addend of the sum. Should be in (0, 1]

explicit KatzIndex(const Graph &G, count maxPathLength = 5, double dampingValue = 0.005)
Parameters:
  • G – The graph to operate on

  • maxPathLength – Maximal length of the paths to consider

  • dampingValue – Used to exponentially damp every addend of the sum. Should be in (0, 1]

virtual std::vector<LinkPredictor::prediction> runOn(std::vector<std::pair<node, node>> nodePairs) override

Executes the run-method on al given nodePairs and returns a vector of predictions. The result is a vector of pairs where the first element is the node-pair and it’s second element the corresponding score generated by the run-method. The method makes use of parallelization.

Parameters:

nodePairs – Node-pairs to run the predictor on

Returns:

a vector of pairs containing the given node-pair as the first element and it’s corresponding score as the second element. The vector is sorted ascendingly by node-pair