Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
CliqueFinderHeuristic.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Graph.h>
35#include <ogdf/basic/basic.h>
37
38namespace ogdf {
39class AdjacencyOracle;
40template<class E>
41class List;
42
44
52public:
55
61 inline void setPostProcessing(bool postProcess) { m_postProcess = postProcess; }
62
72 void setDensity(double density) {
73 if (density < 0.0) {
74 m_density = 0.0;
75 } else if (density > 1.0) {
76 m_density = 1.0;
77 } else {
78 m_density = density;
79 }
80 }
81
82protected:
84 void doCall() override;
85
90 void preProcess();
91
99 void postProcessCliques(List<List<node>*>& cliqueList);
100
112 bool allAdjacent(node v, List<node>* vList) const;
113
122
132 void findClique(node v, List<node>& neighbours);
133
134private:
135 double m_density;
136
138
140
142};
143
144}
Declares ogdf::CliqueFinderModule class.
Includes declaration of graph class.
Basic declarations, included by all source files.
Tells you in constant time if two nodes are adjacent.
Finds cliques and dense subgraphs using a heuristic.
int evaluate(node v)
Evaluates v in m_pCopy heuristically concerning its qualification as a clique start node.
void setDensity(double density)
Sets the density needed for subgraphs to be detected.
void doCall() override
Find cliques in m_pCopy.
double m_density
Value in [0,1] defining how dense subgraphs need to be.
void findClique(node v, List< node > &neighbours)
Searches for a clique/dense subgraph around node v in list neighbours.
void postProcessCliques(List< List< node > * > &cliqueList)
If postprocessing is activated, use the result of the first phase and revisit cliques that are too sm...
bool m_postProcess
Whether postprocessing should be activated.
void preProcess()
Deletes all nodes from m_pCopy with degree < m_density * m_minDegree in O(n+m).
NodeArray< bool > m_usedNode
Whether the node is already assigned to a clique.
AdjacencyOracle * m_adjOracle
Adjacency oracle for m_pCopy.
void setPostProcessing(bool postProcess)
Sets whether postprocessing should be activated.
CliqueFinderHeuristic()
Creates a CliqueFinderHeuristic.
bool allAdjacent(node v, List< node > *vList) const
Checks whether v is adjacent to (at least m_density times) all nodes in vList.
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
Class for the representation of nodes.
Definition Graph_d.h:241
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.