almete.BronKerbosch
almete.BronKerbosch(edges)
Implementation of Bron-Kerbosch algorithm to find maximal cliques in an undirected graph. This algorithm variant uses pivoting and a modification developed by Tomita.
argument | description |
---|
edges | An iterable of edges to build the graph from. An edge is an array of two nodes. |
Returns maximal cliques as an array of arrays.
dependencies
no dependencies
setup
Install the package via npm.
npm install almete.bronkerbosch
Import the module into your Node.js project.
const almete = {BronKerbosch: require('almete.bronkerbosch')};
Include the code in your page via a CDN.
<script src="https://unpkg.com/almete.bronkerbosch"></script>
usage
let edges = [[6, 4], [4, 3], [4, 5], [5, 2], [5, 1], [1, 2]];
let cliques = almete.BronKerbosch(edges);
see also