Package org.graph4j.util
Class StableSet
java.lang.Object
org.graph4j.util.VertexCollection
org.graph4j.util.VertexSet
org.graph4j.util.StableSet
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
-
Field Summary
Fields inherited from class org.graph4j.util.VertexCollection
bitset, DEFAULT_CAPACITY, first, graph, numVertices, vertices -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.graph4j.util.VertexSet
add, addAll, addDirectly, clear, contains, equals, hashCode, indexOf, intersection, intersection, peek, pop, remove, removeFromPos, union, unionMethods inherited from class org.graph4j.util.VertexCollection
computeVerticesWeight, getGraph, grow, indexOf, isClique, isEmpty, isStableSet, iterator, numVertices, removeAll, removeLast, retainAll, size, toString, union, vertexToString, verticesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
StableSet
-
StableSet
-
StableSet
-
-
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:
trueif the stable set is valid,falseotherwise.
-
isMaximal
public boolean isMaximal()Checks if the stable set is maximal.- Returns:
trueif the stable set is maximal,falseotherwise.
-