Skip to content

Commit

Permalink
bugfix: readd ApproxCloseness.h
Browse files Browse the repository at this point in the history
  • Loading branch information
clstaudt committed Aug 19, 2015
1 parent f9c93d7 commit a8689b4
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions networkit/cpp/centrality/ApproxCloseness.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* ApproxCloseness.h
*
* Created on: 16.06.2015
* Author: Arie Slobbe
*/

#ifndef APPROXCLOSENESS_H_
#define APPROXCLOSENESS_H_

#include "Centrality.h"


namespace NetworKit {

/**
* @ingroup centrality
* Approximation of closeness centrality according to algorithm described in
* Eppstein, Wang: Fast Approximation of Centrality
*/
class ApproxCloseness: public NetworKit::Centrality {

public:

/**
* The algorithm approximates the closeness of all nodes, by taking samples
* uniformly at random and solving the SSSP problem for each. More samples
* improves the accuracy of the approximation.
*
* @param graph input graph
* @param nSamples user defined number of samples
* @param normalized normalize centrality values in interval [0,1] ?
*/
ApproxCloseness(const Graph& G, count nSamples, bool normalized=false);


/**
* Compute closeness scores parallel
*
*/
void run() override;

/*
* Returns the maximum possible Closeness a node can have in a graph with the same amount of nodes (=a star)
*/
double maximum();

private:

count nSamples;

};

} /* namespace NetworKit */

#endif /* APPROXCLOSENESS_H_ */

0 comments on commit a8689b4

Please sign in to comment.