All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JaccardDistance.h
Go to the documentation of this file.
1 /*
2  * JaccardDistance.h
3  *
4  * Created on: 17.11.2014
5  * Author: Michael Hamann, Gerd Lindner
6  */
7 
8 #ifndef JACCARDDISTANCE_H_
9 #define JACCARDDISTANCE_H_
10 
11 #include "NodeDistance.h"
12 #include "../graph/Graph.h"
13 #include "../auxiliary/Timer.h"
14 
15 
16 namespace NetworKit {
17 
24 
25 public:
26 
31  JaccardDistance(const Graph& G, const std::vector<count>& triangles);
32 
36  virtual void preprocess();
37 
42  virtual double distance(node u, node v);
43 
48  std::vector<double> getEdgeScores();
49 
50 protected:
51  const std::vector<count>& triangles;
52  std::vector<double> jDistance; //result vector
53 
54  inline double getJaccardDistance(count degU, count degV, count t);
55 
56 };
57 
58 } /* namespace NetworKit */
59 #endif /* JACCARDDISTANCE_H_ */
const Graph & G
Definition: NodeDistance.h:23
JaccardDistance(const Graph &G, const std::vector< count > &triangles)
Definition: JaccardDistance.cpp:15
const std::vector< count > & triangles
Definition: JaccardDistance.h:51
uint64_t count
Definition: Globals.h:21
index node
Definition: Globals.h:23
virtual double distance(node u, node v)
Returns the Jaccard distance between node u and node v.
Definition: JaccardDistance.cpp:30
std::vector< double > getEdgeScores()
Returns the Jaccard distances between all connected nodes.
Definition: JaccardDistance.cpp:35
Abstract base class for node distance measures.
Definition: NodeDistance.h:19
A graph (with optional weights) and parallel iterator methods.
Definition: Graph.h:79
Jaccard distance assigns a distance value to pairs of nodes according to the similarity of their neig...
Definition: JaccardDistance.h:23
double getJaccardDistance(count degU, count degV, count t)
Definition: JaccardDistance.cpp:39
virtual void preprocess()
REQ: Needs to be called before getEdgeScores delivers meaningful results.
Definition: JaccardDistance.cpp:18
std::vector< double > jDistance
Definition: JaccardDistance.h:52