Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

ogdf::CliqueFinder Class Reference

Finds cliques and dense subgraphs. More...

#include <ogdf/graphalg/CliqueFinder.h>

Public Types

enum  postProcess { postProcess::None, postProcess::Simple }
 

Public Member Functions

 CliqueFinder (const Graph &G)
 
 ~CliqueFinder ()
 
void call (NodeArray< int > &cliqueNumber)
 Searches for cliques and returns the clique index number for each node. More...
 
void call (List< List< node > > &cliqueLists)
 Searches for cliques and returns the list of cliques. More...
 
void setDensity (int density)
 Sets the abstract measure of density needed for subgraphs to be detected. More...
 
void setMinSize (int i)
 the minimum degree of the nodes within the clique/subgraph More...
 

Protected Member Functions

bool allAdjacent (node v, List< node > *vList)
 
bool cliqueOK (List< node > *clique)
 
void doCall (int minDegree=2)
 doing the real work, find subgraphs in graph G, skip all nodes with degree < minDegree value 2: all triangles are cliques More...
 
int evaluate (node v, EdgeArray< bool > &usableEdge)
 
void findClique (node v, List< node > &neighbours, int numRandom=0)
 
void postProcessCliques (List< List< node > * > &cliqueList, EdgeArray< bool > &usableEdge)
 
void setResults (NodeArray< int > &cliqueNumber)
 
void setResults (List< List< node > > &cliqueLists)
 
void setResults (List< List< node > * > &cliqueLists)
 
void writeGraph (Graph &G, NodeArray< int > &cliqueNumber, const char *fileName)
 

Private Attributes

bool m_callByList
 
NodeArray< int > m_copyCliqueNumber
 
int m_density
 
int m_minDegree
 
int m_numberOfCliques
 
GraphCopy * m_pCopy
 
const Graph * m_pGraph
 
List< List< node > > * m_pList
 
postProcess m_postProcess
 
NodeArray< bool > m_usedNode
 

Detailed Description

Finds cliques and dense subgraphs.

The class CliqueFinder can be called on a graph to retrieve (disjoint) cliques or dense subgraphs respectively. Uses SPQR trees to find 3-connected components.

In the following, clique always stands for a subgraph with properties that can be defined by the user to change the standard definition of a complete subgraph, e.g. a minimum size/degree etc. We search for cliques in graph G by first dividing G into its triconnnected components and then using a greedy heuristics within each component

Definition at line 60 of file CliqueFinder.h.

Member Enumeration Documentation

◆ postProcess

Enumerator
None 
Simple 

Definition at line 87 of file CliqueFinder.h.

Constructor & Destructor Documentation

◆ CliqueFinder()

ogdf::CliqueFinder::CliqueFinder ( const Graph &  G)
explicit

◆ ~CliqueFinder()

ogdf::CliqueFinder::~CliqueFinder ( )

Member Function Documentation

◆ allAdjacent()

bool ogdf::CliqueFinder::allAdjacent ( node  v,
List< node > *  vList 
)
protected

◆ call() [1/2]

void ogdf::CliqueFinder::call ( NodeArray< int > &  cliqueNumber)

Searches for cliques and returns the clique index number for each node.

Each clique will be assigned a different number, each node gets the number of the clique it is contained in, -1 if not a clique member

◆ call() [2/2]

void ogdf::CliqueFinder::call ( List< List< node > > &  cliqueLists)

Searches for cliques and returns the list of cliques.

Each clique on return is represented by a list of member nodes in the list of cliques cliqueLists

◆ cliqueOK()

bool ogdf::CliqueFinder::cliqueOK ( List< node > *  clique)
protected

◆ doCall()

void ogdf::CliqueFinder::doCall ( int  minDegree = 2)
protected

doing the real work, find subgraphs in graph G, skip all nodes with degree < minDegree value 2: all triangles are cliques

◆ evaluate()

int ogdf::CliqueFinder::evaluate ( node  v,
EdgeArray< bool > &  usableEdge 
)
protected

◆ findClique()

void ogdf::CliqueFinder::findClique ( node  v,
List< node > &  neighbours,
int  numRandom = 0 
)
protected

◆ postProcessCliques()

void ogdf::CliqueFinder::postProcessCliques ( List< List< node > * > &  cliqueList,
EdgeArray< bool > &  usableEdge 
)
protected

◆ setDensity()

void ogdf::CliqueFinder::setDensity ( int  density)
inline

Sets the abstract measure of density needed for subgraphs to be detected.

Does not have an effect for graphs with less than 4 nodes.

Definition at line 93 of file CliqueFinder.h.

◆ setMinSize()

void ogdf::CliqueFinder::setMinSize ( int  i)
inline

the minimum degree of the nodes within the clique/subgraph

Definition at line 86 of file CliqueFinder.h.

◆ setResults() [1/3]

void ogdf::CliqueFinder::setResults ( NodeArray< int > &  cliqueNumber)
protected

◆ setResults() [2/3]

void ogdf::CliqueFinder::setResults ( List< List< node > > &  cliqueLists)
protected

◆ setResults() [3/3]

void ogdf::CliqueFinder::setResults ( List< List< node > * > &  cliqueLists)
protected

◆ writeGraph()

void ogdf::CliqueFinder::writeGraph ( Graph &  G,
NodeArray< int > &  cliqueNumber,
const char *  fileName 
)
protected

Member Data Documentation

◆ m_callByList

bool ogdf::CliqueFinder::m_callByList
private

Definition at line 148 of file CliqueFinder.h.

◆ m_copyCliqueNumber

NodeArray<int> ogdf::CliqueFinder::m_copyCliqueNumber
private

Definition at line 140 of file CliqueFinder.h.

◆ m_density

int ogdf::CliqueFinder::m_density
private

Definition at line 151 of file CliqueFinder.h.

◆ m_minDegree

int ogdf::CliqueFinder::m_minDegree
private

Definition at line 145 of file CliqueFinder.h.

◆ m_numberOfCliques

int ogdf::CliqueFinder::m_numberOfCliques
private

Definition at line 146 of file CliqueFinder.h.

◆ m_pCopy

GraphCopy* ogdf::CliqueFinder::m_pCopy
private

Definition at line 139 of file CliqueFinder.h.

◆ m_pGraph

const Graph* ogdf::CliqueFinder::m_pGraph
private

Definition at line 138 of file CliqueFinder.h.

◆ m_pList

List< List<node> >* ogdf::CliqueFinder::m_pList
private

Definition at line 149 of file CliqueFinder.h.

◆ m_postProcess

postProcess ogdf::CliqueFinder::m_postProcess
private

Definition at line 147 of file CliqueFinder.h.

◆ m_usedNode

NodeArray<bool> ogdf::CliqueFinder::m_usedNode
private

Definition at line 141 of file CliqueFinder.h.


The documentation for this class was generated from the following file: