/Complementarity.jl

provides a modeling interface for mixed complementarity problems (MCP) and math programs with equilibrium problems (MPEC) via JuMP

Primary LanguageJuliaOtherNOASSERTION

Complementarity.jl

Complementarity Complementarity

Build Status Build status Coverage Status

Primarily, this package does the following two things:

Mixed Complementarity Problems (MCP)

F(x) ⟂ lb ≤ x ≤ ub

A very simple example:

(x+2) x = 0,  x ≥ 0,   x+2 ≥ 0
using Complementarity, JuMP
m = MCPModel()
@variable(m, x >= 0)
@NLexpression(m, F, x+2)
complements(m, F, x)
status = solveMCP(m)
@show getvalue(x)

Mathematical Programs with Equilibrium Constraints (MPEC)

min  f(x)
s.t. g(x) ≤ 0
     F(x) ⟂ lb ≤ x ≤ ub

A very simple example:

min  x^3
s.t. (x+2) x = 0,  x ≥ 0,   x+2 ≥ 0
using JuMP, Ipopt, Complementarity
m = Model(solver=IpoptSolver())
@variable(m, x>=0)
@NLobjective(m, Min, x^3)
@complements(m, 0 <= x+2,   x >= 0)
solve(m)
@show getvalue(x)

Installation

Pkg.add("Complementarity")

This will also install a few other packages.