Module org.chocosolver
Class PropagationGuidedNeighborhood
- java.lang.Object
-
- org.chocosolver.solver.search.loop.lns.neighbors.IntNeighbor
-
- org.chocosolver.solver.search.loop.lns.neighbors.PropagationGuidedNeighborhood
-
- Direct Known Subclasses:
ReversePropagationGuidedNeighborhood
public class PropagationGuidedNeighborhood extends IntNeighbor
A Propagation Guided LNSBased on "Propagation Guided Large Neighborhood Search", Perron et al. CP2004.
- Since:
- 08/04/13
- Author:
- Charles Prud'homme
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]
all
Store the modified variablesprotected int[]
dsize
Domain size of each variable inIntNeighbor.variables
protected BitSet
fragment
Indicate which variables are selected in a fragmentprotected Model
mModel
Reference to the modelprotected int
n
Number of variablesprotected Random
rd
For randomness-
Fields inherited from class org.chocosolver.solver.search.loop.lns.neighbors.IntNeighbor
values, variables
-
-
Constructor Summary
Constructors Constructor Description PropagationGuidedNeighborhood(IntVar[] vars, int fgmtSize, int listSize, long seed)
Create a propagation-guided neighbor for LNS
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fixSomeVariables()
Freezes some variables in order to have a fast computation.void
init()
Initialize this neighborvoid
restrictLess()
Use less restriction at the beginning of a LNS run in order to get better solutions Called when no solution was found during a LNS run (trapped into a local optimum)protected void
update()
Create the fragment-
Methods inherited from class org.chocosolver.solver.search.loop.lns.neighbors.IntNeighbor
forEachIntVar, freeze, loadFromSolution, recordSolution
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.chocosolver.solver.search.loop.lns.neighbors.INeighbor
isSearchComplete
-
-
-
-
Field Detail
-
n
protected final int n
Number of variables
-
dsize
protected int[] dsize
Domain size of each variable inIntNeighbor.variables
-
rd
protected Random rd
For randomness
-
all
protected int[] all
Store the modified variables
-
fragment
protected BitSet fragment
Indicate which variables are selected in a fragment
-
mModel
protected Model mModel
Reference to the model
-
-
Constructor Detail
-
PropagationGuidedNeighborhood
public PropagationGuidedNeighborhood(IntVar[] vars, int fgmtSize, int listSize, long seed)
Create a propagation-guided neighbor for LNS- Parameters:
vars
- set of variables to considerfgmtSize
- initial size of the fragmentlistSize
- number of modified variable to store while propagatingseed
- for randomness
-
-
Method Detail
-
fixSomeVariables
public void fixSomeVariables() throws ContradictionException
Description copied from interface:INeighbor
Freezes some variables in order to have a fast computation. The fixed variables are declared as decisions in the decision path.- Throws:
ContradictionException
-
update
protected void update() throws ContradictionException
Create the fragment- Throws:
ContradictionException
- if the fragment is trivially infeasible
-
restrictLess
public void restrictLess()
Description copied from interface:INeighbor
Use less restriction at the beginning of a LNS run in order to get better solutions Called when no solution was found during a LNS run (trapped into a local optimum)
-
init
public void init()
Description copied from interface:INeighbor
Initialize this neighbor
-
-