Package org.ddolib.ddo.core.mdd
Class LinkedDecisionDiagram<T>
java.lang.Object
org.ddolib.ddo.core.mdd.LinkedDecisionDiagram<T>
- Type Parameters:
T- the type of state used in the problem modeled by this decision diagram
- All Implemented Interfaces:
DecisionDiagram<T>
This class implements a decision diagram as a linked structure (linked MDD).
Each node in the diagram is represented by a Node object, and edges
between nodes represent decisions made during the problem-solving process.
This class supports the compilation of exact, relaxed, and restricted decision
diagrams using various heuristics and dominance rules.
The main responsibilities of this class include:
- Building the decision diagram layer by layer from an initial state.
- Managing exact and relaxed cutsets of nodes.
- Applying restrictions and relaxations to limit layer width.
- Computing local bounds and fast lower bounds.
- Exporting the decision diagram to DOT format for visualization.
- Interfacing with caches to optimize repeated computations.
-
Constructor Summary
ConstructorsConstructorDescriptionLinkedDecisionDiagram(CompilationConfig<T> config) Creates a new linked decision diagram. -
Method Summary
Modifier and TypeMethodDescriptionReturns the set of decisions representing the best solution found in this MDD.Returns the value of the best solution found in this decision diagram, if any.voidcompile()Compiles the decision diagram according to the configuration: Exact, relaxed, or restricted compilation type. Layer-wise variable ordering and heuristics. Application of relaxations or restrictions based on width limits. Construction of the DOT graph if export or debugging is enabled. Optional caching of thresholds for faster branch-and-bound computations.Returns an iterator over the nodes in the exact cutset, transformed into subproblems.Exports the compiled decision diagram in DOT format.booleanisExact()Returns whether the decision diagram is exact.doubleReturns the minimum lower bound of expanded nodes of the MDD during the LNS compilation.booleanChecks whether the best path found in a relaxed MDD consists entirely of exact nodes.
-
Constructor Details
-
LinkedDecisionDiagram
Creates a new linked decision diagram.- Parameters:
config- The configuration object containing problem parameters, heuristics, relaxation operators, dominance checkers, and compilation settings.
-
-
Method Details
-
compile
public void compile()Compiles the decision diagram according to the configuration:- Exact, relaxed, or restricted compilation type.
- Layer-wise variable ordering and heuristics.
- Application of relaxations or restrictions based on width limits.
- Construction of the DOT graph if export or debugging is enabled.
- Optional caching of thresholds for faster branch-and-bound computations.
- Specified by:
compilein interfaceDecisionDiagram<T>
-
minLowerBound
public double minLowerBound()Returns the minimum lower bound of expanded nodes of the MDD during the LNS compilation.- Specified by:
minLowerBoundin interfaceDecisionDiagram<T>- Returns:
- a double, minimum lower bound of expanded nodes of the MDD for the LNS.
-
isExact
public boolean isExact()Returns whether the decision diagram is exact.- Specified by:
isExactin interfaceDecisionDiagram<T>- Returns:
trueif the MDD is exact,falseif relaxed/restricted nodes exist
-
bestValue
Returns the value of the best solution found in this decision diagram, if any.- Specified by:
bestValuein interfaceDecisionDiagram<T>- Returns:
- an
Optionalcontaining the best value or empty if no solution exists
-
bestSolution
Returns the set of decisions representing the best solution found in this MDD.- Specified by:
bestSolutionin interfaceDecisionDiagram<T>- Returns:
- an
Optionalcontaining the set of decisions in the best solution, or empty if no solution exists
-
exactCutset
Returns an iterator over the nodes in the exact cutset, transformed into subproblems.- Specified by:
exactCutsetin interfaceDecisionDiagram<T>- Returns:
- iterator of subproblems in the exact cutset
-
relaxedBestPathIsExact
public boolean relaxedBestPathIsExact()Checks whether the best path found in a relaxed MDD consists entirely of exact nodes.- Specified by:
relaxedBestPathIsExactin interfaceDecisionDiagram<T>- Returns:
trueif the best path contains only exact nodes,falseotherwise
-
exportAsDot
Exports the compiled decision diagram in DOT format.- Specified by:
exportAsDotin interfaceDecisionDiagram<T>- Returns:
- a string containing the DOT representation of the MDD
-