All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AlgebraicDistance.h
Go to the documentation of this file.
1 /*
2  * AlgebraicDistance.h
3  *
4  * Created on: 03.11.2015
5  * Author: Henning Meyerhenke, Christian Staudt, Michael Hamann
6  */
7 
8 #ifndef ALGEBRAICDISTANCE_H_
9 #define ALGEBRAICDISTANCE_H_
10 
11 #include "NodeDistance.h"
12 
13 
14 namespace NetworKit {
15 
24 
25 public:
26 
35  AlgebraicDistance(const Graph& G, count numberSystems=10, count numberIterations=30, double omega=0.5, index norm=0, bool withEdgeScores=false);
36 
40  virtual void preprocess();
41 
45  virtual double distance(node u, node v);
46 
47 
48  virtual std::vector<double> getEdgeScores();
49 
50 
51 protected:
52 
56  void randomInit();
57 
60  double omega;
62  const index MAX_NORM = 0;
64 
65  std::vector<double> loads;
66 
67  std::vector<double> edgeScores;
68 
69 };
70 
71 } /* namespace NetworKit */
72 #endif /* ALGEBRAICDISTANCE_H_ */
const Graph & G
Definition: NodeDistance.h:23
void randomInit()
initialize vectors randomly
Definition: AlgebraicDistance.cpp:24
count numSystems
number of vectors/systems used for algebraic iteration
Definition: AlgebraicDistance.h:58
std::vector< double > edgeScores
distance(u,v) for edge {u,v}
Definition: AlgebraicDistance.h:67
AlgebraicDistance(const Graph &G, count numberSystems=10, count numberIterations=30, double omega=0.5, index norm=0, bool withEdgeScores=false)
Definition: AlgebraicDistance.cpp:17
uint64_t index
Typedefs.
Definition: Globals.h:20
virtual void preprocess()
Perform preprocessing work.
Definition: AlgebraicDistance.cpp:34
virtual double distance(node u, node v)
Definition: AlgebraicDistance.cpp:117
virtual std::vector< double > getEdgeScores()
Returns the distances between all connected pairs of nodes.
Definition: AlgebraicDistance.cpp:142
bool withEdgeScores
Definition: AlgebraicDistance.h:63
Algebraic distance assigns a distance value to pairs of nodes according to their structural closeness...
Definition: AlgebraicDistance.h:23
uint64_t count
Definition: Globals.h:21
index node
Definition: Globals.h:23
double omega
attenuation factor influencing the speed of convergence
Definition: AlgebraicDistance.h:60
std::vector< double > loads
loads[u*numSystems..(u+1)*numSystems]: loads for node u
Definition: AlgebraicDistance.h:65
Abstract base class for node distance measures.
Definition: NodeDistance.h:19
count numIters
number of iterations in each system
Definition: AlgebraicDistance.h:59
A graph (with optional weights) and parallel iterator methods.
Definition: Graph.h:79
const index MAX_NORM
Definition: AlgebraicDistance.h:62
index norm
Definition: AlgebraicDistance.h:61