I am trying to get the branch and bound node count using the JuMP interface and the Gurobi solver in Julia.
I tried getnodecount(m) as suggested on the JuMP website, but this came back as undefined. After doing more research, I read to try:
MathProgBase.getnodecount(m)
A simple example:
using Gurobi
using JuMP
using MathProgBase
m = Model(with_optimizer(Gurobi.Optimizer))
@variable(m, x, Bin)
@variable(m, y >=0)
@objective(m, Min, x*y)
optimize!(m)
println(value(x))
# getnodecount(m)
MathProgBase.getnodecount(m)
I expected to get a node count of 0, but got this error:
LoadError: MethodError: no method matching getnodecount(::Model)
Closest candidates are:
getnodecount(!Matched::Gurobi.GurobiMathProgModel) at /uliapro/JuliaPro_v1.1.1.1/packages/Gurobi/dlJep/src/MPB_wrapper.jl:759