Class DynBetweennessOneNode

Inheritance Relationships

Base Types

Class Documentation

class DynBetweennessOneNode : public NetworKit::Algorithm, public NetworKit::DynAlgorithm

This algorithm computes the betweenness centrality for a specified focus node x. It works for dynamic graphs that can be undirected/directed and unweighted/weighted without negative cycles. The Algorithm proceeds as described in [1]. The run() method computes the betweenness centrality by computing SSSP (similar to Dijkstra) for each node. The update() method only works with edge insertions and edge weight decrements and has a WC runtime complexity of O(n²) which outperforms the DynamicBetweenness algorithm for all nodes (instead of one focus node) that takes O(nm).

[1] Bergamini et al. : Improving the Betweenness Centrality of a Node by Adding Links https://dl.acm.org/doi/abs/10.1145/3166071

Public Functions

DynBetweennessOneNode(Graph &G, node x)

Creates the object for G.

Parameters:

G – The graph. @paarm x The node for which we want to compute betweenness.

virtual void run() override

initialize distances and Pred by repeatedly running the Dijkstra2 algorithm

void runUnweighted()
void runWeighted()
virtual void update(GraphEvent event) override

Updates the betweenness centrality of x after an edge insertions on the graph. Notice: it works only with edge insertions.

Parameters:

e – The edge insertions.

virtual void updateBatch(const std::vector<GraphEvent> &batch) override

Updates the betweenness centrality of x after a batch of edge insertions on the graph. Notice: it works only with edge insertions.

Parameters:

batch – The batch of edge insertions.

edgeweight computeScore(GraphEvent event)

Returns the new betweenness score of node x after the insertion of an edge. Distances and scores of the other nodes are not changed by this function.

edgeweight getDistance(node u, node v)
edgeweight getSigma(node u, node v)
edgeweight getSigmax(node u, node v)
edgeweight getbcx()