Skip to content

Commit

Permalink
v0.2.7 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
harshangrjn committed Oct 22, 2021
1 parent 1af6bf7 commit b058efb
Show file tree
Hide file tree
Showing 21 changed files with 1,048 additions and 980 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Alpine.jl Change Log

## v0.2.7
- Support for module shortcut `Alp` in function calls
- Solver options clean up in `examples` folder
- Dropped support for unsued functions `_bound_sense`, `update_boundstop_options`
- Improved code coverage
- Docs cleanup

## v0.2.6
- Bug fix in `algorithm.jl` to handle Gurobi as the MIP solver with updated MOI
- Deactivated redundant functions `collect_lb_pool`, `merge_solution_pool` and `track_new_partition_idx`
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "Alpine"
uuid = "07493b3f-dabb-5b16-a503-4139292d7dd4"
authors = ["Harsha Nagarajan, Site Wang, Kaarthik Sundar and contributors"]
repo = "https://github.com/lanl-ansi/Alpine.jl.git"
version = "0.2.6"
version = "0.2.7"

[deps]
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
Expand Down
8 changes: 4 additions & 4 deletions docs/src/choosingsolver.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ Alpine's global optimization algorithm requires a few types of optimization prob
As the development of Alpine continues, supports for solvers such as [Mosek](http://www.mosek.com/), [GLPK](http://www.gnu.org/software/glpk/), [NLopt](http://ab-initio.mit.edu/wiki/index.php/NLopt) and [Xpress](http://www.fico.com/en/products/fico-xpress-optimization-suite) are in the development roadmap.

!!! tip
Performance of Alpine is significantly faster and robust while using [Gurobi](https://www.gurobi.com) as the convex mixed-integer programming (MIP) solver. Note that this solver's individual-usage license is available [free](https://www.gurobi.com/academia/academic-program-and-licenses/) for academic purposes.
Performance of Alpine is significantly faster and robust while using [Gurobi](https://www.gurobi.com) as the underlying convex mixed-integer programming (MIP) solver. Note that Gurobi's individual-usage license is available [free](https://www.gurobi.com/academia/academic-program-and-licenses/) for academic purposes.

To solve nonlinear program with only continuous variables to global optimality, here is an example to utilize different sub-solvers for the best performance of Alpine:
To solve any nonlinear program with only continuous variables to global optimality, here is an example to utilize different sub-solvers with default options set for Alpine:

```julia
using JuMP
using Alpine
using Alpine
using JuMP
using Gurobi
using Ipopt

Expand Down
53 changes: 13 additions & 40 deletions examples/run_examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,27 @@ using CPLEX
using Gurobi
using JuMP
using Ipopt
using Cbc
using Pavito
using Juniper
# using Cbc
# using Pavito

include("JuMP_models.jl")
include("solver.jl")

# MIP solver - commercial
const gurobi = optimizer_with_attributes(Gurobi.Optimizer,
MOI.Silent() => true,
"Presolve" => 1)

const cplex = optimizer_with_attributes(CPLEX.Optimizer,
MOI.Silent() => true,
"CPX_PARAM_PREIND" => false)

# MIP solver - open-source
const cbc = optimizer_with_attributes(Cbc.Optimizer,
MOI.Silent() => true)

# Choose the MIP solver here (for Alpine/Juniper)
mip_solver = gurobi

# Local solver
const ipopt = optimizer_with_attributes(Ipopt.Optimizer,
MOI.Silent() => true,
"sb" => "yes",
"max_iter" => 9999)

# Convex MINLP solver
const pavito = optimizer_with_attributes(Pavito.Optimizer,
MOI.Silent() => true,
"mip_solver" => cbc,
"cont_solver" => ipopt,
"mip_solver_drives" => false)

const juniper = optimizer_with_attributes(Juniper.Optimizer,
MOI.Silent() => true,
"mip_solver" => mip_solver,
"nl_solver" => ipopt)
# Choose underlying solvers for Alpine
mip_solver = get_gurobi()
nlp_solver = get_ipopt()
minlp_solver = get_juniper(mip_solver, nlp_solver)

# Global solver
const alpine = optimizer_with_attributes(Alpine.Optimizer,
"minlp_solver" => juniper,
"nlp_solver" => ipopt,
"mip_solver" => mip_solver,
"presolve_bt" => true,
"presolve_bt_max_iter" => 5,
"disc_ratio" => 10)
# "minlp_solver" => minlp_solver,
"nlp_solver" => nlp_solver,
"mip_solver" => mip_solver,
"presolve_bt" => true,
"presolve_bt_max_iter" => 5,
"disc_ratio" => 10)

# Try different integer values ( >=4 ) for `disc_ratio` to have better Alpine run times
# Choose `presolve_bt` to `false` if you prefer the OBBT presolve to be turned off.
Expand Down
43 changes: 43 additions & 0 deletions examples/solver.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# MIP solver - commercial
function get_gurobi()
return optimizer_with_attributes(Gurobi.Optimizer,
MOI.Silent() => true,
"Presolve" => 1)
end

function get_cplex()
return optimizer_with_attributes(CPLEX.Optimizer,
MOI.Silent() => true,
"CPX_PARAM_PREIND" => 1)
end

# MIP solver - open-source
function get_cbc()
return optimizer_with_attributes(Cbc.Optimizer,
MOI.Silent() => true)
end

# Local solver
function get_ipopt()
return optimizer_with_attributes(Ipopt.Optimizer,
MOI.Silent() => true,
"sb" => "yes",
"max_iter" => Int(1E4))
end

# Convex MINLP solver
function get_pavito(mip_solver, cont_solver)
return optimizer_with_attributes(Pavito.Optimizer,
MOI.Silent() => true,
"mip_solver" => mip_solver,
"cont_solver" => cont_solver,
"mip_solver_drives" => false)
end

# Non-convex Local MINLP solver
function get_juniper(mip_solver, nl_solver)
return optimizer_with_attributes(Juniper.Optimizer,
MOI.Silent() => true,
"mip_solver" => mip_solver,
"nl_solver" => nl_solver)
end
16 changes: 8 additions & 8 deletions src/Alpine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ __precompile__()
module Alpine

using JuMP
using LinearAlgebra
using Random
using Statistics

import LinearAlgebra as LA
import Random
import Statistics

const ALPINE_DEBUG = false
const ALP = Alpine
const LA = LinearAlgebra
const Alp = Alpine

include("const.jl")

# Engine for High-level Algorithmic Control and User-interface
# Engine for high-level algorithmic control and user-interface
include("matrix_opt_interface.jl")
include("moi_function2expr.jl")
include("solver.jl")
Expand All @@ -22,7 +22,7 @@ include("solver.jl")
include("nlexpr.jl")
include("operators.jl")

# Main Algorithm
# Main algorithm
include("algorithm.jl")
include("presolve.jl")
include("amp.jl")
Expand All @@ -37,7 +37,7 @@ include("tmc.jl")
include("bounds.jl")
include("utility.jl")

# Othes
# Logging
include("log.jl")

end # module
Loading

0 comments on commit b058efb

Please sign in to comment.