A default implementation of VariableHeuristic that selects the next variable to branch on without applying any specific strategy.
This heuristic simply returns the first element obtained from the provided variables iterable. Therefore, it does not guarantee any particular or deterministic order, as the iteration order of an iterable.
This class serves as a minimal or placeholder heuristic to ensure that the compilation or search process can proceed when no specific variable ordering rule has been defined by the user.
override def next(variables: Iterable[Int], states: Iterable[T]): Int
Selects the next variable to branch on given the current set of unassigned variables and the states of the next layer.
Selects the next variable to branch on given the current set of unassigned variables and the states of the next layer.
The heuristic can analyze the provided states to estimate which variable will best separate or discriminate the search space, improving pruning or convergence. If no meaningful decision can be made, null may be returned to indicate that the choice should be deferred or decided by a default mechanism.
Value parameters
states
an iterator over the current states in the next layer
variables
the set of variable indices that are still unassigned
Attributes
Returns
the index of the next variable to branch on, or null if no decision can be made at this point