All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ApproximatePageRank.h
Go to the documentation of this file.
1 /*
2  * ApproximatePageRank.h
3  *
4  * Created on: 26.02.2014
5  * Author: Henning
6  */
7 
8 #ifndef APPROXIMATEPAGERANK_H_
9 #define APPROXIMATEPAGERANK_H_
10 
11 #include <vector>
12 #include <unordered_map>
13 #include "../graph/Graph.h"
14 
15 namespace NetworKit {
16 
21 protected:
22  const Graph& G;
23  double alpha;
24  double eps;
25 
26  std::unordered_map<node, std::pair<double, double>> pr_res;
27 
28  void push(node u, std::queue<node>& activeNodes);
29 
30 public:
36  ApproximatePageRank(const Graph& g, double alpha, double epsilon = 1e-12);
37 
42  std::vector<std::pair<node, double>> run(node seed);
43 };
44 
45 } /* namespace NetworKit */
46 #endif /* APPROXIMATEPAGERANK_H_ */
std::vector< std::pair< node, double > > run(node seed)
Definition: ApproximatePageRank.cpp:41
double alpha
Definition: ApproximatePageRank.h:23
Computes an approximate PageRank vector from a given seed.
Definition: ApproximatePageRank.h:20
ApproximatePageRank(const Graph &g, double alpha, double epsilon=1e-12)
Definition: ApproximatePageRank.cpp:15
index node
Definition: Globals.h:23
const Graph & G
Definition: ApproximatePageRank.h:22
double eps
Definition: ApproximatePageRank.h:24
A graph (with optional weights) and parallel iterator methods.
Definition: Graph.h:79
void push(node u, std::queue< node > &activeNodes)
Definition: ApproximatePageRank.cpp:20
std::unordered_map< node, std::pair< double, double > > pr_res
Definition: ApproximatePageRank.h:26