Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

CliqueFinderModule.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 #include <ogdf/basic/GraphCopy.h>
36 #include <ogdf/basic/List.h>
37 
38 namespace ogdf {
39 
41 
47 public:
54  explicit CliqueFinderModule() : m_pGraph(nullptr), m_pCopy(nullptr), m_minDegree(2) { }
55 
56  virtual ~CliqueFinderModule() { }
57 
59 
66  void call(const Graph& G, NodeArray<int>& cliqueNumber);
67 
69 
75  void call(const Graph& G, List<List<node>*>& cliqueLists);
76 
79 
81  void setMinSize(int i) { m_minDegree = max(0, i - 1); }
82 
86 
94  static void cliqueListToNumber(const Graph& G, const List<List<node>*>& cliqueLists,
95  NodeArray<int>& cliqueNumber);
96 
105  static void cliqueNumberToList(const Graph& G, const NodeArray<int>& cliqueNumber,
106  List<List<node>*>& cliqueLists);
107 
119  static void cliqueGraphAttributes(const Graph& G, const NodeArray<int>& cliqueNumber,
120  GraphAttributes& GA);
121 
132  static bool cliqueOK(const Graph& G, List<node>* clique, double density = 1.0);
133 
135 
136 private:
138 
141  void beginCall(const Graph& G);
142 
148  void setResults(NodeArray<int>& cliqueNumber);
149 
157  void setResults(List<List<node>*>& cliqueLists);
158 
160  void endCall();
161 
167  bool handleTrivialCases();
168 
169  const Graph* m_pGraph;
170 
171 protected:
173 
175 
177 
182  virtual void doCall() = 0;
183 
185 };
186 
187 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:66
GraphAttributes.h
Declaration of class GraphAttributes which extends a Graph by additional attributes.
ogdf::CliqueFinderModule::m_pGraph
const Graph * m_pGraph
The original Graph in which cliques are searched.
Definition: CliqueFinderModule.h:169
ogdf::GraphCopy
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:384
ogdf::CliqueFinderModule::m_pCopy
GraphCopy * m_pCopy
Copy of m_pGraph without self-loops and multi-edges.
Definition: CliqueFinderModule.h:172
OGDF_MALLOC_NEW_DELETE
#define OGDF_MALLOC_NEW_DELETE
Makes the class use malloc for memory allocation.
Definition: memory.h:91
ogdf::CliqueFinderModule::CliqueFinderModule
CliqueFinderModule()
Creates a CliqueFinderModule.
Definition: CliqueFinderModule.h:54
ogdf::CliqueFinderModule::m_copyCliqueNumber
NodeArray< int > m_copyCliqueNumber
The clique number for each node in m_pCopy.
Definition: CliqueFinderModule.h:174
GraphCopy.h
Declaration of graph copy classes.
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: List.h:42
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:862
ogdf::CliqueFinderModule
Finds cliques.
Definition: CliqueFinderModule.h:46
ogdf::CliqueFinderModule::m_minDegree
int m_minDegree
Minimum degree of the nodes in a found clique.
Definition: CliqueFinderModule.h:176
ogdf::CliqueFinderModule::setMinSize
void setMinSize(int i)
Sets the minimum size of a clique.
Definition: CliqueFinderModule.h:81
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
List.h
Declaration of doubly linked lists and iterators.
ogdf::CliqueFinderModule::~CliqueFinderModule
virtual ~CliqueFinderModule()
Definition: CliqueFinderModule.h:56