I get an error when I try to solve a feasibility problem in JuMP using HiGHS. I use Julia v1.9.1 with the Julia packages JuMP v1.12.0 and HiGHS v1.5.2.
$ julia JuMP_solve.jl
Running HiGHS 1.5.3 [date: 1970-01-01, git hash: 45a127b78]
Copyright (c) 2023 HiGHS under MIT licence terms
Presolving model
270074 rows, 274684 cols, 1084700 nonzeros
269789 rows, 274399 cols, 1082726 nonzeros
Objective function is integral with scale 1
Solving MIP model with:
269789 rows
274399 cols (274398 binary, 1 integer, 0 implied int., 0 continuous)
1082726 nonzeros
Nodes | B&B Tree | Objective Bounds | Dynamic Constraints | Work
Proc. InQueue | Leaves Expl. | BestBound BestSol Gap | Cuts InLp Confl. | LpIters Time
0 0 0 0.00% 0 inf inf 0 0 0 0 2.2s
Solving report
Status Infeasible
Primal bound inf
Dual bound inf
Gap inf
Solution status -
Timing 44.02 (total)
1.44 (presolve)
0.00 (postsolve)
Nodes 1
LP iterations 11798 (total)
0 (strong br.)
0 (separation)
0 (heuristics)
ERROR: No invertible representation for getDualRay
45.992959 seconds (3.86 M allocations: 492.087 MiB, 0.48% gc time, 0.52% compilation time: 27% of which was recompilation)
Hello everyone!
I also get this error related to getDualRay. And also my problem should be feasible.
When I set demand = false, the code works fine and find the optimal solution.
When I set demand =true, JuMP return the Error.
Matrix P is all positive and its been multiplied by x which is a bool vector to select one of its rows. So all itens in Mx vector should be greater than 0.
Any hint how could I solve this? Thanks in advance!!!
Here is the code:
Blockquote
function JuMP_MOA(L::BasicLoad; demand::Bool = false)
model = Model()
set_optimizer(model, () -> MOA.Optimizer(HiGHS.Optimizer))
set_attribute(model, MOA.Algorithm(), MOA.Hierarchical())
u = length(L.s)
@variable(model, x[1:u], Bin)
@constraint(model,sum(x)==1)
if demand
P = Generate_PowerMatrix(L)
@expression(model, Mx, P*x)
@constraint(model, [i = 1:288], Mx[i] >= 0)
end
@expression(model, Cost_expr, sum(Cost(L,i)*x[i] for i in 1:u) ) #MIN
@expression(model, Comf_expr, sum(Comf(L,i)*x[i] for i in 1:u) ) #MAX
@objective(model, Max, [-Cost_expr, Comf_expr])
optimize!(model)
if termination_status(model) != OPTIMAL
@warn("The model was not solved correctly.")
return
end
solution_summary(model)
A = value.(x)
ix = findfirst(x-> x>0.5 ,A)
return L.s[ix]
end
I haven’t tested this, but do instead something like
if demand
P = Generate_PowerMatrix(L)
R = Generate_DemandPeakRef(L.Δt, 4, 1)
for i in 1:size(P, 1)
if any(!iszero, P[i, :])
@constraint(model, 0 <= P[i, :]' * x <= R[i])
end
end
end