Module logicng

Class BronKerbosch<T extends Comparable<T>>

  • Type Parameters:
    T - the node type of the graph

    public final class BronKerbosch<T extends Comparable<T>>
    extends Object
    This class implements the Bron-Kerbosch-Algorithm, used to compute all maximal Cliques of a Graph. Requires that the ids of the nodes are comparable.
    Since:
    1.2
    Version:
    2.0.0
    • Constructor Detail

      • BronKerbosch

        public BronKerbosch​(Graph<T> g)
        Constructor.
        Parameters:
        g - the graph whose maximal cliques are to be computed
    • Method Detail

      • compute

        public Set<SortedSet<Node<T>>> compute()
        Computes the maximal cliques and returns them as a Set of SortedSets of Nodes.
        Returns:
        the maximal cliques.
      • getCliquesAsTLists

        public List<List<T>> getCliquesAsTLists()
        Returns the maximal cliques computed with the last call to compute() as a List of Lists of T.
        Returns:
        the maximal cliques