Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
# To group all GitHub Actions updates into a single PR, uncomment the following:
# groups:
# github-actions:
# patterns:
# - "*"
- package-ecosystem: "julia"
directories:
- "/"
- "/docs"
- "/test"
schedule:
interval: "weekly"
# To group all Julia dependency updates into a single PR, uncomment the following:
# groups:
# julia-dependencies:
# patterns:
# - "*"
72 changes: 72 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI
on:
push:
branches:
- main
tags: ['*']
pull_request:
workflow_dispatch:
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
actions: write
contents: read
strategy:
fail-fast: false
matrix:
version:
- '1.10'
- '1.11'
- 'pre'
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v6
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
docs:
name: Documentation
runs-on: ubuntu-latest
permissions:
actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created
contents: write
statuses: write
steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v3
with:
version: '1'
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
- name: Run doctests
shell: julia --project=docs --color=yes {0}
run: |
using Documenter: DocMeta, doctest
using DisjunctiveAlgorithms
DocMeta.setdocmeta!(DisjunctiveAlgorithms, :DocTestSetup, :(using DisjunctiveAlgorithms); recursive=true)
doctest(DisjunctiveAlgorithms)
18 changes: 18 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Install CompatHelper
run: using Pkg; Pkg.add("CompatHelper")
shell: julia --color=yes {0}
- name: Run CompatHelper
run: using CompatHelper; CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
19 changes: 19 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
# For commits that modify workflow files: SSH key enables tagging, but
# releases require manual creation. For full automation of such commits,
# use a PAT with `workflow` scope instead of GITHUB_TOKEN.
# See: https://github.com/JuliaRegistries/TagBot#commits-that-modify-workflow-files
ssh: ${{ secrets.DOCUMENTER_KEY }}
23 changes: 23 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name = "DisjunctiveAlgorithms"
uuid = "af3b8e3a-4098-461f-b6c0-2c9706adb26e"
authors = ["Daniel Nguyen"]
version = "0.1.0"

[deps]
DisjunctiveProgramming = "0d27d021-0159-4c7d-b4a7-9ccb5d9366cf"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"

[compat]
DisjunctiveProgramming = "0.6"
MathOptInterface = "1"
julia = "1.10"

[extras]
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
InfiniteOpt = "20393b10-9daf-11e9-18c9-8db751c92c57"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["HiGHS", "InfiniteOpt", "Ipopt", "JuMP", "Test"]
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,40 @@
# DisjunctiveAlgorithms.jl
An optimizer suite for generalized disjunctive programming.

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://infiniteopt.github.io/DisjunctiveAlgorithms.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://infiniteopt.github.io/DisjunctiveAlgorithms.jl/dev/)
[![Build Status](https://github.com/infiniteopt/DisjunctiveAlgorithms.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/infiniteopt/DisjunctiveAlgorithms.jl/actions/workflows/CI.yml?query=branch%3Amain)
[![Coverage](https://codecov.io/gh/infiniteopt/DisjunctiveAlgorithms.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/infiniteopt/DisjunctiveAlgorithms.jl)

An optimizer suite for generalized disjunctive programming (GDP).

DisjunctiveAlgorithms.jl is an MOI-layer solver for models that contain
disjunctions encoded as vector constraints in
`DisjunctiveProgramming.DisjunctionSet`. Disjunction-aware algorithms
(currently logic-based outer approximation) solve the model by
dispatching subproblems to user-provided MIP and NLP solvers.

The design follows
[MultiObjectiveAlgorithms.jl](https://github.com/jump-dev/MultiObjectiveAlgorithms.jl):
one `Optimizer` that wraps inner solvers, with the algorithm and its
options selected through optimizer attributes.

## Usage with DisjunctiveProgramming.jl

```julia
using DisjunctiveProgramming, DisjunctiveAlgorithms, HiGHS, Ipopt
import DisjunctiveAlgorithms as DA

model = GDPModel(() -> DA.Optimizer(nlp_solver = Ipopt.Optimizer,
mip_solver = HiGHS.Optimizer))
@variable(model, 0 <= x <= 10)
@variable(model, Y[1:2], Logical)
@constraint(model, x <= 3, Disjunct(Y[1]))
@constraint(model, x^2 == 64, Disjunct(Y[2]))
@disjunction(model, Y)
@objective(model, Max, x)
optimize!(model, gdp_method = MOIDisjunction())
```

`MOIDisjunction()` lowers each disjunction to a single
`DisjunctionSet` constraint that this package consumes directly; no
Big-M or Hull reformulation is performed on the modeling side.
6 changes: 6 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[deps]
DisjunctiveAlgorithms = "af3b8e3a-4098-461f-b6c0-2c9706adb26e"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "1.17.0"
22 changes: 22 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using DisjunctiveAlgorithms
using Documenter

DocMeta.setdocmeta!(DisjunctiveAlgorithms, :DocTestSetup, :(using DisjunctiveAlgorithms); recursive=true)

makedocs(;
modules=[DisjunctiveAlgorithms],
authors="Daniel Nguyen",
sitename="DisjunctiveAlgorithms.jl",
format=Documenter.HTML(;
canonical="https://infiniteopt.github.io/DisjunctiveAlgorithms.jl",
edit_link="main",
assets=String[],
),
pages=[
"Home" => "index.md",
],
)

deploydocs(;
repo="github.com/infiniteopt/DisjunctiveAlgorithms.jl",
)
14 changes: 14 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```@meta
CurrentModule = DisjunctiveAlgorithms
```

# DisjunctiveAlgorithms

Documentation for [DisjunctiveAlgorithms](https://github.com/infiniteopt/DisjunctiveAlgorithms.jl).

```@index
```

```@autodocs
Modules = [DisjunctiveAlgorithms]
```
15 changes: 15 additions & 0 deletions src/DisjunctiveAlgorithms.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module DisjunctiveAlgorithms

import MathOptInterface as MOI
import DisjunctiveProgramming: DisjunctionSet, num_disjuncts,
activation_index, indicator_indices, row_indices,
_SupportedInnerSet

include("optimizer.jl")
include("problem.jl")
include("master.jl")
include("nlp.jl")
include("cuts.jl")
include("loa.jl")

end
Loading
Loading