Code covered by the BSD License  

Highlights from
Bron-Kerbosch maximal clique finding algorithm

5.0

5.0 | 2 ratings Rate this file 31 Downloads (last 30 days) File Size: 2.68 KB File ID: #30413

Bron-Kerbosch maximal clique finding algorithm

by Jeffrey Wildman

 

14 Feb 2011 (Updated 27 Oct 2011)

Implementation of the Bron-Kerbosch algorithm to find all maximal cliques of an undirected graph.

| Watch this File

File Information
Description

[MC] = MAXIMALCLIQUES(A,V_STR) Given a graph's boolean adjacency matrix, A, find all maximal cliques on A using the Bron-Kerbosch algorithm in a recursive manner.

V_STR is an optional input string with the version of the Bron-Kerbosch algorithm to be used (either 'v1' or 'v2'). Version 2 is faster (and default), and version 1 is included for posterity.

The output matrix MC contains the maximal cliques in its columns.

Note: This function can be used to compute the maximal independent sets of a graph A by providing the complement of A as the input graph.

Note: This function can be used to compute the maximal matchings of a graph A by providing the complement of the line graph of A as the input graph.

Ref: Bron, Coen and Kerbosch, Joep, "Algorithm 457: finding all cliques of an undirected graph", Communications of the ACM, vol. 16, no. 9, pp: 575–577, September 1973.

Ref: Cazals, F. and Karande, C., "A note on the problem of reporting maximal cliques", Theoretical Computer Science (Elsevier), vol. 407, no. 1-3, pp: 564-568, November 2008.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Maximal Cliques, Bron-Kerbosch maximal independent set and maximal clique algorithms, Maximal Independent Sets using JGraphT

MATLAB release MATLAB 7.12 (2011a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
01 Nov 2011 Akli Benali  
02 Nov 2011 Akli Benali

Very nice work. The function is very fast, efficient and accurate. When compared with the one posted by Ahmad, it is about 1000 times faster.

09 Mar 2012 Edmund Brekke  
20 May 2012 Habib

Very nice work. How can one modify the code in order to limit the number of maximal cliques found so far. That is, one may need only a subset of maximal cliques and only the number of them is important but not specified ones.

Please login to add a comment or rating.
Updates
27 Oct 2011

Updated: 10/27/2011 - updated documentation & removal of ~ punctuation to ignore function output arguments for better compatibility with older MATLAB versions prior to 2009b (Thanks to Akli Benali).

Tag Activity for this File
Tag Applied By Date/Time
bronkerbosch Jeffrey Wildman 15 Feb 2011 09:49:52
maximal Jeffrey Wildman 15 Feb 2011 09:49:52
clique Jeffrey Wildman 15 Feb 2011 09:49:52
independent set Jeffrey Wildman 15 Feb 2011 09:49:52
graph theory Jeffrey Wildman 15 Feb 2011 09:49:52
matching Jeffrey Wildman 15 Feb 2011 09:49:52
maximal Pavle 04 Jun 2011 11:09:08
clique sudip mondal 01 Sep 2011 04:48:29
maximal cliques Lu 16 Dec 2011 09:11:08

Contact us at files@mathworks.com