Class Clique

All Implemented Interfaces:
Iterable<Integer>

public class Clique extends VertexSet
A clique is a set of vertices of a graph such that any two of them are adjacent.
Author:
Cristian Frăsinaru
  • Constructor Details

    • Clique

      public Clique(Graph graph)
    • Clique

      public Clique(Graph graph, int initialCapacity)
    • Clique

      public Clique(Graph graph, int[] vertices)
      Parameters:
      graph - the graph this clique belongs to.
      vertices - the vertices of the clique.
    • Clique

      public Clique(VertexSet other)
      Parameters:
      other - a vertex set.
  • Method Details

    • union

      public Clique union(int... other)
      Overrides:
      union in class VertexSet
      Parameters:
      other - an array of vertex numbers.
      Returns:
      a new set containing vertices belonging to this set or the other array.
    • checkEdge

      protected void checkEdge(int v, int u)
    • checkEdges

      protected final void checkEdges()
    • isValid

      public boolean isValid()
      Checks if the vertices in this set actually represent a clique.
      Returns:
      true if the clique is valid, false otherwise.
    • isMaximal

      public boolean isMaximal()
      Checks if the clique is maximal.
      Returns:
      true if the clique is maximal, false otherwise.