Template Class EdgeScore

Inheritance Relationships

Base Type

Class Documentation

template<typename T>
class EdgeScore : public NetworKit::Algorithm

Abstract base class for an edge score.

Public Functions

EdgeScore(const Graph &G)
virtual void run() override

Compute the edge score.

const std::vector<T> &scores() const

Get a vector containing the score for each edge in the graph.

Returns:

the edge scores calculated by run().

T score(edgeid eid)

Get the edge score of the edge with the given edge id.

T score(node u, node v)

Get the edge score of the given edge.

Graph calculate(bool squared = false, edgeweight offset = 1, edgeweight factor = 1) const

Build a weighted graph from the computed edge scores.

The returned graph has the same topology as the input graph but edge weights are derived from the edge scores:

w(e) = offset + factor * score(e) or, if squared == true: w(e) = offset + factor * score(e)^2

Requires that edges are indexed (G->hasEdgeIds()). Currently intended for undirected graphs (same behavior as the former EdgeScoreAsWeight helper).

Protected Attributes

const Graph *G
std::vector<T> scoreData