Skip to content

Commit

Permalink
Merge pull request #203 from lanl-ansi/Alpine.jl-Link
Browse files Browse the repository at this point in the history
New Feature: Linking Constraints for Multilinear Terms
  • Loading branch information
harshangrjn authored Sep 6, 2022
2 parents 9844e7d + 6b09604 commit 97b9105
Show file tree
Hide file tree
Showing 53 changed files with 9,203 additions and 6,366 deletions.
8 changes: 8 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Configuration file for JuliaFormatter.jl
# For more information, see: https://domluna.github.io/JuliaFormatter.jl/stable/config/

always_for_in = true
always_use_return = true
margin = 90
remove_extra_newlines = true
short_to_long_function_def = true
32 changes: 32 additions & 0 deletions .github/workflows/format_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: format-check
on:
push:
branches:
- master
- release-*
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@latest
with:
version: '1'
- uses: actions/checkout@v1
- name: Format check
shell: julia --color=yes {0}
run: |
using Pkg
Pkg.add(PackageSpec(name="JuliaFormatter", version="1"))
using JuliaFormatter
format("src/MOI_wrapper", verbose=true)
format("test", verbose=true)
format("docs", verbose=true)
out = String(read(Cmd(`git diff`)))
if isempty(out)
exit(0)
end
@error "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Alpine.jl Change Log

## v0.5.0
- New feature: Linking constraints for multilinear terms with uniform and adaptive partitions (significant speed up in run times for multilinear problems: http://www.optimization-online.org/DB_HTML/2022/07/8974.html) (@jongeunkim)
- Added dependency on Combinatorics package for linking constraints
- Added unit tests for linking constraints feature
- Changed Cbc test dependency to HiGHS solver
- Dropped a few redundant unit tests
- Dropped support for (slower) piecewise McCormick formulations
- Changed `disc_ratio` to `partition_scaling_factor`
- Added JuliaFormatter.toml and formatting workfow

## v0.4.3
- Dropped support for checking solver availability. User can choose to use any MILP, MINLP and/or NLP solver with Alpine
- `GRB_ENV` now works with Gurobi solver to avoid printing License info multiple times during iterations
Expand Down Expand Up @@ -185,7 +195,7 @@ Closed issues:
- Alpine.jl first release

## Merged Features
- `disc_ratio` selection algorithm
- `partition_scaling_factor` selection algorithm
- logarithm embedding formulation
- bounding model warm starting and no-good-cuts using solution pool
- `disc_vars` selection algorithm based on weighted minimum vertex cover
Expand Down Expand Up @@ -229,6 +239,6 @@ Closed issues:
- Fixed many other things

## Tests & Coverage
- Most new features are covered (embedding, `disc_ratio` algorithm, etc.)
- Most new features are covered (embedding, `partition_scaling_factor` algorithm, etc.)
- Stronger expression parsing tests with new operators covered
- Coverage should be more than `~90%`
10 changes: 6 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,32 @@ 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.4.3"
version = "0.5.0"

[deps]
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
Cbc = "0.8, 0.9, 1"
HiGHS = "1"
Ipopt = "0.8, 0.9, 1"
JuMP = "0.22, 0.23, 1"
Juniper = "0.8, 0.9"
MathOptInterface = "0.10, 1"
Pavito = "0.3.4, 0.3.5"
julia = "1"
Combinatorics = "1"

[extras]
Cbc = "9961bab8-2fa3-5c5a-9d89-47fab24efd76"
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
Juniper = "2ddba703-00a4-53a7-87a5-e8b9971dde84"
Pavito = "cd433a01-47d1-575d-afb7-6db927ee8d8f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Cbc", "Ipopt", "Juniper", "Pavito", "Random", "Test"]
test = ["HiGHS", "Ipopt", "Juniper", "Pavito", "Random", "Test"]
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ We are seeking out hard benchmark instances for MINLPs. Please get in touch eith
If you find Alpine useful in your work, we kindly request that you cite the following papers ([pdf](http://harshangrjn.github.io/pdf/JOGO_2018.pdf), [pdf](http://harshangrjn.github.io/pdf/CP_2016.pdf))
```bibtex
@article{alpine_JOGO2019,
author = {Nagarajan, Harsha and Lu, Mowen and Wang, Site and Bent, Russell and Sundar, Kaarthik},
title = {An adaptive, multivariate partitioning algorithm for global optimization of nonconvex programs},
author = {Nagarajan, Harsha and Lu, Mowen and Wang, Site and Bent, Russell and Sundar, Kaarthik},
journal = {Journal of Global Optimization},
year = {2019},
issn = {1573-2916},
Expand All @@ -81,7 +81,7 @@ If you find Alpine useful in your work, we kindly request that you cite the foll
doi = {10.1007/978-3-319-44953-1_24},
}
```
If you find the underlying piecewise polyhedral formulations implemented in Alpine useful in your work, we kindly request that you cite the following paper ([link](https://doi.org/10.1016/j.orl.2020.12.002)):
If you find the underlying piecewise polyhedral formulations implemented in Alpine useful in your work, we kindly request that you cite the following papers ([link-1](https://doi.org/10.1016/j.orl.2020.12.002), [link-2](http://www.optimization-online.org/DB_HTML/2022/07/8974.html)):
```bibtex
@article{alpine_ORL2021,
title = {Piecewise polyhedral formulations for a multilinear term},
Expand All @@ -93,4 +93,11 @@ If you find the underlying piecewise polyhedral formulations implemented in Alpi
year = {2021},
publisher = {Elsevier}
}
@article{alpine_OptOnline2022,
title={Piecewise Polyhedral Relaxations of Multilinear Optimization},
author={Kim, Jongeun and Richard, Jean-Philippe P. and Tawarmalani, Mohit},
eprinttype={Optimization Online},
date={2022}
}
```
24 changes: 14 additions & 10 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,25 @@ using DocumenterTools: Themes
for w in ("light", "dark")
header = read(joinpath(@__DIR__, "src/assets/themes/style.scss"), String)
theme = read(joinpath(@__DIR__, "src/assets/themes/$(w)defs.scss"), String)
write(joinpath(@__DIR__, "src/assets/themes/$(w).scss"), header*"\n"*theme)
write(joinpath(@__DIR__, "src/assets/themes/$(w).scss"), header * "\n" * theme)
end

Themes.compile(joinpath(@__DIR__, "src/assets/themes/light.scss"), joinpath(@__DIR__, "src/assets/themes/documenter-light.css"))
Themes.compile(joinpath(@__DIR__, "src/assets/themes/dark.scss"), joinpath(@__DIR__, "src/assets/themes/documenter-dark.css"))
Themes.compile(
joinpath(@__DIR__, "src/assets/themes/light.scss"),
joinpath(@__DIR__, "src/assets/themes/documenter-light.css"),
)
Themes.compile(
joinpath(@__DIR__, "src/assets/themes/dark.scss"),
joinpath(@__DIR__, "src/assets/themes/documenter-dark.css"),
)

makedocs(
sitename = "Alpine",
authors = "Harsha Nagarajan, Site Wang, Kaarthik Sundar and contributors",
format = Documenter.HTML(mathengine = Documenter.MathJax(),
prettyurls = get(ENV, "CI", nothing) == "true"),
format = Documenter.HTML(
mathengine = Documenter.MathJax(),
prettyurls = get(ENV, "CI", nothing) == "true",
),
strict = true,
pages = [
"Introduction" => "index.md",
Expand All @@ -26,8 +34,4 @@ makedocs(
],
)

deploydocs(
repo = "github.com/lanl-ansi/Alpine.jl.git",
push_preview = true
)

deploydocs(repo = "github.com/lanl-ansi/Alpine.jl.git", push_preview = true)
36 changes: 33 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Pkg
Pkg.add("Alpine")
```

At least one local nonlinear-programming (NLP) solver and a convex mixed-integer programming (MIP) solver are required for running Alpine. If your problem is an NLP, we recommend [Ipopt](https://github.com/jump-dev/Ipopt.jl), and else if your problem is a mixed-integer NLP (MINLP), we recommend [Juniper](https://github.com/lanl-ansi/Juniper.jl). For the underlying MIP solver, [Gurobi](https://github.com/jump-dev/Gurobi.jl) is highly recommended, as it is fast, scaleable and can be used to solve on fairly large-scale non-convex programs. However, the open-source [CBC](https://github.com/jump-dev/Cbc.jl) or [GLPK](https://github.com/jump-dev/GLPK.jl) solver is also compatible with Alpine. For example, Ipopt and GLPK can be installed via the package manager with
At least one local nonlinear-programming (NLP) solver and a convex mixed-integer programming (MIP) solver are required for running Alpine. If your problem is an NLP, we recommend [Ipopt](https://github.com/jump-dev/Ipopt.jl), and else if your problem is a mixed-integer NLP (MINLP), we recommend [Juniper](https://github.com/lanl-ansi/Juniper.jl). For the underlying MIP solver, [Gurobi](https://github.com/jump-dev/Gurobi.jl) is highly recommended, as it is fast, scaleable and can be used to solve on fairly large-scale non-convex programs. However, the open-source [HiGHS](https://github.com/jump-dev/HiGHS.jl) or [GLPK](https://github.com/jump-dev/GLPK.jl) solver is also compatible with Alpine. For example, Ipopt and Gurobi can be installed via the package manager with

```julia
import Pkg
Expand All @@ -38,14 +38,44 @@ Pkg.test("Alpine")
```

## Citing Alpine
If you find Alpine useful in your work, we request you to cite the following paper [\[link\]](https://harshangrjn.github.io/pdf/JOGO_2018.pdf):
If you find Alpine useful in your work, we request you to cite the following paper [\[pdf\]](https://harshangrjn.github.io/pdf/JOGO_2018.pdf) [\[pdf\]](http://harshangrjn.github.io/pdf/CP_2016.pdf):
```bibtex
@article{alpine_JOGO2019,
author = {Nagarajan, Harsha and Lu, Mowen and Wang, Site and Bent, Russell and Sundar, Kaarthik},
title = {An adaptive, multivariate partitioning algorithm for global optimization of nonconvex programs},
author = {Nagarajan, Harsha and Lu, Mowen and Wang, Site and Bent, Russell and Sundar, Kaarthik},
journal = {Journal of Global Optimization},
year = {2019},
issn = {1573-2916},
doi = {10.1007/s10898-018-00734-1},
}
@inproceedings{alpine_CP2016,
title = {Tightening {McCormick} relaxations for nonlinear programs via dynamic multivariate partitioning},
author = {Nagarajan, Harsha and Lu, Mowen and Yamangil, Emre and Bent, Russell},
booktitle = {International Conference on Principles and Practice of Constraint Programming},
pages = {369--387},
year = {2016},
organization = {Springer},
doi = {10.1007/978-3-319-44953-1_24},
}
```
If you find the underlying piecewise polyhedral formulations implemented in Alpine useful in your work, we kindly request that you cite the following papers ([link-1](https://doi.org/10.1016/j.orl.2020.12.002), [link-2](http://www.optimization-online.org/DB_HTML/2022/07/8974.html)):
```bibtex
@article{alpine_ORL2021,
title = {Piecewise polyhedral formulations for a multilinear term},
author = {Sundar, Kaarthik and Nagarajan, Harsha and Linderoth, Jeff and Wang, Site and Bent, Russell},
journal = {Operations Research Letters},
volume = {49},
number = {1},
pages = {144--149},
year = {2021},
publisher = {Elsevier}
}
@article{alpine_OptOnline2022,
title={Piecewise Polyhedral Relaxations of Multilinear Optimization},
author={Kim, Jongeun and Richard, Jean-Philippe P. and Tawarmalani, Mohit},
eprinttype={Optimization Online},
date={2022}
}
```
2 changes: 1 addition & 1 deletion docs/src/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Here are a few general solver options which control the performance of Alpine:
## Adaptive Partitioning Options
* `apply_partitioning (default = true)`: applies Alpine's built-in MIP-based partitioning algorithm only when activated; else terminates with the presolve solution.

* `disc_ratio (default = 4)`: used during [`add_adaptive_partition`](@ref) for measuring the width of new partitions relative to the active partition chosen in the sequentially solved lower-bounding MIPs. This value can substantially affect the run time for global convergence; this value can be set to different integer values (>= 4) for various classes of problems.
* `partition_scaling_factor (default = 10)`: used during [`add_adaptive_partition`](@ref) for scaling the width of new partitions relative to the active partition chosen in the sequentially-solved lower-bounding MIP models. This value can substantially affect the run time for global convergence; this value can be set to different integer values (>= 4) for various classes of problems.

* `disc_var_pick (default = 0)`: controls Alpine's algorithm used for selecting variables for partitioning; `0` is for max-cover, `1` is for minimum-vertex-cover. This parameter allows functional inputs.

Expand Down
3 changes: 1 addition & 2 deletions examples/JuMP_models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ include("MINLPs/div.jl")
include("MINLPs/exprstest.jl")
include("MINLPs/linearlift.jl")
include("MINLPs/multi.jl")
include("MINLPs/mult3.jl")
include("MINLPs/rosenbrock.jl")
# include("MINLPs/sincos.jl")
# include("MINLPs/integer.jl")
Loading

0 comments on commit 97b9105

Please sign in to comment.