GraphCoarsening.h
Go to the documentation of this file.
1 /*
2  * GraphCoarsening.h
3  *
4  * Created on: 30.10.2012
5  * Author: Christian Staudt (christian.staudt@kit.edu)
6  */
7
8 #ifndef GRAPHCOARSENING_H_
9 #define GRAPHCOARSENING_H_
10
11 #include "../graph/Graph.h"
12 #include "../base/Algorithm.h"
13
14 namespace NetworKit {
15
20 class GraphCoarsening : public Algorithm {
21
22 public:
23
24  GraphCoarsening(const Graph& G);
25
26  virtual ~GraphCoarsening() = default;
27
28  virtual void run() = 0;
29
30  Graph getCoarseGraph() const;
31
35  std::vector<node> getFineToCoarseNodeMapping() const;
36
40  std::map<node, std::vector<node> > getCoarseToFineNodeMapping() const;
41
42 protected:
43  const Graph& G;
45  std::vector<node> nodeMapping;
46
47 };
48
49 } // namespace
50
51
52 #endif /* GRAPHCOARSENING_H_ */
std::map< node, std::vector< node > > getCoarseToFineNodeMapping() const
Get mapping from coarse node to collection of fine nodes.
Definition: GraphCoarsening.cpp:31
std::vector< node > getFineToCoarseNodeMapping() const
Get mapping from fine to coarse node.
Definition: GraphCoarsening.cpp:23
virtual void run()=0
The generic run method which calls runImpl() and takes care of setting to the appropriate value...
Graph Gcoarsened
Definition: GraphCoarsening.h:44
GraphCoarsening(const Graph &G)
Definition: GraphCoarsening.cpp:12
Abstract base class for graph coarsening/contraction algorithms.
Definition: GraphCoarsening.h:20
virtual ~GraphCoarsening()=default
std::vector< node > nodeMapping
Definition: GraphCoarsening.h:45
Definition: Algorithm.h:9
A graph (with optional weights) and parallel iterator methods.
Definition: Graph.h:79
const Graph & G
Definition: GraphCoarsening.h:43
Graph getCoarseGraph() const
Definition: GraphCoarsening.cpp:16