Interface DdoModel<T>
- Type Parameters:
T- the state type
- All Superinterfaces:
Model<T>
- All Known Implementing Classes:
ExactModel
A DdoModel extends the generic Model interface by providing methods related to
relaxation, ranking, width control, and frontier management. It serves as the foundation for
implementing algorithms that construct and explore decision diagrams dynamically (e.g., exact or
approximate methods).
This interface provides several default behaviors, which can be overridden to customize model evaluation, search strategy, or diagram generation.
Responsibilities
- Provide the problem relaxation used for node evaluation (
relaxation()). - Define the ranking strategy between states (
ranking()). - Control the diagram’s width through heuristics (
widthHeuristic()). - Specify how to maintain and update the frontier (
frontier()). - Indicate optional behaviors like caching (
useCache()) or exporting the structure (exportDot()).
-
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of this model but without dominance.Returns a copy of this model but withoutFastLowerBound.default booleanIndicates whether the generated decision diagram should be exported to a DOT file (Graphviz format).fixWidth(int width) Returns a copy of this model but with a fixed width.frontier()Returns the frontier management strategy used to store and expand the current layer of the decision diagram.default StateRanking<T> ranking()Returns the ranking function used to order states within a layer.Returns the relaxation of the model used to evaluate the nodes or layers of the decision diagram.default ReductionStrategy<T> Strategy to select which nodes should be merged together on a relaxed DD.default ReductionStrategy<T> Strategy to select which nodes should be dropped on a restricted DD.setCutSetType(CutSetType type) Returns a copy of this model by changing theCutSetType.setInitialSolution(Solution solution) Returns a copy of this model but with the given initial solution.default StateDistance<T> Returns the distance measure used to compare states, notably to select the neighborhood explored by a large neighborhood search.default ExactModel<T> Convert this model into a model for the exact solver.default booleanuseCache()Indicates whether caching should be used during the diagram construction.useCache(boolean b) Returns a copy of this model by enabling or disabling the cache.default booleanuseLNS()Indicates whether Large Neighborhood Search (LNS) should be used to improve the solution found by this model.default WidthHeuristic<T> Returns the width heuristic controlling the maximum number of nodes per layer.Methods inherited from interface org.ddolib.layered.modeling.Model
debugMode, dominance, initialSolution, lowerBound, problem, variableHeuristic, verbosityLevel
-
Method Details
-
relaxation
Relaxation<T> relaxation()Returns the relaxation of the model used to evaluate the nodes or layers of the decision diagram.The relaxation defines a simplified or approximate version of the problem, which helps bound the objective function or guide the search.
- Returns:
- the
Relaxationobject associated with this model
-
ranking
Returns the ranking function used to order states within a layer.The default implementation imposes no specific order (always returns 0), meaning all states are considered equal in priority. Override this method to implement problem-specific ranking heuristics.
- Returns:
- a
StateRankingcomparator between states
-
widthHeuristic
Returns the width heuristic controlling the maximum number of nodes per layer.The default implementation uses a fixed width of 10.
- Returns:
- a
WidthHeuristicinstance controlling diagram width
-
frontier
Returns the frontier management strategy used to store and expand the current layer of the decision diagram.The default implementation creates a
SimpleFrontierbased onranking()and usesCutSetType.LastExactLayeras the cut set.- Returns:
- a
Frontierinstance defining the search frontier
-
useCache
default boolean useCache()Indicates whether caching should be used during the diagram construction.Caching stores intermediate results to avoid redundant computations. By default, caching is disabled.
- Returns:
trueif caching is enabled,falseotherwise
-
useCache
Returns a copy of this model by enabling or disabling the cache.- Parameters:
b- whether the cache must be used- Returns:
- a copy of this model by enabling or disabling the cache
-
exportDot
default boolean exportDot()Indicates whether the generated decision diagram should be exported to a DOT file (Graphviz format).This feature allows visualization of the structure of the generated decision diagram for debugging or analysis purposes. By default, export is disabled.
- Returns:
trueif DOT export is enabled,falseotherwise
-
relaxStrategy
Strategy to select which nodes should be merged together on a relaxed DD.- Returns:
- the
ReductionStrategyused to merge nodes in a relaxed decision diagram
-
restrictStrategy
Strategy to select which nodes should be dropped on a restricted DD.- Returns:
- the
ReductionStrategyused to drop nodes in a restricted decision diagram
-
stateDistance
Returns the distance measure used to compare states, notably to select the neighborhood explored by a large neighborhood search.- Returns:
- the
StateDistanceused to compare states
-
useLNS
default boolean useLNS()Indicates whether Large Neighborhood Search (LNS) should be used to improve the solution found by this model.By default, LNS is disabled.
- Returns:
trueif LNS is enabled,falseotherwise
-
fixWidth
Returns a copy of this model but with a fixed width.- Parameters:
width- the maximum width of the diagram- Returns:
- a copy of this model but with a fixed width
-
setCutSetType
Returns a copy of this model by changing theCutSetType.- Parameters:
type- the new cutset type- Returns:
- a copy of this model by changing the
CutSetType
-
disableDominance
Description copied from interface:ModelReturns a copy of this model but without dominance.- Specified by:
disableDominancein interfaceModel<T>- Returns:
- a copy of this model but without dominance
-
disableLowerBound
Description copied from interface:ModelReturns a copy of this model but withoutFastLowerBound.- Specified by:
disableLowerBoundin interfaceModel<T>- Returns:
- a copy of this model but without
FastLowerBound
-
toExactModel
Convert this model into a model for the exact solver.- Returns:
- a model usable by an
ExactModel
-
setInitialSolution
Returns a copy of this model but with the given initial solution.- Specified by:
setInitialSolutionin interfaceModel<T>- Parameters:
solution- the initial solution (seeModel.initialSolution())- Returns:
- a copy of this model but with the given initial solution
-