Finds cliques and dense subgraphs using a heuristic.
More...
#include <ogdf/clique/CliqueFinderHeuristic.h>
Finds cliques and dense subgraphs using a heuristic.
The class CliqueFinderHeuristic can be called on a graph to retrieve (disjoint) cliques or dense subgraphs respectively by using a greedy heuristic.
Definition at line 51 of file CliqueFinderHeuristic.h.
◆ CliqueFinderHeuristic()
ogdf::CliqueFinderHeuristic::CliqueFinderHeuristic |
( |
| ) |
|
|
explicit |
◆ allAdjacent()
bool ogdf::CliqueFinderHeuristic::allAdjacent |
( |
node |
v, |
|
|
List< node > * |
vList |
|
) |
| const |
|
protected |
Checks whether v
is adjacent to (at least m_density times) all nodes in vList
.
- Warning
- m_pGraph must be parallel free!
- Parameters
-
v | The node to check. |
vList | The nodes that potentially form a dense subgraph with v . |
- Returns
- whether node
v
is adjacent to (at least m_density times) all nodes in vList
.
◆ doCall()
void ogdf::CliqueFinderHeuristic::doCall |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ evaluate()
int ogdf::CliqueFinderHeuristic::evaluate |
( |
node |
v | ) |
|
|
protected |
Evaluates v
in m_pCopy heuristically concerning its qualification as a clique start node.
The higher this value, the better the node as a clique start node.
- Returns
- The number of 3-circles starting at
v
.
◆ findClique()
void ogdf::CliqueFinderHeuristic::findClique |
( |
node |
v, |
|
|
List< node > & |
neighbours |
|
) |
| |
|
protected |
Searches for a clique/dense subgraph around node v
in list neighbours
.
neighbours
+ v
will form a clique/dense subgraph afterwards.
- Parameters
-
v | The node around which to search for a clique/dense subgraph. |
neighbours | The nodes which potentially form a clique together with v . Is assigned a list of nodes that actually forms a clique/dense subgraph together with v . |
◆ postProcessCliques()
void ogdf::CliqueFinderHeuristic::postProcessCliques |
( |
List< List< node > * > & |
cliqueList | ) |
|
|
protected |
If postprocessing is activated, use the result of the first phase and revisit cliques that are too small.
These cliques are rearranged to potentially find new, bigger cliques.
- Parameters
-
cliqueList | The cliques to postprocess. |
◆ preProcess()
void ogdf::CliqueFinderHeuristic::preProcess |
( |
| ) |
|
|
protected |
◆ setDensity()
void ogdf::CliqueFinderHeuristic::setDensity |
( |
double |
density | ) |
|
|
inline |
Sets the density needed for subgraphs to be detected.
For a subgraph of size k to recognized as dense, it has to contain at least (density
* (k*(k-1))/2) edges. This setting does not have an effect for graphs with less than 3 nodes.
- Parameters
-
density | value in [0.0 ... 1.0] |
Definition at line 72 of file CliqueFinderHeuristic.h.
◆ setPostProcessing()
void ogdf::CliqueFinderHeuristic::setPostProcessing |
( |
bool |
postProcess | ) |
|
|
inline |
Sets whether postprocessing should be activated.
- Parameters
-
postProcess | Whether postprocessing should be activated. |
Definition at line 61 of file CliqueFinderHeuristic.h.
◆ m_adjOracle
◆ m_density
double ogdf::CliqueFinderHeuristic::m_density |
|
private |
◆ m_postProcess
bool ogdf::CliqueFinderHeuristic::m_postProcess |
|
private |
◆ m_usedNode
NodeArray<bool> ogdf::CliqueFinderHeuristic::m_usedNode |
|
private |
The documentation for this class was generated from the following file: