Issue1205

Title mismatch in bounds for Weighted and Const evaluator
Priority feature Status chatting
Superseder Nosy List jendrik, malte, simon
Assigned To Keywords
Optional summary

Created on 2026-02-17.14:49:59 by simon, last changed by simon.

Messages
msg12009 (view) Author: simon Date: 2026-02-17.15:30:10
[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?)
msg12005 (view) Author: simon Date: 2026-02-17.14:49:59
The weighted evaluator accepts negative values but the constant evaluator does not.
However, you can basically build the ConstEvaluator for any negative number with 'weight(const(42), -1)'.
I think we should allow negative values for the ConstEvaluator, too.
Alternatively, we could restrict the WeightedEvaluator to non-negative values.
The current mix form is weird.
I am in favour of giving the user more flexibility and allow negative values for the ConstEvaluator.
History
Date User Action Args
2026-02-17 15:30:39simonsetnosy: + malte, jendrik
2026-02-17 15:30:10simonsetmessages: + msg12009
2026-02-17 14:49:59simoncreate