Class SimRankScore

Inheritance Relationships

Base Type

Class Documentation

class SimRankScore : public NetworKit::EdgeScore<double>

Computes a SimRank similarity score for each edge of the input graph.

The score assigned to an edge (u, v) is the SimRank similarity between its endpoints u and v.

This implementation follows the classical iterative SimRank recurrence: two nodes are similar if their neighbors/predecessors are similar.

The result is stored as one score per edge id in scoreData.

Requires indexed edges, i.e. G.indexEdges() must have been called before run().

Public Functions

SimRankScore(const Graph &G, double similarityPropagationFactor = 0.9, count maxIterations = 100, double tolerance = 1e-4)

Constructs a SimRank edge-score algorithm.

Parameters:
  • G – The input graph.

  • similarityPropagationFactor – Factor in [0, 1] that scales the contribution of neighboring node-pair similarities in each SimRank iteration. Larger values preserve more propagated similarity.

  • maxIterations – Maximum number of iterations.

  • tolerance – Convergence tolerance for the maximum absolute score change between two consecutive iterations.

Throws:
  • std::invalid_argument – if similarityPropagationFactor is not in [0, 1].

  • std::invalid_argument – if maxIterations is 0.

  • std::invalid_argument – if tolerance is negative.

virtual void run() override

Computes one SimRank score per indexed edge.

After run(), scores can be accessed through:

Throws:
  • std::runtime_error – if the graph has no indexed edges. Call G.indexEdges() before running the algorithm.

  • std::overflow_error – if the internal pairwise score matrix would exceed the supported index range.