Interface StateDistance<T>
- Type Parameters:
T- the type of states
- All Known Implementing Classes:
KSDistance,MaxCoverDistance,MKSDistance,TSDistance
public interface StateDistance<T>
Interface defining a distance function between states, used to form clusters
when deciding which nodes on a layer of a decision diagram should be merged.
The distance function must satisfy the following properties:
- Non-negative: distance(a, b) ≥ 0
- Symmetric: distance(a, b) = distance(b, a)
- Triangle inequality: distance(a, c) ≤ distance(a, b) + distance(b, c)
Type parameter T denotes the type of the states being compared.
-
Method Summary
Modifier and TypeMethodDescriptiondefault doubledistance(NodeSubProblem<T> a, NodeSubProblem<T> b) Computes the distance between two nodes of a subproblem.doubleComputes the discrete distance between two states.default doubledistanceWithRoot(T state) Computes the distance between a state and the root of the search/tree.
-
Method Details
-
distance
Computes the discrete distance between two states.- Parameters:
a- the first stateb- the second state- Returns:
- the distance between
aandb
-
distance
Computes the distance between two nodes of a subproblem.By default, returns 0. Can be overridden for more precise node-level distances.
- Parameters:
a- the first nodeb- the second node- Returns:
- the distance between the nodes
-
distanceWithRoot
Computes the distance between a state and the root of the search/tree.By default, returns 0. Can be overridden for root-distance computations.
- Parameters:
state- the state to measure- Returns:
- the distance to the root
-