Class MD
- java.lang.Object
-
- org.chocosolver.solver.constraints.nary.nvalue.amnv.mis.MD
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]fifoprotected UndirectedGraphgraphprotected BitSetinMISprotected intnprotected int[]nbNeighboursprotected BitSetout
-
Constructor Summary
Constructors Constructor Description MD(UndirectedGraph graph)Creates an instance of the Min Degree heuristic to compute independent sets on graph
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddToMIS(int node)voidcomputeMIS()Computes an Independent Set as large as possible, although it is not necessarily maximumBitSetgetMIS()booleanhasNextMIS()voidprepare()Potentially performs some calculation before computing independent sets
-
-
-
Field Detail
-
graph
protected UndirectedGraph graph
-
n
protected int n
-
out
protected BitSet out
-
inMIS
protected BitSet inMIS
-
nbNeighbours
protected int[] nbNeighbours
-
fifo
protected int[] fifo
-
-
Constructor Detail
-
MD
public MD(UndirectedGraph graph)
Creates an instance of the Min Degree heuristic to compute independent sets on graph- Parameters:
graph- the graph
-
-
Method Detail
-
prepare
public void prepare()
Description copied from interface:FPotentially performs some calculation before computing independent sets
-
computeMIS
public void computeMIS()
Description copied from interface:FComputes an Independent Set as large as possible, although it is not necessarily maximum- Specified by:
computeMISin interfaceF
-
addToMIS
protected void addToMIS(int node)
-
getMIS
public BitSet getMIS()
-
hasNextMIS
public boolean hasNextMIS()
- Specified by:
hasNextMISin interfaceF- Returns:
- true iff the heuristic can compute another independent set
-
-