Class TSRelax

java.lang.Object
org.ddolib.examples.talentscheduling.TSRelax
All Implemented Interfaces:
Relaxation<TSState>

public class TSRelax extends Object implements Relaxation<TSState>
Implementation of a relaxation for the Talent Scheduling problem (TSP).

This class defines how multiple TSState instances can be merged into a single relaxed state and how edge costs are relaxed in the context of DDO or other relaxed decision diagrams.

The relaxation is implemented by merging the remaining and maybe scenes from multiple states:

  • mergedRemaining is the intersection of all remainingScenes sets.
  • mergedMaybe is the union of all remainingScenes and maybeScenes, minus the mergedRemaining scenes.
  • Constructor Details

    • TSRelax

      public TSRelax(TSProblem problem)
      Constructs a new relaxation instance for the given Talent Scheduling problem.
      Parameters:
      problem - The TSP problem instance associated with this relaxation.
  • Method Details

    • mergeStates

      public TSState mergeStates(Iterator<TSState> states)
      Merges multiple TSState instances into a single relaxed state.
      Specified by:
      mergeStates in interface Relaxation<TSState>
      Parameters:
      states - An iterator over the states to merge.
      Returns:
      A new TSState representing the merged state.
    • relaxEdge

      public double relaxEdge(TSState from, TSState to, TSState merged, Decision d, double cost)
      Returns the relaxed edge cost between two states.

      In this implementation, the cost is not changed and returned as-is.

      Specified by:
      relaxEdge in interface Relaxation<TSState>
      Parameters:
      from - The source state.
      to - The target state.
      merged - The merged state if multiple states are combined.
      d - The decision associated with the edge.
      cost - The original edge cost.
      Returns:
      The relaxed edge cost (here equal to cost).