SetProg

Set Programming with JuMP

https://github.com/blegat/setprog.jl

Science Score: 31.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.8%) to scientific vocabulary

Keywords from Contributors

computer-algebra numerics nonlinear-dynamics polytope julialang nonlinear-programming mixed-model differentiable-programming optimization-algorithms global-optimization
Last synced: 11 months ago · JSON representation ·

Repository

Set Programming with JuMP

Basic Info
  • Host: GitHub
  • Owner: blegat
  • License: other
  • Language: Julia
  • Default Branch: master
  • Size: 27.3 MB
Statistics
  • Stars: 22
  • Watchers: 5
  • Forks: 2
  • Open Issues: 2
  • Releases: 18
Created over 7 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

SetProg

| Documentation | Build Status | Social | |:-----------------:|:----------------:|:----------:| | | Build Status | Gitter | | | Codecov branch | |

JuMP extension for Set Programming : optimization with set variables and inclusion/containment constraints. This package allows the formulation of a mathematical program involving set variables and inclusion/membership constraints in addition to classical variables and constraints supported by JuMP.

Documentation

  • STABLEmost recently tagged version of the documentation.
  • LATESTin-development version of the documentation.

Variables

The variables can either be * a Polytope; * an Ellipsoid, or a piecewise semi-ellipsoid; * a Polyset, that is the 1-sublevel set of a polynomial of degree 2d.

julia @variable model S Polytope(piecewise=p) # polytope defined over the pieces defined by `p` @variable model S Ellipsoid() @variable model S Ellipsoid(piecewise=p) # piecewise semi-ellipsoid defined over the pieces defined by `p` @variable model S PolySet(d) # 1-sublevel set of a polynomial of degree 2d @variable model S PolySet(d, convex=true) # Convex 1-sublevel set of a polynomial of degree 2d @variable model S PolySet(d, symmetric=true) # 1-sublevel set of a polynomial of degree 2d symmetric around the origin @variable model S PolySet(d, symmetric=true, point=SetProg.CenterPoint([1, 0])) # 1-sublevel set of a polynomial of degree 2d symmetric around the [1, 0]

Expressions

The following operations are allowed:

| Operation | Description | |-----------|-------------------------------| | A*S | Linear mapping |

But more operations are planned to be added:

| Operation | Description | |-----------|-------------------------------| | S + x | Translation of S by x | | S1 + S2 | Minkowski sum | | S1 ∩ S2 | Intersection of S1 and S2 | | S1 ∪ S2 | Union of S1 and S2 | | polar(S) | Polar of S |

Constraints

The following constraints are implemented

| Operation | Description | |-----------|--------------------------| | x ∈ S | x is contained in S | | S1 ⊆ S2 | S1 is included in S2 | | S1 ⊇ S2 | S1 is included in S2 |

Examples

Consider a polytope julia using Polyhedra diamond = HalfSpace([1, 1], 1) ∩ HalfSpace([-1, -1], 1) ∩ HalfSpace([1, -1], 1) ∩ HalfSpace([-1, 1], 1) simplex = HalfSpace([1, 1], 1) ∩ HalfSpace([-1, 0], 0) ∩ HalfSpace([0, -1], 0) Pick an SDP solver (see here for a list) julia using CSDP # Optimizer optimizer_constructor = CSDP.Optimizer

To compute the maximal symmetric ellipsoid contained in the polytope diamond defined above (i.e. Löwner-John ellipsoid): julia using SetProg model = Model(optimizer_constructor) @variable(model, S, Ellipsoid(symmetric=true)) @constraint(model, S ⊆ diamond) @objective(model, Max, nth_root(volume(S))) optimize!(model) We specify in the example that the ellipsoid is symmetric around the origin to simplify the computation as the solver does not need to look for the center so the SDP problem that need to be solved has a smaller size.

We can visualize the result with Plots as follows: julia using Plots plot(polyhedron(diamond), ratio=1) plot!(value(S))

To compute the maximal ellipsoid contained in simplex, we don't need to specify the center but at least a point in the interior of the ellipsoid. The SDP formulation used will then determine the center and shape of the ellipsoid simultaneously in the same SDP. For the interior point, we take the chebyshev center of the simplex (which can be found by solving an LP). This the center of the sphere of maximal volume in the simplex so one might rightly guess that is is in the interior of the maximal ellispoid contained in the simplex. ```julia using SetProg chebycenter, chebyradius = chebyshevcenter(simplex, optimizerconstructor) interiorpoint = SetProg.InteriorPoint(cheby_center)

model = Model(optimizerconstructor) @variable(model, S, Ellipsoid(point=interiorpoint)) @constraint(model, S ⊆ simplex) @objective(model, Max, nth_root(volume(S))) optimize!(model) ```

We now visualize the result: julia using Plots plot(polyhedron(simplex), ratio=1) plot!(value(S))

To compute the maximal invariant set contained in a polytope (not yet implemented): julia using SetProg model = Model(optimizer_constructor) @variable(model, S, Polytope()) @constraint(model, S ⊆ diamond) @constraint(model, A*S ⊆ S) # Invariance constraint @objective(model, Max, volume(S)) optimize!(model)

To compute the maximal invariant ellipsoid contained in the polytope diamond defined above: julia using SetProg model = Model(optimizer_constructor) @variable(model, S, Ellipsoid(symmetric=true)) @constraint(model, S ⊆ diamond) @constraint(model, A*S ⊆ S) # Invariance constraint @objective(model, Max, nth_root(volume(S))) optimize!(model)

To compute the maximal algebraic-invariant ellipsoid (i.e. AS ⊆ ES) contained in the polytope diamond defined above: julia using SetProg model = Model(optimizer_constructor) @variable(model, S, Ellipsoid(symmetric=true))) @constraint(model, S ⊆ diamond) @constraint(model, A*S ⊆ E*S) # Invariance constraint @objective(model, Max, L1_heuristic(volume(S), ones(Polyhedra.fulldim(P)))) optimize!(model)

Owner

  • Name: Benoît Legat
  • Login: blegat
  • Kind: user
  • Location: Boston, MA, USA
  • Company: LIDS, MIT

Citation (CITATION.bib)

@PhdThesis{legat2020set,
  author = {Beno\^it Legat},
  school = {UCLouvain},
  title  = {Set programming : theory and computation},
  year   = {2020},
}
@Conference{legat2019set,
  author    = {Legat, Beno{\^\i}t and Jungers, Rapha\"{e}l M. and Parrilo, Pablo A. and Tabuada, Paulo},
  title     = {{Set Programming with JuMP}},
  booktitle = {The Third Annual JuMP-dev Workshop},
  year      = {2019},
}

GitHub Events

Total
  • Create event: 4
  • Commit comment event: 2
  • Release event: 1
  • Issues event: 2
  • Watch event: 2
  • Issue comment event: 2
  • Push event: 10
  • Pull request review comment event: 2
  • Pull request review event: 2
  • Pull request event: 5
  • Fork event: 1
Last Year
  • Create event: 4
  • Commit comment event: 2
  • Release event: 1
  • Issues event: 2
  • Watch event: 2
  • Issue comment event: 2
  • Push event: 10
  • Pull request review comment event: 2
  • Pull request review event: 2
  • Pull request event: 5
  • Fork event: 1

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 173
  • Total Committers: 6
  • Avg Commits per committer: 28.833
  • Development Distribution Score (DDS): 0.04
Top Committers
Name Email Commits
Benoît Legat b****t@g****m 166
github-actions[bot] 4****]@u****m 3
Marcelo Forets m****s@g****m 1
Oscar Dowson o****w@u****m 1
Mridul Seth s****l@g****m 1
Julia TagBot 5****t@u****m 1

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 6
  • Total pull requests: 42
  • Average time to close issues: 12 days
  • Average time to close pull requests: 18 days
  • Total issue authors: 4
  • Total pull request authors: 7
  • Average comments per issue: 3.17
  • Average comments per pull request: 0.5
  • Merged pull requests: 26
  • Bot issues: 0
  • Bot pull requests: 18
Past Year
  • Issues: 1
  • Pull requests: 6
  • Average time to close issues: 5 days
  • Average time to close pull requests: 3 days
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.33
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 4
Top Authors
Issue Authors
  • blegat (2)
  • schillic (2)
  • mforets (1)
  • JuliaTagBot (1)
Pull Request Authors
  • blegat (20)
  • github-actions[bot] (18)
  • MridulS (1)
  • mforets (1)
  • odow (1)
  • schillic (1)
  • JuliaTagBot (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • julia 6 total
  • Total dependent packages: 1
  • Total dependent repositories: 0
  • Total versions: 19
juliahub.com: SetProg

Set Programming with JuMP

  • Versions: 19
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 6 Total
Rankings
Dependent repos count: 9.9%
Average: 21.3%
Dependent packages count: 23.0%
Stargazers count: 24.1%
Forks count: 28.1%
Last synced: 11 months ago

Dependencies

.github/workflows/CompatHelper.yml actions
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/ci.yml actions
  • actions/cache v1 composite
  • actions/checkout v2 composite
  • codecov/codecov-action v1 composite
  • julia-actions/julia-buildpkg v1 composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest v1 composite
  • julia-actions/setup-julia v1 composite
.github/workflows/documentation.yml actions
  • actions/checkout v2 composite
  • julia-actions/setup-julia latest composite