Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

CliqueFinderModule.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/List.h>
35 #include <ogdf/basic/GraphCopy.h>
37 
38 namespace ogdf {
39 
41 
47 
48 public:
55  explicit CliqueFinderModule()
56  : m_pGraph(nullptr)
57  , m_pCopy(nullptr)
58  , m_minDegree(2)
59  { }
60 
61  virtual ~CliqueFinderModule() { }
62 
64 
71  void call(const Graph &G, NodeArray<int> &cliqueNumber);
72 
74 
80  void call(const Graph &G, List<List<node>*> &cliqueLists);
81 
84 
86  void setMinSize(int i) { m_minDegree = max(0, i-1); }
87 
91 
99  static void cliqueListToNumber(const Graph &G,
100  const List<List<node>*> &cliqueLists,
101  NodeArray<int> &cliqueNumber);
102 
111  static void cliqueNumberToList(const Graph &G,
112  const NodeArray<int> &cliqueNumber,
113  List<List<node>*> &cliqueLists);
114 
126  static void cliqueGraphAttributes(const Graph &G,
127  const NodeArray<int> &cliqueNumber,
128  GraphAttributes &GA);
129 
140  static bool cliqueOK(const Graph &G,
142  double density = 1.0);
143 
145 
146 private:
148 
151  void beginCall(const Graph &G);
152 
158  void setResults(NodeArray<int> &cliqueNumber);
159 
167  void setResults(List<List<node>*> &cliqueLists);
168 
170  void endCall();
171 
177  bool handleTrivialCases();
178 
179  const Graph *m_pGraph;
180 
181 protected:
183 
185 
187 
192  virtual void doCall() = 0;
193 
195 };
196 
197 }
Declaration of class GraphAttributes which extends a Graph by additional attributes.
NodeArray< int > m_copyCliqueNumber
The clique number for each node in m_pCopy.
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:492
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
#define OGDF_MALLOC_NEW_DELETE
Makes the class use malloc for memory allocation.
Definition: memory.h:91
const Graph * m_pGraph
The original Graph in which cliques are searched.
Stores additional attributes of a graph (like layout information).
Doubly linked lists (maintaining the length of the list).
Definition: List.h:40
Declaration of graph copy classes.
no new dummy nodes are introduced, for every hyperedge e = (v_1, ..., v_l), we add a cliqie K_l conne...
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:249
GraphCopy * m_pCopy
Copy of m_pGraph without self-loops and multi-edges.
CliqueFinderModule()
Creates a CliqueFinderModule.
int m_minDegree
Minimum degree of the nodes in a found clique.
void setMinSize(int i)
Sets the minimum size of a clique.
The namespace for all OGDF objects.
Declaration of doubly linked lists and iterators.