Diameter.h
Go to the documentation of this file.
1 /*
2  * Diameter.h
3  *
4  * Created on: 19.02.2014
5  * Author: Daniel Hoske, Christian Staudt
6  */
7
8 #ifndef DIAMETER_H_
9 #define DIAMETER_H_
10
11 #include "../base/Algorithm.h"
12 #include "../graph/Graph.h"
13 #include "../auxiliary/SignalHandling.h"
14
15
16 namespace NetworKit {
18
22 class Diameter : public Algorithm {
23
24 public:
25
26  Diameter(const Graph& G, DiameterAlgo algo = DiameterAlgo::automatic, double error = -1.f, count nSamples = 0);
27
28  void run() override;
29
30  std::string toString() const override;
31
32  std::pair<count, count> getDiameter() const;
33
34
35 private:
36  const Graph& G;
37  DiameterAlgo algo;
38  double error;
39  count nSamples;
40  std::pair<count, count> diameterBounds;
41
53  std::pair<edgeweight, edgeweight> estimatedDiameterRange(const Graph& G, double error);
54
62  edgeweight exactDiameter(const Graph& G);
63
64
75  edgeweight estimatedVertexDiameter(const Graph& G, count samples);
76
77
81  edgeweight estimatedVertexDiameterPedantic(const Graph& G);
82
86  edgeweight estimatedVertexDiameterPedantic2(const Graph& G);
87 };
88
89 } /* namespace NetworKit */
90
91 #endif /* DIAMETER_H_ */
Definition: Diameter.h:17
Diameter(const Graph &G, DiameterAlgo algo=DiameterAlgo::automatic, double error=-1.f, count nSamples=0)
Definition: Diameter.cpp:19
Definition: Diameter.h:22
std::string toString() const override
Returns a string with the algorithm's name and its parameters, if there are any.
Definition: Diameter.cpp:320
Definition: Diameter.h:17
Definition: Diameter.h:17
Definition: Diameter.h:17
Definition: Diameter.h:17
uint64_t count
Definition: Globals.h:21
DiameterAlgo
Definition: Diameter.h:17
void run() override
The generic run method which calls runImpl() and takes care of setting to the appropriate value...
Definition: Diameter.cpp:32
Definition: Algorithm.h:9
std::pair< count, count > getDiameter() const
Definition: Diameter.cpp:48
A graph (with optional weights) and parallel iterator methods.
Definition: Graph.h:79
double edgeweight
Definition: Globals.h:24