Interface DecisionDiagram<T>

Type Parameters:
T - the type representing the problem state at a given layer in the diagram
All Known Implementing Classes:
LinkedDecisionDiagram, NoLayerDecisionDiagram

public interface DecisionDiagram<T>
Defines the abstraction of a reusable Decision Diagram (DD) used to model and solve combinatorial optimization problems.

A decision diagram is a layered graph-based representation of the solution space of a problem. Depending on how it is compiled, the DD can be:

  • Exact — representing all feasible solutions of the original problem (no relaxation);
  • Relaxed — merging nodes to reduce the diagram width, potentially omitting some constraints while preserving valid lower or upper bounds on the optimal value.

This interface defines the basic operations available on a compiled DD, including: triggering compilation, accessing the best value or solution, iterating over nodes in the cutset, and exporting the structure for visualization.

  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the sequence of decisions leading to the best solution represented in this DD.
    Returns the value of the best solution represented in this decision diagram, if it exists.
    void
    Triggers the compilation of the decision diagram according to the configuration parameters provided by the user (e.g., width, relaxation, variable heuristic, etc.).
    Provides an iterator over the nodes belonging to the exact cutset of the diagram.
    Exports the compiled decision diagram as a Graphviz-compatible DOT formatted string.
    boolean
    Indicates whether the compiled decision diagram is exact.
    default boolean
    Indicates whether the compilation was interrupted by its stop criterion (for instance a time limit) before reaching the last layer.
    double
    Returns the minimum lower bound among the nodes expanded during the compilation of this decision diagram, mainly used to compute the optimality gap during a large neighborhood search.
    int
    Returns the number of nodes pruned during the compilation of this decision diagram because they were dominated.
    default long
    Returns the number of nodes expanded during the compilation: the nodes whose successors were computed.
    int
    Returns the number of nodes pruned during the compilation of this decision diagram because their fast lower bound could not improve the best known solution.
    default long
    Returns the number of successors computed during the compilation (one per transition applied, before any pruning or merge with an existing node).
    int
    Returns the total number of nodes created during the compilation of this decision diagram.
    boolean
    Checks whether the best path found in the relaxed decision diagram is exact.
  • Method Details

    • compile

      void compile()
      Triggers the compilation of the decision diagram according to the configuration parameters provided by the user (e.g., width, relaxation, variable heuristic, etc.).

      The compilation builds the layered graph structure that encodes the feasible (or relaxed) state space of the problem. Depending on the configuration, this process may yield either an exact or a relaxed DD.

    • isExact

      boolean isExact()
      Indicates whether the compiled decision diagram is exact.

      An exact DD represents the full solution space of the original problem, meaning that the best path in the DD corresponds exactly to the true optimal solution.

      Returns:
      true if the compiled DD is exact; false if it is relaxed
    • isInterrupted

      default boolean isInterrupted()
      Indicates whether the compilation was interrupted by its stop criterion (for instance a time limit) before reaching the last layer. An interrupted DD is incomplete: its solutions, bounds and exactness must not be used.
      Returns:
      true if the compilation was interrupted
    • bestValue

      Optional<Double> bestValue()
      Returns the value of the best solution represented in this decision diagram, if it exists.

      For a relaxed DD, this corresponds to a bound (lower or upper depending on the problem formulation). For an exact DD, it is the exact optimal value.

      Returns:
      an Optional containing the best objective value, or an empty Optional if no solution is available
    • bestSolution

      Optional<Set<Decision>> bestSolution()
      Returns the sequence of decisions leading to the best solution represented in this DD.

      The returned solution corresponds to the path in the diagram that achieves the best (lowest or highest) objective value. If the DD is relaxed, the returned set may not correspond to a fully feasible solution.

      Returns:
      an Optional containing the set of Decision objects defining the best solution, or an empty Optional if none exists
    • exactCutset

      Iterator<SubProblem<T>> exactCutset()
      Provides an iterator over the nodes belonging to the exact cutset of the diagram.

      The exact cutset is the set of subproblems (nodes) that exactly represent the state space at a specific layer, usually the last layer before relaxation or completion. It can be used to guide recomputation, heuristic extensions, or incremental compilation.

      Returns:
      an Iterator over the SubProblem elements forming the exact cutset
    • relaxedBestPathIsExact

      boolean relaxedBestPathIsExact()
      Checks whether the best path found in the relaxed decision diagram is exact.

      This can occur when the relaxation did not alter the structure along the optimal path, meaning the computed best value is equal to the true optimum even though the DD is relaxed.

      Returns:
      true if the relaxed best path corresponds to an exact feasible solution; false otherwise
    • exportAsDot

      String exportAsDot()
      Exports the compiled decision diagram as a Graphviz-compatible DOT formatted string.

      This method is typically used for visualization or debugging purposes. The resulting DOT string can be rendered using Graphviz tools (e.g., dot, neato, or web-based renderers).

      Returns:
      a String containing the DOT representation of the compiled decision diagram
    • nbNodes

      int nbNodes()
      Returns the total number of nodes created during the compilation of this decision diagram.
      Returns:
      the number of nodes
    • nbExpandedNodes

      default long nbExpandedNodes()
      Returns the number of nodes expanded during the compilation: the nodes whose successors were computed.
      Returns:
      the number of expanded nodes
    • nbGeneratedNodes

      default long nbGeneratedNodes()
      Returns the number of successors computed during the compilation (one per transition applied, before any pruning or merge with an existing node).
      Returns:
      the number of generated nodes
    • nbFastLowerBoundPruning

      int nbFastLowerBoundPruning()
      Returns the number of nodes pruned during the compilation of this decision diagram because their fast lower bound could not improve the best known solution.
      Returns:
      the number of nodes pruned by the fast lower bound
    • nbDominancePruning

      int nbDominancePruning()
      Returns the number of nodes pruned during the compilation of this decision diagram because they were dominated.
      Returns:
      the number of nodes pruned by dominance
    • minLowerBound

      double minLowerBound()
      Returns the minimum lower bound among the nodes expanded during the compilation of this decision diagram, mainly used to compute the optimality gap during a large neighborhood search.
      Returns:
      the minimum lower bound of the expanded nodes