# How to use interior point algorithm in GLPK

**URL:** <https://discourse.julialang.org/t/how-to-use-interior-point-algorithm-in-glpk/58904>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [April 9, 2021, 6:35am UTC](https://discourse.julialang.org/t/how-to-use-interior-point-algorithm-in-glpk/58904 "2021-04-09T06:35:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![manoj.centura](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/manoj.centura/32/216443_2.png) [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Post date:** [April 9, 2021, 6:35am UTC](https://discourse.julialang.org/t/how-to-use-interior-point-algorithm-in-glpk/58904/1 "2021-04-09T06:35:36Z")

</div>

What param and value to use to set GLPK to use interior point.  
via set\_optimizer\_attribute

Thanks  
Manoj

---

<div class="post-metadata">

**Author:** ![mtanneau](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mtanneau/32/17787_2.png) [@mtanneau](https://discourse.julialang.org/u/mtanneau)\
**Post date:** [April 9, 2021, 2:04pm UTC](https://discourse.julialang.org/t/how-to-use-interior-point-algorithm-in-glpk/58904/2 "2021-04-09T14:04:51Z")

</div>

Hi!

[EDIT: I spoke too fast]

By the looks of it, looks like the simplex/interior-point method must be chosen when instantiating the `GLPK.Optimizer` object.

Thus, you should create the model as

```julia
using JuMP
using GLPK

model = Model(() -> GLPK.Optimizer(method=GLPK.INTERIOR))

```

---

<div class="post-metadata">

**Author:** ![manoj.centura](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/manoj.centura/32/216443_2.png) [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Post date:** [April 9, 2021, 2:34pm UTC](https://discourse.julialang.org/t/how-to-use-interior-point-algorithm-in-glpk/58904/3 "2021-04-09T14:34:28Z")

</div>

Thanks

---

<div class="post-metadata">

**Author:** ![mtanneau](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mtanneau/32/17787_2.png) [@mtanneau](https://discourse.julialang.org/u/mtanneau)\
**Post date:** [April 9, 2021, 2:44pm UTC](https://discourse.julialang.org/t/how-to-use-interior-point-algorithm-in-glpk/58904/4 "2021-04-09T14:44:12Z")

</div>

I edited my previous answer, can you check whether this works for you?

---

<div class="post-metadata">

**Author:** ![manoj.centura](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/manoj.centura/32/216443_2.png) [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Post date:** [April 9, 2021, 2:57pm UTC](https://discourse.julialang.org/t/how-to-use-interior-point-algorithm-in-glpk/58904/5 "2021-04-09T14:57:08Z")

</div>

Hi Thanks,

I am getting the below errors while solving problem with GLPK with SIMPLEX/Interior.  
Any suggestions on how to proceed

```julia
LoadError: Result index of attribute MathOptInterface.VariablePrimal(1) out of bounds. There are currently 0 solution(s) in the model.
in expression starting at C:\Users\manojkumar.ram\Dev julia project\Dev julia project\mono_working.jl:475
check_result_index_bounds at attributes.jl:133 [inlined]
get(::GLPK.Optimizer, ::MathOptInterface.VariablePrimal, ::MathOptInterface.VariableIndex) at MOI_wrapper.jl:1667
get(::MathOptInterface.Bridges.LazyBridgeOptimizer{GLPK.Optimizer}, ::MathOptInterface.VariablePrimal, ::MathOptInterface.VariableIndex) at bridge_optimizer.jl:808
get(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, ::MathOptInterface.VariablePrimal, ::MathOptInterface.VariableIndex) at cachingoptimizer.jl:605
_moi_get_result(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, ::MathOptInterface.VariablePrimal, ::Vararg{Any,N} where N) at JuMP.jl:946
get(::Model, ::MathOptInterface.VariablePrimal, ::VariableRef) at JuMP.jl:976
#value#30(::Int64, ::typeof(value), ::VariableRef) at variables.jl:766
value at variables.jl:766 [inlined]
_broadcast_getindex_evalf at broadcast.jl:625 [inlined]
_broadcast_getindex at broadcast.jl:598 [inlined]
getindex at broadcast.jl:558 [inlined]
copy at broadcast.jl:808 [inlined]
materialize(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{0},Nothing,typeof(value),Tuple{Base.RefValue{VariableRef}}}) at broadcast.jl:798
top-level scope at mono_working.jl:475'
```

---

<div class="post-metadata">

**Author:** ![mtanneau](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mtanneau/32/17787_2.png) [@mtanneau](https://discourse.julialang.org/u/mtanneau)\
**Post date:** [April 9, 2021, 5:32pm UTC](https://discourse.julialang.org/t/how-to-use-interior-point-algorithm-in-glpk/58904/6 "2021-04-09T17:32:14Z")

</div>

Can you provide a reproducible example, e.g., following the instructions in [this post](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757)?
