java.lang.Object
org.jgrapht.alg.vertexcover.RecursiveExactVCImpl.BitSetCover
- Enclosing class:
- RecursiveExactVCImpl<V,E>
protected class RecursiveExactVCImpl.BitSetCover
extends java.lang.Object
Helper class which represents a vertex cover as a space efficient BitSet
-
Field Summary
Fields Modifier and Type Field Description protected java.util.BitSetbitSetCoverprotected doubleweight -
Constructor Summary
Constructors Modifier Constructor Description protectedBitSetCover(int size, int initialWeight)Construct a new empty vertex cover as a BitSet.protectedBitSetCover(RecursiveExactVCImpl.BitSetCover vertexCover)Copy constructor -
Method Summary
Modifier and Type Method Description protected voidaddAllVertices(java.util.List<java.lang.Integer> vertexIndices, double totalWeight)Add multiple vertices in the vertex cover.protected voidaddVertex(int vertexIndex, double weight)Add a vertex in the vertex cover.protected RecursiveExactVCImpl.BitSetCovercopy()Copy a vertex cover.
-
Field Details
-
bitSetCover
protected java.util.BitSet bitSetCover -
weight
protected double weight
-
-
Constructor Details
-
BitSetCover
protected BitSetCover(int size, int initialWeight)Construct a new empty vertex cover as a BitSet.- Parameters:
size- initial capacity of the BitSetinitialWeight- the initial weight
-
BitSetCover
Copy constructor- Parameters:
vertexCover- the input vertex cover to copy
-
-
Method Details
-
copy
Copy a vertex cover.- Returns:
- a copy of the vertex cover
-
addVertex
protected void addVertex(int vertexIndex, double weight)Add a vertex in the vertex cover.- Parameters:
vertexIndex- the index of the vertexweight- the weight of the vertex
-
addAllVertices
protected void addAllVertices(java.util.List<java.lang.Integer> vertexIndices, double totalWeight)Add multiple vertices in the vertex cover.- Parameters:
vertexIndices- the index of the verticestotalWeight- the total weight of the vertices
-