Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for complementarity constraints #144

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

frapac
Copy link
Contributor

@frapac frapac commented Oct 1, 2024

This PR is an attempt to support complementarity constraints, following #37

It introduces three modifications:

  • the number of complementarity constraints n_cc and positions cvar are imported from Ampl using asl_n_cc and asl_cvar, respectively.
  • both n_cc and cvar are stored in AmplNLPMeta
  • a wrapper AmplMPECModel implements a smooth reformulation of the complementarity constraints.

The constraints

x_L <= x complements g(x) >= g_L 

is reformulated as

x_L <= x 
g_L <= g(x)
Diag(g(x)) * x <= 0 

We can think of implementing other smooth reformulations.

AmplMPECModel adds some complexity to the package, and it could be appropriate to move this wrapper in a second package once NLPModels has a proper support for complementarity constraints.

Cc @tmigot @dpo

@amontoison
Copy link
Member

@frapac Can you rebase your branch?

@amontoison amontoison merged commit e3e2953 into JuliaSmoothOptimizers:main Oct 2, 2024
12 checks passed
Copy link

codecov bot commented Oct 2, 2024

Codecov Report

Attention: Patch coverage is 95.43568% with 11 lines in your changes missing coverage. Please review.

Project coverage is 87.83%. Comparing base (7470bdf) to head (0d8d8a7).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/ampl_mpec_model.jl 96.12% 9 Missing ⚠️
src/ampl_model.jl 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #144      +/-   ##
==========================================
+ Coverage   82.68%   87.83%   +5.14%     
==========================================
  Files           3        3              
  Lines         335      567     +232     
==========================================
+ Hits          277      498     +221     
- Misses         58       69      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants