chkwon / PATHSolver.jl

provides a Julia wrapper for the PATH Solver for solving mixed complementarity problems
http://pages.cs.wisc.edu/%7Eferris/path.html
MIT License
50 stars 15 forks source link

Is the redistribution available to solve a nonlinear (mixed) complementarity problem? #87

Closed a24hori closed 1 year ago

a24hori commented 1 year ago

The original PATH solver enables to solve a nonlinear CP by running pathmcp(...).

odow commented 1 year ago

You can solve nonlinear MCP if you provide the function and Jacobian directly:

https://github.com/chkwon/PATHSolver.jl/blob/87f8884973eb344f3ab1e5c9668272d2af86f5bc/src/C_API.jl#L604-L752

An upcoming version of JuMP will support nonlinear complementarity problems: https://github.com/chkwon/PATHSolver.jl/pull/82

a24hori commented 1 year ago

I appreciate your reply. I am a beginner of julia and JuMP, so I am confused some expressions in JuMP. I have one important question to use JuMP.

In the example shown in README, you demonstrate solving the LCP Mx+q \perp x>= 0; however, the standard form of the LCP also has the nonnegative constraint of Mx+q, i.e., Mx+q>=0. Is this automatically added in the model?

odow commented 1 year ago

A complementarity problem in JuMP depends only on the bounds of the x variable:

https://jump.dev/JuMP.jl/stable/moi/reference/standard_form/#MathOptInterface.Complements

For Mx+q ⟂ x>= 0, If x = 0 then Mx+q >= 0, and if x > 0, then Mx+q == 0.

JuMP is not like Pyomo or AMPL, where you can put inequalities on the function as well as the variable.

hurak commented 1 year ago

My guess is that @a24hori is just confused by reading the complementarity constraint in the form Mx+q ⟂ x>= 0, while the form used elsewhere is 0<=Mx+q ⟂ x>= 0. If I understand it correctly, then indeed, the nonnegativity condition on Mx+q is automatically introduced anyway.