-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_ */ |