Chemical Data Processing Library C++ API - Version 1.4.0
Classes | Public Member Functions | List of all members
CDPL::Util::BronKerboschAlgorithm Class Reference

Implementation of the Bron-Kerbosch clique-detection algorithm [BKA]. More...

#include <BronKerboschAlgorithm.hpp>

Public Member Functions

 BronKerboschAlgorithm ()
 Constructs the BronKerboschAlgorithm instance without an associated adjacency matrix. More...
 
 BronKerboschAlgorithm (const BitSetArray &adj_mtx)
 Constructs the BronKerboschAlgorithm instance and immediately initializes it with the adjacency matrix adj_mtx. More...
 
 BronKerboschAlgorithm (const BronKerboschAlgorithm &bka)
 Constructs a copy of the BronKerboschAlgorithm instance bka. More...
 
void init (const BitSetArray &adj_mtx)
 (Re-)initializes the algorithm with the adjacency matrix adj_mtx and resets the clique iterator. More...
 
bool nextClique (BitSet &clique)
 Advances the clique iterator and writes the next maximal clique into clique. More...
 
BronKerboschAlgorithmoperator= (const BronKerboschAlgorithm &bka)
 Copy assignment operator. More...
 

Detailed Description

Implementation of the Bron-Kerbosch clique-detection algorithm [BKA].

Constructor & Destructor Documentation

◆ BronKerboschAlgorithm() [1/3]

CDPL::Util::BronKerboschAlgorithm::BronKerboschAlgorithm ( )
inline

Constructs the BronKerboschAlgorithm instance without an associated adjacency matrix.

◆ BronKerboschAlgorithm() [2/3]

CDPL::Util::BronKerboschAlgorithm::BronKerboschAlgorithm ( const BitSetArray adj_mtx)

Constructs the BronKerboschAlgorithm instance and immediately initializes it with the adjacency matrix adj_mtx.

Parameters
adj_mtxThe graph adjacency matrix (one Util::BitSet per node).

◆ BronKerboschAlgorithm() [3/3]

CDPL::Util::BronKerboschAlgorithm::BronKerboschAlgorithm ( const BronKerboschAlgorithm bka)

Constructs a copy of the BronKerboschAlgorithm instance bka.

Parameters
bkaThe BronKerboschAlgorithm instance to copy.

Member Function Documentation

◆ init()

void CDPL::Util::BronKerboschAlgorithm::init ( const BitSetArray adj_mtx)

(Re-)initializes the algorithm with the adjacency matrix adj_mtx and resets the clique iterator.

Parameters
adj_mtxThe graph adjacency matrix (one Util::BitSet per node).

◆ nextClique()

bool CDPL::Util::BronKerboschAlgorithm::nextClique ( BitSet clique)

Advances the clique iterator and writes the next maximal clique into clique.

Parameters
cliqueThe output clique (set of node indices).
Returns
true if a clique was emitted, and false when the iteration is exhausted.

◆ operator=()

BronKerboschAlgorithm& CDPL::Util::BronKerboschAlgorithm::operator= ( const BronKerboschAlgorithm bka)

Copy assignment operator.

Parameters
bkaThe other BronKerboschAlgorithm instance.
Returns
A reference to itself.

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