MaximalCliques.h
Go to the documentation of this file.
1 #ifndef MAXIMAL_CLIQUES_H_
2 #define MAXIMAL_CLIQUES_H_
3
4 #include "../graph/Graph.h"
5 #include "../base/Algorithm.h"
6 #include <functional>
7
8 namespace NetworKit {
9
27 class MaximalCliques : public Algorithm {
28
29 public:
41  MaximalCliques(const Graph& G, bool maximumOnly = false);
42
53  MaximalCliques(const Graph& G, std::function<void(const std::vector<node>&)> callback);
54
58  void run() override;
59
69  const std::vector<std::vector<node>>& getCliques() const;
70
71 protected:
72  const Graph& G;
73
74  std::vector<std::vector<node>> result;
75
76  std::function<void(const std::vector<node>&)> callback;
78 };
79
80 }
81
82 #endif /* MAXIMAL_CLIQUES_H_ */
const std::vector< std::vector< node > > & getCliques() const
Return all found cliques unless a callback was given.
Definition: MaximalCliques.cpp:381
void run() override
Execute the maximal clique listing algorithm.
Definition: MaximalCliques.cpp:387
std::function< void(const std::vector< node > &)> callback
Definition: MaximalCliques.h:76
MaximalCliques(const Graph &G, bool maximumOnly=false)
Construct the maximal cliques algorithm with the given graph.
Definition: MaximalCliques.cpp:375
const Graph & G
Definition: MaximalCliques.h:72
std::vector< std::vector< node > > result
Definition: MaximalCliques.h:74
bool maximumOnly
Definition: MaximalCliques.h:77
Algorithm for listing all maximal cliques.
Definition: MaximalCliques.h:27
Definition: Algorithm.h:9
A graph (with optional weights) and parallel iterator methods.
Definition: Graph.h:79