Class StableSet

All Implemented Interfaces:
Iterable<Integer>

public class StableSet extends VertexSet
A stable set is a set of vertices of a graph, no two of which are adjacent. It is also called an independent set of vertices.
Author:
Cristian Frăsinaru
  • Constructor Details

    • StableSet

      public StableSet(Graph graph)
    • StableSet

      public StableSet(Graph graph, int initialCapacity)
    • StableSet

      public StableSet(Graph graph, int[] vertices)
  • Method Details

    • 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 stable set.
      Returns:
      true if the stable set is valid, false otherwise.
    • isMaximal

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