- java.lang.Object
-
- org.chocosolver.solver.constraints.nary.nvalue.amnv.mis.Rk
-
-
Constructor Summary
Constructors Constructor Description Rk(UndirectedGraph graph)
Creates an instance of the Random heuristic to compute independent sets on graph uses the default setting DEFAULT_K=30Rk(UndirectedGraph graph, int k)
Creates an instance of the Random heuristic to compute independent sets on graph
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
computeMIS()
Computes an Independent Set as large as possible, although it is not necessarily maximumBitSet
getMIS()
boolean
hasNextMIS()
void
prepare()
Potentially performs some calculation before computing independent sets
-
-
-
Field Detail
-
defaultKValue
public static int defaultKValue
number of random iterations
-
graph
protected UndirectedGraph graph
-
n
protected int n
-
k
protected int k
-
iter
protected int iter
-
out
protected BitSet out
-
inMIS
protected BitSet inMIS
-
rd
protected Random rd
-
-
Constructor Detail
-
Rk
public Rk(UndirectedGraph graph, int k)
Creates an instance of the Random heuristic to compute independent sets on graph- Parameters:
graph
- on which IS have to be computedk
- number of iterations (i.e. number of expected IS per propagation)
-
Rk
public Rk(UndirectedGraph graph)
Creates an instance of the Random heuristic to compute independent sets on graph uses the default setting DEFAULT_K=30- Parameters:
graph
- on which IS have to be computed
-
-
Method Detail
-
prepare
public void prepare()
Description copied from interface:F
Potentially performs some calculation before computing independent sets
-
computeMIS
public void computeMIS()
Description copied from interface:F
Computes an Independent Set as large as possible, although it is not necessarily maximum- Specified by:
computeMIS
in interfaceF
-
getMIS
public BitSet getMIS()
-
hasNextMIS
public boolean hasNextMIS()
- Specified by:
hasNextMIS
in interfaceF
- Returns:
- true iff the heuristic can compute another independent set
-
-