[Malte on discord]
Negative values are not allowed to be returned by evaluators, and the current code cannot fully support them. For example, heuristics internally use the values "-1" for dead end and "-2" for "value unknown". They contain an assertion that we can never return a heuristic value other than non-negative values or "-1" (dead end), which at some point is then converted to max integer.
I haven't checked this thoroughly, but it's possible our open lists currently work for negative values, but this is by accident, not by design.
It is worth reconsidering this because I think someone might want to use general linear expressions including negative coefficients (both as in 5 h_1 - 2 h_2 and as in h_1 + h_2 - 3).
But if we want to do this, it would need to be a conscious decision that we now expect open lists and search algorithms to handle such negative values, and we should be clear about where they are allowed. (For example, are they allowed in g values under cost transformations?)
|