Interface IMoveFactory

  • All Superinterfaces:
    ISelf<Solver>
    All Known Subinterfaces:
    ISolver
    All Known Implementing Classes:
    Solver

    public interface IMoveFactory
    extends ISelf<Solver>
    Interface to define how to explore the search space from a macro perspective (DFS, LDS, LNS, etc.)
    Author:
    Charles Prud'Homme, Jean-Guillaume Fages
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default void setDDS​(int discrepancy)
      Depth-bounded Discrepancy Search[1] algorithms with binary decisions
      default void setDFS()
      Depth-First Search algorithm with binary decisions
      default void setGeometricalRestart​(long base, double geometricalFactor, ICounter restartStrategyLimit, int restartLimit)
      Build a geometrical restart strategy.
      default void setHBFS​(double a, double b, long N)
      Creates a move object based on: Hybrid Best-First Search[1] algorithms with binary decisions.
      default void setLDS​(int discrepancy)
      Limited Discrepancy Search[1] algorithms with binary decisions
      default void setLNS​(INeighbor neighbor)
      Creates a Move object based on Large Neighborhood Search.
      default void setLNS​(INeighbor neighbor, ICounter restartCounter)
      Creates a Move object based on Large Neighborhood Search.
      default void setLubyRestart​(long scaleFactor, ICounter restartStrategyLimit, int restartLimit)
      Branch a luby restart strategy to the model
      default void setRestartOnSolutions()
      Creates a Move object that encapsulates the current move within a restart move.
      default void setRestarts​(LongCriterion restartCriterion, org.chocosolver.cutoffseq.ICutoffStrategy restartStrategy, int restartsLimit)
      Creates a Move object that encapsulates the current move within a restart move.
      • Methods inherited from interface org.chocosolver.solver.ISelf

        ref
    • Method Detail

      • setDFS

        default void setDFS()
        Depth-First Search algorithm with binary decisions
      • setLDS

        default void setLDS​(int discrepancy)
        Limited Discrepancy Search[1] algorithms with binary decisions

        [1]:W.D. Harvey and M.L.Ginsberg, Limited Discrepancy Search, IJCAI-95.

        Parameters:
        discrepancy - the maximum discrepancy
      • setDDS

        default void setDDS​(int discrepancy)
        Depth-bounded Discrepancy Search[1] algorithms with binary decisions

        [1]:T. Walsh, Depth-bounded Discrepancy Search, IJCAI-97.

        Parameters:
        discrepancy - the maximum discrepancy
      • setHBFS

        default void setHBFS​(double a,
                             double b,
                             long N)
        Creates a move object based on: Hybrid Best-First Search[1] algorithms with binary decisions.

        [1]:D. Allouche, S. de Givry, G. Katsirelos, T. Schiex, M. Zytnicki, Anytime Hybrid Best-First Search with Tree Decomposition for Weighted CSP, CP-2015.

        Parameters:
        a - lower bound to limit the rate of redundantly propagated decisions
        b - upper bound to limit the rate of redundantly propagated decisions.
        N - backtrack limit for each DFS try, should be large enough to limit redundancy
      • setRestarts

        default void setRestarts​(LongCriterion restartCriterion,
                                 org.chocosolver.cutoffseq.ICutoffStrategy restartStrategy,
                                 int restartsLimit)
        Creates a Move object that encapsulates the current move within a restart move. Every time the restartCriterion is met, a restart is done, the new restart limit is updated thanks to restartStrategy. There will be at most restartsLimit restarts.
        Parameters:
        restartCriterion - the restart criterion, that is, the condition which triggers a restart
        restartStrategy - the way restart limit (evaluated in restartCriterion) is updated, that is, computes the next limit
        restartsLimit - number of allowed restarts
      • setLubyRestart

        default void setLubyRestart​(long scaleFactor,
                                    ICounter restartStrategyLimit,
                                    int restartLimit)
        Branch a luby restart strategy to the model
        Parameters:
        scaleFactor - scale factor
        restartStrategyLimit - restart trigger
        restartLimit - restart limits (limit of number of restarts)
      • setGeometricalRestart

        default void setGeometricalRestart​(long base,
                                           double geometricalFactor,
                                           ICounter restartStrategyLimit,
                                           int restartLimit)
        Build a geometrical restart strategy. The restartStrategyLimit is a ICounter to observe. Once this counter reaches a limit, restart occurs and the next cutoff is computed. At step n, the next cutoff is computed with the following function : b*g^n.
        Parameters:
        base - the initial limit
        geometricalFactor - geometrical factor
        restartStrategyLimit - restart trigger
        restartLimit - restart limits (limit of number of restarts)
      • setRestartOnSolutions

        default void setRestartOnSolutions()
        Creates a Move object that encapsulates the current move within a restart move. Every time a solution is found, a restart is done.
      • setLNS

        default void setLNS​(INeighbor neighbor,
                            ICounter restartCounter)
        Creates a Move object based on Large Neighborhood Search. It encapsulates the current move within a LNS move. Anytime a solution is encountered, it is recorded and serves as a basis for the INeighbor. The INeighbor creates a fragment: selects variables to freeze/unfreeze wrt the last solution found. If a fragment cannot be extended to a solution, a new one is selected by restarting the search. If a fragment induces a search space which a too big to be entirely evaluated, restarting the search can be forced using the restartCriterion. A fast restart strategy is often a good choice.
        Parameters:
        neighbor - the neighbor for the LNS
        restartCounter - the (fast) restart counter. Initial limit gives the frequency.
      • setLNS

        default void setLNS​(INeighbor neighbor)
        Creates a Move object based on Large Neighborhood Search. It encapsulates the current move within a LNS move. Anytime a solution is encountered, it is recorded and serves as a basis for the INeighbor. The INeighbor creates a fragment: selects variables to freeze/unfreeze wrt the last solution found. If a fragment cannot be extended to a solution, a new one is selected by restarting the search.
        Parameters:
        neighbor - the neighbor for the LNS
        See Also:
        setLNS(INeighbor, ICounter)