# Number of nodes and Relative Gap

**URL:** <https://discourse.julialang.org/t/number-of-nodes-and-relative-gap/30133>\
**Category:** Optimization (Mathematical)\
**Created:** [October 21, 2019, 12:54pm UTC](https://discourse.julialang.org/t/number-of-nodes-and-relative-gap/30133 "2019-10-21T12:54:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![angeloaliano1](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Post date:** [October 21, 2019, 12:54pm UTC](https://discourse.julialang.org/t/number-of-nodes-and-relative-gap/30133/1 "2019-10-21T12:54:36Z")

</div>

Dear users,  
I am with Julia 1.0.4, JuMP version 0.19 and using the MathOptInterface to solve a integer model. According to the documentation in [Reference · MathOptInterface](http://www.juliaopt.org/MathOptInterface.jl/stable/apireference/) the relative Gap and the number of nodes researched are given by the commands:

```julia
GAP = MOI.get(modelo, MOI.NodeCount())
Nodes = MOI.get(modelo, MOI.NodeCount())

```

but this give the following error message, respectively:

```julia
MethodError: no method matching get_node_count(::CPLEX.Optimizer)
Closest candidates are:
  get_node_count(!Matched::LinQuadOptInterface.MockLinQuadOptimizer) at C:\Users\angeloaliano\.juliapro\JuliaPro_v1.0.4.1\packages\LinQuadOptInterface\ZMx9f\src\mockoptimizer.jl:834
get(::CPLEX.Optimizer, ::MathOptInterface.NodeCount) at solve.jl:265
get(::MathOptInterface.Bridges.LazyBridgeOptimizer{CPLEX.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Bridges.AllBridgedConstraints{Float64}}}, ::MathOptInterface.NodeCount) at bridgeoptimizer.jl:189
get(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{JuMP._MOIModel{Float64}}}, ::MathOptInterface.NodeCount) at cachingoptimizer.jl:438
_moi_get_result(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{JuMP._MOIModel{Float64}}}, ::MathOptInterface.NodeCount) at JuMP.jl:587
get(::Model, ::MathOptInterface.NodeCount) at JuMP.jl:600
top-level scope at none:0

```

and

```julia
MethodError: no method matching get_node_count(::CPLEX.Optimizer)
Closest candidates are:
  get_node_count(!Matched::LinQuadOptInterface.MockLinQuadOptimizer) at C:\Users\angeloaliano\.juliapro\JuliaPro_v1.0.4.1\packages\LinQuadOptInterface\ZMx9f\src\mockoptimizer.jl:834
get(::CPLEX.Optimizer, ::MathOptInterface.NodeCount) at solve.jl:265
get(::MathOptInterface.Bridges.LazyBridgeOptimizer{CPLEX.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Bridges.AllBridgedConstraints{Float64}}}, ::MathOptInterface.NodeCount) at bridgeoptimizer.jl:189
get(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{JuMP._MOIModel{Float64}}}, ::MathOptInterface.NodeCount) at cachingoptimizer.jl:438
_moi_get_result(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{JuMP._MOIModel{Float64}}}, ::MathOptInterface.NodeCount) at JuMP.jl:587
get(::Model, ::MathOptInterface.NodeCount) at JuMP.jl:600
top-level scope at none:0

```

I note that, the command for CPU time

```julia
time = MOI.get(modelo, MOI.SolveTime())

```

works very well.  
Could anyone help me please to get this important output of my problem?

---

<div class="post-metadata">

**Author:** ![blegat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/blegat/32/217090_2.png) [@blegat](https://discourse.julialang.org/u/blegat)\
**Post date:** [October 21, 2019, 1:40pm UTC](https://discourse.julialang.org/t/number-of-nodes-and-relative-gap/30133/2 "2019-10-21T13:40:26Z")

</div>

This seems to be a bug in the CPLEX wrapper. The CPLEX wrapper is being rewritten from scratch in [https://github.com/JuliaOpt/CPLEX.jl/pull/250/files](https://github.com/JuliaOpt/CPLEX.jl/pull/250/files) ans NodeCount seems to be implemented there. It’s still a WIP but you can try it out if you’re feeling adventurous.
