Find maximal cliques for large & sparse network
IN A NUTSHELL: The code is based on maximalCliques() by Jeffrey Wildman, 2011. It uses logical indexing instead of set operations for better memory performance, and uses degeneracy ordering for faster performance with large and sparse network.
-----------------------------------
MORE DETAILS: It finds maximal cliques using the Bron-Kerbosch algorithm with both pivoting and degeneracy ordering. Degeneracy ordering speeds up the algorithm especially when the graph is large & sparse.
Given a graph's adjacency matrix, A, it finds all maximal cliques on A using the Bron-Kerbosch algorithm in a recursive manner. The graph is required to be undirected and must contain no self-edges.
The output is a sparse matrix where each column indicates a clique.
Part of the code is based on maximalCliques() by Jeffrey Wildman, 2011.
Algorithm Reference: Eppstein, Loffler, and Strash "Listing All Maximal Cliques in Sparse Graphs in Near-Optimal Time
", 2010
Cite As
max Wei (2024). Find maximal cliques for large & sparse network (https://www.mathworks.com/matlabcentral/fileexchange/47524-find-maximal-cliques-for-large-sparse-network), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Acknowledgements
Inspired by: Bron-Kerbosch maximal clique finding algorithm
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.