All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
NetworKit::JaccardDistance Class Reference

Jaccard distance assigns a distance value to pairs of nodes according to the similarity of their neighborhoods. More...

#include <JaccardDistance.h>

Public Member Functions

 JaccardDistance (const Graph &G, const std::vector< count > &triangles)
 
virtual void preprocess ()
 REQ: Needs to be called before getEdgeScores delivers meaningful results. More...
 
virtual double distance (node u, node v)
 Returns the Jaccard distance between node u and node v. More...
 
std::vector< double > getEdgeScores ()
 Returns the Jaccard distances between all connected nodes. More...
 
- Public Member Functions inherited from NetworKit::NodeDistance
 NodeDistance (const Graph &G)
 Constructs the NodeDistance class for the given Graph G. More...
 
virtual ~NodeDistance ()=default
 Default destructor. More...
 

Protected Member Functions

double getJaccardDistance (count degU, count degV, count t)
 

Protected Attributes

const std::vector< count > & triangles
 
std::vector< double > jDistance
 
- Protected Attributes inherited from NetworKit::NodeDistance
const GraphG
 

Detailed Description

Jaccard distance assigns a distance value to pairs of nodes according to the similarity of their neighborhoods.

Note that we define the JaccardDistance as 1-JaccardSimilarity.

Constructor & Destructor Documentation

NetworKit::JaccardDistance::JaccardDistance ( const Graph G,
const std::vector< count > &  triangles 
)
Parameters
GThe graph.
trianglesEdge attribute containing the number of triangles each edge is contained in.

Member Function Documentation

double NetworKit::JaccardDistance::distance ( node  u,
node  v 
)
virtual

Returns the Jaccard distance between node u and node v.

Returns
Jaccard distance between the two nodes.

Implements NetworKit::NodeDistance.

std::vector< double > NetworKit::JaccardDistance::getEdgeScores ( )
virtual

Returns the Jaccard distances between all connected nodes.

Returns
Vector containing the Jaccard distances between all connected pairs of nodes.

Implements NetworKit::NodeDistance.

double NetworKit::JaccardDistance::getJaccardDistance ( count  degU,
count  degV,
count  t 
)
inlineprotected
void NetworKit::JaccardDistance::preprocess ( )
virtual

REQ: Needs to be called before getEdgeScores delivers meaningful results.

Implements NetworKit::NodeDistance.

Member Data Documentation

std::vector<double> NetworKit::JaccardDistance::jDistance
protected
const std::vector<count>& NetworKit::JaccardDistance::triangles
protected

The documentation for this class was generated from the following files: