Open source complementarity solver?

I am interested in using the open-source solvers in AMPL for a nonlinear complementarity problem. I have it working in a paid version of GAMS using PATH; I just want to try it out in AMPL. It’s not an optimization problem but an economic equilibrium problem. AMPL does support limited trial versions of suitable solvers, e.g. KNITRO. Does anyone know if any of the open-source ones can do complementarity problems?

1 Like

Every solver is handling complementarity constraints with AMPL nowadays thanks to the MP solver interface (all these features are common for our solvers: https://mp.ampl.com/model-guide.html). That said, solvers handling complementarity natively might perform better compared to others that not.

You can keep using PATH, easiest way is via NEOS server:

If you’re in Academia you can access commercial solvers for free (see ampl.com/academia/), but Knitro is not included, 30-days trial for Knitro are there.

If you’re not in Academia you can still have a Community Edition license for prototyping by signing up at portal.ampl.com, and will have commercial solver trials. Open-source solvers like PATH (through NEOS server), HiGHS, Couenne… are included, no size limits.

Marcos - I think PATH is a closed-source, proprietary model, even though it can be accessed for free using NEOS. If you know where I can legitimately obtain the complete source code to PATH, I would be quite surprised. Is there any place to get it?

Complementarity constraints in an optimization (i.e. MPECC) are not what I’m looking for. I need a nonlinear complementarity problem describing the Nash equilibrium among many competing actors. The simplest example would be a bimatrix game, where neither player can achieve their individual optimum because they have to deal with the other player.

The basic problem is that the documentation is so focused on optimization that it is hard to tell if they handle equilibrium problems. Do you know if the open-source tools can solve pure complementarity problems, with no optimization?

You’re right, I mean you can use PATH through the Kestrel interface, which is basically a wrapper around NEOS server so you can use it as another solver from AMPL, you can find it in the Jupyter notebook above.

For now, the instructions to get locally PATH are here - we might eventually provide our own build:

Could you provide some example or reference on your complementarity problem with the Nash equilibrium? You may be able to write it as an optimization problem. Something like
x ≥ 0, y ≥ 0, x * y = 0
could be written as

subject to complementarity_constraint:
    x >= 0 complements y >= 0;

@jsm5712 I’m also sending this other example in case it’s helpful: