If you set the objective on a node to maximize instead of minimize, the objective value it returns will be negative. For example, in the code below, the objective value that is returned should be +2, but it is -2.
using Plasmo, HiGHS
g = OptiGraph()
set_optimizer(g, HiGHS.Optimizer)
@optinode(g, n)
@variable(n, x <= 2)
@objective(n, Max, x)
optimize!(g)
println(objective_value(g))
If you set the objective on a node to maximize instead of minimize, the objective value it returns will be negative. For example, in the code below, the objective value that is returned should be +2, but it is -2.