All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DynBetweennessOneNode.h
Go to the documentation of this file.
1 /*
2  * DYNBETNODE.h
3  *
4  * Created on: 10.03.2016
5  * Author: Elisabetta Bergamini
6  */
7 
8 #ifndef DYNBETNODE1_H_
9 #define DYNBETNODE1_H_
10 
11 #include "../dynamics/GraphEvent.h"
12 #include "../base/DynAlgorithm.h"
13 
14 namespace NetworKit {
15 
21 
22 public:
30 
32  void run();
33 
40  void update(GraphEvent event) override;
41 
48  void updateBatch(const std::vector<GraphEvent>& batch) override;
49 
52 
57 
58 private:
59  Graph& G;
60  node x;
61  // betweenness centrality of node x
62  edgeweight bcx = 0;
63  const edgeweight infDist = std::numeric_limits<edgeweight>::max();
64  const edgeweight epsilon = 0.0000000001; //make sure that no legitimate edge weight is below that.
65 
66  std::vector<std::vector<edgeweight>> distances;
67  std::vector<std::vector<edgeweight>> distancesOld;
68  // total number of shortest paths between two nodes
69  std::vector<std::vector<edgeweight>> sigma;
70  // number of shortest paths between two nodes that go through node x
71  std::vector<std::vector<edgeweight>> sigmax;
72  std::vector<std::vector<edgeweight>> sigmaxOld;
73 
74  std::vector<node> Pred;
75 };
76 
77 } /* namespace NetworKit */
78 
79 #endif /* DYNBETNODE1_H_ */
void updateBatch(const std::vector< GraphEvent > &batch) override
Updates the betweenness centrality of x after a batch of edge insertions on the graph.
Definition: DynBetweennessOneNode.cpp:194
void run()
initialize distances and Pred by repeatedly running the Dijkstra2 algorithm
Definition: DynBetweennessOneNode.cpp:24
Dynamic betweenness of a single node.
Definition: DynBetweennessOneNode.h:20
void update(GraphEvent event) override
Updates the betweenness centrality of x after an edge insertions on the graph.
Definition: DynBetweennessOneNode.cpp:77
edgeweight getbcx()
Definition: DynBetweennessOneNode.cpp:212
DynBetweennessOneNode(Graph &G, node x)
Creates the object for G.
Definition: DynBetweennessOneNode.cpp:19
edgeweight getSigmax(node u, node v)
Definition: DynBetweennessOneNode.cpp:208
edgeweight getDistance(node u, node v)
Definition: DynBetweennessOneNode.cpp:200
Definition: DynAlgorithm.h:10
Definition: GraphEvent.h:19
edgeweight getSigma(node u, node v)
Definition: DynBetweennessOneNode.cpp:204
index node
Definition: Globals.h:23
edgeweight computeScore(GraphEvent event)
Returns the new betweenness score of node x after the insertion of an edge.
A graph (with optional weights) and parallel iterator methods.
Definition: Graph.h:79
double edgeweight
Definition: Globals.h:24