Class GRRelax
- All Implemented Interfaces:
Relaxation<GRState>
This class defines how multiple search states (GRState) can be merged
to create a relaxed (i.e., aggregated) state during search algorithms such as
DDO (Decision Diagram Optimization) or Anytime Column Search.
The relaxation used here computes the intersection of the sets of marks and distances present in the input states. This ensures that only marks and distances common to all states are kept in the merged state. The resulting state represents a conservative approximation that does not introduce new distances, preserving feasibility.
The last mark in the merged state is the minimum of all last marks across the input states, ensuring consistency with the most constrained (shortest) partial ruler.
Example:
GRRelax relax = new GRRelax();
GRState merged = relax.mergeStates(List.of(state1, state2).iterator());
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmergeStates(Iterator<GRState> states) Merges severalGRStateobjects into a single relaxed state.doubleComputes the relaxed cost of transitioning between two states in the relaxed problem.
-
Constructor Details
-
GRRelax
public GRRelax()
-
-
Method Details
-
mergeStates
Merges severalGRStateobjects into a single relaxed state.The resulting state contains:
- The intersection of all mark sets (only marks present in all states are kept).
- The intersection of all distance sets (only distances present in all states are kept).
- The smallest
lastMarkvalue among all merged states.
- Specified by:
mergeStatesin interfaceRelaxation<GRState>- Parameters:
states- an iterator over the states to merge.- Returns:
- a new
GRStaterepresenting the relaxed (merged) state.
-
relaxEdge
Computes the relaxed cost of transitioning between two states in the relaxed problem.In this implementation, the relaxation does not modify the cost — it simply returns the same value as the original transition cost.
- Specified by:
relaxEdgein interfaceRelaxation<GRState>- Parameters:
from- the source state before the transition.to- the destination state after the transition.merged- the merged relaxed state (unused in this relaxation).d- the decision made for the transition.cost- the original transition cost.- Returns:
- the relaxed transition cost (equal to
cost).
-