Package org.ddolib.examples.srflp
Class SRFLPRelax
java.lang.Object
org.ddolib.examples.srflp.SRFLPRelax
- All Implemented Interfaces:
Relaxation<SRFLPState>
Implementation of a relaxation for the Single Row Facility Layout Problem (SRFLP).
In this relaxation, multiple SRFLP states can be merged into a single state to reduce the search space. The merged state over-approximates the possible states by combining the "must" and "maybe" sets and taking minimal cut values.
This class implements the Relaxation interface and is typically used
in decision diagram or DDO-based algorithms for SRFLP to enable state merging
and efficient pruning.
-
Constructor Summary
ConstructorsConstructorDescriptionSRFLPRelax(SRFLPProblem problem) Constructs a new relaxation instance for a given SRFLP problem. -
Method Summary
Modifier and TypeMethodDescriptionmergeStates(Iterator<SRFLPState> states) Merges multiple SRFLP states into a single relaxed state.doublerelaxEdge(SRFLPState from, SRFLPState to, SRFLPState merged, Decision d, double cost) Relaxation of an edge cost between two states.
-
Constructor Details
-
SRFLPRelax
Constructs a new relaxation instance for a given SRFLP problem.- Parameters:
problem- The SRFLP problem instance to which this relaxation applies.
-
-
Method Details
-
mergeStates
Merges multiple SRFLP states into a single relaxed state.The merged state:
- Intersects the "must" sets of all input states.
- Unites the "must" and "maybe" sets into the merged "maybe" set.
- Takes the minimal cut values for each department.
- Uses the maximum depth among all merged states.
- Specified by:
mergeStatesin interfaceRelaxation<SRFLPState>- Parameters:
states- An iterator over the states to merge.- Returns:
- A new SRFLPState representing the merged relaxation of the input states.
-
relaxEdge
Relaxation of an edge cost between two states.In this implementation, the edge cost is not modified by the relaxation and is returned as-is.
- Specified by:
relaxEdgein interfaceRelaxation<SRFLPState>- Parameters:
from- The source state.to- The target state.merged- The merged state containing this edge.d- The decision taken to move fromfromtoto.cost- The original cost of the edge.- Returns:
- The relaxed cost of the edge, which in this case is equal to
cost.
-