Class PropagationGuidedNeighborhood
- java.lang.Object
-
- org.chocosolver.solver.search.loop.lns.neighbors.Neighbor
-
- org.chocosolver.solver.search.loop.lns.neighbors.PropagationGuidedNeighborhood
-
- All Implemented Interfaces:
ICause
- Direct Known Subclasses:
ReversePropagationGuidedNeighborhood
public class PropagationGuidedNeighborhood extends Neighbor
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 inNeighbor.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
-
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.Neighbor
forEachIntVar, freeze, isSearchComplete, loadFromSolution, recordSolution
-
-
-
-
Field Detail
-
n
protected final int n
Number of variables
-
dsize
protected int[] dsize
Domain size of each variable inNeighbor.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 class:Neighbor
Freezes some variables in order to have a fast computation. The fixed variables are declared as decisions in the decision path.- Specified by:
fixSomeVariables
in classNeighbor
- 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 class:Neighbor
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)- Overrides:
restrictLess
in classNeighbor
-
-