Have ideas to improve npm?Join in the discussion! »

    @seregpie/bron-kerbosch

    1.0.0 • Public • Published

    BronKerbosch

    Implementation of the Bron-Kerbosch algorithm to find the maximal cliques in an undirected graph. This algorithm variant uses the pivoting and a modification developed by Tomita.

    argument description
    edges An iterable of the edges to build the graph from. An edge is an array of two nodes.

    Returns the maximal cliques as an array of arrays.

    setup

    npm

    npm install @seregpie/bron-kerbosch

    ES module

    import BronKerbosch from '@seregpie/bron-kerbosch';

    Node

    let BronKerbosch = require('@seregpie/bron-kerbosch');

    browser

    <script src="https://unpkg.com/@seregpie/bron-kerbosch"></script>

    The module is globally available as BronKerbosch.

    usage

    let edges = [[6, 4], [4, 3], [4, 5], [5, 2], [5, 1], [1, 2]];
    let cliques = BronKerbosch(edges);
    // => [[4, 6], [4, 3], [4, 5], [2, 5, 1]]

    see also

    Install

    npm i @seregpie/bron-kerbosch

    DownloadsWeekly Downloads

    8

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.96 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar